libsaria: Created a toggle_play() function

Switches between playing and paused.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
This commit is contained in:
Bryan Schumaker 2012-03-26 20:09:50 -04:00
parent f67cecef0e
commit 6ae25ccdcb
2 changed files with 9 additions and 0 deletions

View File

@ -29,6 +29,7 @@ namespace libsaria
void load(string);
void play();
void pause();
void toggle_play();
GstState get_state();
void stop();
/*bool is_playing();*/

View File

@ -49,6 +49,14 @@ namespace libsaria
change_state(GST_STATE_PAUSED);
}
void audio::toggle_play()
{
if (cur_state == GST_STATE_PLAYING)
pause();
else
play();
}
GstState audio::get_state()
{
return cur_state;