+
+void Client::stream_created(XineStream &stream)
+{
+ stream.signal_duration_changed.connect(sigc::mem_fun(this, &Client::stream_duration_changed));
+ stream.signal_position_changed.connect(sigc::mem_fun(this, &Client::stream_position_changed));
+ string title = stream.get_title();
+ if(!title.empty())
+ send_reply("title "+title);
+}
+
+void Client::stream_duration_changed(const Time::TimeDelta &dur)
+{
+ send_reply(format("duration %.3f", dur/Time::sec));
+}
+
+void Client::stream_position_changed(const Time::TimeDelta &pos)
+{
+ if(abs(pos-last_position)>=Time::sec)
+ {
+ send_reply(format("position %.3f", pos/Time::sec));
+ last_position = pos;
+ }
+}