# HG changeset patch # User mf0102 <0102@gmx.at> # Date 1215464519 -7200 # Node ID 7375fa718dd80be4654bd0d00953b7436213d609 # Parent 736e981747d829a1af3b3bb2887e5fe47d7879c7 made new equalizer interface that doesn't imply a connection with the UI diff -r 736e981747d8 -r 7375fa718dd8 src/audacious/Makefile --- 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 \ diff -r 736e981747d8 -r 7375fa718dd8 src/audacious/dbus.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 +#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; } diff -r 736e981747d8 -r 7375fa718dd8 src/audacious/equalizer.c --- /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 . + * + * 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); +} diff -r 736e981747d8 -r 7375fa718dd8 src/audacious/equalizer.h --- /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 . + * + * 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 + +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 diff -r 736e981747d8 -r 7375fa718dd8 src/audacious/legacy/ui_equalizer.c --- 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; diff -r 736e981747d8 -r 7375fa718dd8 src/audacious/legacy/ui_equalizer.h --- 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 */