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 */
41 /*****************************************************************************
42 * VLCControls implementation
43 *****************************************************************************/
44 @implementation VLCControls
48 [o_specificTime_mi setTitle: _NS("Jump To Time")];
49 [o_specificTime_cancel_btn setTitle: _NS("Cancel")];
50 [o_specificTime_ok_btn setTitle: _NS("OK")];
51 [o_specificTime_sec_lbl setStringValue: _NS("sec.")];
52 [o_specificTime_goTo_lbl setStringValue: _NS("Jump to time")];
55 - (IBAction)play:(id)sender
58 intf_thread_t * p_intf = VLCIntf;
59 playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
63 vlc_mutex_lock( &p_playlist->object_lock );
64 if( p_playlist->i_size <= 0 )
66 vlc_mutex_unlock( &p_playlist->object_lock );
67 vlc_object_release( p_playlist );
68 [o_main intfOpenFileGeneric: (id)sender];
72 vlc_mutex_unlock( &p_playlist->object_lock );
73 vlc_object_release( p_playlist );
77 val.i_int = config_GetInt( p_intf, "key-play-pause" );
78 var_Set( p_intf->p_vlc, "key-pressed", val );
81 /* Small helper method */
87 id o_embedded_vout_list = [[VLCMain sharedInstance] getEmbeddedList];
88 NSEnumerator *o_enumerator = [[NSApp orderedWindows] objectEnumerator];
89 while( !o_vout_view && ( o_window = [o_enumerator nextObject] ) )
91 /* We have an embedded vout */
92 if( [o_embedded_vout_list windowContainsEmbedded: o_window] )
94 o_vout_view = [o_embedded_vout_list getViewForWindow: o_window];
96 /* We have a detached vout */
97 else if( [[o_window className] isEqualToString: @"VLCWindow"] )
99 msg_Dbg( VLCIntf, "detached vout controls.m call getVoutView" );
100 o_vout_view = [o_window getVoutView];
107 - (IBAction)stop:(id)sender
110 intf_thread_t * p_intf = VLCIntf;
111 val.i_int = config_GetInt( p_intf, "key-stop" );
112 var_Set( p_intf->p_vlc, "key-pressed", val );
115 - (IBAction)faster:(id)sender
118 intf_thread_t * p_intf = VLCIntf;
119 val.i_int = config_GetInt( p_intf, "key-faster" );
120 var_Set( p_intf->p_vlc, "key-pressed", val );
123 - (IBAction)slower:(id)sender
126 intf_thread_t * p_intf = VLCIntf;
127 val.i_int = config_GetInt( p_intf, "key-slower" );
128 var_Set( p_intf->p_vlc, "key-pressed", val );
131 - (IBAction)prev:(id)sender
134 intf_thread_t * p_intf = VLCIntf;
135 val.i_int = config_GetInt( p_intf, "key-prev" );
136 var_Set( p_intf->p_vlc, "key-pressed", val );
139 - (IBAction)next:(id)sender
142 intf_thread_t * p_intf = VLCIntf;
143 val.i_int = config_GetInt( p_intf, "key-next" );
144 var_Set( p_intf->p_vlc, "key-pressed", val );
147 - (IBAction)random:(id)sender
150 intf_thread_t * p_intf = VLCIntf;
151 playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
153 if( p_playlist == NULL )
158 var_Get( p_playlist, "random", &val );
159 val.b_bool = !val.b_bool;
160 var_Set( p_playlist, "random", val );
163 vout_OSDMessage( p_intf, DEFAULT_CHAN, _( "Random On" ) );
164 config_PutInt( p_playlist, "random", 1 );
168 vout_OSDMessage( p_intf, DEFAULT_CHAN, _( "Random Off" ) );
169 config_PutInt( p_playlist, "random", 0 );
172 p_intf->p_sys->b_playmode_update = VLC_TRUE;
173 p_intf->p_sys->b_intf_update = VLC_TRUE;
174 vlc_object_release( p_playlist );
177 - (IBAction)repeat:(id)sender
180 intf_thread_t * p_intf = VLCIntf;
181 playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
183 if( p_playlist == NULL )
188 var_Get( p_playlist, "repeat", &val );
191 var_Set( p_playlist, "loop", val );
193 val.b_bool = !val.b_bool;
194 var_Set( p_playlist, "repeat", val );
197 vout_OSDMessage( p_intf, DEFAULT_CHAN, _( "Repeat One" ) );
198 config_PutInt( p_playlist, "repeat", 1 );
202 vout_OSDMessage( p_intf, DEFAULT_CHAN, _( "Repeat Off" ) );
203 config_PutInt( p_playlist, "repeat", 0 );
206 p_intf->p_sys->b_playmode_update = VLC_TRUE;
207 p_intf->p_sys->b_intf_update = VLC_TRUE;
208 vlc_object_release( p_playlist );
211 - (IBAction)loop:(id)sender
214 intf_thread_t * p_intf = VLCIntf;
215 playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
217 if( p_playlist == NULL )
222 var_Get( p_playlist, "loop", &val );
225 var_Set( p_playlist, "repeat", val );
227 val.b_bool = !val.b_bool;
228 var_Set( p_playlist, "loop", val );
231 vout_OSDMessage( p_intf, DEFAULT_CHAN, _( "Repeat All" ) );
232 config_PutInt( p_playlist, "loop", 1 );
236 vout_OSDMessage( p_intf, DEFAULT_CHAN, _( "Repeat Off" ) );
237 config_PutInt( p_playlist, "loop", 0 );
240 p_intf->p_sys->b_playmode_update = VLC_TRUE;
241 p_intf->p_sys->b_intf_update = VLC_TRUE;
242 vlc_object_release( p_playlist );
245 - (IBAction)forward:(id)sender
248 intf_thread_t * p_intf = VLCIntf;
249 val.i_int = config_GetInt( p_intf, "key-jump+short" );
250 var_Set( p_intf->p_vlc, "key-pressed", val );
253 - (IBAction)backward:(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 );
262 - (IBAction)volumeUp:(id)sender
265 intf_thread_t * p_intf = VLCIntf;
266 val.i_int = config_GetInt( p_intf, "key-vol-up" );
267 var_Set( p_intf->p_vlc, "key-pressed", val );
268 /* Manage volume status */
269 [o_main manageVolumeSlider];
272 - (IBAction)volumeDown:(id)sender
275 intf_thread_t * p_intf = VLCIntf;
276 val.i_int = config_GetInt( p_intf, "key-vol-down" );
277 var_Set( p_intf->p_vlc, "key-pressed", val );
278 /* Manage volume status */
279 [o_main manageVolumeSlider];
282 - (IBAction)mute:(id)sender
285 intf_thread_t * p_intf = VLCIntf;
286 val.i_int = config_GetInt( p_intf, "key-vol-mute" );
287 var_Set( p_intf->p_vlc, "key-pressed", val );
288 /* Manage volume status */
289 [o_main manageVolumeSlider];
292 - (IBAction)volumeSliderUpdated:(id)sender
294 intf_thread_t * p_intf = VLCIntf;
295 audio_volume_t i_volume = (audio_volume_t)[sender intValue];
296 int i_volume_step = 0;
297 i_volume_step = config_GetInt( p_intf->p_vlc, "volume-step" );
298 aout_VolumeSet( p_intf, i_volume * i_volume_step );
299 /* Manage volume status */
300 [o_main manageVolumeSlider];
303 - (IBAction)windowAction:(id)sender
305 NSString *o_title = [sender title];
307 vout_thread_t *p_vout = vlc_object_find( VLCIntf, VLC_OBJECT_VOUT,
311 id o_vout_view = [self getVoutView];
314 if( [o_title isEqualToString: _NS("Half Size") ] )
315 [o_vout_view scaleWindowWithFactor: 0.5];
316 else if( [o_title isEqualToString: _NS("Normal Size") ] )
317 [o_vout_view scaleWindowWithFactor: 1.0];
318 else if( [o_title isEqualToString: _NS("Double Size") ] )
319 [o_vout_view scaleWindowWithFactor: 2.0];
320 else if( [o_title isEqualToString: _NS("Float on Top") ] )
321 [o_vout_view toggleFloatOnTop];
322 else if( [o_title isEqualToString: _NS("Fit to Screen") ] )
324 id o_window = [o_vout_view getWindow];
325 if( ![o_window isZoomed] )
326 [o_window performZoom:self];
328 else if( [o_title isEqualToString: _NS("Snapshot") ] )
330 [o_vout_view snapshot];
334 [o_vout_view toggleFullscreen];
337 vlc_object_release( (vlc_object_t *)p_vout );
341 playlist_t * p_playlist = vlc_object_find( VLCIntf, VLC_OBJECT_PLAYLIST,
344 if( p_playlist && ( [o_title isEqualToString: _NS("Fullscreen")] ||
345 [sender isKindOfClass:[NSButton class]] ) )
348 var_Get( p_playlist, "fullscreen", &val );
349 var_Set( p_playlist, "fullscreen", (vlc_value_t)!val.b_bool );
351 if( p_playlist ) vlc_object_release( (vlc_object_t *)p_playlist );
356 - (BOOL)keyEvent:(NSEvent *)o_event
358 BOOL eventHandled = NO;
359 unichar key = [[o_event charactersIgnoringModifiers] characterAtIndex: 0];
363 vout_thread_t *p_vout = vlc_object_find( VLCIntf, VLC_OBJECT_VOUT,
368 if( key == (unichar) 0x1b )
370 id o_vout_view = [self getVoutView];
371 if( o_vout_view && [o_vout_view isFullscreen] )
373 [o_vout_view toggleFullscreen];
377 else if( key == ' ' )
382 vlc_object_release( (vlc_object_t *)p_vout );
388 - (void)setupVarMenuItem:(NSMenuItem *)o_mi
389 target:(vlc_object_t *)p_object
390 var:(const char *)psz_variable
391 selector:(SEL)pf_callback
393 vlc_value_t val, text;
394 int i_type = var_Type( p_object, psz_variable );
396 switch( i_type & VLC_VAR_TYPE )
400 case VLC_VAR_VARIABLE:
402 case VLC_VAR_INTEGER:
405 /* Variable doesn't exist or isn't handled */
409 /* Make sure we want to display the variable */
410 if( i_type & VLC_VAR_HASCHOICE )
412 var_Change( p_object, psz_variable, VLC_VAR_CHOICESCOUNT, &val, NULL );
413 if( val.i_int == 0 ) return;
414 if( (i_type & VLC_VAR_TYPE) != VLC_VAR_VARIABLE && val.i_int == 1 )
418 /* Get the descriptive name of the variable */
419 var_Change( p_object, psz_variable, VLC_VAR_GETTEXT, &text, NULL );
420 [o_mi setTitle: [[VLCMain sharedInstance] localizedString: text.psz_string ?
421 text.psz_string : strdup( psz_variable ) ]];
423 var_Get( p_object, psz_variable, &val );
424 if( i_type & VLC_VAR_HASCHOICE )
426 NSMenu *o_menu = [o_mi submenu];
428 [self setupVarMenu: o_menu forMenuItem: o_mi target:p_object
429 var:psz_variable selector:pf_callback];
431 if( text.psz_string ) free( text.psz_string );
436 switch( i_type & VLC_VAR_TYPE )
439 o_data = [[VLCMenuExt alloc] initWithVar: psz_variable Object: p_object->i_object_id
440 Value: val ofType: i_type];
441 [o_mi setRepresentedObject: [NSValue valueWithPointer:[o_data retain]]];
445 o_data = [[VLCMenuExt alloc] initWithVar: psz_variable Object: p_object->i_object_id
446 Value: val ofType: i_type];
447 [o_mi setRepresentedObject: [NSValue valueWithPointer:[o_data retain]]];
448 if( !( i_type & VLC_VAR_ISCOMMAND ) )
449 [o_mi setState: val.b_bool ? TRUE : FALSE ];
453 if( text.psz_string ) free( text.psz_string );
457 if( ( i_type & VLC_VAR_TYPE ) == VLC_VAR_STRING ) free( val.psz_string );
458 if( text.psz_string ) free( text.psz_string );
462 - (void)setupVarMenu:(NSMenu *)o_menu
463 forMenuItem: (NSMenuItem *)o_parent
464 target:(vlc_object_t *)p_object
465 var:(const char *)psz_variable
466 selector:(SEL)pf_callback
468 vlc_value_t val, val_list, text_list;
469 int i_type, i, i_nb_items;
471 /* remove previous items */
472 i_nb_items = [o_menu numberOfItems];
473 for( i = 0; i < i_nb_items; i++ )
475 [o_menu removeItemAtIndex: 0];
478 /* Check the type of the object variable */
479 i_type = var_Type( p_object, psz_variable );
481 /* Make sure we want to display the variable */
482 if( i_type & VLC_VAR_HASCHOICE )
484 var_Change( p_object, psz_variable, VLC_VAR_CHOICESCOUNT, &val, NULL );
485 if( val.i_int == 0 ) return;
486 if( (i_type & VLC_VAR_TYPE) != VLC_VAR_VARIABLE && val.i_int == 1 )
494 switch( i_type & VLC_VAR_TYPE )
498 case VLC_VAR_VARIABLE:
500 case VLC_VAR_INTEGER:
503 /* Variable doesn't exist or isn't handled */
507 if( var_Get( p_object, psz_variable, &val ) < 0 )
512 if( var_Change( p_object, psz_variable, VLC_VAR_GETLIST,
513 &val_list, &text_list ) < 0 )
515 if( (i_type & VLC_VAR_TYPE) == VLC_VAR_STRING ) free( val.psz_string );
519 /* make (un)sensitive */
520 [o_parent setEnabled: ( val_list.p_list->i_count > 1 )];
522 for( i = 0; i < val_list.p_list->i_count; i++ )
524 vlc_value_t another_val;
526 NSString *o_title = @"";
529 switch( i_type & VLC_VAR_TYPE )
532 another_val.psz_string =
533 strdup(val_list.p_list->p_values[i].psz_string);
535 o_title = [[VLCMain sharedInstance] localizedString: text_list.p_list->p_values[i].psz_string ?
536 text_list.p_list->p_values[i].psz_string : val_list.p_list->p_values[i].psz_string ];
538 o_lmi = [o_menu addItemWithTitle: o_title action: pf_callback keyEquivalent: @""];
539 o_data = [[VLCMenuExt alloc] initWithVar: strdup(psz_variable) Object: p_object->i_object_id
540 Value: another_val ofType: i_type];
541 [o_lmi setRepresentedObject: [NSValue valueWithPointer:[o_data retain]]];
542 [o_lmi setTarget: self];
544 if( !strcmp( val.psz_string, val_list.p_list->p_values[i].psz_string ) && !( i_type & VLC_VAR_ISCOMMAND ) )
545 [o_lmi setState: TRUE ];
549 case VLC_VAR_INTEGER:
551 o_title = text_list.p_list->p_values[i].psz_string ?
552 [[VLCMain sharedInstance] localizedString: strdup( text_list.p_list->p_values[i].psz_string )] :
553 [NSString stringWithFormat: @"%d",
554 val_list.p_list->p_values[i].i_int];
556 o_lmi = [[o_menu addItemWithTitle: o_title action: pf_callback keyEquivalent: @""] retain ];
557 o_data = [[VLCMenuExt alloc] initWithVar: strdup(psz_variable) Object: p_object->i_object_id
558 Value: val_list.p_list->p_values[i] ofType: i_type];
559 [o_lmi setRepresentedObject: [NSValue valueWithPointer:[ o_data retain]]];
560 [o_lmi setTarget: self];
562 if( val_list.p_list->p_values[i].i_int == val.i_int && !( i_type & VLC_VAR_ISCOMMAND ) )
563 [o_lmi setState: TRUE ];
571 /* clean up everything */
572 if( (i_type & VLC_VAR_TYPE) == VLC_VAR_STRING ) free( val.psz_string );
573 var_Change( p_object, psz_variable, VLC_VAR_FREELIST, &val_list, &text_list );
576 - (IBAction)toggleVar:(id)sender
578 NSMenuItem *o_mi = (NSMenuItem *)sender;
579 VLCMenuExt *o_data = [[o_mi representedObject] pointerValue];
580 [NSThread detachNewThreadSelector: @selector(toggleVarThread:)
581 toTarget: self withObject: o_data];
586 - (int)toggleVarThread: (id)_o_data
588 vlc_object_t *p_object;
589 NSAutoreleasePool * o_pool = [[NSAutoreleasePool alloc] init];
590 VLCMenuExt *o_data = (VLCMenuExt *)_o_data;
592 vlc_thread_set_priority( VLCIntf , VLC_THREAD_PRIORITY_LOW );
594 p_object = (vlc_object_t *)vlc_object_get( VLCIntf,
597 if( p_object != NULL )
599 var_Set( p_object, strdup([o_data name]), [o_data value] );
600 vlc_object_release( p_object );
608 - (IBAction)goToSpecificTime:(id)sender
610 if( sender == o_specificTime_cancel_btn )
612 [NSApp endSheet: o_specificTime_win];
613 [o_specificTime_win close];
615 else if( sender == o_specificTime_ok_btn )
617 input_thread_t * p_input = (input_thread_t *)vlc_object_find( VLCIntf, \
618 VLC_OBJECT_INPUT, FIND_ANYWHERE );
621 unsigned int timeInSec = 0;
622 NSString * fieldContent = [o_specificTime_enter_fld stringValue];
623 if( [[fieldContent componentsSeparatedByString: @":"] count] > 1 &&
624 [[fieldContent componentsSeparatedByString: @":"] count] <= 3 )
626 NSArray * ourTempArray = \
627 [fieldContent componentsSeparatedByString: @":"];
629 if( [[fieldContent componentsSeparatedByString: @":"] count] == 3 )
631 timeInSec += ([[ourTempArray objectAtIndex: 0] intValue] * 3600); //h
632 timeInSec += ([[ourTempArray objectAtIndex: 1] intValue] * 60); //m
633 timeInSec += [[ourTempArray objectAtIndex: 2] intValue]; //s
637 timeInSec += ([[ourTempArray objectAtIndex: 0] intValue] * 60); //m
638 timeInSec += [[ourTempArray objectAtIndex: 1] intValue]; //s
642 timeInSec = [fieldContent intValue];
644 input_Control( p_input, INPUT_SET_TIME, (int64_t)(timeInSec * 1000000));
645 vlc_object_release( p_input );
648 [NSApp endSheet: o_specificTime_win];
649 [o_specificTime_win close];
653 input_thread_t * p_input = (input_thread_t *)vlc_object_find( VLCIntf, \
654 VLC_OBJECT_INPUT, FIND_ANYWHERE );
657 /* we can obviously only do that if an input is available */
658 vlc_value_t pos, length;
659 var_Get( p_input, "time", &pos );
660 [o_specificTime_enter_fld setIntValue: (pos.i_time / 1000000)];
661 var_Get( p_input, "length", &length );
662 [o_specificTime_stepper setMaxValue: (length.i_time / 1000000)];
664 [NSApp beginSheet: o_specificTime_win modalForWindow: \
665 [NSApp mainWindow] modalDelegate: self didEndSelector: nil \
667 [o_specificTime_win makeKeyWindow];
668 vlc_object_release( p_input );
675 @implementation VLCControls (NSMenuValidation)
677 - (BOOL)validateMenuItem:(NSMenuItem *)o_mi
679 BOOL bEnabled = TRUE;
681 intf_thread_t * p_intf = VLCIntf;
682 playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
685 if( p_playlist != NULL )
687 vlc_mutex_lock( &p_playlist->object_lock );
691 #define p_input p_playlist->p_input
693 if( [[o_mi title] isEqualToString: _NS("Faster")] ||
694 [[o_mi title] isEqualToString: _NS("Slower")] )
696 if( p_input != NULL )
698 bEnabled = p_input->input.b_can_pace_control;
705 else if( [[o_mi title] isEqualToString: _NS("Stop")] )
707 if( p_input == NULL )
711 [o_main setupMenus]; /* Make sure input menu is up to date */
713 else if( [[o_mi title] isEqualToString: _NS("Previous")] ||
714 [[o_mi title] isEqualToString: _NS("Next")] )
716 bEnabled = p_playlist->i_size > 1;
718 else if( [[o_mi title] isEqualToString: _NS("Random")] )
721 var_Get( p_playlist, "random", &val );
722 i_state = val.b_bool ? NSOnState : NSOffState;
723 [o_mi setState: i_state];
725 else if( [[o_mi title] isEqualToString: _NS("Repeat One")] )
728 var_Get( p_playlist, "repeat", &val );
729 i_state = val.b_bool ? NSOnState : NSOffState;
730 [o_mi setState: i_state];
732 else if( [[o_mi title] isEqualToString: _NS("Repeat All")] )
735 var_Get( p_playlist, "loop", &val );
736 i_state = val.b_bool ? NSOnState : NSOffState;
737 [o_mi setState: i_state];
739 else if( [[o_mi title] isEqualToString: _NS("Step Forward")] ||
740 [[o_mi title] isEqualToString: _NS("Step Backward")] ||
741 [[o_mi title] isEqualToString: _NS("Jump To Time")])
743 if( p_input != NULL )
745 var_Get( p_input, "seekable", &val);
746 bEnabled = val.b_bool;
748 else bEnabled = FALSE;
750 else if( [[o_mi title] isEqualToString: _NS("Mute")] )
752 [o_mi setState: p_intf->p_sys->b_mute ? NSOnState : NSOffState];
753 [o_main setupMenus]; /* Make sure audio menu is up to date */
755 else if( [[o_mi title] isEqualToString: _NS("Half Size")] ||
756 [[o_mi title] isEqualToString: _NS("Normal Size")] ||
757 [[o_mi title] isEqualToString: _NS("Double Size")] ||
758 [[o_mi title] isEqualToString: _NS("Fit to Screen")] ||
759 [[o_mi title] isEqualToString: _NS("Snapshot")] ||
760 [[o_mi title] isEqualToString: _NS("Fullscreen")] ||
761 [[o_mi title] isEqualToString: _NS("Float on Top")] )
764 NSArray *o_windows = [NSApp orderedWindows];
765 NSEnumerator *o_enumerator = [o_windows objectEnumerator];
768 vout_thread_t *p_vout = vlc_object_find( p_intf, VLC_OBJECT_VOUT,
772 if( [[o_mi title] isEqualToString: _NS("Float on Top")] )
774 var_Get( p_vout, "video-on-top", &val );
775 [o_mi setState: val.b_bool ? NSOnState : NSOffState];
778 while( (o_window = [o_enumerator nextObject]))
780 if( [[o_window className] isEqualToString: @"VLCWindow"] ||
781 [[[VLCMain sharedInstance] getEmbeddedList]
782 windowContainsEmbedded: o_window])
788 vlc_object_release( (vlc_object_t *)p_vout );
790 else if( [[o_mi title] isEqualToString: _NS("Fullscreen")] )
792 var_Get( p_playlist, "fullscreen", &val );
793 [o_mi setState: val.b_bool];
796 [o_main setupMenus]; /* Make sure video menu is up to date */
799 vlc_mutex_unlock( &p_playlist->object_lock );
800 vlc_object_release( p_playlist );
807 /*****************************************************************************
808 * VLCMenuExt implementation
809 *****************************************************************************
810 * Object connected to a playlistitem which remembers the data belonging to
811 * the variable of the autogenerated menu
812 *****************************************************************************/
813 @implementation VLCMenuExt
815 - (id)initWithVar: (const char *)_psz_name Object: (int)i_id
816 Value: (vlc_value_t)val ofType: (int)_i_type
822 psz_name = strdup( _psz_name );
860 /*****************************************************************************
861 * VLCTimeField implementation
862 *****************************************************************************
863 * we need this to catch our click-event in the controller window
864 *****************************************************************************/
866 @implementation VLCTimeField
867 - (void)mouseDown: (NSEvent *)ourEvent
869 if( [ourEvent clickCount] > 1 )
870 [[[VLCMain sharedInstance] getControls] goToSpecificTime: nil];