libsaria: Use a load_file() function
All this function does is load a file. Nothing else. I think this will be useful for using about-to-finish.
This commit is contained in:
parent
f8f5f87e54
commit
04a64ca015
|
@ -16,6 +16,7 @@ namespace libsaria
|
|||
string get_current_file();
|
||||
|
||||
/* Playback control functions */
|
||||
void load_file(string);
|
||||
void load(string);
|
||||
void play();
|
||||
void pause();
|
||||
|
|
|
@ -54,18 +54,25 @@ namespace libsaria
|
|||
seek_to(0);
|
||||
}
|
||||
|
||||
void audio::load(string file)
|
||||
void audio::load_file(string file)
|
||||
{
|
||||
if (file == "")
|
||||
return;
|
||||
string uri = "file://" + file;
|
||||
reset();
|
||||
println("Loading uri: " + uri);
|
||||
cur_file = file;
|
||||
g_object_set(G_OBJECT(player), "uri", uri.c_str(), NULL);
|
||||
cur_file = file;
|
||||
trigger_callback(TRACK_LOADED);
|
||||
}
|
||||
|
||||
void audio::load(string file)
|
||||
{
|
||||
if (file == "")
|
||||
return;
|
||||
reset();
|
||||
load_file(file);
|
||||
}
|
||||
|
||||
string audio::get_current_file()
|
||||
{
|
||||
return cur_file;
|
||||
|
|
Loading…
Reference in New Issue