--- Audacious/Audacious.hpp 2008/02/08 14:19:12 22 +++ GPS/GPS.hpp 2008/02/08 15:13:30 23 @@ -1,169 +1,10 @@ -// Beep Remote +// GPS // // Douglas Thrift // // $Id$ -#ifndef _Audacious_hpp_ -#define _Audacious_hpp_ +#ifndef _GPS_hpp_ +#define _GPS_hpp_ -#include -#include - -#include - -#include - -class Audacious -{ - int session; -public: - Audacious(int session = 0) : session(session) {} - - template - inline void Playlist(const Type_ &list, bool enqueue = false) - { - char **list_(NULL); - int size(0); - - _tforeach (const Type_, item, list) - { - list_ = list_ ? std::realloc(list_, ++size) : std::malloc(++size); - list_[_index] = const_cast(item->c_str()); - } - - Playlist(list_, size, enqueue); - - if (list_) - std::free(list_); - } - - void Playlist(char **list, int size, bool enqueue = false); - int GetVersion() const; - - template - inline void PlaylistAdd(const Type_ &list) - { - ::GList *list_(NULL); - - _tforeach (const Type_, item, list) - list_ = ::g_list_append(list_, const_cast(item->c_str())); - - PlaylistAdd(list_); - ::g_list_free(list_); - } - - void PlaylistAdd(::GList *list); - void PlaylistDelete(int position); - void Play(); - void Pause(); - void Stop(); - bool IsPlaying() const; - bool IsPaused() const; - int GetPlaylistPosition() const; - void SetPlaylistPosition(int position); - int GetPlaylistLength() const; - void PlaylistClear(); - int GetOutputTime() const; - void JumpToTime(int position); - void GetVolume(int &left, int &right) const; - int GetMainVolume() const; - int GetBalance() const; - void SetVolume(int left, int right); - void SetMainVolume(int volume); - void SetBalance(int balance); - std::string GetSkin() const; - void SetSkin(const std::string &skin); - std::string GetPlaylistFile(int position) const; - std::string GetPlaylistTitle(int position) const; - int GetPlaylistTime(int position) const; - void GetInfo(int &rate, int &frequency, int &channels) const; - void MainWindowToggle(bool show); - void PlaylistWindowToggle(bool show); - void EqualizerWindowToggle(bool show); - bool IsMainWindow() const; - bool IsPlaylistWindow() const; - bool IsEqualizerWindow() const; - void ShowPreferencesBox(); - void ToggleAlwaysOnTop(bool always); - void Eject(); - void PlaylistPrevious(); - void PlaylistNext(); - void PlaylistAddUrl(const std::string &url); - bool IsRunning() const; - void ToggleRepeat(); - void ToggleShuffle(); - bool IsRepeat() const; - bool IsShuffle() const; - - inline void ToggleRepeat(bool repeat) - { - if (repeat != IsRepeat()) - ToggleRepeat(); - } - - inline void ToggleShuffle(bool shuffle) - { - if (shuffle != IsShuffle()) - ToggleShuffle(); - } - - void GetEqualizer(float &preamp, float bands[10]) const; - float GetEqualizerPreamp() const; - float GetEqualizerBand(int band) const; - void SetEqualizer(float preamp, float bands[10]); - void SetEqualizerPreamp(float preamp); - void SetEqualizerBand(int band, float value); - - // XMMS 1.2.1 - void Quit(); - - // XMMS 1.2.6 - void PlayPause(); - void PlaylistInsertUrl(const std::string &url, int position); - - // XMMS 1.2.11 - void PlayqueueAdd(int position); - void PlayqueueRemove(int position); - int GetPlayqueueLength() const; - void ToggleAdvance(); - bool IsAdvance() const; - - inline void ToggleAdvance(bool advance) - { - if (advance != IsAdvance()) - ToggleAdvance(); - } - - // BMP 0.9.7 - void Activate(); - - // Audacious 1.1 - void ShowJumpToFileBox(); - void PlayqueueClear(); - bool PlayqueueIsQueued(int position) const; - int GetPlayqueuePosition(int position) const; - int GetPlayqueueQueuePosition(int position) const; - - // Audacious 1.2 - void SetSessionUri(const std::string &uri); - std::string GetSessionUri() const; - - enum Type { Unix, Tcp }; - - void SetSessionType(Type type); - - // Audacious 1.3 - void PlaylistEnqueueToTemp(const std::string &string); - std::string GetTupleFieldData(const std::string &field, int position); -}; - -template <> -inline void Audacious::PlaylistAdd(const std::string &item) -{ - ::GList list = { const_cast(item.c_str()), NULL, NULL }; - - PlaylistAdd(&list); -} - -#endif//_Audacious_hpp_ +#endif//_GPS_hpp_