Examples of PmsConfiguration


Examples of net.pms.configuration.PmsConfiguration

  public void setUp() {
    // Silence all log messages from the PMS code that is being tested
    LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory();
        context.reset();

    PmsConfiguration pmsConf = null;

    try {
      pmsConf = new PmsConfiguration(false);
    } catch (ConfigurationException e) {
      // This should be impossible since no configuration file will be loaded.
    }

    // Initialize the RendererConfiguration
View Full Code Here

Examples of net.pms.configuration.PmsConfiguration

    boolean configurationLoaded = false;

    try {
      // Initialize PMS configuration like at initialization time, this
      // is relevant for RendererConfiguration.isCompatible().
      PMS.setConfiguration(new PmsConfiguration());
      configurationLoaded = true;
    } catch (ConfigurationException e) {
      e.printStackTrace();
    }
View Full Code Here

Examples of net.pms.configuration.PmsConfiguration

        } else if (obj instanceof String[]) {
          add((String[]) obj);
        }
      }
    }
    PmsConfiguration configuration = PMS.getConfiguration();

    // check dbgpack property in UMS.conf
    LOGGER.debug("Checking dbgpack property in UMS.conf");
    String f = (String) configuration.getCustomProperty("dbgpack");
    if (f != null) {
      add(f.split(","));
    }

    // add confs of connected renderers
    for (RendererConfiguration r : RendererConfiguration.getConnectedRenderersConfigurations()) {
      if (r.getFile() != null) {
        add(r.getFile());
      }
    }

    // add core items with debug.log last (LinkedHashMap preserves insertion order)
    String profileDirectory = configuration.getProfileDirectory();

    // add virtual folders file if it exists
    String vfolders = configuration.getVirtualFoldersFile(null);
    if (StringUtils.isNotEmpty(vfolders)) {
      add(new File(profileDirectory, vfolders.substring(1)));
    }

    add(new File(profileDirectory, "WEB.conf"));
    add(new File(configuration.getProfilePath()));
    add(new File(debug_log + ".prev"));
    add(new File(debug_log));
  }
View Full Code Here

Examples of net.pms.configuration.PmsConfiguration

            sb.append("<source src=\"/media/").append(id1).append("\" type=\"").append(mime).append("\">");
          }
          sb.append(CRLF);

          if (flowplayer) {
            PmsConfiguration configuration = PMS.getConfiguration();
            boolean isFFmpegFontConfig = configuration.isFFmpegFontConfig();
            if (isFFmpegFontConfig) { // do not apply fontconfig to flowplayer subs
              configuration.setFFmpegFontConfig(false);
            }

            OutputParams p = new OutputParams(configuration);
            Player.setAudioAndSubs(r.getName(), r.getMedia(), p);
            if (p.sid !=null && p.sid.getType().isText()) {
              try {
                File subFile = SubtitleUtils.getSubtitles(r, r.getMedia(), p, configuration, SubtitleType.WEBVTT);
                LOGGER.debug("subFile " + subFile);
                if (subFile != null) {
                  sb.append("<track src=\"/subs/").append(subFile.getAbsolutePath()).append("\">");
                }
              } catch (Exception e) {
                LOGGER.debug("error when doing sub file " + e);
              }
            }
           
            configuration.setFFmpegFontConfig(isFFmpegFontConfig); // return back original fontconfig value
          }
          sb.append("</").append(mediaType).append(">").append(CRLF);

          if (flowplayer) {
            sb.append("</div>").append(CRLF);
          }
    // nex and prev buttons
    sb.append("<div>").append(CRLF);
    sb.append("<button value=\"<<\" onclick=\"").append(prvJs).append("\"><<</button>").append(CRLF);
    sb.append("<button value=\">>\" onclick=\"").append(nxtJs).append("\">>></button>").append(CRLF);
    sb.append("</div>").append(CRLF);
    sb.append("</div>").append(CRLF);
    sb.append("<a href=\"/raw/").append(rawId).append("\" target=\"_blank\" id=\"DownloadLink\" title=\"Download this video\"></a>").append(CRLF);
    if (flowplayer) {
      sb.append("<script>").append(CRLF);
      sb.append("$(function() {").append(CRLF);
      if (configuration.getWebAutoCont(r.getFormat())) {
        // auto continue for flowplayer
        sb.append("var api = $(\".player\").flowplayer();").append(CRLF);
        sb.append("               api.bind(\"finish\",function() {").append(CRLF);
        sb.append(nxtJs).append(CRLF);
        sb.append("               });").append(CRLF);
      }
      sb.append("  $(\".player\").flowplayer({").append(CRLF);
      sb.append("    ratio: 9/16,").append(CRLF);
      sb.append("    flashfit: true").append(CRLF);
      sb.append("  });").append(CRLF);
      sb.append("});").append(CRLF);
      sb.append("</script>").append(CRLF);
    } else {
      if (configuration.getWebAutoCont(r.getFormat())) {
        // logic here use our own id (for example 123)
        // once we're done ask for /play/123?nxt=true
        // the nxt will cause us to pick next (most likely 124) from list.
        sb.append("<script>").append(CRLF);
        sb.append("var player = document.getElementById(\"player\");").append(CRLF);
View Full Code Here

Examples of net.pms.configuration.PmsConfiguration

      FileUtils.copyFile(new File("debug.log"), new File("debug.log.prev"));
    } catch (Exception e) {
    }

    try {
      setConfiguration(new PmsConfiguration());
      assert getConfiguration() != null;

      // Load the (optional) logback config file.
      // This has to be called after 'new PmsConfiguration'
      // as the logging starts immediately and some filters
View Full Code Here

Examples of net.pms.configuration.PmsConfiguration

  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>");
View Full Code Here

Examples of net.pms.configuration.PmsConfiguration

    if (!isHeadless() && displayProfileChooser) {
      ProfileChooser.display();
    }

    try {
      setConfiguration(new PmsConfiguration());
      assert getConfiguration() != null;

      // Load the (optional) logback config file.
      // This has to be called after 'new PmsConfiguration'
      // as the logging starts immediately and some filters
View Full Code Here

Examples of net.pms.configuration.PmsConfiguration

  public final void setUp() throws IOException, ConfigurationException {
    // Silence all log messages from the PMS code that is being tested
    LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory();
    context.reset();

    SubtitleUtils.setConfiguration(new PmsConfiguration() {
      @Override
      public File getTempFolder() throws IOException {
        return temporaryFolder.newFolder("subutils");
      }
    });
View Full Code Here

Examples of net.pms.configuration.PmsConfiguration

  public void setUp() {
    // Silence all log messages from the PMS code that is being tested
    LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory();
        context.reset();

    PmsConfiguration pmsConf = null;

    try {
      pmsConf = new PmsConfiguration(false);
    } catch (ConfigurationException e) {
      // This should be impossible since no configuration file will be loaded.
    }

    // Initialize the RendererConfiguration
View Full Code Here

Examples of net.pms.configuration.PmsConfiguration

    boolean configurationLoaded = false;

    try {
      // Initialize PMS configuration like at initialization time, this
      // is relevant for RendererConfiguration.isCompatible().
      PMS.setConfiguration(new PmsConfiguration());
      configurationLoaded = true;
    } catch (ConfigurationException e) {
      e.printStackTrace();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.