From 7dce8ffedc6437bac0d7c5dac330952d2d3692d9 Mon Sep 17 00:00:00 2001 From: Bryan Schumaker Date: Thu, 27 Oct 2011 14:31:35 -0400 Subject: [PATCH] ocarina: Switch to new audio functions These functions have been moved to a new namespace, so the front end needs to be updated. --- ocarina/buttons/button.cpp | 4 ++-- ocarina/buttons/controls.cpp | 13 ++++++------- ocarina/buttons/volume.cpp | 6 +++--- ocarina/ocarina.cpp | 4 ++-- 4 files changed, 13 insertions(+), 14 deletions(-) diff --git a/ocarina/buttons/button.cpp b/ocarina/buttons/button.cpp index d8767eca..dec326ff 100644 --- a/ocarina/buttons/button.cpp +++ b/ocarina/buttons/button.cpp @@ -2,8 +2,8 @@ #include #include +#include #include -#include static GtkWidget *get_button(void (* func)(GtkWidget *, GdkEvent *, gpointer), bool show) @@ -62,7 +62,7 @@ static void on_click_open_file(GtkWidget *b, GdkEvent *e, gpointer d) string file = ocarina_choose_file(); if (file != "") { println("Playing file: " + file); - libsaria::load(file); + libsaria::audio::load(file); } } diff --git a/ocarina/buttons/controls.cpp b/ocarina/buttons/controls.cpp index d40ba21b..20217903 100644 --- a/ocarina/buttons/controls.cpp +++ b/ocarina/buttons/controls.cpp @@ -3,8 +3,7 @@ using namespace std; #include -#include -#include +#include static list play_buttons; static list pause_buttons; @@ -37,7 +36,7 @@ void hide_button_list(button_list_t bttn_list) static void on_click_play(GtkWidget *b, GdkEvent *e, gpointer d) { - libsaria::play(); + libsaria::audio::play(); } GtkWidget *make_play_button() @@ -51,7 +50,7 @@ GtkWidget *make_play_button() static void on_click_pause(GtkWidget *b, GdkEvent *e, gpointer d) { - libsaria::pause(); + libsaria::audio::pause(); } GtkWidget *make_pause_button() @@ -65,7 +64,7 @@ GtkWidget *make_pause_button() static void on_click_stop(GtkWidget *b, GdkEvent *e, gpointer d) { - libsaria::stop(); + libsaria::audio::stop(); } GtkWidget *make_stop_button() @@ -77,7 +76,7 @@ GtkWidget *make_stop_button() static void on_click_rewind(GtkWidget *b, GdkEvent *e, gpointer d) { - libsaria::seek(-5); + libsaria::audio::seek(-5); } GtkWidget *make_rewind_button() @@ -89,7 +88,7 @@ GtkWidget *make_rewind_button() static void on_click_forward(GtkWidget *b, GdkEvent *e, gpointer d) { - libsaria::seek(5); + libsaria::audio::seek(5); } GtkWidget *make_forward_button() diff --git a/ocarina/buttons/volume.cpp b/ocarina/buttons/volume.cpp index c2081c8d..c0fe2304 100644 --- a/ocarina/buttons/volume.cpp +++ b/ocarina/buttons/volume.cpp @@ -1,5 +1,5 @@ -#include +#include #include static void resize(GtkWidget *volume) @@ -24,7 +24,7 @@ static void set_increment(GtkWidget *volume, double incr) static void changed(GtkWidget *button, gdouble value, gpointer data) { - libsaria::set_volume(value); + libsaria::audio::set_volume(value); resize(button); } @@ -32,7 +32,7 @@ GtkWidget *make_volume_button() { GtkWidget *volume = gtk_volume_button_new(); gtk_scale_button_set_value(GTK_SCALE_BUTTON(volume), - libsaria::get_volume()); + libsaria::audio::get_volume()); gtk_widget_show(volume); set_increment(volume, 0.05); resize(volume); diff --git a/ocarina/ocarina.cpp b/ocarina/ocarina.cpp index 24e75bc2..6a20c47b 100644 --- a/ocarina/ocarina.cpp +++ b/ocarina/ocarina.cpp @@ -7,8 +7,8 @@ #include #include +#include #include -#include #include #include @@ -47,7 +47,7 @@ int main(int argc, char **argv) ocarina_init(argc, argv); if (argc > 1) - libsaria::load(argv[1]); + libsaria::audio::load(argv[1]); gtk_main(); libsaria::quit();