[ekiga] ui: add the extended video option



commit fb8d5a4d445b2b3e59ecc15c0502a0d8f603d5d5
Author: VÃctor Manuel JÃquez Leal <vjaquez igalia com>
Date:   Wed Sep 5 18:23:45 2012 -0500

    ui: add the extended video option
    
    With this patch the user can choose to display the "extended video" through
    the view menu.
    
    The menu item is enabled only when the on_videoutput_device_opened_cb()
    callback has the extended stream (ext_stream) as true.
    
    When the opened video output device doesn't contain an extended stream, and
    the view is set on that stream, the configuration is reset to the local view.
    
    Also, the validation of the values for the key
    /apps/ekiga/general/user_interface/video_display/video_view is more generic,
    using enum symbols rather than numbers.

 lib/engine/gui/gtk-frontend/call-window.cpp        |   27 +++++++++++++++----
 .../videooutput/videooutput-gmconf-bridge.cpp      |   11 +++++---
 2 files changed, 28 insertions(+), 10 deletions(-)
---
diff --git a/lib/engine/gui/gtk-frontend/call-window.cpp b/lib/engine/gui/gtk-frontend/call-window.cpp
index c380ff6..929e91c 100644
--- a/lib/engine/gui/gtk-frontend/call-window.cpp
+++ b/lib/engine/gui/gtk-frontend/call-window.cpp
@@ -263,7 +263,7 @@ static void on_videooutput_device_opened_cb (Ekiga::VideoOutputManager & /* mana
                                              Ekiga::VideoOutputMode mode,
                                              unsigned zoom,
                                              bool both_streams,
-                                             G_GNUC_UNUSED bool ext_stream,
+                                             bool ext_stream,
                                              gpointer self);
 
 static void on_videooutput_device_closed_cb (Ekiga::VideoOutputManager & /* manager */,
@@ -579,8 +579,12 @@ display_changed_cb (GtkWidget *widget,
       group = g_slist_next (group);
     }
 
-    if (!EKIGA_CALL_WINDOW (data)->priv->changing_back_to_local_after_a_call)
-      gm_conf_set_int (VIDEO_DISPLAY_KEY "video_view", group_last_pos - active);
+    if (!EKIGA_CALL_WINDOW (data)->priv->changing_back_to_local_after_a_call) {
+      int view = group_last_pos - active;
+      if (view > 2) // let's jump VO_MODE_PIP_WINDOW & VO_MODE_FULLSCREEN modes
+        view += 2;
+      gm_conf_set_int (VIDEO_DISPLAY_KEY "video_view", view);
+    }
   }
 }
 
@@ -733,7 +737,7 @@ on_videooutput_device_opened_cb (Ekiga::VideoOutputManager & /* manager */,
                                  Ekiga::VideoOutputMode mode,
                                  unsigned zoom,
                                  bool both_streams,
-                                 G_GNUC_UNUSED bool ext_stream,
+                                 bool ext_stream,
                                  gpointer self)
 {
   EkigaCallWindow *cw = EKIGA_CALL_WINDOW (self);
@@ -750,17 +754,23 @@ on_videooutput_device_opened_cb (Ekiga::VideoOutputManager & /* manager */,
       gtk_menu_set_sensitive (cw->priv->main_menu, "remote_video", true);
   }
 
+  gtk_menu_set_sensitive (cw->priv->main_menu, "extended_video", ext_stream);
+
   // when ending a call and going back to local video, the video_view
   // setting should not be updated, so memorise the setting and
   // restore it afterwards
-  if (!both_streams && mode == Ekiga::VO_MODE_LOCAL)
-    vv = gm_conf_get_int (VIDEO_DISPLAY_KEY "video_view");
+  vv = gm_conf_get_int (VIDEO_DISPLAY_KEY "video_view");
   cw->priv->changing_back_to_local_after_a_call = true;
   gtk_radio_menu_select_with_id (cw->priv->main_menu, "local_video", mode);
   cw->priv->changing_back_to_local_after_a_call = false;
   if (!both_streams && mode == Ekiga::VO_MODE_LOCAL)
     gm_conf_set_int (VIDEO_DISPLAY_KEY "video_view", vv);
 
+  // if in a past video we left in the extended video stream, but the new
+  // one doesn't have it, we reset the view to the local one
+  if (vv == Ekiga::VO_MODE_REMOTE_EXT && !ext_stream)
+    gm_conf_set_int (VIDEO_DISPLAY_KEY "video_view", Ekiga::VO_MODE_LOCAL);
+
   ekiga_call_window_zooms_menu_update_sensitivity (cw, zoom);
 }
 
@@ -2038,6 +2048,11 @@ ekiga_call_window_init_menu (EkigaCallWindow *cw)
 			   NULL, '3',
 			   G_CALLBACK (display_changed_cb), cw,
 			   false, false),
+      GTK_MENU_RADIO_ENTRY("extended_video", ("_Extended Video"),
+			   ("Extended video images"),
+			   NULL, '4',
+			   G_CALLBACK (display_changed_cb), cw,
+			   false, false),
       GTK_MENU_SEPARATOR,
 
       GTK_MENU_ENTRY("zoom_in", NULL, _("Zoom in"),
diff --git a/lib/engine/videooutput/videooutput-gmconf-bridge.cpp b/lib/engine/videooutput/videooutput-gmconf-bridge.cpp
index f71931b..718a377 100644
--- a/lib/engine/videooutput/videooutput-gmconf-bridge.cpp
+++ b/lib/engine/videooutput/videooutput-gmconf-bridge.cpp
@@ -68,8 +68,9 @@ void VideoOutputCoreConfBridge::on_property_changed (std::string key, GmConfEntr
     DisplayInfo display_info;
     PTRACE(4, "VideoOutputCoreConfBridge\tUpdating video view");
 
-    if (( gm_conf_get_int (VIDEO_DISPLAY_KEY "video_view") < 0) || ( gm_conf_get_int (VIDEO_DISPLAY_KEY "video_view") > 4))
-      gm_conf_set_int (VIDEO_DISPLAY_KEY "video_view", 0);
+    if ((gm_conf_get_int (VIDEO_DISPLAY_KEY "video_view") < Ekiga::VO_MODE_LOCAL) ||
+	(gm_conf_get_int (VIDEO_DISPLAY_KEY "video_view") >= Ekiga::VO_MODE_UNSET))
+      gm_conf_set_int (VIDEO_DISPLAY_KEY "video_view", Ekiga::VO_MODE_LOCAL);
 
     display_info.mode = (VideoOutputMode) gm_conf_get_int (VIDEO_DISPLAY_KEY "video_view");
     display_core.set_display_info(display_info);
@@ -78,9 +79,11 @@ void VideoOutputCoreConfBridge::on_property_changed (std::string key, GmConfEntr
 
     DisplayInfo display_info;
     PTRACE(4, "VideoOutputCoreConfBridge\tUpdating zoom");
-      
+
     display_info.zoom = gm_conf_get_int (VIDEO_DISPLAY_KEY "zoom");
-    if ((display_info.zoom != 100) && (display_info.zoom != 50) && (display_info.zoom != 200)) {
+    if ((display_info.zoom != 100) &&
+	(display_info.zoom != 50) &&
+	(display_info.zoom != 200)) {
       display_info.zoom = 100;
       gm_conf_set_int (VIDEO_DISPLAY_KEY "zoom", 100);
     }



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