]> git.tdb.fi Git - xinema.git/blob - source/xinestream.h
Inform clients of stream title changes
[xinema.git] / source / xinestream.h
1 #ifndef XINESTREAM_H_
2 #define XINESTREAM_H_
3
4 #include <string>
5 #include <xine.h>
6 #include <msp/time/timedelta.h>
7
8 class XineEngine;
9
10 class XineStream
11 {
12 public:
13         sigc::signal<void, const std::string &> signal_title_changed;
14         sigc::signal<void, const Msp::Time::TimeDelta &> signal_duration_changed;
15         sigc::signal<void, const Msp::Time::TimeDelta &> signal_position_changed;
16
17 private:
18         XineEngine &engine;
19         xine_stream_t *stream;
20         xine_event_queue_t *queue;
21         std::string title;
22         Msp::Time::TimeDelta duration;
23         Msp::Time::TimeDelta position;
24
25 public:
26         XineStream(XineEngine &, const std::string &);
27         ~XineStream();
28
29         const Msp::Time::TimeDelta &get_duration() const { return duration; }
30         const Msp::Time::TimeDelta &get_position() const { return position; }
31         const std::string &get_title() const { return title; }
32
33         void play();
34         void stop();
35
36         void tick();
37 private:
38         void check_info();
39         void handle_event(const xine_event_t &);
40 };
41
42 #endif