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
49 o_fs_panel = [[VLCFSPanel alloc] init];
55 [o_specificTime_mi setTitle: _NS("Jump To Time")];
56 [o_specificTime_cancel_btn setTitle: _NS("Cancel")];
57 [o_specificTime_ok_btn setTitle: _NS("OK")];
58 [o_specificTime_sec_lbl setStringValue: _NS("sec.")];
59 [o_specificTime_goTo_lbl setStringValue: _NS("Jump to time")];
62 - (IBAction)play:(id)sender
65 intf_thread_t * p_intf = VLCIntf;
66 playlist_t * p_playlist = pl_Yield( p_intf );
68 vlc_mutex_lock( &p_playlist->object_lock );
69 if( p_playlist->i_size <= 0 )
71 vlc_mutex_unlock( &p_playlist->object_lock );
72 vlc_object_release( p_playlist );
73 [o_main intfOpenFileGeneric: (id)sender];
77 vlc_mutex_unlock( &p_playlist->object_lock );
78 vlc_object_release( p_playlist );
81 val.i_int = config_GetInt( p_intf, "key-play-pause" );
82 var_Set( p_intf->p_libvlc, "key-pressed", val );
85 /* Small helper method */
91 id o_embedded_vout_list = [[VLCMain sharedInstance] getEmbeddedList];
92 NSEnumerator *o_enumerator = [[NSApp orderedWindows] objectEnumerator];
93 while( !o_vout_view && ( o_window = [o_enumerator nextObject] ) )
95 /* We have an embedded vout */
96 if( [o_embedded_vout_list windowContainsEmbedded: o_window] )
98 o_vout_view = [o_embedded_vout_list getViewForWindow: o_window];
100 /* We have a detached vout */
101 else if( [[o_window className] isEqualToString: @"VLCWindow"] )
103 msg_Dbg( VLCIntf, "detached vout controls.m call getVoutView" );
104 o_vout_view = [o_window getVoutView];
111 - (IBAction)stop:(id)sender
114 intf_thread_t * p_intf = VLCIntf;
115 val.i_int = config_GetInt( p_intf, "key-stop" );
116 var_Set( p_intf->p_libvlc, "key-pressed", val );
119 - (IBAction)faster:(id)sender
122 intf_thread_t * p_intf = VLCIntf;
123 val.i_int = config_GetInt( p_intf, "key-faster" );
124 var_Set( p_intf->p_libvlc, "key-pressed", val );
127 - (IBAction)slower:(id)sender
130 intf_thread_t * p_intf = VLCIntf;
131 val.i_int = config_GetInt( p_intf, "key-slower" );
132 var_Set( p_intf->p_libvlc, "key-pressed", val );
135 - (IBAction)prev:(id)sender
138 intf_thread_t * p_intf = VLCIntf;
139 val.i_int = config_GetInt( p_intf, "key-prev" );
140 var_Set( p_intf->p_libvlc, "key-pressed", val );
143 - (IBAction)next:(id)sender
146 intf_thread_t * p_intf = VLCIntf;
147 val.i_int = config_GetInt( p_intf, "key-next" );
148 var_Set( p_intf->p_libvlc, "key-pressed", val );
151 - (IBAction)random:(id)sender
154 intf_thread_t * p_intf = VLCIntf;
155 playlist_t * p_playlist = pl_Yield( p_intf );
157 var_Get( p_playlist, "random", &val );
158 val.b_bool = !val.b_bool;
159 var_Set( p_playlist, "random", val );
162 vout_OSDMessage( p_intf, DEFAULT_CHAN, _( "Random On" ) );
163 config_PutInt( p_playlist, "random", 1 );
167 vout_OSDMessage( p_intf, DEFAULT_CHAN, _( "Random Off" ) );
168 config_PutInt( p_playlist, "random", 0 );
171 p_intf->p_sys->b_playmode_update = VLC_TRUE;
172 p_intf->p_sys->b_intf_update = VLC_TRUE;
173 vlc_object_release( p_playlist );
176 - (IBAction)repeat:(id)sender
179 intf_thread_t * p_intf = VLCIntf;
180 playlist_t * p_playlist = pl_Yield( p_intf );
182 var_Get( p_playlist, "repeat", &val );
185 var_Set( p_playlist, "loop", val );
187 val.b_bool = !val.b_bool;
188 var_Set( p_playlist, "repeat", val );
191 vout_OSDMessage( p_intf, DEFAULT_CHAN, _( "Repeat One" ) );
192 config_PutInt( p_playlist, "repeat", 1 );
196 vout_OSDMessage( p_intf, DEFAULT_CHAN, _( "Repeat Off" ) );
197 config_PutInt( p_playlist, "repeat", 0 );
200 p_intf->p_sys->b_playmode_update = VLC_TRUE;
201 p_intf->p_sys->b_intf_update = VLC_TRUE;
202 vlc_object_release( p_playlist );
205 - (IBAction)loop:(id)sender
208 intf_thread_t * p_intf = VLCIntf;
209 playlist_t * p_playlist = pl_Yield( p_intf );
211 var_Get( p_playlist, "loop", &val );
214 var_Set( p_playlist, "repeat", val );
216 val.b_bool = !val.b_bool;
217 var_Set( p_playlist, "loop", val );
220 vout_OSDMessage( p_intf, DEFAULT_CHAN, _( "Repeat All" ) );
221 config_PutInt( p_playlist, "loop", 1 );
225 vout_OSDMessage( p_intf, DEFAULT_CHAN, _( "Repeat Off" ) );
226 config_PutInt( p_playlist, "loop", 0 );
229 p_intf->p_sys->b_playmode_update = VLC_TRUE;
230 p_intf->p_sys->b_intf_update = VLC_TRUE;
231 vlc_object_release( p_playlist );
234 - (IBAction)forward:(id)sender
237 intf_thread_t * p_intf = VLCIntf;
238 val.i_int = config_GetInt( p_intf, "key-jump+short" );
239 var_Set( p_intf->p_libvlc, "key-pressed", val );
242 - (IBAction)backward:(id)sender
245 intf_thread_t * p_intf = VLCIntf;
246 val.i_int = config_GetInt( p_intf, "key-jump-short" );
247 var_Set( p_intf->p_libvlc, "key-pressed", val );
251 - (IBAction)volumeUp:(id)sender
254 intf_thread_t * p_intf = VLCIntf;
255 val.i_int = config_GetInt( p_intf, "key-vol-up" );
256 var_Set( p_intf->p_libvlc, "key-pressed", val );
257 /* Manage volume status */
258 [o_main manageVolumeSlider];
261 - (IBAction)volumeDown:(id)sender
264 intf_thread_t * p_intf = VLCIntf;
265 val.i_int = config_GetInt( p_intf, "key-vol-down" );
266 var_Set( p_intf->p_libvlc, "key-pressed", val );
267 /* Manage volume status */
268 [o_main manageVolumeSlider];
271 - (IBAction)mute:(id)sender
274 intf_thread_t * p_intf = VLCIntf;
275 val.i_int = config_GetInt( p_intf, "key-vol-mute" );
276 var_Set( p_intf->p_libvlc, "key-pressed", val );
277 /* Manage volume status */
278 [o_main manageVolumeSlider];
281 - (IBAction)volumeSliderUpdated:(id)sender
283 intf_thread_t * p_intf = VLCIntf;
284 audio_volume_t i_volume = (audio_volume_t)[sender intValue];
285 int i_volume_step = 0;
286 i_volume_step = config_GetInt( p_intf->p_libvlc, "volume-step" );
287 aout_VolumeSet( p_intf, i_volume * i_volume_step );
288 /* Manage volume status */
289 [o_main manageVolumeSlider];
292 - (IBAction)windowAction:(id)sender
294 NSString *o_title = [sender title];
296 vout_thread_t *p_vout = vlc_object_find( VLCIntf, VLC_OBJECT_VOUT,
300 id o_vout_view = [self getVoutView];
303 if( [o_title isEqualToString: _NS("Half Size") ] )
304 [o_vout_view scaleWindowWithFactor: 0.5];
305 else if( [o_title isEqualToString: _NS("Normal Size") ] )
306 [o_vout_view scaleWindowWithFactor: 1.0];
307 else if( [o_title isEqualToString: _NS("Double Size") ] )
308 [o_vout_view scaleWindowWithFactor: 2.0];
309 else if( [o_title isEqualToString: _NS("Float on Top") ] )
310 [o_vout_view toggleFloatOnTop];
311 else if( [o_title isEqualToString: _NS("Fit to Screen") ] )
313 id o_window = [o_vout_view getWindow];
314 if( ![o_window isZoomed] )
315 [o_window performZoom:self];
317 else if( [o_title isEqualToString: _NS("Snapshot") ] )
319 [o_vout_view snapshot];
323 [o_vout_view toggleFullscreen];
326 vlc_object_release( (vlc_object_t *)p_vout );
330 playlist_t * p_playlist = pl_Yield( VLCIntf );
332 if( [o_title isEqualToString: _NS("Fullscreen")] ||
333 [sender isKindOfClass:[NSButton class]] )
336 var_Get( p_playlist, "fullscreen", &val );
337 var_Set( p_playlist, "fullscreen", (vlc_value_t)!val.b_bool );
340 vlc_object_release( p_playlist );
345 - (BOOL)keyEvent:(NSEvent *)o_event
347 BOOL eventHandled = NO;
348 unichar key = [[o_event charactersIgnoringModifiers] characterAtIndex: 0];
352 vout_thread_t *p_vout = vlc_object_find( VLCIntf, VLC_OBJECT_VOUT,
357 if( key == (unichar) 0x1b )
359 id o_vout_view = [self getVoutView];
360 if( o_vout_view && [o_vout_view isFullscreen] )
362 [o_vout_view toggleFullscreen];
366 else if( key == ' ' )
371 vlc_object_release( (vlc_object_t *)p_vout );
377 - (void)setupVarMenuItem:(NSMenuItem *)o_mi
378 target:(vlc_object_t *)p_object
379 var:(const char *)psz_variable
380 selector:(SEL)pf_callback
382 vlc_value_t val, text;
383 int i_type = var_Type( p_object, psz_variable );
385 switch( i_type & VLC_VAR_TYPE )
389 case VLC_VAR_VARIABLE:
391 case VLC_VAR_INTEGER:
394 /* Variable doesn't exist or isn't handled */
398 /* Make sure we want to display the variable */
399 if( i_type & VLC_VAR_HASCHOICE )
401 var_Change( p_object, psz_variable, VLC_VAR_CHOICESCOUNT, &val, NULL );
402 if( val.i_int == 0 ) return;
403 if( (i_type & VLC_VAR_TYPE) != VLC_VAR_VARIABLE && val.i_int == 1 )
407 /* Get the descriptive name of the variable */
408 var_Change( p_object, psz_variable, VLC_VAR_GETTEXT, &text, NULL );
409 [o_mi setTitle: [[VLCMain sharedInstance] localizedString: text.psz_string ?
410 text.psz_string : strdup( psz_variable ) ]];
412 var_Get( p_object, psz_variable, &val );
413 if( i_type & VLC_VAR_HASCHOICE )
415 NSMenu *o_menu = [o_mi submenu];
417 [self setupVarMenu: o_menu forMenuItem: o_mi target:p_object
418 var:psz_variable selector:pf_callback];
420 if( text.psz_string ) free( text.psz_string );
425 switch( i_type & VLC_VAR_TYPE )
428 o_data = [[VLCMenuExt alloc] initWithVar: psz_variable Object: p_object->i_object_id
429 Value: val ofType: i_type];
430 [o_mi setRepresentedObject: [NSValue valueWithPointer:[o_data retain]]];
434 o_data = [[VLCMenuExt alloc] initWithVar: psz_variable Object: p_object->i_object_id
435 Value: val ofType: i_type];
436 [o_mi setRepresentedObject: [NSValue valueWithPointer:[o_data retain]]];
437 if( !( i_type & VLC_VAR_ISCOMMAND ) )
438 [o_mi setState: val.b_bool ? TRUE : FALSE ];
442 if( text.psz_string ) free( text.psz_string );
446 if( ( i_type & VLC_VAR_TYPE ) == VLC_VAR_STRING ) free( val.psz_string );
447 if( text.psz_string ) free( text.psz_string );
451 - (void)setupVarMenu:(NSMenu *)o_menu
452 forMenuItem: (NSMenuItem *)o_parent
453 target:(vlc_object_t *)p_object
454 var:(const char *)psz_variable
455 selector:(SEL)pf_callback
457 vlc_value_t val, val_list, text_list;
458 int i_type, i, i_nb_items;
460 /* remove previous items */
461 i_nb_items = [o_menu numberOfItems];
462 for( i = 0; i < i_nb_items; i++ )
464 [o_menu removeItemAtIndex: 0];
467 /* Check the type of the object variable */
468 i_type = var_Type( p_object, psz_variable );
470 /* Make sure we want to display the variable */
471 if( i_type & VLC_VAR_HASCHOICE )
473 var_Change( p_object, psz_variable, VLC_VAR_CHOICESCOUNT, &val, NULL );
474 if( val.i_int == 0 ) return;
475 if( (i_type & VLC_VAR_TYPE) != VLC_VAR_VARIABLE && val.i_int == 1 )
483 switch( i_type & VLC_VAR_TYPE )
487 case VLC_VAR_VARIABLE:
489 case VLC_VAR_INTEGER:
492 /* Variable doesn't exist or isn't handled */
496 if( var_Get( p_object, psz_variable, &val ) < 0 )
501 if( var_Change( p_object, psz_variable, VLC_VAR_GETLIST,
502 &val_list, &text_list ) < 0 )
504 if( (i_type & VLC_VAR_TYPE) == VLC_VAR_STRING ) free( val.psz_string );
508 /* make (un)sensitive */
509 [o_parent setEnabled: ( val_list.p_list->i_count > 1 )];
511 for( i = 0; i < val_list.p_list->i_count; i++ )
513 vlc_value_t another_val;
515 NSString *o_title = @"";
518 switch( i_type & VLC_VAR_TYPE )
521 another_val.psz_string =
522 strdup(val_list.p_list->p_values[i].psz_string);
524 o_title = [[VLCMain sharedInstance] localizedString: text_list.p_list->p_values[i].psz_string ?
525 text_list.p_list->p_values[i].psz_string : val_list.p_list->p_values[i].psz_string ];
527 o_lmi = [o_menu addItemWithTitle: o_title action: pf_callback keyEquivalent: @""];
528 o_data = [[VLCMenuExt alloc] initWithVar: strdup(psz_variable) Object: p_object->i_object_id
529 Value: another_val ofType: i_type];
530 [o_lmi setRepresentedObject: [NSValue valueWithPointer:[o_data retain]]];
531 [o_lmi setTarget: self];
533 if( !strcmp( val.psz_string, val_list.p_list->p_values[i].psz_string ) && !( i_type & VLC_VAR_ISCOMMAND ) )
534 [o_lmi setState: TRUE ];
538 case VLC_VAR_INTEGER:
540 o_title = text_list.p_list->p_values[i].psz_string ?
541 [[VLCMain sharedInstance] localizedString: strdup( text_list.p_list->p_values[i].psz_string )] :
542 [NSString stringWithFormat: @"%d",
543 val_list.p_list->p_values[i].i_int];
545 o_lmi = [[o_menu addItemWithTitle: o_title action: pf_callback keyEquivalent: @""] retain ];
546 o_data = [[VLCMenuExt alloc] initWithVar: strdup(psz_variable) Object: p_object->i_object_id
547 Value: val_list.p_list->p_values[i] ofType: i_type];
548 [o_lmi setRepresentedObject: [NSValue valueWithPointer:[ o_data retain]]];
549 [o_lmi setTarget: self];
551 if( val_list.p_list->p_values[i].i_int == val.i_int && !( i_type & VLC_VAR_ISCOMMAND ) )
552 [o_lmi setState: TRUE ];
560 /* clean up everything */
561 if( (i_type & VLC_VAR_TYPE) == VLC_VAR_STRING ) free( val.psz_string );
562 var_Change( p_object, psz_variable, VLC_VAR_FREELIST, &val_list, &text_list );
565 - (IBAction)toggleVar:(id)sender
567 NSMenuItem *o_mi = (NSMenuItem *)sender;
568 VLCMenuExt *o_data = [[o_mi representedObject] pointerValue];
569 [NSThread detachNewThreadSelector: @selector(toggleVarThread:)
570 toTarget: self withObject: o_data];
575 - (int)toggleVarThread: (id)_o_data
577 vlc_object_t *p_object;
578 NSAutoreleasePool * o_pool = [[NSAutoreleasePool alloc] init];
579 VLCMenuExt *o_data = (VLCMenuExt *)_o_data;
581 vlc_thread_set_priority( VLCIntf , VLC_THREAD_PRIORITY_LOW );
583 p_object = (vlc_object_t *)vlc_object_get( VLCIntf,
586 if( p_object != NULL )
588 var_Set( p_object, strdup([o_data name]), [o_data value] );
589 vlc_object_release( p_object );
597 - (IBAction)goToSpecificTime:(id)sender
599 if( sender == o_specificTime_cancel_btn )
601 [NSApp endSheet: o_specificTime_win];
602 [o_specificTime_win close];
604 else if( sender == o_specificTime_ok_btn )
606 input_thread_t * p_input = (input_thread_t *)vlc_object_find( VLCIntf, \
607 VLC_OBJECT_INPUT, FIND_ANYWHERE );
610 unsigned int timeInSec = 0;
611 NSString * fieldContent = [o_specificTime_enter_fld stringValue];
612 if( [[fieldContent componentsSeparatedByString: @":"] count] > 1 &&
613 [[fieldContent componentsSeparatedByString: @":"] count] <= 3 )
615 NSArray * ourTempArray = \
616 [fieldContent componentsSeparatedByString: @":"];
618 if( [[fieldContent componentsSeparatedByString: @":"] count] == 3 )
620 timeInSec += ([[ourTempArray objectAtIndex: 0] intValue] * 3600); //h
621 timeInSec += ([[ourTempArray objectAtIndex: 1] intValue] * 60); //m
622 timeInSec += [[ourTempArray objectAtIndex: 2] intValue]; //s
626 timeInSec += ([[ourTempArray objectAtIndex: 0] intValue] * 60); //m
627 timeInSec += [[ourTempArray objectAtIndex: 1] intValue]; //s
631 timeInSec = [fieldContent intValue];
633 input_Control( p_input, INPUT_SET_TIME, (int64_t)(timeInSec * 1000000));
634 vlc_object_release( p_input );
637 [NSApp endSheet: o_specificTime_win];
638 [o_specificTime_win close];
642 input_thread_t * p_input = (input_thread_t *)vlc_object_find( VLCIntf, \
643 VLC_OBJECT_INPUT, FIND_ANYWHERE );
646 /* we can obviously only do that if an input is available */
647 vlc_value_t pos, length;
648 var_Get( p_input, "time", &pos );
649 [o_specificTime_enter_fld setIntValue: (pos.i_time / 1000000)];
650 var_Get( p_input, "length", &length );
651 [o_specificTime_stepper setMaxValue: (length.i_time / 1000000)];
653 [NSApp beginSheet: o_specificTime_win modalForWindow: \
654 [NSApp mainWindow] modalDelegate: self didEndSelector: nil \
656 [o_specificTime_win makeKeyWindow];
657 vlc_object_release( p_input );
668 msg_Err( VLCIntf, "FSPanel is nil" );
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 = pl_Yield( p_intf );
684 vlc_mutex_lock( &p_playlist->object_lock );
686 #define p_input p_playlist->p_input
688 if( [[o_mi title] isEqualToString: _NS("Faster")] ||
689 [[o_mi title] isEqualToString: _NS("Slower")] )
691 if( p_input != NULL )
693 bEnabled = p_input->input.b_can_pace_control;
700 else if( [[o_mi title] isEqualToString: _NS("Stop")] )
702 if( p_input == NULL )
706 [o_main setupMenus]; /* Make sure input menu is up to date */
708 else if( [[o_mi title] isEqualToString: _NS("Previous")] ||
709 [[o_mi title] isEqualToString: _NS("Next")] )
711 bEnabled = p_playlist->i_size > 1;
713 else if( [[o_mi title] isEqualToString: _NS("Random")] )
716 var_Get( p_playlist, "random", &val );
717 i_state = val.b_bool ? NSOnState : NSOffState;
718 [o_mi setState: i_state];
720 else if( [[o_mi title] isEqualToString: _NS("Repeat One")] )
723 var_Get( p_playlist, "repeat", &val );
724 i_state = val.b_bool ? NSOnState : NSOffState;
725 [o_mi setState: i_state];
727 else if( [[o_mi title] isEqualToString: _NS("Repeat All")] )
730 var_Get( p_playlist, "loop", &val );
731 i_state = val.b_bool ? NSOnState : NSOffState;
732 [o_mi setState: i_state];
734 else if( [[o_mi title] isEqualToString: _NS("Step Forward")] ||
735 [[o_mi title] isEqualToString: _NS("Step Backward")] ||
736 [[o_mi title] isEqualToString: _NS("Jump To Time")])
738 if( p_input != NULL )
740 var_Get( p_input, "seekable", &val);
741 bEnabled = val.b_bool;
743 else bEnabled = FALSE;
745 else if( [[o_mi title] isEqualToString: _NS("Mute")] )
747 [o_mi setState: p_intf->p_sys->b_mute ? NSOnState : NSOffState];
748 [o_main setupMenus]; /* Make sure audio menu is up to date */
750 else if( [[o_mi title] isEqualToString: _NS("Half Size")] ||
751 [[o_mi title] isEqualToString: _NS("Normal Size")] ||
752 [[o_mi title] isEqualToString: _NS("Double Size")] ||
753 [[o_mi title] isEqualToString: _NS("Fit to Screen")] ||
754 [[o_mi title] isEqualToString: _NS("Snapshot")] ||
755 [[o_mi title] isEqualToString: _NS("Fullscreen")] ||
756 [[o_mi title] isEqualToString: _NS("Float on Top")] )
759 NSArray *o_windows = [NSApp orderedWindows];
760 NSEnumerator *o_enumerator = [o_windows objectEnumerator];
763 vout_thread_t *p_vout = vlc_object_find( p_intf, VLC_OBJECT_VOUT,
767 if( [[o_mi title] isEqualToString: _NS("Float on Top")] )
769 var_Get( p_vout, "video-on-top", &val );
770 [o_mi setState: val.b_bool ? NSOnState : NSOffState];
773 while( (o_window = [o_enumerator nextObject]))
775 if( [[o_window className] isEqualToString: @"VLCWindow"] ||
776 [[[VLCMain sharedInstance] getEmbeddedList]
777 windowContainsEmbedded: o_window])
783 vlc_object_release( (vlc_object_t *)p_vout );
785 else if( [[o_mi title] isEqualToString: _NS("Fullscreen")] )
787 var_Get( p_playlist, "fullscreen", &val );
788 [o_mi setState: val.b_bool];
791 [o_main setupMenus]; /* Make sure video menu is up to date */
794 vlc_mutex_unlock( &p_playlist->object_lock );
795 vlc_object_release( p_playlist );
802 /*****************************************************************************
803 * VLCMenuExt implementation
804 *****************************************************************************
805 * Object connected to a playlistitem which remembers the data belonging to
806 * the variable of the autogenerated menu
807 *****************************************************************************/
808 @implementation VLCMenuExt
810 - (id)initWithVar: (const char *)_psz_name Object: (int)i_id
811 Value: (vlc_value_t)val ofType: (int)_i_type
817 psz_name = strdup( _psz_name );
855 /*****************************************************************************
856 * VLCTimeField implementation
857 *****************************************************************************
858 * we need this to catch our click-event in the controller window
859 *****************************************************************************/
861 @implementation VLCTimeField
862 - (void)mouseDown: (NSEvent *)ourEvent
864 if( [ourEvent clickCount] > 1 )
865 [[[VLCMain sharedInstance] getControls] goToSpecificTime: nil];