ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/truck/Audacious/Audacious.hpp
(Generate patch)

Comparing SteeringWheelRemote/Audacious.hpp (file contents):
Revision 13 by douglas, 2007-05-13T04:38:16-07:00 vs.
Revision 14 by douglas, 2007-05-14T18:24:34-07:00

# Line 7 | Line 7
7   #ifndef _Audacious_hpp_
8   #define _Audacious_hpp_
9  
10 < #include <cxx/platform.hpp>
10 > #include <cstdlib>
11 > #include <string>
12  
12 #ifdef MENES_PRAGMA_ONCE
13 #pragma once
14 #endif
15
16 #include <stdlib.h>
13   #include <glib.h>
14  
15 + #include <foreach.hpp>
16 +
17   class Audacious
18   {
19          int session;
# Line 30 | Line 28 | public:
28  
29                  _tforeach (const Type_, item, list)
30                  {
31 <                        list_ = list_ ? ::realloc(list_, ++size) : ::malloc(++size);
32 <                        list_[_index] = const_cast<char *>(item->NullTerminate());
31 >                        list_ = list_ ? std::realloc(list_, ++size) : std::malloc(++size);
32 >                        list_[_index] = const_cast<char *>(item->c_str());
33                  }
34  
35                  Playlist(list_, size, enqueue);
36  
37                  if (list_)
38 <                        ::free(list_);
38 >                        std::free(list_);
39          }
40  
41          void Playlist(char **list, int size, bool enqueue = false);
# Line 49 | Line 47 | public:
47                  ::GList *list_(NULL);
48  
49                  _tforeach (const Type_, item, list)
50 <                        list_ = ::g_list_append(list_, const_cast<char *>(item->NullTerminate()));
50 >                        list_ = ::g_list_append(list_, const_cast<char *>(item->c_str()));
51  
52                  PlaylistAdd(list_);
53                  ::g_list_free(list_);
# Line 74 | Line 72 | public:
72          void SetVolume(int left, int right);
73          void SetMainVolume(int volume);
74          void SetBalance(int balance);
75 <        cse::String GetSkin() const;
76 <        void SetSkin(const cse::String &skin);
77 <        cse::String GetPlaylistFile(int position) const;
78 <        cse::String GetPlaylistTitle(int position) const;
75 >        std::string GetSkin() const;
76 >        void SetSkin(const std::string &skin);
77 >        std::string GetPlaylistFile(int position) const;
78 >        std::string GetPlaylistTitle(int position) const;
79          int GetPlaylistTime(int position) const;
80          void GetInfo(int &rate, int &frequency, int &channels) const;
81          void MainWindowToggle(bool show);
# Line 91 | Line 89 | public:
89          void Eject();
90          void PlaylistPrevious();
91          void PlaylistNext();
92 <        void PlaylistAddUrl(const cse::String &url);
92 >        void PlaylistAddUrl(const std::string &url);
93          bool IsRunning() const;
94          void ToggleRepeat();
95          void ToggleShuffle();
# Line 122 | Line 120 | public:
120  
121          // XMMS 1.2.6
122          void PlayPause();
123 <        void PlaylistInsertUrl(const cse::String &url, int position);
123 >        void PlaylistInsertUrl(const std::string &url, int position);
124  
125          // XMMS 1.2.11
126          void PlayqueueAdd(int position);
# Line 148 | Line 146 | public:
146          int GetPlayqueueQueuePosition(int position) const;
147  
148          // Audacious 1.2
149 <        void SetSessionUri(const cse::String &uri);
150 <        cse::String GetSessionUri() const;
149 >        void SetSessionUri(const std::string &uri);
150 >        std::string GetSessionUri() const;
151  
152          enum Type { Unix, Tcp };
153  
154          void SetSessionType(Type type);
155  
156          // Audacious 1.3
157 <        void PlaylistEnqueueToTemp(const cse::String &string);
158 <        cse::String GetTupleFieldData(const cse::String &field, int position);
157 >        void PlaylistEnqueueToTemp(const std::string &string);
158 >        std::string GetTupleFieldData(const std::string &field, int position);
159   };
160  
161   template <>
162 < inline void Audacious::PlaylistAdd(const cse::String &item)
162 > inline void Audacious::PlaylistAdd(const std::string &item)
163   {
164 <        ::GList list = { const_cast<char *>(item.NullTerminate()), NULL, NULL };
164 >        ::GList list = { const_cast<char *>(item.c_str()), NULL, NULL };
165  
166          PlaylistAdd(&list);
167   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines