+#include "streamcontrolitem.h"
+#include "xinemacontrolitem.h"
+
+StreamControlItem::StreamControlItem():
+ control(0)
+{
+}
+
+void StreamControlItem::set_control(XinemaControlItem *c)
+{
+ if(control)
+ disconnect(control, 0, this, 0);
+
+ control = c;
+ if(control)
+ {
+ XinemaControl &xc = control->get_control();
+ connect(&xc, &XinemaControl::title_changed, this, &StreamControlItem::title_changed);
+ connect(&xc, &XinemaControl::duration_changed, this, &StreamControlItem::duration_changed);
+ connect(&xc, &XinemaControl::position_changed, this, &StreamControlItem::position_changed);
+ }
+
+ emit control_changed();
+
+ if(control)
+ {
+ emit title_changed();
+ emit duration_changed();
+ emit position_changed();
+ }
+}
+
+QString StreamControlItem::get_title() const
+{
+ if(!control)
+ return QString();
+
+ return control->get_control().get_title();
+}
+
+float StreamControlItem::get_duration() const
+{
+ if(!control)
+ return 0;
+
+ return control->get_control().get_duration();
+}
+
+float StreamControlItem::get_position() const
+{
+ if(!control)
+ return 0;
+
+ return control->get_control().get_position();
+}