From 12aab9f618f91bb9c6478f7045ab61843a3268d6 Mon Sep 17 00:00:00 2001 From: Stefan Sauer Date: Thu, 28 Oct 2010 17:34:15 +0300 Subject: [PATCH] info: switch streams when switching tabs --- mediainfo/src/mi-info.vala | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/mediainfo/src/mi-info.vala b/mediainfo/src/mi-info.vala index 5105597030..55a48359d0 100644 --- a/mediainfo/src/mi-info.vala +++ b/mediainfo/src/mi-info.vala @@ -97,6 +97,7 @@ public class MediaInfo.Info : VBox row++; video_streams = new Notebook (); + video_streams.switch_page.connect (on_video_stream_switched); table.attach (video_streams, 0, 2, row, row+1, fill_exp, 0, 0, 1); row++; @@ -107,6 +108,7 @@ public class MediaInfo.Info : VBox row++; audio_streams = new Notebook (); + audio_streams.switch_page.connect (on_audio_stream_switched); table.attach (audio_streams, 0, 2, row, row+1, fill_exp, 0, 0, 1); row++; @@ -379,4 +381,20 @@ public class MediaInfo.Info : VBox } } } + + private void on_video_stream_switched (NotebookPage page, uint page_num) + { + if (pb.current_state > State.PAUSED) { + stdout.printf ("Switching video to: %u\n", page_num); + ((GLib.Object)pb).set_property ("current-video", (int)page_num); + } + } + + private void on_audio_stream_switched (NotebookPage page, uint page_num) + { + if (pb.current_state > State.PAUSED) { + stdout.printf ("Switching audio to: %u\n", page_num); + ((GLib.Object)pb).set_property ("current-audio", (int)page_num); + } + } }