libsaria: Created a toggle_play() function
Switches between playing and paused. Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
This commit is contained in:
parent
f67cecef0e
commit
6ae25ccdcb
|
@ -29,6 +29,7 @@ namespace libsaria
|
|||
void load(string);
|
||||
void play();
|
||||
void pause();
|
||||
void toggle_play();
|
||||
GstState get_state();
|
||||
void stop();
|
||||
/*bool is_playing();*/
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue