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
9fa00260
Commit
9fa00260
authored
Oct 10, 2009
by
Felix Paul Kühne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
osx/framework: added convience methods for volume up/down
parent
967a86e5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
4 deletions
+31
-4
projects/macosx/framework/Headers/Public/VLCAudio.h
projects/macosx/framework/Headers/Public/VLCAudio.h
+3
-0
projects/macosx/framework/Sources/VLCAudio.m
projects/macosx/framework/Sources/VLCAudio.m
+28
-4
No files found.
projects/macosx/framework/Headers/Public/VLCAudio.h
View file @
9fa00260
...
...
@@ -45,4 +45,7 @@ extern NSString * VLCMediaPlayerVolumeChanged;
@property
(
setter
=
setMute
:
)
BOOL
isMuted
;
@property
(
assign
)
int
volume
;
-
(
void
)
volumeDown
;
-
(
void
)
volumeUp
;
@end
projects/macosx/framework/Sources/VLCAudio.m
View file @
9fa00260
...
...
@@ -25,6 +25,10 @@
#import "VLCAudio.h"
#import "VLCLibVLCBridging.h"
#define VOLUME_STEP 6
#define VOLUME_MAX 200
#define VOLUME_MIN 0
/* Notification Messages */
NSString
*
VLCMediaPlayerVolumeChanged
=
@"VLCMediaPlayerVolumeChanged"
;
...
...
@@ -60,13 +64,33 @@ NSString * VLCMediaPlayerVolumeChanged = @"VLCMediaPlayerVolumeChanged";
-
(
void
)
setVolume
:(
int
)
value
{
if
(
value
<
0
)
value
=
0
;
else
if
(
value
>
200
)
value
=
200
;
if
(
value
<
VOLUME_MIN
)
value
=
VOLUME_MIN
;
else
if
(
value
>
VOLUME_MAX
)
value
=
VOLUME_MAX
;
libvlc_audio_set_volume
([
library
instance
],
value
,
NULL
);
}
-
(
void
)
volumeUp
{
int
tempVolume
=
[
self
volume
]
+
VOLUME_STEP
;
if
(
tempVolume
>
VOLUME_MAX
)
tempVolume
=
VOLUME_MAX
;
else
if
(
tempVolume
<
VOLUME_MIN
)
tempVolume
=
VOLUME_MIN
;
[
self
setVolume
:
tempVolume
];
}
-
(
void
)
volumeDown
{
int
tempVolume
=
[
self
volume
]
-
VOLUME_STEP
;
if
(
tempVolume
>
VOLUME_MAX
)
tempVolume
=
VOLUME_MAX
;
else
if
(
tempVolume
<
VOLUME_MIN
)
tempVolume
=
VOLUME_MIN
;
[
self
setVolume
:
tempVolume
];
}
-
(
int
)
volume
{
return
libvlc_audio_get_volume
([
library
instance
]);
...
...
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