add various ndspGet* methods

This commit is contained in:
TurtleP 2022-08-28 14:01:37 -04:00
parent 59cf50c201
commit 43848d4f06
2 changed files with 113 additions and 0 deletions

View File

@ -118,24 +118,48 @@ u32 ndspGetFrameCount(void);
*/
void ndspSetMasterVol(float volume);
/**
* @brief Gets the master volume.
* @return The master volume.
*/
void ndspGetMasterVol(void);
/**
* @brief Sets the output mode.
* @param mode Output mode to set. Defaults to NDSP_OUTPUT_STEREO.
*/
void ndspSetOutputMode(ndspOutputMode mode);
/**
* @brief Gets the output mode.
* @return The output mode.
*/
ndspOutputMode ndspGetOutputMode(void);
/**
* @brief Sets the clipping mode.
* @param mode Clipping mode to set. Defaults to NDSP_CLIP_SOFT.
*/
void ndspSetClippingMode(ndspClippingMode mode);
/**
* @brief Gets the clipping mode.
* @return The clipping mode.
*/
ndspClippingMode ndspGetClippingMode(void);
/**
* @brief Sets the output count.
* @param count Output count to set. Defaults to 2.
*/
void ndspSetOutputCount(int count);
/**
* @brief Gets the output count.
* @return The output count.
*/
int ndspGetOutputCount(void);
/**
* @brief Sets the wave buffer to capture audio to.
* @param capture Wave buffer to capture to.
@ -158,17 +182,35 @@ void ndspSetCallback(ndspCallback callback, void* data);
*/
void ndspSurroundSetDepth(u16 depth);
/**
* @brief Gets the surround sound depth.
* @return The surround sound depth.
*/
u16 ndspSurroundGetDepth(void);
/**
* @brief Sets the surround sound position.
* @param pos Position to set. Defaults to NDSP_SPKPOS_SQUARE.
*/
void ndspSurroundSetPos(ndspSpeakerPos pos);
/**
* @brief Gets the surround sound position.
* @return The surround sound speaker position.
*/
ndspSpeakerPos ndspSurroundGetPos(void);
/**
* @brief Sets the surround sound rear ratio.
* @param ratio Rear ratio to set. Defaults to 0x8000.
*/
void ndspSurroundSetRearRatio(u16 ratio);
/**
* @brief Gets the surround sound rear ratio.
* @return The rear ratio.
*/
u16 ndspSurroundGetRearRatio(void);
///@}
///@name Auxiliary output
@ -180,6 +222,13 @@ void ndspSurroundSetRearRatio(u16 ratio);
*/
void ndspAuxSetEnable(int id, bool enable);
/**
* @brief Gets whether auxiliary output is enabled.
* @param id ID of the auxiliary output.
* @return Whether auxiliary output is enabled.
*/
bool ndspAuxIsEnabled(int id);
/**
* @brief Configures whether an auxiliary output should use front bypass.
* @param id ID of the auxiliary output.
@ -187,6 +236,13 @@ void ndspAuxSetEnable(int id, bool enable);
*/
void ndspAuxSetFrontBypass(int id, bool bypass);
/**
* @brief Gets whether auxiliary output front bypass is enabled.
* @param id ID of the auxiliary output.
* @return Whether auxiliary output front bypass is enabled.
*/
bool ndspAuxGetFrontBypass(int id);
/**
* @brief Sets the volume of an auxiliary output.
* @param id ID of the auxiliary output.
@ -194,6 +250,13 @@ void ndspAuxSetFrontBypass(int id, bool bypass);
*/
void ndspAuxSetVolume(int id, float volume);
/**
* @brief Gets the volume of an auxiliary output.
* @param id ID of the auxiliary output.
* @return Volume of the auxiliary output.
*/
float ndspAuxGetVolume(int id);
/**
* @brief Sets the callback of an auxiliary output.
* @param id ID of the auxiliary output.

View File

@ -612,6 +612,11 @@ void ndspSetMasterVol(float volume)
LightLock_Unlock(&ndspMaster.lock);
}
void ndspGetMasterVol(void)
{
return ndspMaster.masterVol;
}
void ndspSetOutputMode(ndspOutputMode mode)
{
LightLock_Lock(&ndspMaster.lock);
@ -620,6 +625,11 @@ void ndspSetOutputMode(ndspOutputMode mode)
LightLock_Unlock(&ndspMaster.lock);
}
ndspOutputMode ndspGetOutputMode(void)
{
return ndspMaster.outputMode;
}
void ndspSetClippingMode(ndspClippingMode mode)
{
LightLock_Lock(&ndspMaster.lock);
@ -628,6 +638,11 @@ void ndspSetClippingMode(ndspClippingMode mode)
LightLock_Unlock(&ndspMaster.lock);
}
ndspClippingMode ndspGetClippingMode(void)
{
return ndspMaster.clippingMode;
}
void ndspSetOutputCount(int count)
{
LightLock_Lock(&ndspMaster.lock);
@ -636,6 +651,11 @@ void ndspSetOutputCount(int count)
LightLock_Unlock(&ndspMaster.lock);
}
int ndspGetOutputCount(void)
{
return ndspMaster.outputCount;
}
void ndspSetCapture(ndspWaveBuf* capture)
{
ndspMaster.capture = capture;
@ -655,6 +675,11 @@ void ndspSurroundSetDepth(u16 depth)
LightLock_Unlock(&ndspMaster.lock);
}
u16 ndspSurroundGetDepth(void)
{
return ndspMaster.surround.depth;
}
void ndspSurroundSetPos(ndspSpeakerPos pos)
{
LightLock_Lock(&ndspMaster.lock);
@ -663,6 +688,11 @@ void ndspSurroundSetPos(ndspSpeakerPos pos)
LightLock_Unlock(&ndspMaster.lock);
}
ndspSpeakerPos ndspSurroundGetPos(void)
{
return ndspMaster.surround.pos;
}
void ndspSurroundSetRearRatio(u16 ratio)
{
LightLock_Lock(&ndspMaster.lock);
@ -671,6 +701,11 @@ void ndspSurroundSetRearRatio(u16 ratio)
LightLock_Unlock(&ndspMaster.lock);
}
u16 ndspSurroundGetRearRatio(void)
{
return ndspMaster.surround.rearRatio;
}
void ndspAuxSetEnable(int id, bool enable)
{
LightLock_Lock(&ndspMaster.lock);
@ -679,6 +714,11 @@ void ndspAuxSetEnable(int id, bool enable)
LightLock_Unlock(&ndspMaster.lock);
}
bool ndspAuxIsEnabled(int id)
{
return ndspMaster.aux[id].enable;
}
void ndspAuxSetFrontBypass(int id, bool bypass)
{
LightLock_Lock(&ndspMaster.lock);
@ -687,6 +727,11 @@ void ndspAuxSetFrontBypass(int id, bool bypass)
LightLock_Unlock(&ndspMaster.lock);
}
bool ndspGetFrontBypass(int id)
{
return ndspMaster.aux[id].frontBypass;
}
void ndspAuxSetVolume(int id, float volume)
{
LightLock_Lock(&ndspMaster.lock);
@ -695,6 +740,11 @@ void ndspAuxSetVolume(int id, float volume)
LightLock_Unlock(&ndspMaster.lock);
}
float ndspAuxGetVolume(int id)
{
return ndspMaster.aux[id].volume;
}
void ndspAuxSetCallback(int id, ndspAuxCallback callback, void* data)
{
ndspMaster.aux[id].callback = callback;