Exemplo n.º 1
0
        public HohoemaPlaylist(MediaPlayer mediaPlayer, PlaylistSettings playlistSettings, StorageFolder playlistSaveFolder)
        {
            MediaPlayer         = mediaPlayer;
            PlaylistSettings    = playlistSettings;
            PlaylistsSaveFolder = playlistSaveFolder;
            Player = new PlaylistPlayer(this, playlistSettings);

            Playlists = new ReadOnlyObservableCollection <LocalMylist>(_Playlists);

            var smtc = MediaPlayer.SystemMediaTransportControls;

            smtc.AutoRepeatModeChangeRequested          += Smtc_AutoRepeatModeChangeRequested;
            MediaPlayer.CommandManager.NextReceived     += CommandManager_NextReceived;
            MediaPlayer.CommandManager.PreviousReceived += CommandManager_PreviousReceived;
        }
Exemplo n.º 2
0
        public HohoemaPlaylist(HohoemaApp hohoemaApp, PlaylistSettings playlistSettings, StorageFolder playlistSaveFolder, HohoemaViewManager viewMan)
        {
            HohoemaApp          = hohoemaApp;
            PlaylistSettings    = playlistSettings;
            PlaylistsSaveFolder = playlistSaveFolder;
            Player         = new PlaylistPlayer(this, playlistSettings);
            _SecondaryView = viewMan;

            Playlists = new ReadOnlyObservableCollection <LocalMylist>(_Playlists);

            MakeDefaultPlaylist();
            CurrentPlaylist = DefaultPlaylist;

            if (ApplicationData.Current.LocalSettings.Values.TryGetValue(nameof(PlayerDisplayType), out var showInMainView))
            {
                try
                {
                    _PlayerDisplayType = (bool)showInMainView ? PlayerDisplayType.PrimaryView : PlayerDisplayType.SecondaryView;
                }
                catch { }
            }

            Player.PlayRequested += Player_PlayRequested;
        }