Beispiel #1
0
        /// <summary>
        /// Prepares the player for playback
        /// </summary>
        private void PrepareForPlayback(ITrackSimple track)
        {
            player.Stop();
            player.Reset();

            player.SetDataSource(fileService.GetFullFilePath(track.LocalFileName));

            player.Prepare();
            NotifyObserver();
        }
Beispiel #2
0
        public void Update()
        {
            ITrackSimple currentTrack = mediaPlayer.CurrentlyPlaying();

            LocalFileName.Text = currentTrack.LocalFileName;
            if (currentTrack is ITrack)
            {
                TrackName.Text = ((ITrack)currentTrack).TrackName;
                Artist.Text    = ((ITrack)currentTrack).Artist;
            }
            else
            {
                TrackName.Text = "--No data--";
                Artist.Text    = "--No data--";
            }

            //Insert code here to update GUI Interface with track information
        }
        private void GetAllTracks()
        {
            IFileService fileService = environmentFactory.CreateFileServicePublicAccess("");

            string[] tracks = fileService.GetAllFilesWithExtension("mp3");



            for (int i = 0; i < tracks.Length; i++)
            {
                Console.WriteLine(tracks[i]);

                ITrackSimple trackSimple = environmentFactory.CreateTrack(fileService.GetLocalFilePath(tracks[i]));

                Console.WriteLine(trackSimple.LocalFileName);
                TracksPosibleToBeAdded.Add(trackSimple);
            }
        }
Beispiel #4
0
 public void SelectTrack(ITrackSimple track)
 {
     PrepareForPlayback(track);
 }
Beispiel #5
0
 public void RemoveTrack(ITrackSimple track)
 {
     Playlist.Remove(track);
 }
Beispiel #6
0
 public void AddTrack(ITrackSimple track)
 {
     Playlist.Add(track);
 }