Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
c3259248
Commit
c3259248
authored
Jun 18, 2013
by
Felix Paul Kühne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
macosx: add visual markers for 100% of the volume (refs #8628)
parent
338846d9
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
2 deletions
+41
-2
modules/gui/macosx/fspanel.h
modules/gui/macosx/fspanel.h
+3
-1
modules/gui/macosx/fspanel.m
modules/gui/macosx/fspanel.m
+4
-0
modules/gui/macosx/misc.h
modules/gui/macosx/misc.h
+6
-1
modules/gui/macosx/misc.m
modules/gui/macosx/misc.m
+28
-0
No files found.
modules/gui/macosx/fspanel.h
View file @
c3259248
...
...
@@ -78,6 +78,7 @@
@end
@class
VLCProgressView
;
@class
VLCFSVolumeSlider
;
@interface
VLCFSPanelView
:
NSView
{
...
...
@@ -85,7 +86,8 @@
NSButton
*
o_prev
,
*
o_next
,
*
o_bwd
,
*
o_fwd
,
*
o_play
,
*
o_fullscreen
;
NSTextField
*
o_streamTitle_txt
;
VLCTimeField
*
o_streamPosition_txt
,
*
o_streamLength_txt
;
NSSlider
*
o_fs_timeSlider
,
*
o_fs_volumeSlider
;
NSSlider
*
o_fs_timeSlider
;
VLCFSVolumeSlider
*
o_fs_volumeSlider
;
VLCProgressView
*
o_progress_view
;
NSImage
*
o_background_img
,
*
o_vol_sld_img
,
*
o_vol_mute_img
,
*
o_vol_max_img
,
*
o_time_sld_img
;
NSTimeInterval
last_fwd_event
;
...
...
modules/gui/macosx/fspanel.m
View file @
c3259248
...
...
@@ -459,6 +459,7 @@
[
o_fs_volumeSlider
setContinuous
:
YES
];
[
o_fs_volumeSlider
setTarget
:
self
];
[
o_fs_volumeSlider
setAction
:
@selector
(
fsVolumeSliderUpdate
:)];
[
o_fs_volumeSlider
setUsesBrightArtwork
:
YES
];
[[
o_fs_volumeSlider
cell
]
accessibilitySetOverrideValue
:
_NS
(
"Volume"
)
forAttribute
:
NSAccessibilityTitleAttribute
];
[[
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
];
[
self
addSubview
:
o_fs_volumeSlider
];
...
...
@@ -708,6 +709,7 @@
* VLCFSVolumeSlider
*****************************************************************************/
@implementation
VLCFSVolumeSlider
-
(
void
)
drawKnobInRect
:(
NSRect
)
knobRect
{
NSRect
image_rect
;
...
...
@@ -729,6 +731,8 @@
[
super
drawRect
:
rect
];
[[
NSGraphicsContext
currentContext
]
restoreGraphicsState
];
[
self
drawFullVolumeMarker
];
NSRect
knobRect
=
[[
self
cell
]
knobRectFlipped
:
NO
];
knobRect
.
origin
.
y
+=
7
.
5
;
[[[
NSColor
blackColor
]
colorWithAlphaComponent
:
0
.
6
]
set
];
...
...
modules/gui/macosx/misc.h
View file @
c3259248
/*****************************************************************************
* misc.h: code not specific to vlc
*****************************************************************************
* Copyright (C) 2003-201
2
VLC authors and VideoLAN
* Copyright (C) 2003-201
3
VLC authors and VideoLAN
* $Id$
*
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
...
...
@@ -121,8 +121,13 @@
*****************************************************************************/
@interface
VLCVolumeSliderCommon
:
NSSlider
{
BOOL
_usesBrightArtwork
;
}
@property
(
readwrite
,
nonatomic
)
BOOL
usesBrightArtwork
;
-
(
void
)
scrollWheel
:(
NSEvent
*
)
o_event
;
-
(
void
)
drawFullVolumeMarker
;
@end
...
...
modules/gui/macosx/misc.m
View file @
c3259248
...
...
@@ -511,6 +511,8 @@ void _drawFrameInRect(NSRect frameRect)
@implementation
VLCVolumeSliderCommon
:
NSSlider
@synthesize
usesBrightArtwork
=
_usesBrightArtwork
;
-
(
void
)
scrollWheel
:(
NSEvent
*
)
o_event
{
intf_thread_t
*
p_intf
=
VLCIntf
;
...
...
@@ -543,6 +545,30 @@ void _drawFrameInRect(NSRect frameRect)
}
}
-
(
void
)
drawFullVolumeMarker
{
NSRect
frame
=
[
self
frame
];
NSColor
*
drawingColor
;
if
(
_usesBrightArtwork
)
drawingColor
=
[[
NSColor
whiteColor
]
colorWithAlphaComponent
:.
8
];
else
drawingColor
=
[[
NSColor
blackColor
]
colorWithAlphaComponent
:.
6
];
NSBezierPath
*
bezierPath
=
[
NSBezierPath
bezierPath
];
float
fullVolPos
=
frame
.
size
.
width
/
2
.;
[
bezierPath
moveToPoint
:
NSMakePoint
(
fullVolPos
,
frame
.
size
.
height
-
3
.)];
[
bezierPath
lineToPoint
:
NSMakePoint
(
fullVolPos
,
3
.)];
[
bezierPath
closePath
];
bezierPath
.
lineWidth
=
1
.;
[
drawingColor
setStroke
];
[
bezierPath
stroke
];
[
drawingColor
setFill
];
[
bezierPath
fill
];
}
@end
/*****************************************************************************
...
...
@@ -584,6 +610,8 @@ void _drawFrameInRect(NSRect frameRect)
[
super
drawRect
:
rect
];
[[
NSGraphicsContext
currentContext
]
restoreGraphicsState
];
[
self
drawFullVolumeMarker
];
NSRect
knobRect
=
[[
self
cell
]
knobRectFlipped
:
NO
];
knobRect
.
origin
.
y
+=
2
;
[
self
drawKnobInRect
:
knobRect
];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment