]> git.tdb.fi Git - libs/al.git/blobdiff - source/jukebox.cpp
Style update: add spaces around assignments
[libs/al.git] / source / jukebox.cpp
index b8224b29596acd234f67c5cb22c7104cbb6eb83d..95ca6a05e9e2656dab7d85708c98d07e0606cafd 100644 (file)
@@ -31,25 +31,25 @@ Jukebox::~Jukebox()
 
 void Jukebox::add_track(const string &trk)
 {
-       bool was_empty=tracks.empty();
+       bool was_empty = tracks.empty();
        tracks.push_back(trk);
        if(was_empty)
        {
-               current_track=tracks.begin();
+               current_track = tracks.begin();
                signal_track_changed.emit(*current_track);
        }
 }
 
 void Jukebox::remove_track(const string &trk)
 {
-       list<string>::iterator i=find(tracks.begin(), tracks.end(), trk);
+       list<string>::iterator i = find(tracks.begin(), tracks.end(), trk);
        if(i!=tracks.end())
        {
                if(i==current_track)
                        next();
                tracks.erase(i);
                if(tracks.empty())
-                       current_track=tracks.end();
+                       current_track = tracks.end();
        }
 }
 
@@ -57,7 +57,7 @@ void Jukebox::clear_tracks()
 {
        stop();
        tracks.clear();
-       current_track=tracks.end();
+       current_track = tracks.end();
 }
 
 const string &Jukebox::get_current_track() const
@@ -69,7 +69,7 @@ const string &Jukebox::get_current_track() const
 
 void Jukebox::set_shuffle(bool s)
 {
-       shuffle=s;
+       shuffle = s;
 }
 
 void Jukebox::play()
@@ -77,7 +77,7 @@ void Jukebox::play()
        if(tracks.empty() || sound)
                return;
 
-       sound=new AL::Sound;
+       sound = new AL::Sound;
        sound->open_file(*current_track);
        streamer.play(*sound);
 }
@@ -91,7 +91,7 @@ void Jukebox::next()
                {
                        while(1)
                        {
-                               list<string>::iterator i=tracks.begin();
+                               list<string>::iterator i = tracks.begin();
                                advance(i, rand()%tracks.size());
                                if(i!=current_track)
                                {
@@ -104,7 +104,7 @@ void Jukebox::next()
                {
                        ++current_track;
                        if(current_track==tracks.end())
-                               current_track=tracks.begin();
+                               current_track = tracks.begin();
                }
                signal_track_changed.emit(*current_track);
        }
@@ -120,7 +120,7 @@ void Jukebox::previous()
        if(tracks.size()>1)
        {
                if(current_track==tracks.begin())
-                       current_track=tracks.end();
+                       current_track = tracks.end();
                --current_track;
                signal_track_changed.emit(*current_track);
        }
@@ -131,7 +131,7 @@ void Jukebox::stop()
 {
        streamer.stop();
        delete sound;
-       sound=0;
+       sound = 0;
 }
 
 void Jukebox::tick()