コード例 #1
0
  public static boolean IsTextFormat(String format) {
    String codec = (format != null) ? format : "";

    // sub = external .sub file

    return StringHelper.IndexOfIgnoreCase(codec, "pgs") == -1
        && StringHelper.IndexOfIgnoreCase(codec, "dvd") == -1
        && !StringHelper.EqualsIgnoreCase(codec, "sub");
  }
コード例 #2
0
  public final String getDisplayTitle() {
    if (!tangible.DotNetToJavaStringHelper.isNullOrEmpty(getTitle())) {
      return getTitle();
    }

    if (getType() == MediaStreamType.Audio) {
      java.util.ArrayList<String> attributes = new java.util.ArrayList<String>();

      if (!tangible.DotNetToJavaStringHelper.isNullOrEmpty(getLanguage())) {
        attributes.add(StringHelper.FirstToUpper(getLanguage()));
      }
      if (!tangible.DotNetToJavaStringHelper.isNullOrEmpty(getCodec())
          && !StringHelper.EqualsIgnoreCase(getCodec(), "dca")) {
        attributes.add(AudioCodec.GetFriendlyName(getCodec()));
      } else if (!tangible.DotNetToJavaStringHelper.isNullOrEmpty(getProfile())
          && !StringHelper.EqualsIgnoreCase(getProfile(), "lc")) {
        attributes.add(getProfile());
      }

      if (!tangible.DotNetToJavaStringHelper.isNullOrEmpty(getChannelLayout())) {
        attributes.add(getChannelLayout());
      } else if (getChannels() != null) {
        attributes.add(StringHelper.ToStringCultureInvariant(getChannels()) + " ch");
      }

      String name = tangible.DotNetToJavaStringHelper.join(" ", attributes.toArray(new String[0]));

      if (getIsDefault()) {
        name += " (D)";
      }

      return name;
    }

    if (getType() == MediaStreamType.Subtitle) {
      java.util.ArrayList<String> attributes = new java.util.ArrayList<String>();

      if (!tangible.DotNetToJavaStringHelper.isNullOrEmpty(getLanguage())) {
        attributes.add(getLanguage());
      }
      if (!tangible.DotNetToJavaStringHelper.isNullOrEmpty(getCodec())) {
        attributes.add(getCodec());
      }

      String name = tangible.DotNetToJavaStringHelper.join(" ", attributes.toArray(new String[0]));

      if (getIsDefault()) {
        name += " (D)";
      }

      if (getIsForced()) {
        name += " (F)";
      }

      if (getIsExternal()) {
        name += " (EXT)";
      }

      return name;
    }

    if (getType() == MediaStreamType.Video) {}

    return null;
  }