A Reusable Channel which can Load files like a Player.

MediaPlayer is perfect for UIs, as it implements INotifyPropertyChanged.

Also, unlike normal, Properties/Effects/DSP set on a MediaPlayer persist through subsequent loads.

Inheritance: INotifyPropertyChanged, IDisposable
Beispiel #1
0
 public MusicPlayer(IEnumerable <Track> tracks)
 {
     musicPlayer             = new MediaPlayer();
     musicPlayer.MediaEnded += TrackPlayEnded;
     Queue        = new List <Track>(tracks);
     CurrentTrack = Queue.Count >= 1 ? Queue[0] : null;
 }
Beispiel #2
0
        /// <summary>
        /// Applies the DSP on a <see cref="MediaPlayer"/>.
        /// </summary>
        /// <param name="Player"><see cref="MediaPlayer"/> to apply the DSP on.</param>
        /// <param name="Priority">Priority of the DSP in the DSP chain.</param>
        public void ApplyOn(MediaPlayer Player, int Priority = 0)
        {
            _priority = Priority;

            Reassign(Player.Handle);

            Player.MediaLoaded += Reassign;
        }