Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using Gtk;
- using Gst;
- public static int main(string[] args)
- {
- Gst.init (ref args);
- Gtk.init(ref args);
- var window = new Window();
- var hbox = new Box(Orientation.HORIZONTAL, 3);
- var file_choose = new FileChooserButton("Select media", FileChooserAction.OPEN);
- var play_button = new Button();
- var stop_button = new Button();
- dynamic Element playbin = ElementFactory.make ("playbin", "playbin");
- play_button.set_label("Play");
- stop_button.set_label("Stop");
- hbox.add(file_choose);
- hbox.add(play_button);
- hbox.add(stop_button);
- window.add(hbox);
- window.title = "Interface Test";
- window.set_default_size (350, 70);
- window.show_all();
- play_button.clicked.connect(() =>
- {
- playbin.uri = file_choose.get_uri();
- playbin.set_state (State.PLAYING);
- });
- stop_button.clicked.connect (() => playbin.set_state (State.READY));
- window.destroy.connect (Gtk.main_quit);
- new MainLoop().run();
- Gtk.main();
- return 0;
- }
Add Comment
Please, Sign In to add comment