[vlc-commits] macosx: duplicate video filters options in the playlist

Victorien Le Couviour--Tuffet git at videolan.org
Thu Jul 13 11:24:03 CEST 2017


vlc | branch: master | Victorien Le Couviour--Tuffet <victorien.lecouviour.tuffet at gmail.com> | Tue Jun 20 16:35:27 2017 +0200| [b3d9857b4fc4ad46e1a56d1a31b15cd2485fcd83] | committer: Jean-Baptiste Kempf

macosx: duplicate video filters options in the playlist

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=b3d9857b4fc4ad46e1a56d1a31b15cd2485fcd83
---

 modules/gui/macosx/VLCCoreInteraction.m              | 13 +++++++++++++
 modules/gui/macosx/VLCVideoEffectsWindowController.m |  9 ++++-----
 2 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/modules/gui/macosx/VLCCoreInteraction.m b/modules/gui/macosx/VLCCoreInteraction.m
index 914cbc9423..7ac339b0ec 100644
--- a/modules/gui/macosx/VLCCoreInteraction.m
+++ b/modules/gui/macosx/VLCCoreInteraction.m
@@ -799,6 +799,7 @@ static int BossCallback(vlc_object_t *p_this, const char *psz_var,
 {
     NSArray<NSValue *> *vouts = getVouts();
     intf_thread_t *p_intf = getIntf();
+    playlist_t *p_playlist = pl_Get(p_intf);
     if (!p_intf)
         return;
     int i_type;
@@ -819,13 +820,25 @@ static int BossCallback(vlc_object_t *p_this, const char *psz_var,
 
     i_type &= VLC_VAR_CLASS;
     if (i_type == VLC_VAR_BOOL)
+    {
+        var_SetBool(p_playlist, psz_property, value.b_bool);
         config_PutInt(p_intf, psz_property, (int64_t)value.b_bool);
+    }
     else if (i_type == VLC_VAR_INTEGER)
+    {
+        var_SetInteger(p_playlist, psz_property, value.i_int);
         config_PutInt(p_intf, psz_property, value.i_int);
+    }
     else if (i_type == VLC_VAR_FLOAT)
+    {
         config_PutFloat(p_intf, psz_property, value.f_float);
+        var_SetFloat(p_playlist, psz_property, value.f_float);
+    }
     else if (i_type == VLC_VAR_STRING)
+    {
         config_PutPsz(p_intf, psz_property, EnsureUTF8(value.psz_string));
+        var_SetString(p_playlist, psz_property, EnsureUTF8(value.psz_string));
+    }
     else
     {
         msg_Err(p_intf,
diff --git a/modules/gui/macosx/VLCVideoEffectsWindowController.m b/modules/gui/macosx/VLCVideoEffectsWindowController.m
index 2ff5470116..9562fe63b6 100644
--- a/modules/gui/macosx/VLCVideoEffectsWindowController.m
+++ b/modules/gui/macosx/VLCVideoEffectsWindowController.m
@@ -267,6 +267,7 @@
 - (void)setWidgetValue: (id)widget forOption: (char *)psz_option enabled: (bool)b_state
 {
     intf_thread_t *p_intf = getIntf();
+    playlist_t *p_playlist = pl_Get(p_intf);
 
     vlc_value_t val;
     int i_type = config_GetType(p_intf, psz_option) & VLC_VAR_CLASS;
@@ -274,18 +275,16 @@
     {
     case VLC_VAR_BOOL:
     case VLC_VAR_INTEGER:
-        val.i_int = config_GetInt(p_intf, psz_option);
-        break;
     case VLC_VAR_FLOAT:
-        val.f_float = config_GetFloat(p_intf, psz_option);
-        break;
     case VLC_VAR_STRING:
-        val.psz_string = config_GetPsz(p_intf, psz_option);
         break;
     default:
         msg_Err(p_intf, "%s variable is of an unsupported type (%d)", psz_option, i_type);
         return;
     }
+    if (var_Create(p_playlist, psz_option, i_type | VLC_VAR_DOINHERIT) ||
+        var_GetChecked(p_playlist, psz_option, i_type, &val))
+        return;
 
     if (i_type == VLC_VAR_BOOL || i_type == VLC_VAR_INTEGER)
     {



More information about the vlc-commits mailing list