1 /*****************************************************************************
2 * controls.m: MacOS X interface module
3 *****************************************************************************
4 * Copyright (C) 2002-2005 the VideoLAN team
7 * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
8 * Christophe Massiot <massiot@via.ecp.fr>
9 * Derk-Jan Hartman <hartman at videolan dot org>
10 * Benjamin Pracht <bigben at videolan doit org>
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
25 *****************************************************************************/
27 /*****************************************************************************
29 *****************************************************************************/
30 #include <stdlib.h> /* malloc(), free() */
31 #include <sys/param.h> /* for MAXPATHLEN */
42 /*****************************************************************************
43 * VLCControls implementation
44 *****************************************************************************/
45 @implementation VLCControls
50 o_fs_panel = [[VLCFSPanel alloc] init];
56 [o_specificTime_mi setTitle: _NS("Jump To Time")];
57 [o_specificTime_cancel_btn setTitle: _NS("Cancel")];
58 [o_specificTime_ok_btn setTitle: _NS("OK")];
59 [o_specificTime_sec_lbl setStringValue: _NS("sec.")];
60 [o_specificTime_goTo_lbl setStringValue: _NS("Jump to time")];
63 - (IBAction)play:(id)sender
66 intf_thread_t * p_intf = VLCIntf;
67 playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
71 vlc_mutex_lock( &p_playlist->object_lock );
72 if( p_playlist->i_size <= 0 )
74 vlc_mutex_unlock( &p_playlist->object_lock );
75 vlc_object_release( p_playlist );
76 [o_main intfOpenFileGeneric: (id)sender];
80 vlc_mutex_unlock( &p_playlist->object_lock );
81 vlc_object_release( p_playlist );
85 val.i_int = config_GetInt( p_intf, "key-play-pause" );
86 var_Set( p_intf->p_vlc, "key-pressed", val );
89 /* Small helper method */
95 id o_embedded_vout_list = [[VLCMain sharedInstance] getEmbeddedList];
96 NSEnumerator *o_enumerator = [[NSApp orderedWindows] objectEnumerator];
97 while( !o_vout_view && ( o_window = [o_enumerator nextObject] ) )
99 /* We have an embedded vout */
100 if( [o_embedded_vout_list windowContainsEmbedded: o_window] )
102 o_vout_view = [o_embedded_vout_list getViewForWindow: o_window];
104 /* We have a detached vout */
105 else if( [[o_window className] isEqualToString: @"VLCWindow"] )
107 msg_Dbg( VLCIntf, "detached vout controls.m call getVoutView" );
108 o_vout_view = [o_window getVoutView];
115 - (IBAction)stop:(id)sender
118 intf_thread_t * p_intf = VLCIntf;
119 val.i_int = config_GetInt( p_intf, "key-stop" );
120 var_Set( p_intf->p_vlc, "key-pressed", val );
123 - (IBAction)faster:(id)sender
126 intf_thread_t * p_intf = VLCIntf;
127 val.i_int = config_GetInt( p_intf, "key-faster" );
128 var_Set( p_intf->p_vlc, "key-pressed", val );
131 - (IBAction)slower:(id)sender
134 intf_thread_t * p_intf = VLCIntf;
135 val.i_int = config_GetInt( p_intf, "key-slower" );
136 var_Set( p_intf->p_vlc, "key-pressed", val );
139 - (IBAction)prev:(id)sender
142 intf_thread_t * p_intf = VLCIntf;
143 val.i_int = config_GetInt( p_intf, "key-prev" );
144 var_Set( p_intf->p_vlc, "key-pressed", val );
147 - (IBAction)next:(id)sender
150 intf_thread_t * p_intf = VLCIntf;
151 val.i_int = config_GetInt( p_intf, "key-next" );
152 var_Set( p_intf->p_vlc, "key-pressed", val );
155 - (IBAction)random:(id)sender
158 intf_thread_t * p_intf = VLCIntf;
159 playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
161 if( p_playlist == NULL )
166 var_Get( p_playlist, "random", &val );
167 val.b_bool = !val.b_bool;
168 var_Set( p_playlist, "random", val );
171 vout_OSDMessage( p_intf, DEFAULT_CHAN, _( "Random On" ) );
172 config_PutInt( p_playlist, "random", 1 );
176 vout_OSDMessage( p_intf, DEFAULT_CHAN, _( "Random Off" ) );
177 config_PutInt( p_playlist, "random", 0 );
180 p_intf->p_sys->b_playmode_update = VLC_TRUE;
181 p_intf->p_sys->b_intf_update = VLC_TRUE;
182 vlc_object_release( p_playlist );
185 - (IBAction)repeat:(id)sender
188 intf_thread_t * p_intf = VLCIntf;
189 playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
191 if( p_playlist == NULL )
196 var_Get( p_playlist, "repeat", &val );
199 var_Set( p_playlist, "loop", val );
201 val.b_bool = !val.b_bool;
202 var_Set( p_playlist, "repeat", val );
205 vout_OSDMessage( p_intf, DEFAULT_CHAN, _( "Repeat One" ) );
206 config_PutInt( p_playlist, "repeat", 1 );
210 vout_OSDMessage( p_intf, DEFAULT_CHAN, _( "Repeat Off" ) );
211 config_PutInt( p_playlist, "repeat", 0 );
214 p_intf->p_sys->b_playmode_update = VLC_TRUE;
215 p_intf->p_sys->b_intf_update = VLC_TRUE;
216 vlc_object_release( p_playlist );
219 - (IBAction)loop:(id)sender
222 intf_thread_t * p_intf = VLCIntf;
223 playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
225 if( p_playlist == NULL )
230 var_Get( p_playlist, "loop", &val );
233 var_Set( p_playlist, "repeat", val );
235 val.b_bool = !val.b_bool;
236 var_Set( p_playlist, "loop", val );
239 vout_OSDMessage( p_intf, DEFAULT_CHAN, _( "Repeat All" ) );
240 config_PutInt( p_playlist, "loop", 1 );
244 vout_OSDMessage( p_intf, DEFAULT_CHAN, _( "Repeat Off" ) );
245 config_PutInt( p_playlist, "loop", 0 );
248 p_intf->p_sys->b_playmode_update = VLC_TRUE;
249 p_intf->p_sys->b_intf_update = VLC_TRUE;
250 vlc_object_release( p_playlist );
253 - (IBAction)forward:(id)sender
256 intf_thread_t * p_intf = VLCIntf;
257 val.i_int = config_GetInt( p_intf, "key-jump+short" );
258 var_Set( p_intf->p_vlc, "key-pressed", val );
261 - (IBAction)backward:(id)sender
264 intf_thread_t * p_intf = VLCIntf;
265 val.i_int = config_GetInt( p_intf, "key-jump-short" );
266 var_Set( p_intf->p_vlc, "key-pressed", val );
270 - (IBAction)volumeUp:(id)sender
273 intf_thread_t * p_intf = VLCIntf;
274 val.i_int = config_GetInt( p_intf, "key-vol-up" );
275 var_Set( p_intf->p_vlc, "key-pressed", val );
276 /* Manage volume status */
277 [o_main manageVolumeSlider];
280 - (IBAction)volumeDown:(id)sender
283 intf_thread_t * p_intf = VLCIntf;
284 val.i_int = config_GetInt( p_intf, "key-vol-down" );
285 var_Set( p_intf->p_vlc, "key-pressed", val );
286 /* Manage volume status */
287 [o_main manageVolumeSlider];
290 - (IBAction)mute:(id)sender
293 intf_thread_t * p_intf = VLCIntf;
294 val.i_int = config_GetInt( p_intf, "key-vol-mute" );
295 var_Set( p_intf->p_vlc, "key-pressed", val );
296 /* Manage volume status */
297 [o_main manageVolumeSlider];
300 - (IBAction)volumeSliderUpdated:(id)sender
302 intf_thread_t * p_intf = VLCIntf;
303 audio_volume_t i_volume = (audio_volume_t)[sender intValue];
304 int i_volume_step = 0;
305 i_volume_step = config_GetInt( p_intf->p_vlc, "volume-step" );
306 aout_VolumeSet( p_intf, i_volume * i_volume_step );
307 /* Manage volume status */
308 [o_main manageVolumeSlider];
311 - (IBAction)windowAction:(id)sender
313 NSString *o_title = [sender title];
315 vout_thread_t *p_vout = vlc_object_find( VLCIntf, VLC_OBJECT_VOUT,
319 id o_vout_view = [self getVoutView];
322 if( [o_title isEqualToString: _NS("Half Size") ] )
323 [o_vout_view scaleWindowWithFactor: 0.5];
324 else if( [o_title isEqualToString: _NS("Normal Size") ] )
325 [o_vout_view scaleWindowWithFactor: 1.0];
326 else if( [o_title isEqualToString: _NS("Double Size") ] )
327 [o_vout_view scaleWindowWithFactor: 2.0];
328 else if( [o_title isEqualToString: _NS("Float on Top") ] )
329 [o_vout_view toggleFloatOnTop];
330 else if( [o_title isEqualToString: _NS("Fit to Screen") ] )
332 id o_window = [o_vout_view getWindow];
333 if( ![o_window isZoomed] )
334 [o_window performZoom:self];
336 else if( [o_title isEqualToString: _NS("Snapshot") ] )
338 [o_vout_view snapshot];
342 [o_vout_view toggleFullscreen];
345 vlc_object_release( (vlc_object_t *)p_vout );
349 playlist_t * p_playlist = vlc_object_find( VLCIntf, VLC_OBJECT_PLAYLIST,
352 if( p_playlist && ( [o_title isEqualToString: _NS("Fullscreen")] ||
353 [sender isKindOfClass:[NSButton class]] ) )
356 var_Get( p_playlist, "fullscreen", &val );
357 var_Set( p_playlist, "fullscreen", (vlc_value_t)!val.b_bool );
359 if( p_playlist ) vlc_object_release( (vlc_object_t *)p_playlist );
364 - (BOOL)keyEvent:(NSEvent *)o_event
366 BOOL eventHandled = NO;
367 unichar key = [[o_event charactersIgnoringModifiers] characterAtIndex: 0];
371 vout_thread_t *p_vout = vlc_object_find( VLCIntf, VLC_OBJECT_VOUT,
376 if( key == (unichar) 0x1b )
378 id o_vout_view = [self getVoutView];
379 if( o_vout_view && [o_vout_view isFullscreen] )
381 [o_vout_view toggleFullscreen];
385 else if( key == ' ' )
390 vlc_object_release( (vlc_object_t *)p_vout );
396 - (void)setupVarMenuItem:(NSMenuItem *)o_mi
397 target:(vlc_object_t *)p_object
398 var:(const char *)psz_variable
399 selector:(SEL)pf_callback
401 vlc_value_t val, text;
402 int i_type = var_Type( p_object, psz_variable );
404 switch( i_type & VLC_VAR_TYPE )
408 case VLC_VAR_VARIABLE:
410 case VLC_VAR_INTEGER:
413 /* Variable doesn't exist or isn't handled */
417 /* Make sure we want to display the variable */
418 if( i_type & VLC_VAR_HASCHOICE )
420 var_Change( p_object, psz_variable, VLC_VAR_CHOICESCOUNT, &val, NULL );
421 if( val.i_int == 0 ) return;
422 if( (i_type & VLC_VAR_TYPE) != VLC_VAR_VARIABLE && val.i_int == 1 )
426 /* Get the descriptive name of the variable */
427 var_Change( p_object, psz_variable, VLC_VAR_GETTEXT, &text, NULL );
428 [o_mi setTitle: [[VLCMain sharedInstance] localizedString: text.psz_string ?
429 text.psz_string : strdup( psz_variable ) ]];
431 var_Get( p_object, psz_variable, &val );
432 if( i_type & VLC_VAR_HASCHOICE )
434 NSMenu *o_menu = [o_mi submenu];
436 [self setupVarMenu: o_menu forMenuItem: o_mi target:p_object
437 var:psz_variable selector:pf_callback];
439 if( text.psz_string ) free( text.psz_string );
444 switch( i_type & VLC_VAR_TYPE )
447 o_data = [[VLCMenuExt alloc] initWithVar: psz_variable Object: p_object->i_object_id
448 Value: val ofType: i_type];
449 [o_mi setRepresentedObject: [NSValue valueWithPointer:[o_data retain]]];
453 o_data = [[VLCMenuExt alloc] initWithVar: psz_variable Object: p_object->i_object_id
454 Value: val ofType: i_type];
455 [o_mi setRepresentedObject: [NSValue valueWithPointer:[o_data retain]]];
456 if( !( i_type & VLC_VAR_ISCOMMAND ) )
457 [o_mi setState: val.b_bool ? TRUE : FALSE ];
461 if( text.psz_string ) free( text.psz_string );
465 if( ( i_type & VLC_VAR_TYPE ) == VLC_VAR_STRING ) free( val.psz_string );
466 if( text.psz_string ) free( text.psz_string );
470 - (void)setupVarMenu:(NSMenu *)o_menu
471 forMenuItem: (NSMenuItem *)o_parent
472 target:(vlc_object_t *)p_object
473 var:(const char *)psz_variable
474 selector:(SEL)pf_callback
476 vlc_value_t val, val_list, text_list;
477 int i_type, i, i_nb_items;
479 /* remove previous items */
480 i_nb_items = [o_menu numberOfItems];
481 for( i = 0; i < i_nb_items; i++ )
483 [o_menu removeItemAtIndex: 0];
486 /* Check the type of the object variable */
487 i_type = var_Type( p_object, psz_variable );
489 /* Make sure we want to display the variable */
490 if( i_type & VLC_VAR_HASCHOICE )
492 var_Change( p_object, psz_variable, VLC_VAR_CHOICESCOUNT, &val, NULL );
493 if( val.i_int == 0 ) return;
494 if( (i_type & VLC_VAR_TYPE) != VLC_VAR_VARIABLE && val.i_int == 1 )
502 switch( i_type & VLC_VAR_TYPE )
506 case VLC_VAR_VARIABLE:
508 case VLC_VAR_INTEGER:
511 /* Variable doesn't exist or isn't handled */
515 if( var_Get( p_object, psz_variable, &val ) < 0 )
520 if( var_Change( p_object, psz_variable, VLC_VAR_GETLIST,
521 &val_list, &text_list ) < 0 )
523 if( (i_type & VLC_VAR_TYPE) == VLC_VAR_STRING ) free( val.psz_string );
527 /* make (un)sensitive */
528 [o_parent setEnabled: ( val_list.p_list->i_count > 1 )];
530 for( i = 0; i < val_list.p_list->i_count; i++ )
532 vlc_value_t another_val;
534 NSString *o_title = @"";
537 switch( i_type & VLC_VAR_TYPE )
540 another_val.psz_string =
541 strdup(val_list.p_list->p_values[i].psz_string);
543 o_title = [[VLCMain sharedInstance] localizedString: text_list.p_list->p_values[i].psz_string ?
544 text_list.p_list->p_values[i].psz_string : val_list.p_list->p_values[i].psz_string ];
546 o_lmi = [o_menu addItemWithTitle: o_title action: pf_callback keyEquivalent: @""];
547 o_data = [[VLCMenuExt alloc] initWithVar: strdup(psz_variable) Object: p_object->i_object_id
548 Value: another_val ofType: i_type];
549 [o_lmi setRepresentedObject: [NSValue valueWithPointer:[o_data retain]]];
550 [o_lmi setTarget: self];
552 if( !strcmp( val.psz_string, val_list.p_list->p_values[i].psz_string ) && !( i_type & VLC_VAR_ISCOMMAND ) )
553 [o_lmi setState: TRUE ];
557 case VLC_VAR_INTEGER:
559 o_title = text_list.p_list->p_values[i].psz_string ?
560 [[VLCMain sharedInstance] localizedString: strdup( text_list.p_list->p_values[i].psz_string )] :
561 [NSString stringWithFormat: @"%d",
562 val_list.p_list->p_values[i].i_int];
564 o_lmi = [[o_menu addItemWithTitle: o_title action: pf_callback keyEquivalent: @""] retain ];
565 o_data = [[VLCMenuExt alloc] initWithVar: strdup(psz_variable) Object: p_object->i_object_id
566 Value: val_list.p_list->p_values[i] ofType: i_type];
567 [o_lmi setRepresentedObject: [NSValue valueWithPointer:[ o_data retain]]];
568 [o_lmi setTarget: self];
570 if( val_list.p_list->p_values[i].i_int == val.i_int && !( i_type & VLC_VAR_ISCOMMAND ) )
571 [o_lmi setState: TRUE ];
579 /* clean up everything */
580 if( (i_type & VLC_VAR_TYPE) == VLC_VAR_STRING ) free( val.psz_string );
581 var_Change( p_object, psz_variable, VLC_VAR_FREELIST, &val_list, &text_list );
584 - (IBAction)toggleVar:(id)sender
586 NSMenuItem *o_mi = (NSMenuItem *)sender;
587 VLCMenuExt *o_data = [[o_mi representedObject] pointerValue];
588 [NSThread detachNewThreadSelector: @selector(toggleVarThread:)
589 toTarget: self withObject: o_data];
594 - (int)toggleVarThread: (id)_o_data
596 vlc_object_t *p_object;
597 NSAutoreleasePool * o_pool = [[NSAutoreleasePool alloc] init];
598 VLCMenuExt *o_data = (VLCMenuExt *)_o_data;
600 vlc_thread_set_priority( VLCIntf , VLC_THREAD_PRIORITY_LOW );
602 p_object = (vlc_object_t *)vlc_object_get( VLCIntf,
605 if( p_object != NULL )
607 var_Set( p_object, strdup([o_data name]), [o_data value] );
608 vlc_object_release( p_object );
616 - (IBAction)goToSpecificTime:(id)sender
618 if( sender == o_specificTime_cancel_btn )
620 [NSApp endSheet: o_specificTime_win];
621 [o_specificTime_win close];
623 else if( sender == o_specificTime_ok_btn )
625 input_thread_t * p_input = (input_thread_t *)vlc_object_find( VLCIntf, \
626 VLC_OBJECT_INPUT, FIND_ANYWHERE );
629 unsigned int timeInSec = 0;
630 NSString * fieldContent = [o_specificTime_enter_fld stringValue];
631 if( [[fieldContent componentsSeparatedByString: @":"] count] > 1 &&
632 [[fieldContent componentsSeparatedByString: @":"] count] <= 3 )
634 NSArray * ourTempArray = \
635 [fieldContent componentsSeparatedByString: @":"];
637 if( [[fieldContent componentsSeparatedByString: @":"] count] == 3 )
639 timeInSec += ([[ourTempArray objectAtIndex: 0] intValue] * 3600); //h
640 timeInSec += ([[ourTempArray objectAtIndex: 1] intValue] * 60); //m
641 timeInSec += [[ourTempArray objectAtIndex: 2] intValue]; //s
645 timeInSec += ([[ourTempArray objectAtIndex: 0] intValue] * 60); //m
646 timeInSec += [[ourTempArray objectAtIndex: 1] intValue]; //s
650 timeInSec = [fieldContent intValue];
652 input_Control( p_input, INPUT_SET_TIME, (int64_t)(timeInSec * 1000000));
653 vlc_object_release( p_input );
656 [NSApp endSheet: o_specificTime_win];
657 [o_specificTime_win close];
661 input_thread_t * p_input = (input_thread_t *)vlc_object_find( VLCIntf, \
662 VLC_OBJECT_INPUT, FIND_ANYWHERE );
665 /* we can obviously only do that if an input is available */
666 vlc_value_t pos, length;
667 var_Get( p_input, "time", &pos );
668 [o_specificTime_enter_fld setIntValue: (pos.i_time / 1000000)];
669 var_Get( p_input, "length", &length );
670 [o_specificTime_stepper setMaxValue: (length.i_time / 1000000)];
672 [NSApp beginSheet: o_specificTime_win modalForWindow: \
673 [NSApp mainWindow] modalDelegate: self didEndSelector: nil \
675 [o_specificTime_win makeKeyWindow];
676 vlc_object_release( p_input );
687 msg_Err( VLCIntf, "FSPanel is nil" );
694 @implementation VLCControls (NSMenuValidation)
696 - (BOOL)validateMenuItem:(NSMenuItem *)o_mi
698 BOOL bEnabled = TRUE;
700 intf_thread_t * p_intf = VLCIntf;
701 playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
704 if( p_playlist != NULL )
706 vlc_mutex_lock( &p_playlist->object_lock );
710 #define p_input p_playlist->p_input
712 if( [[o_mi title] isEqualToString: _NS("Faster")] ||
713 [[o_mi title] isEqualToString: _NS("Slower")] )
715 if( p_input != NULL )
717 bEnabled = p_input->input.b_can_pace_control;
724 else if( [[o_mi title] isEqualToString: _NS("Stop")] )
726 if( p_input == NULL )
730 [o_main setupMenus]; /* Make sure input menu is up to date */
732 else if( [[o_mi title] isEqualToString: _NS("Previous")] ||
733 [[o_mi title] isEqualToString: _NS("Next")] )
735 bEnabled = p_playlist->i_size > 1;
737 else if( [[o_mi title] isEqualToString: _NS("Random")] )
740 var_Get( p_playlist, "random", &val );
741 i_state = val.b_bool ? NSOnState : NSOffState;
742 [o_mi setState: i_state];
744 else if( [[o_mi title] isEqualToString: _NS("Repeat One")] )
747 var_Get( p_playlist, "repeat", &val );
748 i_state = val.b_bool ? NSOnState : NSOffState;
749 [o_mi setState: i_state];
751 else if( [[o_mi title] isEqualToString: _NS("Repeat All")] )
754 var_Get( p_playlist, "loop", &val );
755 i_state = val.b_bool ? NSOnState : NSOffState;
756 [o_mi setState: i_state];
758 else if( [[o_mi title] isEqualToString: _NS("Step Forward")] ||
759 [[o_mi title] isEqualToString: _NS("Step Backward")] ||
760 [[o_mi title] isEqualToString: _NS("Jump To Time")])
762 if( p_input != NULL )
764 var_Get( p_input, "seekable", &val);
765 bEnabled = val.b_bool;
767 else bEnabled = FALSE;
769 else if( [[o_mi title] isEqualToString: _NS("Mute")] )
771 [o_mi setState: p_intf->p_sys->b_mute ? NSOnState : NSOffState];
772 [o_main setupMenus]; /* Make sure audio menu is up to date */
774 else if( [[o_mi title] isEqualToString: _NS("Half Size")] ||
775 [[o_mi title] isEqualToString: _NS("Normal Size")] ||
776 [[o_mi title] isEqualToString: _NS("Double Size")] ||
777 [[o_mi title] isEqualToString: _NS("Fit to Screen")] ||
778 [[o_mi title] isEqualToString: _NS("Snapshot")] ||
779 [[o_mi title] isEqualToString: _NS("Fullscreen")] ||
780 [[o_mi title] isEqualToString: _NS("Float on Top")] )
783 NSArray *o_windows = [NSApp orderedWindows];
784 NSEnumerator *o_enumerator = [o_windows objectEnumerator];
787 vout_thread_t *p_vout = vlc_object_find( p_intf, VLC_OBJECT_VOUT,
791 if( [[o_mi title] isEqualToString: _NS("Float on Top")] )
793 var_Get( p_vout, "video-on-top", &val );
794 [o_mi setState: val.b_bool ? NSOnState : NSOffState];
797 while( (o_window = [o_enumerator nextObject]))
799 if( [[o_window className] isEqualToString: @"VLCWindow"] ||
800 [[[VLCMain sharedInstance] getEmbeddedList]
801 windowContainsEmbedded: o_window])
807 vlc_object_release( (vlc_object_t *)p_vout );
809 else if( [[o_mi title] isEqualToString: _NS("Fullscreen")] )
811 var_Get( p_playlist, "fullscreen", &val );
812 [o_mi setState: val.b_bool];
815 [o_main setupMenus]; /* Make sure video menu is up to date */
818 vlc_mutex_unlock( &p_playlist->object_lock );
819 vlc_object_release( p_playlist );
826 /*****************************************************************************
827 * VLCMenuExt implementation
828 *****************************************************************************
829 * Object connected to a playlistitem which remembers the data belonging to
830 * the variable of the autogenerated menu
831 *****************************************************************************/
832 @implementation VLCMenuExt
834 - (id)initWithVar: (const char *)_psz_name Object: (int)i_id
835 Value: (vlc_value_t)val ofType: (int)_i_type
841 psz_name = strdup( _psz_name );
879 /*****************************************************************************
880 * VLCTimeField implementation
881 *****************************************************************************
882 * we need this to catch our click-event in the controller window
883 *****************************************************************************/
885 @implementation VLCTimeField
886 - (void)mouseDown: (NSEvent *)ourEvent
888 if( [ourEvent clickCount] > 1 )
889 [[[VLCMain sharedInstance] getControls] goToSpecificTime: nil];