ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/truck/Audacious/Audacious.cpp
Revision: 23
Committed: 2008-02-08T07:13:30-08:00 (14 years, 4 months ago) by douglas
File size: 7037 byte(s)
Log Message:
More improvements; modularization!

File Contents

# User Rev Content
1 douglas 23 // Audacious
2 douglas 6 //
3     // Douglas Thrift
4     //
5     // $Id$
6    
7     #include <audacious/beepctrl.h>
8    
9     #include "Audacious.hpp"
10    
11     void Audacious::Playlist(char **list, int size, bool enqueue)
12     {
13     ::xmms_remote_playlist(session, list, size, enqueue);
14     }
15    
16     int Audacious::GetVersion() const
17     {
18     return ::xmms_remote_get_version(session);
19     }
20    
21 douglas 7 void Audacious::PlaylistAdd(::GList *list)
22     {
23     ::xmms_remote_playlist_add(session, list);
24     }
25    
26     void Audacious::PlaylistDelete(int position)
27     {
28     ::xmms_remote_playlist_delete(session, position);
29     }
30    
31     void Audacious::Play()
32     {
33     ::xmms_remote_play(session);
34     }
35    
36     void Audacious::Pause()
37     {
38     ::xmms_remote_pause(session);
39     }
40    
41     void Audacious::Stop()
42     {
43     ::xmms_remote_stop(session);
44     }
45    
46     bool Audacious::IsPlaying() const
47     {
48     return ::xmms_remote_is_playing(session);
49     }
50    
51     bool Audacious::IsPaused() const
52     {
53     return ::xmms_remote_is_paused(session);
54     }
55    
56     int Audacious::GetPlaylistPosition() const
57     {
58     return ::xmms_remote_get_playlist_pos(session);
59     }
60    
61     void Audacious::SetPlaylistPosition(int position)
62     {
63     ::xmms_remote_set_playlist_pos(session, position);
64     }
65    
66     int Audacious::GetPlaylistLength() const
67     {
68     return ::xmms_remote_get_playlist_length(session);
69     }
70    
71     void Audacious::PlaylistClear()
72     {
73     return ::xmms_remote_playlist_clear(session);
74     }
75    
76     int Audacious::GetOutputTime() const
77     {
78     return ::xmms_remote_get_output_time(session);
79     }
80    
81     void Audacious::JumpToTime(int position)
82     {
83     ::xmms_remote_jump_to_time(session, position);
84     }
85    
86     void Audacious::GetVolume(int& left, int& right) const
87     {
88     ::xmms_remote_get_volume(session, &left, &right);
89     }
90    
91 douglas 6 int Audacious::GetMainVolume() const
92     {
93     return ::xmms_remote_get_main_volume(session);
94     }
95    
96 douglas 7 int Audacious::GetBalance() const
97     {
98     return ::xmms_remote_get_balance(session);
99     }
100    
101     void Audacious::SetVolume(int left, int right)
102     {
103     ::xmms_remote_set_volume(session, left, right);
104     }
105    
106 douglas 6 void Audacious::SetMainVolume(int volume)
107     {
108     ::xmms_remote_set_main_volume(session, volume);
109     }
110    
111 douglas 7 void Audacious::SetBalance(int balance)
112     {
113     ::xmms_remote_set_balance(session, balance);
114     }
115    
116 douglas 14 std::string Audacious::GetSkin() const
117 douglas 7 {
118     return ::xmms_remote_get_skin(session);
119     }
120    
121 douglas 14 void Audacious::SetSkin(const std::string &skin)
122 douglas 7 {
123 douglas 14 ::xmms_remote_set_skin(session, const_cast<char*>(skin.c_str()));
124 douglas 7 }
125    
126 douglas 14 std::string Audacious::GetPlaylistFile(int position) const
127 douglas 7 {
128     return ::xmms_remote_get_playlist_file(session, position);
129     }
130    
131 douglas 14 std::string Audacious::GetPlaylistTitle(int position) const
132 douglas 7 {
133     return ::xmms_remote_get_playlist_title(session, position);
134     }
135    
136     int Audacious::GetPlaylistTime(int position) const
137     {
138     return ::xmms_remote_get_playlist_time(session, position);
139     }
140    
141     void Audacious::GetInfo(int &rate, int &frequency, int &channels) const
142     {
143     ::xmms_remote_get_info(session, &rate, &frequency, &channels);
144     }
145    
146     void Audacious::MainWindowToggle(bool show)
147     {
148     ::xmms_remote_main_win_toggle(session, show);
149     }
150    
151     void Audacious::PlaylistWindowToggle(bool show)
152     {
153     ::xmms_remote_pl_win_toggle(session, show);
154     }
155    
156     void Audacious::EqualizerWindowToggle(bool show)
157     {
158     ::xmms_remote_eq_win_toggle(session, show);
159     }
160    
161     bool Audacious::IsMainWindow() const
162     {
163     return ::xmms_remote_is_main_win(session);
164     }
165    
166     bool Audacious::IsPlaylistWindow() const
167     {
168     return ::xmms_remote_is_pl_win(session);
169     }
170    
171     bool Audacious::IsEqualizerWindow() const
172     {
173     return ::xmms_remote_is_eq_win(session);
174     }
175    
176     void Audacious::ShowPreferencesBox()
177     {
178     ::xmms_remote_show_prefs_box(session);
179     }
180    
181     void Audacious::ToggleAlwaysOnTop(bool always)
182     {
183     ::xmms_remote_toggle_aot(session, always);
184     }
185    
186     void Audacious::Eject()
187     {
188     ::xmms_remote_eject(session);
189     }
190    
191 douglas 6 void Audacious::PlaylistPrevious()
192     {
193     ::xmms_remote_playlist_prev(session);
194     }
195    
196     void Audacious::PlaylistNext()
197     {
198     ::xmms_remote_playlist_next(session);
199     }
200    
201 douglas 14 void Audacious::PlaylistAddUrl(const std::string &url)
202 douglas 7 {
203 douglas 14 ::xmms_remote_playlist_add_url_string(session, const_cast<char*>(url.c_str()));
204 douglas 7 }
205    
206 douglas 6 bool Audacious::IsRunning() const
207     {
208     return ::xmms_remote_is_running(session);
209     }
210    
211 douglas 7 void Audacious::ToggleRepeat()
212     {
213     ::xmms_remote_toggle_repeat(session);
214     }
215    
216     void Audacious::ToggleShuffle()
217     {
218     ::xmms_remote_toggle_shuffle(session);
219     }
220    
221     bool Audacious::IsRepeat() const
222     {
223     return ::xmms_remote_is_repeat(session);
224     }
225    
226     bool Audacious::IsShuffle() const
227     {
228     return ::xmms_remote_is_shuffle(session);
229     }
230    
231     void Audacious::GetEqualizer(float& preamp, float bands[10]) const
232     {
233     float* bands_;
234    
235     ::xmms_remote_get_eq(session, &preamp, &bands_);
236    
237     _forall (uint8_t, index, 0, 10)
238     bands[index] = bands[index];
239    
240     ::g_free(bands_);
241     }
242    
243     float Audacious::GetEqualizerPreamp() const
244     {
245     return ::xmms_remote_get_eq_preamp(session);
246     }
247    
248     float Audacious::GetEqualizerBand(int band) const
249     {
250     return ::xmms_remote_get_eq_band(session, band);
251     }
252    
253     void Audacious::SetEqualizer(float preamp, float bands[10])
254     {
255     ::xmms_remote_set_eq(session, preamp, bands);
256     }
257    
258     void Audacious::SetEqualizerPreamp(float preamp)
259     {
260     ::xmms_remote_set_eq_preamp(session, preamp);
261     }
262    
263     void Audacious::SetEqualizerBand(int band, float value)
264     {
265     ::xmms_remote_set_eq_band(session, band, value);
266     }
267    
268     // XMMS 1.2.1
269     void Audacious::Quit()
270     {
271     ::xmms_remote_quit(session);
272     }
273    
274     // XMMS 1.2.6
275 douglas 6 void Audacious::PlayPause()
276     {
277     ::xmms_remote_play_pause(session);
278     }
279 douglas 7
280 douglas 14 void Audacious::PlaylistInsertUrl(const std::string &url, int position)
281 douglas 7 {
282 douglas 14 ::xmms_remote_playlist_ins_url_string(session, const_cast<char*>(url.c_str()), position);
283 douglas 7 }
284    
285     // XMMS 1.2.11
286     void Audacious::PlayqueueAdd(int position)
287     {
288     ::xmms_remote_playqueue_add(session, position);
289     }
290    
291     void Audacious::PlayqueueRemove(int position)
292     {
293     ::xmms_remote_playqueue_remove(session, position);
294     }
295    
296     int Audacious::GetPlayqueueLength() const
297     {
298     return ::xmms_remote_get_playqueue_length(session);
299     }
300    
301     void Audacious::ToggleAdvance()
302     {
303     ::xmms_remote_toggle_advance(session);
304     }
305    
306     bool Audacious::IsAdvance() const
307     {
308     return ::xmms_remote_is_advance(session);
309     }
310    
311     // BMP 0.9.7
312     void Audacious::Activate()
313     {
314     ::xmms_remote_activate(session);
315     }
316    
317     // Audacious 1.1
318     void Audacious::ShowJumpToFileBox()
319     {
320     ::xmms_remote_show_jtf_box(session);
321     }
322    
323     void Audacious::PlayqueueClear()
324     {
325     ::xmms_remote_playqueue_clear(session);
326     }
327    
328     bool Audacious::PlayqueueIsQueued(int position) const
329     {
330     return ::xmms_remote_playqueue_is_queued(session, position);
331     }
332    
333     int Audacious::GetPlayqueuePosition(int position) const
334     {
335     return ::xmms_remote_get_playqueue_position(session, position);
336     }
337    
338     int Audacious::GetPlayqueueQueuePosition(int position) const
339     {
340     return ::xmms_remote_get_playqueue_queue_position(session, position);
341     }
342    
343     // Audacious 1.2
344 douglas 14 void Audacious::SetSessionUri(const std::string &uri)
345 douglas 7 {
346 douglas 14 ::audacious_set_session_uri(const_cast<char *>(uri.c_str()));
347 douglas 7 }
348    
349 douglas 14 std::string Audacious::GetSessionUri() const
350 douglas 7 {
351     return ::audacious_get_session_uri(session);
352     }
353    
354     void Audacious::SetSessionType(Type type)
355     {
356     ::audacious_set_session_type(type);
357     }
358    
359     // Audacious 1.3
360 douglas 14 void Audacious::PlaylistEnqueueToTemp(const std::string &string)
361 douglas 7 {
362 douglas 14 ::xmms_remote_playlist_enqueue_to_temp(session, const_cast<char *>(string.c_str()));
363 douglas 7 }
364    
365 douglas 14 std::string Audacious::GetTupleFieldData(const std::string &field, int position)
366 douglas 7 {
367 douglas 14 return ::audacious_get_tuple_field_data(session, const_cast<char *>(field.c_str()), position);
368 douglas 7 }

Properties

Name Value
svn:keywords Id