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::channels_changed, this, &StreamControlItem::control_channels_changed);
23 connect(&xc, &XinemaControl::current_audio_channel_changed, this, &StreamControlItem::current_audio_channel_changed);
24 connect(&xc, &XinemaControl::current_spu_channel_changed, this, &StreamControlItem::current_spu_channel_changed);
27 emit control_changed();
31 emit playback_state_changed();
33 emit duration_changed();
34 emit position_changed();
35 emit channels_changed();
36 emit current_audio_channel_changed();
37 emit current_spu_channel_changed();
41 StreamControlItem::PlaybackState StreamControlItem::get_playback_state() const
46 return static_cast<PlaybackState>(control->get_control().get_playback_state());
49 void StreamControlItem::set_playback_state(PlaybackState state)
54 XinemaControl &xc = control->get_control();
57 else if(state==Paused)
59 else if(state==Playing)
63 QString StreamControlItem::get_title() const
68 return control->get_control().get_title();
71 float StreamControlItem::get_duration() const
76 return control->get_control().get_duration();
79 void StreamControlItem::set_position(float pos)
82 control->get_control().seek(pos);
85 float StreamControlItem::get_position() const
90 return control->get_control().get_position();
93 QStringList StreamControlItem::get_audio_channels() const
98 return control->get_control().get_audio_channels();
101 QStringList StreamControlItem::get_spu_channels() const
104 return QStringList();
106 return control->get_control().get_spu_channels();
109 void StreamControlItem::select_audio_channel(int chan)
112 control->get_control().select_audio_channel(chan);
115 void StreamControlItem::select_spu_channel(int chan)
118 control->get_control().select_spu_channel(chan);
121 int StreamControlItem::get_current_audio_channel() const
126 return control->get_control().get_current_audio_channel();
129 int StreamControlItem::get_current_spu_channel() const
134 return control->get_control().get_current_spu_channel();
137 void StreamControlItem::control_channels_changed()
139 emit channels_changed();
140 emit current_audio_channel_changed();
141 emit current_spu_channel_changed();