44 #ifndef PLAYERCLIENT_H
45 #define PLAYERCLIENT_H
47 #include "libplayerc++/utility.h"
48 #include "libplayerc++/playerc++config.h"
54 #if defined (PLAYER_STATIC)
55 #define PLAYERCC_EXPORT
56 #elif defined (playerc___EXPORTS)
57 #define PLAYERCC_EXPORT __declspec (dllexport)
59 #define PLAYERCC_EXPORT __declspec (dllimport)
62 #define PLAYERCC_EXPORT
65 #ifdef HAVE_BOOST_SIGNALS
66 #include <boost/signal.hpp>
69 #ifdef HAVE_BOOST_THREAD
70 #include <boost/thread/mutex.hpp>
71 #include <boost/thread/thread.hpp>
72 #include <boost/thread/xtime.hpp>
73 #include <boost/bind.hpp>
127 std::list<PlayerCc::ClientProxy*> mProxyList;
129 std::list<playerc_device_info_t> mDeviceList;
133 void Connect(
const std::string aHostname, uint32_t aPort);
142 std::string mHostname;
148 unsigned int mTransport;
186 void Run(uint32_t aTimeout=10);
197 bool Peek(uint32_t timeout=0);
234 void ReadIfWaiting();
256 void SetDataMode(uint32_t aMode);
274 void SetReplaceRule(
bool aReplace,
281 void RequestDeviceList();
283 std::list<playerc_device_info_t> GetDeviceList();
292 int LookupCode(std::string aName)
const;
295 std::string LookupName(
int aCode)
const;
298 uint32_t GetOverflowCount();
const std::string PLAYER_HOSTNAME
The default hostname for PlayerClient.
Definition: utility.h:63
Definition: playerclient.h:78
int retry_limit
How many times we'll try to reconnect after a socket error.
Definition: playerc.h:479
int connected
Whether or not we're currently connected.
Definition: playerc.h:474
void SetRequestTimeout(uint32_t seconds)
Set the timeout for client requests.
Definition: playerclient.h:201
Definition: playerclient.h:305
T limit(T a, T min, T max)
Limit a value to the range of min, max.
Definition: utility.h:114
mutex_t mMutex
A mutex for handling synchronization.
Definition: playerclient.h:173
uint32_t GetPort() const
Returns the port.
Definition: playerclient.h:289
The PlayerClient is used for communicating with the player server.
Definition: playerclient.h:115
double GetRetryTime()
Get connection retry time, which is number of seconds to wait between reconnection attempts...
Definition: playerclient.h:219
The client proxy base class.
Definition: clientproxy.h:79
const int PLAYER_PORTNUM
The default port number for PlayerClient.
Definition: utility.h:61
Definition: playerclient.h:80
PLAYERC_EXPORT void playerc_client_set_request_timeout(playerc_client_t *client, uint32_t seconds)
Set the timeout for client requests.
Definition: playerclient.h:90
void SetRetryLimit(int limit)
Set connection retry limit, which is the number of times that we'll try to reconnect to the server af...
Definition: playerclient.h:207
#define PLAYERC_TRANSPORT_TCP
The valid transports.
Definition: playerc.h:114
void SetRetryTime(double time)
Set connection retry time, which is number of seconds to wait between reconnection attempts...
Definition: playerclient.h:215
PLAYERC_EXPORT void playerc_client_set_retry_limit(playerc_client_t *client, int limit)
Set the connection retry limit.
Client object data.
Definition: playerc.h:460
double retry_time
How long to sleep, in seconds, to sleep between reconnect attempts.
Definition: playerc.h:483
int GetRetryLimit()
Get connection retry limit, which is the number of times that we'll try to reconnect to the server af...
Definition: playerclient.h:211
Definition: playerclient.h:86
Definition: playerclient.h:99
PLAYERC_EXPORT void playerc_client_set_retry_time(playerc_client_t *client, double time)
Set the connection retry sleep time.
std::string GetHostname() const
Returns the hostname.
Definition: playerclient.h:286
bool Connected()
Are we currently connected?
Definition: playerclient.h:170