libsaria: Find audio position and duration
Used for update a slider in the UI. Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
This commit is contained in:
parent
53425485d6
commit
70ef389aab
|
@ -35,11 +35,11 @@ namespace libsaria
|
|||
|
||||
/* Position related functions */
|
||||
/*bool seek(int);
|
||||
void seek_to(double);
|
||||
void seek_to(double);*/
|
||||
gint64 duration();
|
||||
gint64 position();
|
||||
string posstr();
|
||||
string durstr();*/
|
||||
string durstr();
|
||||
|
||||
/* Volume functions */
|
||||
/*float get_volume();
|
||||
|
|
|
@ -5,7 +5,7 @@ using namespace std;
|
|||
#include <libsaria/audio.h>
|
||||
#include "audio.h"
|
||||
|
||||
/*static bool get_duration(gint64 &duration)
|
||||
static bool get_duration(gint64 &duration)
|
||||
{
|
||||
GstFormat fmt = GST_FORMAT_TIME;
|
||||
return gst_element_query_duration(GST_ELEMENT(player),
|
||||
|
@ -37,7 +37,7 @@ static string to_string(gint64 time)
|
|||
stream << "0";
|
||||
stream << seconds;
|
||||
return stream.str();
|
||||
}*/
|
||||
}
|
||||
|
||||
namespace libsaria
|
||||
{
|
||||
|
@ -69,7 +69,7 @@ namespace libsaria
|
|||
seek_to(pos);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
}*/
|
||||
|
||||
gint64 audio::duration()
|
||||
{
|
||||
|
@ -97,6 +97,6 @@ namespace libsaria
|
|||
string audio::posstr()
|
||||
{
|
||||
return to_string(position());
|
||||
}*/
|
||||
}
|
||||
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue