1 #include "streamcontrolitem.h"
2 #include "xinemacontrolitem.h"
4 StreamControlItem::StreamControlItem():
9 void StreamControlItem::set_control(XinemaControlItem *c)
12 disconnect(control, 0, this, 0);
17 XinemaControl &xc = control->get_control();
18 connect(&xc, &XinemaControl::playback_state_changed, this, &StreamControlItem::playback_state_changed);
19 connect(&xc, &XinemaControl::title_changed, this, &StreamControlItem::title_changed);
20 connect(&xc, &XinemaControl::duration_changed, this, &StreamControlItem::duration_changed);
21 connect(&xc, &XinemaControl::position_changed, this, &StreamControlItem::position_changed);
22 connect(&xc, &XinemaControl::size_changed, this, &StreamControlItem::size_changed);
23 connect(&xc, &XinemaControl::framerate_changed, this, &StreamControlItem::framerate_changed);
24 connect(&xc, &XinemaControl::codecs_changed, this, &StreamControlItem::codecs_changed);
25 connect(&xc, &XinemaControl::channels_changed, this, &StreamControlItem::control_channels_changed);
26 connect(&xc, &XinemaControl::current_audio_channel_changed, this, &StreamControlItem::current_audio_channel_changed);
27 connect(&xc, &XinemaControl::current_spu_channel_changed, this, &StreamControlItem::current_spu_channel_changed);
30 emit control_changed();
34 emit playback_state_changed();
36 emit duration_changed();
37 emit position_changed();
39 emit framerate_changed();
40 emit codecs_changed();
41 emit channels_changed();
42 emit current_audio_channel_changed();
43 emit current_spu_channel_changed();
47 StreamControlItem::PlaybackState StreamControlItem::get_playback_state() const
52 return static_cast<PlaybackState>(control->get_control().get_playback_state());
55 void StreamControlItem::set_playback_state(PlaybackState state)
60 XinemaControl &xc = control->get_control();
63 else if(state==Paused)
65 else if(state==Playing)
69 QString StreamControlItem::get_title() const
74 return control->get_control().get_title();
77 float StreamControlItem::get_duration() const
82 return control->get_control().get_duration();
85 void StreamControlItem::set_position(float pos)
88 control->get_control().seek(pos);
91 float StreamControlItem::get_position() const
96 return control->get_control().get_position();
99 QSize StreamControlItem::get_video_size() const
104 return control->get_control().get_video_size();
107 float StreamControlItem::get_framerate() const
112 return control->get_control().get_framerate();
115 QString StreamControlItem::get_video_codec() const
120 return control->get_control().get_video_codec();
123 QString StreamControlItem::get_audio_codec() const
128 return control->get_control().get_audio_codec();
131 QStringList StreamControlItem::get_audio_channels() const
134 return QStringList();
136 return control->get_control().get_audio_channels();
139 QStringList StreamControlItem::get_spu_channels() const
142 return QStringList();
144 return control->get_control().get_spu_channels();
147 void StreamControlItem::select_audio_channel(int chan)
150 control->get_control().select_audio_channel(chan);
153 void StreamControlItem::select_spu_channel(int chan)
156 control->get_control().select_spu_channel(chan);
159 int StreamControlItem::get_current_audio_channel() const
164 return control->get_control().get_current_audio_channel();
167 int StreamControlItem::get_current_spu_channel() const
172 return control->get_control().get_current_spu_channel();
175 void StreamControlItem::control_channels_changed()
177 emit channels_changed();
178 emit current_audio_channel_changed();
179 emit current_spu_channel_changed();