libsaria: New controls

I added functions for rewinding, fast forwarding, and toggling play /
pause.  This should make it easier on the UI.
This commit is contained in:
Bryan Schumaker 2011-12-23 15:48:08 -05:00
parent e2ee610439
commit 3944e691a5
2 changed files with 20 additions and 0 deletions

View File

@ -6,6 +6,9 @@ namespace libsaria
void next();
void set_pause_after(bool);
bool get_pause_after();
void toggle_play();
void rewind();
void forward();
};
#endif /* LIBSARIA_CONTROLS_H */

View File

@ -33,4 +33,21 @@ namespace libsaria
return pause_after_current;
}
void toggle_play()
{
if (audio::is_playing())
audio::pause();
else
audio::play();
}
void rewind()
{
audio::seek(-5);
}
void forward()
{
audio::seek(5);
}
}; /* Namespace: libsaria */