audio: Make audio functions more consistent

Sometimes I would check for cur_track, other times !cur_track.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This commit is contained in:
Anna Schumaker 2014-12-20 10:29:26 -05:00
parent fd2a251c14
commit e866ea2574

View File

@ -111,8 +111,7 @@ void audio :: pause()
void audio :: seek_to(long pos) void audio :: seek_to(long pos)
{ {
if (!cur_track) if (cur_track)
return;
cur_driver->seek_to(pos); cur_driver->seek_to(pos);
} }
@ -124,16 +123,16 @@ void audio :: stop()
long audio :: position() long audio :: position()
{ {
if (!cur_track) if (cur_track)
return 0;
return cur_driver->position(); return cur_driver->position();
return 0;
} }
long audio :: duration() long audio :: duration()
{ {
if (!cur_track) if (cur_track)
return 0;
return cur_driver->duration(); return cur_driver->duration();
return 0;
} }
std::string audio :: position_str() std::string audio :: position_str()