summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <wakeroid@gmail.com>2009-12-11 22:16:34 +0100
committerGravatar Alexey Yakovenko <wakeroid@gmail.com>2009-12-11 22:16:34 +0100
commitf8fefd635ad9acda8f5affb0be77a168f78d56b4 (patch)
tree529afc545ea65680366aa6b1a21a1c14fabc2792
parent47f7266baf4cc88c23e98c3f384d22a4780536e2 (diff)
implemented dynamic output plugin selection
-rw-r--r--deadbeef.h2
-rw-r--r--main.c11
-rw-r--r--plugins.c70
-rw-r--r--plugins.h9
-rw-r--r--plugins/alsa/alsa.c2
-rw-r--r--plugins/gtkui/callbacks.c47
-rw-r--r--plugins/gtkui/callbacks.h4
-rw-r--r--plugins/gtkui/deadbeef.glade143
-rw-r--r--plugins/gtkui/interface.c116
9 files changed, 275 insertions, 129 deletions
diff --git a/deadbeef.h b/deadbeef.h
index f6a3c0b5..5c510167 100644
--- a/deadbeef.h
+++ b/deadbeef.h
@@ -219,7 +219,6 @@ typedef struct {
float (*playback_get_pos) (void); // [0..100]
void (*playback_set_pos) (float pos); // [0..100]
void (*playback_update_bitrate) (float bitrate);
- void (*playback_enum_soundcards) (void (*callback)(const char *name, const char *desc, void*), void *userdata);
// streamer access
// FIXME: needs to be thread-safe
DB_playItem_t *(*streamer_get_playing_track) (void);
@@ -343,6 +342,7 @@ typedef struct {
void (*conf_remove_items) (const char *key);
// plugin communication
struct DB_decoder_s **(*plug_get_decoder_list) (void);
+ struct DB_output_s **(*plug_get_output_list) (void);
struct DB_plugin_s **(*plug_get_list) (void);
int (*plug_activate) (struct DB_plugin_s *p, int activate);
// exporting plugin conf options for gui
diff --git a/main.c b/main.c
index 1d512df9..20bc07c2 100644
--- a/main.c
+++ b/main.c
@@ -234,16 +234,7 @@ player_thread (uintptr_t ctx) {
while (messagepump_pop(&msg, &ctx, &p1, &p2) != -1) {
switch (msg) {
case M_REINIT_SOUND:
- {
- int state = p_get_state ();
-
- p_free ();
- p_init ();
-
- if (state != OUTPUT_STATE_PAUSED && state != OUTPUT_STATE_STOPPED) {
- p_play ();
- }
- }
+ plug_reinit_sound ();
break;
case M_TERMINATE:
return;
diff --git a/plugins.c b/plugins.c
index d8a1534f..54cff709 100644
--- a/plugins.c
+++ b/plugins.c
@@ -163,6 +163,7 @@ static DB_functions_t deadbeef_api = {
.conf_remove_items = conf_remove_items,
// plugin communication
.plug_get_decoder_list = plug_get_decoder_list,
+ .plug_get_output_list = plug_get_output_list,
.plug_get_list = plug_get_list,
.plug_activate = plug_activate,
};
@@ -592,23 +593,7 @@ plug_load_all (void) {
g_output_plugins[numoutput] = NULL;
// select output plugin
- const char *outplugname = conf_get_str ("output_plugin", "alsa");
- for (int i = 0; g_output_plugins[i]; i++) {
- DB_output_t *p = g_output_plugins[i];
- if (!strcmp (p->plugin.name, outplugname)) {
- fprintf (stderr, "selected output plugin: %s\n", outplugname);
- output_plugin = p;
- break;
- }
- }
- if (!output_plugin) {
- output_plugin = g_output_plugins[0];
- }
- if (output_plugin) {
- fprintf (stderr, "selected output plugin: %s\n", output_plugin->plugin.name);
- conf_set_str ("output_plugin", output_plugin->plugin.name);
- }
- else {
+ if (plug_select_output () < 0) {
fprintf (stderr, "failed to find output plugin!\n");
exit (-1);
}
@@ -619,7 +604,9 @@ plug_unload_all (void) {
while (plugins) {
plugin_t *next = plugins->next;
if (plugins->plugin->stop) {
+ fprintf (stderr, "stopping %s...", plugins->plugin->name);
plugins->plugin->stop ();
+ fprintf (stderr, " [OK]\n");
}
if (plugins->handle) {
dlclose (plugins->handle);
@@ -627,6 +614,7 @@ plug_unload_all (void) {
plugins = next;
}
mutex_free (mutex);
+ fprintf (stderr, "all plugins had been unloaded\n");
}
struct DB_decoder_s **
@@ -634,6 +622,11 @@ plug_get_decoder_list (void) {
return g_decoder_plugins;
}
+struct DB_output_s **
+plug_get_output_list (void) {
+ return g_output_plugins;
+}
+
struct DB_vfs_s **
plug_get_vfs_list (void) {
return g_vfs_plugins;
@@ -688,3 +681,46 @@ DB_output_t *
plug_get_output (void) {
return output_plugin;
}
+
+int
+plug_select_output (void) {
+ const char *outplugname = conf_get_str ("output_plugin", "ALSA output plugin");
+ for (int i = 0; g_output_plugins[i]; i++) {
+ DB_output_t *p = g_output_plugins[i];
+ if (!strcmp (p->plugin.name, outplugname)) {
+ fprintf (stderr, "selected output plugin: %s\n", outplugname);
+ output_plugin = p;
+ break;
+ }
+ }
+ if (!output_plugin) {
+ output_plugin = g_output_plugins[0];
+ if (output_plugin) {
+ fprintf (stderr, "selected output plugin: %s\n", output_plugin->plugin.name);
+ conf_set_str ("output_plugin", output_plugin->plugin.name);
+ }
+ }
+ if (!output_plugin) {
+ return -1;
+ }
+ return 0;
+}
+
+void
+plug_reinit_sound (void) {
+ int state = p_get_state ();
+
+ p_free ();
+
+ DB_output_t *prev = plug_get_output ();
+ if (plug_select_output () < 0) {
+ const char *outplugname = conf_get_str ("output_plugin", "ALSA output plugin");
+ fprintf (stderr, "failed to select output plugin %s\nreverted to %s\n", outplugname, prev->plugin.name);
+ output_plugin = prev;
+ }
+ p_init ();
+
+ if (state != OUTPUT_STATE_PAUSED && state != OUTPUT_STATE_STOPPED) {
+ p_play ();
+ }
+}
diff --git a/plugins.h b/plugins.h
index cfa7df11..62b0ec89 100644
--- a/plugins.h
+++ b/plugins.h
@@ -91,6 +91,9 @@ plug_get_list (void);
struct DB_decoder_s **
plug_get_decoder_list (void);
+struct DB_output_s **
+plug_get_output_list (void);
+
struct DB_vfs_s **
plug_get_vfs_list (void);
@@ -109,4 +112,10 @@ plug_activate (DB_plugin_t *plug, int activate);
DB_output_t *
plug_get_output (void);
+void
+plug_reinit_sound (void);
+
+int
+plug_select_output (void);
+
#endif // __PLUGINS_H
diff --git a/plugins/alsa/alsa.c b/plugins/alsa/alsa.c
index 186a5f9d..26e5a0bb 100644
--- a/plugins/alsa/alsa.c
+++ b/plugins/alsa/alsa.c
@@ -609,7 +609,7 @@ static DB_output_t plugin = {
.plugin.version_minor = 1,
.plugin.nostop = 1,
.plugin.type = DB_PLUGIN_OUTPUT,
- .plugin.name = "alsa output plugin",
+ .plugin.name = "ALSA output plugin",
.plugin.descr = "plays sound through linux standard alsa library",
.plugin.author = "Alexey Yakovenko",
.plugin.email = "waker@users.sourceforge.net",
diff --git a/plugins/gtkui/callbacks.c b/plugins/gtkui/callbacks.c
index be2e7d12..1aa3d6b9 100644
--- a/plugins/gtkui/callbacks.c
+++ b/plugins/gtkui/callbacks.c
@@ -1368,17 +1368,31 @@ on_preferences_activate (GtkMenuItem *menuitem,
GtkWidget *w = prefwin = create_prefwin ();
gtk_window_set_transient_for (GTK_WINDOW (w), GTK_WINDOW (mainwin));
- // alsa_soundcard
+ GtkComboBox *combobox = NULL;;
+
+ // output plugin selection
+ const char *outplugname = deadbeef->conf_get_str ("output_plugin", "ALSA output plugin");
+ combobox = GTK_COMBO_BOX (lookup_widget (w, "pref_output_plugin"));
+
+ DB_output_t **out_plugs = deadbeef->plug_get_output_list ();
+ for (int i = 0; out_plugs[i]; i++) {
+ gtk_combo_box_append_text (combobox, out_plugs[i]->plugin.name);
+ if (!strcmp (outplugname, out_plugs[i]->plugin.name)) {
+ gtk_combo_box_set_active (combobox, i);
+ }
+ }
+
+ // soundcard (output device) selection
const char *s = deadbeef->conf_get_str ("alsa_soundcard", "default");
- GtkComboBox *combobox = GTK_COMBO_BOX (lookup_widget (w, "pref_soundcard"));
+ combobox = GTK_COMBO_BOX (lookup_widget (w, "pref_soundcard"));
gtk_combo_box_append_text (combobox, "Default Audio Device");
if (!strcmp (s, "default")) {
gtk_combo_box_set_active (combobox, 0);
}
num_alsa_devices = 1;
strcpy (alsa_device_names[0], "default");
- deadbeef->playback_enum_soundcards (gtk_enum_sound_callback, combobox);
+ deadbeef->get_output ()->enum_soundcards (gtk_enum_sound_callback, combobox);
// alsa resampling
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (lookup_widget (w, "pref_alsa_resampling")), deadbeef->conf_get_int ("alsa.resample", 0));
@@ -1462,6 +1476,33 @@ on_pref_soundcard_changed (GtkComboBox *combobox,
}
void
+on_pref_output_plugin_changed (GtkComboBox *combobox,
+ gpointer user_data)
+{
+ const char *outplugname = deadbeef->conf_get_str ("output_plugin", "ALSA output plugin");
+ int active = gtk_combo_box_get_active (combobox);
+
+ DB_output_t **out_plugs = deadbeef->plug_get_output_list ();
+ DB_output_t *prev = NULL;
+ DB_output_t *new = NULL;
+ for (int i = 0; out_plugs[i]; i++) {
+ if (!strcmp (out_plugs[i]->plugin.name, outplugname)) {
+ prev = out_plugs[i];
+ }
+ if (i == active) {
+ new = out_plugs[i];
+ }
+ }
+ if (!new) {
+ fprintf (stderr, "failed to find output plugin selected in preferences window\n");
+ }
+ else {
+ deadbeef->conf_set_str ("output_plugin", new->plugin.name);
+ deadbeef->sendmessage (M_REINIT_SOUND, 0, 0, 0);
+ }
+}
+
+void
on_pref_alsa_resampling_clicked (GtkButton *button,
gpointer user_data)
{
diff --git a/plugins/gtkui/callbacks.h b/plugins/gtkui/callbacks.h
index acf23a02..124dda58 100644
--- a/plugins/gtkui/callbacks.h
+++ b/plugins/gtkui/callbacks.h
@@ -701,3 +701,7 @@ gboolean
on_mainwin_window_state_event (GtkWidget *widget,
GdkEventWindowState *event,
gpointer user_data);
+
+void
+on_pref_output_plugin_changed (GtkComboBox *combobox,
+ gpointer user_data);
diff --git a/plugins/gtkui/deadbeef.glade b/plugins/gtkui/deadbeef.glade
index 9615d476..9f515e40 100644
--- a/plugins/gtkui/deadbeef.glade
+++ b/plugins/gtkui/deadbeef.glade
@@ -1356,16 +1356,16 @@
<widget class="GtkTable" id="table3">
<property name="border_width">3</property>
<property name="visible">True</property>
- <property name="n_rows">6</property>
+ <property name="n_rows">7</property>
<property name="n_columns">2</property>
<property name="homogeneous">False</property>
<property name="row_spacing">0</property>
<property name="column_spacing">3</property>
<child>
- <widget class="GtkLabel" id="label4">
+ <widget class="GtkLabel" id="label15">
<property name="visible">True</property>
- <property name="label" translatable="yes">Output device</property>
+ <property name="label" translatable="yes">Release ALSA while stopped</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
@@ -1383,17 +1383,17 @@
<packing>
<property name="left_attach">0</property>
<property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
+ <property name="top_attach">6</property>
+ <property name="bottom_attach">7</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child>
- <widget class="GtkLabel" id="label5">
+ <widget class="GtkLabel" id="label9">
<property name="visible">True</property>
- <property name="label" translatable="yes">Software ALSA resampling</property>
+ <property name="label" translatable="yes">Replaygain peak scale</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
@@ -1411,17 +1411,17 @@
<packing>
<property name="left_attach">0</property>
<property name="right_attach">1</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
+ <property name="top_attach">5</property>
+ <property name="bottom_attach">6</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child>
- <widget class="GtkLabel" id="label6">
+ <widget class="GtkLabel" id="label8">
<property name="visible">True</property>
- <property name="label" translatable="yes">SRC quality (libsamplerate)</property>
+ <property name="label" translatable="yes">Replaygain mode</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
@@ -1439,17 +1439,17 @@
<packing>
<property name="left_attach">0</property>
<property name="right_attach">1</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
+ <property name="top_attach">4</property>
+ <property name="bottom_attach">5</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child>
- <widget class="GtkLabel" id="label8">
+ <widget class="GtkLabel" id="label6">
<property name="visible">True</property>
- <property name="label" translatable="yes">Replaygain mode</property>
+ <property name="label" translatable="yes">SRC quality (libsamplerate)</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
@@ -1475,9 +1475,9 @@
</child>
<child>
- <widget class="GtkLabel" id="label9">
+ <widget class="GtkLabel" id="label5">
<property name="visible">True</property>
- <property name="label" translatable="yes">Replaygain peak scale</property>
+ <property name="label" translatable="yes">Software ALSA resampling</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
@@ -1495,17 +1495,17 @@
<packing>
<property name="left_attach">0</property>
<property name="right_attach">1</property>
- <property name="top_attach">4</property>
- <property name="bottom_attach">5</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child>
- <widget class="GtkLabel" id="label15">
+ <widget class="GtkLabel" id="label4">
<property name="visible">True</property>
- <property name="label" translatable="yes">Release ALSA while stopped</property>
+ <property name="label" translatable="yes">Output device</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
@@ -1523,37 +1523,59 @@
<packing>
<property name="left_attach">0</property>
<property name="right_attach">1</property>
- <property name="top_attach">5</property>
- <property name="bottom_attach">6</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child>
- <widget class="GtkCheckButton" id="pref_alsa_resampling">
+ <widget class="GtkLabel" id="label23">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes"></property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="label" translatable="yes">Output plugin</property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </widget>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="right_attach">1</property>
+ <property name="top_attach">0</property>
+ <property name="bottom_attach">1</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkComboBox" id="pref_soundcard">
+ <property name="visible">True</property>
+ <property name="add_tearoffs">False</property>
<property name="focus_on_click">True</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- <signal name="clicked" handler="on_pref_alsa_resampling_clicked" last_modification_time="Sat, 24 Oct 2009 16:50:34 GMT"/>
+ <signal name="changed" handler="on_pref_soundcard_changed" last_modification_time="Sat, 07 Nov 2009 14:12:28 GMT"/>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
- <property name="y_options"></property>
+ <property name="y_options">fill</property>
</packing>
</child>
<child>
- <widget class="GtkCheckButton" id="pref_replaygain_scale">
+ <widget class="GtkCheckButton" id="pref_alsa_resampling">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes"></property>
@@ -1563,19 +1585,19 @@
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
- <signal name="clicked" handler="on_pref_replaygain_scale_clicked" last_modification_time="Sat, 10 Oct 2009 18:52:10 GMT"/>
+ <signal name="clicked" handler="on_pref_alsa_resampling_clicked" last_modification_time="Sat, 24 Oct 2009 16:50:34 GMT"/>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
- <property name="top_attach">4</property>
- <property name="bottom_attach">5</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
<property name="y_options"></property>
</packing>
</child>
<child>
- <widget class="GtkCheckButton" id="pref_alsa_freewhenstopped">
+ <widget class="GtkCheckButton" id="pref_replaygain_scale">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes"></property>
@@ -1585,7 +1607,7 @@
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
- <signal name="clicked" handler="on_pref_alsa_freewhenstopped_clicked" last_modification_time="Sat, 07 Nov 2009 11:37:02 GMT"/>
+ <signal name="clicked" handler="on_pref_replaygain_scale_clicked" last_modification_time="Sat, 10 Oct 2009 18:52:10 GMT"/>
</widget>
<packing>
<property name="left_attach">1</property>
@@ -1597,18 +1619,24 @@
</child>
<child>
- <widget class="GtkComboBox" id="pref_soundcard">
+ <widget class="GtkCheckButton" id="pref_alsa_freewhenstopped">
<property name="visible">True</property>
- <property name="add_tearoffs">False</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes"></property>
+ <property name="use_underline">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
- <signal name="changed" handler="on_pref_soundcard_changed" last_modification_time="Sat, 07 Nov 2009 14:12:28 GMT"/>
+ <property name="active">False</property>
+ <property name="inconsistent">False</property>
+ <property name="draw_indicator">True</property>
+ <signal name="clicked" handler="on_pref_alsa_freewhenstopped_clicked" last_modification_time="Sat, 07 Nov 2009 11:37:02 GMT"/>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="y_options">fill</property>
+ <property name="top_attach">6</property>
+ <property name="bottom_attach">7</property>
+ <property name="y_options"></property>
</packing>
</child>
@@ -1627,8 +1655,8 @@ linear</property>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
<property name="y_options">fill</property>
</packing>
</child>
@@ -1646,8 +1674,25 @@ Album</property>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
+ <property name="top_attach">4</property>
+ <property name="bottom_attach">5</property>
+ <property name="y_options">fill</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkComboBox" id="pref_output_plugin">
+ <property name="visible">True</property>
+ <property name="add_tearoffs">False</property>
+ <property name="focus_on_click">True</property>
+ <signal name="changed" handler="on_pref_output_plugin_changed" last_modification_time="Fri, 11 Dec 2009 21:05:28 GMT"/>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">0</property>
+ <property name="bottom_attach">1</property>
+ <property name="x_options">fill</property>
<property name="y_options">fill</property>
</packing>
</child>
diff --git a/plugins/gtkui/interface.c b/plugins/gtkui/interface.c
index d3df2830..cf833cef 100644
--- a/plugins/gtkui/interface.c
+++ b/plugins/gtkui/interface.c
@@ -1154,18 +1154,20 @@ create_prefwin (void)
GtkWidget *prefwin;
GtkWidget *notebook2;
GtkWidget *table3;
- GtkWidget *label4;
- GtkWidget *label5;
- GtkWidget *label6;
- GtkWidget *label8;
- GtkWidget *label9;
GtkWidget *label15;
+ GtkWidget *label9;
+ GtkWidget *label8;
+ GtkWidget *label6;
+ GtkWidget *label5;
+ GtkWidget *label4;
+ GtkWidget *label23;
+ GtkWidget *pref_soundcard;
GtkWidget *pref_alsa_resampling;
GtkWidget *pref_replaygain_scale;
GtkWidget *pref_alsa_freewhenstopped;
- GtkWidget *pref_soundcard;
GtkWidget *pref_src_quality;
GtkWidget *pref_replaygain_mode;
+ GtkWidget *pref_output_plugin;
GtkWidget *Sound;
GtkWidget *table4;
GtkWidget *label7;
@@ -1205,81 +1207,88 @@ create_prefwin (void)
gtk_widget_show (notebook2);
gtk_container_add (GTK_CONTAINER (prefwin), notebook2);
- table3 = gtk_table_new (6, 2, FALSE);
+ table3 = gtk_table_new (7, 2, FALSE);
gtk_widget_show (table3);
gtk_container_add (GTK_CONTAINER (notebook2), table3);
gtk_container_set_border_width (GTK_CONTAINER (table3), 3);
gtk_table_set_col_spacings (GTK_TABLE (table3), 3);
- label4 = gtk_label_new ("Output device");
- gtk_widget_show (label4);
- gtk_table_attach (GTK_TABLE (table3), label4, 0, 1, 0, 1,
+ label15 = gtk_label_new ("Release ALSA while stopped");
+ gtk_widget_show (label15);
+ gtk_table_attach (GTK_TABLE (table3), label15, 0, 1, 6, 7,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
- gtk_misc_set_alignment (GTK_MISC (label4), 0, 0.5);
+ gtk_misc_set_alignment (GTK_MISC (label15), 0, 0.5);
- label5 = gtk_label_new ("Software ALSA resampling");
- gtk_widget_show (label5);
- gtk_table_attach (GTK_TABLE (table3), label5, 0, 1, 1, 2,
+ label9 = gtk_label_new ("Replaygain peak scale");
+ gtk_widget_show (label9);
+ gtk_table_attach (GTK_TABLE (table3), label9, 0, 1, 5, 6,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
- gtk_misc_set_alignment (GTK_MISC (label5), 0, 0.5);
+ gtk_misc_set_alignment (GTK_MISC (label9), 0, 0.5);
+
+ label8 = gtk_label_new ("Replaygain mode");
+ gtk_widget_show (label8);
+ gtk_table_attach (GTK_TABLE (table3), label8, 0, 1, 4, 5,
+ (GtkAttachOptions) (GTK_FILL),
+ (GtkAttachOptions) (0), 0, 0);
+ gtk_misc_set_alignment (GTK_MISC (label8), 0, 0.5);
label6 = gtk_label_new ("SRC quality (libsamplerate)");
gtk_widget_show (label6);
- gtk_table_attach (GTK_TABLE (table3), label6, 0, 1, 2, 3,
+ gtk_table_attach (GTK_TABLE (table3), label6, 0, 1, 3, 4,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
gtk_misc_set_alignment (GTK_MISC (label6), 0, 0.5);
- label8 = gtk_label_new ("Replaygain mode");
- gtk_widget_show (label8);
- gtk_table_attach (GTK_TABLE (table3), label8, 0, 1, 3, 4,
+ label5 = gtk_label_new ("Software ALSA resampling");
+ gtk_widget_show (label5);
+ gtk_table_attach (GTK_TABLE (table3), label5, 0, 1, 2, 3,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
- gtk_misc_set_alignment (GTK_MISC (label8), 0, 0.5);
+ gtk_misc_set_alignment (GTK_MISC (label5), 0, 0.5);
- label9 = gtk_label_new ("Replaygain peak scale");
- gtk_widget_show (label9);
- gtk_table_attach (GTK_TABLE (table3), label9, 0, 1, 4, 5,
+ label4 = gtk_label_new ("Output device");
+ gtk_widget_show (label4);
+ gtk_table_attach (GTK_TABLE (table3), label4, 0, 1, 1, 2,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
- gtk_misc_set_alignment (GTK_MISC (label9), 0, 0.5);
+ gtk_misc_set_alignment (GTK_MISC (label4), 0, 0.5);
- label15 = gtk_label_new ("Release ALSA while stopped");
- gtk_widget_show (label15);
- gtk_table_attach (GTK_TABLE (table3), label15, 0, 1, 5, 6,
+ label23 = gtk_label_new ("Output plugin");
+ gtk_widget_show (label23);
+ gtk_table_attach (GTK_TABLE (table3), label23, 0, 1, 0, 1,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
- gtk_misc_set_alignment (GTK_MISC (label15), 0, 0.5);
+ gtk_misc_set_alignment (GTK_MISC (label23), 0, 0.5);
+
+ pref_soundcard = gtk_combo_box_new_text ();
+ gtk_widget_show (pref_soundcard);
+ gtk_table_attach (GTK_TABLE (table3), pref_soundcard, 1, 2, 1, 2,
+ (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
+ (GtkAttachOptions) (GTK_FILL), 0, 0);
pref_alsa_resampling = gtk_check_button_new_with_mnemonic ("");
gtk_widget_show (pref_alsa_resampling);
- gtk_table_attach (GTK_TABLE (table3), pref_alsa_resampling, 1, 2, 1, 2,
+ gtk_table_attach (GTK_TABLE (table3), pref_alsa_resampling, 1, 2, 2, 3,
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
pref_replaygain_scale = gtk_check_button_new_with_mnemonic ("");
gtk_widget_show (pref_replaygain_scale);
- gtk_table_attach (GTK_TABLE (table3), pref_replaygain_scale, 1, 2, 4, 5,
+ gtk_table_attach (GTK_TABLE (table3), pref_replaygain_scale, 1, 2, 5, 6,
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
pref_alsa_freewhenstopped = gtk_check_button_new_with_mnemonic ("");
gtk_widget_show (pref_alsa_freewhenstopped);
- gtk_table_attach (GTK_TABLE (table3), pref_alsa_freewhenstopped, 1, 2, 5, 6,
+ gtk_table_attach (GTK_TABLE (table3), pref_alsa_freewhenstopped, 1, 2, 6, 7,
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
- pref_soundcard = gtk_combo_box_new_text ();
- gtk_widget_show (pref_soundcard);
- gtk_table_attach (GTK_TABLE (table3), pref_soundcard, 1, 2, 0, 1,
- (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
- (GtkAttachOptions) (GTK_FILL), 0, 0);
-
pref_src_quality = gtk_combo_box_new_text ();
gtk_widget_show (pref_src_quality);
- gtk_table_attach (GTK_TABLE (table3), pref_src_quality, 1, 2, 2, 3,
+ gtk_table_attach (GTK_TABLE (table3), pref_src_quality, 1, 2, 3, 4,
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
(GtkAttachOptions) (GTK_FILL), 0, 0);
gtk_combo_box_append_text (GTK_COMBO_BOX (pref_src_quality), "sinc_best_quality");
@@ -1290,13 +1299,19 @@ create_prefwin (void)
pref_replaygain_mode = gtk_combo_box_new_text ();
gtk_widget_show (pref_replaygain_mode);
- gtk_table_attach (GTK_TABLE (table3), pref_replaygain_mode, 1, 2, 3, 4,
+ gtk_table_attach (GTK_TABLE (table3), pref_replaygain_mode, 1, 2, 4, 5,
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
(GtkAttachOptions) (GTK_FILL), 0, 0);
gtk_combo_box_append_text (GTK_COMBO_BOX (pref_replaygain_mode), "Disable");
gtk_combo_box_append_text (GTK_COMBO_BOX (pref_replaygain_mode), "Track");
gtk_combo_box_append_text (GTK_COMBO_BOX (pref_replaygain_mode), "Album");
+ pref_output_plugin = gtk_combo_box_new_text ();
+ gtk_widget_show (pref_output_plugin);
+ gtk_table_attach (GTK_TABLE (table3), pref_output_plugin, 1, 2, 0, 1,
+ (GtkAttachOptions) (GTK_FILL),
+ (GtkAttachOptions) (GTK_FILL), 0, 0);
+
Sound = gtk_label_new ("Sound");
gtk_widget_show (Sound);
gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook2), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook2), 0), Sound);
@@ -1490,6 +1505,9 @@ create_prefwin (void)
g_signal_connect ((gpointer) prefwin, "key_press_event",
G_CALLBACK (on_prefwin_key_press_event),
NULL);
+ g_signal_connect ((gpointer) pref_soundcard, "changed",
+ G_CALLBACK (on_pref_soundcard_changed),
+ NULL);
g_signal_connect ((gpointer) pref_alsa_resampling, "clicked",
G_CALLBACK (on_pref_alsa_resampling_clicked),
NULL);
@@ -1499,15 +1517,15 @@ create_prefwin (void)
g_signal_connect ((gpointer) pref_alsa_freewhenstopped, "clicked",
G_CALLBACK (on_pref_alsa_freewhenstopped_clicked),
NULL);
- g_signal_connect ((gpointer) pref_soundcard, "changed",
- G_CALLBACK (on_pref_soundcard_changed),
- NULL);
g_signal_connect ((gpointer) pref_src_quality, "changed",
G_CALLBACK (on_pref_src_quality_changed),
NULL);
g_signal_connect ((gpointer) pref_replaygain_mode, "changed",
G_CALLBACK (on_pref_replaygain_mode_changed),
NULL);
+ g_signal_connect ((gpointer) pref_output_plugin, "changed",
+ G_CALLBACK (on_pref_output_plugin_changed),
+ NULL);
g_signal_connect ((gpointer) pref_close_send_to_tray, "clicked",
G_CALLBACK (on_pref_close_send_to_tray_clicked),
NULL);
@@ -1534,18 +1552,20 @@ create_prefwin (void)
GLADE_HOOKUP_OBJECT_NO_REF (prefwin, prefwin, "prefwin");
GLADE_HOOKUP_OBJECT (prefwin, notebook2, "notebook2");
GLADE_HOOKUP_OBJECT (prefwin, table3, "table3");
- GLADE_HOOKUP_OBJECT (prefwin, label4, "label4");
- GLADE_HOOKUP_OBJECT (prefwin, label5, "label5");
- GLADE_HOOKUP_OBJECT (prefwin, label6, "label6");
- GLADE_HOOKUP_OBJECT (prefwin, label8, "label8");
- GLADE_HOOKUP_OBJECT (prefwin, label9, "label9");
GLADE_HOOKUP_OBJECT (prefwin, label15, "label15");
+ GLADE_HOOKUP_OBJECT (prefwin, label9, "label9");
+ GLADE_HOOKUP_OBJECT (prefwin, label8, "label8");
+ GLADE_HOOKUP_OBJECT (prefwin, label6, "label6");
+ GLADE_HOOKUP_OBJECT (prefwin, label5, "label5");
+ GLADE_HOOKUP_OBJECT (prefwin, label4, "label4");
+ GLADE_HOOKUP_OBJECT (prefwin, label23, "label23");
+ GLADE_HOOKUP_OBJECT (prefwin, pref_soundcard, "pref_soundcard");
GLADE_HOOKUP_OBJECT (prefwin, pref_alsa_resampling, "pref_alsa_resampling");
GLADE_HOOKUP_OBJECT (prefwin, pref_replaygain_scale, "pref_replaygain_scale");
GLADE_HOOKUP_OBJECT (prefwin, pref_alsa_freewhenstopped, "pref_alsa_freewhenstopped");
- GLADE_HOOKUP_OBJECT (prefwin, pref_soundcard, "pref_soundcard");
GLADE_HOOKUP_OBJECT (prefwin, pref_src_quality, "pref_src_quality");
GLADE_HOOKUP_OBJECT (prefwin, pref_replaygain_mode, "pref_replaygain_mode");
+ GLADE_HOOKUP_OBJECT (prefwin, pref_output_plugin, "pref_output_plugin");
GLADE_HOOKUP_OBJECT (prefwin, Sound, "Sound");
GLADE_HOOKUP_OBJECT (prefwin, table4, "table4");
GLADE_HOOKUP_OBJECT (prefwin, label7, "label7");