This patch doesn't stop you from going above the limit using the hotkeys or the Apple Remote
#import <Cocoa/Cocoa.h>
#import "CompatibilityFixes.h"
+#import "misc.h"
@class VLCFSPanel;
IBOutlet id o_repeat_btn;
IBOutlet id o_shuffle_btn;
- IBOutlet id o_volume_sld;
+ IBOutlet VLCVolumeSliderCommon * o_volume_sld;
IBOutlet id o_volume_track_view;
IBOutlet id o_volume_down_btn;
IBOutlet id o_volume_up_btn;
[o_volume_down_btn setImage: [NSImage imageNamed:@"volume-low"]];
[o_volume_track_view setImage: [NSImage imageNamed:@"volume-slider-track"]];
[o_volume_up_btn setImage: [NSImage imageNamed:@"volume-high"]];
+ [o_volume_sld setUsesBrightArtwork: YES];
if (b_nativeFullscreenMode) {
[o_effects_btn setImage: [NSImage imageNamed:@"effects-one-button"]];
[o_volume_down_btn setImage: [NSImage imageNamed:@"volume-low_dark"]];
[o_volume_track_view setImage: [NSImage imageNamed:@"volume-slider-track_dark"]];
[o_volume_up_btn setImage: [NSImage imageNamed:@"volume-high_dark"]];
+ [o_volume_sld setUsesBrightArtwork: NO];
if (b_nativeFullscreenMode) {
[o_effects_btn setImage: [NSImage imageNamed:@"effects-one-button_dark"]];
BOOL b_mute = ![[VLCCoreInteraction sharedInstance] mute];
[o_volume_sld setEnabled: b_mute];
+ [o_volume_sld setMaxValue: [[VLCCoreInteraction sharedInstance] maxVolume]];
[o_volume_up_btn setEnabled: b_mute];
-
// remove fullscreen button for lion fullscreen
if (b_nativeFullscreenMode) {
NSRect frame;
}
+ (VLCCoreInteraction *)sharedInstance;
@property (readwrite) int volume;
+@property (readonly, nonatomic) float maxVolume;
@property (readwrite) int playbackRate;
@property (nonatomic, readwrite) BOOL aspectRatioIsLocked;
@property (readonly) int durationOfCurrentPlaylistItem;
return 0;
float volume = playlist_VolumeGet(pl_Get(p_intf));
+ NSLog(@"return vol %f", volume);
return lroundf(volume * AOUT_VOLUME_DEFAULT);
}
if (!p_intf)
return;
+ if (i_value >= self.maxVolume)
+ i_value = self.maxVolume;
+
float f_value = i_value / (float)AOUT_VOLUME_DEFAULT;
+ NSLog( @"set vol %f", f_value);
playlist_VolumeSet(pl_Get(p_intf), f_value);
}
+- (float)maxVolume
+{
+ return 1.2 * AOUT_VOLUME_DEFAULT;
+}
+
#pragma mark -
#pragma mark drag and drop support for VLCVoutView, VLBrushedMetalImageView and VLCThreePartDropView
- (BOOL)performDragOperation:(id <NSDraggingInfo>)sender
@interface VLCVolumeSliderCommon : NSSlider
{
BOOL _usesBrightArtwork;
+ CGFloat _maximumVolume;
}
@property (readwrite, nonatomic) BOOL usesBrightArtwork;
drawingColor = [[NSColor blackColor] colorWithAlphaComponent:.6];
NSBezierPath* bezierPath = [NSBezierPath bezierPath];
-
float fullVolPos = frame.size.width / 2.;
+
+ CGFloat maxAudioVol = self.maxValue / AOUT_VOLUME_DEFAULT;
+
+ if ((maxAudioVol - 1.) > 0)
+ fullVolPos += ((maxAudioVol - 1.) * 2000) / fullVolPos;
+
[bezierPath moveToPoint:NSMakePoint(fullVolPos, frame.size.height - 3.)];
[bezierPath lineToPoint:NSMakePoint(fullVolPos, 3.)];
[bezierPath closePath];