From f5ce96dcd21f2a56d894770e2f4802963c08dbf7 Mon Sep 17 00:00:00 2001 From: kevin Date: Sat, 21 May 2022 12:35:28 -0400 Subject: [PATCH] cwIoPresetSelApp.cpp : Update fragment button enable to include 'play seq' and 'play all' buttons. --- cwIoPresetSelApp.cpp | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/cwIoPresetSelApp.cpp b/cwIoPresetSelApp.cpp index 247dcd4..d7d1017 100644 --- a/cwIoPresetSelApp.cpp +++ b/cwIoPresetSelApp.cpp @@ -733,7 +733,6 @@ namespace cw unsigned fragPanelUuId = kInvalidId; get_value( app->psH, fragId, preset_sel::kGuiUuIdVarId, kInvalidId, fragPanelUuId ); - _update_frag_ui( app, fragId, preset_sel::kBegLocVarId, kInvalidId, fragPanelUuId, kFragBegLocId, uiChanId, uValue ); _update_frag_ui( app, fragId, preset_sel::kEndLocVarId, kInvalidId, fragPanelUuId, kFragEndLocId, uiChanId, uValue ); @@ -772,20 +771,28 @@ namespace cw void _enable_frag_play_btn( app_t* app, ui_blob_t* blob, const char*, unsigned ){} void _enable_frag_play_btn( app_t* app, ui_blob_t* blob, unsigned begPlayLoc, unsigned endPlayLoc ) { - bool enableFl = begPlayLoc < endPlayLoc; - unsigned fragUuId = kInvalidId; - unsigned fragPlayBtnUuId = kInvalidId; + bool enableFl = begPlayLoc < endPlayLoc; + unsigned fragUuId = kInvalidId; if((fragUuId = frag_to_gui_id( app->psH, blob->fragId )) != kInvalidId ) - if((fragPlayBtnUuId = uiFindElementUuId( app->ioH, fragUuId, kFragPlayBtnId, blob->presetId )) != kInvalidId ) + { + unsigned btnIdA[] = { kFragPlayBtnId, kFragPlaySeqBtnId, kFragPlayAllBtnId }; + unsigned btnIdN = sizeof(btnIdA)/sizeof(btnIdA[0]); + + for(unsigned i=0; iioH, fragPlayBtnUuId, enableFl ); - if( enableFl ) - _clear_status(app); - else - _set_status(app,"Invalid fragment play range."); + unsigned btnUuId; + if((btnUuId = uiFindElementUuId( app->ioH, fragUuId, btnIdA[i], blob->presetId )) != kInvalidId ) + uiSetEnable( app->ioH, btnUuId, enableFl ); + } - + } + + if( enableFl ) + _clear_status(app); + else + _set_status(app,"Invalid fragment play range."); + } void _disable_frag_play_btn( app_t* app, unsigned fragBegEndUuId )