当前位置: 首页>>代码示例>>C#>>正文


C# StreamKind类代码示例

本文整理汇总了C#中StreamKind的典型用法代码示例。如果您正苦于以下问题:C# StreamKind类的具体用法?C# StreamKind怎么用?C# StreamKind使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


StreamKind类属于命名空间,在下文中一共展示了StreamKind类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetDurationValue

 public static async Task<long> GetDurationValue(this IMediaInfo mediaInfo, StreamKind streamKind, string parameter)
 {
     string textValue = await mediaInfo.Get(streamKind, 0, parameter);
     TimeSpan timeSpanValue;
     TimeSpan.TryParse(textValue, CultureInfo, out timeSpanValue);
     return (long)timeSpanValue.TotalMilliseconds;
 }
开发者ID:GusLab,项目名称:video-portal,代码行数:7,代码来源:MediaInfoExtentions.cs

示例2: Get

        public async Task<string> Get(StreamKind streamKind, int streamNumber, string parameter)
        {
            if (_handle == (IntPtr)0)
            {
                return "Unable to load MediaInfo library";
            }

            if (_mustUseAnsi)
            {
                IntPtr parameterPtr = Marshal.StringToHGlobalAnsi(parameter);
                string toReturn = Marshal.PtrToStringAnsi(
                    await MediaInfoInterop.GetAnsiAsync(
                        _handle,
                        (IntPtr)streamKind,
                        (IntPtr)streamNumber,
                        parameterPtr,
                        (IntPtr)InfoKind.Text,
                        (IntPtr)InfoKind.Name));
                Marshal.FreeHGlobal(parameterPtr);
                return toReturn;
            }

            return Marshal.PtrToStringUni(
                await MediaInfoInterop.GetAsync(
                    _handle,
                    (IntPtr)streamKind,
                    (IntPtr)streamNumber,
                    parameter,
                    (IntPtr)InfoKind.Text,
                    (IntPtr)InfoKind.Name));
        }
开发者ID:GusLab,项目名称:video-portal,代码行数:31,代码来源:MediaInfo.cs

示例3: GetLongValue

 public static async Task<long> GetLongValue(this IMediaInfo mediaInfo, StreamKind streamKind, string parameter)
 {
     string textValue = await mediaInfo.Get(streamKind, 0, parameter);
     long longValue;
     long.TryParse(textValue, NumberStyles.Integer, CultureInfo, out longValue);
     return longValue;
 }
开发者ID:GusLab,项目名称:video-portal,代码行数:7,代码来源:MediaInfoExtentions.cs

示例4: GetDoubleValue

 public static async Task<double> GetDoubleValue(this IMediaInfo mediaInfo, StreamKind streamKind, string parameter)
 {
     string textValue = await mediaInfo.Get(streamKind, 0, parameter);
     double doubleValue;
     double.TryParse(textValue, NumberStyles.Float, CultureInfo, out doubleValue);
     return doubleValue;
 }
开发者ID:GusLab,项目名称:video-portal,代码行数:7,代码来源:MediaInfoExtentions.cs

示例5: GetIntegerValue

 public static async Task<int> GetIntegerValue(this IMediaInfo mediaInfo, StreamKind streamKind, string parameter)
 {
     string textValue = await mediaInfo.Get(streamKind, 0, parameter);
     int integerValue;
     int.TryParse(textValue, NumberStyles.Integer, CultureInfo, out integerValue);
     return integerValue;
 }
开发者ID:GusLab,项目名称:video-portal,代码行数:7,代码来源:MediaInfoExtentions.cs

示例6: GetLength

 private short? GetLength(StreamKind stream) {
     string StrValue = lastMedia.Get(stream, 0, "Duration");
     int Result = 0;
     if (int.TryParse(StrValue, out Result))
         return (short)(Result / 1000);
     else
         return null;
 }
开发者ID:mysteryx93,项目名称:NaturalGroundingPlayer,代码行数:8,代码来源:MediaInfoReader.cs

示例7: GetDateValue

 public static async Task<DateTime> GetDateValue(this IMediaInfo mediaInfo, StreamKind streamKind, string parameter)
 {
     string textValue = await mediaInfo.Get(streamKind, 0, parameter);
     textValue = textValue.Replace("UTC ", string.Empty);
     DateTime dateValue;
     DateTime.TryParse(textValue, CultureInfo, DateTimeStyles.AssumeUniversal | DateTimeStyles.AdjustToUniversal, out dateValue);
     return dateValue;
 }
开发者ID:GusLab,项目名称:video-portal,代码行数:8,代码来源:MediaInfoExtentions.cs

