]> git.sesse.net Git - vlc/blob - modules/gui/macosx/fspanel.m
macosx: retain window level across a fullscreen session
[vlc] / modules / gui / macosx / fspanel.m
1 /*****************************************************************************
2  * fspanel.m: MacOS X full screen panel
3  *****************************************************************************
4  * Copyright (C) 2006-2008 the VideoLAN team
5  * $Id$
6  *
7  * Authors: Jérôme Decoodt <djc at videolan dot org>
8  *          Felix Paul Kühne <fkuehne at videolan dot org>
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  * 
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, write to the Free Software
22  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
23  *****************************************************************************/
24
25 /*****************************************************************************
26  * Preamble
27  *****************************************************************************/
28 #import "intf.h"
29 #import "CoreInteraction.h"
30 #import "MainWindow.h"
31 #import "misc.h"
32 #import "fspanel.h"
33
34 @interface VLCFSPanel ()
35 - (void)hideMouse;
36 @end
37
38 /*****************************************************************************
39  * VLCFSPanel
40  *****************************************************************************/
41 @implementation VLCFSPanel
42 /* We override this initializer so we can set the NSBorderlessWindowMask styleMask, and set a few other important settings */
43 - (id)initWithContentRect:(NSRect)contentRect 
44                 styleMask:(NSUInteger)aStyle 
45                   backing:(NSBackingStoreType)bufferingType 
46                     defer:(BOOL)flag
47 {
48     id win = [super initWithContentRect:contentRect styleMask:NSTexturedBackgroundWindowMask backing:bufferingType defer:flag];
49     [win setOpaque:NO];
50     [win setHasShadow: NO];
51     [win setBackgroundColor:[NSColor clearColor]];
52     
53     /* let the window sit on top of everything else and start out completely transparent */
54     [win setLevel:NSModalPanelWindowLevel];
55     i_device = 0;
56     [win center];
57     hideAgainTimer = fadeTimer = nil;
58     [self setNonActive:nil];
59     return win;
60 }
61
62 - (void)awakeFromNib
63 {
64     [self setContentView:[[VLCFSPanelView alloc] initWithFrame: [self frame]]];
65     BOOL isInside = (NSPointInRect([NSEvent mouseLocation],[self frame]));
66     [[self contentView] addTrackingRect:[[self contentView] bounds] owner:self userData:nil assumeInside:isInside];
67     if (isInside)
68         [self mouseEntered:NULL];
69     if (!isInside)
70         [self mouseExited:NULL];
71     
72     /* get a notification if VLC isn't the active app anymore */
73     [[NSNotificationCenter defaultCenter]
74     addObserver: self
75        selector: @selector(setNonActive:)
76            name: NSApplicationDidResignActiveNotification
77          object: NSApp];
78     
79     /* get a notification if VLC is the active app again */
80     [[NSNotificationCenter defaultCenter]
81     addObserver: self
82        selector: @selector(setActive:)
83            name: NSApplicationDidBecomeActiveNotification
84          object: NSApp];
85 }
86
87 /* make sure that we don't become key, since we can't handle hotkeys */
88 - (BOOL)canBecomeKeyWindow
89 {
90     return NO;
91 }
92
93 - (BOOL)mouseDownCanMoveWindow
94 {
95     return YES;
96 }
97
98 -(void)dealloc
99 {
100     [[NSNotificationCenter defaultCenter] removeObserver: self];
101
102     if( hideAgainTimer )
103     {
104         [hideAgainTimer invalidate];
105         [hideAgainTimer release];
106     }
107     [self setFadeTimer:nil];
108     [super dealloc];
109 }
110
111 -(void)center
112 {
113     /* centre the panel in the lower third of the screen */
114     NSPoint theCoordinate;
115     NSRect theScreensFrame;
116     NSRect theWindowsFrame;
117     NSScreen *screen;
118     
119     /* user-defined screen */
120     screen = [NSScreen screenWithDisplayID: (CGDirectDisplayID)i_device];
121     
122     if (!screen)
123     {
124         /* invalid preferences or none specified, using main screen */
125         screen = [NSScreen mainScreen];
126     }
127
128     theScreensFrame = [screen frame];
129
130     theWindowsFrame = [self frame];
131     
132     theCoordinate.x = (theScreensFrame.size.width - theWindowsFrame.size.width) / 2 + theScreensFrame.origin.x;
133     theCoordinate.y = (theScreensFrame.size.height / 3) - theWindowsFrame.size.height + theScreensFrame.origin.y;
134     [self setFrameTopLeftPoint: theCoordinate];
135 }
136
137 - (void)setPlay
138 {
139     [[self contentView] setPlay];
140 }
141
142 - (void)setPause
143 {
144     [[self contentView] setPause];
145 }
146
147 - (void)setStreamTitle:(NSString *)o_title
148 {
149     [[self contentView] setStreamTitle: o_title];
150 }
151
152 - (void)setStreamPos:(float) f_pos andTime:(NSString *)o_time
153 {
154     [[self contentView] setStreamPos:f_pos andTime: o_time];
155 }
156
157 - (void)setSeekable:(BOOL) b_seekable
158 {
159     [[self contentView] setSeekable: b_seekable];
160 }
161
162 - (void)setVolumeLevel: (float)f_volumeLevel
163 {
164     [[self contentView] setVolumeLevel: f_volumeLevel];
165 }
166
167 - (void)setNonActive:(id)noData
168 {
169     b_nonActive = YES;
170     [self orderOut: self];
171     
172     /* here's fadeOut, just without visibly fading */
173     b_displayed = NO;
174     [self setAlphaValue:0.0];
175     [self setFadeTimer:nil];
176     b_fadeQueued = NO;
177 }
178
179 - (void)setActive:(id)noData
180 {
181     vout_thread_t *p_vout = getVout();
182     if (p_vout)
183     {
184         if (var_GetBool( p_vout, "fullscreen" ))
185         {
186             b_nonActive = NO;
187             [self fadeIn];
188         }
189         vlc_object_release( p_vout );
190     }
191 }
192
193 /* This routine is called repeatedly to fade in the window */
194 - (void)focus:(NSTimer *)timer
195 {
196     /* we need to push ourselves to front if the vout window was closed since our last display */
197     if( b_voutWasUpdated )
198     {
199         [self orderFront: self];
200         b_voutWasUpdated = NO;
201     }
202
203     if( [self alphaValue] < 1.0 )
204         [self setAlphaValue:[self alphaValue]+0.1];
205     if( [self alphaValue] >= 1.0 )
206     {
207         b_displayed = YES;
208         [self setAlphaValue: 1.0];
209         [self setFadeTimer:nil];
210         if( b_fadeQueued )
211         {
212             b_fadeQueued=NO;
213             [self setFadeTimer:[NSTimer scheduledTimerWithTimeInterval:0.1 target:self selector:@selector(unfocus:) userInfo:NULL repeats:YES]];
214         }
215     }
216 }
217
218 /* This routine is called repeatedly to hide the window */
219 - (void)unfocus:(NSTimer *)timer
220 {
221     if( b_keptVisible )
222     {
223         b_keptVisible = NO;
224         b_fadeQueued = NO;
225         [self setFadeTimer: NULL];
226         [self fadeIn];
227         return;
228     }
229     if( [self alphaValue] > 0.0 )
230         [self setAlphaValue:[self alphaValue]-0.05];
231     if( [self alphaValue] <= 0.05 )
232     {
233         b_displayed = NO;
234         [self setAlphaValue:0.0];
235         [self setFadeTimer:nil];
236         if( b_fadeQueued )
237         {
238             b_fadeQueued=NO;
239             [self setFadeTimer:
240                 [NSTimer scheduledTimerWithTimeInterval:0.1 
241                                                  target:self 
242                                                selector:@selector(focus:) 
243                                                userInfo:NULL 
244                                                 repeats:YES]];
245         }
246     }
247 }
248
249 - (void)mouseExited:(NSEvent *)theEvent
250 {
251     /* give up our focus, so the vout may show us again without letting the user clicking it */
252     vout_thread_t *p_vout = getVout();
253     if (p_vout)
254     {
255         if (var_GetBool( p_vout, "fullscreen" ))
256             [[[[VLCMainWindow sharedInstance] videoView] window] makeKeyWindow];
257         vlc_object_release( p_vout );
258     }
259 }
260
261 - (void)hideMouse
262 {
263     [NSCursor setHiddenUntilMouseMoves: YES];
264 }
265
266 - (void)fadeIn
267 {
268     /* in case that the user don't want us to appear, make sure we hide the mouse */
269
270     if( !config_GetInt( VLCIntf, "macosx-fspanel" ) )
271     {
272         float time = (float)var_CreateGetInteger( VLCIntf, "mouse-hide-timeout" ) / 1000.;
273         [self setFadeTimer:[NSTimer scheduledTimerWithTimeInterval:time target:self selector:@selector(hideMouse) userInfo:nil repeats:NO]];
274         return;
275     }
276
277     if( b_nonActive )
278         return;
279
280     [self orderFront: nil];
281     
282     if( [self alphaValue] < 1.0 || b_displayed != YES )
283     {
284         if (![self fadeTimer])
285             [self setFadeTimer:[NSTimer scheduledTimerWithTimeInterval:0.05 target:self selector:@selector(focus:) userInfo:[NSNumber numberWithShort:1] repeats:YES]];
286         else if ([[[self fadeTimer] userInfo] shortValue]==0)
287             b_fadeQueued=YES;
288     }
289     [self autoHide];
290 }
291
292 - (void)fadeOut
293 {
294     if( NSPointInRect([NSEvent mouseLocation],[self frame]))
295         return;
296
297     if( ( [self alphaValue] > 0.0 ) )
298     {
299         if (![self fadeTimer])
300             [self setFadeTimer:[NSTimer scheduledTimerWithTimeInterval:0.05 target:self selector:@selector(unfocus:) userInfo:[NSNumber numberWithShort:0] repeats:YES]];
301         else if ([[[self fadeTimer] userInfo] shortValue]==1)
302             b_fadeQueued=YES;
303     }
304 }
305
306 /* triggers a timer to autoHide us again after some seconds of no activity */
307 - (void)autoHide
308 {
309     /* this will tell the timer to start over again or to start at all */
310     b_keptVisible = YES;
311     
312     /* get us a valid timer */
313     if(! b_alreadyCounting )
314     {
315         i_timeToKeepVisibleInSec = var_CreateGetInteger( VLCIntf, "mouse-hide-timeout" ) / 500;
316         if( hideAgainTimer )
317         {
318             [hideAgainTimer invalidate];
319             [hideAgainTimer autorelease];
320         }
321         /* released in -autoHide and -dealloc */
322         hideAgainTimer = [[NSTimer scheduledTimerWithTimeInterval: 0.5
323                                                           target: self 
324                                                         selector: @selector(keepVisible:)
325                                                         userInfo: nil 
326                                                          repeats: YES] retain];
327         b_alreadyCounting = YES;
328     }
329 }
330
331 - (void)keepVisible:(NSTimer *)timer
332 {
333     /* if the user triggered an action, start over again */
334     if( b_keptVisible )
335         b_keptVisible = NO;
336
337     /* count down until we hide ourselfes again and do so if necessary */
338     if( --i_timeToKeepVisibleInSec < 1 )
339     {
340         [self hideMouse];
341         [self fadeOut];
342         [hideAgainTimer invalidate]; /* released in -autoHide and -dealloc */
343         b_alreadyCounting = NO;
344     }
345 }
346
347 /* A getter and setter for our main timer that handles window fading */
348 - (NSTimer *)fadeTimer
349 {
350     return fadeTimer;
351 }
352
353 - (void)setFadeTimer:(NSTimer *)timer
354 {
355     [timer retain];
356     [fadeTimer invalidate];
357     [fadeTimer autorelease];
358     fadeTimer=timer;
359 }
360
361 - (void)mouseDown:(NSEvent *)theEvent
362 {
363     mouseClic = [theEvent locationInWindow];
364 }
365
366 - (void)mouseDragged:(NSEvent *)theEvent
367 {
368     NSPoint point = [NSEvent mouseLocation];
369     point.x -= mouseClic.x;
370     point.y -= mouseClic.y;
371     [self setFrameOrigin:point];
372 }
373
374 - (BOOL)isDisplayed
375 {
376     return b_displayed;
377 }
378
379 - (void)setVoutWasUpdated: (int)i_newdevice;
380 {
381     b_voutWasUpdated = YES;
382     if( i_newdevice != i_device )
383     {
384         i_device = i_newdevice;
385         [self center];
386     }
387 }
388 @end
389
390 /*****************************************************************************
391  * FSPanelView
392  *****************************************************************************/
393 @implementation VLCFSPanelView
394
395 #define addButton( o_button, imageOff, imageOn, _x, _y, action )                                \
396     s_rc.origin.x = _x;                                                                         \
397     s_rc.origin.y = _y;                                                                         \
398     o_button = [[NSButton alloc] initWithFrame: s_rc];                                 \
399     [o_button setButtonType: NSMomentaryChangeButton];                                          \
400     [o_button setBezelStyle: NSRegularSquareBezelStyle];                                        \
401     [o_button setBordered: NO];                                                                 \
402     [o_button setFont:[NSFont systemFontOfSize:0]];                                             \
403     [o_button setImage:[NSImage imageNamed:imageOff]];                                 \
404     [o_button setAlternateImage:[NSImage imageNamed:imageOn]];                         \
405     [o_button sizeToFit];                                                                       \
406     [o_button setTarget: self];                                                                 \
407     [o_button setAction: @selector(action:)];                                                   \
408     [self addSubview:o_button];
409
410 #define addTextfield( class, o_text, align, font, color, size )                                    \
411     o_text = [[class alloc] initWithFrame: s_rc];                            \
412     [o_text setDrawsBackground: NO];                                                        \
413     [o_text setBordered: NO];                                                               \
414     [o_text setEditable: NO];                                                               \
415     [o_text setSelectable: NO];                                                             \
416     [o_text setStringValue: _NS("(no item is being played)")];                                                    \
417     [o_text setAlignment: align];                                                           \
418     [o_text setTextColor: [NSColor color]];                                                 \
419     [o_text setFont:[NSFont font:[NSFont smallSystemFontSize] - size]];                     \
420     [self addSubview:o_text];
421
422 - (id)initWithFrame:(NSRect)frameRect
423 {
424     id view = [super initWithFrame:frameRect];
425     fillColor = [[NSColor clearColor] retain];
426     NSRect s_rc = [self frame];
427     addButton( o_prev, @"fs_skip_previous" , @"fs_skip_previous_highlight", 174, 15, prev );
428     addButton( o_bwd, @"fs_rewind"        , @"fs_rewind_highlight"       , 211, 14, backward );
429     addButton( o_play, @"fs_play"          , @"fs_play_highlight"         , 267, 10, play );
430     addButton( o_fwd, @"fs_forward"       , @"fs_forward_highlight"      , 313, 14, forward );
431     addButton( o_next, @"fs_skip_next"     , @"fs_skip_next_highlight"    , 365, 15, next );
432     addButton( o_fullscreen, @"fs_exit_fullscreen", @"fs_exit_fullscreen_hightlight", 507, 13, windowAction );
433 /*
434     addButton( o_button, @"image (off state)", @"image (on state)", 38, 51, something );
435  */
436
437     /* time slider */
438     s_rc = [self frame];
439     s_rc.origin.x = 15;
440     s_rc.origin.y = 53;
441     s_rc.size.width = 518;
442     s_rc.size.height = 9;
443     o_fs_timeSlider = [[VLCFSTimeSlider alloc] initWithFrame: s_rc];
444     [o_fs_timeSlider setMinValue:0];
445     [o_fs_timeSlider setMaxValue:10000];
446     [o_fs_timeSlider setFloatValue: 0];
447     [o_fs_timeSlider setContinuous: YES];
448     [o_fs_timeSlider setTarget: self];
449     [o_fs_timeSlider setAction: @selector(fsTimeSliderUpdate:)];
450     [self addSubview: o_fs_timeSlider];
451
452     /* volume slider */
453     s_rc = [self frame];
454     s_rc.origin.x = 26;
455     s_rc.origin.y = 17.5;
456     s_rc.size.width = 95;
457     s_rc.size.height = 10;
458     o_fs_volumeSlider = [[VLCFSVolumeSlider alloc] initWithFrame: s_rc];
459     [o_fs_volumeSlider setMinValue:0];
460     [o_fs_volumeSlider setMaxValue:32];
461     [o_fs_volumeSlider setFloatValue: 0];
462     [o_fs_volumeSlider setContinuous: YES];
463     [o_fs_volumeSlider setTarget: self];
464     [o_fs_volumeSlider setAction: @selector(fsVolumeSliderUpdate:)];
465     [self addSubview: o_fs_volumeSlider];
466     
467     /* time counter and stream title output fields */
468     s_rc = [self frame];
469     s_rc.origin.x = 98;
470     s_rc.origin.y = 64;
471     s_rc.size.width = 352;
472     s_rc.size.height = 14;
473     addTextfield( NSTextField, o_streamTitle_txt, NSCenterTextAlignment, systemFontOfSize, whiteColor, 0 );
474     s_rc.origin.x = 481;
475     s_rc.origin.y = 64;
476     s_rc.size.width = 55;
477     addTextfield( VLCTimeField, o_streamPosition_txt, NSRightTextAlignment, systemFontOfSize, whiteColor, 0 );
478
479     return view;
480 }
481
482 - (void)dealloc
483 {
484     [o_fs_timeSlider release];
485     [o_fs_volumeSlider release];
486     [o_prev release];
487     [o_next release];
488     [o_bwd release];
489     [o_play release];
490     [o_fwd release];
491     [o_fullscreen release];
492     [o_streamTitle_txt release];
493     [o_streamPosition_txt release];
494     [super dealloc];
495 }
496
497 - (void)setPlay
498 {
499     [o_play setImage:[NSImage imageNamed:@"fs_play"]];
500     [o_play setAlternateImage: [NSImage imageNamed:@"fs_play_highlight"]];
501 }
502
503 - (void)setPause
504 {
505     [o_play setImage: [NSImage imageNamed:@"fs_pause"]];
506     [o_play setAlternateImage: [NSImage imageNamed:@"fs_pause_highlight"]];
507 }
508
509 - (void)setStreamTitle:(NSString *)o_title
510 {
511     [o_streamTitle_txt setStringValue: o_title];
512 }
513
514 - (void)setStreamPos:(float) f_pos andTime:(NSString *)o_time
515 {
516     [o_streamPosition_txt setStringValue: o_time];
517     [o_fs_timeSlider setFloatValue: f_pos];
518 }
519
520 - (void)setSeekable:(BOOL)b_seekable
521 {
522     [o_bwd setEnabled: b_seekable];
523     [o_fwd setEnabled: b_seekable];
524     [o_fs_timeSlider setEnabled: b_seekable];
525 }
526
527 - (void)setVolumeLevel: (float)f_volumeLevel
528 {
529     [o_fs_volumeSlider setFloatValue: f_volumeLevel];
530 }
531
532 - (IBAction)play:(id)sender
533 {
534     [[[VLCMain sharedInstance] controls] play: sender];
535 }
536
537 - (IBAction)forward:(id)sender
538 {
539     [[[VLCMain sharedInstance] controls] forward: sender];
540 }
541
542 - (IBAction)backward:(id)sender
543 {
544     [[[VLCMain sharedInstance] controls] backward: sender];
545 }
546
547 - (IBAction)prev:(id)sender
548 {
549     [[[VLCMain sharedInstance] controls] prev: sender];
550 }
551
552 - (IBAction)next:(id)sender
553 {
554     [[[VLCMain sharedInstance] controls] next: sender];
555 }
556
557 - (IBAction)windowAction:(id)sender
558 {
559     [[[VLCMain sharedInstance] controls] windowAction: sender];
560 }
561
562 - (IBAction)fsTimeSliderUpdate:(id)sender
563 {
564     input_thread_t * p_input;
565     p_input = pl_CurrentInput( VLCIntf );
566     if( p_input != NULL )
567     {
568         vlc_value_t pos;
569
570         pos.f_float = [o_fs_timeSlider floatValue] / 10000.;
571         var_Set( p_input, "position", pos );
572         vlc_object_release( p_input );
573     }
574     [[VLCMain sharedInstance] updatePlaybackPosition];
575 }
576
577 - (IBAction)fsVolumeSliderUpdate:(id)sender
578 {
579     [[VLCCoreInteraction sharedInstance] setVolume: [sender intValue]];
580 }
581
582 #define addImage(image, _x, _y, mode, _width)                                               \
583     img = [NSImage imageNamed:image];                                              \
584     image_rect.size = [img size];                                                           \
585     image_rect.origin.x = 0;                                                                \
586     image_rect.origin.y = 0;                                                                \
587     frame.origin.x = _x;                                                                    \
588     frame.origin.y = _y;                                                                    \
589     frame.size = [img size];                                                                \
590     if( _width ) frame.size.width = _width;                                                 \
591     [img drawInRect:frame fromRect:image_rect operation:mode fraction:1];
592
593 - (void)drawRect:(NSRect)rect
594 {
595     NSRect frame = [self frame];
596     NSRect image_rect;
597     NSImage *img;
598     addImage( @"fs_background", 0, 0, NSCompositeCopy, 0 );
599     addImage( @"fs_volume_slider_bar", 26, 22, NSCompositeSourceOver, 0 );
600     addImage( @"fs_volume_mute", 16, 18, NSCompositeSourceOver, 0 );
601     addImage( @"fs_volume_max", 124, 17, NSCompositeSourceOver, 0 );
602     addImage( @"fs_time_slider", 15, 53, NSCompositeSourceOver, 0);
603 }
604
605 @end
606
607 /*****************************************************************************
608  * VLCFSTimeSlider
609  *****************************************************************************/
610 @implementation VLCFSTimeSlider
611 - (void)drawKnobInRect:(NSRect)knobRect
612 {
613     NSRect image_rect;
614     NSImage *img = [NSImage imageNamed:@"fs_time_slider_knob_highlight"];
615     image_rect.size = [img size];
616     image_rect.origin.x = 0;
617     image_rect.origin.y = 0;
618     knobRect.origin.x += (knobRect.size.width - image_rect.size.width) / 2;
619     knobRect.size.width = image_rect.size.width;
620     knobRect.size.height = image_rect.size.height;
621     [img drawInRect:knobRect fromRect:image_rect operation:NSCompositeSourceOver fraction:1];
622 }
623
624 - (void)drawRect:(NSRect)rect
625 {
626     /* Draw default to make sure the slider behaves correctly */
627     [[NSGraphicsContext currentContext] saveGraphicsState];
628     NSRectClip(NSZeroRect);
629     [super drawRect:rect];
630     [[NSGraphicsContext currentContext] restoreGraphicsState];
631     
632     NSRect knobRect = [[self cell] knobRectFlipped:NO];
633     knobRect.origin.y+=7.5;
634     [[[NSColor blackColor] colorWithAlphaComponent:0.6] set];
635     [self drawKnobInRect: knobRect];
636 }
637
638 @end
639
640 /*****************************************************************************
641 * VLCFSVolumeSlider
642 *****************************************************************************/
643 @implementation VLCFSVolumeSlider
644 - (void)drawKnobInRect:(NSRect) knobRect
645 {
646     NSRect image_rect;
647     NSImage *img = [NSImage imageNamed:@"fs_volume_slider_knob"];
648     image_rect.size = [img size];
649     image_rect.origin.x = 0;
650     image_rect.origin.y = 0;
651     knobRect.origin.x += (knobRect.size.width - image_rect.size.width) / 2;
652     knobRect.size.width = image_rect.size.width;
653     knobRect.size.height = image_rect.size.height;
654     [img drawInRect:knobRect fromRect:image_rect operation:NSCompositeSourceOver fraction:1];
655 }
656
657 - (void)drawRect:(NSRect)rect
658 {
659     /* Draw default to make sure the slider behaves correctly */
660     [[NSGraphicsContext currentContext] saveGraphicsState];
661     NSRectClip(NSZeroRect);
662     [super drawRect:rect];
663     [[NSGraphicsContext currentContext] restoreGraphicsState];
664     
665     NSRect knobRect = [[self cell] knobRectFlipped:NO];
666     knobRect.origin.y+=6;
667     [[[NSColor blackColor] colorWithAlphaComponent:0.6] set];
668     [self drawKnobInRect: knobRect];
669 }
670
671 @end
672