info: switch streams when switching tabs

This commit is contained in:
Stefan Sauer 2010-10-28 17:34:15 +03:00
parent 4d817e158d
commit 12aab9f618

View file

@ -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);
}
}
}