From 41271d632b74f5cf47c30d3b699eb6b2786f2136 Mon Sep 17 00:00:00 2001 From: inmarket Date: Sat, 23 Jun 2018 13:02:07 +1000 Subject: Added new type definitions - moving towards V3.0 --- src/gaudio/gaudio.c | 22 +++++++++++----------- src/gaudio/gaudio.h | 28 ++++++++++------------------ src/gaudio/gaudio_driver_play.h | 10 +++++----- src/gaudio/gaudio_driver_record.h | 4 ++-- 4 files changed, 28 insertions(+), 36 deletions(-) (limited to 'src/gaudio') diff --git a/src/gaudio/gaudio.c b/src/gaudio/gaudio.c index a9f20357..8311d8cb 100644 --- a/src/gaudio/gaudio.c +++ b/src/gaudio/gaudio.c @@ -76,13 +76,13 @@ void _gaudioDeinit(void) #if GAUDIO_NEED_PLAY - bool_t gaudioPlayInit(uint16_t channel, uint32_t frequency, ArrayDataFormat format) { + gBool gaudioPlayInit(uint16_t channel, uint32_t frequency, ArrayDataFormat format) { gaudioPlayStop(); playFlags &= ~PLAYFLG_ISINIT; if (!gaudio_play_lld_init(channel, frequency, format)) - return FALSE; + return gFalse; playFlags |= PLAYFLG_ISINIT; - return TRUE; + return gTrue; } void gaudioPlay(GDataBuffer *pd) { @@ -115,13 +115,13 @@ void _gaudioDeinit(void) gfxBufferRelease(pd); } - bool_t gaudioPlaySetVolume(uint8_t vol) { + gBool gaudioPlaySetVolume(uint8_t vol) { return gaudio_play_lld_set_volume(vol); } - bool_t gaudioPlayWait(delaytime_t ms) { + gBool gaudioPlayWait(delaytime_t ms) { if (!(playFlags & PLAYFLG_PLAYING)) - return TRUE; + return gTrue; return gfxSemWait(&playComplete, ms); } @@ -152,7 +152,7 @@ void _gaudioDeinit(void) GSourceHandle gaudioPlayGetSource(void) { if (!gtimerIsActive(&playTimer)) - gtimerStart(&playTimer, PlayTimerCallback, 0, TRUE, TIME_INFINITE); + gtimerStart(&playTimer, PlayTimerCallback, 0, gTrue, TIME_INFINITE); playFlags |= PLAYFLG_USEEVENTS; return (GSourceHandle)&playTimer; } @@ -185,13 +185,13 @@ void _gaudioDeinit(void) #endif #if GAUDIO_NEED_RECORD - bool_t gaudioRecordInit(uint16_t channel, uint32_t frequency, ArrayDataFormat format) { + gBool gaudioRecordInit(uint16_t channel, uint32_t frequency, ArrayDataFormat format) { gaudioRecordStop(); recordFlags &= ~RECORDFLG_ISINIT; if (!gaudio_record_lld_init(channel, frequency, format)) - return FALSE; + return gFalse; recordFlags |= RECORDFLG_ISINIT; - return TRUE; + return gTrue; } void gaudioRecordStart(void) { @@ -245,7 +245,7 @@ void _gaudioDeinit(void) GSourceHandle gaudioRecordGetSource(void) { if (!gtimerIsActive(&recordTimer)) - gtimerStart(&recordTimer, RecordTimerCallback, 0, TRUE, TIME_INFINITE); + gtimerStart(&recordTimer, RecordTimerCallback, 0, gTrue, TIME_INFINITE); recordFlags |= RECORDFLG_USEEVENTS; return (GSourceHandle)&recordTimer; } diff --git a/src/gaudio/gaudio.h b/src/gaudio/gaudio.h index 7473373c..a318bab5 100644 --- a/src/gaudio/gaudio.h +++ b/src/gaudio/gaudio.h @@ -93,15 +93,11 @@ /* External declarations. */ /*===========================================================================*/ -#ifdef __cplusplus -extern "C" { -#endif - #if GAUDIO_NEED_PLAY || defined(__DOXYGEN__) /** * @brief Set the audio device to play on the specified channel and with the specified * sample frequency. - * @return TRUE is successful, FALSE if the driver doesn't accept those parameters. + * @return gTrue is successful, gFalse if the driver doesn't accept those parameters. * * @param[in] channel The audio output channel to use. Can be set from 0 to GAUDIO_PLAY_NUM_CHANNELS - 1 * @param[in] frequency The audio sample rate in samples per second @@ -114,7 +110,7 @@ extern "C" { * * @api */ - bool_t gaudioPlayInit(uint16_t channel, uint32_t frequency, ArrayDataFormat format); + gBool gaudioPlayInit(uint16_t channel, uint32_t frequency, ArrayDataFormat format); /** * @brief Play the specified sample data. @@ -159,16 +155,16 @@ extern "C" { /** * @brief Set the output volume. - * @return TRUE if successful. + * @return gTrue if successful. * * @param[in] vol 0->255 (0 = muted) * - * @note Some drivers may not support this. They will return FALSE. + * @note Some drivers may not support this. They will return gFalse. * @note For stereo devices, both channels are set to the same volume. * * @api */ - bool_t gaudioPlaySetVolume(uint8_t vol); + gBool gaudioPlaySetVolume(uint8_t vol); #if GFX_USE_GEVENT || defined(__DOXYGEN__) /** @@ -191,19 +187,19 @@ extern "C" { /** * @brief Wait for any currently playing sounds to complete - * @return TRUE if there is now nothing playing or FALSE if the timeout is exceeded + * @return gTrue if there is now nothing playing or gFalse if the timeout is exceeded * * @param[in] ms The maximum amount of time in milliseconds to wait for playing to complete. * * @api */ - bool_t gaudioPlayWait(delaytime_t ms); + gBool gaudioPlayWait(delaytime_t ms); #endif #if GAUDIO_NEED_RECORD || defined(__DOXYGEN__) /** * @brief Initialise (but not start) the Audio Recording sub-system. - * @details Returns FALSE for an invalid channel or other invalid parameter. + * @details Returns gFalse for an invalid channel or other invalid parameter. * * @param[in] channel The channel to convert. Can be set from 0 to GAUDIO_RECORD_NUM_CHANNELS - 1 * @param[in] frequency The sample frequency @@ -225,11 +221,11 @@ extern "C" { * Make sure you allocate your buffers large enough. Each channel is then interleaved * into the provided buffer. * - * @return FALSE if invalid channel or parameter + * @return gFalse if invalid channel or parameter * * @api */ - bool_t gaudioRecordInit(uint16_t channel, uint32_t frequency, ArrayDataFormat format); + gBool gaudioRecordInit(uint16_t channel, uint32_t frequency, ArrayDataFormat format); /** * @brief Start the audio recording. @@ -286,10 +282,6 @@ extern "C" { #endif #endif -#ifdef __cplusplus -} -#endif - #endif /* GFX_USE_GAUDIO */ #endif /* _GAUDIO_H */ diff --git a/src/gaudio/gaudio_driver_play.h b/src/gaudio/gaudio_driver_play.h index 622769f1..69e194c7 100644 --- a/src/gaudio/gaudio_driver_play.h +++ b/src/gaudio/gaudio_driver_play.h @@ -71,7 +71,7 @@ void gaudioPlayDoneI(void); /** * @brief Initialise the play driver - * @return TRUE if the channel, frequency and format are valid. + * @return gTrue if the channel, frequency and format are valid. * * @param[in] channel The channel to use (see the driver for the available channels provided) * @param[in] frequency The sample frequency to use @@ -81,7 +81,7 @@ void gaudioPlayDoneI(void); * * @api */ -bool_t gaudio_play_lld_init(uint16_t channel, uint32_t frequency, ArrayDataFormat format); +gBool gaudio_play_lld_init(uint16_t channel, uint32_t frequency, ArrayDataFormat format); /** * @brief Start the audio output playing @@ -108,16 +108,16 @@ void gaudio_play_lld_stop(void); /** * @brief Set the output volume. - * @return TRUE if successful. + * @return gTrue if successful. * * @param[in] vol 0->255 (0 = muted) * - * @note Some drivers may not support this. They will return FALSE. + * @note Some drivers may not support this. They will return gFalse. * @note For stereo devices, both channels are set to the same volume. * * @api */ -bool_t gaudio_play_lld_set_volume(uint8_t vol); +gBool gaudio_play_lld_set_volume(uint8_t vol); #ifdef __cplusplus } diff --git a/src/gaudio/gaudio_driver_record.h b/src/gaudio/gaudio_driver_record.h index 5cbe4532..f7db3d14 100644 --- a/src/gaudio/gaudio_driver_record.h +++ b/src/gaudio/gaudio_driver_record.h @@ -71,7 +71,7 @@ extern "C" { /** * @brief Initialise the record driver - * @return TRUE if the channel, frequency and format are valid. + * @return gTrue if the channel, frequency and format are valid. * * @param[in] channel The channel to use (see the driver for the available channels provided) * @param[in] frequency The sample frequency to use @@ -81,7 +81,7 @@ extern "C" { * * @api */ -bool_t gaudio_record_lld_init(uint16_t channel, uint32_t frequency, ArrayDataFormat format); +gBool gaudio_record_lld_init(uint16_t channel, uint32_t frequency, ArrayDataFormat format); /** * @brief Start the audio recording -- cgit v1.2.3