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);
24 emit control_changed();
28 emit playback_state_changed();
30 emit duration_changed();
31 emit position_changed();
35 StreamControlItem::PlaybackState StreamControlItem::get_playback_state() const
40 return static_cast<PlaybackState>(control->get_control().get_playback_state());
43 void StreamControlItem::set_playback_state(PlaybackState state)
48 XinemaControl &xc = control->get_control();
51 else if(state==Paused)
53 else if(state==Playing)
57 QString StreamControlItem::get_title() const
62 return control->get_control().get_title();
65 float StreamControlItem::get_duration() const
70 return control->get_control().get_duration();
73 void StreamControlItem::set_position(float pos)
76 control->get_control().seek(pos);
79 float StreamControlItem::get_position() const
84 return control->get_control().get_position();