示例8: Media

 ///<summary>Used to create a stream-specific object, such as an audio
 ///stream, for use by an existing MediaFile object.</summary>
 ///<param name="mediaInfo">A pre-initialized MediaInfo object.</param>
 ///<param name="kind">A defined value from StreamKind enum.</param>
 ///<param name="id">The MediaInfo ID for this stream.</param>
 public Media(MediaInfo mediaInfo, StreamKind kind, int id)
 {
     string errorText;
     this.mediaInfo = mediaInfo;
     if (mediaInfo == null) {
         errorText = "MediaInfo object cannot be null.";
         throw new ArgumentNullException(errorText);
     }
     if (!isMediaInfoDllCompatible()) {
         errorText = "Incompatible version of MediaInfo.DLL";
         throw new InvalidOperationException(errorText);
     }
     this.kind = kind;
     if (!Enum.IsDefined(typeof(StreamKind), (object)kind)) {
         errorText = "Invalid value for StreamKind";
         throw new ArgumentOutOfRangeException(errorText);
     }
     this.id = id;
 }
开发者ID:Mouaijin,项目名称:DownloadSort,代码行数:24,代码来源:Media.cs

示例9: Get

 public String Get(int FilePos, StreamKind StreamKind, int StreamNumber, String Parameter, InfoKind KindOfInfo)
 {
     return Get(FilePos, StreamKind, StreamNumber, Parameter, KindOfInfo, InfoKind.Name);
 }
开发者ID:beppec56,项目名称:MediaInfoLib-git_svn,代码行数:4,代码来源:MediaInfoDLL.cs

示例10: Count_Get

 public int Count_Get(int FilePos, StreamKind StreamKind)
 {
     return Count_Get(FilePos, StreamKind, -1);
 }
开发者ID:beppec56,项目名称:MediaInfoLib-git_svn,代码行数:4,代码来源:MediaInfoDLL.cs

示例11: BaseStreamCommons

 ///<summary>MultiStreamCommon constructor.</summary>
 ///<param name="mediaInfo">A MediaInfo object.</param>
 ///<param name="kind">A MediaInfo StreamKind.</param>
 ///<param name="id">The MediaInfo ID for this audio stream.</param>
 public BaseStreamCommons(MediaInfo mediaInfo, StreamKind kind, int id)
     : base(mediaInfo, kind, id)
 {
 }
开发者ID:cschlote,项目名称:MediaInfoDotNet,代码行数:8,代码来源:BaseStreamCommons.cs

示例12: Get

 public string Get(StreamKind streamKind, int streamNumber, int parameter, InfoKind infoKind)
 {
     if (MustUseAnsi)
     {
         return MakeStringResult(MediaInfoA_GetI(_handle, (IntPtr)streamKind, (IntPtr)streamNumber, (IntPtr)parameter, (IntPtr)infoKind));
     }
     else
     {
         return MakeStringResult(MediaInfo_GetI(_handle, (IntPtr)streamKind, (IntPtr)streamNumber, (IntPtr)parameter, (IntPtr)infoKind));
     }
 }
开发者ID:nnic,项目名称:Sonarr,代码行数:11,代码来源:MediaInfoLib.cs

示例13: GetFullCodecName

 private string GetFullCodecName(StreamKind type, int audiotrack)
 {
   string strCodec = _mI.Get(type, 0, "Format").ToUpper();
   string strCodecVer = _mI.Get(type, 0, "Format_Version").ToUpper();
   if (strCodec == "MPEG-4 VISUAL")
   {
     strCodec = _mI.Get(type, 0, "CodecID").ToUpper();
   }
   else
   {
     if (!String.IsNullOrEmpty(strCodecVer))
     {
       strCodec = (strCodec + " " + strCodecVer).Trim();
       string strCodecProf = _mI.Get(type, 0, "Format_Profile").ToUpper();
       if (type == StreamKind.Video && strCodecProf != "[email protected]")
       {
         strCodec = (strCodec + " " + strCodecProf).Trim();
       }
     }
   }
   if (type == StreamKind.Audio)
   {
     strCodec =
       (strCodec + " " + _mI.Get(type, audiotrack, "Format_Profile").Split(new char[] {'/'})[0].ToUpper()).Trim();
   }
   //
   // Workarround because skin engine ( string.equals/string.contains ) doesn't handle the "+" as last digit
   //
   return strCodec.Replace("+", "PLUS");
 }
开发者ID:npcomplete111,项目名称:MediaPortal-1,代码行数:30,代码来源:MediaInfoWrapper.cs

示例14: Get

 public String Get(int filePos, StreamKind streamKind, int streamNumber, String parameter, InfoKind kindOfInfo)
 {
     return Get(filePos, streamKind, streamNumber, parameter, kindOfInfo, InfoKind.Name);
 }
开发者ID:GusLab,项目名称:video-portal,代码行数:4,代码来源:MediaInfoList.cs

示例15: Get

 public String Get(StreamKind StreamKind, int StreamNumber, String Parameter, InfoKind KindOfInfo,
     InfoKind KindOfSearch)
 {
     return
     Marshal.PtrToStringUni(MediaInfo_Get(Handle, (IntPtr)StreamKind, (IntPtr)StreamNumber, Parameter,
                                      (IntPtr)KindOfInfo, (IntPtr)KindOfSearch));
 }
开发者ID:Thorsten1982,项目名称:MPExtended,代码行数:7,代码来源:MediaInfo.cs


注:本文中的StreamKind类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。