[vlc-devel] [PATCH 01/23] macosx: save/retrieve video filters to/from the playlist

Victorien Le Couviour--Tuffet victorien.lecouviour.tuffet at gmail.com
Thu Jun 29 14:24:08 CEST 2017


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

diff --git a/modules/gui/macosx/VLCCoreInteraction.m b/modules/gui/macosx/VLCCoreInteraction.m
index 912ff8bc25..abda75c6fd 100644
--- a/modules/gui/macosx/VLCCoreInteraction.m
+++ b/modules/gui/macosx/VLCCoreInteraction.m
@@ -735,6 +735,7 @@ static int BossCallback(vlc_object_t *p_this, const char *psz_var,
     intf_thread_t *p_intf = getIntf();
     if (!p_intf)
         return;
+    playlist_t *p_playlist = pl_Get(p_intf);
     char *psz_string, *psz_parser;
 
     const char *psz_filter_type = [self getFilterType:psz_name];
@@ -745,8 +746,7 @@ static int BossCallback(vlc_object_t *p_this, const char *psz_var,
 
     msg_Dbg(p_intf, "will set filter '%s'", psz_name);
 
-
-    psz_string = config_GetPsz(p_intf, psz_filter_type);
+    psz_string = var_InheritString(p_playlist, psz_filter_type);
 
     if (b_on) {
         if (psz_string == NULL) {
@@ -777,13 +777,10 @@ static int BossCallback(vlc_object_t *p_this, const char *psz_var,
             return;
         }
     }
-    config_PutPsz(p_intf, psz_filter_type, psz_string);
+    var_SetString(p_playlist, psz_filter_type, psz_string);
 
-    /* Try to set on the fly */
-    if (!strcmp(psz_filter_type, "video-splitter")) {
-        playlist_t *p_playlist = pl_Get(p_intf);
-        var_SetString(p_playlist, psz_filter_type, psz_string);
-    } else {
+    /* Try to set non splitter filters on the fly */
+    if (strcmp(psz_filter_type, "video-splitter")) {
         vout_thread_t *p_vout = getVout();
         if (p_vout) {
             var_SetString(p_vout, psz_filter_type, psz_string);
diff --git a/modules/gui/macosx/VLCVideoEffectsWindowController.m b/modules/gui/macosx/VLCVideoEffectsWindowController.m
index 79f5f1d2a3..27cba7e6b1 100644
--- a/modules/gui/macosx/VLCVideoEffectsWindowController.m
+++ b/modules/gui/macosx/VLCVideoEffectsWindowController.m
@@ -253,13 +253,14 @@
 - (void)resetValues
 {
     intf_thread_t *p_intf = getIntf();
+    playlist_t *p_playlist = pl_Get(p_intf);
     NSString *tmpString;
     char *tmpChar;
     BOOL b_state;
 
     /* do we have any filter enabled? if yes, show it. */
     char * psz_vfilters;
-    psz_vfilters = config_GetPsz(p_intf, "video-filter");
+    psz_vfilters = var_InheritString(p_playlist, "video-filter");
     if (psz_vfilters) {
         [_adjustCheckbox setState: (NSInteger)strstr(psz_vfilters, "adjust")];
         [_sharpenCheckbox setState: (NSInteger)strstr(psz_vfilters, "sharpen")];
@@ -305,7 +306,7 @@
         [_anaglyphCheckbox setState: NSOffState];
     }
 
-    psz_vfilters = config_GetPsz(p_intf, "sub-source");
+    psz_vfilters = var_InheritString(p_playlist, "sub-source");
     if (psz_vfilters) {
         [_addTextCheckbox setState: (NSInteger)strstr(psz_vfilters, "marq")];
         [_addLogoCheckbox setState: (NSInteger)strstr(psz_vfilters, "logo")];
@@ -315,7 +316,7 @@
         [_addLogoCheckbox setState: NSOffState];
     }
 
-    psz_vfilters = config_GetPsz(p_intf, "video-splitter");
+    psz_vfilters = var_InheritString(p_playlist, "video-splitter");
     if (psz_vfilters) {
         [_cloneCheckbox setState: (NSInteger)strstr(psz_vfilters, "clone")];
         [_wallCheckbox setState: (NSInteger)strstr(psz_vfilters, "wall")];
-- 
2.13.1



More information about the vlc-devel mailing list