summarylogtreecommitdiffstats
path: root/wmauda.patch
blob: 15d2f445157e3a3818162a2a9a8d8f362ec09a72 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
diff -up src/wmauda-0.9/Makefile.orig src/wmauda-0.9/Makefile
--- src/wmauda-0.9/Makefile.orig	2012-03-26 16:27:20.000000000 -0600
+++ src/wmauda-0.9/Makefile	2013-08-18 23:02:34.000000000 -0600
@@ -7,12 +7,15 @@ INSTALL_DIR	:= $(PREFIX)/bin
 PIXMAP_DIR	:= $(PREFIX)/share/pixmaps
 MANPAGE_DIR	:= $(PREFIX)/share/man/man1
 
-CFLAGS 	+= $(shell pkg-config audacious --cflags) $(shell pkg-config dbus-1 --cflags) -DPIXMAP_DIR="\"$(PIXMAP_DIR)\""
-LIBS 	:= $(shell pkg-config audacious --libs) $(shell pkg-config audclient --libs)  $(shell pkg-config dbus-1 --libs)
+CFLAGS 	+= $(shell pkg-config audacious2 --cflags) $(shell pkg-config dbus-1 --cflags) -DPIXMAP_DIR="\"$(PIXMAP_DIR)\""
+LIBS 	:= $(shell pkg-config audacious2 --libs) $(shell pkg-config audclient2 --libs)  $(shell pkg-config dbus-1 --libs)
 
 CFLAGS  += $(shell pkg-config gtk+-2.0 --cflags)
 LIBS    += $(shell pkg-config gtk+-2.0 --libs)
 
+CFLAGS  += $(shell pkg-config dbus-glib-1 --cflags)
+LIBS    += $(shell pkg-config dbus-glib-1 --libs) -lX11
+
 OBJS 	= wmauda.o
 HEADERS = dock-master.xpm
 
diff -up src/wmauda-0.9/wmauda.c.orig src/wmauda-0.9/wmauda.c
--- src/wmauda-0.9/wmauda.c.orig	2012-03-26 16:23:14.000000000 -0600
+++ src/wmauda-0.9/wmauda.c	2013-08-18 23:04:55.000000000 -0600
@@ -134,7 +134,7 @@ GdkBitmap *mask, *launch_mask;
 GdkGC *dock_gc;
 GtkTooltips *tooltips = NULL;
 
-char *xmms_cmd = "audacious";
+char *xmms_cmd = "audacious2";
 gboolean xmms_running = FALSE;
 
 gboolean has_geometry = FALSE, single_click = FALSE, song_title = FALSE;
@@ -151,33 +151,33 @@ GtkTargetEntry drop_types[] =
 
 void action_play(void)
 {
-	audacious_remote_play(dbus_proxy);
+	audacious2_remote_play(dbus_proxy);
 }
 
 void action_pause(void)
 {
-	audacious_remote_pause(dbus_proxy);
+	audacious2_remote_pause(dbus_proxy);
 }
 
 void action_eject(void)
 {
-	audacious_remote_playlist_clear(dbus_proxy);
-	audacious_remote_stop(dbus_proxy);
+	audacious2_remote_playlist_clear(dbus_proxy);
+	audacious2_remote_stop(dbus_proxy);
 }
 
 void action_prev(void)
 {
-	audacious_remote_playlist_prev(dbus_proxy);
+	audacious2_remote_playlist_prev(dbus_proxy);
 }
 
 void action_next(void)
 {
-	audacious_remote_playlist_next(dbus_proxy);
+	audacious2_remote_playlist_next(dbus_proxy);
 }
 
 void action_stop(void)
 {
-	audacious_remote_stop(dbus_proxy);
+	audacious2_remote_stop(dbus_proxy);
 }
 
 gboolean inside_region(int mx, int my, int x, int y, int w, int h)
