public void reset() { queue.Clear(); currentSongPointer = -1; cmdControl = new CommandInvoker(); slot = 0; //slot to be used when setting commands subject = new Subject(); subject.setState(currentSongPointer); new Observer1(subject); it = new SongIterator(); Player.mplayer.Stop(); }
private Player() { mplayer = new MediaPlayer(); queue = new ObservableCollection <Song>(); //queue = new List<Song>(); currentSongPointer = -1; cmdControl = new CommandInvoker(); slot = 0; //slot to be used when setting commands subject = new Subject(); subject.setState(currentSongPointer); new Observer1(subject); it = new SongIterator(); }
/* OLD WAY * public DiscJockey(SongsOfThe70s newSongs70s, SongsOfThe80s newSongs80s, SongsOfThe90s newSongs90s) { * * songs70s = newSongs70s; * songs80s = newSongs80s; * songs90s = newSongs90s; * * } */ // NEW WAY Initialize the iterators public DiscJockey(SongIterator newSongs70s, SongIterator newSongs80s, SongIterator newSongs90s) { iter70sSongs = newSongs70s; iter80sSongs = newSongs80s; iter90sSongs = newSongs90s; }