The Winamp Remote Control suite
a remote control client and plugin for Winamp 2.x, 5.x
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
ClientConfig.h
Go to the documentation of this file.
1 /*
2  * ClientConfig.h
3  *
4  * Created on: 28 Jul 2013
5  * Author: Patrick
6  */
7 
8 #include <forms.hpp>
9 
10 #include <string>
11 #include <ostream>
12 
13 #ifndef CLIENTCONFIG_H_
14 #define CLIENTCONFIG_H_
15 
16 namespace WinampRemote
17 {
18 namespace Config
19 {
20 
25 {
26 private:
27 
28  TPoint m_CommandsPos;
29  bool m_CommandsVisible;
30  TPoint m_VolumePos;
31  bool m_VolumeVisible;
32  TRect m_PlaylistPos;
33  bool m_PlaylistVisible;
34  std::string m_endpoint;
35  std::string m_address;
36  bool m_autohide;
37  bool m_autorestore;
38  bool m_updatePerSong;
39  bool m_visible;
40  int m_pollInterval;
41 
42 public:
47  m_CommandsPos(Point(0, 0)), m_CommandsVisible(false),
48  m_VolumePos(Point(0,0)), m_VolumeVisible(false),
49  m_PlaylistPos(Rect(0,0,0,0)), m_PlaylistVisible(), m_endpoint(""), m_address(""),
50  m_autohide(false), m_autorestore(false),m_updatePerSong(false),
51  m_visible(true), m_pollInterval(10) {}
55  void read();
62  void write(const TForm * const frmCommands,
63  const TForm * const frmPlaylist,
64  const TForm * const frmSettings) const;
65 
70  TPoint& CommandsPos() { return m_CommandsPos; }
71 
76  TPoint& VolumePos() { return m_VolumePos; }
77 
82  bool& CommandsVisible() { return m_CommandsVisible; }
83 
88  bool& VolumeVisible() { return m_VolumeVisible; }
89 
94  TRect& PlaylistPos() { return m_PlaylistPos; }
95 
100  bool& PlaylistVisible() { return m_PlaylistVisible; }
101 
106  bool& AutoRestore() { return m_autorestore; }
107 
113  std::ostream& streamOut(std::ostream& os) const
114  {
115 
116  os <<
117  "Command Pos [" << m_CommandsPos.x << "," << m_CommandsPos.y << "]" <<
118  "Commands Visible [" << m_CommandsVisible << "]" <<
119  "Volume Pos [" << m_VolumePos.x << "," << m_VolumePos.y << "]" <<
120  "Volume Visible [" << m_VolumeVisible << "]" <<
121  "Playlist Pos [" << m_PlaylistPos.Top << "," << m_PlaylistPos.Left <<
122  "," << m_PlaylistPos.Bottom << "," << m_PlaylistPos.Right << "]" <<
123  "Playlist Visible [" << m_PlaylistVisible << "]" <<
124  "Endpoint [" << m_endpoint << "]" <<
125  "Address [" << m_address << "]" <<
126  "Auto Restore [" << m_autorestore << "]" <<
127  "Auto Hide [" << m_autohide << "]" <<
128  "Update per Song [" << m_updatePerSong << "]" <<
129  "Visible [" << m_visible << "]" <<
130  "Poll Interval [" << m_pollInterval << "]"
131  ;
132 
133  return os;
134  }
135 
143 }; // ClientConfig
144 
145 std::ostream& operator << (std::ostream& os, const ClientConfig & config)
146 {
147  return config.streamOut(os);
148 }
149 
150 } /* namespace Config */
151 } /* namespace WinampRemote */
152 #endif /* CLIENTCONFIG_H_ */