1 /*****************************************************************************
2 * fspanel.m: MacOS X full screen panel
3 *****************************************************************************
4 * Copyright (C) 2006-2013 VLC authors and VideoLAN
7 * Authors: Jérôme Decoodt <djc at videolan dot org>
8 * Felix Paul Kühne <fkuehne at videolan dot org>
9 * David Fuhrmann <david dot fuhrmann at googlemail dot com>
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
24 *****************************************************************************/
26 /*****************************************************************************
28 *****************************************************************************/
30 #import "CoreInteraction.h"
31 #import "MainWindow.h"
34 #import "CompatibilityFixes.h"
36 @interface VLCFSPanel ()
40 /*****************************************************************************
42 *****************************************************************************/
43 @implementation VLCFSPanel
44 /* We override this initializer so we can set the NSBorderlessWindowMask styleMask, and set a few other important settings */
45 - (id)initWithContentRect:(NSRect)contentRect
46 styleMask:(NSUInteger)aStyle
47 backing:(NSBackingStoreType)bufferingType
50 id win = [super initWithContentRect:contentRect styleMask:NSTexturedBackgroundWindowMask backing:bufferingType defer:flag];
52 [win setHasShadow: NO];
53 [win setBackgroundColor:[NSColor clearColor]];
54 if (!OSX_SNOW_LEOPARD)
55 [win setCollectionBehavior: NSWindowCollectionBehaviorFullScreenAuxiliary];
57 /* let the window sit on top of everything else and start out completely transparent */
58 [win setLevel:NSModalPanelWindowLevel];
59 i_device = config_GetInt(VLCIntf, "macosx-vdev");
60 hideAgainTimer = fadeTimer = nil;
61 [self setNonActive:nil];
67 [self setContentView:[[VLCFSPanelView alloc] initWithFrame: [self frame]]];
68 BOOL isInside = (NSPointInRect([NSEvent mouseLocation],[self frame]));
69 [[self contentView] addTrackingRect:[[self contentView] bounds] owner:self userData:nil assumeInside:isInside];
71 [self mouseEntered:NULL];
73 [self mouseExited:NULL];
75 if (!OSX_SNOW_LEOPARD)
76 [self setAnimationBehavior:NSWindowAnimationBehaviorNone];
78 /* get a notification if VLC isn't the active app anymore */
79 [[NSNotificationCenter defaultCenter]
81 selector: @selector(setNonActive:)
82 name: NSApplicationDidResignActiveNotification
85 /* Get a notification if VLC is the active app again.
86 Needed as becomeKeyWindow does not get called when window is activated by clicking */
87 [[NSNotificationCenter defaultCenter]
89 selector: @selector(setActive:)
90 name: NSApplicationDidBecomeActiveNotification
94 /* make sure that we don't become key, since we can't handle hotkeys */
95 - (BOOL)canBecomeKeyWindow
100 - (BOOL)mouseDownCanMoveWindow
107 [[NSNotificationCenter defaultCenter] removeObserver: self];
109 if (hideAgainTimer) {
110 [hideAgainTimer invalidate];
111 [hideAgainTimer release];
115 [o_vout_window release];
117 [self setFadeTimer:nil];
123 /* centre the panel in the lower third of the screen */
124 NSPoint theCoordinate;
125 NSRect theScreensFrame;
126 NSRect theWindowsFrame;
129 /* user-defined screen */
130 screen = [NSScreen screenWithDisplayID: (CGDirectDisplayID)i_device];
133 /* invalid preferences or none specified, using main screen */
134 screen = [NSScreen mainScreen];
136 theScreensFrame = [screen frame];
137 theWindowsFrame = [self frame];
139 theCoordinate.x = (theScreensFrame.size.width - theWindowsFrame.size.width) / 2 + theScreensFrame.origin.x;
140 theCoordinate.y = (theScreensFrame.size.height / 3) - theWindowsFrame.size.height + theScreensFrame.origin.y;
141 [self setFrameTopLeftPoint: theCoordinate];
146 [[self contentView] setPlay];
151 [[self contentView] setPause];
154 - (void)setStreamTitle:(NSString *)o_title
156 [[self contentView] setStreamTitle: o_title];
159 - (void)updatePositionAndTime
161 [[self contentView] updatePositionAndTime];
164 - (void)setSeekable:(BOOL) b_seekable
166 [[self contentView] setSeekable: b_seekable];
169 - (void)setVolumeLevel: (int)i_volumeLevel
171 [[self contentView] setVolumeLevel: i_volumeLevel];
174 - (void)setNonActive:(id)noData
178 /* here's fadeOut, just without visibly fading */
180 [self setAlphaValue:0.0];
181 [self setFadeTimer:nil];
185 [self orderOut: self];
188 - (void)setActive:(id)noData
192 [[VLCMain sharedInstance] showFullscreenController];
195 /* This routine is called repeatedly to fade in the window */
196 - (void)focus:(NSTimer *)timer
198 /* we need to push ourselves to front if the vout window was closed since our last display */
199 if (b_voutWasUpdated) {
200 [self orderFront: self];
201 b_voutWasUpdated = NO;
204 if ([self alphaValue] < 1.0) {
205 [self setAlphaValue:[self alphaValue]+0.1];
207 if ([self alphaValue] >= 1.0) {
209 [self setAlphaValue: 1.0];
210 [self setFadeTimer:nil];
213 [self setFadeTimer:[NSTimer scheduledTimerWithTimeInterval:0.1 target:self selector:@selector(unfocus:) userInfo:NULL repeats:YES]];
218 /* This routine is called repeatedly to hide the window */
219 - (void)unfocus:(NSTimer *)timer
224 [self setFadeTimer: NULL];
228 if ([self alphaValue] > 0.0) {
229 [self setAlphaValue:[self alphaValue]-0.05];
231 if ([self alphaValue] <= 0.05) {
233 [self setAlphaValue:0.0];
234 [self setFadeTimer:nil];
238 [NSTimer scheduledTimerWithTimeInterval:0.1
240 selector:@selector(focus:)
247 - (void)mouseExited:(NSEvent *)theEvent
249 /* give up our focus, so the vout may show us again without letting the user clicking it */
250 if (o_vout_window && var_GetBool(pl_Get(VLCIntf), "fullscreen"))
251 [o_vout_window makeKeyWindow];
256 [NSCursor setHiddenUntilMouseMoves: YES];
261 /* in case that the user don't want us to appear, make sure we hide the mouse */
263 if (!config_GetInt(VLCIntf, "macosx-fspanel")) {
264 float time = (float)var_CreateGetInteger(VLCIntf, "mouse-hide-timeout") / 1000.;
265 [self setFadeTimer:[NSTimer scheduledTimerWithTimeInterval:time target:self selector:@selector(hideMouse) userInfo:nil repeats:NO]];
272 [self orderFront: nil];
274 if ([self alphaValue] < 1.0 || b_displayed != YES) {
275 if (![self fadeTimer])
276 [self setFadeTimer:[NSTimer scheduledTimerWithTimeInterval:0.05 target:self selector:@selector(focus:) userInfo:@1 repeats:YES]];
277 else if ([[[self fadeTimer] userInfo] shortValue]==0)
285 if (NSPointInRect([NSEvent mouseLocation],[self frame]))
288 if (([self alphaValue] > 0.0)) {
289 if (![self fadeTimer])
290 [self setFadeTimer:[NSTimer scheduledTimerWithTimeInterval:0.05 target:self selector:@selector(unfocus:) userInfo:@0 repeats:YES]];
291 else if ([[[self fadeTimer] userInfo] shortValue]==1)
296 /* triggers a timer to autoHide us again after some seconds of no activity */
299 /* this will tell the timer to start over again or to start at all */
302 /* get us a valid timer */
303 if (!b_alreadyCounting) {
304 i_timeToKeepVisibleInSec = var_CreateGetInteger(VLCIntf, "mouse-hide-timeout") / 500;
305 if (hideAgainTimer) {
306 [hideAgainTimer invalidate];
307 [hideAgainTimer autorelease];
309 /* released in -autoHide and -dealloc */
310 hideAgainTimer = [[NSTimer scheduledTimerWithTimeInterval: 0.5
312 selector: @selector(keepVisible:)
314 repeats: YES] retain];
315 b_alreadyCounting = YES;
319 - (void)keepVisible:(NSTimer *)timer
321 /* if the user triggered an action, start over again */
325 /* count down until we hide ourselfes again and do so if necessary */
326 if (--i_timeToKeepVisibleInSec < 1) {
329 [hideAgainTimer invalidate]; /* released in -autoHide and -dealloc */
330 b_alreadyCounting = NO;
334 /* A getter and setter for our main timer that handles window fading */
335 - (NSTimer *)fadeTimer
340 - (void)setFadeTimer:(NSTimer *)timer
343 [fadeTimer invalidate];
344 [fadeTimer autorelease];
348 - (void)mouseDown:(NSEvent *)theEvent
350 mouseClic = [theEvent locationInWindow];
353 - (void)mouseDragged:(NSEvent *)theEvent
355 NSPoint point = [NSEvent mouseLocation];
356 point.x -= mouseClic.x;
357 point.y -= mouseClic.y;
358 [self setFrameOrigin:point];
361 - (void)setVoutWasUpdated: (VLCWindow *)o_window
363 b_voutWasUpdated = YES;
365 [o_vout_window release];
366 o_vout_window = [o_window retain];
367 int i_newdevice = (int)[[o_vout_window screen] displayID];
368 if ((i_newdevice != i_device && i_device != 0) || i_newdevice != [[self screen] displayID]) {
369 i_device = i_newdevice;
372 i_device = i_newdevice;
376 /*****************************************************************************
378 *****************************************************************************/
379 @implementation VLCFSPanelView
381 #define addButton(o_button, imageOff, imageOn, _x, _y, action, AXDesc, ToolTip) \
382 s_rc.origin.x = _x; \
383 s_rc.origin.y = _y; \
384 o_button = [[NSButton alloc] initWithFrame: s_rc]; \
385 [o_button setButtonType: NSMomentaryChangeButton]; \
386 [o_button setBezelStyle: NSRegularSquareBezelStyle]; \
387 [o_button setBordered: NO]; \
388 [o_button setFont:[NSFont systemFontOfSize:0]]; \
389 [o_button setImage:[NSImage imageNamed:imageOff]]; \
390 [o_button setAlternateImage:[NSImage imageNamed:imageOn]]; \
391 [o_button sizeToFit]; \
392 [o_button setTarget: self]; \
393 [o_button setAction: @selector(action:)]; \
394 [[o_button cell] accessibilitySetOverrideValue:AXDesc forAttribute:NSAccessibilityDescriptionAttribute]; \
395 [[o_button cell] accessibilitySetOverrideValue:ToolTip forAttribute:NSAccessibilityTitleAttribute]; \
396 [o_button setToolTip: ToolTip]; \
397 [self addSubview:o_button];
399 #define addTextfield(class, o_text, align, font, color) \
400 o_text = [[class alloc] initWithFrame: s_rc]; \
401 [o_text setDrawsBackground: NO]; \
402 [o_text setBordered: NO]; \
403 [o_text setEditable: NO]; \
404 [o_text setSelectable: NO]; \
405 [o_text setStringValue: _NS("(no item is being played)")]; \
406 [o_text setAlignment: align]; \
407 [o_text setTextColor: [NSColor color]]; \
408 [o_text setFont:[NSFont font:[NSFont smallSystemFontSize]]]; \
409 [self addSubview:o_text];
411 - (id)initWithFrame:(NSRect)frameRect
413 id view = [super initWithFrame:frameRect];
414 fillColor = [[NSColor clearColor] retain];
415 NSRect s_rc = [self frame];
416 addButton(o_prev, @"fs_skip_previous_highlight" , @"fs_skip_previous", 174, 15, prev, _NS("Click to go to the previous playlist item."), _NS("Previous"));
417 addButton(o_bwd, @"fs_rewind_highlight" , @"fs_rewind" , 211, 14, backward, _NS("Click and hold to skip backward through the current media."), _NS("Backward"));
418 addButton(o_play, @"fs_play_highlight" , @"fs_play" , 265, 10, play, _NS("Click to play or pause the current media."), _NS("Play/Pause"));
419 addButton(o_fwd, @"fs_forward_highlight" , @"fs_forward" , 313, 14, forward, _NS("Click and hold to skip forward through the current media."), _NS("Forward"));
420 addButton(o_next, @"fs_skip_next_highlight" , @"fs_skip_next" , 365, 15, next, _NS("Click to go to the next playlist item."), _NS("Next"));
421 addButton(o_fullscreen, @"fs_exit_fullscreen_highlight", @"fs_exit_fullscreen", 507, 13, toggleFullscreen, _NS("Click to exit fullscreen playback."), _NS("Toggle Fullscreen mode"));
423 addButton(o_button, @"image (off state)", @"image (on state)", 38, 51, something, accessibility help string, usual tool tip);
425 [o_fwd setContinuous:YES];
426 [o_bwd setContinuous:YES];
429 // (surrounding progress view for swipe behaviour)
432 s_rc.size.width = 518;
433 s_rc.size.height = 13;
434 o_progress_view = [[VLCProgressView alloc] initWithFrame: s_rc];
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 [[o_fs_volumeSlider cell] accessibilitySetOverrideValue:_NS("Position") forAttribute:NSAccessibilityTitleAttribute];
445 [[o_fs_timeSlider cell] accessibilitySetOverrideValue:_NS("Click and move the mouse while keeping the button pressed to use this slider to change current playback position.") forAttribute:NSAccessibilityDescriptionAttribute];
446 [self addSubview: o_progress_view];
447 [o_progress_view addSubview: o_fs_timeSlider];
453 s_rc.size.width = 95;
454 s_rc.size.height = 12;
455 o_fs_volumeSlider = [[VLCFSVolumeSlider alloc] initWithFrame: s_rc];
456 [o_fs_volumeSlider setMinValue:0];
457 [o_fs_volumeSlider setMaxValue: [[VLCCoreInteraction sharedInstance] maxVolume]];
458 [o_fs_volumeSlider setIntValue:AOUT_VOLUME_DEFAULT];
459 [o_fs_volumeSlider setContinuous: YES];
460 [o_fs_volumeSlider setTarget: self];
461 [o_fs_volumeSlider setAction: @selector(fsVolumeSliderUpdate:)];
462 [o_fs_volumeSlider setUsesBrightArtwork:NO];
463 [[o_fs_volumeSlider cell] accessibilitySetOverrideValue:_NS("Volume") forAttribute:NSAccessibilityTitleAttribute];
464 [[o_fs_volumeSlider cell] accessibilitySetOverrideValue:_NS("Click and move the mouse while keeping the button pressed to use this slider to change the volume.") forAttribute:NSAccessibilityDescriptionAttribute];
465 [self addSubview: o_fs_volumeSlider];
467 /* time counter and stream title output fields */
469 // 10 px gap between time fields
472 s_rc.size.width = 361;
473 s_rc.size.height = 14;
474 addTextfield(NSTextField, o_streamTitle_txt, NSCenterTextAlignment, systemFontOfSize, whiteColor);
477 s_rc.size.width = 65;
478 addTextfield(VLCTimeField, o_streamPosition_txt, NSLeftTextAlignment, systemFontOfSize, whiteColor);
481 s_rc.size.width = 65;
482 addTextfield(VLCTimeField, o_streamLength_txt, NSRightTextAlignment, systemFontOfSize, whiteColor);
483 [o_streamLength_txt setRemainingIdentifier: @"DisplayFullscreenTimeAsTimeRemaining"];
485 o_background_img = [[NSImage imageNamed:@"fs_background"] retain];
486 o_vol_sld_img = [[NSImage imageNamed:@"fs_volume_slider_bar"] retain];
487 o_vol_mute_img = [[NSImage imageNamed:@"fs_volume_mute_highlight"] retain];
488 o_vol_max_img = [[NSImage imageNamed:@"fs_volume_max_highlight"] retain];
489 o_time_sld_img = [[NSImage imageNamed:@"fs_time_slider"] retain];
496 [o_background_img release];
497 [o_vol_sld_img release];
498 [o_vol_mute_img release];
499 [o_vol_max_img release];
500 [o_time_sld_img release];
501 [o_fs_timeSlider release];
502 [o_fs_volumeSlider release];
508 [o_fullscreen release];
509 [o_streamTitle_txt release];
510 [o_streamPosition_txt release];
516 [o_play setImage:[NSImage imageNamed:@"fs_play_highlight"]];
517 [o_play setAlternateImage: [NSImage imageNamed:@"fs_play"]];
522 [o_play setImage: [NSImage imageNamed:@"fs_pause_highlight"]];
523 [o_play setAlternateImage: [NSImage imageNamed:@"fs_pause"]];
526 - (void)setStreamTitle:(NSString *)o_title
528 [o_streamTitle_txt setStringValue: o_title];
531 - (void)updatePositionAndTime
533 input_thread_t * p_input;
534 p_input = pl_CurrentInput(VLCIntf);
540 var_Get(p_input, "position", &pos);
541 f_updated = 10000. * pos.f_float;
542 [o_fs_timeSlider setFloatValue: f_updated];
545 char psz_time[MSTRTIME_MAX_SIZE];
547 var_Get(p_input, "time", &time);
548 mtime_t dur = input_item_GetDuration(input_GetItem(p_input));
550 // update total duration (right field)
552 [o_streamLength_txt setHidden: YES];
554 [o_streamLength_txt setHidden: NO];
556 NSString *o_total_time;
557 if ([o_streamLength_txt timeRemaining]) {
558 mtime_t remaining = 0;
559 if (dur > time.i_time)
560 remaining = dur - time.i_time;
561 o_total_time = [NSString stringWithFormat: @"-%s", secstotimestr(psz_time, (remaining / 1000000))];
563 o_total_time = @(secstotimestr(psz_time, (dur / 1000000)));
565 [o_streamLength_txt setStringValue: o_total_time];
568 // update current position (left field)
569 NSString *o_playback_pos = @(secstotimestr(psz_time, (time.i_time / 1000000)));
571 [o_streamPosition_txt setStringValue: o_playback_pos];
572 vlc_object_release(p_input);
574 [o_fs_timeSlider setFloatValue: 0.0];
575 [o_streamPosition_txt setStringValue: @"00:00"];
576 [o_streamLength_txt setHidden: YES];
581 - (void)setSeekable:(BOOL)b_seekable
583 [o_bwd setEnabled: b_seekable];
584 [o_fwd setEnabled: b_seekable];
585 [o_fs_timeSlider setEnabled: b_seekable];
588 - (void)setVolumeLevel: (int)i_volumeLevel
590 [o_fs_volumeSlider setIntValue: i_volumeLevel];
593 - (IBAction)play:(id)sender
595 [[VLCCoreInteraction sharedInstance] playOrPause];
598 - (IBAction)forward:(id)sender
600 if (([NSDate timeIntervalSinceReferenceDate] - last_fwd_event) > 0.16) {
601 // we just skipped 4 "continous" events, otherwise we are too fast
602 [[VLCCoreInteraction sharedInstance] forwardExtraShort];
603 last_fwd_event = [NSDate timeIntervalSinceReferenceDate];
607 - (IBAction)backward:(id)sender
609 if (([NSDate timeIntervalSinceReferenceDate] - last_bwd_event) > 0.16) {
610 // we just skipped 4 "continous" events, otherwise we are too fast
611 [[VLCCoreInteraction sharedInstance] backwardExtraShort];
612 last_bwd_event = [NSDate timeIntervalSinceReferenceDate];
616 - (IBAction)prev:(id)sender
618 [[VLCCoreInteraction sharedInstance] previous];
621 - (IBAction)next:(id)sender
623 [[VLCCoreInteraction sharedInstance] next];
626 - (IBAction)toggleFullscreen:(id)sender
628 [[VLCCoreInteraction sharedInstance] toggleFullscreen];
631 - (IBAction)fsTimeSliderUpdate:(id)sender
633 input_thread_t * p_input;
634 p_input = pl_CurrentInput(VLCIntf);
635 if (p_input != NULL) {
638 pos.f_float = [o_fs_timeSlider floatValue] / 10000.;
639 var_Set(p_input, "position", pos);
640 vlc_object_release(p_input);
642 [[VLCMain sharedInstance] updatePlaybackPosition];
645 - (IBAction)fsVolumeSliderUpdate:(id)sender
647 [[VLCCoreInteraction sharedInstance] setVolume: [sender intValue]];
650 #define addImage(image, _x, _y, mode) \
651 image_size = [image size]; \
652 image_rect.size = image_size; \
653 image_rect.origin.x = 0; \
654 image_rect.origin.y = 0; \
655 frame.origin.x = _x; \
656 frame.origin.y = _y; \
657 frame.size = image_size; \
658 [image drawInRect:frame fromRect:image_rect operation:mode fraction:1];
660 - (void)drawRect:(NSRect)rect
662 NSRect frame = [self frame];
666 addImage(o_background_img, 0, 0, NSCompositeCopy);
667 addImage(o_vol_sld_img, 26, 23, NSCompositeSourceOver);
668 addImage(o_vol_mute_img, 16, 18, NSCompositeSourceOver);
669 addImage(o_vol_max_img, 124, 18, NSCompositeSourceOver);
670 addImage(o_time_sld_img, 15, 45, NSCompositeSourceOver);
675 /*****************************************************************************
677 *****************************************************************************/
678 @implementation VLCFSTimeSlider
679 - (void)drawKnobInRect:(NSRect)knobRect
682 NSImage *img = [NSImage imageNamed:@"fs_time_slider_knob_highlight"];
683 image_rect.size = [img size];
684 image_rect.origin.x = 0;
685 image_rect.origin.y = 0;
686 knobRect.origin.x += (knobRect.size.width - image_rect.size.width) / 2;
687 knobRect.size.width = image_rect.size.width;
688 knobRect.size.height = image_rect.size.height;
689 [img drawInRect:knobRect fromRect:image_rect operation:NSCompositeSourceOver fraction:1];
692 - (void)drawRect:(NSRect)rect
694 /* Draw default to make sure the slider behaves correctly */
695 [[NSGraphicsContext currentContext] saveGraphicsState];
696 NSRectClip(NSZeroRect);
697 [super drawRect:rect];
698 [[NSGraphicsContext currentContext] restoreGraphicsState];
700 NSRect knobRect = [[self cell] knobRectFlipped:NO];
701 knobRect.origin.y+=4;
702 [[[NSColor blackColor] colorWithAlphaComponent:0.6] set];
703 [self drawKnobInRect: knobRect];
708 /*****************************************************************************
710 *****************************************************************************/
711 @implementation VLCFSVolumeSlider
713 - (void)drawKnobInRect:(NSRect) knobRect
716 NSImage *img = [NSImage imageNamed:@"fs_volume_slider_knob_highlight"];
717 image_rect.size = [img size];
718 image_rect.origin.x = 0;
719 image_rect.origin.y = 0;
720 knobRect.origin.x += (knobRect.size.width - image_rect.size.width) / 2;
721 knobRect.size.width = image_rect.size.width;
722 knobRect.size.height = image_rect.size.height;
723 [img drawInRect:knobRect fromRect:image_rect operation:NSCompositeSourceOver fraction:1];
726 - (void)drawRect:(NSRect)rect
728 /* Draw default to make sure the slider behaves correctly */
729 [[NSGraphicsContext currentContext] saveGraphicsState];
730 NSRectClip(NSZeroRect);
731 [super drawRect:rect];
732 [[NSGraphicsContext currentContext] restoreGraphicsState];
734 [self drawFullVolumeMarker];
736 NSRect knobRect = [[self cell] knobRectFlipped:NO];
737 knobRect.origin.y+=7.5;
738 [[[NSColor blackColor] colorWithAlphaComponent:0.6] set];
739 [self drawKnobInRect: knobRect];
742 - (void)drawFullVolBezierPath:(NSBezierPath*)bezierPath
744 CGFloat fullVolPos = [self fullVolumePos];
745 [bezierPath moveToPoint:NSMakePoint(fullVolPos, [self frame].size.height)];
746 [bezierPath lineToPoint:NSMakePoint(fullVolPos, 1.)];