libsaria: Add progress file
This will include code for seeking and getting the current position in the song. Right now I just have a function for resetting the position to the beginning of the song.
This commit is contained in:
parent
937fbc1111
commit
4b3b1babbc
|
@ -0,0 +1,3 @@
|
|||
|
||||
void libsaria_seek();
|
||||
|
|
@ -24,16 +24,3 @@ bool Audio::pause()
|
|||
{
|
||||
return change_state(GST_STATE_PAUSED);
|
||||
}
|
||||
|
||||
/*
|
||||
* Right now I just seek to the beginning of the song.
|
||||
* Eventually I should allow the user to seek anywhere.
|
||||
*/
|
||||
void Audio::seek()
|
||||
{
|
||||
gst_element_seek_simple(GST_ELEMENT(player),
|
||||
GST_FORMAT_TIME,
|
||||
GST_SEEK_FLAG_FLUSH,
|
||||
// Convert seconds to nano-seconds
|
||||
0 * GST_SECOND);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
|
||||
#include <libsaria/audio.h>
|
||||
|
||||
/*
|
||||
* Right now I just seek to the beginning of the song.
|
||||
* Eventually I should allow the user to seek anywhere.
|
||||
*/
|
||||
void Audio::seek()
|
||||
{
|
||||
gst_element_seek_simple(GST_ELEMENT(player),
|
||||
GST_FORMAT_TIME,
|
||||
GST_SEEK_FLAG_FLUSH,
|
||||
// Convert seconds to nano-seconds
|
||||
0 * GST_SECOND);
|
||||
}
|
|
@ -24,11 +24,6 @@ void Libsaria::stop()
|
|||
seek();
|
||||
}
|
||||
|
||||
void Libsaria::seek()
|
||||
{
|
||||
audio.seek();
|
||||
}
|
||||
|
||||
/*
|
||||
* Convenience functions for accessing libsaria class functions
|
||||
*/
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
|
||||
#include <libsaria/libsaria.h>
|
||||
|
||||
/*
|
||||
* Implementations of functions defined in the libsaria class
|
||||
*/
|
||||
|
||||
void Libsaria::seek()
|
||||
{
|
||||
audio.seek();
|
||||
}
|
||||
|
||||
/*
|
||||
* Convenience functions for accessing libsaria class functions
|
||||
*/
|
||||
|
||||
void libsaria_seek()
|
||||
{
|
||||
libsaria_get()->seek();
|
||||
}
|
||||
|
Loading…
Reference in New Issue