Mercurial > audlegacy
comparison src/audtool/audtool_handlers_playqueue.c @ 3867:e48f2f4c116d
- many remained audacious remote functions have been implemented.
- audtool improvement in progress.
author | Yoshiki Yazawa <yaz@cc.rim.or.jp> |
---|---|
date | Mon, 29 Oct 2007 22:21:42 +0900 |
parents | 7be518cc8e60 |
children | f3341c2d6b9e |
comparison
equal
deleted
inserted
replaced
3866:5c5f56a710d1 | 3867:e48f2f4c116d |
---|---|
99 if (i < 1 || i > audacious_remote_get_playlist_length(dbus_proxy)) | 99 if (i < 1 || i > audacious_remote_get_playlist_length(dbus_proxy)) |
100 { | 100 { |
101 audtool_whine("invalid playlist position %d", i); | 101 audtool_whine("invalid playlist position %d", i); |
102 return; | 102 return; |
103 } | 103 } |
104 | 104 if(audacious_remote_playqueue_is_queued(dbus_proxy, i - 1)) { |
105 exit(!(audacious_remote_playqueue_is_queued(dbus_proxy, i - 1))); | 105 audtool_report("OK"); |
106 } | 106 exit(0); |
107 | 107 } |
108 void playqueue_get_position(gint argc, gchar **argv) | 108 else |
109 exit(1); | |
110 } | |
111 | |
112 void playqueue_get_queue_position(gint argc, gchar **argv) | |
109 { | 113 { |
110 gint i, pos; | 114 gint i, pos; |
111 | 115 |
112 if (argc < 2) | 116 if (argc < 2) |
113 { | 117 { |
122 { | 126 { |
123 audtool_whine("invalid playlist position %d", i); | 127 audtool_whine("invalid playlist position %d", i); |
124 return; | 128 return; |
125 } | 129 } |
126 | 130 |
127 pos = audacious_remote_get_playqueue_position(dbus_proxy, i - 1) + 1; | 131 pos = audacious_remote_get_playqueue_queue_position(dbus_proxy, i - 1) + 1; |
128 | 132 |
129 if (pos < 1) | 133 if (pos < 1) |
130 return; | 134 return; |
131 | 135 |
132 audtool_report("%d", pos); | 136 audtool_report("%d", pos); |
133 } | 137 } |
134 | 138 |
135 void playqueue_get_qposition(gint argc, gchar **argv) | 139 void playqueue_get_list_position(gint argc, gchar **argv) |
136 { | 140 { |
137 gint i, pos; | 141 gint i, pos; |
138 | 142 |
139 if (argc < 2) | 143 if (argc < 2) |
140 { | 144 { |
149 { | 153 { |
150 audtool_whine("invalid playlist position %d", i); | 154 audtool_whine("invalid playlist position %d", i); |
151 return; | 155 return; |
152 } | 156 } |
153 | 157 |
154 pos = audacious_remote_get_playqueue_queue_position(dbus_proxy, i - 1) + 1; | 158 pos = audacious_remote_get_playqueue_list_position(dbus_proxy, i - 1) + 1; |
155 | 159 |
156 if (pos < 1) | 160 if (pos < 1) |
157 return; | 161 return; |
158 | 162 |
159 audtool_report("%d", pos); | 163 audtool_report("%d", pos); |
172 | 176 |
173 total = 0; | 177 total = 0; |
174 | 178 |
175 for (ii = 0; ii < i; ii++) | 179 for (ii = 0; ii < i; ii++) |
176 { | 180 { |
177 position = audacious_remote_get_playqueue_queue_position(dbus_proxy, ii); | 181 position = audacious_remote_get_playqueue_list_position(dbus_proxy, ii); |
178 songname = audacious_remote_get_playlist_title(dbus_proxy, position); | 182 songname = audacious_remote_get_playlist_title(dbus_proxy, position); |
179 frames = audacious_remote_get_playlist_time(dbus_proxy, position); | 183 frames = audacious_remote_get_playlist_time(dbus_proxy, position); |
180 length = frames / 1000; | 184 length = frames / 1000; |
181 total += length; | 185 total += length; |
182 | 186 |