本文整理汇总了C#中MediaPortal.Playlists.PlayListPlayer类的典型用法代码示例。如果您正苦于以下问题:C# PlayListPlayer类的具体用法?C# PlayListPlayer怎么用?C# PlayListPlayer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PlayListPlayer类属于MediaPortal.Playlists命名空间,在下文中一共展示了PlayListPlayer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetNextReturnsFileName
public void GetNextReturnsFileName()
{
PlayListPlayer player = new PlayListPlayer();
player.CurrentPlaylistType = PlayListType.PLAYLIST_MUSIC;
PlayList playlist = player.GetPlaylist(PlayListType.PLAYLIST_MUSIC);
PlayListItem item1 = new PlayListItem("apa", "c:\\apa.mp3");
playlist.Add(item1);
Assert.AreEqual("c:\\apa.mp3", player.GetNext());
}
示例2: InsertItemButNotStartPlayingGivesNull
public void InsertItemButNotStartPlayingGivesNull()
{
PlayListPlayer player = new PlayListPlayer();
player.CurrentPlaylistType = PlayListType.PLAYLIST_MUSIC;
PlayList playlist = player.GetPlaylist(PlayListType.PLAYLIST_MUSIC);
PlayListItem item1 = new PlayListItem();
playlist.Add(item1);
Assert.IsNull(player.GetCurrentItem());
}
示例3: GUIVideoBaseWindow
public GUIVideoBaseWindow()
{
playlistPlayer = PlayListPlayer.SingletonPlayer;
if (handler == null)
{
handler = new VideoViewHandler();
}
GUIWindowManager.OnNewAction += new OnActionHandler(OnNewAction);
}
示例4: PlayMovesCurrentToItem
public void PlayMovesCurrentToItem()
{
PlayListPlayer player = new PlayListPlayer();
player.g_Player = this; //fake g_Player
player.CurrentPlaylistType = PlayListType.PLAYLIST_MUSIC;
PlayList playlist = player.GetPlaylist(PlayListType.PLAYLIST_MUSIC);
PlayListItem item1 = new PlayListItem();
playlist.Add(item1);
player.PlayNext();
Assert.AreEqual(item1, player.GetCurrentItem());
Assert.IsTrue(hasPlayBeenCalled);
}
示例5: GUIVideoOSD
public GUIVideoOSD()
{
GetID = (int)Window.WINDOW_OSD;
playlistPlayer = PlayListPlayer.SingletonPlayer;
}
示例6: GUISlideShow
public GUISlideShow()
{
GetID = (int)Window.WINDOW_SLIDESHOW;
playlistPlayer = PlayListPlayer.SingletonPlayer;
}
示例7: GUIVideoFullscreen
public GUIVideoFullscreen()
{
GetID = (int)Window.WINDOW_FULLSCREEN_VIDEO;
playlistPlayer = PlayListPlayer.SingletonPlayer;
}
示例8: GUIMusicBaseWindow
public GUIMusicBaseWindow()
{
if (m_database == null)
{
m_database = MusicDatabase.Instance;
}
playlistPlayer = PlayListPlayer.SingletonPlayer;
playlistPlayer.PlaylistChanged += new PlayListPlayer.PlaylistChangedEventHandler(playlistPlayer_PlaylistChanged);
using (Profile.Settings xmlreader = new Profile.MPSettings())
{
string playNowJumpTo = xmlreader.GetValueAsString("music", "playnowjumpto", "none");
switch (playNowJumpTo)
{
case "none":
PlayNowJumpTo = PlayNowJumpToType.None;
break;
case "nowPlayingAlways":
PlayNowJumpTo = PlayNowJumpToType.NowPlayingAlways;
break;
case "nowPlayingMultipleItems":
PlayNowJumpTo = PlayNowJumpToType.NowPlayingMultipleItems;
break;
case "currentPlaylistAlways":
PlayNowJumpTo = PlayNowJumpToType.CurrentPlaylistAlways;
break;
case "currentPlaylistMultipleItems":
PlayNowJumpTo = PlayNowJumpToType.CurrentPlaylistMultipleItems;
break;
case "fullscreenAlways":
PlayNowJumpTo = PlayNowJumpToType.FullscreenIfVizEnabledAlways;
break;
case "fullscreenMultipleItems":
PlayNowJumpTo = PlayNowJumpToType.FullscreenIfVizEnabledMultipleItems;
break;
default:
PlayNowJumpTo = PlayNowJumpToType.None;
break;
}
_autoShuffleOnLoad = xmlreader.GetValueAsBool("musicfiles", "autoshuffle", false);
}
UsingInternalMusicPlayer = BassMusicPlayer.IsDefaultMusicPlayer;
}
示例9: Init
/// <summary>
/// Initialise The Viz Window
/// </summary>
private void Init()
{
InitializeComponent();
CheckForIllegalCrossThreadCalls = false;
PlaylistPlayer = PlayListPlayer.SingletonPlayer;
g_Player.PlayBackStarted += new g_Player.StartedHandler(OnPlayBackStarted);
Bass.InternetStreamSongChanged += new BassAudioEngine.InternetStreamSongChangedDelegate(InternetStreamSongChanged);
//if (GUIGraphicsContext.form != null)
// GUIGraphicsContext.form.Resize += new EventHandler(OnAppFormResize);
GUIGraphicsContext.OnNewAction += new OnActionHandler(OnNewAction);
SetStyle(ControlStyles.DoubleBuffer, true);
SetStyle(ControlStyles.AllPaintingInWmPaint, true);
SetStyle(ControlStyles.UserPaint, true);
TextStringFormat.Trimming = StringTrimming.Character;
TextStringFormat.FormatFlags = StringFormatFlags.NoWrap | StringFormatFlags.NoClip | StringFormatFlags.FitBlackBox;
LoadSettings();
// Soundspectrum Graphics always show the cursor, so let's hide it here
if (GUIGraphicsContext.Fullscreen && _autoHideMouse)
{
Cursor.Hide();
}
}
示例10: GUIMusicFullscreen
public GUIMusicFullscreen()
{
GetID = (int)Window.WINDOW_FULLSCREEN_MUSIC;
playlistPlayer = PlayListPlayer.SingletonPlayer;
}
示例11: VideoHandler
public VideoHandler()
{
playlistPlayer = MediaPortal.Playlists.PlayListPlayer.SingletonPlayer;
// Check if External Player is being used
MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"));
m_bIsExternalPlayer = !xmlreader.GetValueAsBool("movieplayer", "internal", true);
m_bIsExternalDVDPlayer = !xmlreader.GetValueAsBool("dvdplayer", "internal", true);
// external player handlers
Utils.OnStartExternal += new Utils.UtilEventHandler(onStartExternal);
Utils.OnStopExternal += new Utils.UtilEventHandler(onStopExternal);
g_Player.PlayBackStopped += new MediaPortal.Player.g_Player.StoppedHandler(OnPlayBackStopped);
g_Player.PlayBackEnded += new MediaPortal.Player.g_Player.EndedHandler(OnPlayBackEnded);
g_Player.PlayBackStarted += new MediaPortal.Player.g_Player.StartedHandler(OnPlayBackStarted);
g_Player.PlayBackChanged += new g_Player.ChangedHandler(OnPlaybackChanged);
PlayPropertyUpdater.WorkerSupportsCancellation = true;
PlayPropertyUpdater.DoWork += new DoWorkEventHandler(SetPlayProperties_DoWork);
}
示例12: RenderVisualization
public override int RenderVisualization()
{
try
{
if (VisualizationWindow == null || !VisualizationWindow.Visible || _visParam.VisHandle == 0)
{
return 0;
}
// Set Song information, so that the plugin can display it
if (trackTag != null && Bass != null)
{
_playlistPlayer = PlayListPlayer.SingletonPlayer;
PlayListItem curPlaylistItem = _playlistPlayer.GetCurrentItem();
_mediaInfo.Position = (int)Bass.CurrentPosition;
_mediaInfo.Duration = (int)Bass.Duration;
_mediaInfo.PlaylistLen = 1;
_mediaInfo.PlaylistPos = _playlistPlayer.CurrentPlaylistPos;
}
else
{
_mediaInfo.Position = 0;
_mediaInfo.Duration = 0;
_mediaInfo.PlaylistLen = 0;
_mediaInfo.PlaylistPos = 0;
}
if (IsPreviewVisualization)
{
_mediaInfo.SongTitle = "Mediaportal Preview";
}
BassVis.BASSVIS_SetInfo(_visParam, _mediaInfo);
if (RenderStarted)
{
return 1;
}
int stream = 0;
if (Bass != null)
{
stream = (int)Bass.GetCurrentVizStream();
}
BassVis.BASSVIS_SetPlayState(_visParam, BASSVIS_PLAYSTATE.Play);
RenderStarted = BassVis.BASSVIS_RenderChannel(_visParam, stream);
}
catch (Exception) {}
return 1;
}
示例13: Init
public override bool Init()
{
_playlistPlayer = PlayListPlayer.SingletonPlayer;
g_Player.PlayBackEnded += OnPlayBackEnded;
g_Player.PlayBackChanged += OnPlayBackChanged;
g_Player.PlayBackStopped += OnPlayBackStopped;
var mdb = MusicDatabase.Instance;
var sessionKey = mdb.GetLastFMSK();
var currentUser = mdb.GetLastFMUser();
var a = new LastFMLibrary(sessionKey, currentUser); //TODO this is just making _SK get loaded. No need to actual instansiate
return Load(GUIGraphicsContext.GetThemedSkinDirectory(@"\lastFmRadio.xml"));
}
示例14: D3D
protected static Rectangle _backupBounds; // Bounds backup
#endregion
#region constructor
/// <summary>
/// Constructor
/// </summary>
protected D3D()
{
_firstTimeWindowDisplayed = true;
_firstTimeActivated = true;
MinimizeOnStartup = false;
MinimizeOnGuiExit = false;
MinimizeOnFocusLoss = false;
ShuttingDown = false;
AutoHideMouse = true;
MouseCursor = true;
Windowed = true;
Volume = -1;
AppActive = false;
KeyPreview = true;
Frames = 0;
FrameStatsLine1 = null;
FrameStatsLine2 = null;
Text = Resources.D3DApp_NotifyIcon_MediaPortal;
PlaylistPlayer = PlayListPlayer.SingletonPlayer;
MouseTimeOutTimer = DateTime.Now;
_lastActiveWindow = -1;
IsVisible = true;
IsDisplayTurnedOn = true;
IsInAwayMode = false;
IsUserPresent = true;
_lastMouseCursor = !MouseCursor;
_showCursorWhenFullscreen = false;
_currentPlayListType = PlayListType.PLAYLIST_NONE;
_enumerationSettings = new D3DEnumeration();
_presentParams = new PresentParameters();
_renderTarget = this;
using (Settings xmlreader = new MPSettings())
{
_useExclusiveDirectXMode = xmlreader.GetValueAsBool("general", "exclusivemode", true);
UseEnhancedVideoRenderer = xmlreader.GetValueAsBool("general", "useEVRenderer", false);
_disableMouseEvents = xmlreader.GetValueAsBool("remote", "CentareaJoystickMap", false);
AutoHideTaskbar = xmlreader.GetValueAsBool("general", "hidetaskbar", true);
_alwaysOnTop = xmlreader.GetValueAsBool("general", "alwaysontop", false);
_reduceFrameRate = xmlreader.GetValueAsBool("gui", "reduceframerate", false);
_doNotWaitForVSync = xmlreader.GetValueAsBool("debug", "donotwaitforvsync", false);
}
_useExclusiveDirectXMode = !UseEnhancedVideoRenderer && _useExclusiveDirectXMode;
GUIGraphicsContext.IsVMR9Exclusive = _useExclusiveDirectXMode;
GUIGraphicsContext.IsEvr = UseEnhancedVideoRenderer;
InitializeComponent();
}
示例15: Init
public override bool Init()
{
bool bResult = Load(GUIGraphicsContext.GetThemedSkinFile(@"\MyRadioLastFM.xml"));
using (Profile.Settings xmlreader = new Profile.MPSettings())
{
_configShowTrayIcon = xmlreader.GetValueAsBool("audioscrobbler", "showtrayicon", false);
_configShowBallonTips = xmlreader.GetValueAsBool("audioscrobbler", "showballontips", false);
_configDirectSkip = xmlreader.GetValueAsBool("audioscrobbler", "directskip", false);
_configListEntryCount = xmlreader.GetValueAsInt("audioscrobbler", "listentrycount", 24);
_configOneClickStart = xmlreader.GetValueAsBool("audioscrobbler", "oneclickstart", false);
}
PlaylistPlayer = PlayListPlayer.SingletonPlayer;
LastFMStation = new StreamControl();
InfoScrobbler = AudioscrobblerUtils.Instance;
_usersTopArtists = new List<string>(_configListEntryCount);
_usersOwnTags = new List<string>(_configListEntryCount);
_usersFriends = new List<string>(_configListEntryCount);
_radioTrackList = new List<Song>(5);
_similarArtistCache = new List<string>(5);
_trackTagsCache = new List<string>(5);
_streamSong = new Song();
_scrobbleUsers = new List<string>(1);
if (_configShowTrayIcon)
{
InitTrayIcon();
}
g_Player.PlayBackStarted += new g_Player.StartedHandler(PlayBackStartedHandler);
g_Player.PlayBackStopped += new g_Player.StoppedHandler(PlayBackStoppedHandler);
g_Player.PlayBackEnded += new g_Player.EndedHandler(PlayBackEndedHandler);
LastFMStation.RadioSettingsSuccess += new StreamControl.RadioSettingsLoaded(OnRadioSettingsSuccess);
LastFMStation.RadioSettingsError += new StreamControl.RadioSettingsFailed(OnRadioSettingsError);
this.PlaylistUpdateSuccess += new PlaylistUpdated(OnPlaylistUpdateSuccess);
this.PlaylistUpdateError += new PlaylistEmpty(OnPlaylistUpdateError);
return bResult;
}