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:
parent
e2ee610439
commit
3944e691a5
|
@ -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 */
|
||||
|
|
|
@ -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 */
|
||||
|
|
Loading…
Reference in New Issue