]> git.tdb.fi Git - xinema.git/blob - source/client.h
Re-display the logo after the stream finishes
[xinema.git] / source / client.h
1 #ifndef CLIENT_H_
2 #define CLIENT_H_
3
4 #include <sigc++/trackable.h>
5 #include <msp/fs/path.h>
6 #include <msp/net/streamsocket.h>
7 #include <msp/time/timedelta.h>
8 #include "xinestream.h"
9
10 class Xinema;
11
12 class Client: public sigc::trackable
13 {
14 private:
15         Xinema &xinema;
16         Msp::Net::StreamSocket *socket;
17         std::string buffer;
18         Msp::Mutex mutex;
19         Msp::Time::TimeDelta last_position;
20         bool stale;
21
22 public:
23         Client(Xinema &, Msp::Net::StreamSocket *);
24
25         bool is_stale() const { return stale; }
26
27 private:
28         void data_available();
29         void end_of_stream();
30
31         XineStream &get_stream() const;
32         void process_command(const std::string &);
33         void send_reply(const std::string &);
34         void list_directory(const Msp::FS::Path &);
35
36         void stream_created(XineStream &);
37         void stream_destroyed();
38         void stream_state_changed(XineStream::State);
39         void stream_title_changed(const std::string &);
40         void stream_duration_changed(const Msp::Time::TimeDelta &);
41         void stream_position_changed(const Msp::Time::TimeDelta &);
42 };
43
44 #endif