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