Commit 81e886a8 authored by Felix Paul Kühne's avatar Felix Paul Kühne

macosx: implemented a bunch of video filters

remaining options: marquee, add logo, erase logo, clone
parent 3b66dabc
......@@ -21,7 +21,7 @@
</object>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
<integer value="2"/>
<integer value="6"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
......@@ -47,7 +47,7 @@
<int key="NSWindowStyleMask">8211</int>
<int key="NSWindowBacking">2</int>
<string key="NSWindowRect">{{196, 270}, {642, 240}}</string>
<int key="NSWTFlags">1886912512</int>
<int key="NSWTFlags">-260571136</int>
<string key="NSWindowTitle">Video Effects</string>
<string key="NSWindowClass">NSPanel</string>
<nil key="NSViewClass"/>
......@@ -755,7 +755,7 @@
<object class="BGHUDTabViewItem" id="52756061">
<string key="NSIdentifier">crop</string>
<object class="NSView" key="NSView" id="838226260">
<nil key="NSNextResponder"/>
<reference key="NSNextResponder" ref="898819366"/>
<int key="NSvFlags">256</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
......@@ -768,7 +768,7 @@
<bool key="NSEnabled">YES</bool>
<object class="BGHUDTextFieldCell" key="NSCell" id="474337841">
<int key="NSCellFlags">-1804468671</int>
<int key="NSCellFlags2">71435264</int>
<int key="NSCellFlags2">71435328</int>
<integer value="0" key="NSContents"/>
<reference key="NSSupport" ref="26"/>
<object class="NSNumberFormatter" key="NSFormatter" id="210492527">
......@@ -899,7 +899,7 @@
<bool key="NSEnabled">YES</bool>
<object class="BGHUDTextFieldCell" key="NSCell" id="975473061">
<int key="NSCellFlags">-1804468671</int>
<int key="NSCellFlags2">71435264</int>
<int key="NSCellFlags2">71435328</int>
<integer value="0" key="NSContents"/>
<reference key="NSSupport" ref="26"/>
<object class="NSNumberFormatter" key="NSFormatter" id="1075575">
......@@ -1013,7 +1013,7 @@
<bool key="NSEnabled">YES</bool>
<object class="BGHUDTextFieldCell" key="NSCell" id="659672481">
<int key="NSCellFlags">-1804468671</int>
<int key="NSCellFlags2">71435264</int>
<int key="NSCellFlags2">71435328</int>
<integer value="0" key="NSContents"/>
<reference key="NSSupport" ref="26"/>
<object class="NSNumberFormatter" key="NSFormatter" id="106661807">
......@@ -1127,7 +1127,7 @@
<bool key="NSEnabled">YES</bool>
<object class="BGHUDTextFieldCell" key="NSCell" id="594295999">
<int key="NSCellFlags">-1804468671</int>
<int key="NSCellFlags2">71435264</int>
<int key="NSCellFlags2">71435328</int>
<integer value="0" key="NSContents"/>
<reference key="NSSupport" ref="26"/>
<object class="NSNumberFormatter" key="NSFormatter" id="947826067">
......@@ -1286,6 +1286,7 @@
</object>
</object>
<string key="NSFrame">{{10, 33}, {638, 197}}</string>
<reference key="NSSuperview" ref="898819366"/>
<string key="NSReuseIdentifierKey">_NS:809</string>
</object>
<string key="NSLabel">Crop</string>
......@@ -1791,7 +1792,7 @@
<object class="NSTabViewItem" id="133975353">
<string key="NSIdentifier">color</string>
<object class="NSView" key="NSView" id="10628740">
<reference key="NSNextResponder" ref="898819366"/>
<nil key="NSNextResponder"/>
<int key="NSvFlags">256</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
......@@ -2912,7 +2913,6 @@
</object>
</object>
<string key="NSFrame">{{10, 33}, {638, 197}}</string>
<reference key="NSSuperview" ref="898819366"/>
</object>
<string key="NSLabel">Color</string>
<reference key="NSColor" ref="279270326"/>
......@@ -4015,7 +4015,7 @@
<reference key="NSTabView" ref="898819366"/>
</object>
</object>
<reference key="NSSelectedTabViewItem" ref="133975353"/>
<reference key="NSSelectedTabViewItem" ref="52756061"/>
<object class="NSFont" key="NSFont">
<string key="NSName">LucidaGrande</string>
<double key="NSSize">13</double>
......@@ -4027,7 +4027,7 @@
<nil key="themeKey"/>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="10628740"/>
<reference ref="838226260"/>
</object>
</object>
</object>
......@@ -5046,38 +5046,6 @@
</object>
<int key="connectionID">585</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">cropFieldChanged:</string>
<reference key="source" ref="707254443"/>
<reference key="destination" ref="411363183"/>
</object>
<int key="connectionID">586</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">cropFieldChanged:</string>
<reference key="source" ref="707254443"/>
<reference key="destination" ref="950709956"/>
</object>
<int key="connectionID">587</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">cropFieldChanged:</string>
<reference key="source" ref="707254443"/>
<reference key="destination" ref="190644777"/>
</object>
<int key="connectionID">588</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">cropFieldChanged:</string>
<reference key="source" ref="707254443"/>
<reference key="destination" ref="785525140"/>
</object>
<int key="connectionID">589</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">enableAddLogo:</string>
......@@ -5142,22 +5110,6 @@
</object>
<int key="connectionID">597</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">enableCropModifier:</string>
<reference key="source" ref="707254443"/>
<reference key="destination" ref="973277604"/>
</object>
<int key="connectionID">598</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">enableCropModifier:</string>
<reference key="source" ref="707254443"/>
<reference key="destination" ref="447321799"/>
</object>
<int key="connectionID">599</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">enableExtract:</string>
......@@ -5438,6 +5390,54 @@
</object>
<int key="connectionID">635</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">cropObjectChanged:</string>
<reference key="source" ref="707254443"/>
<reference key="destination" ref="950709956"/>
</object>
<int key="connectionID">637</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">cropObjectChanged:</string>
<reference key="source" ref="707254443"/>
<reference key="destination" ref="190644777"/>
</object>
<int key="connectionID">638</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">cropObjectChanged:</string>
<reference key="source" ref="707254443"/>
<reference key="destination" ref="411363183"/>
</object>
<int key="connectionID">639</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">cropObjectChanged:</string>
<reference key="source" ref="707254443"/>
<reference key="destination" ref="785525140"/>
</object>
<int key="connectionID">640</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">cropObjectChanged:</string>
<reference key="source" ref="707254443"/>
<reference key="destination" ref="973277604"/>
</object>
<int key="connectionID">641</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">cropObjectChanged:</string>
<reference key="source" ref="707254443"/>
<reference key="destination" ref="447321799"/>
</object>
<int key="connectionID">642</int>
</object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
......@@ -8785,7 +8785,7 @@
</object>
</object>
<nil key="sourceID"/>
<int key="maxID">636</int>
<int key="maxID">642</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptionsV3.1+">
......@@ -8803,7 +8803,7 @@
<string>bandingSliderChanged:</string>
<string>blurModifierChanged:</string>
<string>cloneModifierChanged:</string>
<string>cropFieldChanged:</string>
<string>cropObjectChanged:</string>
<string>enableAddLogo:</string>
<string>enableAddText:</string>
<string>enableAdjust:</string>
......@@ -8811,7 +8811,6 @@
<string>enableBanding:</string>
<string>enableBlur:</string>
<string>enableClone:</string>
<string>enableCropModifier:</string>
<string>enableEraseLogo:</string>
<string>enableExtract:</string>
<string>enableGradient:</string>
......@@ -8838,6 +8837,7 @@
<string>sepiaModifierChanged:</string>
<string>sharpenSliderChanged:</string>
<string>thresholdModifierChanged:</string>
<string>toggleWindow:</string>
<string>transformModifierChanged:</string>
</object>
<object class="NSMutableArray" key="dict.values">
......@@ -8896,7 +8896,7 @@
<string>bandingSliderChanged:</string>
<string>blurModifierChanged:</string>
<string>cloneModifierChanged:</string>
<string>cropFieldChanged:</string>
<string>cropObjectChanged:</string>
<string>enableAddLogo:</string>
<string>enableAddText:</string>
<string>enableAdjust:</string>
......@@ -8904,7 +8904,6 @@
<string>enableBanding:</string>
<string>enableBlur:</string>
<string>enableClone:</string>
<string>enableCropModifier:</string>
<string>enableEraseLogo:</string>
<string>enableExtract:</string>
<string>enableGradient:</string>
......@@ -8931,6 +8930,7 @@
<string>sepiaModifierChanged:</string>
<string>sharpenSliderChanged:</string>
<string>thresholdModifierChanged:</string>
<string>toggleWindow:</string>
<string>transformModifierChanged:</string>
</object>
<object class="NSMutableArray" key="dict.values">
......@@ -8960,7 +8960,7 @@
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo">
<string key="name">cropFieldChanged:</string>
<string key="name">cropObjectChanged:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo">
......@@ -8991,10 +8991,6 @@
<string key="name">enableClone:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo">
<string key="name">enableCropModifier:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo">
<string key="name">enableEraseLogo:</string>
<string key="candidateClassName">id</string>
......@@ -9099,6 +9095,10 @@
<string key="name">thresholdModifierChanged:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo">
<string key="name">toggleWindow:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo">
<string key="name">transformModifierChanged:</string>
<string key="candidateClassName">id</string>
......
......@@ -144,6 +144,10 @@
- (IBAction)toggleWindow:(id)sender;
- (void)resetValues;
- (void)setVideoFilter: (char *)psz_name on:(BOOL)b_on;
- (void)setVideoFilterProperty: (char *)psz_name forFilter: (char*)psz_filter integer: (int)i_value;
- (void)setVideoFilterProperty: (char *)psz_name forFilter: (char*)psz_filter float: (float)f_value;
- (void)setVideoFilterProperty: (char *)psz_name forFilter: (char *)psz_filter string: (char *)psz_value;
- (void)setVideoFilterProperty: (char *)psz_name forFilter: (char *)psz_filter boolean: (BOOL)b_value;
/* basic */
- (IBAction)enableAdjust:(id)sender;
......@@ -157,8 +161,7 @@
- (IBAction)grainSliderChanged:(id)sender;
/* crop */
- (IBAction)cropFieldChanged:(id)sender;
- (IBAction)enableCropModifier:(id)sender;
- (IBAction)cropObjectChanged:(id)sender;
/* geometry */
- (IBAction)enableTransform:(id)sender;
......
......@@ -171,6 +171,8 @@ static VLCVideoEffects *_o_sharedInstance = nil;
[o_eraselogo_top_lbl setStringValue:_NS("Top")];
[o_eraselogo_left_lbl setStringValue:_NS("Left")];
[o_tableView selectFirstTabViewItem:self];
[self resetValues];
}
......@@ -217,14 +219,23 @@ static VLCVideoEffects *_o_sharedInstance = nil;
[o_adjust_gamma_sld setEnabled: [o_adjust_ckb state]];
[o_adjust_hue_sld setEnabled: [o_adjust_ckb state]];
[o_adjust_saturation_sld setEnabled: [o_adjust_ckb state]];
[o_adjust_brightness_lbl setEnabled: [o_adjust_ckb state]];
[o_adjust_contrast_lbl setEnabled: [o_adjust_ckb state]];
[o_adjust_gamma_lbl setEnabled: [o_adjust_ckb state]];
[o_adjust_hue_lbl setEnabled: [o_adjust_ckb state]];
[o_adjust_saturation_lbl setEnabled: [o_adjust_ckb state]];
[o_adjust_opaque_sld setFloatValue: config_GetFloat( p_intf, "macosx-opaqueness" )];
[o_adjust_opaque_sld setEnabled: NO]; // FIXME: not implemented!
[o_adjust_opaque_sld setEnabled: [o_adjust_ckb state]];
[o_adjust_opaque_lbl setEnabled: [o_adjust_ckb state]];
[o_sharpen_sld setFloatValue: config_GetFloat( p_intf, "sharpen-sigma" )];
[o_sharpen_sld setEnabled: [o_sharpen_ckb state]];
[o_sharpen_lbl setEnabled: [o_sharpen_ckb state]];
[o_banding_sld setIntValue: config_GetInt( p_intf, "gradfun-radius" )];
[o_banding_sld setEnabled: [o_banding_ckb state]];
[o_banding_lbl setEnabled: [o_banding_ckb state]];
[o_grain_sld setFloatValue: config_GetFloat( p_intf, "grain-variance" )];
[o_grain_sld setEnabled: [o_grain_ckb state]];
[o_grain_lbl setEnabled: [o_grain_ckb state]];
[o_crop_top_fld setIntValue: 0];
[o_crop_left_fld setIntValue: 0];
......@@ -245,17 +256,23 @@ static VLCVideoEffects *_o_sharedInstance = nil;
[o_puzzle_columns_fld setIntValue: config_GetInt( p_intf, "puzzle-cols" )];
[o_puzzle_blackslot_ckb setState: config_GetInt( p_intf, "puzzle-black-slot" )];
[o_puzzle_rows_fld setEnabled: [o_puzzle_ckb state]];
[o_puzzle_rows_lbl setEnabled: [o_puzzle_ckb state]];
[o_puzzle_columns_fld setEnabled: [o_puzzle_ckb state]];
[o_puzzle_columns_lbl setEnabled: [o_puzzle_ckb state]];
[o_puzzle_blackslot_ckb setEnabled: [o_puzzle_ckb state]];
[o_threshold_color_fld setStringValue: [NSString stringWithFormat:@"%x", config_GetInt( p_intf, "colorthres-color" )]];
[o_threshold_color_fld setStringValue: [[NSString stringWithFormat:@"%x", config_GetInt( p_intf, "colorthres-color" )] uppercaseString]];
[o_threshold_saturation_sld setIntValue: config_GetInt( p_intf, "colorthres-saturationthres" )];
[o_threshold_similarity_sld setIntValue: config_GetInt( p_intf, "colorthres-similaritythres" )];
[o_threshold_color_fld setEnabled: [o_threshold_ckb state]];
[o_threshold_color_lbl setEnabled: [o_threshold_ckb state]];
[o_threshold_saturation_sld setEnabled: [o_threshold_ckb state]];
[o_threshold_saturation_lbl setEnabled: [o_threshold_ckb state]];
[o_threshold_similarity_sld setEnabled: [o_threshold_ckb state]];
[o_threshold_similarity_lbl setEnabled: [o_threshold_ckb state]];
[o_sepia_fld setIntValue: config_GetInt( p_intf, "sepia-intensity" )];
[o_sepia_fld setEnabled: [o_sepia_ckb state]];
[o_sepia_lbl setEnabled: [o_sepia_ckb state]];
tmpString = [NSString stringWithUTF8String: config_GetPsz( p_intf, "gradient-mode" )];
if( [tmpString isEqualToString:@"hough"] )
[o_gradient_mode_pop selectItemWithTag: 3];
......@@ -266,20 +283,29 @@ static VLCVideoEffects *_o_sharedInstance = nil;
[o_gradient_cartoon_ckb setState: config_GetInt( p_intf, "gradient-cartoon" )];
[o_gradient_color_ckb setState: config_GetInt( p_intf, "gradient-type" )];
[o_gradient_mode_pop setEnabled: [o_gradient_ckb state]];
[o_gradient_mode_lbl setEnabled: [o_gradient_ckb state]];
[o_gradient_cartoon_ckb setEnabled: [o_gradient_ckb state]];
[o_gradient_color_ckb setEnabled: [o_gradient_ckb state]];
[o_extract_fld setStringValue: [NSString stringWithFormat:@"%x", config_GetInt( p_intf, "extract-component" )]];
[o_extract_fld setStringValue: [[NSString stringWithFormat:@"%x", config_GetInt( p_intf, "extract-component" )] uppercaseString]];
[o_extract_fld setEnabled: [o_extract_ckb state]];
[o_extract_lbl setEnabled: [o_extract_ckb state]];
[o_posterize_fld setIntValue: config_GetInt( p_intf, "posterize-level" )];
[o_posterize_fld setEnabled: [o_posterize_ckb state]];
[o_posterize_lbl setEnabled: [o_posterize_ckb state]];
[o_blur_sld setIntValue: config_GetInt( p_intf, "blur-factor" )];
[o_blur_sld setEnabled: [o_blur_ckb state]];
[o_blur_lbl setEnabled: [o_blur_ckb state]];
[o_clone_fld setIntValue: config_GetInt( p_intf, "clone-count" )];
[o_clone_fld setEnabled: [o_clone_ckb state]];
[o_clone_lbl setEnabled: [o_clone_ckb state]];
if( config_GetPsz( p_intf, "marq-marquee" ) )
[o_addtext_text_fld setStringValue: [NSString stringWithUTF8String: config_GetPsz( p_intf, "marq-marquee" )]];
[o_addtext_pos_pop selectItemWithTag: config_GetInt( p_intf, "marq-position" )];
[o_addtext_pos_pop setEnabled: [o_addtext_ckb state]];
[o_addtext_pos_lbl setEnabled: [o_addtext_ckb state]];
[o_addtext_text_lbl setEnabled: [o_addtext_ckb state]];
[o_addtext_text_fld setEnabled: [o_addtext_ckb state]];
if( config_GetPsz( p_intf, "logo-file" ) )
[o_addlogo_logo_fld setStringValue: [NSString stringWithUTF8String: config_GetPsz( p_intf, "logo-file" )]];
......@@ -287,15 +313,23 @@ static VLCVideoEffects *_o_sharedInstance = nil;
[o_addlogo_left_fld setIntValue: config_GetInt( p_intf, "logo-y" )];
[o_addlogo_transparency_sld setIntValue: config_GetInt( p_intf, "logo-opacity" )];
[o_addlogo_logo_fld setEnabled: [o_addlogo_ckb state]];
[o_addlogo_logo_lbl setEnabled: [o_addlogo_ckb state]];
[o_addlogo_left_fld setEnabled: [o_addlogo_ckb state]];
[o_addlogo_left_lbl setEnabled: [o_addlogo_ckb state]];
[o_addlogo_top_fld setEnabled: [o_addlogo_ckb state]];
[o_addlogo_top_lbl setEnabled: [o_addlogo_ckb state]];
[o_addlogo_transparency_sld setEnabled: [o_addlogo_ckb state]];
[o_addlogo_transparency_lbl setEnabled: [o_addlogo_ckb state]];
if( config_GetPsz( p_intf, "erase-mask" ) )
[o_eraselogo_mask_fld setStringValue: [NSString stringWithUTF8String: config_GetPsz( p_intf, "erase-mask" )]];
[o_eraselogo_top_fld setIntValue: config_GetInt( p_intf, "erase-x" )];
[o_eraselogo_left_fld setIntValue: config_GetInt( p_intf, "erase-y" )];
[o_eraselogo_mask_fld setEnabled: [o_eraselogo_ckb state]];
[o_eraselogo_mask_lbl setEnabled: [o_eraselogo_ckb state]];
[o_eraselogo_left_fld setEnabled: [o_eraselogo_ckb state]];
[o_eraselogo_left_lbl setEnabled: [o_eraselogo_ckb state]];
[o_eraselogo_top_fld setEnabled: [o_eraselogo_ckb state]];
[o_eraselogo_top_lbl setEnabled: [o_eraselogo_ckb state]];
}
- (void)setVideoFilter: (char *)psz_name on:(BOOL)b_on
......@@ -332,6 +366,90 @@ static VLCVideoEffects *_o_sharedInstance = nil;
}
}
- (void)setVideoFilterProperty: (char *)psz_name forFilter: (char *)psz_filter integer: (int)i_value
{
vout_thread_t *p_vout = getVout();
vlc_object_t *p_filter;
if( p_vout == NULL ) {
config_PutInt( p_intf , psz_name , i_value );
} else {
p_filter = vlc_object_find_name( pl_Get(p_intf), psz_filter );
if(! p_filter ) {
msg_Err( p_intf, "we're unable to find the filter '%s'", psz_filter );
vlc_object_release( p_vout );
return;
}
var_SetFloat( p_filter, psz_name, i_value );
config_PutFloat( p_intf, psz_name, i_value );
vlc_object_release( p_vout );
}
}
- (void)setVideoFilterProperty: (char *)psz_name forFilter: (char *)psz_filter float: (float)f_value
{
vout_thread_t *p_vout = getVout();
vlc_object_t *p_filter;
if( p_vout == NULL ) {
config_PutFloat( p_intf , psz_name , f_value );
} else {
p_filter = vlc_object_find_name( pl_Get(p_intf), psz_filter );
if(! p_filter ) {
msg_Err( p_intf, "we're unable to find the filter '%s'", psz_filter );
vlc_object_release( p_vout );
return;
}
var_SetFloat( p_filter, psz_name, f_value );
config_PutFloat( p_intf, psz_name, f_value );
vlc_object_release( p_vout );
}
}
- (void)setVideoFilterProperty: (char *)psz_name forFilter: (char *)psz_filter string: (char *)psz_value
{
vout_thread_t *p_vout = getVout();
vlc_object_t *p_filter;
if( p_vout == NULL ) {
config_PutPsz( p_intf, psz_name, psz_value );
} else {
p_filter = vlc_object_find_name( pl_Get(p_intf), psz_filter );
if(! p_filter ) {
msg_Err( p_intf, "we're unable to find the filter '%s'", psz_filter );
vlc_object_release( p_vout );
return;
}
var_SetString( p_filter, psz_name, psz_value );
config_PutPsz( p_intf, psz_name, psz_value );
vlc_object_release( p_vout );
}
}
- (void)setVideoFilterProperty: (char *)psz_name forFilter: (char *)psz_filter boolean: (BOOL)b_value
{
vout_thread_t *p_vout = getVout();
vlc_object_t *p_filter;
if( p_vout == NULL ) {
config_PutInt( p_intf, psz_name, b_value );
} else {
p_filter = vlc_object_find_name( pl_Get(p_intf), psz_filter );
if(! p_filter ) {
msg_Err( p_intf, "we're unable to find the filter '%s'", psz_filter );
vlc_object_release( p_vout );
return;
}
var_SetBool( p_filter, psz_name, b_value );
config_PutInt( p_intf, psz_name, b_value );
vlc_object_release( p_vout );
}
}
#pragma mark -
#pragma mark basic
- (IBAction)enableAdjust:(id)sender
......@@ -340,55 +458,64 @@ static VLCVideoEffects *_o_sharedInstance = nil;
[self setVideoFilter: "adjust" on:[o_adjust_ckb state]];
[o_adjust_brightness_sld setEnabled: state];
[o_adjust_brightness_ckb setEnabled: state];
[o_adjust_brightness_lbl setEnabled: state];
[o_adjust_contrast_sld setEnabled: state];
[o_adjust_contrast_lbl setEnabled: state];
[o_adjust_gamma_sld setEnabled: state];
[o_adjust_gamma_lbl setEnabled: state];
[o_adjust_hue_sld setEnabled: state];
[o_adjust_hue_lbl setEnabled: state];
[o_adjust_saturation_sld setEnabled: state];
[o_adjust_saturation_lbl setEnabled: state];
[o_adjust_opaque_sld setEnabled: state];
[o_adjust_opaque_lbl setEnabled: state];
}
- (IBAction)adjustSliderChanged:(id)sender
{
vout_thread_t *p_vout = getVout();
vlc_object_t *p_filter;
if( sender == o_adjust_opaque_sld ){
vlc_value_t val;
id o_tmpWindow = [NSApp keyWindow];
NSArray *o_windows = [NSApp orderedWindows];
NSEnumerator *o_enumerator = [o_windows objectEnumerator];
playlist_t * p_playlist = pl_Get( p_intf );
vout_thread_t *p_vout = getVout();
vout_thread_t *p_real_vout;
if( p_vout == NULL ) {
val.f_float = [o_adjust_opaque_sld floatValue];
if( p_vout != NULL )
{
//FIXME: update this implementation once the vout is fixed
#if 0
p_real_vout = [VLCVoutView realVout: p_vout];
var_Set( p_real_vout, "macosx-opaqueness", val );
while ((o_tmpWindow = [o_enumerator nextObject]))
{
if( [[o_tmpWindow className] isEqualToString: @"VLCVoutWindow"] ||
[[[VLCMain sharedInstance] embeddedList] windowContainsEmbedded: o_tmpWindow])
{
[o_tmpWindow setAlphaValue: val.f_float];
}
break;
}
#endif
vlc_object_release( p_vout );
}
config_PutFloat( p_playlist , "macosx-opaqueness" , val.f_float );
} else {
if( sender == o_adjust_brightness_sld )
config_PutFloat( p_intf , "brightness" , [o_adjust_brightness_sld floatValue] );
[self setVideoFilterProperty: "brightness" forFilter: "adjust" float: [o_adjust_brightness_sld floatValue]];
else if( sender == o_adjust_contrast_sld )
config_PutFloat( p_intf , "contrast" , [o_adjust_contrast_sld floatValue] );
[self setVideoFilterProperty: "contrast" forFilter: "adjust" float: [o_adjust_contrast_sld floatValue]];
else if( sender == o_adjust_gamma_sld )
config_PutFloat( p_intf , "gamma" , [o_adjust_gamma_sld floatValue] );
[self setVideoFilterProperty: "gamma" forFilter: "adjust" float: [o_adjust_gamma_sld floatValue]];
else if( sender == o_adjust_hue_sld )
config_PutInt( p_intf , "hue" , [o_adjust_hue_sld intValue] );
[self setVideoFilterProperty: "hue" forFilter: "adjust" integer: [o_adjust_hue_sld intValue]];
else if( sender == o_adjust_saturation_sld )
config_PutFloat( p_intf , "saturation" , [o_adjust_saturation_sld floatValue] );
} else {
p_filter = vlc_object_find_name( pl_Get(p_intf), "adjust" );
if(! p_filter ) {
msg_Err( p_intf, "we're unable to find the adjust filter!" );
vlc_object_release( p_vout );
return;
}
if( sender == o_adjust_brightness_sld ) {
var_SetFloat( p_filter, "brightness", [o_adjust_brightness_sld floatValue] );
config_PutFloat( p_intf, "brightness", [o_adjust_brightness_sld floatValue] );
} else if( sender == o_adjust_contrast_sld ) {
var_SetFloat( p_filter, "contrast", [o_adjust_contrast_sld floatValue] );
config_PutFloat( p_intf, "contrast", [o_adjust_contrast_sld floatValue] );
} else if( sender == o_adjust_gamma_sld ) {
var_SetFloat( p_filter, "gamma", [o_adjust_gamma_sld floatValue] );
config_PutFloat( p_intf, "gamma", [o_adjust_gamma_sld floatValue] );
} else if( sender == o_adjust_hue_sld ) {
var_SetInteger( p_filter, "hue", [o_adjust_hue_sld intValue] );
config_PutInt( p_intf , "hue" , [o_adjust_hue_sld intValue] );
} else if( sender == o_adjust_saturation_sld ) {
var_SetFloat( p_filter, "saturation", [o_adjust_saturation_sld floatValue] );
config_PutFloat( p_intf , "saturation" , [o_adjust_saturation_sld floatValue] );
}
vlc_object_release( p_filter );
vlc_object_release( p_vout );
[self setVideoFilterProperty: "saturation" forFilter: "adjust" float: [o_adjust_saturation_sld floatValue]];
}