X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fxinestream.h;h=01cc3e05c3533c1baddde06c6a4dc4998a6aee21;hb=HEAD;hp=c5778c7d0f36975acb193d2c16c7c510e987687b;hpb=a4982bb4d3fd9908aa01c824ac6202ac8618ac24;p=xinema.git diff --git a/source/xinestream.h b/source/xinestream.h index c5778c7..01cc3e0 100644 --- a/source/xinestream.h +++ b/source/xinestream.h @@ -20,15 +20,26 @@ public: PLAYING }; + enum + { + OFF = -1 + }; + sigc::signal signal_state_changed; sigc::signal signal_title_changed; sigc::signal signal_duration_changed; sigc::signal signal_position_changed; + sigc::signal signal_video_size_changed; + sigc::signal signal_framerate_changed; + sigc::signal signal_codecs_changed; sigc::signal signal_channels_changed; + sigc::signal signal_current_audio_channel_changed; + sigc::signal signal_current_spu_channel_changed; sigc::signal signal_finished; private: XineEngine &engine; + std::string filename; xine_stream_t *stream; xine_event_queue_t *queue; Msp::Mutex mutex; @@ -36,8 +47,15 @@ private: std::string title; Msp::Time::TimeDelta duration; Msp::Time::TimeDelta position; + unsigned video_width; + unsigned video_height; + float framerate; + std::string video_codec; + std::string audio_codec; std::vector audio_channels; std::vector spu_channels; + int current_audio; + int current_spu; bool channels_changed; public: @@ -48,13 +66,12 @@ public: State get_state() const { return state; } const Msp::Time::TimeDelta &get_duration() const { return duration; } const Msp::Time::TimeDelta &get_position() const { return position; } - const std::string &get_title() const { return title; } - const std::vector &get_audio_channels() const { return audio_channels; } - const std::vector &get_spu_channels() const { return spu_channels; } - void set_audio_channel(unsigned); - void set_audio_off(); - void set_spu_channel(unsigned); - void set_spu_off(); + const std::string &get_title() const; + unsigned get_video_width() const { return video_width; } + unsigned get_video_height() const { return video_height; } + float get_framerate() const { return framerate; } + const std::string &get_video_codec() const { return video_codec; } + const std::string &get_audio_codec() const { return audio_codec; } void play(); void seek(const Msp::Time::TimeDelta &); @@ -64,8 +81,16 @@ private: void set_state(State); public: + const std::vector &get_audio_channels() const { return audio_channels; } + const std::vector &get_spu_channels() const { return spu_channels; } + void select_audio_channel(int); + void select_spu_channel(int); + int get_current_audio_channel() const { return current_audio; } + int get_current_spu_channel() const { return current_spu; } + void tick(); private: + static bool equals(const std::string &, const char *); void update_info(); void update_channels(); void handle_event(const xine_event_t &);