annotate src/audtool/handlers_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 8a7752f1c662
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4074
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
1 /*
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
2 * Audtool2
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
3 * Copyright (c) 2007 Audacious development team
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
4 *
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
5 * Redistribution and use in source and binary forms, with or without
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
6 * modification, are permitted provided that the following conditions are
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
7 * met:
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
8 *
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
9 * 1. Redistributions of source code must retain the above copyright notice,
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
10 * this list of conditions and the following disclaimer.
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
11 *
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
12 * 2. Redistributions in binary form must reproduce the above copyright
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
13 * notice, this list of conditions and the following disclaimer in the
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
14 * documentation and/or other materials provided with the distribution.
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
15 *
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
16 * 3. The name of the author may not be used to endorse or promote products
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
17 * derived from this software without specific prior written permission.
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
18 *
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
19 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
20 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
21 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
22 * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
23 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
24 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
25 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
27 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
28 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
29 * POSSIBILITY OF SUCH DAMAGE.
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
30 */
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
31
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
32 #include <stdlib.h>
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
33 #include <string.h>
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
34 #include <glib.h>
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
35 #include <mowgli.h>
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
36 #include <locale.h>
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
37 #include "libaudclient/audctrl.h"
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
38 #include "audtool.h"
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
39
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
40 void equalizer_get_eq(gint argc, gchar **argv)
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
41 {
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
42 double preamp;
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
43 GArray *bands;
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
44 int i;
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
45
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
46 audacious_remote_get_eq(dbus_proxy, &preamp, &bands);
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
47
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
48 audtool_report("preamp = %.2f", preamp);
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
49 for(i=0; i<10; i++){
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
50 printf("%.2f ", g_array_index(bands, gdouble, i));
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
51 }
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
52 printf("\n");
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
53 g_array_free(bands, TRUE);
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
54 }
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
55
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
56 void equalizer_get_eq_preamp(gint argc, gchar **argv)
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
57 {
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
58 audtool_report("preamp = %.2f", audacious_remote_get_eq_preamp(dbus_proxy));
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
59 }
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
60
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
61 void equalizer_get_eq_band(gint argc, gchar **argv)
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
62 {
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
63 int band;
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
64
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
65 if (argc < 2)
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
66 {
4611
895297e46ee3 Cure some 'repetitive code syndromes' from audtool.
Matti Hamalainen <ccr@tnsp.org>
parents: 4074
diff changeset
67 audtool_whine_args(argv[0], "<band>");
4074
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
68 exit(1);
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
69 }
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
70
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
71 band = atoi(argv[1]);
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
72
4611
895297e46ee3 Cure some 'repetitive code syndromes' from audtool.
Matti Hamalainen <ccr@tnsp.org>
parents: 4074
diff changeset
73 /* FIXME, XXX, TODO: we should have a function for requesting
895297e46ee3 Cure some 'repetitive code syndromes' from audtool.
Matti Hamalainen <ccr@tnsp.org>
parents: 4074
diff changeset
74 * the actual number of bands, if we support dynamic amount some day ...
895297e46ee3 Cure some 'repetitive code syndromes' from audtool.
Matti Hamalainen <ccr@tnsp.org>
parents: 4074
diff changeset
75 * -- ccr
895297e46ee3 Cure some 'repetitive code syndromes' from audtool.
Matti Hamalainen <ccr@tnsp.org>
parents: 4074
diff changeset
76 */
4074
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
77 if (band < 0 || band > 9)
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
78 {
4611
895297e46ee3 Cure some 'repetitive code syndromes' from audtool.
Matti Hamalainen <ccr@tnsp.org>
parents: 4074
diff changeset
79 audtool_whine("band number out of range\n");
4074
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
80 exit(1);
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
81 }
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
82
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
83 audtool_report("band %d = %.2f", band, audacious_remote_get_eq_band(dbus_proxy, band));
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
84
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
85 }
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
86
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
87 void equalizer_set_eq(gint argc, gchar **argv)
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
88 {
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
89 gdouble preamp;
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
90 GArray *bands = g_array_sized_new(FALSE, FALSE, sizeof(gdouble), 10);
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
91 int i;
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
92
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
93 if (argc < 12)
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
94 {
4611
895297e46ee3 Cure some 'repetitive code syndromes' from audtool.
Matti Hamalainen <ccr@tnsp.org>
parents: 4074
diff changeset
95 audtool_whine_args(argv[0], "<preamp> <band0> <band1> <band2> <band3> <band4> <band5> <band6> <band7> <band8> <band9>");
4074
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
96 exit(1);
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
97 }
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
98
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
99 preamp = atof(argv[1]);
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
100
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
101 for(i=0; i<10; i++){
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
102 gdouble val = atof(argv[i+2]);
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
103 g_array_append_val(bands, val);
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
104 }
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
105
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
106 audacious_remote_set_eq(dbus_proxy, preamp, bands);
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
107 }
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
108
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
109 void equalizer_set_eq_preamp(gint argc, gchar **argv)
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
110 {
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
111 gdouble preamp;
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
112
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
113 if (argc < 2)
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
114 {
4611
895297e46ee3 Cure some 'repetitive code syndromes' from audtool.
Matti Hamalainen <ccr@tnsp.org>
parents: 4074
diff changeset
115 audtool_whine_args(argv[0], "<preamp>");
4074
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
116 exit(1);
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
117 }
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
118
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
119 preamp = atof(argv[1]);
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
120
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
121 audacious_remote_set_eq_preamp(dbus_proxy, preamp);
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
122 }
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
123
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
124 void equalizer_set_eq_band(gint argc, gchar **argv)
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
125 {
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
126 int band;
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
127 gdouble preamp;
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
128
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
129 if (argc < 3)
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
130 {
4611
895297e46ee3 Cure some 'repetitive code syndromes' from audtool.
Matti Hamalainen <ccr@tnsp.org>
parents: 4074
diff changeset
131 audtool_whine_args(argv[0], "<band> <value>");
4074
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
132 exit(1);
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
133 }
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
134
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
135 band = atoi(argv[1]);
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
136 preamp = atof(argv[2]);
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
137
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
138 audacious_remote_set_eq_band(dbus_proxy, band, preamp);
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
139 }
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
140
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
141 void equalizer_active(gint argc, gchar **argv)
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
142 {
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
143 if (argc < 2)
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
144 {
4611
895297e46ee3 Cure some 'repetitive code syndromes' from audtool.
Matti Hamalainen <ccr@tnsp.org>
parents: 4074
diff changeset
145 audtool_whine_args(argv[0], "<on/off>");
4074
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
146 exit(1);
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
147 }
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
148
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
149 if (!g_ascii_strcasecmp(argv[1], "on")) {
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
150 audacious_remote_eq_activate(dbus_proxy, TRUE);
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
151 }
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
152 else if (!g_ascii_strcasecmp(argv[1], "off")) {
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
153 audacious_remote_eq_activate(dbus_proxy, FALSE);
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
154 }
ea194fd79267 audtool maintenance:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
155 }