From e1652533a10b9c7b24e61f208d5f3b8c36aa80eb Mon Sep 17 00:00:00 2001 From: capitalistspz Date: Tue, 3 Mar 2026 16:43:50 +0000 Subject: [PATCH 1/2] padscore: Make `WENCGetEncodeData` take an enum arg Because only 0 and 1 are valid values --- include/padscore/wpad.h | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/include/padscore/wpad.h b/include/padscore/wpad.h index 5d55dce21..1d657c4f4 100644 --- a/include/padscore/wpad.h +++ b/include/padscore/wpad.h @@ -394,6 +394,15 @@ typedef enum WPADBalanceBoardCmd WPAD_BALANCE_BOARD_CMD_ON = 0xAA, } WPADBalanceBoardCmd; +//! Encoding mode +typedef enum WENCMode +{ + //! Start encoding with new parameters + WENC_MODE_NEW = 0, + //! Use prior encoding parameters + WENC_MODE_CONTINUE = 1 +} + //! 2D vector. struct WPADVec2D { @@ -908,7 +917,7 @@ WPADSendStreamData(WPADChan channel, /** * Encode 16-bit LPCM as 4-bit Yamaha ADPCM * \param params encoding continuation params, written on first call, and read and updated on each subsequent call - * \param continuing should be TRUE if continuing encoding stream with the params produced via a prior call + * \param mode should be WENC_MODE_CONTINUE if continuing encoding stream with the params produced via a prior call * \param [in] samples 16-bit LPCM sample buffer * \param sampleCount number of 16-bit LPCM samples * \param [out] outEncodedData buffer for the returned ADPCM samples, size should be {(sampleCount + 1) / 2} @@ -919,7 +928,7 @@ WPADSendStreamData(WPADChan channel, */ uint32_t WENCGetEncodeData(WENCParams *params, - BOOL continuing, + WENCMode mode, const int16_t *samples, uint32_t sampleCount, uint8_t *outEncodedData); From 6007443dbdc201e2738b3bd7e3fed568d9699dd2 Mon Sep 17 00:00:00 2001 From: capitalistspz Date: Tue, 3 Mar 2026 17:09:49 +0000 Subject: [PATCH 2/2] typedef correction --- include/padscore/wpad.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/padscore/wpad.h b/include/padscore/wpad.h index 1d657c4f4..776740246 100644 --- a/include/padscore/wpad.h +++ b/include/padscore/wpad.h @@ -401,7 +401,7 @@ typedef enum WENCMode WENC_MODE_NEW = 0, //! Use prior encoding parameters WENC_MODE_CONTINUE = 1 -} +} WENCMode; //! 2D vector. struct WPADVec2D