Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
03648ce9
Commit
03648ce9
authored
Jun 16, 2014
by
Felix Paul Kühne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
macosx: fix post-proc menu item (refs #11613)
parent
10027f27
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
128 additions
and
6 deletions
+128
-6
modules/gui/macosx/MainMenu.h
modules/gui/macosx/MainMenu.h
+1
-0
modules/gui/macosx/MainMenu.m
modules/gui/macosx/MainMenu.m
+127
-6
No files found.
modules/gui/macosx/MainMenu.h
View file @
03648ce9
...
...
@@ -277,6 +277,7 @@
-
(
IBAction
)
switchSubtitleBackgroundOpacity
:(
id
)
sender
;
-
(
IBAction
)
telxTransparent
:(
id
)
sender
;
-
(
IBAction
)
telxNavLink
:(
id
)
sender
;
-
(
IBAction
)
togglePostProcessing
:(
id
)
sender
;
-
(
IBAction
)
showWizard
:(
id
)
sender
;
-
(
IBAction
)
showConvertAndSave
:(
id
)
sender
;
...
...
modules/gui/macosx/MainMenu.m
View file @
03648ce9
...
...
@@ -267,6 +267,37 @@ static VLCMainMenu *_o_sharedInstance = nil;
[
self
setupExtensionsMenu
];
NSUInteger
count
=
(
NSUInteger
)
[
o_mu_ffmpeg_pp
numberOfItems
];
if
(
count
>
0
)
[
o_mu_ffmpeg_pp
removeAllItems
];
NSMenuItem
*
o_mitem
;
[
o_mu_ffmpeg_pp
setAutoenablesItems
:
YES
];
[
o_mu_ffmpeg_pp
addItemWithTitle
:
_NS
(
"Disable"
)
action
:
@selector
(
togglePostProcessing
:
)
keyEquivalent
:
@""
];
o_mitem
=
[
o_mu_ffmpeg_pp
itemAtIndex
:
0
];
[
o_mitem
setTag
:
-
1
];
[
o_mitem
setEnabled
:
YES
];
[
o_mitem
setTarget
:
self
];
for
(
NSUInteger
x
=
0
;
x
<
7
;
x
++
)
{
[
o_mu_ffmpeg_pp
addItemWithTitle
:[
NSString
stringWithFormat
:
_NS
(
"Level %i"
),
x
]
action:
@selector
(
togglePostProcessing
:)
keyEquivalent:
@""
];
o_mitem
=
[
o_mu_ffmpeg_pp
itemAtIndex
:
x
+
1
];
[
o_mitem
setEnabled
:
YES
];
[
o_mitem
setTag
:
x
];
[
o_mitem
setTarget
:
self
];
}
char
*
psz_config
=
config_GetPsz
(
p_intf
,
"video-filter"
);
if
(
psz_config
)
{
if
(
!
strstr
(
psz_config
,
"postprocess"
))
[[
o_mu_ffmpeg_pp
itemAtIndex
:
0
]
setState
:
NSOnState
];
else
[[
o_mu_ffmpeg_pp
itemWithTag
:
config_GetInt
(
p_intf
,
"postproc-q"
)]
setState
:
NSOnState
];
free
(
psz_config
);
}
else
[[
o_mu_ffmpeg_pp
itemAtIndex
:
0
]
setState
:
NSOnState
];
[
o_mi_ffmpeg_pp
setEnabled
:
NO
];
[
self
refreshAudioDeviceList
];
/* setup subtitles menu */
...
...
@@ -583,17 +614,16 @@ static VLCMainMenu *_o_sharedInstance = nil;
[
self
setupVarMenuItem
:
o_mi_deinterlace_mode
target
:
(
vlc_object_t
*
)
p_vout
var:
"deinterlace-mode"
selector
:
@selector
(
toggleVar
:
)];
[
self
setupVarMenuItem
:
o_mi_ffmpeg_pp
target
:
(
vlc_object_t
*
)
p_vout
var:
"postprocess"
selector
:
@selector
(
toggleVar
:
)];
vlc_object_release
(
p_vout
);
[
self
refreshVoutDeviceMenu
:
nil
];
}
[
o_mi_ffmpeg_pp
setEnabled
:
YES
];
vlc_object_release
(
p_input
);
}
else
}
else
{
[
o_mi_record
setEnabled
:
NO
];
[
o_mi_ffmpeg_pp
setEnabled
:
NO
];
}
}
-
(
void
)
refreshVoutDeviceMenu
:(
NSNotification
*
)
o_notification
...
...
@@ -637,7 +667,6 @@ static VLCMainMenu *_o_sharedInstance = nil;
[
o_mi_channels
setEnabled
:
b_enabled
];
[
o_mi_deinterlace
setEnabled
:
b_enabled
];
[
o_mi_deinterlace_mode
setEnabled
:
b_enabled
];
[
o_mi_ffmpeg_pp
setEnabled
:
b_enabled
];
[
o_mi_screen
setEnabled
:
b_enabled
];
[
o_mi_aspect_ratio
setEnabled
:
b_enabled
];
[
o_mi_crop
setEnabled
:
b_enabled
];
...
...
@@ -930,6 +959,98 @@ static VLCMainMenu *_o_sharedInstance = nil;
}
}
-
(
void
)
_disablePostProcessing
{
char
*
psz_name
=
"postprocess"
;
char
*
psz_string
,
*
psz_parser
;
psz_string
=
config_GetPsz
(
p_intf
,
"video-filter"
);
if
(
!
psz_string
)
return
;
psz_parser
=
strstr
(
psz_string
,
psz_name
);
if
(
psz_parser
)
{
if
(
*
(
psz_parser
+
strlen
(
psz_name
))
==
':'
)
{
memmove
(
psz_parser
,
psz_parser
+
strlen
(
psz_name
)
+
1
,
strlen
(
psz_parser
+
strlen
(
psz_name
)
+
1
)
+
1
);
}
else
*
psz_parser
=
'\0'
;
/* Remove trailing : : */
if
(
strlen
(
psz_string
)
>
0
&&
*
(
psz_string
+
strlen
(
psz_string
)
-
1
)
==
':'
)
*
(
psz_string
+
strlen
(
psz_string
)
-
1
)
=
'\0'
;
}
else
{
free
(
psz_string
);
return
;
}
config_PutPsz
(
p_intf
,
"video-filter"
,
psz_string
);
/* Try to set on the fly */
vout_thread_t
*
p_vout
=
getVout
();
if
(
p_vout
)
{
var_SetString
(
p_vout
,
"video-filter"
,
psz_string
);
vlc_object_release
(
p_vout
);
}
}
-
(
void
)
_enablePostProcessing
{
char
*
psz_name
=
"postprocess"
;
char
*
psz_string
,
*
psz_parser
;
psz_string
=
config_GetPsz
(
p_intf
,
"video-filter"
);
if
(
psz_string
==
NULL
)
psz_string
=
psz_name
;
else
if
(
strstr
(
psz_string
,
psz_name
)
==
NULL
)
{
char
*
psz_tmp
=
strdup
([[
NSString
stringWithFormat
:
@"%s:%s"
,
psz_string
,
psz_name
]
UTF8String
]);
free
(
psz_string
);
psz_string
=
psz_tmp
;
}
config_PutPsz
(
p_intf
,
"video-filter"
,
psz_string
);
/* Try to set on the fly */
vout_thread_t
*
p_vout
=
getVout
();
if
(
p_vout
)
{
var_SetString
(
p_vout
,
"video-filter"
,
psz_string
);
vlc_object_release
(
p_vout
);
}
}
-
(
IBAction
)
togglePostProcessing
:(
id
)
sender
{
char
*
psz_name
=
"postprocess"
;
NSInteger
count
=
[
o_mu_ffmpeg_pp
numberOfItems
];
for
(
NSUInteger
x
=
0
;
x
<
count
;
x
++
)
[[
o_mu_ffmpeg_pp
itemAtIndex
:
x
]
setState
:
NSOffState
];
if
([
sender
tag
]
==
-
1
)
{
[
self
_disablePostProcessing
];
[
sender
setState
:
NSOnState
];
}
else
{
[
self
_enablePostProcessing
];
[
sender
setState
:
NSOnState
];
vout_thread_t
*
p_vout
=
getVout
();
vlc_object_t
*
p_filter
;
config_PutInt
(
p_intf
,
"postproc-q"
,
[
sender
tag
]);
if
(
p_vout
)
{
p_filter
=
vlc_object_find_name
(
pl_Get
(
p_intf
),
psz_name
);
if
(
!
p_filter
)
{
msg_Warn
(
p_intf
,
"filter '%s' isn't enabled"
,
psz_name
);
vlc_object_release
(
p_vout
);
return
;
}
var_SetInteger
(
p_filter
,
"postproc-q"
,
[
sender
tag
]);
vlc_object_release
(
p_vout
);
vlc_object_release
(
p_filter
);
}
}
}
-
(
IBAction
)
toggleFullscreenDevice
:(
id
)
sender
{
config_PutInt
(
VLCIntf
,
"macosx-vdev"
,
[
sender
tag
]);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment