本文整理汇总了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;
}
示例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));
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例9: Get
public String Get(int FilePos, StreamKind StreamKind, int StreamNumber, String Parameter, InfoKind KindOfInfo)
{
return Get(FilePos, StreamKind, StreamNumber, Parameter, KindOfInfo, InfoKind.Name);
}
示例10: Count_Get
public int Count_Get(int FilePos, StreamKind StreamKind)
{
return Count_Get(FilePos, StreamKind, -1);
}
示例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)
{
}
示例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));
}
}
示例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");
}
示例14: Get
public String Get(int filePos, StreamKind streamKind, int streamNumber, String parameter, InfoKind kindOfInfo)
{
return Get(filePos, streamKind, streamNumber, parameter, kindOfInfo, InfoKind.Name);
}
示例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));
}