Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
Steve Lhomme
VLC
Commits
b102a078
Commit
b102a078
authored
Jun 16, 2017
by
Victorien Le Couviour--Tuffet
Committed by
Jean-Baptiste Kempf
Jul 13, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
macosx: refactor VLCVideoEffectsWindowController::resetValues
Signed-off-by:
Jean-Baptiste Kempf
<
jb@videolan.org
>
parent
d9c47b95
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
121 additions
and
105 deletions
+121
-105
modules/gui/macosx/VLCVideoEffectsWindowController.m
modules/gui/macosx/VLCVideoEffectsWindowController.m
+121
-105
No files found.
modules/gui/macosx/VLCVideoEffectsWindowController.m
View file @
b102a078
...
@@ -27,6 +27,7 @@
...
@@ -27,6 +27,7 @@
#import "VLCPopupPanelController.h"
#import "VLCPopupPanelController.h"
#import "VLCTextfieldPanelController.h"
#import "VLCTextfieldPanelController.h"
#import "VLCCoreInteraction.h"
#import "VLCCoreInteraction.h"
#import "VLCHexNumberFormatter.h"
@interface
VLCVideoEffectsWindowController
()
@interface
VLCVideoEffectsWindowController
()
{
{
...
@@ -97,14 +98,19 @@
...
@@ -97,14 +98,19 @@
[
_transformCheckbox
setTitle
:
_NS
(
"Transform"
)];
[
_transformCheckbox
setTitle
:
_NS
(
"Transform"
)];
[
_transformPopup
removeAllItems
];
[
_transformPopup
removeAllItems
];
[
_transformPopup
addItemWithTitle
:
_NS
(
"Rotate by 90 degrees"
)];
[
_transformPopup
addItemWithTitle
:
_NS
(
"Rotate by 90 degrees"
)];
[[
_transformPopup
lastItem
]
setRepresentedObject
:
@"90"
];
[[
_transformPopup
lastItem
]
setTag
:
90
];
[[
_transformPopup
lastItem
]
setTag
:
90
];
[
_transformPopup
addItemWithTitle
:
_NS
(
"Rotate by 180 degrees"
)];
[
_transformPopup
addItemWithTitle
:
_NS
(
"Rotate by 180 degrees"
)];
[[
_transformPopup
lastItem
]
setRepresentedObject
:
@"180"
];
[[
_transformPopup
lastItem
]
setTag
:
180
];
[[
_transformPopup
lastItem
]
setTag
:
180
];
[
_transformPopup
addItemWithTitle
:
_NS
(
"Rotate by 270 degrees"
)];
[
_transformPopup
addItemWithTitle
:
_NS
(
"Rotate by 270 degrees"
)];
[[
_transformPopup
lastItem
]
setRepresentedObject
:
@"270"
];
[[
_transformPopup
lastItem
]
setTag
:
270
];
[[
_transformPopup
lastItem
]
setTag
:
270
];
[
_transformPopup
addItemWithTitle
:
_NS
(
"Flip horizontally"
)];
[
_transformPopup
addItemWithTitle
:
_NS
(
"Flip horizontally"
)];
[[
_transformPopup
lastItem
]
setRepresentedObject
:
@"hflip"
];
[[
_transformPopup
lastItem
]
setTag
:
1
];
[[
_transformPopup
lastItem
]
setTag
:
1
];
[
_transformPopup
addItemWithTitle
:
_NS
(
"Flip vertically"
)];
[
_transformPopup
addItemWithTitle
:
_NS
(
"Flip vertically"
)];
[[
_transformPopup
lastItem
]
setRepresentedObject
:
@"vflip"
];
[[
_transformPopup
lastItem
]
setTag
:
2
];
[[
_transformPopup
lastItem
]
setTag
:
2
];
[
_zoomCheckbox
setTitle
:
_NS
(
"Magnification/Zoom"
)];
[
_zoomCheckbox
setTitle
:
_NS
(
"Magnification/Zoom"
)];
[
_puzzleCheckbox
setTitle
:
_NS
(
"Puzzle game"
)];
[
_puzzleCheckbox
setTitle
:
_NS
(
"Puzzle game"
)];
...
@@ -118,6 +124,7 @@
...
@@ -118,6 +124,7 @@
[
_thresholdCheckbox
setTitle
:
_NS
(
"Color threshold"
)];
[
_thresholdCheckbox
setTitle
:
_NS
(
"Color threshold"
)];
[
_thresholdColorLabel
setStringValue
:
_NS
(
"Color"
)];
[
_thresholdColorLabel
setStringValue
:
_NS
(
"Color"
)];
[
_thresholdColorTextField
setFormatter
:[[
VLCHexNumberFormatter
alloc
]
init
]];
[
_thresholdSaturationLabel
setStringValue
:
_NS
(
"Saturation"
)];
[
_thresholdSaturationLabel
setStringValue
:
_NS
(
"Saturation"
)];
[
_thresholdSimilarityLabel
setStringValue
:
_NS
(
"Similarity"
)];
[
_thresholdSimilarityLabel
setStringValue
:
_NS
(
"Similarity"
)];
[
_sepiaCheckbox
setTitle
:
_NS
(
"Sepia"
)];
[
_sepiaCheckbox
setTitle
:
_NS
(
"Sepia"
)];
...
@@ -127,15 +134,19 @@
...
@@ -127,15 +134,19 @@
[
_gradientModeLabel
setStringValue
:
_NS
(
"Mode"
)];
[
_gradientModeLabel
setStringValue
:
_NS
(
"Mode"
)];
[
_gradientModePopup
removeAllItems
];
[
_gradientModePopup
removeAllItems
];
[
_gradientModePopup
addItemWithTitle
:
_NS
(
"Gradient"
)];
[
_gradientModePopup
addItemWithTitle
:
_NS
(
"Gradient"
)];
[[
_gradientModePopup
lastItem
]
setRepresentedObject
:
@"gradient"
];
[[
_gradientModePopup
lastItem
]
setTag
:
1
];
[[
_gradientModePopup
lastItem
]
setTag
:
1
];
[
_gradientModePopup
addItemWithTitle
:
_NS
(
"Edge"
)];
[
_gradientModePopup
addItemWithTitle
:
_NS
(
"Edge"
)];
[[
_gradientModePopup
lastItem
]
setRepresentedObject
:
@"edge"
];
[[
_gradientModePopup
lastItem
]
setTag
:
2
];
[[
_gradientModePopup
lastItem
]
setTag
:
2
];
[
_gradientModePopup
addItemWithTitle
:
_NS
(
"Hough"
)];
[
_gradientModePopup
addItemWithTitle
:
_NS
(
"Hough"
)];
[[
_gradientModePopup
lastItem
]
setRepresentedObject
:
@"hough"
];
[[
_gradientModePopup
lastItem
]
setTag
:
3
];
[[
_gradientModePopup
lastItem
]
setTag
:
3
];
[
_gradientColorCheckbox
setTitle
:
_NS
(
"Color"
)];
[
_gradientColorCheckbox
setTitle
:
_NS
(
"Color"
)];
[
_gradientCartoonCheckbox
setTitle
:
_NS
(
"Cartoon"
)];
[
_gradientCartoonCheckbox
setTitle
:
_NS
(
"Cartoon"
)];
[
_extractCheckbox
setTitle
:
_NS
(
"Color extraction"
)];
[
_extractCheckbox
setTitle
:
_NS
(
"Color extraction"
)];
[
_extractLabel
setStringValue
:
_NS
(
"Color"
)];
[
_extractLabel
setStringValue
:
_NS
(
"Color"
)];
[
_extractTextField
setFormatter
:[[
VLCHexNumberFormatter
alloc
]
init
]];
[
_invertCheckbox
setTitle
:
_NS
(
"Invert colors"
)];
[
_invertCheckbox
setTitle
:
_NS
(
"Invert colors"
)];
[
_posterizeCheckbox
setTitle
:
_NS
(
"Posterize"
)];
[
_posterizeCheckbox
setTitle
:
_NS
(
"Posterize"
)];
[
_posterizeLabel
setStringValue
:
_NS
(
"Posterize level"
)];
[
_posterizeLabel
setStringValue
:
_NS
(
"Posterize level"
)];
...
@@ -146,7 +157,6 @@
...
@@ -146,7 +157,6 @@
[
_wavesCheckbox
setTitle
:
_NS
(
"Waves"
)];
[
_wavesCheckbox
setTitle
:
_NS
(
"Waves"
)];
[
_psychedelicCheckbox
setTitle
:
_NS
(
"Psychedelic"
)];
[
_psychedelicCheckbox
setTitle
:
_NS
(
"Psychedelic"
)];
[
_anaglyphCheckbox
setTitle
:
_NS
(
"Anaglyph"
)];
[
_anaglyphCheckbox
setTitle
:
_NS
(
"Anaglyph"
)];
[
_addTextCheckbox
setTitle
:
_NS
(
"Add text"
)];
[
_addTextCheckbox
setTitle
:
_NS
(
"Add text"
)];
[
_addTextTextLabel
setStringValue
:
_NS
(
"Text"
)];
[
_addTextTextLabel
setStringValue
:
_NS
(
"Text"
)];
[
_addTextPositionLabel
setStringValue
:
_NS
(
"Position"
)];
[
_addTextPositionLabel
setStringValue
:
_NS
(
"Position"
)];
...
@@ -200,7 +210,6 @@
...
@@ -200,7 +210,6 @@
name:
VLCInputChangedNotification
name:
VLCInputChangedNotification
object:
nil
];
object:
nil
];
[
self
resetValues
];
[
self
resetValues
];
}
}
...
@@ -250,6 +259,79 @@
...
@@ -250,6 +259,79 @@
[
self
profileSelectorAction
:
self
];
[
self
profileSelectorAction
:
self
];
}
}
-
(
void
)
setWidgetValue
:
(
id
)
widget
forOption
:
(
char
*
)
psz_option
enabled
:
(
bool
)
b_state
{
intf_thread_t
*
p_intf
=
getIntf
();
vlc_value_t
val
;
int
i_type
=
config_GetType
(
p_intf
,
psz_option
)
&
VLC_VAR_CLASS
;
switch
(
i_type
)
{
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
(
i_type
==
VLC_VAR_BOOL
||
i_type
==
VLC_VAR_INTEGER
)
{
if
([
widget
isKindOfClass
:
[
NSSlider
class
]])
{
[
widget
setIntValue
:
val
.
i_int
];
[
widget
setToolTip
:
[
NSString
stringWithFormat
:
@"%lli"
,
val
.
i_int
]];
}
else
if
([
widget
isKindOfClass
:
[
NSButton
class
]])
[
widget
setState
:
val
.
i_int
?
NSOnState
:
NSOffState
];
else
if
([
widget
isKindOfClass
:
[
NSTextField
class
]])
[
widget
setIntValue
:
val
.
i_int
];
else
if
([
widget
isKindOfClass
:
[
NSStepper
class
]])
[
widget
setIntValue
:
val
.
i_int
];
else
if
([
widget
isKindOfClass
:
[
NSPopUpButton
class
]])
[
widget
selectItemWithTag
:
val
.
i_int
];
else
msg_Warn
(
p_intf
,
"Could not find the correct Integer widget"
);
}
else
if
(
i_type
==
VLC_VAR_FLOAT
)
{
if
([
widget
isKindOfClass
:
[
NSSlider
class
]])
{
[
widget
setFloatValue
:
val
.
f_float
];
[
widget
setToolTip
:
[
NSString
stringWithFormat
:
@"%0.3f"
,
val
.
f_float
]];
}
else
msg_Warn
(
p_intf
,
"Could not find the correct Float widget"
);
}
else
if
(
i_type
==
VLC_VAR_STRING
)
{
if
([
widget
isKindOfClass
:
[
NSPopUpButton
class
]])
{
for
(
NSMenuItem
*
item
in
[
widget
itemArray
])
if
([
item
representedObject
]
&&
!
strcmp
([[
item
representedObject
]
UTF8String
],
val
.
psz_string
))
{
[
widget
selectItemWithTitle
:
[
item
title
]];
break
;
}
}
else
if
([
widget
isKindOfClass
:
[
NSTextField
class
]])
[
widget
setStringValue
:
toNSStr
(
val
.
psz_string
)];
else
msg_Warn
(
p_intf
,
"Could not find the correct String widget"
);
free
(
val
.
psz_string
);
}
[
widget
setEnabled
:
b_state
];
}
-
(
void
)
resetValues
-
(
void
)
resetValues
{
{
intf_thread_t
*
p_intf
=
getIntf
();
intf_thread_t
*
p_intf
=
getIntf
();
...
@@ -327,25 +409,13 @@
...
@@ -327,25 +409,13 @@
}
}
/* fetch and show the various values */
/* fetch and show the various values */
[
_adjustHueSlider
setFloatValue
:
config_GetFloat
(
p_intf
,
"hue"
)];
[
_adjustContrastSlider
setFloatValue
:
config_GetFloat
(
p_intf
,
"contrast"
)];
[
_adjustBrightnessSlider
setFloatValue
:
config_GetFloat
(
p_intf
,
"brightness"
)];
[
_adjustSaturationSlider
setFloatValue
:
config_GetFloat
(
p_intf
,
"saturation"
)];
[
_adjustBrightnessCheckbox
setState
:(
config_GetInt
(
p_intf
,
"brightness-threshold"
)
!=
0
?
NSOnState
:
NSOffState
)];
[
_adjustGammaSlider
setFloatValue
:
config_GetFloat
(
p_intf
,
"gamma"
)];
[
_adjustBrightnessSlider
setToolTip
:
[
NSString
stringWithFormat
:
@"%0.3f"
,
config_GetFloat
(
p_intf
,
"brightness"
)]];
[
_adjustContrastSlider
setToolTip
:
[
NSString
stringWithFormat
:
@"%0.3f"
,
config_GetFloat
(
p_intf
,
"contrast"
)]];
[
_adjustGammaSlider
setToolTip
:
[
NSString
stringWithFormat
:
@"%0.3f"
,
config_GetFloat
(
p_intf
,
"gamma"
)]];
[
_adjustHueSlider
setToolTip
:
[
NSString
stringWithFormat
:
@"%.0f"
,
config_GetFloat
(
p_intf
,
"hue"
)]];
[
_adjustSaturationSlider
setToolTip
:
[
NSString
stringWithFormat
:
@"%0.3f"
,
config_GetFloat
(
p_intf
,
"saturation"
)]];
b_state
=
[
_adjustCheckbox
state
];
b_state
=
[
_adjustCheckbox
state
];
[
self
setWidgetValue
:
_adjustHueSlider
forOption
:
"hue"
enabled
:
b_state
];
[
_adjustBrightnessSlider
setEnabled
:
b_state
];
[
self
setWidgetValue
:
_adjustContrastSlider
forOption
:
"contrast"
enabled
:
b_state
];
[
_adjustBrightnessCheckbox
setEnabled
:
b_state
];
[
self
setWidgetValue
:
_adjustBrightnessSlider
forOption
:
"brightness"
enabled
:
b_state
];
[
_adjustContrastSlider
setEnabled
:
b_state
];
[
self
setWidgetValue
:
_adjustSaturationSlider
forOption
:
"saturation"
enabled
:
b_state
];
[
_adjustGammaSlider
setEnabled
:
b_state
];
[
self
setWidgetValue
:
_adjustBrightnessCheckbox
forOption
:
"brightness-threshold"
enabled
:
b_state
];
[
_adjustHueSlider
setEnabled
:
b_state
];
[
self
setWidgetValue
:
_adjustGammaSlider
forOption
:
"gamma"
enabled
:
b_state
];
[
_adjustSaturationSlider
setEnabled
:
b_state
];
[
_adjustBrightnessLabel
setEnabled
:
b_state
];
[
_adjustBrightnessLabel
setEnabled
:
b_state
];
[
_adjustContrastLabel
setEnabled
:
b_state
];
[
_adjustContrastLabel
setEnabled
:
b_state
];
[
_adjustGammaLabel
setEnabled
:
b_state
];
[
_adjustGammaLabel
setEnabled
:
b_state
];
...
@@ -353,19 +423,13 @@
...
@@ -353,19 +423,13 @@
[
_adjustSaturationLabel
setEnabled
:
b_state
];
[
_adjustSaturationLabel
setEnabled
:
b_state
];
[
_adjustResetButton
setEnabled
:
b_state
];
[
_adjustResetButton
setEnabled
:
b_state
];
[
_sharpenSlider
setFloatValue
:
config_GetFloat
(
p_intf
,
"sharpen-sigma"
)];
[
self
setWidgetValue
:
_sharpenSlider
forOption
:
"sharpen-sigma"
enabled
:
[
_sharpenCheckbox
state
]];
[
_sharpenSlider
setToolTip
:
[
NSString
stringWithFormat
:
@"%0.3f"
,
config_GetFloat
(
p_intf
,
"sharpen-sigma"
)]];
[
_sharpenSlider
setEnabled
:
[
_sharpenCheckbox
state
]];
[
_sharpenLabel
setEnabled
:
[
_sharpenCheckbox
state
]];
[
_sharpenLabel
setEnabled
:
[
_sharpenCheckbox
state
]];
[
_bandingSlider
setIntValue
:
config_GetInt
(
p_intf
,
"gradfun-radius"
)];
[
self
setWidgetValue
:
_bandingSlider
forOption
:
"gradfun-radius"
enabled
:
[
_bandingCheckbox
state
]];
[
_bandingSlider
setToolTip
:
[
NSString
stringWithFormat
:
@"%lli"
,
config_GetInt
(
p_intf
,
"gradfun-radius"
)]];
[
_bandingSlider
setEnabled
:
[
_bandingCheckbox
state
]];
[
_bandingLabel
setEnabled
:
[
_bandingCheckbox
state
]];
[
_bandingLabel
setEnabled
:
[
_bandingCheckbox
state
]];
[
_grainSlider
setFloatValue
:
config_GetFloat
(
p_intf
,
"grain-variance"
)];
[
self
setWidgetValue
:
_grainSlider
forOption
:
"grain-variance"
enabled
:
[
_grainCheckbox
state
]];
[
_grainSlider
setToolTip
:
[
NSString
stringWithFormat
:
@"%0.3f"
,
config_GetFloat
(
p_intf
,
"grain-variance"
)]];
[
_grainSlider
setEnabled
:
[
_grainCheckbox
state
]];
[
_grainLabel
setEnabled
:
[
_grainCheckbox
state
]];
[
_grainLabel
setEnabled
:
[
_grainCheckbox
state
]];
[
self
setCropLeftValue
:
0
];
[
self
setCropLeftValue
:
0
];
...
@@ -375,119 +439,71 @@
...
@@ -375,119 +439,71 @@
[
_cropSyncTopBottomCheckbox
setState
:
NSOffState
];
[
_cropSyncTopBottomCheckbox
setState
:
NSOffState
];
[
_cropSyncLeftRightCheckbox
setState
:
NSOffState
];
[
_cropSyncLeftRightCheckbox
setState
:
NSOffState
];
tmpChar
=
config_GetPsz
(
p_intf
,
"transform-type"
);
[
self
setWidgetValue
:
_transformPopup
forOption
:
"transform-type"
enabled
:
[
_transformCheckbox
state
]];
tmpString
=
toNSStr
(
tmpChar
);
if
([
tmpString
isEqualToString
:
@"hflip"
])
[
_transformPopup
selectItemWithTag
:
1
];
else
if
([
tmpString
isEqualToString
:
@"vflip"
])
[
_transformPopup
selectItemWithTag
:
2
];
else
[
_transformPopup
selectItemWithTag
:[
tmpString
intValue
]];
FREENULL
(
tmpChar
);
[
_transformPopup
setEnabled
:
[
_transformCheckbox
state
]];
[
self
setPuzzleColumnsValue
:
config_GetInt
(
p_intf
,
"puzzle-cols"
)];
[
self
setPuzzleRowsValue
:
config_GetInt
(
p_intf
,
"puzzle-rows"
)];
b_state
=
[
_puzzleCheckbox
state
];
b_state
=
[
_puzzleCheckbox
state
];
[
_puzzleRowsTextField
setEnabled
:
b_state
];
[
self
setWidgetValue
:
_puzzleColumnsTextField
forOption
:
"puzzle-cols"
enabled
:
b_state
];
[
_puzzleRowsStepper
setEnabled
:
b_state
];
[
self
setWidgetValue
:
_puzzleColumnsStepper
forOption
:
"puzzle-cols"
enabled
:
b_state
];
[
self
setWidgetValue
:
_puzzleRowsTextField
forOption
:
"puzzle-rows"
enabled
:
b_state
];
[
self
setWidgetValue
:
_puzzleRowsStepper
forOption
:
"puzzle-rows"
enabled
:
b_state
];
[
_puzzleRowsLabel
setEnabled
:
b_state
];
[
_puzzleRowsLabel
setEnabled
:
b_state
];
[
_puzzleColumnsTextField
setEnabled
:
b_state
];
[
_puzzleColumnsStepper
setEnabled
:
b_state
];
[
_puzzleColumnsLabel
setEnabled
:
b_state
];
[
_puzzleColumnsLabel
setEnabled
:
b_state
];
[
self
setCloneValue
:
config_GetInt
(
p_intf
,
"clone-count"
)];
b_state
=
[
_cloneCheckbox
state
];
b_state
=
[
_cloneCheckbox
state
];
[
self
setWidgetValue
:
_cloneNumberTextField
forOption
:
"clone-count"
enabled
:
b_state
];
[
self
setWidgetValue
:
_cloneNumberStepper
forOption
:
"clone-count"
enabled
:
b_state
];
[
_cloneNumberLabel
setEnabled
:
b_state
];
[
_cloneNumberLabel
setEnabled
:
b_state
];
[
_cloneNumberTextField
setEnabled
:
b_state
];
[
_cloneNumberStepper
setEnabled
:
b_state
];
b_state
=
[
_wallCheckbox
state
];
b_state
=
[
_wallCheckbox
state
];
[
self
setWallRowsValue
:
config_GetInt
(
p_intf
,
"wall-rows"
)];
[
self
setWidgetValue
:
_wallNumbersOfRowsTextField
forOption
:
"wall-rows"
enabled
:
b_state
];
[
self
setWidgetValue
:
_wallNumbersOfRowsStepper
forOption
:
"wall-rows"
enabled
:
b_state
];
[
self
setWidgetValue
:
_wallNumberOfColumnsTextField
forOption
:
"wall-cols"
enabled
:
b_state
];
[
self
setWidgetValue
:
_wallNumberOfColumnsStepper
forOption
:
"wall-cols"
enabled
:
b_state
];
[
_wallNumbersOfRowsLabel
setEnabled
:
b_state
];
[
_wallNumbersOfRowsLabel
setEnabled
:
b_state
];
[
_wallNumbersOfRowsTextField
setEnabled
:
b_state
];
[
_wallNumbersOfRowsStepper
setEnabled
:
b_state
];
[
self
setWallColumnsValue
:
config_GetInt
(
p_intf
,
"wall-cols"
)];
[
_wallNumberOfColumnsLabel
setEnabled
:
b_state
];
[
_wallNumberOfColumnsLabel
setEnabled
:
b_state
];
[
_wallNumberOfColumnsTextField
setEnabled
:
b_state
];
[
_wallNumberOfColumnsStepper
setEnabled
:
b_state
];
[
_thresholdColorTextField
setStringValue
:
[[
NSString
stringWithFormat
:
@"%llx"
,
config_GetInt
(
p_intf
,
"colorthres-color"
)]
uppercaseString
]];
[
_thresholdSaturationSlider
setIntValue
:
config_GetInt
(
p_intf
,
"colorthres-saturationthres"
)];
[
_thresholdSaturationSlider
setToolTip
:
[
NSString
stringWithFormat
:
@"%lli"
,
config_GetInt
(
p_intf
,
"colorthres-saturationthres"
)]];
[
_thresholdSimilaritySlider
setIntValue
:
config_GetInt
(
p_intf
,
"colorthres-similaritythres"
)];
[
_thresholdSimilaritySlider
setToolTip
:
[
NSString
stringWithFormat
:
@"%lli"
,
config_GetInt
(
p_intf
,
"colorthres-similaritythres"
)]];
b_state
=
[
_thresholdCheckbox
state
];
b_state
=
[
_thresholdCheckbox
state
];
[
_thresholdColorTextField
setEnabled
:
b_state
];
[
self
setWidgetValue
:
_thresholdColorTextField
forOption
:
"colorthres-color"
enabled
:
b_state
];
[
self
setWidgetValue
:
_thresholdSaturationSlider
forOption
:
"colorthres-saturationthres"
enabled
:
b_state
];
[
self
setWidgetValue
:
_thresholdSimilaritySlider
forOption
:
"colorthres-similaritythres"
enabled
:
b_state
];
[
_thresholdColorLabel
setEnabled
:
b_state
];
[
_thresholdColorLabel
setEnabled
:
b_state
];
[
_thresholdSaturationSlider
setEnabled
:
b_state
];
[
_thresholdSaturationLabel
setEnabled
:
b_state
];
[
_thresholdSaturationLabel
setEnabled
:
b_state
];
[
_thresholdSimilaritySlider
setEnabled
:
b_state
];
[
_thresholdSimilarityLabel
setEnabled
:
b_state
];
[
_thresholdSimilarityLabel
setEnabled
:
b_state
];
[
self
setSepiaValue
:
config_GetInt
(
p_intf
,
"sepia-intensity"
)];
b_state
=
[
_sepiaCheckbox
state
];
b_state
=
[
_sepiaCheckbox
state
];
[
_sepiaTextField
setE
nabled
:
b_state
];
[
self
setWidgetValue
:
_sepiaTextField
forOption
:
"sepia-intensity"
e
nabled
:
b_state
];
[
_sepiaStepper
setE
nabled
:
b_state
];
[
self
setWidgetValue
:
_sepiaStepper
forOption
:
"sepia-intensity"
e
nabled
:
b_state
];
[
_sepiaLabel
setEnabled
:
b_state
];
[
_sepiaLabel
setEnabled
:
b_state
];
tmpChar
=
config_GetPsz
(
p_intf
,
"gradient-mode"
);
tmpString
=
toNSStr
(
tmpChar
);
if
([
tmpString
isEqualToString
:
@"hough"
])
[
_gradientModePopup
selectItemWithTag
:
3
];
else
if
([
tmpString
isEqualToString
:
@"edge"
])
[
_gradientModePopup
selectItemWithTag
:
2
];
else
[
_gradientModePopup
selectItemWithTag
:
1
];
FREENULL
(
tmpChar
);
[
_gradientCartoonCheckbox
setState
:
config_GetInt
(
p_intf
,
"gradient-cartoon"
)];
[
_gradientColorCheckbox
setState
:
config_GetInt
(
p_intf
,
"gradient-type"
)];
b_state
=
[
_gradientCheckbox
state
];
b_state
=
[
_gradientCheckbox
state
];
[
_gradientModePopup
setEnabled
:
b_state
];
[
self
setWidgetValue
:
_gradientModePopup
forOption
:
"gradient-mode"
enabled
:
b_state
];
[
self
setWidgetValue
:
_gradientCartoonCheckbox
forOption
:
"gradient-cartoon"
enabled
:
b_state
];
[
self
setWidgetValue
:
_gradientColorCheckbox
forOption
:
"gradient-type"
enabled
:
b_state
];
[
_gradientModeLabel
setEnabled
:
b_state
];
[
_gradientModeLabel
setEnabled
:
b_state
];
[
_gradientCartoonCheckbox
setEnabled
:
b_state
];
[
_gradientColorCheckbox
setEnabled
:
b_state
];
[
_extractTextField
setStringValue
:
[[
NSString
stringWithFormat
:
@"%llx"
,
config_GetInt
(
p_intf
,
"extract-component"
)]
uppercaseString
]];
[
self
setWidgetValue
:
_extractTextField
forOption
:
"extract-component"
enabled
:
[
_extractCheckbox
state
]];
[
_extractTextField
setEnabled
:
[
_extractCheckbox
state
]];
[
_extractLabel
setEnabled
:
[
_extractCheckbox
state
]];
[
_extractLabel
setEnabled
:
[
_extractCheckbox
state
]];
[
self
setPosterizeValue
:
config_GetInt
(
p_intf
,
"posterize-level"
)];
b_state
=
[
_posterizeCheckbox
state
];
b_state
=
[
_posterizeCheckbox
state
];
[
_posterizeTextField
setE
nabled
:
b_state
];
[
self
setWidgetValue
:
_posterizeTextField
forOption
:
"posterize-level"
e
nabled
:
b_state
];
[
_posterizeStepper
setE
nabled
:
b_state
];
[
self
setWidgetValue
:
_posterizeStepper
forOption
:
"posterize-level"
e
nabled
:
b_state
];
[
_posterizeLabel
setEnabled
:
b_state
];
[
_posterizeLabel
setEnabled
:
b_state
];
[
_blurSlider
setIntValue
:
config_GetInt
(
p_intf
,
"blur-factor"
)];
[
self
setWidgetValue
:
_blurSlider
forOption
:
"blur-factor"
enabled
:
[
_blurCheckbox
state
]];
[
_blurSlider
setToolTip
:
[
NSString
stringWithFormat
:
@"%lli"
,
config_GetInt
(
p_intf
,
"blur-factor"
)]];
[
_blurSlider
setEnabled
:
[
_blurCheckbox
state
]];
[
_blurLabel
setEnabled
:
[
_blurCheckbox
state
]];
[
_blurLabel
setEnabled
:
[
_blurCheckbox
state
]];
tmpChar
=
config_GetPsz
(
p_intf
,
"marq-marquee"
);
[
_addTextTextTextField
setStringValue
:
toNSStr
(
tmpChar
)];
if
(
tmpChar
)
FREENULL
(
tmpChar
);
[
_addTextPositionPopup
selectItemWithTag
:
config_GetInt
(
p_intf
,
"marq-position"
)];
b_state
=
[
_addTextCheckbox
state
];
b_state
=
[
_addTextCheckbox
state
];
[
_addTextPositionPopup
setEnabled
:
b_state
];
[
self
setWidgetValue
:
_addTextTextTextField
forOption
:
"marq-marquee"
enabled
:
b_state
];
[
self
setWidgetValue
:
_addTextPositionPopup
forOption
:
"marq-position"
enabled
:
b_state
];
[
_addTextPositionLabel
setEnabled
:
b_state
];
[
_addTextPositionLabel
setEnabled
:
b_state
];
[
_addTextTextLabel
setEnabled
:
b_state
];
[
_addTextTextLabel
setEnabled
:
b_state
];
[
_addTextTextTextField
setEnabled
:
b_state
];
tmpChar
=
config_GetPsz
(
p_intf
,
"logo-file"
);
[
_addLogoLogoTextField
setStringValue
:
toNSStr
(
tmpChar
)];
if
(
tmpChar
)
FREENULL
(
tmpChar
);
[
_addLogoPositionPopup
selectItemWithTag
:
config_GetInt
(
p_intf
,
"logo-position"
)];
[
_addLogoTransparencySlider
setIntValue
:
config_GetInt
(
p_intf
,
"logo-opacity"
)];
[
_addLogoTransparencySlider
setToolTip
:
[
NSString
stringWithFormat
:
@"%lli"
,
config_GetInt
(
p_intf
,
"logo-opacity"
)]];
b_state
=
[
_addLogoCheckbox
state
];
b_state
=
[
_addLogoCheckbox
state
];
[
_addLogoPositionPopup
setEnabled
:
b_state
];
[
self
setWidgetValue
:
_addLogoLogoTextField
forOption
:
"logo-file"
enabled
:
b_state
];
[
self
setWidgetValue
:
_addLogoPositionPopup
forOption
:
"logo-position"
enabled
:
b_state
];
[
self
setWidgetValue
:
_addLogoTransparencySlider
forOption
:
"logo-opacity"
enabled
:
b_state
];
[
_addLogoPositionLabel
setEnabled
:
b_state
];
[
_addLogoPositionLabel
setEnabled
:
b_state
];
[
_addLogoLogoTextField
setEnabled
:
b_state
];
[
_addLogoLogoLabel
setEnabled
:
b_state
];
[
_addLogoLogoLabel
setEnabled
:
b_state
];
[
_addLogoTransparencySlider
setEnabled
:
b_state
];
[
_addLogoTransparencyLabel
setEnabled
:
b_state
];
[
_addLogoTransparencyLabel
setEnabled
:
b_state
];
}
}
...
...
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