Пример #1
0
  public TranscodeProfile getDefaultTranscodeProfile() {
    String uid = getPersistentStringProperty(PP_REND_DEF_TRANS_PROF);

    DeviceManagerImpl dm = getManager();

    TranscodeManagerImpl tm = dm.getTranscodeManager();

    TranscodeProfile profile = tm.getProfileFromUID(uid);

    if (profile != null) {

      return (profile);
    }

    return (null);
  }
Пример #2
0
  private TranscodeProfile[] getTranscodeProfiles(String classification) {
    List<TranscodeProfile> profiles = new ArrayList<TranscodeProfile>();

    DeviceManagerImpl dm = getManager();

    TranscodeProvider[] providers = dm.getProviders();

    for (TranscodeProvider provider : providers) {

      TranscodeProfile[] ps = provider.getProfiles(classification);

      if (providers.length == 1) {

        return (ps);
      }

      profiles.addAll(Arrays.asList(ps));
    }

    return (profiles.toArray(new TranscodeProfile[profiles.size()]));
  }
Пример #3
0
  public File getWorkingDirectory(boolean persist) {
    String result = getPersistentStringProperty(PP_REND_WORK_DIR);

    if (result.length() == 0) {

      File f = manager.getDefaultWorkingDirectory(persist);

      if (persist) {

        f.mkdirs();
      }

      String name = FileUtil.convertOSSpecificChars(getName(), true);

      for (int i = 0; i < 1024; i++) {

        String test_name = name + (i == 0 ? "" : ("_" + i));

        File test_file = new File(f, test_name);

        if (!test_file.exists()) {

          f = test_file;

          break;
        }
      }

      result = f.getAbsolutePath();

      if (persist) {

        setPersistentStringProperty(PP_REND_WORK_DIR, result);
      }
    }

    File f_result = new File(result);

    if (!f_result.exists()) {

      if (persist) {

        f_result.mkdirs();
      }
    }

    return (f_result);
  }
Пример #4
0
  protected void setBusy(boolean busy) {
    boolean changed = false;

    synchronized (this) {
      if (busy) {

        changed = busy_count++ == 0;

      } else {

        changed = busy_count-- == 1;
      }
    }

    if (changed) {

      manager.deviceChanged(this, false);
    }
  }
Пример #5
0
  protected void setInfo(Object key, String info) {
    boolean changed = false;

    if (info == null || info.length() == 0) {

      synchronized (infos) {
        changed = infos.remove(key) != null;
      }
    } else {

      String existing;

      synchronized (infos) {
        existing = infos.put(key, info);
      }

      changed = existing == null || !existing.equals(info);
    }

    if (changed) {

      manager.deviceChanged(this, false);
    }
  }
Пример #6
0
  protected void setError(Object key, String error) {
    boolean changed = false;

    if (error == null || error.length() == 0) {

      synchronized (errors) {
        changed = errors.remove(key) != null;
      }
    } else {

      String existing;

      synchronized (errors) {
        existing = errors.put(key, error);
      }

      changed = existing == null || !existing.equals(error);
    }

    if (changed) {

      manager.deviceChanged(this, false);
    }
  }
Пример #7
0
 public void requestAttention() {
   manager.requestAttention(this);
 }
Пример #8
0
 protected void setDirty(boolean save_changes) {
   manager.configDirty(this, save_changes);
 }
Пример #9
0
  public VuzeFile getVuzeFile() throws IOException {

    return (manager.exportVuzeFile(this));
  }
Пример #10
0
 protected void log(String str, Throwable e) {
   manager.log(str, e);
 }
Пример #11
0
 protected void log(String str) {
   manager.log(str);
 }
Пример #12
0
 protected String getMimeType(TranscodeFileImpl file) {
   return (manager.getMimeType(file));
 }
Пример #13
0
 protected URL getStreamURL(TranscodeFileImpl file, String host) {
   return (manager.getStreamURL(file, host));
 }
Пример #14
0
 public void remove() {
   manager.removeDevice(this);
 }
Пример #15
0
  protected void setTranscoding(boolean _transcoding) {
    transcoding = _transcoding;

    manager.deviceChanged(this, false);
  }