本文整理汇总了C#中MediaPortal.Video.Database.IMDBMovie.SetPlayProperties方法的典型用法代码示例。如果您正苦于以下问题:C# IMDBMovie.SetPlayProperties方法的具体用法?C# IMDBMovie.SetPlayProperties怎么用?C# IMDBMovie.SetPlayProperties使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MediaPortal.Video.Database.IMDBMovie
的用法示例。
在下文中一共展示了IMDBMovie.SetPlayProperties方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetCurrentFile
//.........这里部分代码省略.........
GUIPropertyManager.SetProperty("#Play.Current.Thumb", logo);
_thumbLogo = logo;
bMovieInfoFound = true;
}
else // Nfo support
{
string path = string.Empty;
int pathIndex = 0;
if (fileName.ToUpperInvariant().Contains(@"\BDMV"))
{
pathIndex = fileName.ToUpperInvariant().LastIndexOf(@"\BDMV");
path = fileName.Remove(pathIndex);
}
else if (fileName.ToUpperInvariant().Contains(@"\VIDEO_TS\"))
{
pathIndex = fileName.ToUpperInvariant().LastIndexOf(@"\VIDEO_TS\");
path = fileName.Remove(pathIndex);
}
else
{
path = Path.GetDirectoryName(fileName);
}
IMDBMovie.FetchMovieNfo(path, fileName, ref movieDetails);
if (!movieDetails.IsEmpty)
{
bMovieInfoFound = true;
}
}
if (bMovieInfoFound)
{
movieDetails.SetPlayProperties(true);
}
else
{
GUIListItem item = new GUIListItem();
item.IsFolder = false;
item.Path = fileName;
Util.Utils.SetThumbnails(ref item);
GUIPropertyManager.SetProperty("#Play.Current.Thumb", item.ThumbnailImage);
// Image file check to set title for OSD (non db)
if (VirtualDirectory.IsImageFile(Path.GetExtension(fileName)))
{
string title = Util.Utils.GetFilename(fileName, true);
GUIPropertyManager.SetProperty("#Play.Current.Title", title);
}
else if (fileName.ToLower().Contains("index.bdmv")) // BD folder title check
{
string title = selectBdHandler.GetBDFolderName(fileName);
// get the name when play BD directly from Drive letter
if (String.IsNullOrEmpty(title))
{
List<GUIListItem> rootDrives = VirtualDirectories.Instance.Movies.GetRootExt();
title = Path.GetPathRoot(fileName);
title = Util.Utils.RemoveTrailingSlash(title);
for (int i = rootDrives.Count - 1; i >= 0; i--)
{
GUIListItem itemBDroot = (GUIListItem)rootDrives[i];
string itemBD = Path.GetPathRoot(itemBDroot.Path);
itemBD = Util.Utils.RemoveTrailingSlash(itemBD);
if (itemBD == title && !String.IsNullOrEmpty(itemBDroot.DVDLabel)) //cd or dvd drive
{
示例2: SetCurrentFile
//.........这里部分代码省略.........
{
selectBdHandler = new SelectBDHandler();
GlobalServiceProvider.Add<ISelectBDHandler>(selectBdHandler);
}
// Adapt filename for image files
if (Util.Utils.IsISOImage(fileName))
{
fileName = DaemonTools.MountedIsoFile;
}
// -------------------------------------------------------
// Try to set the properties and the thumb path in 5 steps
bool movieInfoFound = false;
bool thumbInfoFound = false;
// Step 1 ------------------------------- -------------------------
// Try to set the properties and thumb path from the video database
IMDBMovie movie = new IMDBMovie();
string name = fileName;
if (fileName.ToLowerInvariant().Contains(".mpls")) // BD folder title check (playlist)
{
int index = fileName.ToLowerInvariant().LastIndexOf(@"\playlist");
name = fileName.Remove(index) + @"\index.bdmv";
}
if (VideoDatabase.HasMovieInfo(name))
{
// Set the properties (incuding cover thumb) from the movie info
VideoDatabase.GetMovieInfo(name, ref movie);
if (movie.ThumbURL.ToLowerInvariant().StartsWith("file://"))
movie.ThumbURL = movie.ThumbURL.Substring(7);
movie.SetPlayProperties(true);
movieInfoFound = true;
if (!string.IsNullOrEmpty(movie.ThumbURL))
{
thumbInfoFound = true;
return;
}
}
// Step 2 --------------------------------------------------------
// Try to set the properties and the thumb path from the .nfo file
string path = string.Empty;
int pathIndex = 0;
if (fileName.ToUpperInvariant().Contains(@"\BDMV"))
{
pathIndex = fileName.ToUpperInvariant().LastIndexOf(@"\BDMV");
path = fileName.Remove(pathIndex);
}
else if (fileName.ToUpperInvariant().Contains(@"\VIDEO_TS\"))
{
pathIndex = fileName.ToUpperInvariant().LastIndexOf(@"\VIDEO_TS\");
path = fileName.Remove(pathIndex);
}
else if (!String.IsNullOrEmpty(fileName))
{
path = Path.GetDirectoryName(fileName);
}
IMDBMovie.FetchMovieNfo(path, fileName, ref movie);
if (!movie.IsEmpty)
{
// Set the properties (incuding cover thumb) from the .nfo file
示例3: SetCurrentFile
//.........这里部分代码省略.........
index = lowPath.IndexOf(@"video_ts\");
}
if (index >= 0)
{
fileName = fileName.Substring(0, index);
fileName = Util.Utils.RemoveTrailingSlash(fileName);
// get the name by stripping the first part : c:\media\movies
string strName = fileName;
int pos = fileName.LastIndexOfAny(new char[] {'\\', '/'});
if (pos >= 0 && pos + 1 < fileName.Length - 1)
{
strName = fileName.Substring(pos + 1);
}
GUIPropertyManager.SetProperty("#Play.Current.Title", strName);
GUIPropertyManager.SetProperty("#Play.Current.File", strName);
// construct full filename as imdb info is stored...
fileName += @"\VIDEO_TS\VIDEO_TS.IFO";
}
}
bool isLive = g_Player.IsTimeShifting;
string extension = Path.GetExtension(fileName).ToLower();
if (extension.Equals(".sbe") || extension.Equals(".dvr-ms") ||
(extension.Equals(".ts") && !isLive || g_Player.IsTVRecording))
{
// this is a recorded movie.
// check the TVDatabase for the description,genre,title,...
if (g_Player.currentTitle != "")
{
GUIPropertyManager.SetProperty("#Play.Current.Title", g_Player.currentTitle);
GUIPropertyManager.SetProperty("#Play.Current.Plot",
g_Player.currentTitle + "\n" + g_Player.currentDescription);
GUIPropertyManager.SetProperty("#Play.Current.PlotOutline", g_Player.currentDescription);
}
}
/*if (fileName.Substring(0, 4) == "rtsp")
{
GUIPropertyManager.SetProperty("#Play.Current.Title", g_Player.currentTitle);
GUIPropertyManager.SetProperty("#Play.Current.Plot", g_Player.currentTitle + "\n" + g_Player.currentDescription);
GUIPropertyManager.SetProperty("#Play.Current.PlotOutline", g_Player.currentDescription);
}*/
IMDBMovie movieDetails = new IMDBMovie();
bool bMovieInfoFound = false;
if (!g_Player.IsTVRecording)
{
if (VideoDatabase.HasMovieInfo(fileName))
{
VideoDatabase.GetMovieInfo(fileName, ref movieDetails);
bMovieInfoFound = true;
}
else if (File.Exists(Path.ChangeExtension(fileName, ".xml")))
{
MatroskaTagInfo info = MatroskaTagHandler.Fetch(Path.ChangeExtension(fileName, ".xml"));
movieDetails.Title = info.title;
movieDetails.Plot = info.description;
movieDetails.Genre = info.genre;
GUIPropertyManager.SetProperty("#Play.Current.Channel", info.channelName);
string logo = Util.Utils.GetCoverArt(Thumbs.TVChannel, info.channelName);
if (!Util.Utils.FileExistsInCache(logo))
{
logo = "defaultVideoBig.png";
}
GUIPropertyManager.SetProperty("#Play.Current.Thumb", logo);
_thumbLogo = logo;
bMovieInfoFound = true;
}
if (bMovieInfoFound)
{
movieDetails.SetPlayProperties();
}
else
{
GUIListItem item = new GUIListItem();
item.IsFolder = false;
item.Path = fileName;
Util.Utils.SetThumbnails(ref item);
GUIPropertyManager.SetProperty("#Play.Current.Thumb", item.ThumbnailImage);
}
}
else if (g_Player.IsTV && g_Player.IsTimeShifting)
{
GUIPropertyManager.SetProperty("#Play.Current.Title", GUIPropertyManager.GetProperty("#TV.View.channel"));
GUIPropertyManager.SetProperty("#Play.Current.Genre", GUIPropertyManager.GetProperty("#TV.View.title"));
}
else
{
GUIListItem item = new GUIListItem();
item.IsFolder = false;
item.Path = fileName;
Util.Utils.SetThumbnails(ref item);
GUIPropertyManager.SetProperty("#Play.Current.Thumb", item.ThumbnailImage);
}
_thumbLogo = GUIPropertyManager.GetProperty("#Play.Current.Thumb");
}