Commit 4877c42e authored by Felix Paul Kühne's avatar Felix Paul Kühne

VLCAudio: add passthrough property (closes #17)

parent 642d74e2
......@@ -46,6 +46,11 @@ extern NSString *const VLCMediaPlayerVolumeChanged;
* \note This is a NO-OP on iOS and tvOS */
@property (assign) int volume;
/**
* enable passthrough mode for the current audio device
* \note There is no warrenty that it succeeds as it depends on the capabilities of the hardware audio decoder / receiver attached by the user */
@property (readwrite) BOOL passthrough;
/**
* Mute the current audio output.
* \deprecated This selector will be removed in the next release */
......
......@@ -44,7 +44,6 @@ New APIs:
(int)currentTitleIndex
(int)currentAudioTrackIndex
- VLCMedia
- added keys: VLCMetaInformationTrackTotal, VLCMetaInformationDirector,
VLCMetaInformationSeason, VLCMetaInformationEpisode,
......@@ -68,6 +67,9 @@ New APIs:
- added selectors: isEqual:
hash
- VLCAudio
- added property: passthrough
Deprecated APIs:
- VLCAudio
- setMute:
......
......@@ -86,6 +86,28 @@ NSString *const VLCMediaPlayerVolumeChanged = @"VLCMediaPlayerVolumeChanged";
return libvlc_audio_get_mute([self instance]);
}
- (void)setPassthrough:(BOOL)passthrough
{
if (passthrough) {
libvlc_audio_output_device_set([self instance], NULL, "encoded");
} else {
libvlc_audio_output_device_set([self instance], NULL, "pcm");
}
}
- (BOOL)passthrough
{
char *deviceIdentifier = libvlc_audio_output_device_get([self instance]);
if (deviceIdentifier != NULL) {
if (!strcmp(deviceIdentifier, "encoded")) {
return YES;
}
free(deviceIdentifier);
}
return NO;
}
- (void)setVolume:(int)value
{
if (value < VOLUME_MIN)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment