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

Comparing SteeringWheelRemote/Audacious.hpp (file contents):
Revision 7 by douglas, 2007-05-06T22:12:04-07:00 vs.
Revision 12 by douglas, 2007-05-13T04:38:16-07:00

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines