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
53d2132c
Commit
53d2132c
authored
Feb 02, 2010
by
Pierre d'Herbemont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
macosx/framework: VLCAudio now use a media_player. Cool.
parent
812707a1
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
35 additions
and
17 deletions
+35
-17
projects/macosx/framework/Headers/Internal/VLCLibVLCBridging.h
...cts/macosx/framework/Headers/Internal/VLCLibVLCBridging.h
+3
-3
projects/macosx/framework/Headers/Public/VLCAudio.h
projects/macosx/framework/Headers/Public/VLCAudio.h
+3
-3
projects/macosx/framework/Headers/Public/VLCMediaPlayer.h
projects/macosx/framework/Headers/Public/VLCMediaPlayer.h
+1
-0
projects/macosx/framework/Sources/VLCAudio.m
projects/macosx/framework/Sources/VLCAudio.m
+24
-10
projects/macosx/framework/Sources/VLCMediaPlayer.m
projects/macosx/framework/Sources/VLCMediaPlayer.m
+4
-1
No files found.
projects/macosx/framework/Headers/Internal/VLCLibVLCBridging.h
View file @
53d2132c
...
...
@@ -147,10 +147,10 @@ extern void __catch_exception( void * e, const char * function, const char * fil
@interface
VLCAudio
(
VLCAudioBridging
)
/* Initializers */
/**
* Initializes a new object using the specified
library
instance.
* \return Newly created audio object using specified VLC
Library
instance.
* Initializes a new object using the specified
mediaPlayer
instance.
* \return Newly created audio object using specified VLC
MediaPlayer
instance.
*/
-
(
id
)
initWith
Library
:(
VLCLibrary
*
)
library
;
-
(
id
)
initWith
MediaPlayer
:(
VLCMediaPlayer
*
)
mediaPlayer
;
@end
/**
...
...
projects/macosx/framework/Headers/Public/VLCAudio.h
View file @
53d2132c
...
...
@@ -28,14 +28,14 @@
*/
extern
NSString
*
VLCMediaPlayerVolumeChanged
;
@class
VLC
Library
;
@class
VLC
MediaPlayer
;
/**
* TODO: Documentation VLCAudio
*/
@interface
VLCAudio
:
NSObject
{
VLCLibrary
*
library
;
//< Library to control audio for
void
*
instance
;
}
/* Properties */
...
...
projects/macosx/framework/Headers/Public/VLCMediaPlayer.h
View file @
53d2132c
...
...
@@ -86,6 +86,7 @@ extern NSString * VLCMediaPlayerStateToString(VLCMediaPlayerState state);
VLCMediaPlayerState
cachedState
;
//< Cached state of the media being played
float
position
;
//< The position of the media being played
id
drawable
;
//< The drawable associated to this media player
VLCAudio
*
audio
;
}
/* Initializers */
...
...
projects/macosx/framework/Sources/VLCAudio.m
View file @
53d2132c
...
...
@@ -35,31 +35,45 @@ NSString * VLCMediaPlayerVolumeChanged = @"VLCMediaPlayerVolumeChanged";
/* libvlc event callback */
// TODO: Callbacks
@implementation
VLCAudio
/**
* Use this method instead of instance directly as this one is type checked.
*/
-
(
libvlc_media_player_t
*
)
instance
{
return
instance
;
}
-
(
id
)
init
{
return
nil
;
}
-
(
id
)
initWith
Library
:(
VLCLibrary
*
)
aLibrary
-
(
id
)
initWith
MediaPlayer
:(
VLCMediaPlayer
*
)
mediaPlayer
{
if
(
!
[
library
audio
]
&&
(
self
=
[
super
init
]))
{
library
=
aLibrary
;
[
library
setAudio
:
self
];
}
self
=
[
super
init
];
if
(
!
self
)
return
nil
;
instance
=
[
mediaPlayer
libVLCMediaPlayer
];
libvlc_media_player_retain
([
self
instance
]);
return
self
;
}
-
(
void
)
dealloc
{
libvlc_media_player_release
([
self
instance
]);
[
super
dealloc
];
}
-
(
void
)
setMute
:(
BOOL
)
value
{
libvlc_audio_set_mute
([
library
instance
],
value
);
libvlc_audio_set_mute
([
self
instance
],
value
);
}
-
(
BOOL
)
isMuted
{
return
libvlc_audio_get_mute
([
library
instance
]);
return
libvlc_audio_get_mute
([
self
instance
]);
}
-
(
void
)
setVolume
:(
NSUInteger
)
value
...
...
@@ -68,7 +82,7 @@ NSString * VLCMediaPlayerVolumeChanged = @"VLCMediaPlayerVolumeChanged";
value
=
VOLUME_MIN
;
else
if
(
value
>
VOLUME_MAX
)
value
=
VOLUME_MAX
;
libvlc_audio_set_volume
([
library
instance
],
value
);
libvlc_audio_set_volume
([
self
instance
],
value
);
}
-
(
void
)
volumeUp
...
...
@@ -93,6 +107,6 @@ NSString * VLCMediaPlayerVolumeChanged = @"VLCMediaPlayerVolumeChanged";
-
(
NSUInteger
)
volume
{
return
libvlc_audio_get_volume
([
library
instance
]);
return
libvlc_audio_get_volume
([
self
instance
]);
}
@end
projects/macosx/framework/Sources/VLCMediaPlayer.m
View file @
53d2132c
...
...
@@ -225,6 +225,7 @@ static void HandleMediaPlayerMediaChanged(const libvlc_event_t * event, void * s
[
cachedTime
release
];
[
cachedRemainingTime
release
];
[
drawable
release
];
[
audio
release
];
[
super
dealloc
];
}
...
...
@@ -262,7 +263,9 @@ static void HandleMediaPlayerMediaChanged(const libvlc_event_t * event, void * s
-
(
VLCAudio
*
)
audio
{
return
[[
VLCLibrary
sharedLibrary
]
audio
];
if
(
!
audio
)
audio
=
[[
VLCAudio
alloc
]
initWithMediaPlayer
:
self
];
return
audio
;
}
#pragma mark -
...
...
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