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
836dd5f6
Commit
836dd5f6
authored
Sep 02, 2012
by
David Fuhrmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
macosx: add scroll wheel support for progress and volume bar
parent
fc562ac8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
830 additions
and
2656 deletions
+830
-2656
extras/package/macosx/Resources/English.lproj/MainMenu.xib
extras/package/macosx/Resources/English.lproj/MainMenu.xib
+745
-2656
modules/gui/macosx/misc.h
modules/gui/macosx/misc.h
+11
-0
modules/gui/macosx/misc.m
modules/gui/macosx/misc.m
+74
-0
No files found.
extras/package/macosx/Resources/English.lproj/MainMenu.xib
View file @
836dd5f6
This source diff could not be displayed because it is too large. You can
view the blob
instead.
modules/gui/macosx/misc.h
View file @
836dd5f6
...
...
@@ -116,6 +116,17 @@
@end
/*****************************************************************************
* ProgressView
*****************************************************************************/
@interface
VLCProgressView
:
NSView
-
(
void
)
scrollWheel
:(
NSEvent
*
)
o_event
;
@end
/*****************************************************************************
* TimeLineSlider
*****************************************************************************/
...
...
modules/gui/macosx/misc.m
View file @
836dd5f6
...
...
@@ -28,6 +28,8 @@
#import "controls.h"
#import "CoreInteraction.h"
#import <CoreAudio/CoreAudio.h>
#import <vlc_keys.h>
/*****************************************************************************
* NSSound (VLCAdditions)
...
...
@@ -558,6 +560,48 @@ void _drawFrameInRect(NSRect frameRect)
@end
/*****************************************************************************
* ProgressView
*****************************************************************************/
@implementation
VLCProgressView
:
NSView
-
(
void
)
scrollWheel
:(
NSEvent
*
)
o_event
{
intf_thread_t
*
p_intf
=
VLCIntf
;
CGFloat
f_deltaY
=
[
o_event
deltaY
];
CGFloat
f_deltaX
=
[
o_event
deltaX
];
if
(
!
OSX_SNOW_LEOPARD
&&
[
o_event
isDirectionInvertedFromDevice
])
f_deltaX
=
-
f_deltaX
;
// optimisation, actually double invertion of f_deltaY here
else
f_deltaY
=
-
f_deltaY
;
// positive for left / down, negative otherwise
CGFloat
f_delta
=
f_deltaX
+
f_deltaY
;
CGFloat
f_abs
;
int
i_vlckey
;
if
(
f_delta
>
0
.
0
f
)
{
i_vlckey
=
ACTIONID_JUMP_BACKWARD_EXTRASHORT
;
f_abs
=
f_delta
;
}
else
{
i_vlckey
=
ACTIONID_JUMP_FORWARD_EXTRASHORT
;
f_abs
=
-
f_delta
;
}
for
(
NSUInteger
i
=
0
;
i
<
(
int
)(
f_abs
/
4
.
+
1
.)
&&
f_abs
>
0
.
05
;
i
++
)
var_SetInteger
(
p_intf
->
p_libvlc
,
"key-action"
,
i_vlckey
);
}
-
(
BOOL
)
acceptsFirstResponder
{
return
YES
;
}
@end
/*****************************************************************************
* TimeLineSlider
*****************************************************************************/
...
...
@@ -663,6 +707,35 @@ void _drawFrameInRect(NSRect frameRect)
[
self
drawKnobInRect
:
knobRect
];
}
-
(
void
)
scrollWheel
:(
NSEvent
*
)
o_event
{
intf_thread_t
*
p_intf
=
VLCIntf
;
CGFloat
f_deltaY
=
[
o_event
deltaY
];
CGFloat
f_deltaX
=
[
o_event
deltaX
];
if
(
!
OSX_SNOW_LEOPARD
&&
[
o_event
isDirectionInvertedFromDevice
])
f_deltaX
=
-
f_deltaX
;
// optimisation, actually double invertion of f_deltaY here
else
f_deltaY
=
-
f_deltaY
;
// positive for left / down, negative otherwise
CGFloat
f_delta
=
f_deltaX
+
f_deltaY
;
CGFloat
f_abs
;
int
i_vlckey
;
if
(
f_delta
>
0
.
0
f
)
{
i_vlckey
=
ACTIONID_VOL_DOWN
;
f_abs
=
f_delta
;
}
else
{
i_vlckey
=
ACTIONID_VOL_UP
;
f_abs
=
-
f_delta
;
}
for
(
NSUInteger
i
=
0
;
i
<
(
int
)(
f_abs
/
4
.
+
1
.)
&&
f_abs
>
0
.
05
;
i
++
)
var_SetInteger
(
p_intf
->
p_libvlc
,
"key-action"
,
i_vlckey
);
}
@end
/*****************************************************************************
...
...
@@ -765,6 +838,7 @@ void _drawFrameInRect(NSRect frameRect)
* VLCThreePartImageView interface
*****************************************************************************/
@implementation
VLCThreePartImageView
-
(
void
)
dealloc
{
[
o_left_img
release
];
...
...
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