1 /*****************************************************************************
2 * extended.m: MacOS X Extended interface panel
3 *****************************************************************************
4 * Copyright (C) 2005-2008 the VideoLAN team
7 * Authors: Felix Paul Kühne <fkuehne@videolan.org>
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.
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.
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 *****************************************************************************/
25 /*****************************************************************************
27 *****************************************************************************/
33 #import <vlc_interface.h>
35 /*****************************************************************************
36 * VLCExtended implementation
37 *****************************************************************************/
39 @implementation VLCExtended
41 static VLCExtended *_o_sharedInstance = nil;
43 + (VLCExtended *)sharedInstance
45 return _o_sharedInstance ? _o_sharedInstance : [[self alloc] init];
50 if (_o_sharedInstance) {
53 _o_sharedInstance = [super init];
56 return _o_sharedInstance;
59 /*****************************************************************************
61 *****************************************************************************/
65 /* localise GUI-strings */
66 /* method is called from intf.m (in method showExtended) */
67 [o_extended_window setTitle: _NS("Extended controls")];
68 [o_btn_vidFlts_mrInfo setToolTip: _NS("Shows more information about the available video filters.")];
69 [o_ckb_wave setTitle: _NS("Wave")];
70 [o_ckb_ripple setTitle: _NS("Ripple")];
71 [o_ckb_psycho setTitle: _NS("Psychedelic")];
72 [o_ckb_gradient setTitle: _NS("Gradient")];
73 [o_lbl_general setStringValue: _NS("General editing filters")];
74 [o_lbl_distort setStringValue: _NS("Distortion filters")];
75 [o_ckb_blur setTitle: _NS("Blur")];
76 [o_ckb_blur setToolTip: _NS("Adds motion blurring to the image")];
77 [o_ckb_imgClone setTitle: _NS("Image clone")];
78 [o_ckb_imgClone setToolTip: _NS("Creates several copies of the Video "
80 [o_ckb_imgCrop setTitle: _NS("Image cropping")];
81 [o_ckb_imgCrop setToolTip: _NS("Crops a defined part of the image")];
82 [o_ckb_imgInvers setTitle: _NS("Invert colors")];
83 [o_ckb_imgInvers setToolTip: _NS("Inverts the colors of the image")];
84 [o_ckb_trnsform setTitle: _NS("Transformation")];
85 [o_ckb_trnsform setToolTip: _NS("Rotates or flips the image")];
86 [o_ckb_intZoom setTitle: _NS("Interactive Zoom")];
87 [o_ckb_intZoom setToolTip: _NS("Enables an interactive Zoom feature")];
88 [o_ckb_vlme_norm setTitle: _NS("Volume normalization")];
89 [o_ckb_vlme_norm setToolTip: _NS("Prevents the audio output from going "
90 "over a predefined value.")];
91 [o_ckb_hdphnVirt setTitle: _NS("Headphone virtualization")];
92 [o_ckb_hdphnVirt setToolTip: _NS("Imitates the effect of surround sound "
93 "when using headphones.")];
94 [o_lbl_maxLevel setStringValue: _NS("Maximum level")];
95 [o_btn_rstrDefaults setTitle: _NS("Restore Defaults")];
96 [o_ckb_enblAdjustImg setTitle: _NS("Enable")];
97 [o_lbl_brightness setStringValue: _NS("Brightness")];
98 [o_lbl_contrast setStringValue: _NS("Contrast")];
99 [o_lbl_gamma setStringValue: _NS("Gamma")];
100 [o_lbl_hue setStringValue: _NS("Hue")];
101 [o_lbl_saturation setStringValue: _NS("Saturation")];
102 [o_lbl_opaque setStringValue: _NS("Opaqueness")];
108 /* set the adjust-filter-sliders to the values from the prefs and enable
111 intf_thread_t * p_intf = VLCIntf;
112 psz_vfilters = config_GetPsz( p_intf, "vout-filter" );
113 /* set the video-filter-checkboxes to the correct values */
116 [o_ckb_blur setState: (int)strstr( psz_vfilters, "motionblur")];
117 [o_ckb_imgClone setState: (int)strstr( psz_vfilters, "clone")];
118 [o_ckb_imgCrop setState: (int)strstr( psz_vfilters, "crop")];
119 [o_ckb_trnsform setState: (int)strstr( psz_vfilters, "transform")];
120 [o_ckb_intZoom setState: (int)strstr( psz_vfilters, "magnify")];
122 free( psz_vfilters );
125 /* set the video-filter checkboxes to the correct values */
126 char * psz_vifilters;
127 psz_vifilters = config_GetPsz( p_intf, "video-filter" );
128 if( psz_vifilters && strstr( psz_vifilters, "adjust" ) )
130 [o_ckb_enblAdjustImg setState: NSOnState];
131 [o_btn_rstrDefaults setEnabled: YES];
132 [o_sld_brightness setEnabled: YES];
133 [o_sld_contrast setEnabled: YES];
134 [o_sld_gamma setEnabled: YES];
135 [o_sld_hue setEnabled: YES];
136 [o_sld_saturation setEnabled: YES];
140 [o_ckb_enblAdjustImg setState: NSOffState];
141 [o_btn_rstrDefaults setEnabled: NO];
142 [o_sld_brightness setEnabled: NO];
143 [o_sld_contrast setEnabled: NO];
144 [o_sld_gamma setEnabled: NO];
145 [o_sld_hue setEnabled: NO];
146 [o_sld_saturation setEnabled: NO];
150 [o_ckb_wave setState: (int)strstr( psz_vifilters, "wave")];
151 [o_ckb_psycho setState: (int)strstr( psz_vifilters, "psychedelic")];
152 [o_ckb_ripple setState: (int)strstr( psz_vifilters, "ripple")];
153 [o_ckb_gradient setState: (int)strstr( psz_vifilters, "gradient")];
154 [o_ckb_imgInvers setState: (int)strstr( psz_vifilters, "invert")];
156 free( psz_vifilters );
159 /* set the audio-filter-checkboxes to the values taken from the prefs */
161 psz_afilters = config_GetPsz( p_intf, "audio-filter" );
164 [o_ckb_hdphnVirt setState: (int)strstr( psz_afilters, "headphone" ) ];
165 [o_ckb_vlme_norm setState: (int)strstr( psz_afilters, "normvol" ) ];
167 free( psz_afilters );
170 /* fill the popup button according to our available views */
171 [o_selector_pop removeAllItems];
172 [o_selector_pop addItemWithTitle: _NS("Adjust Image")];
173 [o_selector_pop addItemWithTitle: _NS("Video Filter")];
174 [o_selector_pop addItemWithTitle: _NS("Audio Filter")];
175 [o_selector_pop selectItemAtIndex: 0];
177 /* make sure we draw a view on launch */
178 [self viewSelectorAction: self];
183 - (BOOL)getConfigChanged
185 return o_config_changed;
190 /* get the correct slider values from the prefs, in case they were changed
192 intf_thread_t * p_intf = VLCIntf;
194 int i_value = config_GetInt( p_intf, "hue" );
195 if( i_value > 0 && i_value < 360 )
197 [o_sld_hue setIntValue: i_value];
202 f_value = config_GetFloat( p_intf, "saturation" );
203 if( f_value > 0 && f_value < 5 )
204 [o_sld_saturation setIntValue: (int)(100 * f_value) ];
206 f_value = config_GetFloat( p_intf, "contrast" );
207 if( f_value > 0 && f_value < 4 )
208 [o_sld_contrast setIntValue: (int)(100 * f_value) ];
210 f_value = config_GetFloat( p_intf, "brightness" );
211 if( f_value > 0 && f_value < 2 )
212 [o_sld_brightness setIntValue: (int)(100 * f_value) ];
214 f_value = config_GetFloat( p_intf, "gamma" );
215 if( f_value > 0 && f_value < 10 )
216 [o_sld_gamma setIntValue: (int)(10 * f_value) ];
218 f_value = config_GetFloat( p_intf, "norm-max-level" );
219 if( f_value > 0 && f_value < 10 )
220 [o_sld_maxLevel setFloatValue: f_value ];
222 [o_sld_opaque setFloatValue: (config_GetFloat( p_intf,
223 "macosx-opaqueness") * 100)];
225 /* show the window */
226 [o_extended_window displayIfNeeded];
227 [o_extended_window makeKeyAndOrderFront:nil];
230 - (IBAction)viewSelectorAction:(id)sender
232 NSView *o_toBeShown_view;
233 /* check which view to show */
234 if( [[[o_selector_pop selectedItem] title] isEqualToString: _NS("Adjust Image")] )
235 o_toBeShown_view = o_adjustImg_view;
236 else if( [[[o_selector_pop selectedItem] title] isEqualToString: _NS("Audio Filter")] )
237 o_toBeShown_view = o_audioFlts_view;
238 else if( [[[o_selector_pop selectedItem] title] isEqualToString: _NS("Video Filter")] )
239 o_toBeShown_view = o_videoFilters_view;
241 msg_Err( VLCIntf, "invalid ui view requested" );
243 NSRect o_win_rect, o_view_rect, o_old_view_rect;
244 o_win_rect = [o_extended_window frame];
245 o_view_rect = [o_toBeShown_view frame];
247 if( o_currentlyshown_view != nil )
249 /* restore our window's height, if we've shown another category previously */
250 o_old_view_rect = [o_currentlyshown_view frame];
251 o_win_rect.size.height = o_win_rect.size.height - o_old_view_rect.size.height;
252 o_win_rect.origin.y = ( o_win_rect.origin.y + o_old_view_rect.size.height ) - o_view_rect.size.height;
254 /* remove our previous category view */
255 [o_currentlyshown_view removeFromSuperviewWithoutNeedingDisplay];
258 o_win_rect.size.height = o_win_rect.size.height + o_view_rect.size.height;
260 //[o_extended_window displayIfNeeded];
261 [o_extended_window setFrame: o_win_rect display:YES animate: YES];
263 [o_toBeShown_view setFrame: NSMakeRect( 0,
264 0, //[o_top_controls_box frame].size.height,
265 o_view_rect.size.width,
266 o_view_rect.size.height )];
267 [o_toBeShown_view setNeedsDisplay: YES];
268 [o_toBeShown_view setAutoresizesSubviews: YES];
269 [[o_extended_window contentView] addSubview: o_toBeShown_view];
271 /* keep our current category for further reference */
272 [o_currentlyshown_view release];
273 o_currentlyshown_view = o_toBeShown_view;
274 [o_currentlyshown_view retain];
277 - (IBAction)enableAdjustImage:(id)sender
279 /* en-/disable the sliders */
280 if ([o_ckb_enblAdjustImg state] == NSOnState)
282 [o_btn_rstrDefaults setEnabled: YES];
283 [o_sld_brightness setEnabled: YES];
284 [o_sld_contrast setEnabled: YES];
285 [o_sld_gamma setEnabled: YES];
286 [o_sld_hue setEnabled: YES];
287 [o_sld_saturation setEnabled: YES];
288 [self changeVideoFiltersString: "adjust" onOrOff: true];
292 [o_btn_rstrDefaults setEnabled: NO];
293 [o_sld_brightness setEnabled: NO];
294 [o_sld_contrast setEnabled: NO];
295 [o_sld_gamma setEnabled: NO];
296 [o_sld_hue setEnabled: NO];
297 [o_sld_saturation setEnabled: NO];
298 [self changeVideoFiltersString: "adjust" onOrOff: false];
302 - (IBAction)restoreDefaultsForAdjustImage:(id)sender
304 /* reset the sliders */
305 [o_sld_brightness setIntValue: 100];
306 [o_sld_contrast setIntValue: 100];
307 [o_sld_gamma setIntValue: 10];
308 [o_sld_hue setIntValue: 0];
309 [o_sld_saturation setIntValue: 100];
310 [o_sld_opaque setIntValue: 100];
312 /* transmit the values */
313 [self sliderActionAdjustImage: o_sld_brightness];
314 [self sliderActionAdjustImage: o_sld_contrast];
315 [self sliderActionAdjustImage: o_sld_gamma];
316 [self sliderActionAdjustImage: o_sld_hue];
317 [self sliderActionAdjustImage: o_sld_saturation];
318 [self opaqueSliderAction: o_sld_opaque];
321 - (IBAction)sliderActionAdjustImage:(id)sender
323 /* read-out the sliders' values and apply them */
324 intf_thread_t * p_intf = VLCIntf;
325 vout_thread_t *p_vout = (vout_thread_t *)vlc_object_find(p_intf, VLC_OBJECT_VOUT, FIND_ANYWHERE);
326 vlc_object_t *p_filter;
330 msg_Dbg( p_intf, "no vout present, saving settings anyway" );
331 if (sender == o_sld_brightness)
333 config_PutFloat( p_intf , "brightness" , [o_sld_brightness floatValue] / 100);
335 else if (sender == o_sld_contrast)
337 config_PutFloat( p_intf , "contrast" , [o_sld_contrast floatValue] / 100);
339 else if (sender == o_sld_gamma)
341 config_PutFloat( p_intf , "gamma" , [o_sld_gamma floatValue] / 10);
343 else if (sender == o_sld_hue)
345 config_PutInt( p_intf , "hue" , [o_sld_hue intValue]);
347 else if (sender == o_sld_saturation)
349 config_PutFloat( p_intf , "saturation" , [o_sld_saturation floatValue] / 100);
353 msg_Warn( p_intf, "the corresponding subfilter coundn't be found" );
358 msg_Dbg( p_intf, "we found a vout to adjust, let's look for the filter" );
359 p_filter = (vlc_object_t *)vlc_object_find_name( p_intf, "adjust", FIND_ANYWHERE );
363 msg_Err( p_intf, "we're unable to find the adjust filter!" );
364 vlc_object_release( p_vout );
368 if (sender == o_sld_brightness)
370 var_SetFloat( p_filter, "brightness", [o_sld_brightness floatValue] / 100 );
371 config_PutFloat( p_intf, "brightness", [o_sld_brightness floatValue] / 100 );
373 else if (sender == o_sld_contrast)
375 var_SetFloat( p_filter, "contrast", [o_sld_contrast floatValue] / 100 );
376 config_PutFloat( p_intf, "contrast", [o_sld_contrast floatValue] / 100 );
378 else if (sender == o_sld_gamma)
380 var_SetFloat( p_filter, "gamma", [o_sld_gamma floatValue] / 10 );
381 config_PutFloat( p_intf, "gamma", [o_sld_gamma floatValue] / 10 );
383 else if (sender == o_sld_hue)
385 var_SetInteger( p_filter, "hue", [o_sld_hue intValue] );
386 config_PutInt( p_intf , "hue" , [o_sld_hue intValue] );
388 else if (sender == o_sld_saturation)
390 var_SetFloat( p_filter, "saturation", [o_sld_saturation floatValue] / 100 );
391 config_PutFloat( p_intf , "saturation" , [o_sld_saturation floatValue] / 100 );
395 msg_Warn( p_intf, "couldn't find variable for slider!" );
397 vlc_object_release( p_filter );
398 vlc_object_release( p_vout );
401 o_config_changed = YES;
404 /* change the opaqueness of the vouts */
405 - (IBAction)opaqueSliderAction:(id)sender
408 id o_window = [NSApp keyWindow];
409 NSArray *o_windows = [NSApp orderedWindows];
410 NSEnumerator *o_enumerator = [o_windows objectEnumerator];
411 playlist_t * p_playlist = pl_Yield( VLCIntf );
412 vout_thread_t *p_vout = vlc_object_find( VLCIntf, VLC_OBJECT_VOUT, FIND_ANYWHERE );
413 vout_thread_t *p_real_vout;
415 val.f_float = [o_sld_opaque floatValue] / 100;
419 p_real_vout = [VLCVoutView getRealVout: p_vout];
420 var_Set( p_real_vout, "macosx-opaqueness", val );
422 while ((o_window = [o_enumerator nextObject]))
424 if( [[o_window className] isEqualToString: @"VLCVoutWindow"] ||
425 [[[VLCMain sharedInstance] getEmbeddedList]
426 windowContainsEmbedded: o_window])
428 [o_window setAlphaValue: val.f_float];
432 vlc_object_release( p_vout );
436 config_PutFloat( p_playlist , "macosx-opaqueness" , val.f_float );
438 vlc_object_release( p_playlist );
440 o_config_changed = YES;
443 - (IBAction)enableHeadphoneVirtualizer:(id)sender
445 /* en-/disable headphone virtualisation */
446 if ([o_ckb_hdphnVirt state] == NSOnState)
447 [self changeAFiltersString: "headphone_channel_mixer" onOrOff: true ];
449 [self changeAFiltersString: "headphone_channel_mixer" onOrOff: false ];
452 - (IBAction)sliderActionMaximumAudioLevel:(id)sender
454 /* read-out the slider's value and apply it */
455 intf_thread_t * p_intf = VLCIntf;
456 aout_instance_t * p_aout= (aout_instance_t *)vlc_object_find(p_intf, VLC_OBJECT_AOUT, FIND_ANYWHERE);
460 var_SetFloat( p_aout, "norm-max-level", [o_sld_maxLevel floatValue] );
461 vlc_object_release( p_aout );
464 config_PutFloat( p_intf, "norm-max-level", [o_sld_maxLevel floatValue] );
466 o_config_changed = YES;
469 - (IBAction)enableVolumeNormalization:(id)sender
471 /* en-/disable volume normalisation */
472 if( [o_ckb_vlme_norm state] == NSOnState )
473 [self changeAFiltersString: "normvol" onOrOff: YES ];
475 [self changeAFiltersString: "normvol" onOrOff: NO ];
478 - (IBAction)videoFilterAction:(id)sender
480 /* en-/disable video filters */
481 if (sender == o_ckb_blur)
482 [self changeVideoFiltersString: "motionblur" onOrOff: [o_ckb_blur state]];
484 else if (sender == o_ckb_imgClone)
485 [self changeVoutFiltersString: "clone" onOrOff: [o_ckb_imgClone state]];
487 else if (sender == o_ckb_imgCrop)
488 [self changeVoutFiltersString: "crop" onOrOff: [o_ckb_imgCrop state]];
490 else if (sender == o_ckb_imgInvers)
491 [self changeVideoFiltersString: "invert" onOrOff: [o_ckb_imgInvers state]];
493 else if (sender == o_ckb_trnsform)
494 [self changeVoutFiltersString: "transform" onOrOff: [o_ckb_trnsform state]];
496 else if (sender == o_ckb_intZoom )
497 [self changeVoutFiltersString: "magnify" onOrOff: [o_ckb_intZoom state]];
499 else if (sender == o_ckb_wave )
500 [self changeVideoFiltersString: "wave" onOrOff: [o_ckb_wave state]];
502 else if (sender == o_ckb_gradient )
503 [self changeVideoFiltersString: "gradient" onOrOff: [o_ckb_gradient state]];
505 else if (sender == o_ckb_psycho )
506 [self changeVideoFiltersString: "psychedelic" onOrOff: [o_ckb_psycho state]];
508 else if (sender == o_ckb_ripple )
509 [self changeVideoFiltersString: "ripple" onOrOff: [o_ckb_ripple state]];
512 msg_Err( VLCIntf, "cannot find switched video-filter" ); /* this can't happen */
515 - (IBAction)moreInfoVideoFilters:(id)sender
517 /* show info sheet */
518 NSBeginInformationalAlertSheet(_NS("About the video filters"),
527 _NS("This panel allows on-the-fly selection of various video effects.\n"
528 "These filters can be configured individually in the Preferences, in "
529 "the subsections of Video/Filters.\n"
530 "To choose the order in which the filter are applied, a filter "
531 "option string can be set in the Preferences, Video / Filters section."));
535 /*****************************************************************************
536 * methods to communicate changes to VLC's core
537 *****************************************************************************/
539 - (void)changeVoutFiltersString:(char *)psz_name onOrOff:(bool )b_add
541 /* copied from ../wxwidgets/extrapanel.cpp
542 * renamed to conform with Cocoa's rules */
543 /* this method only changes 1st generation video filters (the ones that
544 * can't be used for transcoding). Have a look at changeVideoFiltersString
545 * for the 2nd generation filters. */
547 vout_thread_t *p_vout;
548 intf_thread_t * p_intf = VLCIntf;
550 char *psz_parser, *psz_string;
551 psz_string = config_GetPsz( p_intf, "vout-filter" );
553 if( !psz_string ) psz_string = strdup("");
555 psz_parser = strstr( psz_string, psz_name );
561 psz_parser = psz_string;
562 asprintf( &psz_string, (*psz_string) ? "%s:%s" : "%s%s",
563 psz_string, psz_name );
575 memmove( psz_parser, psz_parser + strlen(psz_name) +
576 (*(psz_parser + strlen(psz_name)) == ':' ? 1 : 0 ),
577 strlen(psz_parser + strlen(psz_name)) + 1 );
579 /* Remove trailing : : */
580 if( *(psz_string+strlen(psz_string ) -1 ) == ':' )
582 *(psz_string+strlen(psz_string ) -1 ) = '\0';
591 /* Vout is not kept, so put that in the config */
592 config_PutPsz( p_intf, "vout-filter", psz_string );
594 /* Try to set on the fly */
595 p_vout = (vout_thread_t *)vlc_object_find( p_intf, VLC_OBJECT_VOUT,
599 var_SetString( p_vout, "vout-filter", psz_string );
600 vlc_object_release( p_vout );
605 o_config_changed = YES;
609 - (void)changeVideoFiltersString:(char *)psz_name onOrOff:(bool )b_add
611 /* same as changeVoutFiltersString but addressing the "video-filter"
612 * variable which represents the video filter 2 modules */
614 vout_thread_t *p_vout;
615 intf_thread_t * p_intf = VLCIntf;
617 char *psz_parser, *psz_string;
618 psz_string = config_GetPsz( p_intf, "video-filter" );
620 if( !psz_string ) psz_string = strdup("");
622 psz_parser = strstr( psz_string, psz_name );
628 psz_parser = psz_string;
629 asprintf( &psz_string, (*psz_string) ? "%s:%s" : "%s%s",
630 psz_string, psz_name );
642 memmove( psz_parser, psz_parser + strlen(psz_name) +
643 (*(psz_parser + strlen(psz_name)) == ':' ? 1 : 0 ),
644 strlen(psz_parser + strlen(psz_name)) + 1 );
646 /* Remove trailing : : */
647 if( *(psz_string+strlen(psz_string ) -1 ) == ':' )
649 *(psz_string+strlen(psz_string ) -1 ) = '\0';
658 /* Vout is not kept, so put that in the config */
659 config_PutPsz( p_intf, "video-filter", psz_string );
661 /* Try to set on the fly */
662 p_vout = (vout_thread_t *)vlc_object_find( p_intf, VLC_OBJECT_VOUT,
666 var_SetString( p_vout, "video-filter", psz_string );
667 vlc_object_release( p_vout );
672 o_config_changed = YES;
675 - (void)changeAFiltersString: (char *)psz_name onOrOff: (bool )b_add;
677 /* copied from ../wxwidgets/extrapanel.cpp
678 * renamed to conform with Cocoa's rules */
680 char *psz_parser, *psz_string;
681 intf_thread_t * p_intf = VLCIntf;
682 aout_instance_t * p_aout= (aout_instance_t *)vlc_object_find(p_intf,
683 VLC_OBJECT_AOUT, FIND_ANYWHERE);
687 psz_string = var_GetNonEmptyString( p_aout, "audio-filter" );
691 psz_string = config_GetPsz( p_intf, "audio-filter" );
694 if( !psz_string ) psz_string = strdup("");
696 psz_parser = strstr( psz_string, psz_name );
702 psz_parser = psz_string;
703 asprintf( &psz_string, (*psz_string) ? "%s:%s" : "%s%s",
704 psz_string, psz_name );
716 memmove( psz_parser, psz_parser + strlen(psz_name) +
717 (*(psz_parser + strlen(psz_name)) == ':' ? 1 : 0 ),
718 strlen(psz_parser + strlen(psz_name)) + 1 );
720 if( *(psz_string+strlen(psz_string ) -1 ) == ':' )
722 *(psz_string+strlen(psz_string ) -1 ) = '\0';
734 config_PutPsz( p_intf, "audio-filter", psz_string );
738 var_SetString( p_aout, "audio-filter", psz_string );
740 while( i < p_aout->i_nb_inputs )
742 p_aout->pp_inputs[i]->b_restart = true;
745 vlc_object_release( p_aout );
749 o_config_changed = YES;
754 /* save the preferences to make sure that our module-changes will up on
755 * next launch again */
756 playlist_t * p_playlist = pl_Yield( VLCIntf );
758 NSArray * theModules;
759 theModules = [[NSArray alloc] initWithObjects: @"main",
769 @"headphone_channel_mixer",
774 while ( x != [theModules count] )
776 returnedValue = config_SaveConfigFile( p_playlist, [[theModules
777 objectAtIndex: x] UTF8String] );
779 if (returnedValue != 0)
781 msg_Err(p_playlist, "unable to save the preferences of the "
782 "extended control attribute '%s' (%i)",
783 [[theModules objectAtIndex: x] UTF8String] , returnedValue);
784 [theModules release];
785 vlc_object_release( p_playlist );
793 msg_Dbg( VLCIntf, "VLCExtended: saved certain preferences successfully" );
795 [theModules release];
796 vlc_object_release( p_playlist );