1 |
// Beep Remote |
2 |
// |
3 |
// Douglas Thrift |
4 |
// |
5 |
// $Id$ |
6 |
|
7 |
#include <menes/standard.hh> |
8 |
|
9 |
#include "BeepRemote.hpp" |
10 |
|
11 |
void BeepRemote::Playlist(const _L<ext::String>& list, bool enqueue) |
12 |
{ |
13 |
char** list_(new char*[list.GetSize()]); |
14 |
|
15 |
_foreach (const _L<ext::String>, item, list) |
16 |
list_[_index] = const_cast<char*>(item->NullTerminate()); |
17 |
|
18 |
::xmms_remote_playlist(session, list_, list.GetSize(), enqueue); |
19 |
|
20 |
delete [] list_; |
21 |
} |
22 |
|
23 |
void BeepRemote::PlaylistAdd(const _L<ext::String>& list) |
24 |
{ |
25 |
::GList* list_(NULL); |
26 |
|
27 |
_foreach (const _L<ext::String>, item, list) |
28 |
list_ = ::g_list_append(list_, const_cast<char*>(item->NullTerminate())); |
29 |
|
30 |
::xmms_remote_playlist_add(session, list_); |
31 |
::g_list_free(list_); |
32 |
} |
33 |
|
34 |
void BeepRemote::PlaylistAdd(const ext::String& item) |
35 |
{ |
36 |
::GList list = { const_cast<char*>(item.NullTerminate()), NULL, NULL }; |
37 |
|
38 |
::xmms_remote_playlist_add(session, &list); |
39 |
} |
40 |
|
41 |
void BeepRemote::GetEqualizer(float& preamp, float bands[10]) |
42 |
{ |
43 |
float* bands_; |
44 |
|
45 |
::xmms_remote_get_eq(session, &preamp, &bands_); |
46 |
ext::CopyAssign(bands, bands_, 10); |
47 |
::g_free(bands_); |
48 |
} |