[ekiga/ds-clutter] VideoOutput: Added toggle to enable/disable PIP mode.
- From: Damien Sandras <dsandras src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ekiga/ds-clutter] VideoOutput: Added toggle to enable/disable PIP mode.
- Date: Tue, 31 Dec 2013 16:38:35 +0000 (UTC)
commit 1d95e1cc5eda371e358cc77e1949c7c73f8897b5
Author: Damien Sandras <dsandras beip be>
Date: Tue Dec 31 17:37:48 2013 +0100
VideoOutput: Added toggle to enable/disable PIP mode.
lib/engine/gui/gtk-frontend/call-window.cpp | 71 ++++++++++++++------
lib/engine/gui/gtk-frontend/preferences-window.cpp | 4 +
org.gnome.ekiga.gschema.xml.in.in | 5 ++
3 files changed, 58 insertions(+), 22 deletions(-)
---
diff --git a/lib/engine/gui/gtk-frontend/call-window.cpp b/lib/engine/gui/gtk-frontend/call-window.cpp
index c5fb52d..9ad5237 100644
--- a/lib/engine/gui/gtk-frontend/call-window.cpp
+++ b/lib/engine/gui/gtk-frontend/call-window.cpp
@@ -196,6 +196,10 @@ static void stay_on_top_changed_cb (GSettings *settings,
gchar *key,
gpointer self);
+static void pip_mode_changed_cb (GSettings *settings,
+ gchar *key,
+ gpointer self);
+
static void pick_up_call_cb (GtkWidget * /*widget*/,
gpointer data);
@@ -469,6 +473,26 @@ stay_on_top_changed_cb (GSettings *settings,
}
static void
+pip_mode_changed_cb (GSettings *settings,
+ gchar *key,
+ gpointer self)
+
+{
+ g_return_if_fail (EKIGA_IS_CALL_WINDOW (self));
+
+ EkigaCallWindow *cw = EKIGA_CALL_WINDOW (self);
+ bool val = false;
+
+ val = g_settings_get_boolean (settings, key);
+ if (cw->priv->video_stream_natural_width[Ekiga::VideoOutputManager::LOCAL] > 0
+ && cw->priv->video_stream_natural_height[Ekiga::VideoOutputManager::LOCAL] > 0
+ && cw->priv->video_stream_natural_width[Ekiga::VideoOutputManager::REMOTE] > 0
+ && cw->priv->video_stream_natural_height[Ekiga::VideoOutputManager::REMOTE] > 0)
+ clutter_actor_set_opacity (cw->priv->video_stream[Ekiga::VideoOutputManager::LOCAL],
+ val ? 255 : 0);
+}
+
+static void
fullscreen_changed_cb (G_GNUC_UNUSED GtkWidget *widget,
gpointer data)
{
@@ -607,6 +631,7 @@ on_videooutput_device_opened_cb (Ekiga::VideoOutputManager & /* manager */,
gpointer self)
{
gfloat ratio;
+ bool show_local = true;
g_return_if_fail (EKIGA_IS_CALL_WINDOW (self));
@@ -622,29 +647,20 @@ on_videooutput_device_opened_cb (Ekiga::VideoOutputManager & /* manager */,
*/
ekiga_call_window_set_pip (cw, both_streams);
- clutter_actor_set_opacity (CLUTTER_ACTOR (cw->priv->video_stream[type]), 255);
-
+ show_local =
+ (!both_streams || cw->priv->video_display_settings->get_bool ("enable-pip"));
- // FIXME
- return;
- /*
- int vv;
-
- if (both_streams) {
- gtk_menu_section_set_sensitive (cw->priv->main_menu, "local_video", true);
- gtk_menu_section_set_sensitive (cw->priv->main_menu, "fullscreen", true);
- }
- else {
- if (mode == Ekiga::VO_MODE_LOCAL)
- gtk_menu_set_sensitive (cw->priv->main_menu, "local_video", true);
- else if (mode == Ekiga::VO_MODE_REMOTE)
- gtk_menu_set_sensitive (cw->priv->main_menu, "remote_video", true);
- }
+ if (both_streams) {
+ clutter_actor_set_opacity (cw->priv->video_stream[Ekiga::VideoOutputManager::LOCAL],
+ show_local ? 255 : 0);
+ clutter_actor_set_opacity (cw->priv->video_stream[Ekiga::VideoOutputManager::REMOTE],
+ 255);
+ }
+ else
+ clutter_actor_set_opacity (cw->priv->video_stream[type],
+ 255);
- if (cw->priv->ext_video_win && ext_stream) {
- gtk_widget_show_now (cw->priv->ext_video_win);
- }
- */
+ gtk_menu_section_set_sensitive (cw->priv->main_menu, "pip", both_streams);
}
static void
@@ -666,6 +682,7 @@ on_videooutput_device_closed_cb (Ekiga::VideoOutputManager & /* manager */, gpoi
cw->priv->video_stream_natural_width[type],
cw->priv->video_stream_natural_height[type],
clutter_actor_get_height (CLUTTER_ACTOR (cw->priv->stage)));
+ gtk_menu_section_set_sensitive (cw->priv->main_menu, "pip", FALSE);
}
}
@@ -1928,13 +1945,19 @@ ekiga_call_window_init_menu (EkigaCallWindow *cw)
GTK_MENU_SEPARATOR,
- GTK_MENU_ENTRY("close", NULL, _("Close the Ekiga window"),
+ GTK_MENU_ENTRY("close", NULL, _("Close the Ekiga Window"),
GTK_STOCK_CLOSE, 'W',
G_CALLBACK (window_closed_from_menu_cb),
cw, TRUE),
GTK_MENU_NEW(_("_View")),
+ GTK_MENU_TOGGLE_ENTRY("pip", _("Enable _Picture-In-Picture Mode"),
+ _("This allows the local video stream to be displayed incrusted in the remote
video stream. This is only effective when sending and receiving video"),
+ NULL, 'P',
+ cw->priv->video_display_settings->get_g_settings (), "enable-pip",
+ FALSE),
+
GTK_MENU_SEPARATOR,
GTK_MENU_ENTRY("fullscreen", _("_Fullscreen"), _("Switch to fullscreen"),
@@ -2573,6 +2596,10 @@ call_window_new (Ekiga::ServiceCore & core)
"changed::stay-on-top",
G_CALLBACK (stay_on_top_changed_cb), cw);
+ g_signal_connect (cw->priv->video_display_settings->get_g_settings (),
+ "changed::enable-pip",
+ G_CALLBACK (pip_mode_changed_cb), cw);
+
gtk_window_set_title (GTK_WINDOW (cw), _("Call Window"));
return GTK_WIDGET (cw);
diff --git a/lib/engine/gui/gtk-frontend/preferences-window.cpp
b/lib/engine/gui/gtk-frontend/preferences-window.cpp
index 4736b65..1a693dd 100644
--- a/lib/engine/gui/gtk-frontend/preferences-window.cpp
+++ b/lib/engine/gui/gtk-frontend/preferences-window.cpp
@@ -570,6 +570,10 @@ gm_pw_init_general_page (PreferencesWindow *self,
self->priv->video_display_settings, "stay-on-top",
_("Place windows displaying video above other windows during calls"));
+ gm_pw_toggle_new (container, _("Enable _Picture-In-Picture Mode"),
+ self->priv->video_display_settings, "enable-pip",
+ _("This allows the local video stream to be displayed incrusted in the remote video
stream. This is only effective when sending and receiving video"));
+
/* Network Settings */
gm_pw_subsection_new (container, _("Network Settings"));
gm_pw_spin_new (container, _("Type of Service (TOS):"), NULL,
diff --git a/org.gnome.ekiga.gschema.xml.in.in b/org.gnome.ekiga.gschema.xml.in.in
index 13e569d..32a9476 100644
--- a/org.gnome.ekiga.gschema.xml.in.in
+++ b/org.gnome.ekiga.gschema.xml.in.in
@@ -294,6 +294,11 @@
<_summary>Place windows displaying video above other windows during calls</_summary>
<_description>Place windows displaying video above other windows during calls</_description>
</key>
+ <key name="enable-pip" type="b">
+ <default>true</default>
+ <_summary>Enable Picture-In-Picture mode</_summary>
+ <_description>This allows the local video stream to be displayed incrusted in the remote video stream.
This is only effective when sending and receiving video.</_description>
+ </key>
</schema>
<schema gettext-domain="@GETTEXT_PACKAGE@" id="org gnome
PACKAGE_NAME@.general.user-interface.remote-video-window"
path="/org/gnome/@PACKAGE_NAME@/general/user-interface/remote-video-window/">
<key name="size" type="s">
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]