Esempio n. 1
0
  /**
   * @param dl
   * @since 3.0.2.3
   */
  public static String getMediaServerContentURL(Download dl) {

    // TorrentListViewsUtils.debugDCAD("enter - getMediaServerContentURL");

    PluginManager pm = AzureusCoreFactory.getSingleton().getPluginManager();
    PluginInterface pi = pm.getPluginInterfaceByID("azupnpav", false);

    if (pi == null) {
      Logger.log(new LogEvent(LogIDs.UI3, "Media server plugin not found"));
      return null;
    }

    if (!pi.getPluginState().isOperational()) {
      Logger.log(new LogEvent(LogIDs.UI3, "Media server plugin not operational"));
      return null;
    }

    try {
      Program program = Program.findProgram(".qtl");
      boolean hasQuickTime =
          program == null ? false : (program.getName().toLowerCase().indexOf("quicktime") != -1);

      pi.getIPC().invoke("setQuickTimeAvailable", new Object[] {new Boolean(hasQuickTime)});

      Object url = pi.getIPC().invoke("getContentURL", new Object[] {dl});
      if (url instanceof String) {
        return (String) url;
      }
    } catch (Throwable e) {
      Logger.log(
          new LogEvent(LogIDs.UI3, LogEvent.LT_WARNING, "IPC to media server plugin failed", e));
    }

    return null;
  }
Esempio n. 2
0
  /** @return */
  public static boolean hasFullBurn() {

    PluginInterface pi =
        PluginInitializer.getDefaultInterface().getPluginState().isInitialisationComplete()
            ? AzureusCoreFactory.getSingleton()
                .getPluginManager()
                .getPluginInterfaceByID("azburn_v")
            : null;
    if (pi == null) {
      // maybe not added yet.. use featman
      Set<String> featuresInstalled = UtilitiesImpl.getFeaturesInstalled();
      return featuresInstalled.contains("dvdburn_trial") && !featuresInstalled.contains("dvdburn");
    }
    return pi.getPluginState().isOperational();
  }
Esempio n. 3
0
  private static final synchronized boolean loadEmpPluginClass() {
    if (piEmp != null && piEmp.getPluginState().isUnloaded()) {
      piEmp = null;
      triedLoadingEmpPluginClass = false;
      methodIsExternallyPlayable = null;
      methodIsExternallyPlayable2 = null;
    }

    if (!triedLoadingEmpPluginClass) {
      triedLoadingEmpPluginClass = true;

      try {
        piEmp =
            AzureusCoreFactory.getSingleton().getPluginManager().getPluginInterfaceByID("azemp");

        if (piEmp == null) {

          return (false);
        }

        Class empPluginClass = piEmp.getPlugin().getClass();

        methodIsExternallyPlayable =
            empPluginClass.getMethod("isExternallyPlayable", new Class[] {TOTorrent.class});

        try {
          methodIsExternallyPlayable2 =
              empPluginClass.getMethod(
                  "isExternallyPlayable", new Class[] {TOTorrent.class, int.class});
        } catch (Throwable e) {
          Logger.log(new LogEvent(LogIDs.UI3, "isExternallyPlayable with file_index not found"));
        }

        // methodIsExternalPlayerInstalled = empPluginClass.getMethod("isExternalPlayerInstalled",
        // new Class[] {});

      } catch (Exception e1) {
        return false;
      }
    }
    return true;
  }
Esempio n. 4
0
  protected NetworkSearch(AzureusCore core, String searchText, Browser browser) {
    PluginInterface pi = core.getPluginManager().getPluginInterfaceByID("azsearch", false);

    if (pi == null) {

      Logger.log(new LogEvent(LOGID, "Search plugin not found"));

      return;
    }

    if (!pi.getPluginState().isOperational()) {

      Logger.log(new LogEvent(LOGID, "Search plugin not operational"));

      return;
    }

    Logger.log(new LogEvent(LOGID, "Search plugin functionality disabled"));
    /*

    Map params = new HashMap();

    params.put("expression", searchText);

    params.put("swtbrowser", browser);

    try {
    	IPCInterface my_ipc = new IPCInterfaceImpl(this);

    	pi.getIPC().invoke("search", new Object[] {
    		my_ipc,
    		params
    	});

    } catch (Throwable e) {

    	Logger.log(new LogEvent(LOGID, "IPC to search plugin failed", e));
    }
    */
  }