]> git.sesse.net Git - vlc/blob - modules/gui/macosx/VideoEffects.m
macosx: fixed a crash in the video effects panel if no vout is present and set the...
[vlc] / modules / gui / macosx / VideoEffects.m
1 /*****************************************************************************
2  * VideoEffects.m: MacOS X interface module
3  *****************************************************************************
4  * Copyright (C) 2011-2012 Felix Paul Kühne
5  * $Id$
6  *
7  * Authors: Felix Paul Kühne <fkuehne -at- videolan -dot- org>
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22  *****************************************************************************/
23
24 #import "CompatibilityFixes.h"
25 #import "intf.h"
26 #import <vlc_common.h>
27 #import <vlc_modules.h>
28 #import "VideoEffects.h"
29
30 #pragma mark -
31 #pragma mark Initialization & Generic code
32
33 @implementation VLCVideoEffects
34 static VLCVideoEffects *_o_sharedInstance = nil;
35
36 + (VLCVideoEffects *)sharedInstance
37 {
38     return _o_sharedInstance ? _o_sharedInstance : [[self alloc] init];
39 }
40
41 - (id)init
42 {
43     if (_o_sharedInstance) {
44         [self dealloc];
45     } else {
46         p_intf = VLCIntf;
47         _o_sharedInstance = [super init];
48     }
49     
50     return _o_sharedInstance;
51 }
52
53 - (IBAction)toggleWindow:(id)sender
54 {
55     if( [o_window isVisible] )
56         [o_window orderOut:sender];
57     else
58         [o_window makeKeyAndOrderFront:sender];
59 }
60
61 - (void)awakeFromNib
62 {
63     [o_window setTitle: _NS("Video Effects")];
64     [o_window setExcludedFromWindowsMenu:YES];
65     if (OSX_LION)
66         [o_window setCollectionBehavior: NSWindowCollectionBehaviorFullScreenAuxiliary];
67
68     [[o_tableView tabViewItemAtIndex:[o_tableView indexOfTabViewItemWithIdentifier:@"basic"]] setLabel:_NS("Basic")];
69     [[o_tableView tabViewItemAtIndex:[o_tableView indexOfTabViewItemWithIdentifier:@"crop"]] setLabel:_NS("Crop")];
70     [[o_tableView tabViewItemAtIndex:[o_tableView indexOfTabViewItemWithIdentifier:@"geometry"]] setLabel:_NS("Geometry")];
71     [[o_tableView tabViewItemAtIndex:[o_tableView indexOfTabViewItemWithIdentifier:@"color"]] setLabel:_NS("Color")];
72     [[o_tableView tabViewItemAtIndex:[o_tableView indexOfTabViewItemWithIdentifier:@"misc"]] setLabel:_NS("Miscellaneous")];
73
74     [o_adjust_ckb setTitle:_NS("Image Adjust")];
75     [o_adjust_hue_lbl setStringValue:_NS("Hue")];
76     [o_adjust_contrast_lbl setStringValue:_NS("Contrast")];
77     [o_adjust_brightness_lbl setStringValue:_NS("Brightness")];
78     [o_adjust_brightness_ckb setTitle:_NS("Brightness Threshold")];
79     [o_adjust_saturation_lbl setStringValue:_NS("Saturation")];
80     [o_adjust_gamma_lbl setStringValue:_NS("Gamma")];
81     [o_adjust_reset_btn setTitle: _NS("Reset")];
82     [o_sharpen_ckb setTitle:_NS("Sharpen")];
83     [o_sharpen_lbl setStringValue:_NS("Sigma")];
84     [o_banding_ckb setTitle:_NS("Banding removal")];
85     [o_banding_lbl setStringValue:_NS("Radius")];
86     [o_grain_ckb setTitle:_NS("Film Grain")];
87     [o_grain_lbl setStringValue:_NS("Variance")];
88     [o_crop_top_lbl setStringValue:_NS("Top")];
89     [o_crop_left_lbl setStringValue:_NS("Left")];
90     [o_crop_right_lbl setStringValue:_NS("Right")];
91     [o_crop_bottom_lbl setStringValue:_NS("Bottom")];
92     [o_crop_sync_top_bottom_ckb setTitle:_NS("Synchronize top and bottom")];
93     [o_crop_sync_left_right_ckb setTitle:_NS("Synchronize left and right")];
94
95     [o_transform_ckb setTitle:_NS("Transform")];
96     [o_transform_pop removeAllItems];
97     [o_transform_pop addItemWithTitle: _NS("Rotate by 90 degrees")];
98     [[o_transform_pop lastItem] setTag: 90];
99     [o_transform_pop addItemWithTitle: _NS("Rotate by 180 degrees")];
100     [[o_transform_pop lastItem] setTag: 180];
101     [o_transform_pop addItemWithTitle: _NS("Rotate by 270 degrees")];
102     [[o_transform_pop lastItem] setTag: 270];
103     [o_transform_pop addItemWithTitle: _NS("Flip horizontally")];
104     [[o_transform_pop lastItem] setTag: 1];
105     [o_transform_pop addItemWithTitle: _NS("Flip vertically")];
106     [[o_transform_pop lastItem] setTag: 2];
107     [o_zoom_ckb setTitle:_NS("Magnification/Zoom")];
108     [o_puzzle_ckb setTitle:_NS("Puzzle game")];
109     [o_puzzle_rows_lbl setStringValue:_NS("Rows")];
110     [o_puzzle_columns_lbl setStringValue:_NS("Columns")];
111     [o_puzzle_blackslot_ckb setTitle:_NS("Black Slot")];
112
113     [o_threshold_ckb setTitle:_NS("Color threshold")];
114     [o_threshold_color_lbl setStringValue:_NS("Color")];
115     [o_threshold_saturation_lbl setStringValue:_NS("Saturation")];
116     [o_threshold_similarity_lbl setStringValue:_NS("Similarity")];
117     [o_sepia_ckb setTitle:_NS("Sepia")];
118     [o_sepia_lbl setStringValue:_NS("Intensity")];
119     [o_noise_ckb setTitle:_NS("Noise")];
120     [o_gradient_ckb setTitle:_NS("Gradient")];
121     [o_gradient_mode_lbl setStringValue:_NS("Mode")];
122     [o_gradient_mode_pop removeAllItems];
123     [o_gradient_mode_pop addItemWithTitle: _NS("Gradient")];
124     [[o_gradient_mode_pop lastItem] setTag: 1];
125     [o_gradient_mode_pop addItemWithTitle: _NS("Edge")];
126     [[o_gradient_mode_pop lastItem] setTag: 2];
127     [o_gradient_mode_pop addItemWithTitle: _NS("Hough")];
128     [[o_gradient_mode_pop lastItem] setTag: 3];
129     [o_gradient_color_ckb setTitle:_NS("Color")];
130     [o_gradient_cartoon_ckb setTitle:_NS("Cartoon")];
131     [o_extract_ckb setTitle:_NS("Color extraction")];
132     [o_extract_lbl setStringValue:_NS("Color")];
133     [o_invert_ckb setTitle:_NS("Invert colors")];
134     [o_posterize_ckb setTitle:_NS("Posterize")];
135     [o_posterize_lbl setStringValue:_NS("Posterize level")];
136     [o_blur_ckb setTitle:_NS("Motion blur")];
137     [o_blur_lbl setStringValue:_NS("Factor")];
138     [o_motiondetect_ckb setTitle:_NS("Motion Detect")];
139     [o_watereffect_ckb setTitle:_NS("Water effect")];
140     [o_waves_ckb setTitle:_NS("Waves")];
141     [o_psychedelic_ckb setTitle:_NS("Psychedelic")];
142
143     [o_addtext_ckb setTitle:_NS("Add text")];
144     [o_addtext_text_lbl setStringValue:_NS("Text")];
145     [o_addtext_pos_lbl setStringValue:_NS("Position")];
146     [o_addtext_pos_pop removeAllItems];
147     [o_addtext_pos_pop addItemWithTitle: _NS("Center")];
148     [[o_addtext_pos_pop lastItem] setTag: 0];
149     [o_addtext_pos_pop addItemWithTitle: _NS("Left")];
150     [[o_addtext_pos_pop lastItem] setTag: 1];
151     [o_addtext_pos_pop addItemWithTitle: _NS("Right")];
152     [[o_addtext_pos_pop lastItem] setTag: 2];
153     [o_addtext_pos_pop addItemWithTitle: _NS("Top")];
154     [[o_addtext_pos_pop lastItem] setTag: 4];
155     [o_addtext_pos_pop addItemWithTitle: _NS("Bottom")];
156     [[o_addtext_pos_pop lastItem] setTag: 8];
157     [o_addtext_pos_pop addItemWithTitle: _NS("Top-Left")];
158     [[o_addtext_pos_pop lastItem] setTag: 5];
159     [o_addtext_pos_pop addItemWithTitle: _NS("Top-Right")];
160     [[o_addtext_pos_pop lastItem] setTag: 6];
161     [o_addtext_pos_pop addItemWithTitle: _NS("Bottom-Left")];
162     [[o_addtext_pos_pop lastItem] setTag: 9];
163     [o_addtext_pos_pop addItemWithTitle: _NS("Bottom-Right")];
164     [[o_addtext_pos_pop lastItem] setTag: 10];
165     [o_addlogo_ckb setTitle:_NS("Add logo")];
166     [o_addlogo_logo_lbl setStringValue:_NS("Logo")];
167     [o_addlogo_pos_lbl setStringValue:_NS("Position")];
168     [o_addlogo_pos_pop removeAllItems];
169     [o_addlogo_pos_pop addItemWithTitle: _NS("Center")];
170     [[o_addlogo_pos_pop lastItem] setTag: 0];
171     [o_addlogo_pos_pop addItemWithTitle: _NS("Left")];
172     [[o_addlogo_pos_pop lastItem] setTag: 1];
173     [o_addlogo_pos_pop addItemWithTitle: _NS("Right")];
174     [[o_addlogo_pos_pop lastItem] setTag: 2];
175     [o_addlogo_pos_pop addItemWithTitle: _NS("Top")];
176     [[o_addlogo_pos_pop lastItem] setTag: 4];
177     [o_addlogo_pos_pop addItemWithTitle: _NS("Bottom")];
178     [[o_addlogo_pos_pop lastItem] setTag: 8];
179     [o_addlogo_pos_pop addItemWithTitle: _NS("Top-Left")];
180     [[o_addlogo_pos_pop lastItem] setTag: 5];
181     [o_addlogo_pos_pop addItemWithTitle: _NS("Top-Right")];
182     [[o_addlogo_pos_pop lastItem] setTag: 6];
183     [o_addlogo_pos_pop addItemWithTitle: _NS("Bottom-Left")];
184     [[o_addlogo_pos_pop lastItem] setTag: 9];
185     [o_addlogo_pos_pop addItemWithTitle: _NS("Bottom-Right")];
186     [[o_addlogo_pos_pop lastItem] setTag: 10];
187     [o_addlogo_transparency_lbl setStringValue:_NS("Transparency")];
188
189     [o_tableView selectFirstTabViewItem:self];
190
191     [self resetValues];
192 }
193
194 - (void)resetValues
195 {
196     NSString *tmpString;
197     char *tmpChar;
198     BOOL b_state;
199
200     /* do we have any filter enabled? if yes, show it. */
201     char * psz_vfilters;
202     psz_vfilters = config_GetPsz( p_intf, "video-filter" );
203     if( psz_vfilters ) {
204         [o_adjust_ckb setState: (NSInteger)strstr( psz_vfilters, "adjust")];
205         [o_sharpen_ckb setState: (NSInteger)strstr( psz_vfilters, "sharpen")];
206         [o_banding_ckb setState: (NSInteger)strstr( psz_vfilters, "gradfun")];
207         [o_grain_ckb setState: (NSInteger)strstr( psz_vfilters, "grain")];
208         [o_transform_ckb setState: (NSInteger)strstr( psz_vfilters, "transform")];
209         [o_zoom_ckb setState: (NSInteger)strstr( psz_vfilters, "magnify")];
210         [o_puzzle_ckb setState: (NSInteger)strstr( psz_vfilters, "puzzle")];
211         [o_threshold_ckb setState: (NSInteger)strstr( psz_vfilters, "colorthres")];
212         [o_sepia_ckb setState: (NSInteger)strstr( psz_vfilters, "sepia")];
213         [o_noise_ckb setState: (NSInteger)strstr( psz_vfilters, "noise")];
214         [o_gradient_ckb setState: (NSInteger)strstr( psz_vfilters, "gradient")];
215         [o_extract_ckb setState: (NSInteger)strstr( psz_vfilters, "extract")];
216         [o_invert_ckb setState: (NSInteger)strstr( psz_vfilters, "invert")];
217         [o_posterize_ckb setState: (NSInteger)strstr( psz_vfilters, "posterize")];
218         [o_blur_ckb setState: (NSInteger)strstr( psz_vfilters, "motionblur")];
219         [o_motiondetect_ckb setState: (NSInteger)strstr( psz_vfilters, "motiondetect")];
220         [o_watereffect_ckb setState: (NSInteger)strstr( psz_vfilters, "ripple")];
221         [o_waves_ckb setState: (NSInteger)strstr( psz_vfilters, "wave")];
222         [o_psychedelic_ckb setState: (NSInteger)strstr( psz_vfilters, "psychedelic")];
223         free( psz_vfilters );
224     }
225     psz_vfilters = config_GetPsz( p_intf, "sub-source" );
226     if (psz_vfilters) {
227         [o_addtext_ckb setState: (NSInteger)strstr( psz_vfilters, "marq" )];
228         [o_addlogo_ckb setState: (NSInteger)strstr( psz_vfilters, "logo" )];
229         free( psz_vfilters );
230     }
231
232     /* fetch and show the various values */
233     [o_adjust_hue_sld setIntValue: config_GetInt( p_intf, "hue" )];
234     [o_adjust_contrast_sld setFloatValue: config_GetFloat( p_intf, "contrast" )];
235     [o_adjust_brightness_sld setFloatValue: config_GetFloat( p_intf, "brightness" )];
236     [o_adjust_saturation_sld setFloatValue: config_GetFloat( p_intf, "saturation" )];
237     [o_adjust_gamma_sld setFloatValue: config_GetFloat( p_intf, "gamma" )];
238     [o_adjust_brightness_sld setToolTip: [NSString stringWithFormat:@"%0.3f", config_GetFloat( p_intf, "brightness" )]];
239     [o_adjust_contrast_sld setToolTip: [NSString stringWithFormat:@"%0.3f", config_GetFloat( p_intf, "contrast" )]];
240     [o_adjust_gamma_sld setToolTip: [NSString stringWithFormat:@"%0.3f", config_GetFloat( p_intf, "gamma" )]];
241     [o_adjust_hue_sld setToolTip: [NSString stringWithFormat:@"%i", config_GetInt( p_intf, "hue" )]];
242     [o_adjust_saturation_sld setToolTip: [NSString stringWithFormat:@"%0.3f", config_GetFloat( p_intf, "saturation" )]];
243     b_state = [o_adjust_ckb state];
244     [o_adjust_brightness_sld setEnabled: b_state];
245     [o_adjust_brightness_ckb setEnabled: b_state];
246     [o_adjust_contrast_sld setEnabled: b_state];
247     [o_adjust_gamma_sld setEnabled: b_state];
248     [o_adjust_hue_sld setEnabled: b_state];
249     [o_adjust_saturation_sld setEnabled: b_state];
250     [o_adjust_brightness_lbl setEnabled: b_state];
251     [o_adjust_contrast_lbl setEnabled: b_state];
252     [o_adjust_gamma_lbl setEnabled: b_state];
253     [o_adjust_hue_lbl setEnabled: b_state];
254     [o_adjust_saturation_lbl setEnabled: b_state];
255     [o_adjust_reset_btn setEnabled: b_state];
256     [o_sharpen_sld setFloatValue: config_GetFloat( p_intf, "sharpen-sigma" )];
257     [o_sharpen_sld setToolTip: [NSString stringWithFormat:@"%0.3f", config_GetFloat( p_intf, "sharpen-sigma" )]];
258     [o_sharpen_sld setEnabled: [o_sharpen_ckb state]];
259     [o_sharpen_lbl setEnabled: [o_sharpen_ckb state]];
260     [o_banding_sld setIntValue: config_GetInt( p_intf, "gradfun-radius" )];
261     [o_banding_sld setToolTip: [NSString stringWithFormat:@"%i", config_GetInt( p_intf, "gradfun-radius" )]];
262     [o_banding_sld setEnabled: [o_banding_ckb state]];
263     [o_banding_lbl setEnabled: [o_banding_ckb state]];
264     [o_grain_sld setFloatValue: config_GetFloat( p_intf, "grain-variance" )];
265     [o_grain_sld setToolTip: [NSString stringWithFormat:@"%0.3f", config_GetFloat( p_intf, "grain-variance" )]];
266     [o_grain_sld setEnabled: [o_grain_ckb state]];
267     [o_grain_lbl setEnabled: [o_grain_ckb state]];
268
269     [o_crop_top_fld setIntValue: 0];
270     [o_crop_left_fld setIntValue: 0];
271     [o_crop_right_fld setIntValue: 0];
272     [o_crop_bottom_fld setIntValue: 0];
273     [o_crop_sync_top_bottom_ckb setState: NSOffState];
274     [o_crop_sync_left_right_ckb setState: NSOffState];
275
276     tmpChar = config_GetPsz( p_intf, "transform-type" );
277     tmpString = [NSString stringWithUTF8String: tmpChar];
278     if( [tmpString isEqualToString:@"hflip"] )
279         [o_transform_pop selectItemWithTag: 1];
280     else if( [tmpString isEqualToString:@"vflip"] )
281         [o_transform_pop selectItemWithTag: 2];
282     else
283         [o_transform_pop selectItemWithTag:[tmpString intValue]];
284     FREENULL( tmpChar );
285     [o_transform_pop setEnabled: [o_transform_ckb state]];
286     [o_puzzle_rows_fld setIntValue: config_GetInt( p_intf, "puzzle-rows" )];
287     [o_puzzle_columns_fld setIntValue: config_GetInt( p_intf, "puzzle-cols" )];
288     [o_puzzle_blackslot_ckb setState: config_GetInt( p_intf, "puzzle-black-slot" )];
289     b_state = [o_puzzle_ckb state];
290     [o_puzzle_rows_fld setEnabled: b_state];
291     [o_puzzle_rows_lbl setEnabled: b_state];
292     [o_puzzle_columns_fld setEnabled: b_state];
293     [o_puzzle_columns_lbl setEnabled: b_state];
294     [o_puzzle_blackslot_ckb setEnabled: b_state];
295
296     [o_threshold_color_fld setStringValue: [[NSString stringWithFormat:@"%x", config_GetInt( p_intf, "colorthres-color" )] uppercaseString]];
297     [o_threshold_saturation_sld setIntValue: config_GetInt( p_intf, "colorthres-saturationthres" )];
298     [o_threshold_saturation_sld setToolTip: [NSString stringWithFormat:@"%i", config_GetInt( p_intf, "colorthres-saturationthres" )]];
299     [o_threshold_similarity_sld setIntValue: config_GetInt( p_intf, "colorthres-similaritythres" )];
300     [o_threshold_similarity_sld setToolTip: [NSString stringWithFormat:@"%i", config_GetInt( p_intf, "colorthres-similaritythres" )]];
301     b_state = [o_threshold_ckb state];
302     [o_threshold_color_fld setEnabled: b_state];
303     [o_threshold_color_lbl setEnabled: b_state];
304     [o_threshold_saturation_sld setEnabled: b_state];
305     [o_threshold_saturation_lbl setEnabled: b_state];
306     [o_threshold_similarity_sld setEnabled: b_state];
307     [o_threshold_similarity_lbl setEnabled: b_state];
308     [o_sepia_fld setIntValue: config_GetInt( p_intf, "sepia-intensity" )];
309     [o_sepia_fld setEnabled: [o_sepia_ckb state]];
310     [o_sepia_lbl setEnabled: [o_sepia_ckb state]];
311     tmpChar = config_GetPsz( p_intf, "gradient-mode" );
312     tmpString = [NSString stringWithUTF8String: tmpChar];
313     if( [tmpString isEqualToString:@"hough"] )
314         [o_gradient_mode_pop selectItemWithTag: 3];
315     else if( [tmpString isEqualToString:@"edge"] )
316         [o_gradient_mode_pop selectItemWithTag: 2];
317     else
318         [o_gradient_mode_pop selectItemWithTag: 1];
319     FREENULL( tmpChar );
320     [o_gradient_cartoon_ckb setState: config_GetInt( p_intf, "gradient-cartoon" )];
321     [o_gradient_color_ckb setState: config_GetInt( p_intf, "gradient-type" )];
322     b_state = [o_gradient_ckb state];
323     [o_gradient_mode_pop setEnabled: b_state];
324     [o_gradient_mode_lbl setEnabled: b_state];
325     [o_gradient_cartoon_ckb setEnabled: b_state];
326     [o_gradient_color_ckb setEnabled: b_state];
327     [o_extract_fld setStringValue: [[NSString stringWithFormat:@"%x", config_GetInt( p_intf, "extract-component" )] uppercaseString]];
328     [o_extract_fld setEnabled: [o_extract_ckb state]];
329     [o_extract_lbl setEnabled: [o_extract_ckb state]];
330     [o_posterize_fld setIntValue: config_GetInt( p_intf, "posterize-level" )];
331     [o_posterize_fld setEnabled: [o_posterize_ckb state]];
332     [o_posterize_lbl setEnabled: [o_posterize_ckb state]];
333     [o_blur_sld setIntValue: config_GetInt( p_intf, "blur-factor" )];
334     [o_blur_sld setToolTip: [NSString stringWithFormat:@"%i", config_GetInt( p_intf, "blur-factor" )]];
335     [o_blur_sld setEnabled: [o_blur_ckb state]];
336     [o_blur_lbl setEnabled: [o_blur_ckb state]];
337
338     tmpChar = config_GetPsz( p_intf, "marq-marquee" );
339     if( tmpChar )
340     {
341         [o_addtext_text_fld setStringValue: [NSString stringWithUTF8String: tmpChar]];
342         FREENULL( tmpChar );
343     }
344     [o_addtext_pos_pop selectItemWithTag: config_GetInt( p_intf, "marq-position" )];
345     b_state = [o_addtext_ckb state];
346     [o_addtext_pos_pop setEnabled: b_state];
347     [o_addtext_pos_lbl setEnabled: b_state];
348     [o_addtext_text_lbl setEnabled: b_state];
349     [o_addtext_text_fld setEnabled: b_state];
350
351     tmpChar = config_GetPsz( p_intf, "logo-file" );
352     if( tmpChar )
353     {
354        [o_addlogo_logo_fld setStringValue: [NSString stringWithUTF8String: tmpChar]];
355         FREENULL( tmpChar );
356     }
357     [o_addlogo_pos_pop selectItemWithTag: config_GetInt( p_intf, "logo-position" )];
358     [o_addlogo_transparency_sld setIntValue: config_GetInt( p_intf, "logo-opacity" )];
359     [o_addlogo_transparency_sld setToolTip: [NSString stringWithFormat:@"%i", config_GetInt( p_intf, "logo-opacity" )]];
360     b_state = [o_addlogo_ckb state];
361     [o_addlogo_pos_pop setEnabled: b_state];
362     [o_addlogo_pos_lbl setEnabled: b_state];
363     [o_addlogo_logo_fld setEnabled: b_state];
364     [o_addlogo_logo_lbl setEnabled: b_state];
365     [o_addlogo_transparency_sld setEnabled: b_state];
366     [o_addlogo_transparency_lbl setEnabled: b_state];
367 }
368
369 - (void)setVideoFilter: (char *)psz_name on:(BOOL)b_on
370 {
371     char *psz_string, *psz_parser;
372     const char *psz_filter_type;
373
374     module_t *p_obj = module_find( psz_name );
375     if( !p_obj )
376     {
377         msg_Err( p_intf, "Unable to find filter module \"%s\".", psz_name );
378         return;
379     }
380     msg_Dbg( p_intf, "will set filter '%s'", psz_name );
381
382     if( module_provides( p_obj, "video splitter" ) )
383     {
384         psz_filter_type = "video-splitter";
385     }
386     else if( module_provides( p_obj, "video filter2" ) )
387     {
388         psz_filter_type = "video-filter";
389     }
390     else if( module_provides( p_obj, "sub source" ) )
391     {
392         psz_filter_type = "sub-source";
393     }
394     else if( module_provides( p_obj, "sub filter" ) )
395     {
396         psz_filter_type = "sub-filter";
397     }
398     else
399     {
400         msg_Err( p_intf, "Unknown video filter type." );
401         return;
402     }
403
404     psz_string = config_GetPsz( p_intf, psz_filter_type );
405
406     if (b_on) {
407         if(! psz_string)
408             psz_string = psz_name;
409         else if( (NSInteger)strstr( psz_string, psz_name ) == NO )
410             psz_string = (char *)[[NSString stringWithFormat: @"%s:%s", psz_string, psz_name] UTF8String];
411     } else {
412         psz_parser = strstr( psz_string, psz_name );
413         if( psz_parser )
414         {
415             if( *( psz_parser + strlen( psz_name ) ) == ':' )
416             {
417                 memmove( psz_parser, psz_parser + strlen( psz_name ) + 1,
418                         strlen( psz_parser + strlen( psz_name ) + 1 ) + 1 );
419             }
420             else
421             {
422                 *psz_parser = '\0';
423             }
424
425             /* Remove trailing : : */
426             if( strlen( psz_string ) > 0 &&
427                *( psz_string + strlen( psz_string ) -1 ) == ':' )
428             {
429                 *( psz_string + strlen( psz_string ) -1 ) = '\0';
430             }
431         }
432         else
433         {
434             free( psz_string );
435             return;
436         }
437     }
438     config_PutPsz( p_intf, psz_filter_type, psz_string );
439
440     /* Try to set on the fly */
441     if( !strcmp( psz_filter_type, "video-splitter" ) )
442     {
443         playlist_t *p_playlist = pl_Get( p_intf );
444         var_SetString( p_playlist, psz_filter_type, psz_string );
445     }
446     else
447     {
448         vout_thread_t *p_vout = getVout();
449         if( p_vout )
450         {
451             var_SetString( p_vout, psz_filter_type, psz_string );
452             vlc_object_release( p_vout );
453         }
454     }
455 }
456
457 - (void)restartFilterIfNeeded: (char *)psz_filter option: (char *)psz_name
458 {
459     vout_thread_t *p_vout = getVout();
460
461     if (p_vout == NULL)
462         return;
463     else
464         vlc_object_release( p_vout );
465
466     vlc_object_t *p_filter = vlc_object_find_name( pl_Get(p_intf), psz_filter );
467     int i_type;
468     i_type = var_Type( p_filter, psz_name );
469     if( i_type == 0 )
470         i_type = config_GetType( p_intf, psz_name );
471
472     if( !(i_type & VLC_VAR_ISCOMMAND) )
473     {
474         msg_Warn( p_intf, "Brute-restarting filter '%s', because the last changed option isn't a command", psz_name );
475         [self setVideoFilter: psz_filter on: NO];
476         [self setVideoFilter: psz_filter on: YES];
477     }
478     else
479         msg_Dbg( p_intf, "restart not needed" );
480
481     if( p_filter )
482         vlc_object_release( p_filter );
483 }
484
485 - (void)setVideoFilterProperty: (char *)psz_name forFilter: (char *)psz_filter integer: (int)i_value
486 {
487     vout_thread_t *p_vout = getVout();
488     vlc_object_t *p_filter;
489
490     if( p_vout == NULL ) {
491         config_PutInt( p_intf , psz_name , i_value );
492     } else {
493         p_filter = vlc_object_find_name( pl_Get(p_intf), psz_filter );
494
495         if(! p_filter ) {
496             msg_Err( p_intf, "we're unable to find the filter '%s'", psz_filter );
497             vlc_object_release( p_vout );
498             return;
499         }
500         var_SetInteger( p_filter, psz_name, i_value );
501         config_PutInt( p_intf, psz_name, i_value );
502         vlc_object_release( p_vout );
503         vlc_object_release( p_filter );
504     }
505
506     [self restartFilterIfNeeded:psz_filter option: psz_name];
507 }
508
509 - (void)setVideoFilterProperty: (char *)psz_name forFilter: (char *)psz_filter float: (float)f_value
510 {
511     vout_thread_t *p_vout = getVout();
512     vlc_object_t *p_filter;
513
514     if( p_vout == NULL ) {
515         config_PutFloat( p_intf , psz_name , f_value );
516     } else {
517         p_filter = vlc_object_find_name( pl_Get(p_intf), psz_filter );
518
519         if(! p_filter ) {
520             msg_Err( p_intf, "we're unable to find the filter '%s'", psz_filter );
521             vlc_object_release( p_vout );
522             return;
523         }
524         var_SetFloat( p_filter, psz_name, f_value );
525         config_PutFloat( p_intf, psz_name, f_value );
526         vlc_object_release( p_vout );
527         vlc_object_release( p_filter );
528
529         [self restartFilterIfNeeded:psz_filter option: psz_name];
530     }
531 }
532
533 - (void)setVideoFilterProperty: (char *)psz_name forFilter: (char *)psz_filter string: (char *)psz_value
534 {
535     vout_thread_t *p_vout = getVout();
536     vlc_object_t *p_filter;
537
538     if( p_vout == NULL ) {
539         config_PutPsz( p_intf, psz_name, psz_value );
540     } else {
541         p_filter = vlc_object_find_name( pl_Get(p_intf), psz_filter );
542
543         if(! p_filter ) {
544             msg_Err( p_intf, "we're unable to find the filter '%s'", psz_filter );
545             vlc_object_release( p_vout );
546             return;
547         }
548         var_SetString( p_filter, psz_name, psz_value );
549         config_PutPsz( p_intf, psz_name, psz_value );
550         vlc_object_release( p_vout );
551         vlc_object_release( p_filter );
552
553         [self restartFilterIfNeeded:psz_filter option: psz_name];
554     }
555 }
556
557 - (void)setVideoFilterProperty: (char *)psz_name forFilter: (char *)psz_filter boolean: (BOOL)b_value
558 {
559     vout_thread_t *p_vout = getVout();
560     vlc_object_t *p_filter;
561
562     if( p_vout == NULL ) {
563         config_PutInt( p_intf, psz_name, b_value );
564     } else {
565         p_filter = vlc_object_find_name( pl_Get(p_intf), psz_filter );
566
567         if(! p_filter ) {
568             msg_Err( p_intf, "we're unable to find the filter '%s'", psz_filter );
569             vlc_object_release( p_vout );
570             return;
571         }
572         var_SetBool( p_filter, psz_name, b_value );
573         config_PutInt( p_intf, psz_name, b_value );
574         vlc_object_release( p_vout );
575     }
576 }
577
578 #pragma mark -
579 #pragma mark basic
580 - (IBAction)enableAdjust:(id)sender
581 {
582     BOOL b_state = [o_adjust_ckb state];
583
584     [self setVideoFilter: "adjust" on: b_state];
585     [o_adjust_brightness_sld setEnabled: b_state];
586     [o_adjust_brightness_ckb setEnabled: b_state];
587     [o_adjust_brightness_lbl setEnabled: b_state];
588     [o_adjust_contrast_sld setEnabled: b_state];
589     [o_adjust_contrast_lbl setEnabled: b_state];
590     [o_adjust_gamma_sld setEnabled: b_state];
591     [o_adjust_gamma_lbl setEnabled: b_state];
592     [o_adjust_hue_sld setEnabled: b_state];
593     [o_adjust_hue_lbl setEnabled: b_state];
594     [o_adjust_saturation_sld setEnabled: b_state];
595     [o_adjust_saturation_lbl setEnabled: b_state];
596     [o_adjust_reset_btn setEnabled: b_state];
597 }
598
599 - (IBAction)adjustSliderChanged:(id)sender
600 {
601     if( sender == o_adjust_brightness_sld )
602         [self setVideoFilterProperty: "brightness" forFilter: "adjust" float: [o_adjust_brightness_sld floatValue]];
603     else if( sender == o_adjust_contrast_sld )
604         [self setVideoFilterProperty: "contrast" forFilter: "adjust" float: [o_adjust_contrast_sld floatValue]];
605     else if( sender == o_adjust_gamma_sld )
606         [self setVideoFilterProperty: "gamma" forFilter: "adjust" float: [o_adjust_gamma_sld floatValue]];
607     else if( sender == o_adjust_hue_sld )
608         [self setVideoFilterProperty: "hue" forFilter: "adjust" integer: [o_adjust_hue_sld intValue]];
609     else if( sender == o_adjust_saturation_sld )
610         [self setVideoFilterProperty: "saturation" forFilter: "adjust" float: [o_adjust_saturation_sld floatValue]];
611
612     if( sender == o_adjust_hue_sld )
613         [o_adjust_hue_sld setToolTip: [NSString stringWithFormat:@"%i", [o_adjust_hue_sld intValue]]];
614     else
615         [sender setToolTip: [NSString stringWithFormat:@"%0.3f", [sender floatValue]]];
616 }
617
618 - (IBAction)enableAdjustBrightnessThreshold:(id)sender
619 {
620     if (sender == o_adjust_reset_btn)
621     {
622         [o_adjust_brightness_sld setFloatValue: 1.0];
623         [o_adjust_contrast_sld setFloatValue: 1.0];
624         [o_adjust_gamma_sld setFloatValue: 1.0];
625         [o_adjust_hue_sld setIntValue: 0];
626         [o_adjust_saturation_sld setFloatValue: 1.0];
627         [o_adjust_brightness_sld setToolTip: [NSString stringWithFormat:@"%0.3f", 1.0]];
628         [o_adjust_contrast_sld setToolTip: [NSString stringWithFormat:@"%0.3f", 1.0]];
629         [o_adjust_gamma_sld setToolTip: [NSString stringWithFormat:@"%0.3f", 1.0]];
630         [o_adjust_hue_sld setToolTip: [NSString stringWithFormat:@"%i", 0]];
631         [o_adjust_saturation_sld setToolTip: [NSString stringWithFormat:@"%0.3f", 1.0]];
632         [self setVideoFilterProperty: "brightness" forFilter: "adjust" float: 1.0];
633         [self setVideoFilterProperty: "contrast" forFilter: "adjust" float: 1.0];
634         [self setVideoFilterProperty: "gamma" forFilter: "adjust" float: 1.0];
635         [self setVideoFilterProperty: "hue" forFilter: "adjust" integer: 0.0];
636         [self setVideoFilterProperty: "saturation" forFilter: "adjust" float: 1.0];
637     }
638     else
639         config_PutInt( p_intf, "brightness-threshold", [o_adjust_brightness_ckb state] );
640 }
641
642 - (IBAction)enableSharpen:(id)sender
643 {
644     BOOL b_state = [o_sharpen_ckb state];
645
646     [self setVideoFilter: "sharpen" on: b_state];
647     [o_sharpen_sld setEnabled: b_state];
648     [o_sharpen_lbl setEnabled: b_state];
649 }
650
651 - (IBAction)sharpenSliderChanged:(id)sender
652 {
653     [self setVideoFilterProperty: "sharpen-sigma" forFilter: "sharpen" float: [sender floatValue]];
654     [sender setToolTip: [NSString stringWithFormat:@"%0.3f", [sender floatValue]]];
655 }
656
657 - (IBAction)enableBanding:(id)sender
658 {
659     BOOL b_state = [o_banding_ckb state];
660
661     [self setVideoFilter: "gradfun" on: b_state];
662     [o_banding_sld setEnabled: b_state];
663     [o_banding_lbl setEnabled: b_state];
664 }
665
666 - (IBAction)bandingSliderChanged:(id)sender
667 {
668     [self setVideoFilterProperty: "gradfun-radius" forFilter: "gradfun" integer: [sender intValue]];
669     [sender setToolTip: [NSString stringWithFormat:@"%i", [sender intValue]]];
670 }
671
672 - (IBAction)enableGrain:(id)sender
673 {
674     BOOL b_state = [o_grain_ckb state];
675
676     [self setVideoFilter: "grain" on: b_state];
677     [o_grain_sld setEnabled: b_state];
678     [o_grain_lbl setEnabled: b_state];
679 }
680
681 - (IBAction)grainSliderChanged:(id)sender
682 {
683     [self setVideoFilterProperty: "grain-variance" forFilter: "grain" float: [sender floatValue]];
684     [sender setToolTip: [NSString stringWithFormat:@"%0.3f", [sender floatValue]]];
685 }
686
687
688 #pragma mark -
689 #pragma mark crop
690
691 #define updateopposite( giver, taker ) \
692     if (sender == giver) \
693         [taker setIntValue: [giver intValue]]
694
695 - (IBAction)cropObjectChanged:(id)sender
696 {
697     updateopposite( o_crop_top_fld, o_crop_top_stp );
698     updateopposite( o_crop_top_stp, o_crop_top_fld );
699     updateopposite( o_crop_left_fld, o_crop_left_stp );
700     updateopposite( o_crop_left_stp, o_crop_left_fld );
701     updateopposite( o_crop_right_fld, o_crop_right_stp );
702     updateopposite( o_crop_right_stp, o_crop_right_fld );
703     updateopposite( o_crop_bottom_fld, o_crop_bottom_stp );
704     updateopposite( o_crop_bottom_stp, o_crop_bottom_fld );
705
706     if( [o_crop_sync_top_bottom_ckb state] ) {
707         if (sender == o_crop_top_fld || sender == o_crop_top_stp ) {
708             [o_crop_bottom_fld setIntValue: [o_crop_top_fld intValue]];
709             [o_crop_bottom_stp setIntValue: [o_crop_top_fld intValue]];
710         }
711         else
712         {
713             [o_crop_top_fld setIntValue: [o_crop_bottom_fld intValue]];
714             [o_crop_top_stp setIntValue: [o_crop_bottom_fld intValue]];
715         }
716     }
717     if( [o_crop_sync_left_right_ckb state] ) {
718         if (sender == o_crop_left_fld || sender == o_crop_left_stp ) {
719             [o_crop_right_fld setIntValue: [o_crop_left_fld intValue]];
720             [o_crop_right_stp setIntValue: [o_crop_left_fld intValue]];
721         }
722         else
723         {
724             [o_crop_left_fld setIntValue: [o_crop_right_fld intValue]];
725             [o_crop_left_stp setIntValue: [o_crop_right_fld intValue]];
726         }
727     }
728
729     vout_thread_t *p_vout = getVout();
730     if( p_vout ) {
731         var_SetInteger( p_vout, "crop-top", [o_crop_top_fld intValue] );
732         var_SetInteger( p_vout, "crop-bottom", [o_crop_bottom_fld intValue] );
733         var_SetInteger( p_vout, "crop-left", [o_crop_left_fld intValue] );
734         var_SetInteger( p_vout, "crop-right", [o_crop_right_fld intValue] );
735         vlc_object_release( p_vout );
736     }
737 }
738
739 #undef updateopposite
740
741 #pragma mark -
742 #pragma mark geometry
743 - (IBAction)enableTransform:(id)sender
744 {
745     [self setVideoFilter: "transform" on: [o_transform_ckb state]];
746     [o_transform_pop setEnabled: [o_transform_ckb state]];
747 }
748
749 - (IBAction)transformModifierChanged:(id)sender
750 {
751     NSInteger tag = [[o_transform_pop selectedItem] tag];
752     char * psz_string = (char *)[[NSString stringWithFormat:@"%i", tag] UTF8String];
753     if( tag == 1 )
754         psz_string = (char *)"hflip";
755     else if( tag == 2 )
756         psz_string = (char *)"vflip";
757
758     [self setVideoFilterProperty: "transform-type" forFilter: "transform" string: psz_string];
759 }
760
761 - (IBAction)enableZoom:(id)sender
762 {
763     [self setVideoFilter: "magnify" on: [o_zoom_ckb state]];
764 }
765
766 - (IBAction)enablePuzzle:(id)sender
767 {
768     BOOL b_state = [o_puzzle_ckb state];
769
770     [self setVideoFilter: "puzzle" on: b_state];
771     [o_puzzle_columns_fld setEnabled: b_state];
772     [o_puzzle_columns_lbl setEnabled: b_state];
773     [o_puzzle_rows_fld setEnabled: b_state];
774     [o_puzzle_rows_lbl setEnabled: b_state];
775     [o_puzzle_blackslot_ckb setEnabled: b_state];
776 }
777
778 - (IBAction)puzzleModifierChanged:(id)sender
779 {
780     if( sender == o_puzzle_blackslot_ckb )
781         [self setVideoFilterProperty: "puzzle-black-slot" forFilter: "puzzle" boolean: [o_puzzle_blackslot_ckb state]];
782     else if( sender == o_puzzle_columns_fld )
783         [self setVideoFilterProperty: "puzzle-cols" forFilter: "puzzle" integer: [o_puzzle_columns_fld intValue]];
784     else
785         [self setVideoFilterProperty: "puzzle-rows" forFilter: "puzzle" integer: [o_puzzle_rows_fld intValue]];
786 }
787
788
789 #pragma mark -
790 #pragma mark color
791 - (IBAction)enableThreshold:(id)sender
792 {
793     BOOL b_state = [o_threshold_ckb state];
794
795     [self setVideoFilter: "colorthres" on: b_state];
796     [o_threshold_color_fld setEnabled: b_state];
797     [o_threshold_color_lbl setEnabled: b_state];
798     [o_threshold_saturation_sld setEnabled: b_state];
799     [o_threshold_saturation_lbl setEnabled: b_state];
800     [o_threshold_similarity_sld setEnabled: b_state];
801     [o_threshold_similarity_lbl setEnabled: b_state];
802 }
803
804 - (IBAction)thresholdModifierChanged:(id)sender
805 {
806     if( sender == o_threshold_color_fld )
807         [self setVideoFilterProperty: "colorthres-color" forFilter: "colorthres" integer: [o_threshold_color_fld intValue]];
808     else if( sender == o_threshold_saturation_sld )
809     {
810         [self setVideoFilterProperty: "colorthres-saturationthres" forFilter: "colorthres" integer: [o_threshold_saturation_sld intValue]];
811         [o_threshold_saturation_sld setToolTip: [NSString stringWithFormat:@"%i", [o_threshold_saturation_sld intValue]]];
812     }
813     else
814     {
815         [self setVideoFilterProperty: "colorthres-similaritythres" forFilter: "colorthres" integer: [o_threshold_similarity_sld intValue]];
816         [o_threshold_similarity_sld setToolTip: [NSString stringWithFormat:@"%i", [o_threshold_similarity_sld intValue]]];
817     }
818 }
819
820 - (IBAction)enableSepia:(id)sender
821 {
822     BOOL b_state = [o_sepia_ckb state];
823
824     [self setVideoFilter: "sepia" on: b_state];
825     [o_sepia_fld setEnabled: b_state];
826     [o_sepia_lbl setEnabled: b_state];
827 }
828
829 - (IBAction)sepiaModifierChanged:(id)sender
830 {
831     [self setVideoFilterProperty: "sepia-intensity" forFilter: "sepia" integer: [o_sepia_fld intValue]];
832 }
833
834 - (IBAction)enableNoise:(id)sender
835 {
836     [self setVideoFilter: "noise" on: [o_noise_ckb state]];
837 }
838
839 - (IBAction)enableGradient:(id)sender
840 {
841     BOOL b_state = [o_gradient_ckb state];
842
843     [self setVideoFilter: "gradient" on: b_state];
844     [o_gradient_mode_pop setEnabled: b_state];
845     [o_gradient_mode_lbl setEnabled: b_state];
846     [o_gradient_color_ckb setEnabled: b_state];
847     [o_gradient_cartoon_ckb setEnabled: b_state];
848 }
849
850 - (IBAction)gradientModifierChanged:(id)sender
851 {
852     if( sender == o_gradient_mode_pop ) {
853         if( [[o_gradient_mode_pop selectedItem] tag] == 3 )
854             [self setVideoFilterProperty: "gradient-mode" forFilter: "gradient" string: "hough"];
855         else if( [[o_gradient_mode_pop selectedItem] tag] == 2 )
856             [self setVideoFilterProperty: "gradient-mode" forFilter: "gradient" string: "edge"];
857         else
858             [self setVideoFilterProperty: "gradient-mode" forFilter: "gradient" string: "gradient"];
859     }
860     else if( sender == o_gradient_color_ckb )
861         [self setVideoFilterProperty: "gradient-type" forFilter: "gradient" integer: [o_gradient_color_ckb state]];
862     else
863         [self setVideoFilterProperty: "gradient-cartoon" forFilter: "gradient" boolean: [o_gradient_cartoon_ckb state]];
864 }
865
866 - (IBAction)enableExtract:(id)sender
867 {
868     BOOL b_state = [o_extract_ckb state]; 
869     [self setVideoFilter: "extract" on: b_state];
870     [o_extract_fld setEnabled: b_state];
871     [o_extract_lbl setEnabled: b_state];
872 }
873
874 - (IBAction)extractModifierChanged:(id)sender
875 {
876     [self setVideoFilterProperty: "extract-component" forFilter: "extract" integer: [o_extract_fld intValue]];  
877 }
878
879 - (IBAction)enableInvert:(id)sender
880 {
881     [self setVideoFilter: "invert" on: [o_invert_ckb state]];
882 }
883
884 - (IBAction)enablePosterize:(id)sender
885 {
886     BOOL b_state = [o_posterize_ckb state];
887
888     [self setVideoFilter: "posterize" on: b_state];
889     [o_posterize_fld setEnabled: b_state];
890     [o_posterize_lbl setEnabled: b_state];
891 }
892
893 - (IBAction)posterizeModifierChanged:(id)sender
894 {
895     [self setVideoFilterProperty: "posterize-level" forFilter: "posterize" integer: [o_extract_fld intValue]];
896 }
897
898 - (IBAction)enableBlur:(id)sender
899 {
900     BOOL b_state = [o_blur_ckb state];
901
902     [self setVideoFilter: "motionblur" on: b_state];
903     [o_blur_sld setEnabled: b_state];
904     [o_blur_lbl setEnabled: b_state];
905 }
906
907 - (IBAction)blurModifierChanged:(id)sender
908 {
909     [self setVideoFilterProperty: "blur-factor" forFilter: "motionblur" integer: [sender intValue]];
910     [sender setToolTip: [NSString stringWithFormat:@"%i", [sender intValue]]];
911 }
912
913 - (IBAction)enableMotionDetect:(id)sender
914 {
915     [self setVideoFilter: "motiondetect" on: [o_motiondetect_ckb state]];
916 }
917
918 - (IBAction)enableWaterEffect:(id)sender
919 {
920     [self setVideoFilter: "ripple" on: [o_watereffect_ckb state]];
921 }
922
923 - (IBAction)enableWaves:(id)sender
924 {
925     [self setVideoFilter: "wave" on: [o_waves_ckb state]];
926 }
927
928 - (IBAction)enablePsychedelic:(id)sender
929 {
930     [self setVideoFilter: "psychedelic" on: [o_psychedelic_ckb state]];
931 }
932
933
934 #pragma mark -
935 #pragma mark Miscellaneous
936 - (IBAction)enableAddText:(id)sender
937 {
938     BOOL b_state = [o_addtext_ckb state];
939
940     [o_addtext_pos_pop setEnabled: b_state];
941     [o_addtext_pos_lbl setEnabled: b_state];
942     [o_addtext_text_lbl setEnabled: b_state];
943     [o_addtext_text_fld setEnabled: b_state];
944     [self setVideoFilter: "marq" on: b_state];
945 }
946
947 - (IBAction)addTextModifierChanged:(id)sender
948 {
949     if (sender == o_addtext_text_fld)
950         [self setVideoFilterProperty: "marq-marquee" forFilter: "marq" string: (char *)[[o_addtext_text_fld stringValue] UTF8String]];
951     else
952         [self setVideoFilterProperty: "marq-position" forFilter: "marq" integer: [[o_addtext_pos_pop selectedItem] tag]];
953 }
954
955 - (IBAction)enableAddLogo:(id)sender
956 {
957     BOOL b_state = [o_addlogo_ckb state];
958
959     [o_addlogo_pos_pop setEnabled: b_state];
960     [o_addlogo_pos_lbl setEnabled: b_state];
961     [o_addlogo_logo_fld setEnabled: b_state];
962     [o_addlogo_logo_lbl setEnabled: b_state];
963     [o_addlogo_transparency_sld setEnabled: b_state];
964     [o_addlogo_transparency_lbl setEnabled: b_state];
965     [self setVideoFilter: "logo" on: b_state];
966 }
967
968 - (IBAction)addLogoModifierChanged:(id)sender
969 {
970     if (sender == o_addlogo_logo_fld)
971         [self setVideoFilterProperty: "logo-file" forFilter: "logo" string: (char *)[[o_addlogo_logo_fld stringValue] UTF8String]];
972     else if (sender == o_addlogo_pos_pop)
973         [self setVideoFilterProperty: "logo-position" forFilter: "logo" integer: [[o_addlogo_pos_pop selectedItem] tag]];
974     else
975     {
976         [self setVideoFilterProperty: "logo-opacity" forFilter: "logo" integer: [o_addlogo_transparency_sld intValue]];
977         [o_addlogo_transparency_sld setToolTip: [NSString stringWithFormat:@"%i", [o_addlogo_transparency_sld intValue]]];
978     }
979 }
980
981 @end