mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-21 12:32:40 +02:00
add remaining IAudioOut commands (#393)
This commit is contained in:
parent
77022a6d11
commit
7dbb90ee66
@ -51,6 +51,17 @@ Result audoutAppendAudioOutBuffer(AudioOutBuffer *Buffer);
|
||||
Result audoutGetReleasedAudioOutBuffer(AudioOutBuffer **Buffer, u32 *ReleasedBuffersCount);
|
||||
Result audoutContainsAudioOutBuffer(AudioOutBuffer *Buffer, bool *ContainsBuffer);
|
||||
|
||||
/// Only available with [4.0.0+].
|
||||
Result audoutGetAudioOutBufferCount(u32 *count);
|
||||
/// Only available with [4.0.0+].
|
||||
Result audoutGetAudioOutPlayedSampleCount(u64 *count);
|
||||
/// Only available with [4.0.0+].
|
||||
Result audoutFlushAudioOutBuffers(bool *flushed);
|
||||
/// Only available with [6.0.0+].
|
||||
Result audoutSetAudioOutVolume(float volume);
|
||||
/// Only available with [6.0.0+].
|
||||
Result audoutGetAudioOutVolume(float *volume);
|
||||
|
||||
/**
|
||||
* @brief Submits an audio sample data buffer for playing and waits for it to finish playing.
|
||||
* @brief Uses \ref audoutAppendAudioOutBuffer and \ref audoutWaitPlayFinish internally.
|
||||
|
@ -220,3 +220,41 @@ Result audoutContainsAudioOutBuffer(AudioOutBuffer *Buffer, bool *ContainsBuffer
|
||||
if (R_SUCCEEDED(rc) && ContainsBuffer) *ContainsBuffer = out & 1;
|
||||
return rc;
|
||||
}
|
||||
|
||||
Result audoutGetAudioOutBufferCount(u32 *count) {
|
||||
if (hosversionBefore(4,0,0))
|
||||
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
|
||||
|
||||
return serviceDispatchOut(&g_audoutIAudioOut, 9, *count);
|
||||
}
|
||||
|
||||
Result audoutGetAudioOutPlayedSampleCount(u64 *count) {
|
||||
if (hosversionBefore(4,0,0))
|
||||
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
|
||||
|
||||
return serviceDispatchOut(&g_audoutIAudioOut, 10, *count);
|
||||
}
|
||||
|
||||
Result audoutFlushAudioOutBuffers(bool *flushed) {
|
||||
if (hosversionBefore(4,0,0))
|
||||
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
|
||||
|
||||
u8 out=0;
|
||||
Result rc = serviceDispatchOut(&g_audoutIAudioOut, 11, out);
|
||||
if (R_SUCCEEDED(rc) && flushed) *flushed = out & 1;
|
||||
return rc;
|
||||
}
|
||||
|
||||
Result audoutSetAudioOutVolume(float volume) {
|
||||
if (hosversionBefore(6,0,0))
|
||||
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
|
||||
|
||||
return serviceDispatchIn(&g_audoutIAudioOut, 12, volume);
|
||||
}
|
||||
|
||||
Result audoutGetAudioOutVolume(float *volume) {
|
||||
if (hosversionBefore(6,0,0))
|
||||
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
|
||||
|
||||
return serviceDispatchOut(&g_audoutIAudioOut, 13, *volume);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user