Commit 441bac0a authored by Victorien Le Couviour--Tuffet's avatar Victorien Le Couviour--Tuffet Committed by Jean-Baptiste Kempf

macosx: save/retrieve video filters to/from the playlist

Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent ef708542
......@@ -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);
......
......@@ -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")];
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment