info: make the overlay iface work and activate playback

This commit is contained in:
Stefan Sauer 2010-10-18 10:31:43 +03:00
parent 2e24a0b565
commit 0fdfd4d0af

View file

@ -47,32 +47,43 @@ public class MediaInfo.Info : VBox
pb = ElementFactory.make ("playbin2", "player") as Pipeline; pb = ElementFactory.make ("playbin2", "player") as Pipeline;
Gst.Bus bus = pb.get_bus (); Gst.Bus bus = pb.get_bus ();
bus.add_signal_watch (); bus.set_sync_handler (bus.sync_signal_handler);
bus.message["element"].connect (on_element_message); bus.sync_message["element"].connect (on_element_sync_message);
} }
~Info ()
{
// stop previous playback
pb.set_state (State.NULL);
}
// public methods // public methods
public bool discover (string uri) public bool discover (string uri)
{ {
// TODO: stop previous playback (also need destructor) bool res = true;
// stop previous playback
pb.set_state (State.NULL);
this.uri.set_text (uri); this.uri.set_text (uri);
if (uri != null) {
//DiscovererInfo info = dc.discover_uri (uri, null); //DiscovererInfo info = dc.discover_uri (uri, null);
// TODO: play file // play file
//pb.uri = uri; ((GLib.Object)pb).set_property ("uri", uri);
//pb.set_state (State.PLAYING); pb.set_state (State.PLAYING);
res = true;
}
return (true); return (res);
} }
// signal handlers // signal handlers
private void on_element_message (Gst.Bus bus, Message message) private void on_element_sync_message (Gst.Bus bus, Message message)
{ {
Structure structure = message.get_structure (); Structure structure = message.get_structure ();
if (structure.has_name ("prepare-xwindow-id")) if (structure.has_name ("prepare-xwindow-id"))