コード例 #1
0
  public final boolean getIsTextSubtitleStream() {
    if (getType() != MediaStreamType.Subtitle) {
      return false;
    }

    if (tangible.DotNetToJavaStringHelper.isNullOrEmpty(getCodec()) && !getIsExternal()) {
      return false;
    }

    return IsTextFormat(getCodec());
  }
コード例 #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;
  }