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:
Bryan Schumaker 2012-03-22 20:52:12 -04:00
parent 53425485d6
commit 70ef389aab
2 changed files with 6 additions and 6 deletions

View File

@ -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();

View File

@ -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());
}*/
}
};