Mercurial > audlegacy
annotate src/audlegacy/equalizer.c @ 4872:9501ad351ac0
When deleting last playlist, set title to "Untitled Playlist", as for a new one.
author | John Lindgren <john.lindgren@tds.net> |
---|---|
date | Sun, 26 Apr 2009 04:34:53 -0400 |
parents | 8ebd8358de04 |
children |
rev | line source |
---|---|
4706
7375fa718dd8
made new equalizer interface that doesn't imply a connection with the UI
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1 /* Audacious - Cross-platform multimedia player |
7375fa718dd8
made new equalizer interface that doesn't imply a connection with the UI
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
2 * Copyright (C) 2005-2008 Audacious development team. |
7375fa718dd8
made new equalizer interface that doesn't imply a connection with the UI
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
3 * |
7375fa718dd8
made new equalizer interface that doesn't imply a connection with the UI
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
4 * This program is free software; you can redistribute it and/or modify |
7375fa718dd8
made new equalizer interface that doesn't imply a connection with the UI
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
5 * it under the terms of the GNU General Public License as published by |
7375fa718dd8
made new equalizer interface that doesn't imply a connection with the UI
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
6 * the Free Software Foundation; under version 3 of the License. |
7375fa718dd8
made new equalizer interface that doesn't imply a connection with the UI
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
7 * |
7375fa718dd8
made new equalizer interface that doesn't imply a connection with the UI
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
8 * This program is distributed in the hope that it will be useful, |
7375fa718dd8
made new equalizer interface that doesn't imply a connection with the UI
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
7375fa718dd8
made new equalizer interface that doesn't imply a connection with the UI
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
7375fa718dd8
made new equalizer interface that doesn't imply a connection with the UI
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
11 * GNU General Public License for more details. |
7375fa718dd8
made new equalizer interface that doesn't imply a connection with the UI
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
12 * |
7375fa718dd8
made new equalizer interface that doesn't imply a connection with the UI
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
13 * You should have received a copy of the GNU General Public License |
7375fa718dd8
made new equalizer interface that doesn't imply a connection with the UI
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
14 * along with this program. If not, see <http://www.gnu.org/licenses>. |
7375fa718dd8
made new equalizer interface that doesn't imply a connection with the UI
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
15 * |
7375fa718dd8
made new equalizer interface that doesn't imply a connection with the UI
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
16 * The Audacious team does not consider modular code linking to |
7375fa718dd8
made new equalizer interface that doesn't imply a connection with the UI
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
17 * Audacious or using our public API to be a derived work. |
7375fa718dd8
made new equalizer interface that doesn't imply a connection with the UI
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
18 */ |
7375fa718dd8
made new equalizer interface that doesn't imply a connection with the UI
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
19 |
7375fa718dd8
made new equalizer interface that doesn't imply a connection with the UI
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
20 #include "equalizer.h" |
4848
b2ee645f3e59
Hook up the equalizer (bug #24)
John Lindgren <john.lindgren@tds.net>
parents:
4829
diff
changeset
|
21 #include "hook.h" |
4829
e286934cd9f2
-equalizer.c:34: warning: implicit declaration of function ¡Æoutput_set_eq¡Ç
Tony Vroon <chainsaw@gentoo.org>
parents:
4811
diff
changeset
|
22 #include "output.h" |
4706
7375fa718dd8
made new equalizer interface that doesn't imply a connection with the UI
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
23 |
4718 | 24 #include "audconfig.h" |
4706
7375fa718dd8
made new equalizer interface that doesn't imply a connection with the UI
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
25 #include "legacy/ui_equalizer.h" |
7375fa718dd8
made new equalizer interface that doesn't imply a connection with the UI
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
26 |
4848
b2ee645f3e59
Hook up the equalizer (bug #24)
John Lindgren <john.lindgren@tds.net>
parents:
4829
diff
changeset
|
27 static void change_equalizer (void) { |
b2ee645f3e59
Hook up the equalizer (bug #24)
John Lindgren <john.lindgren@tds.net>
parents:
4829
diff
changeset
|
28 output_set_eq (cfg.equalizer_active, cfg.equalizer_preamp, |
b2ee645f3e59
Hook up the equalizer (bug #24)
John Lindgren <john.lindgren@tds.net>
parents:
4829
diff
changeset
|
29 cfg.equalizer_bands); |
b2ee645f3e59
Hook up the equalizer (bug #24)
John Lindgren <john.lindgren@tds.net>
parents:
4829
diff
changeset
|
30 } |
b2ee645f3e59
Hook up the equalizer (bug #24)
John Lindgren <john.lindgren@tds.net>
parents:
4829
diff
changeset
|
31 |
b2ee645f3e59
Hook up the equalizer (bug #24)
John Lindgren <john.lindgren@tds.net>
parents:
4829
diff
changeset
|
32 void init_equalizer (void) { |
b2ee645f3e59
Hook up the equalizer (bug #24)
John Lindgren <john.lindgren@tds.net>
parents:
4829
diff
changeset
|
33 hook_register ("equalizer changed"); |
b2ee645f3e59
Hook up the equalizer (bug #24)
John Lindgren <john.lindgren@tds.net>
parents:
4829
diff
changeset
|
34 if (hook_associate ("equalizer changed", (HookFunction) change_equalizer, 0)) |
b2ee645f3e59
Hook up the equalizer (bug #24)
John Lindgren <john.lindgren@tds.net>
parents:
4829
diff
changeset
|
35 abort (); |
b2ee645f3e59
Hook up the equalizer (bug #24)
John Lindgren <john.lindgren@tds.net>
parents:
4829
diff
changeset
|
36 } |
b2ee645f3e59
Hook up the equalizer (bug #24)
John Lindgren <john.lindgren@tds.net>
parents:
4829
diff
changeset
|
37 |
4718 | 38 gfloat |
39 equalizer_get_preamp(void) | |
40 { | |
41 return equalizerwin_get_preamp(); | |
42 } | |
43 | |
4706
7375fa718dd8
made new equalizer interface that doesn't imply a connection with the UI
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
44 void |
7375fa718dd8
made new equalizer interface that doesn't imply a connection with the UI
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
45 equalizer_set_preamp(gfloat preamp) |
7375fa718dd8
made new equalizer interface that doesn't imply a connection with the UI
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
46 { |
7375fa718dd8
made new equalizer interface that doesn't imply a connection with the UI
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
47 equalizerwin_set_preamp(preamp); |
7375fa718dd8
made new equalizer interface that doesn't imply a connection with the UI
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
48 } |
7375fa718dd8
made new equalizer interface that doesn't imply a connection with the UI
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
49 |
7375fa718dd8
made new equalizer interface that doesn't imply a connection with the UI
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
50 gfloat |
7375fa718dd8
made new equalizer interface that doesn't imply a connection with the UI
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
51 equalizer_get_band(gint band) |
7375fa718dd8
made new equalizer interface that doesn't imply a connection with the UI
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
52 { |
7375fa718dd8
made new equalizer interface that doesn't imply a connection with the UI
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
53 return equalizerwin_get_band(band); |
7375fa718dd8
made new equalizer interface that doesn't imply a connection with the UI
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
54 } |
7375fa718dd8
made new equalizer interface that doesn't imply a connection with the UI
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
55 |
7375fa718dd8
made new equalizer interface that doesn't imply a connection with the UI
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
56 void |
4718 | 57 equalizer_set_band(gint band, gfloat value) |
58 { | |
59 equalizerwin_set_band(band, value); | |
60 } | |
61 | |
62 gboolean equalizer_get_active(gboolean active) | |
63 { | |
64 return cfg.equalizer_active; | |
65 } | |
66 | |
67 void | |
68 equalizer_set_active(gboolean active) | |
4706
7375fa718dd8
made new equalizer interface that doesn't imply a connection with the UI
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
69 { |
7375fa718dd8
made new equalizer interface that doesn't imply a connection with the UI
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
70 equalizerwin_activate(active); |
7375fa718dd8
made new equalizer interface that doesn't imply a connection with the UI
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
71 } |