Package net.pms.dlna

Examples of net.pms.dlna.DLNAMediaDatabase


    but5.setToolTipText(Messages.getString("FoldTab.2"));
    but5.addActionListener(new ActionListener() {
      @Override
      public void actionPerformed(ActionEvent e) {
        if (configuration.getUseCache()) {
          DLNAMediaDatabase database = PMS.get().getDatabase();

          if (database != null) {
            if (!database.isScanLibraryRunning()) {
              int option = JOptionPane.showConfirmDialog(
                looksFrame,
                Messages.getString("FoldTab.3") + Messages.getString("FoldTab.4"),
                Messages.getString("Dialog.Question"),
                JOptionPane.YES_NO_OPTION);
              if (option == JOptionPane.YES_OPTION) {
                database.scanLibrary();
                but5.setIcon(LooksFrame.readImageIcon("button-scan-busy.gif"));
                but5.setRolloverIcon(LooksFrame.readImageIcon("button-scan-cancel.png"));
                but5.setToolTipText(Messages.getString("FoldTab.40"));
              }
            } else {
              int option = JOptionPane.showConfirmDialog(
                looksFrame,
                Messages.getString("FoldTab.10"),
                Messages.getString("Dialog.Question"),
                JOptionPane.YES_NO_OPTION);
              if (option == JOptionPane.YES_OPTION) {
                database.stopScanLibrary();
                looksFrame.setStatusLine(null);
                setScanLibraryEnabled(false);
                but5.setToolTipText(Messages.getString("FoldTab.41"));
              }
            }
View Full Code Here


   * @see net.pms.dlna.DLNAMediaDatabase
   */
  private DLNAMediaDatabase database;

  private synchronized void initializeDatabase() {
    database = new DLNAMediaDatabase("medias"); // TODO: rename "medias" -> "cache"
    database.init(false);
  }
View Full Code Here

public class HTMLConsole {
  public static String servePage(String resource) {
    StringBuilder sb = new StringBuilder();
    sb.append("<html><head><title>").append(PropertiesUtil.getProjectProperties().get("project.name")).append(" HTML Console</title></head><body>");

    DLNAMediaDatabase database = PMS.get().getDatabase();
    PmsConfiguration configuration = PMS.getConfiguration();
    if (resource.equals("compact") && configuration.getUseCache()) {
      database.compact();
      sb.append("<p align=center><b>Database compacted!</b></p><br>");
    }

    if (resource.equals("scan") && configuration.getUseCache()) {
      if (!database.isScanLibraryRunning()) {
        database.scanLibrary();
      }
      if (database.isScanLibraryRunning()) {
        sb.append("<p align=center><b>Scan in progress! you can also <a href=\"stop\">stop it</a></b></p><br>");
      }
    }

    if (resource.equals("stop") && configuration.getUseCache() && database.isScanLibraryRunning()) {
      database.stopScanLibrary();
      sb.append("<p align=center><b>Scan stopped!</b></p><br>");
    }

    sb.append("<p align=center><img src='/images/logo.png'><br>").append(PropertiesUtil.getProjectProperties().get("project.name")).append(" HTML console<br><br>Menu:<br>");
    sb.append("<a href=\"home\">Home</a><br>");
View Full Code Here

    but5.setToolTipText(Messages.getString("FoldTab.2"));
    //but5.setBorder(BorderFactory.createEmptyBorder());
    but5.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        if (configuration.getUseCache()) {
          DLNAMediaDatabase database = PMS.get().getDatabase();

          if (database != null) {
            if (!database.isScanLibraryRunning()) {
              int option = JOptionPane.showConfirmDialog(
                (Component) PMS.get().getFrame(),
                Messages.getString("FoldTab.3") + Messages.getString("FoldTab.4"),
                Messages.getString("Dialog.Question"),
                JOptionPane.YES_NO_OPTION);
              if (option == JOptionPane.YES_OPTION) {
                database.scanLibrary();
                but5.setIcon(LooksFrame.readImageIcon("viewmagfit-32.png"));
              }
            } else {
              int option = JOptionPane.showConfirmDialog(
                (Component) PMS.get().getFrame(),
                Messages.getString("FoldTab.10"),
                Messages.getString("Dialog.Question"),
                JOptionPane.YES_NO_OPTION);
              if (option == JOptionPane.YES_OPTION) {
                database.stopScanLibrary();
                PMS.get().getFrame().setStatusLine(null);
                but5.setIcon(LooksFrame.readImageIcon("search-32.png"));
              }
            }
          }
View Full Code Here

   * @see net.pms.dlna.DLNAMediaDatabase
   */
  private DLNAMediaDatabase database;

  private void initializeDatabase() {
    database = new DLNAMediaDatabase("medias"); // TODO: rename "medias" -> "cache"
    database.init(false);
  }
View Full Code Here

TOP

Related Classes of net.pms.dlna.DLNAMediaDatabase

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.