1 |
douglas |
464 |
// Beep Remote |
2 |
|
|
// |
3 |
|
|
// Douglas Thrift |
4 |
|
|
// |
5 |
|
|
// $Id$ |
6 |
|
|
|
7 |
|
|
#ifndef _BeepRemote_hpp_ |
8 |
|
|
#define _BeepRemote_hpp_ |
9 |
|
|
|
10 |
douglas |
468 |
#include <menes/platform.hpp> |
11 |
|
|
|
12 |
|
|
#ifdef MENES_PRAGMA_ONCE |
13 |
|
|
#pragma once |
14 |
|
|
#endif |
15 |
|
|
|
16 |
|
|
#include <menes-ext/string.hpp> |
17 |
|
|
|
18 |
douglas |
464 |
#include <bmp/beepctrl.h> |
19 |
|
|
|
20 |
|
|
class BeepRemote |
21 |
|
|
{ |
22 |
|
|
private: |
23 |
|
|
int session; |
24 |
|
|
public: |
25 |
|
|
BeepRemote(int session = 0) : session(session) {} |
26 |
douglas |
471 |
void Playlist(const _L<ext::String>& list, bool enqueue = false); |
27 |
douglas |
478 |
int GetVersion() const { return ::xmms_remote_get_version(session); } |
28 |
douglas |
471 |
void PlaylistAdd(const _L<ext::String>& list); |
29 |
|
|
void PlaylistAdd(const ext::String& item); |
30 |
douglas |
464 |
void PlaylistDelete(int position) { ::xmms_remote_playlist_delete(session, position); } |
31 |
|
|
void Play() { ::xmms_remote_play(session); } |
32 |
|
|
void Pause() { ::xmms_remote_pause(session); } |
33 |
|
|
void Stop() { ::xmms_remote_stop(session); } |
34 |
douglas |
478 |
bool IsPlaying() const { return ::xmms_remote_is_playing(session); } |
35 |
|
|
bool IsPaused() const { return ::xmms_remote_is_paused(session); } |
36 |
|
|
int GetPlaylistPosition() const { return ::xmms_remote_get_playlist_pos(session); } |
37 |
douglas |
464 |
void SetPlaylistPosition(int position) { ::xmms_remote_set_playlist_pos(session, position); } |
38 |
douglas |
478 |
int GetPlaylistLength() const { return ::xmms_remote_get_playlist_length(session); } |
39 |
douglas |
464 |
void PlaylistClear() { return ::xmms_remote_playlist_clear(session); } |
40 |
douglas |
478 |
int GetOutputTime() const { return ::xmms_remote_get_output_time(session); } |
41 |
douglas |
464 |
void JumpToTime(int position) { ::xmms_remote_jump_to_time(session, position); } |
42 |
douglas |
478 |
void GetVolume(int& left, int& right) const { ::xmms_remote_get_volume(session, &left, &right); } |
43 |
|
|
int GetMainVolume() const { return ::xmms_remote_get_main_volume(session); } |
44 |
|
|
int GetBalance() const { return ::xmms_remote_get_balance(session); } |
45 |
douglas |
464 |
void SetVolume(int left, int right) { ::xmms_remote_set_volume(session, left, right); } |
46 |
|
|
void SetMainVolume(int volume) { ::xmms_remote_set_main_volume(session, volume); } |
47 |
|
|
void SetBalance(int balance) { ::xmms_remote_set_balance(session, balance); } |
48 |
douglas |
478 |
ext::String GetSkin() const { return ::xmms_remote_get_skin(session); } |
49 |
douglas |
468 |
void SetSkin(const ext::String& skin) { ::xmms_remote_set_skin(session, const_cast<char*>(skin.NullTerminate())); } |
50 |
douglas |
478 |
ext::String GetPlaylistFile(int position) const { return ::xmms_remote_get_playlist_file(session, position); } |
51 |
|
|
ext::String GetPlaylistTitle(int position) const { return ::xmms_remote_get_playlist_title(session, position); } |
52 |
|
|
int GetPlaylistTime(int position) const { return ::xmms_remote_get_playlist_time(session, position); } |
53 |
|
|
void GetInfo(int& rate, int& frequency, int& channels) const { ::xmms_remote_get_info(session, &rate, &frequency, &channels); } |
54 |
douglas |
464 |
void MainWindowToggle(bool show) { ::xmms_remote_main_win_toggle(session, show); } |
55 |
|
|
void PlaylistWindowToggle(bool show) { ::xmms_remote_pl_win_toggle(session, show); } |
56 |
|
|
void EqualizerWindowToggle(bool show) { ::xmms_remote_eq_win_toggle(session, show); } |
57 |
douglas |
478 |
bool IsMainWindow() const { return ::xmms_remote_is_main_win(session); } |
58 |
|
|
bool IsPlaylistWindow() const { return ::xmms_remote_is_pl_win(session); } |
59 |
|
|
bool IsEqualizerWindow() const { return ::xmms_remote_is_eq_win(session); } |
60 |
douglas |
464 |
void ShowPreferencesBox() { ::xmms_remote_show_prefs_box(session); } |
61 |
|
|
void ToggleAlwaysOnTop(bool always) { ::xmms_remote_toggle_aot(session, always); } |
62 |
|
|
void Eject() { ::xmms_remote_eject(session); } |
63 |
|
|
void PlaylistPrevious() { ::xmms_remote_playlist_prev(session); } |
64 |
|
|
void PlaylistNext() { ::xmms_remote_playlist_next(session); } |
65 |
douglas |
468 |
void PlaylistAddUrl(const ext::String& url) { ::xmms_remote_playlist_add_url_string(session, const_cast<char*>(url.NullTerminate())); } |
66 |
douglas |
478 |
bool IsRunning() const { return ::xmms_remote_is_running(session); } |
67 |
douglas |
464 |
void ToggleRepeat() { ::xmms_remote_toggle_repeat(session); } |
68 |
|
|
void ToggleShuffle() { ::xmms_remote_toggle_shuffle(session); } |
69 |
douglas |
478 |
bool IsRepeat() const { return ::xmms_remote_is_repeat(session); } |
70 |
|
|
bool IsShuffle() const { return ::xmms_remote_is_shuffle(session); } |
71 |
douglas |
464 |
void ToggleRepeat(bool repeat) |
72 |
|
|
{ |
73 |
|
|
if (repeat != IsRepeat()) |
74 |
|
|
ToggleRepeat(); |
75 |
|
|
} |
76 |
|
|
void ToggleShuffle(bool shuffle) |
77 |
|
|
{ |
78 |
|
|
if (shuffle != IsShuffle()) |
79 |
|
|
ToggleShuffle(); |
80 |
|
|
} |
81 |
douglas |
478 |
void GetEqualizer(float& preamp, float bands[10]) const; |
82 |
|
|
float GetEqualizerPreamp() const { return ::xmms_remote_get_eq_preamp(session); } |
83 |
|
|
float GetEqualizerBand(int band) const { return ::xmms_remote_get_eq_band(session, band); } |
84 |
douglas |
466 |
void SetEqualizer(float preamp, float bands[10]) { ::xmms_remote_set_eq(session, preamp, bands); } |
85 |
douglas |
464 |
void SetEqualizerPreamp(float preamp) { ::xmms_remote_set_eq_preamp(session, preamp); } |
86 |
|
|
void SetEqualizerBand(int band, float value) { ::xmms_remote_set_eq_band(session, band, value); } |
87 |
|
|
void Quit() { ::xmms_remote_quit(session); } |
88 |
|
|
void PlayPause() { ::xmms_remote_play_pause(session); } |
89 |
douglas |
468 |
void PlaylistInsertUrl(const ext::String& url, int position) { ::xmms_remote_playlist_ins_url_string(session, const_cast<char*>(url.NullTerminate()), position); } |
90 |
douglas |
464 |
void Activate() { ::xmms_remote_activate(session); } |
91 |
|
|
}; |
92 |
|
|
|
93 |
|
|
#endif//_BeepRemote_hpp_ |