changeset 4706:7375fa718dd8

made new equalizer interface that doesn't imply a connection with the UI
author mf0102 <0102@gmx.at>
date Mon, 07 Jul 2008 23:01:59 +0200
parents 736e981747d8
children 512217ec24cc
files src/audacious/Makefile src/audacious/dbus.c src/audacious/equalizer.c src/audacious/equalizer.h src/audacious/legacy/ui_equalizer.c src/audacious/legacy/ui_equalizer.h
diffstat 6 files changed, 101 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/src/audacious/Makefile	Mon Jul 07 22:28:30 2008 +0200
+++ b/src/audacious/Makefile	Mon Jul 07 23:01:59 2008 +0200
@@ -12,8 +12,9 @@
        discovery.c								\
        dnd.c									\
        effect.c									\
+       equalizer.c								\
        equalizer_flow.c							\
-       equalizer_preset.c							\
+       equalizer_preset.c						\
        eventqueue.c								\
        fft.c									\
        flow.c									\
--- a/src/audacious/dbus.c	Mon Jul 07 22:28:30 2008 +0200
+++ b/src/audacious/dbus.c	Mon Jul 07 23:01:59 2008 +0200
@@ -32,14 +32,13 @@
 #include "dbus-server-bindings.h"
 
 #include <math.h>
+#include "equalizer.h"
+#include "input.h"
 #include "main.h"
-#include "input.h"
 #include "playback.h"
 #include "playlist.h"
+#include "strings.h"
 #include "tuple.h"
-#include "strings.h"
-
-#include "legacy/ui_equalizer.h"
 
 static DBusGConnection *dbus_conn = NULL;
 static guint signals[LAST_SIG] = { 0 };
@@ -928,11 +927,11 @@
 {
     int i;
 
-    *preamp = (gdouble)equalizerwin_get_preamp();
+    *preamp = (gdouble)equalizer_get_preamp();
     *bands = g_array_sized_new(FALSE, FALSE, sizeof(gdouble), AUD_EQUALIZER_NBANDS);
 
     for(i=0; i < AUD_EQUALIZER_NBANDS; i++){
-        gdouble val = (gdouble)equalizerwin_get_band(i);
+        gdouble val = (gdouble)equalizer_get_band(i);
         g_array_append_val(*bands, val);
     }
 
@@ -941,13 +940,13 @@
 
 gboolean audacious_rc_get_eq_preamp(RemoteObject *obj, gdouble *preamp, GError **error)
 {
-    *preamp = (gdouble)equalizerwin_get_preamp();
+    *preamp = (gdouble)equalizer_get_preamp();
     return TRUE;
 }
 
 gboolean audacious_rc_get_eq_band(RemoteObject *obj, gint band, gdouble *value, GError **error)
 {
-    *value = (gdouble)equalizerwin_get_band(band);
+    *value = (gdouble)equalizer_get_band(band);
     return TRUE;
 }
 
@@ -956,28 +955,25 @@
     gdouble element;
     int i;
     
-    equalizerwin_set_preamp((gfloat)preamp);
+    equalizer_set_preamp((gfloat)preamp);
 
     for (i = 0; i < AUD_EQUALIZER_NBANDS; i++) {
         element = g_array_index(bands, gdouble, i);
-        equalizerwin_set_band(i, (gfloat)element);
+        equalizer_set_band(i, (gfloat)element);
     }
-    equalizerwin_eq_changed();
 
     return TRUE;
 }
 
 gboolean audacious_rc_set_eq_preamp(RemoteObject *obj, gdouble preamp, GError **error)
 {
-    equalizerwin_set_preamp((gfloat)preamp);
-    equalizerwin_eq_changed();
+    equalizer_set_preamp((gfloat)preamp);
     return TRUE;
 }
 
 gboolean audacious_rc_set_eq_band(RemoteObject *obj, gint band, gdouble value, GError **error)
 {
-    equalizerwin_set_band(band, (gfloat)value);
-    equalizerwin_eq_changed();
+    equalizer_set_band(band, (gfloat)value);
     return TRUE;
 }
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/audacious/equalizer.c	Mon Jul 07 23:01:59 2008 +0200
@@ -0,0 +1,54 @@
+/*  Audacious - Cross-platform multimedia player
+ *  Copyright (C) 2005-2008  Audacious development team.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; under version 3 of the License.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program.  If not, see <http://www.gnu.org/licenses>.
+ *
+ *  The Audacious team does not consider modular code linking to
+ *  Audacious or using our public API to be a derived work.
+ */
+
+#include "equalizer.h"
+
+#include "legacy/ui_equalizer.h"
+
+void
+equalizer_set_preamp(gfloat preamp)
+{
+    equalizerwin_set_preamp(preamp);
+    equalizerwin_eq_changed();
+}
+
+void
+equalizer_set_band(gint band, gfloat value)
+{
+    equalizerwin_set_band(band, value);
+    equalizerwin_eq_changed();
+}
+
+gfloat
+equalizer_get_preamp(void)
+{
+    return equalizerwin_get_preamp();
+}
+
+gfloat
+equalizer_get_band(gint band)
+{
+    return equalizerwin_get_band(band);
+}
+
+void
+equalizer_activate(gboolean active)
+{
+    equalizerwin_activate(active);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/audacious/equalizer.h	Mon Jul 07 23:01:59 2008 +0200
@@ -0,0 +1,32 @@
+/*  Audacious - Cross-platform multimedia player
+ *  Copyright (C) 2005-2008  Audacious development team.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; under version 3 of the License.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program.  If not, see <http://www.gnu.org/licenses>.
+ *
+ *  The Audacious team does not consider modular code linking to
+ *  Audacious or using our public API to be a derived work.
+ */
+
+#ifndef AUDACIOUS_EQUALIZER_H
+#define AUDACIOUS_EQUALIZER_H
+
+#include <glib.h>
+
+void equalizer_set_preamp(gfloat preamp);
+void equalizer_set_band(gint band, gfloat value);
+gfloat equalizer_get_preamp(void);
+gfloat equalizer_get_band(gint band);
+
+void equalizer_activate(gboolean active);
+
+#endif
--- a/src/audacious/legacy/ui_equalizer.c	Mon Jul 07 22:28:30 2008 +0200
+++ b/src/audacious/legacy/ui_equalizer.c	Mon Jul 07 23:01:59 2008 +0200
@@ -1350,7 +1350,7 @@
 }
 
 void
-equalizer_activate(gboolean active)
+equalizerwin_activate(gboolean active)
 {
     cfg.equalizer_active = active;
     UI_SKINNED_BUTTON(equalizerwin_on)->inside = active;
--- a/src/audacious/legacy/ui_equalizer.h	Mon Jul 07 22:28:30 2008 +0200
+++ b/src/audacious/legacy/ui_equalizer.h	Mon Jul 07 23:01:59 2008 +0200
@@ -63,6 +63,6 @@
 extern GtkWidget *equalizerwin_graph;
 extern gboolean equalizerwin_focus;
 
-void equalizer_activate(gboolean active);
+void equalizerwin_activate(gboolean active);
 
 #endif /* AUDACIOUS_UI_EQUALIZER_H */