mirror of
https://github.com/switchbrew/libnx.git
synced 2025-07-03 18:12:14 +02:00
add version checks and annotation
This commit is contained in:
parent
0bf03cee4f
commit
cb2905c8ea
@ -50,10 +50,16 @@ 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);
|
||||
|
||||
/**
|
||||
|
@ -222,14 +222,23 @@ Result audoutContainsAudioOutBuffer(AudioOutBuffer *Buffer, bool *ContainsBuffer
|
||||
}
|
||||
|
||||
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;
|
||||
@ -237,9 +246,15 @@ Result audoutFlushAudioOutBuffers(bool *flushed) {
|
||||
}
|
||||
|
||||
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