updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / mpcstick / mpcstick-0.10.2-kru.patch
blobc1f8e791f81ce8e01563de757a04977a8b2e07ab
1 --- ../mpcstickorig-0.10.2/mpcstick-0.10.2/src/mpcstick.c 2004-04-14 17:11:53.000000000 +0200
2 +++ src/mpcstick.c 2007-09-02 13:59:14.000000000 +0200
3 @@ -45,7 +45,7 @@
4 #include <errno.h>
6 #define PACKAGE "mpcstick"
7 -#define VERSION "0.10.2"
8 +#define VERSION "0.10.2-kru"
10 #include "libmpdclient.h"
12 @@ -57,6 +57,9 @@ gboolean mpc_previous();
13 gboolean mpc_next();
14 gboolean mpc_volume_up();
15 gboolean mpc_volume_down();
16 +gboolean mpc_mute();
17 +gboolean mpc_repeat();
18 +gboolean mpc_random();
19 gboolean mpc_playpause();
20 gboolean mpc_stop();
21 gboolean mpc_seek_left();
22 @@ -78,7 +81,8 @@ enum {
23 JS_BUTTON_7 = 2048,
24 JS_BUTTON_8 = 4096,
25 JS_BUTTON_9 = 8192,
26 - JS_BUTTON_10 = 16384
27 + JS_BUTTON_10 = 16384,
28 + JS_BUTTON_11 = 32768
31 enum {
32 @@ -97,6 +101,9 @@ js_function_table function_table[] = {
33 "next", mpc_next,
34 "volume_up", mpc_volume_up,
35 "volume_down", mpc_volume_down,
36 + "mute", mpc_mute,
37 + "random", mpc_random,
38 + "repeat", mpc_repeat,
39 "playpause", mpc_playpause,
40 "stop", mpc_stop,
41 "seek_left", mpc_seek_left,
42 @@ -125,6 +132,7 @@ js_button_table button_table[] = {
43 "JS_BUTTON_8", JS_BUTTON_8,
44 "JS_BUTTON_9", JS_BUTTON_9,
45 "JS_BUTTON_10", JS_BUTTON_10,
46 + "JS_BUTTON_11", JS_BUTTON_11,
47 NULL, JS_BUTTON_NONE
50 @@ -276,6 +284,7 @@ void joystick_listen(gchar *joy_dev_path
51 case 7: pressed_button = JS_BUTTON_8; break;
52 case 8: pressed_button = JS_BUTTON_9; break;
53 case 9: pressed_button = JS_BUTTON_10; break;
54 + case 10:pressed_button = JS_BUTTON_11; break;
55 default: pressed_button = JS_BUTTON_NONE; break;
58 @@ -372,6 +381,44 @@ gboolean mpc_next()
59 return TRUE;
62 +gboolean mpc_random()
64 + ASSERT_CONNECTION;
65 + PING_WAIT;
67 + mpc_get_status();
68 + if(status->random == 0)
69 + {
70 + mpd_sendRandomCommand(conn, 1);
71 + }
72 + else
73 + {
74 + mpd_sendRandomCommand(conn, 0);
75 + }
76 + mpd_finishCommand(conn);
78 + return TRUE;
81 +gboolean mpc_repeat()
83 + ASSERT_CONNECTION;
84 + PING_WAIT;
86 + mpc_get_status();
87 + if(status->repeat == 0)
88 + {
89 + mpd_sendRepeatCommand(conn, 1);
90 + }
91 + else
92 + {
93 + mpd_sendRepeatCommand(conn, 0);
94 + }
95 + mpd_finishCommand(conn);
97 + return TRUE;
100 gboolean mpc_volume_up()
102 ASSERT_CONNECTION;
103 @@ -396,6 +443,26 @@ gboolean mpc_volume_down()
104 return TRUE;
107 +gboolean mpc_mute()
109 + ASSERT_CONNECTION;
110 + PING_WAIT;
112 + gint *unmute = status->volume;
113 + mpc_get_status();
114 + if(status->volume == 0)
116 + mpd_sendSetvolCommand(conn, unmute);
118 + else
120 + mpd_sendSetvolCommand(conn, 0);
122 + mpd_finishCommand(conn);
123 + printf("vol: %d \n", unmute);
124 + return TRUE;
127 gboolean mpc_playpause()
129 gint index = 0;
130 --- ../mpcstickorig-0.10.2/mpcstick-0.10.2/mpcstick.conf 2004-04-14 02:01:50.000000000 +0200
131 +++ mpcstick.conf 2007-09-02 01:14:17.000000000 +0200
132 @@ -1,7 +1,7 @@
133 [general]
135 server_addr = localhost
136 -server_port = 2100
137 +server_port = 6600
138 server_timeout = 25
140 js_device = /dev/input/js0
141 @@ -19,6 +19,10 @@ JS_AXIS_DOWN = volume_down
142 JS_BUTTON_3 = playpause
143 JS_BUTTON_4 = stop
145 +JS_BUTTON_5 = repeat
146 +JS_BUTTON_6 = random
147 +JS_BUTTON_7 = mute
149 JS_BUTTON_2 | JS_AXIS_LEFT = seek_left
150 JS_BUTTON_2 | JS_AXIS_RIGHT = seek_right
152 --- ../mpcstickorig-0.10.2/mpcstick-0.10.2/configure.in 2004-04-14 17:09:06.000000000 +0200
153 +++ configure.in 2007-09-01 20:53:13.000000000 +0200
154 @@ -1,5 +1,5 @@
155 AC_INIT(configure.in)
156 -AM_INIT_AUTOMAKE(mpcstick, "0.10.2", aaron@aaronbock.net)
157 +AM_INIT_AUTOMAKE(mpcstick, "0.10.2-kru", aaron@aaronbock.net)
159 AC_PROG_CC
160 AC_PROG_INSTALL