@@ -260,11 +260,11 @@ void draw_seekslider(void)
 void real_draw_scrolltext(GdkWindow * w)
 {
         /* get titlestring */
-	gint pl_pos = audacious_remote_get_playlist_pos(dbus_proxy);
+	gint pl_pos = audacious2_remote_get_playlist_pos(dbus_proxy);
 
 	if (pl_pos != -1)
 	{
-	        char *title = audacious_remote_get_playlist_title(dbus_proxy, pl_pos);
+	        char *title = audacious2_remote_get_playlist_title(dbus_proxy, pl_pos);
 		if (title)
 		{
 		        /* render text */	
@@ -352,7 +352,7 @@ void wheel_scroll_cb(GtkWidget *w, GdkEv
 				volslider_pos = 0;
 			if (volslider_pos > VOLSLIDER_HEIGHT)
 				volslider_pos = VOLSLIDER_HEIGHT;
-			audacious_remote_set_main_volume(dbus_proxy, (volslider_pos * 100) / VOLSLIDER_HEIGHT);
+			audacious2_remote_set_main_volume(dbus_proxy, (volslider_pos * 100) / VOLSLIDER_HEIGHT);
 			draw_volslider();
 		}
 	}
@@ -368,10 +368,10 @@ void button_press_cb(GtkWidget *w, GdkEv
 	{
 		if ((event->button == 2) || (event->button == 3))
 		{
-			if(audacious_remote_is_main_win(dbus_proxy))
-				audacious_remote_main_win_toggle(dbus_proxy, FALSE);
+			if(audacious2_remote_is_main_win(dbus_proxy))
+				audacious2_remote_main_win_toggle(dbus_proxy, FALSE);
 			else
-				audacious_remote_main_win_toggle(dbus_proxy, TRUE);
+				audacious2_remote_main_win_toggle(dbus_proxy, TRUE);
 		}
 	}
 
@@ -392,7 +392,7 @@ void button_press_cb(GtkWidget *w, GdkEv
 		if (inside_region(event->x, event->y, VOLSLIDER_X, VOLSLIDER_Y, VOLSLIDER_WIDTH, VOLSLIDER_HEIGHT))
 		{
 			volslider_pos = VOLSLIDER_HEIGHT - (event->y - VOLSLIDER_Y);
-			audacious_remote_set_main_volume(dbus_proxy, (volslider_pos * 100) / VOLSLIDER_HEIGHT);
+			audacious2_remote_set_main_volume(dbus_proxy, (volslider_pos * 100) / VOLSLIDER_HEIGHT);
 			draw_volslider();
 			volslider_dragging = TRUE;
 		}
@@ -449,8 +449,8 @@ void button_release_cb(GtkWidget *w, Gdk
 	volslider_dragging = FALSE;
 	if (seekslider_dragging)
 	{
-		len = audacious_remote_get_playlist_time(dbus_proxy, audacious_remote_get_playlist_pos(dbus_proxy));
-		audacious_remote_jump_to_time(dbus_proxy, (seekslider_pos * len) / SEEKSLIDER_MAX);
+		len = audacious2_remote_get_playlist_time(dbus_proxy, audacious2_remote_get_playlist_pos(dbus_proxy));
+		audacious2_remote_jump_to_time(dbus_proxy, (seekslider_pos * len) / SEEKSLIDER_MAX);
 		seekslider_dragging = FALSE;
 	}
 
@@ -485,7 +485,7 @@ void motion_notify_cb(GtkWidget *w, GdkE
 			volslider_pos = 0;
 		if (volslider_pos > VOLSLIDER_HEIGHT)
 			volslider_pos = VOLSLIDER_HEIGHT;
-		audacious_remote_set_main_volume(dbus_proxy, (volslider_pos * 100) / VOLSLIDER_HEIGHT);
+		audacious2_remote_set_main_volume(dbus_proxy, (volslider_pos * 100) / VOLSLIDER_HEIGHT);
 		draw_volslider();
 	}
 	if (seekslider_dragging)
@@ -515,7 +515,7 @@ static void update_tooltip(void)
 	if (!tooltips)
 		return;
 	
-	new_pos = audacious_remote_get_playlist_pos(dbus_proxy);
+	new_pos = audacious2_remote_get_playlist_pos(dbus_proxy);
 
 	if (new_pos == 0)
 	{
@@ -523,7 +523,7 @@ static void update_tooltip(void)
 		 * Need to do some extra checking, as we get 0 also on
 		 * a empty playlist
 		 */
-		char *current = audacious_remote_get_playlist_file(dbus_proxy, 0);
+		char *current = audacious2_remote_get_playlist_file(dbus_proxy, 0);
 		if (!filename && current)
 		{
 			filename = current;
@@ -547,7 +547,7 @@ static void update_tooltip(void)
 	{
 		char *tip = NULL;
 		char *title =
-			audacious_remote_get_playlist_title(dbus_proxy, new_pos);
+			audacious2_remote_get_playlist_title(dbus_proxy, new_pos);
 		if (title)
 		{
 			tip = g_strdup_printf("%d. %s", new_pos+1, title);
@@ -564,7 +564,7 @@ int timeout_func(gpointer data)
 	int new_pos, pos;
 	gboolean playing, running;
 
-	running = audacious_remote_is_running(dbus_proxy);
+	running = audacious2_remote_is_running(dbus_proxy);
 
 	if (running)
 	{
@@ -576,7 +576,7 @@ int timeout_func(gpointer data)
 		}
 		if (!volslider_dragging)
 		{
-			new_pos = (audacious_remote_get_main_volume(dbus_proxy) * 40) / 100;
+			new_pos = (audacious2_remote_get_main_volume(dbus_proxy) * 40) / 100;
 
 			if (new_pos < 0)
 				new_pos = 0;
@@ -593,7 +593,7 @@ int timeout_func(gpointer data)
 		update_tooltip();
 		draw_scrolltext();
 
-		playing = audacious_remote_is_playing(dbus_proxy);
+		playing = audacious2_remote_is_playing(dbus_proxy);
 		if (!playing && seekslider_visible)
 		{
 			seekslider_visible = FALSE;
@@ -603,8 +603,8 @@ int timeout_func(gpointer data)
 		}
 		else if (playing)
 		{
-			int len, p = audacious_remote_get_playlist_pos(dbus_proxy);
-			len = audacious_remote_get_playlist_time(dbus_proxy, p);
+			int len, p = audacious2_remote_get_playlist_pos(dbus_proxy);
+			len = audacious2_remote_get_playlist_time(dbus_proxy, p);
 			if (len == -1)
 			{
 				seekslider_visible = FALSE;
@@ -615,7 +615,7 @@ int timeout_func(gpointer data)
 			else if (!seekslider_dragging)
 			{
 				seekslider_visible = TRUE;
-				pos = audacious_remote_get_output_time(dbus_proxy);
+				pos = audacious2_remote_get_output_time(dbus_proxy);
 				if (len != 0)
 					new_pos = (pos * SEEKSLIDER_MAX) / len;
 				else
@@ -654,9 +654,9 @@ void drag_data_received(GtkWidget *widge
 	if (selection_data->data)
 	{
 		char *url = selection_data->data;
-		audacious_remote_playlist_clear(dbus_proxy);
-		audacious_remote_playlist_add_url_string(dbus_proxy, url);
-		audacious_remote_play(dbus_proxy);
+		audacious2_remote_playlist_clear(dbus_proxy);
+		audacious2_remote_playlist_add_url_string(dbus_proxy, url);
+		audacious2_remote_play(dbus_proxy);
 	}
 }