本文整理汇总了C#中VideoType类的典型用法代码示例。如果您正苦于以下问题:C# VideoType类的具体用法?C# VideoType怎么用?C# VideoType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
VideoType类属于命名空间,在下文中一共展示了VideoType类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: handleVideoToggleButtonClick
private void handleVideoToggleButtonClick(System.Windows.Controls.Primitives.ToggleButton button, ref VideoWindow window, VideoType videoType)
{
if (button.IsChecked.GetValueOrDefault(false))
{
if (window != null)
{
window.Close();
}
window = new VideoWindow();
window.SetSensorVideo(nuiSensor, videoType);
window.Closed += delegate(object cSender, EventArgs cArgs)
{
button.IsChecked = false;
};
window.Show();
}
else
{
if (window != null)
{
window.Close();
window = null;
}
}
}
开发者ID:wandermyz,项目名称:KinectGestures,代码行数:26,代码来源:MainWindow.xaml.cs
示例2: LoadLibraries
public static List<NavLibrary> LoadLibraries(string username, VideoType videoType)
{
var cacheKey = username + (videoType == VideoType.Movie ? "MovieLibraries" : "ShowsLibraries");
var names = new List<NavLibrary>();
var cnames = (List<NavLibrary>)HttpContext.Current.Cache[cacheKey];
if (cnames == null)
{
using (var db = new MediaManagerDataContext())
{
var user = db.Users.FirstOrDefault(a => a.UserName == username);
if (user != null)
{
var libraries = user.UserXServers.Select(a => a.Server).SelectMany(a => a.Libraries);
names = videoType == VideoType.Movie ?
libraries.Where(a => a.ServerMedias.Any(b => b.Movie != null)).Select(a => new NavLibrary() {Name = a.Name, ServerName = a.Server.Name, ServerId = a.ServerId}).ToList()
: libraries.Where(a => a.ServerMedias.Any(b => b.Episode != null)).Select(a => new NavLibrary() {Name = a.Name, ServerName = a.Server.Name, ServerId = a.ServerId}).ToList();
// cache the value with a 15 minute sliding, and 1 day abolute expiration
HttpContext.Current.Cache.Add(cacheKey, names, null, DateTime.MaxValue, new TimeSpan(0, 0, 15, 0), CacheItemPriority.Normal, null);
}
}
}
else
{
names = cnames;
}
return names;
}
开发者ID:anlai,项目名称:MyMediaManager,代码行数:33,代码来源:Loader.cs
示例3: InitVideo
/// <summary>
/// 初始化环境
/// </summary>
/// <param name="hdlwin">初始化当前窗口</param>
/// <param name="videotype">视频卡类别</param>
/// <returns>返回视频卡通道数量</returns>
public int InitVideo(IntPtr hdlwin, VideoType videotype)
{
int channel = 0;
switch (videotype)
{
case VideoType.MvAPI:
try
{
channel = (int)MvAPI.MV_GetDeviceNumber();
}
catch (Exception ex)
{
channel = 0;
}
break;
case VideoType.Sa7134Capture:
try
{
if (Sa7134Capture.VCAInitSdk(hdlwin, DISPLAYTRANSTYPE.PCI_MEMORY_VIDEOMEMORY, false))
channel = Sa7134Capture.VCAGetDevNum();
}
catch (Exception ex)
{
channel = 0;
}
break;
}
if (channel > 0)
{
this.channelHandle.Clear();
this.VideoType = videotype;
}
return channel;
}
开发者ID:thisisvoa,项目名称:GranityApp2.5,代码行数:40,代码来源:VideoPreview.cs
示例4: Transcode
/// <summary>
/// Transcode video to a mp4 file
/// </summary>
/// <param name="inputPath">File path to source</param>
/// <param name="profile">Preset profile to transcode to</param>
/// <param name="videoType">Video type (tv or movie)</param>
public void Transcode(string inputPath, string profile, VideoType videoType)
{
//strip the file name out
var filename = DirectoryHelpers.ExtractFilename(inputPath);
var startInfo = new ProcessStartInfo();
startInfo.FileName = HandbrakePath;
startInfo.Arguments = string.Format("-i \"{0}\"", inputPath);
if (videoType == VideoType.Movie)
{
startInfo.Arguments += string.Format(" -o \"{0}movies\\{1} ({2}).mp4\"", _outputPath, filename, profile);
}
if (videoType == VideoType.TvShowEpisode)
{
startInfo.Arguments += string.Format(" -o \"{0}shows\\{1} ({2}).mp4\"", _outputPath, filename, profile);
}
startInfo.Arguments += string.Format(" --preset=\"{0}\"", profile);
startInfo.CreateNoWindow = false;
startInfo.UseShellExecute = false;
using(var process = Process.Start(startInfo))
{
process.WaitForExit();
}
}
开发者ID:anlai,项目名称:MyMediaManager,代码行数:31,代码来源:TranscodingService.cs
示例5: SetSensorVideo
public void SetSensorVideo(NuiSensor sensor, VideoType videoType)
{
this.videoType = videoType;
this.sensor = sensor;
Title = videoType.ToString();
sensor.HandTracker.HandDestroy += new EventHandler<HandDestroyEventArgs>(HandTracker_HandDestroy);
sensor.HandTracker.HandUpdate += new EventHandler<HandUpdateEventArgs>(HandTracker_HandUpdate);
refreshWorker = new BackgroundWorker();
refreshWorker.DoWork += new DoWorkEventHandler(refreshWorker_DoWork);
CompositionTarget.Rendering += new EventHandler(CompositionTarget_Rendering);
//create finger points
for (int i = 0; i < MultiTouchTracker.MAX_FINGERS; i++)
{
Ellipse ellipse = new Ellipse()
{
Width = 10,
Height = 10,
Fill = Brushes.Orange,
Stroke = Brushes.White,
StrokeThickness = 2,
Opacity = 0,
};
fingerPoints.Add(ellipse);
canvas.Children.Add(ellipse);
}
}
开发者ID:wandermyz,项目名称:KinectGestures,代码行数:30,代码来源:VideoWindow.xaml.cs
示例6: GetInputType
/// <summary>
/// Gets the type of the input.
/// </summary>
/// <param name="path">The path.</param>
/// <param name="videoType">Type of the video.</param>
/// <param name="isoType">Type of the iso.</param>
/// <returns>InputType.</returns>
public static InputType GetInputType(string path, VideoType? videoType, IsoType? isoType)
{
var type = InputType.AudioFile;
if (videoType.HasValue)
{
switch (videoType.Value)
{
case VideoType.BluRay:
type = InputType.Bluray;
break;
case VideoType.Dvd:
type = InputType.Dvd;
break;
case VideoType.Iso:
if (isoType.HasValue)
{
switch (isoType.Value)
{
case IsoType.BluRay:
type = InputType.Bluray;
break;
case IsoType.Dvd:
type = InputType.Dvd;
break;
}
}
break;
}
}
return type;
}
开发者ID:Jon-theHTPC,项目名称:MediaBrowser,代码行数:40,代码来源:MediaEncoderHelpers.cs
示例7: Video
/// <summary>
/// Represents a video through a set of locally held attributes.
/// </summary>
/// <param name="location">
/// The "location" of the video on the internet. In other words, the string representation of the url for the video.
/// </param>
/// <param name="res">
/// The resolution of the video.
/// </param>
/// <param name="format">
/// The format (or extension) of the video.
/// </param>
public Video(string location, int res, VideoType format)
{
this.Location = location;
this.Resolution = res;
this.Format = format;
}
开发者ID:AnonymousUser200102010,项目名称:Youtube-Download-Helper,代码行数:20,代码来源:GlobalVariables.cs
示例8: VideoInfo
private VideoInfo(string title, VideoType type, int year, int season, int episode)
{
Title = title;
Type = type;
Year = year;
Season = season;
Episode = episode;
}
开发者ID:tvdburgt,项目名称:subtle,代码行数:8,代码来源:VideoInfo.cs
示例9: EnumHelper_Parse_ReturnsCorrectEnum
public void EnumHelper_Parse_ReturnsCorrectEnum(string value, VideoType videoType)
{
//act
var result = EnumHelper<VideoType>.Parse(value);
//assert
result.Should().Be(videoType);
}
开发者ID:letmeproperty,项目名称:Properties,代码行数:8,代码来源:EnumHelper_TestFixture.cs
示例10: VideoInfo
private VideoInfo(int formatCode, VideoType videoType, int resolution, bool is3D, AudioType audioType, int audioBitrate)
{
FormatCode = formatCode;
VideoType = videoType;
Resolution = resolution;
Is3D = is3D;
AudioType = audioType;
AudioBitrate = audioBitrate;
}
开发者ID:changwng,项目名称:MS.Youtube.Playlist.Downloader,代码行数:9,代码来源:VideoInfo.cs
示例11: VideoInfo
private VideoInfo(int formatCode, VideoType videoType, int resolution, bool is3D, AudioType audioType, int audioBitrate)
{
this.FormatCode = formatCode;
this.VideoType = videoType;
this.Resolution = resolution;
this.Is3D = is3D;
this.AudioType = audioType;
this.AudioBitrate = audioBitrate;
}
开发者ID:remy22,项目名称:Youtube_downloader,代码行数:9,代码来源:VideoInfo.cs
示例12: Verify_Add_Should_AddTheEntityToTheContext
public void Verify_Add_Should_AddTheEntityToTheContext()
{
// Arrange
Mock<IDbSet<VideoType>> mockSetVideoTypes;
var mockContext = VideoTypesMockingSetup.DoMockingSetupForContext(false, out mockSetVideoTypes);
var repository = new VideoTypesRepository(mockContext.Object);
var videoTypes = new VideoType { Active = true, CustomKey = "SALVATORE-RAA", };
// Act
repository.Add(videoTypes);
// Assert
mockSetVideoTypes.Verify(x => x.Add(videoTypes), Times.Once);
}
开发者ID:Jothay,项目名称:comic-vinescraper-api,代码行数:12,代码来源:Videos.VideoTypeRepositoryTests.cs
示例13: ToVideoAsync
/// <summary>
/// Downloads context to audio, requires Url, Optional - VideoInfo (Default: Highest Quality), Optional - BaseDirectory
/// </summary>
public async static Task ToVideoAsync(this YoutubeContext context, VideoType customtype = VideoType.Mp4) {
if (context==null)
throw new ArgumentException(nameof(context));
if (string.IsNullOrEmpty(context.Url))
throw new ArgumentException(nameof(context.Url));
if (context.VideoInfo == null)
await context.FindHighestVideoQualityDownloadUrlAsync(customtype);
var vd = new VideoDownloader(context);
await vd.ExecuteAsync();
}
开发者ID:Nucs,项目名称:YoutubeExtractor-Improved,代码行数:15,代码来源:YoutubeContextTo.cs
示例14: ToVideo
/// <summary>
/// Downloads context to audio, requires Url, Optional - VideoInfo (Default: Highest Quality), Optional - BaseDirectory
/// </summary>
public static void ToVideo(this YoutubeContext context, VideoType customtype = VideoType.Mp4) {
if (context==null)
throw new ArgumentException(nameof(context));
if (string.IsNullOrEmpty(context.Url))
throw new ArgumentException(nameof(context.Url));
if (context.VideoInfo == null)
DownloadUrlResolver.FindHighestVideoQualityDownloadUrl(context, customtype);
var vd = new VideoDownloader(context);
vd.Execute();
}
开发者ID:natenho,项目名称:YoutubeExtractor-Improved,代码行数:15,代码来源:YoutubeContextTo.cs
示例15: SimpleDownloadVideo
public static void SimpleDownloadVideo(string video_url, string title, string folder_destination, VideoType format, Form1 form)
{
IEnumerable<VideoInfo> videoInfos = DownloadUrlResolver.GetDownloadUrls(video_url);
VideoInfo video = videoInfos.First(info => info.VideoType == format);
if (video.RequiresDecryption)
{
DownloadUrlResolver.DecryptDownloadUrl(video);
}
var videoDownloader = new VideoDownloader(video, Path.Combine(folder_destination, title + video.VideoExtension));
videoDownloader.DownloadProgressChanged += (sender, args2) => form.SetProgressBarValue(Convert.ToInt32(args2.ProgressPercentage));
videoDownloader.Execute();
}
开发者ID:Coruscant11,项目名称:YouTeub,代码行数:12,代码来源:YouTubeService.cs
示例16: GetInputArgument
/// <summary>
/// Gets the input argument.
/// </summary>
/// <param name="videoPath">The video path.</param>
/// <param name="isRemote">if set to <c>true</c> [is remote].</param>
/// <param name="videoType">Type of the video.</param>
/// <param name="isoType">Type of the iso.</param>
/// <param name="isoMount">The iso mount.</param>
/// <param name="playableStreamFileNames">The playable stream file names.</param>
/// <param name="type">The type.</param>
/// <returns>System.String[][].</returns>
public static string[] GetInputArgument(string videoPath, bool isRemote, VideoType videoType, IsoType? isoType, IIsoMount isoMount, IEnumerable<string> playableStreamFileNames, out InputType type)
{
var inputPath = isoMount == null ? new[] { videoPath } : new[] { isoMount.MountedPath };
type = InputType.File;
switch (videoType)
{
case VideoType.BluRay:
type = InputType.Bluray;
inputPath = GetPlayableStreamFiles(inputPath[0], playableStreamFileNames).ToArray();
break;
case VideoType.Dvd:
type = InputType.Dvd;
inputPath = GetPlayableStreamFiles(inputPath[0], playableStreamFileNames).ToArray();
break;
case VideoType.Iso:
if (isoType.HasValue)
{
switch (isoType.Value)
{
case IsoType.BluRay:
type = InputType.Bluray;
inputPath = GetPlayableStreamFiles(inputPath[0], playableStreamFileNames).ToArray();
break;
case IsoType.Dvd:
type = InputType.Dvd;
inputPath = GetPlayableStreamFiles(inputPath[0], playableStreamFileNames).ToArray();
break;
}
}
break;
case VideoType.VideoFile:
{
if (isRemote)
{
type = InputType.Url;
}
break;
}
}
return inputPath;
}
开发者ID:Tensre,项目名称:MediaBrowser,代码行数:55,代码来源:MediaEncoderHelpers.cs
示例17: SendMessageBroadcastVideo
public void SendMessageBroadcastVideo(string[] recipients, byte[] VideoData, VideoType vidtype)
{
string to;
List<string> foo = new List<string>();
foreach (string s in recipients)
{
foo.Add(GetJID(s));
}
to = string.Join(",", foo.ToArray());
FMessage msg = this.getFmessageVideo(to, VideoData, vidtype);
if (msg != null)
{
this.SendMessage(msg);
}
}
开发者ID:RCOliveira,项目名称:WhatsAPINet,代码行数:15,代码来源:WhatsApp.cs
示例18: GetMediaInfo
public MediaInfo GetMediaInfo(InternalMediaInfoResult data, VideoType videoType, bool isAudio, string path, MediaProtocol protocol)
{
var info = new Model.MediaInfo.MediaInfo
{
Path = path,
Protocol = protocol
};
FFProbeHelpers.NormalizeFFProbeResult(data);
SetSize(data, info);
var internalStreams = data.streams ?? new MediaStreamInfo[] { };
info.MediaStreams = internalStreams.Select(s => GetMediaStream(isAudio, s, data.format))
.Where(i => i != null)
.ToList();
if (data.format != null)
{
info.Container = data.format.format_name;
if (!string.IsNullOrEmpty(data.format.bit_rate))
{
int value;
if (int.TryParse(data.format.bit_rate, NumberStyles.Any, _usCulture, out value))
{
info.Bitrate = value;
}
}
}
if (isAudio)
{
SetAudioRuntimeTicks(data, info);
var tags = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
// tags are normally located under data.format, but we've seen some cases with ogg where they're part of the audio stream
// so let's create a combined list of both
if (data.streams != null)
{
var audioStream = data.streams.FirstOrDefault(i => string.Equals(i.codec_type, "audio", StringComparison.OrdinalIgnoreCase));
if (audioStream != null && audioStream.tags != null)
{
foreach (var pair in audioStream.tags)
{
tags[pair.Key] = pair.Value;
}
}
}
if (data.format != null && data.format.tags != null)
{
foreach (var pair in data.format.tags)
{
tags[pair.Key] = pair.Value;
}
}
SetAudioInfoFromTags(info, tags);
}
else
{
if (data.format != null && !string.IsNullOrEmpty(data.format.duration))
{
info.RunTimeTicks = TimeSpan.FromSeconds(double.Parse(data.format.duration, _usCulture)).Ticks;
}
FetchWtvInfo(info, data);
if (data.Chapters != null)
{
info.Chapters = data.Chapters.Select(GetChapterInfo).ToList();
}
ExtractTimestamp(info);
}
return info;
}
开发者ID:rezafouladian,项目名称:Emby,代码行数:82,代码来源:ProbeResultNormalizer.cs
示例19: ParseVideoType_ReturnsCorrectString
public void ParseVideoType_ReturnsCorrectString(VideoType videoType, string expected)
{
//act
var result = EnumFactory.ParseVideoType(videoType);
//assert
result.Should().Be(expected);
}
开发者ID:letmeproperty,项目名称:Properties,代码行数:8,代码来源:EnumFactory_TestFixture.cs
示例20: IsRippedMedia
protected bool IsRippedMedia(VideoType type)
{
return type == VideoType.BluRay || type == VideoType.Dvd || type == VideoType.Iso || type == VideoType.HdDvd;
}
开发者ID:Ceten,项目名称:MediaBrowser.Classic,代码行数:4,代码来源:MB3ApiRepository.cs
注:本文中的VideoType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论