3 This file is part of libmspal
4 Copyright © 2009 Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
30 void Jukebox::add_track(const string &trk)
32 bool was_empty=tracks.empty();
33 tracks.push_back(trk);
35 current_track=tracks.begin();
38 void Jukebox::remove_track(const string &trk)
40 list<string>::iterator i=find(tracks.begin(), tracks.end(), trk);
49 void Jukebox::clear_tracks()
55 void Jukebox::set_shuffle(bool s)
62 if(tracks.empty() || sound)
66 sound->open_file(*current_track);
67 streamer.play(*sound);
79 list<string>::iterator i=tracks.begin();
80 advance(i, rand()%tracks.size());
91 if(current_track==tracks.end())
92 current_track=tracks.begin();
108 if(sound && sound->eof())