[totem] backend: Add functions to cycle through sub/lang



commit 0d15b326b717d6724019275049789a68a77d49b1
Author: Bastien Nocera <hadess hadess net>
Date:   Wed Mar 6 17:42:49 2013 +0100

    backend: Add functions to cycle through sub/lang

 src/backend/bacon-video-widget.c |   30 ++++++++++++++++++++++++++++++
 src/backend/bacon-video-widget.h |    2 ++
 2 files changed, 32 insertions(+), 0 deletions(-)
---
diff --git a/src/backend/bacon-video-widget.c b/src/backend/bacon-video-widget.c
index 080bd09..12234f1 100644
--- a/src/backend/bacon-video-widget.c
+++ b/src/backend/bacon-video-widget.c
@@ -2801,6 +2801,21 @@ bacon_video_widget_set_subtitle (BaconVideoWidget * bvw, int subtitle)
   }
 }
 
+void
+bacon_video_widget_set_next_subtitle (BaconVideoWidget *bvw)
+{
+  int n_text;
+  int current_text;
+
+  g_object_get (bvw->priv->play, "current-text", &current_text, "n-text", &n_text, NULL);
+
+  current_text++;
+  if (current_text >= n_text)
+    current_text = -2;
+
+  bacon_video_widget_set_subtitle (bvw, current_text);
+}
+
 /**
  * bacon_video_widget_has_next_track:
  * @bvw: a #BaconVideoWidget
@@ -3030,6 +3045,21 @@ bacon_video_widget_set_language (BaconVideoWidget * bvw, int language)
   g_signal_emit (bvw, bvw_signals[SIGNAL_CHANNELS_CHANGE], 0);
 }
 
+void
+bacon_video_widget_set_next_language (BaconVideoWidget *bvw)
+{
+  int n_audio;
+  int current_audio;
+
+  g_object_get (bvw->priv->play, "current-audio", &current_audio, "n-audio", &n_audio, NULL);
+
+  current_audio++;
+  if (current_audio >= n_audio)
+    current_audio = -2;
+
+  bacon_video_widget_set_language (bvw, current_audio);
+}
+
 /**
  * bacon_video_widget_set_deinterlacing:
  * @bvw: a #BaconVideoWidget
diff --git a/src/backend/bacon-video-widget.h b/src/backend/bacon-video-widget.h
index c286c11..af10cfd 100644
--- a/src/backend/bacon-video-widget.h
+++ b/src/backend/bacon-video-widget.h
@@ -417,11 +417,13 @@ GList *bacon_video_widget_get_languages          (BaconVideoWidget *bvw);
 int bacon_video_widget_get_language              (BaconVideoWidget *bvw);
 void bacon_video_widget_set_language             (BaconVideoWidget *bvw,
                                                  int language);
+void bacon_video_widget_set_next_language        (BaconVideoWidget *bvw);
 
 GList *bacon_video_widget_get_subtitles          (BaconVideoWidget *bvw);
 int bacon_video_widget_get_subtitle              (BaconVideoWidget *bvw);
 void bacon_video_widget_set_subtitle             (BaconVideoWidget *bvw,
                                                  int subtitle);
+void bacon_video_widget_set_next_subtitle        (BaconVideoWidget *bvw);
 
 gboolean bacon_video_widget_has_next_track      (BaconVideoWidget *bvw);
 gboolean bacon_video_widget_has_previous_track  (BaconVideoWidget *bvw);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]