cwAudioBuf,cwAudioDeviceAlsa : Test functions now return error codes.

This commit is contained in:
kevin 2020-09-27 10:27:32 -04:00
parent 9b97662d62
commit 43c8737d73
4 changed files with 14 additions and 7 deletions

View File

@ -923,8 +923,9 @@ void cw::audio::buf::report(handle_t h)
/// [cwAudioBufExample] /// [cwAudioBufExample]
void cw::audio::buf::test() cw::rc_t cw::audio::buf::test()
{ {
rc_t rc = kOkRC;
unsigned devIdx = 0; unsigned devIdx = 0;
unsigned devCnt = 1 ; unsigned devCnt = 1 ;
unsigned dspFrameCnt = 10; unsigned dspFrameCnt = 10;
@ -1021,6 +1022,8 @@ void cw::audio::buf::test()
cwLogInfo("\n"); cwLogInfo("\n");
destroy(h); destroy(h);
return rc;
} }
/// [cwAudioBufExample] /// [cwAudioBufExample]

View File

@ -232,7 +232,7 @@ namespace cw
void report( handle_t h ); void report( handle_t h );
// Run a buffer usage simulation to test the class. cmAudioPortTest.c calls this function. // Run a buffer usage simulation to test the class. cmAudioPortTest.c calls this function.
void test(); rc_t test();
//) //)

View File

@ -1590,7 +1590,7 @@ void cw::audio::device::alsa::deviceRealTimeReport(struct driver_str* drv, unsig
//) //)
//[ //[
void cw::audio::device::alsa::report( handle_t h ) cw::rc_t cw::audio::device::alsa::report( handle_t h )
{ {
alsa_t* p = _handleToPtr(h); alsa_t* p = _handleToPtr(h);
unsigned i; unsigned i;
@ -1603,17 +1603,21 @@ void cw::audio::device::alsa::report( handle_t h )
} }
snd_config_update_free_global(); snd_config_update_free_global();
return kOkRC;
} }
void cw::audio::device::alsa::report() cw::rc_t cw::audio::device::alsa::report()
{ {
rc_t rc = kOkRC;
handle_t h; handle_t h;
driver_t* d; driver_t* d;
if( create(h,d) == kOkRC ) if( create(h,d) == kOkRC )
{ {
report(h); rc = report(h);
destroy(h); destroy(h);
} }
return rc;
} }
//] //]

View File

@ -26,8 +26,8 @@ namespace cw
bool deviceIsStarted( struct driver_str* drv, unsigned devIdx ); bool deviceIsStarted( struct driver_str* drv, unsigned devIdx );
void deviceRealTimeReport( struct driver_str* drv, unsigned devIdx ); void deviceRealTimeReport( struct driver_str* drv, unsigned devIdx );
void report(handle_t h ); rc_t report(handle_t h );
void report(); rc_t report();
} }
} }
} }