From 82b60a873d2b9851dd007e8f4474bb5cba0a9c83 Mon Sep 17 00:00:00 2001 From: kevin Date: Fri, 29 Dec 2023 13:43:08 -0500 Subject: [PATCH] cwIo.h : Added uiSendMsg(),audioIsEnabled(),audioActiveDeviceCount(). --- cwIo.cpp | 25 +++++++++++++++++++++++++ cwIo.h | 6 +++++- 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/cwIo.cpp b/cwIo.cpp index b7ebeca..d9cdbf9 100644 --- a/cwIo.cpp +++ b/cwIo.cpp @@ -2106,6 +2106,8 @@ namespace cw rc = ui::ws::create(p->wsUiH, args, p, _uiCallback, args.uiRsrc, p->uiMapA, p->uiMapN); ui::ws::releaseArgs(args); + + //ui::enableCache( ui::ws::uiHandle(p->wsUiH) ); } } @@ -2668,6 +2670,19 @@ cw::rc_t cw::io::midiDeviceSend( handle_t h, unsigned devIdx, unsigned portIdx, // Audio // +bool cw::io::audioIsEnabled( handle_t h ) +{ + io_t* p = _handleToPtr(h); + for(unsigned devIdx=0; devIdxaudioDevN; ++devIdx) + { + audioDev_t* ad; + if((ad = _audioDeviceIndexToRecd(p,devIdx)) != nullptr && ad->activeFl ) + return true; + } + + return false; +} + unsigned cw::io::audioDeviceCount( handle_t h ) { io_t* p = _handleToPtr(h); @@ -3728,6 +3743,16 @@ cw::rc_t cw::io::uiSendValue( handle_t h, unsigned uuId, const char* value ) return rc; } +cw::rc_t cw::io::uiSendMsg( handle_t h, const char* msg ) +{ + rc_t rc; + ui::handle_t uiH; + if((rc = _handleToUiHandle(h,uiH)) == kOkRC ) + rc = ui::sendMsg(uiH, msg); + return rc; +} + + void cw::io::uiReport( handle_t h ) { ui::handle_t uiH; diff --git a/cwIo.h b/cwIo.h index 458c737..1446266 100644 --- a/cwIo.h +++ b/cwIo.h @@ -230,8 +230,10 @@ namespace cw // // Audio // - + + bool audioIsEnabled( handle_t h ); unsigned audioDeviceCount( handle_t h ); + unsigned audioActiveDeviceCount( handle_t h ); unsigned audioDeviceLabelToIndex( handle_t h, const char* label ); const char* audioDeviceLabel( handle_t h, unsigned devIdx ); rc_t audioDeviceSetUserId( handle_t h, unsigned devIdx, unsigned userId ); @@ -398,6 +400,8 @@ namespace cw rc_t uiSendValue( handle_t h, unsigned uuId, double value ); rc_t uiSendValue( handle_t h, unsigned uuId, const char* value ); + rc_t uiSendMsg( handle_t h, const char* msg ); + void uiRealTimeReport( handle_t h ); void uiReport( handle_t h );