cwIoPresetSelApp.cpp : Added use of cwVelTableTuner
This commit is contained in:
parent
67361c928b
commit
6c97b62d6f
@ -24,6 +24,7 @@
|
|||||||
#include "cwFlowCross.h"
|
#include "cwFlowCross.h"
|
||||||
#include "cwIoFlow.h"
|
#include "cwIoFlow.h"
|
||||||
#include "cwPresetSel.h"
|
#include "cwPresetSel.h"
|
||||||
|
#include "cwVelTableTuner.h"
|
||||||
|
|
||||||
#define INVALID_LOC (0)
|
#define INVALID_LOC (0)
|
||||||
|
|
||||||
@ -90,15 +91,6 @@ namespace cw
|
|||||||
kAMtrOut0Id,
|
kAMtrOut0Id,
|
||||||
kAMtrOut1Id,
|
kAMtrOut1Id,
|
||||||
|
|
||||||
/*
|
|
||||||
kHalfPedalPedalVel,
|
|
||||||
kHalfPedalDelayMs,
|
|
||||||
kHalfPedalPitch,
|
|
||||||
kHalfPedalVel,
|
|
||||||
kHalfPedalDurMs,
|
|
||||||
kHalfPedalDnDelayMs,
|
|
||||||
*/
|
|
||||||
|
|
||||||
kLogId,
|
kLogId,
|
||||||
|
|
||||||
kFragListId,
|
kFragListId,
|
||||||
@ -121,14 +113,10 @@ namespace cw
|
|||||||
kFragPlayBtnId,
|
kFragPlayBtnId,
|
||||||
kFragPlaySeqBtnId,
|
kFragPlaySeqBtnId,
|
||||||
kFragPlayAllBtnId,
|
kFragPlayAllBtnId,
|
||||||
kFragNoteId
|
kFragNoteId,
|
||||||
|
|
||||||
};
|
kVelTblMinId = vtbl::kVtMinId,
|
||||||
|
kVelTblMaxId = vtbl::kVtMaxId
|
||||||
enum
|
|
||||||
{
|
|
||||||
kPiano_MRP_DevIdx = 1,
|
|
||||||
kSampler_MRP_DevIdx = 0
|
|
||||||
};
|
};
|
||||||
|
|
||||||
enum
|
enum
|
||||||
@ -177,15 +165,6 @@ namespace cw
|
|||||||
{ kPanelDivId, kInsertBtnId, "insertBtnId" },
|
{ kPanelDivId, kInsertBtnId, "insertBtnId" },
|
||||||
{ kPanelDivId, kDeleteBtnId, "deleteBtnId" },
|
{ kPanelDivId, kDeleteBtnId, "deleteBtnId" },
|
||||||
|
|
||||||
/*
|
|
||||||
{ kPanelDivId, kHalfPedalPedalVel, "halfPedalPedalVelId" },
|
|
||||||
{ kPanelDivId, kHalfPedalDelayMs, "halfPedalDelayMsId" },
|
|
||||||
{ kPanelDivId, kHalfPedalPitch, "halfPedalPitchId" },
|
|
||||||
{ kPanelDivId, kHalfPedalVel, "halfPedalVelId" },
|
|
||||||
{ kPanelDivId, kHalfPedalDurMs, "halfPedalDurMsId" },
|
|
||||||
{ kPanelDivId, kHalfPedalDnDelayMs, "halfPedalDnDelayMsId" },
|
|
||||||
*/
|
|
||||||
|
|
||||||
{ kPanelDivId, kPvWndSmpCntId, "pvWndSmpCntId" },
|
{ kPanelDivId, kPvWndSmpCntId, "pvWndSmpCntId" },
|
||||||
{ kPanelDivId, kSdBypassId, "sdBypassId" },
|
{ kPanelDivId, kSdBypassId, "sdBypassId" },
|
||||||
{ kPanelDivId, kSdInGainId, "sdInGainId" },
|
{ kPanelDivId, kSdInGainId, "sdInGainId" },
|
||||||
@ -205,6 +184,7 @@ namespace cw
|
|||||||
|
|
||||||
{ kPanelDivId, kLogId, "logId" },
|
{ kPanelDivId, kLogId, "logId" },
|
||||||
|
|
||||||
|
|
||||||
{ kPanelDivId, kFragListId, "fragListId" },
|
{ kPanelDivId, kFragListId, "fragListId" },
|
||||||
{ kFragListId, kFragPanelId, "fragPanelId" },
|
{ kFragListId, kFragPanelId, "fragPanelId" },
|
||||||
{ kFragPanelId, kFragMeasId, "fragMeasId" },
|
{ kFragPanelId, kFragMeasId, "fragMeasId" },
|
||||||
@ -222,6 +202,8 @@ namespace cw
|
|||||||
{ kFragPanelId, kFragPlayAllBtnId, "fragPlayAllBtnId" },
|
{ kFragPanelId, kFragPlayAllBtnId, "fragPlayAllBtnId" },
|
||||||
{ kFragPanelId, kFragNoteId, "fragNoteId" },
|
{ kFragPanelId, kFragNoteId, "fragNoteId" },
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
unsigned mapN = sizeof(mapA)/sizeof(mapA[0]);
|
unsigned mapN = sizeof(mapA)/sizeof(mapA[0]);
|
||||||
@ -248,6 +230,8 @@ namespace cw
|
|||||||
const char* record_fn_ext;
|
const char* record_fn_ext;
|
||||||
const char* record_backup_dir;
|
const char* record_backup_dir;
|
||||||
const char* scoreFn;
|
const char* scoreFn;
|
||||||
|
const char* velTableFname;
|
||||||
|
const char* velTableBackupDir;
|
||||||
const object_t* midi_play_record_cfg;
|
const object_t* midi_play_record_cfg;
|
||||||
const object_t* presets_cfg;
|
const object_t* presets_cfg;
|
||||||
object_t* flow_proc_dict;
|
object_t* flow_proc_dict;
|
||||||
@ -275,6 +259,7 @@ namespace cw
|
|||||||
unsigned end_play_loc;
|
unsigned end_play_loc;
|
||||||
|
|
||||||
preset_sel::handle_t psH;
|
preset_sel::handle_t psH;
|
||||||
|
vtbl::handle_t vtH;
|
||||||
io_flow::handle_t ioFlowH;
|
io_flow::handle_t ioFlowH;
|
||||||
|
|
||||||
double crossFadeSrate;
|
double crossFadeSrate;
|
||||||
@ -282,13 +267,6 @@ namespace cw
|
|||||||
|
|
||||||
bool printMidiFl;
|
bool printMidiFl;
|
||||||
|
|
||||||
unsigned hpDelayMs;
|
|
||||||
unsigned hpPedalVel;
|
|
||||||
unsigned hpPitch;
|
|
||||||
unsigned hpVel;
|
|
||||||
unsigned hpDurMs;
|
|
||||||
unsigned hpDnDelayMs;
|
|
||||||
|
|
||||||
bool seqActiveFl; // true if the sequence is currently active (set by 'Play Seq' btn)
|
bool seqActiveFl; // true if the sequence is currently active (set by 'Play Seq' btn)
|
||||||
unsigned seqStartedFl; // set by the first seq idle callback
|
unsigned seqStartedFl; // set by the first seq idle callback
|
||||||
unsigned seqFragId; //
|
unsigned seqFragId; //
|
||||||
@ -316,25 +294,25 @@ namespace cw
|
|||||||
|
|
||||||
for(int i=0; i<argc ; i+=2)
|
for(int i=0; i<argc ; i+=2)
|
||||||
{
|
{
|
||||||
if( strcmp(argv[i],"record_fn")==0 )
|
if( textCompare(argv[i],"record_fn") == 0 )
|
||||||
{
|
{
|
||||||
app->record_fn = argv[i+1];
|
app->record_fn = argv[i+1];
|
||||||
goto found_fl;
|
goto found_fl;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( strcmp(argv[i],"score_fn")==0 )
|
if( textCompare(argv[i],"score_fn") == 0 )
|
||||||
{
|
{
|
||||||
app->scoreFn = argv[i+1];
|
app->scoreFn = argv[i+1];
|
||||||
goto found_fl;
|
goto found_fl;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( strcmp(argv[i],"beg_play_loc")==0 )
|
if( textCompare(argv[i],"beg_play_loc") == 0 )
|
||||||
{
|
{
|
||||||
string_to_number( argv[i+1], app->beg_play_loc );
|
string_to_number( argv[i+1], app->beg_play_loc );
|
||||||
goto found_fl;
|
goto found_fl;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( strcmp(argv[i],"end_play_loc")==0 )
|
if( textCompare(argv[i],"end_play_loc") == 0 )
|
||||||
{
|
{
|
||||||
string_to_number( argv[i+1], app->end_play_loc );
|
string_to_number( argv[i+1], app->end_play_loc );
|
||||||
goto found_fl;
|
goto found_fl;
|
||||||
@ -369,8 +347,10 @@ namespace cw
|
|||||||
"record_fn", app->record_fn,
|
"record_fn", app->record_fn,
|
||||||
"record_fn_ext", app->record_fn_ext,
|
"record_fn_ext", app->record_fn_ext,
|
||||||
"score_fn", app->scoreFn,
|
"score_fn", app->scoreFn,
|
||||||
"flow_proc_dict_fn",flow_proc_dict_fn,
|
"flow_proc_dict_fn", flow_proc_dict_fn,
|
||||||
"midi_play_record", app->midi_play_record_cfg,
|
"midi_play_record", app->midi_play_record_cfg,
|
||||||
|
"vel_table_fname", app->velTableFname,
|
||||||
|
"vel_table_backup_dir", app->velTableBackupDir,
|
||||||
"presets", app->presets_cfg,
|
"presets", app->presets_cfg,
|
||||||
"crossFadeSrate", app->crossFadeSrate,
|
"crossFadeSrate", app->crossFadeSrate,
|
||||||
"crossFadeCount", app->crossFadeCnt,
|
"crossFadeCount", app->crossFadeCnt,
|
||||||
@ -476,6 +456,7 @@ namespace cw
|
|||||||
mem::release((char*&)app.record_backup_dir);
|
mem::release((char*&)app.record_backup_dir);
|
||||||
mem::release((char*&)app.record_dir);
|
mem::release((char*&)app.record_dir);
|
||||||
mem::release((char*&)app.scoreFn);
|
mem::release((char*&)app.scoreFn);
|
||||||
|
vtbl::destroy(app.vtH);
|
||||||
preset_sel::destroy(app.psH);
|
preset_sel::destroy(app.psH);
|
||||||
io_flow::destroy(app.ioFlowH);
|
io_flow::destroy(app.ioFlowH);
|
||||||
midi_record_play::destroy(app.mrpH);
|
midi_record_play::destroy(app.mrpH);
|
||||||
@ -512,7 +493,7 @@ namespace cw
|
|||||||
|
|
||||||
printf("Apply preset: '%s' : loc:%i", preset_idx==kInvalidIdx ? "<invalid>" : preset_label, loc );
|
printf("Apply preset: '%s' : loc:%i", preset_idx==kInvalidIdx ? "<invalid>" : preset_label, loc );
|
||||||
|
|
||||||
_set_status(app,"Apply preset: '%s'.", preset_idx==kInvalidIdx ? "<invalid>" : preset_label);
|
_set_status(app,"Apply preset: '%s'.", preset_idx == kInvalidIdx ? "<invalid>" : preset_label);
|
||||||
|
|
||||||
if( preset_label != nullptr )
|
if( preset_label != nullptr )
|
||||||
{
|
{
|
||||||
@ -589,7 +570,7 @@ namespace cw
|
|||||||
switch( actionId )
|
switch( actionId )
|
||||||
{
|
{
|
||||||
case midi_record_play::kPlayerStoppedActionId:
|
case midi_record_play::kPlayerStoppedActionId:
|
||||||
app->seqStartedFl=false;
|
app->seqStartedFl = false;
|
||||||
_do_stop_play(app);
|
_do_stop_play(app);
|
||||||
_set_status(app,"Done");
|
_set_status(app,"Done");
|
||||||
break;
|
break;
|
||||||
@ -648,7 +629,7 @@ namespace cw
|
|||||||
const io::midi_msg_t& m = *msg.u.midi;
|
const io::midi_msg_t& m = *msg.u.midi;
|
||||||
const midi::packet_t* pkt = m.pkt;
|
const midi::packet_t* pkt = m.pkt;
|
||||||
// for each midi msg
|
// for each midi msg
|
||||||
for(unsigned j=0; j<pkt->msgCnt; ++j)
|
for(unsigned j = 0; j<pkt->msgCnt; ++j)
|
||||||
{
|
{
|
||||||
// if this is a sys-ex msg
|
// if this is a sys-ex msg
|
||||||
if( pkt->msgArray == NULL )
|
if( pkt->msgArray == NULL )
|
||||||
@ -666,7 +647,7 @@ namespace cw
|
|||||||
|
|
||||||
if( midi::isChStatus(mm->status) )
|
if( midi::isChStatus(mm->status) )
|
||||||
{
|
{
|
||||||
if(midi_record_play::send_midi_msg( app->mrpH, kSampler_MRP_DevIdx, mm->status & 0x0f, mm->status & 0xf0, mm->d0, mm->d1 ) == kOkRC )
|
if(midi_record_play::send_midi_msg( app->mrpH, midi_record_play::kSampler_MRP_DevIdx, mm->status & 0x0f, mm->status & 0xf0, mm->d0, mm->d1 ) == kOkRC )
|
||||||
_midi_play_callback( app, midi_record_play::kMidiEventActionId, id, timestamp, loc, mm->status & 0x0f, mm->status & 0xf0, mm->d0, mm->d1 );
|
_midi_play_callback( app, midi_record_play::kMidiEventActionId, id, timestamp, loc, mm->status & 0x0f, mm->status & 0xf0, mm->d0, mm->d1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -757,8 +738,6 @@ namespace cw
|
|||||||
goto errLabel;
|
goto errLabel;
|
||||||
}
|
}
|
||||||
|
|
||||||
//midi_record_play::half_pedal_params( app->mrpH, app->hpDelayMs, app->hpPitch, app->hpVel, app->hpPedalVel, app->hpDurMs, app->hpDnDelayMs );
|
|
||||||
|
|
||||||
if( app->in_audio_dev_idx != kInvalidIdx )
|
if( app->in_audio_dev_idx != kInvalidIdx )
|
||||||
{
|
{
|
||||||
unsigned frameIdx = 0;
|
unsigned frameIdx = 0;
|
||||||
@ -919,7 +898,7 @@ namespace cw
|
|||||||
rc_t rc = kOkRC;
|
rc_t rc = kOkRC;
|
||||||
|
|
||||||
// if the seq player is active but currently stopped
|
// if the seq player is active but currently stopped
|
||||||
if( app->seqActiveFl && app->seqStartedFl==false)
|
if( app->seqActiveFl && app->seqStartedFl == false)
|
||||||
{
|
{
|
||||||
app->seqPresetIdx += 1;
|
app->seqPresetIdx += 1;
|
||||||
app->seqStartedFl = app->seqPresetIdx < preset_sel::fragment_seq_count( app->psH, app->seqFragId );
|
app->seqStartedFl = app->seqPresetIdx < preset_sel::fragment_seq_count( app->psH, app->seqFragId );
|
||||||
@ -984,7 +963,7 @@ namespace cw
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Update the preset select check boxes on a fragment panel
|
// Update the preset select check boxes on a fragment panel
|
||||||
rc_t _update_frag_select_flags( app_t* app, unsigned fragId, unsigned fragEndLoc=kInvalidId )
|
rc_t _update_frag_select_flags( app_t* app, unsigned fragId, unsigned fragEndLoc = kInvalidId )
|
||||||
{
|
{
|
||||||
rc_t rc = kOkRC;
|
rc_t rc = kOkRC;
|
||||||
|
|
||||||
@ -1089,7 +1068,7 @@ namespace cw
|
|||||||
unsigned btnIdA[] = { kFragPlayBtnId, kFragPlaySeqBtnId, kFragPlayAllBtnId };
|
unsigned btnIdA[] = { kFragPlayBtnId, kFragPlaySeqBtnId, kFragPlayAllBtnId };
|
||||||
unsigned btnIdN = sizeof(btnIdA)/sizeof(btnIdA[0]);
|
unsigned btnIdN = sizeof(btnIdA)/sizeof(btnIdA[0]);
|
||||||
|
|
||||||
for(unsigned i=0; i<btnIdN; ++i)
|
for(unsigned i = 0; i<btnIdN; ++i)
|
||||||
{
|
{
|
||||||
unsigned btnUuId;
|
unsigned btnUuId;
|
||||||
if((btnUuId = uiFindElementUuId( app->ioH, fragUuId, btnIdA[i], blob->presetId )) != kInvalidId )
|
if((btnUuId = uiFindElementUuId( app->ioH, fragUuId, btnIdA[i], blob->presetId )) != kInvalidId )
|
||||||
@ -1181,7 +1160,7 @@ namespace cw
|
|||||||
|
|
||||||
rc_t _frag_set_ui_blob( app_t* app, unsigned uuId, unsigned fragId, unsigned varId, unsigned presetId )
|
rc_t _frag_set_ui_blob( app_t* app, unsigned uuId, unsigned fragId, unsigned varId, unsigned presetId )
|
||||||
{
|
{
|
||||||
ui_blob_t blob = { .fragId=fragId, .varId=varId, .presetId=presetId };
|
ui_blob_t blob = { .fragId = fragId, .varId=varId, .presetId=presetId };
|
||||||
return io::uiSetBlob( app->ioH, uuId, &blob, sizeof(blob) );
|
return io::uiSetBlob( app->ioH, uuId, &blob, sizeof(blob) );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1287,7 +1266,7 @@ namespace cw
|
|||||||
|
|
||||||
|
|
||||||
// create each of the preset controls
|
// create each of the preset controls
|
||||||
for(unsigned preset_idx=0; preset_idx<presetN; ++preset_idx)
|
for(unsigned preset_idx = 0; preset_idx<presetN; ++preset_idx)
|
||||||
if((rc = _create_frag_preset_ctl(app, fragId, fragPresetRowUuId, presetN, preset_idx )) != kOkRC )
|
if((rc = _create_frag_preset_ctl(app, fragId, fragPresetRowUuId, presetN, preset_idx )) != kOkRC )
|
||||||
goto errLabel;
|
goto errLabel;
|
||||||
|
|
||||||
@ -1329,7 +1308,7 @@ namespace cw
|
|||||||
//preset_sel::report( app->psH );
|
//preset_sel::report( app->psH );
|
||||||
|
|
||||||
f = preset_sel::get_fragment_base(app->psH);
|
f = preset_sel::get_fragment_base(app->psH);
|
||||||
for(int i=0; f!=nullptr; f=f->link,++i)
|
for(int i = 0; f!=nullptr; f=f->link,++i)
|
||||||
{
|
{
|
||||||
unsigned fragId = f->fragId;
|
unsigned fragId = f->fragId;
|
||||||
|
|
||||||
@ -1402,7 +1381,7 @@ namespace cw
|
|||||||
midiEventCntRef = 0;
|
midiEventCntRef = 0;
|
||||||
|
|
||||||
// create the score
|
// create the score
|
||||||
if((rc = score::create( app->scoreH, app->scoreFn )) != kOkRC )
|
if((rc= score::create( app->scoreH, app->scoreFn )) != kOkRC )
|
||||||
{
|
{
|
||||||
cwLogError(rc,"Score create failed on '%s'.",app->scoreFn);
|
cwLogError(rc,"Score create failed on '%s'.",app->scoreFn);
|
||||||
goto errLabel;
|
goto errLabel;
|
||||||
@ -1410,7 +1389,7 @@ namespace cw
|
|||||||
|
|
||||||
// get the count of MIDI events
|
// get the count of MIDI events
|
||||||
if((e = score::base_event( app->scoreH )) != nullptr )
|
if((e = score::base_event( app->scoreH )) != nullptr )
|
||||||
for(; e!=nullptr; e=e->link)
|
for(; e != nullptr; e=e->link)
|
||||||
if( e->status != 0 )
|
if( e->status != 0 )
|
||||||
midiEventN += 1;
|
midiEventN += 1;
|
||||||
|
|
||||||
@ -1428,7 +1407,7 @@ namespace cw
|
|||||||
m = mem::allocZ<midi_record_play::midi_msg_t>( midiEventN );
|
m = mem::allocZ<midi_record_play::midi_msg_t>( midiEventN );
|
||||||
|
|
||||||
// load the player msg array
|
// load the player msg array
|
||||||
for(unsigned i=0; e!=nullptr && i<midiEventN; e=e->link)
|
for(unsigned i = 0; e!=nullptr && i<midiEventN; e = e->link)
|
||||||
if( e->status != 0 )
|
if( e->status != 0 )
|
||||||
{
|
{
|
||||||
time::millisecondsToSpec(m[i].timestamp, (unsigned)(e->sec*1000) );
|
time::millisecondsToSpec(m[i].timestamp, (unsigned)(e->sec*1000) );
|
||||||
@ -1575,7 +1554,7 @@ namespace cw
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
bool fl0 = _find_loc(app,loc) != nullptr;
|
bool fl0 = _find_loc(app,loc) != nullptr;
|
||||||
bool fl1 = preset_sel::is_fragment_end_loc( app->psH, loc-1)==false;
|
bool fl1 = preset_sel::is_fragment_end_loc( app->psH, loc-1) == false;
|
||||||
|
|
||||||
return fl0 && fl1;
|
return fl0 && fl1;
|
||||||
}
|
}
|
||||||
@ -1763,7 +1742,7 @@ namespace cw
|
|||||||
|
|
||||||
rc_t _on_echo_master_value( app_t* app, unsigned varId, unsigned uuId )
|
rc_t _on_echo_master_value( app_t* app, unsigned varId, unsigned uuId )
|
||||||
{
|
{
|
||||||
rc_t rc = kOkRC;
|
rc_t rc= kOkRC;
|
||||||
double val = 0;
|
double val = 0;
|
||||||
if((rc = get_value( app->psH, kInvalidId, varId, kInvalidId, val )) != kOkRC )
|
if((rc = get_value( app->psH, kInvalidId, varId, kInvalidId, val )) != kOkRC )
|
||||||
rc = cwLogError(rc,"Unable to get the master value for var id:%i.",varId);
|
rc = cwLogError(rc,"Unable to get the master value for var id:%i.",varId);
|
||||||
@ -1791,7 +1770,7 @@ namespace cw
|
|||||||
unsigned n = std::min(agd->chCnt,2U);
|
unsigned n = std::min(agd->chCnt,2U);
|
||||||
unsigned baseUiAppId = cwIsFlag(agd->flags,io::kInFl) ? kAMtrIn0Id : kAMtrOut0Id;
|
unsigned baseUiAppId = cwIsFlag(agd->flags,io::kInFl) ? kAMtrIn0Id : kAMtrOut0Id;
|
||||||
|
|
||||||
for(unsigned i=0; i<n; ++i)
|
for(unsigned i = 0; i<n; ++i)
|
||||||
{
|
{
|
||||||
unsigned uuid = io::uiFindElementUuId( app->ioH, baseUiAppId+i );
|
unsigned uuid = io::uiFindElementUuId( app->ioH, baseUiAppId+i );
|
||||||
|
|
||||||
@ -1814,13 +1793,13 @@ namespace cw
|
|||||||
switch( m.appId )
|
switch( m.appId )
|
||||||
{
|
{
|
||||||
case kPvWndSmpCntId:
|
case kPvWndSmpCntId:
|
||||||
var_label="wndSmpN";
|
var_label = "wndSmpN";
|
||||||
app->pvWndSmpCnt = m.value->u.u;
|
app->pvWndSmpCnt = m.value->u.u;
|
||||||
rc = io_flow::set_variable_value( app->ioFlowH, flow_cross::kAllDestId, "pva", var_label, flow::kAnyChIdx, m.value->u.u );
|
rc = io_flow::set_variable_value( app->ioFlowH, flow_cross::kAllDestId, "pva", var_label, flow::kAnyChIdx, m.value->u.u );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case kSdBypassId:
|
case kSdBypassId:
|
||||||
var_label="bypass";
|
var_label = "bypass";
|
||||||
app->sdBypassFl = m.value->u.b;
|
app->sdBypassFl = m.value->u.b;
|
||||||
rc = io_flow::set_variable_value( app->ioFlowH, flow_cross::kAllDestId, "sd", var_label, flow::kAnyChIdx, m.value->u.b );
|
rc = io_flow::set_variable_value( app->ioFlowH, flow_cross::kAllDestId, "sd", var_label, flow::kAnyChIdx, m.value->u.b );
|
||||||
break;
|
break;
|
||||||
@ -1861,7 +1840,7 @@ namespace cw
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case kCmpBypassId:
|
case kCmpBypassId:
|
||||||
var_label="cmp-bypass";
|
var_label = "cmp-bypass";
|
||||||
app->cmpBypassFl = m.value->u.b;
|
app->cmpBypassFl = m.value->u.b;
|
||||||
rc = io_flow::set_variable_value( app->ioFlowH, flow_cross::kAllDestId, "cmp", "bypass", flow::kAnyChIdx, m.value->u.b );
|
rc = io_flow::set_variable_value( app->ioFlowH, flow_cross::kAllDestId, "cmp", "bypass", flow::kAnyChIdx, m.value->u.b );
|
||||||
break;
|
break;
|
||||||
@ -1880,78 +1859,6 @@ namespace cw
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
rc_t _on_ui_half_pedal_value( app_t* app, unsigned appId, unsigned uuId, unsigned value )
|
|
||||||
{
|
|
||||||
switch( appId )
|
|
||||||
{
|
|
||||||
case kHalfPedalDelayMs:
|
|
||||||
app->hpDelayMs = value;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case kHalfPedalPedalVel:
|
|
||||||
app->hpPedalVel = value;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case kHalfPedalPitch:
|
|
||||||
app->hpPitch = value;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case kHalfPedalVel:
|
|
||||||
app->hpVel = value;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case kHalfPedalDurMs:
|
|
||||||
app->hpDurMs = value;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case kHalfPedalDnDelayMs:
|
|
||||||
app->hpDnDelayMs = value;
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
{ assert(0); }
|
|
||||||
|
|
||||||
}
|
|
||||||
return kOkRC;
|
|
||||||
}
|
|
||||||
|
|
||||||
rc_t _on_echo_half_pedal( app_t* app, unsigned appId, unsigned uuId )
|
|
||||||
{
|
|
||||||
switch( appId )
|
|
||||||
{
|
|
||||||
case kHalfPedalDelayMs:
|
|
||||||
io::uiSendValue( app->ioH, uuId, app->hpDelayMs );
|
|
||||||
break;
|
|
||||||
|
|
||||||
case kHalfPedalPedalVel:
|
|
||||||
io::uiSendValue( app->ioH, uuId, app->hpPedalVel );
|
|
||||||
break;
|
|
||||||
|
|
||||||
case kHalfPedalPitch:
|
|
||||||
io::uiSendValue( app->ioH, uuId, app->hpPitch );
|
|
||||||
break;
|
|
||||||
|
|
||||||
case kHalfPedalVel:
|
|
||||||
io::uiSendValue( app->ioH, uuId, app->hpVel );
|
|
||||||
break;
|
|
||||||
|
|
||||||
case kHalfPedalDurMs:
|
|
||||||
io::uiSendValue( app->ioH, uuId, app->hpDurMs );
|
|
||||||
break;
|
|
||||||
|
|
||||||
case kHalfPedalDnDelayMs:
|
|
||||||
io::uiSendValue( app->ioH, uuId, app->hpDnDelayMs );
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
{ assert(0); }
|
|
||||||
|
|
||||||
}
|
|
||||||
return kOkRC;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
rc_t _onUiInit(app_t* app, const io::ui_msg_t& m )
|
rc_t _onUiInit(app_t* app, const io::ui_msg_t& m )
|
||||||
{
|
{
|
||||||
rc_t rc = kOkRC;
|
rc_t rc = kOkRC;
|
||||||
@ -2000,7 +1907,8 @@ namespace cw
|
|||||||
//io_flow::report(app->ioFlowH);
|
//io_flow::report(app->ioFlowH);
|
||||||
//midi_record_play::save_csv(app->mrpH,"/home/kevin/temp/mrp_1.csv");
|
//midi_record_play::save_csv(app->mrpH,"/home/kevin/temp/mrp_1.csv");
|
||||||
//printf("%i %i\n",app->beg_play_loc,app->end_play_loc);
|
//printf("%i %i\n",app->beg_play_loc,app->end_play_loc);
|
||||||
io::realTimeReport(app->ioH);
|
//io::realTimeReport(app->ioH);
|
||||||
|
midi_record_play::report(app->mrpH);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case kSaveBtnId:
|
case kSaveBtnId:
|
||||||
@ -2037,11 +1945,11 @@ namespace cw
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case kPianoMidiCheckId:
|
case kPianoMidiCheckId:
|
||||||
_on_midi_enable( app, m.appId, kPiano_MRP_DevIdx, m.value->u.b );
|
_on_midi_enable( app, m.appId, midi_record_play::kPiano_MRP_DevIdx, m.value->u.b );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case kSamplerMidiCheckId:
|
case kSamplerMidiCheckId:
|
||||||
_on_midi_enable( app, m.appId, kSampler_MRP_DevIdx, m.value->u.b );
|
_on_midi_enable( app, m.appId, midi_record_play::kSampler_MRP_DevIdx, m.value->u.b );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case kWetInGainId:
|
case kWetInGainId:
|
||||||
@ -2093,17 +2001,6 @@ namespace cw
|
|||||||
_on_sd_control(app,m);
|
_on_sd_control(app,m);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/*
|
|
||||||
case kHalfPedalPedalVel:
|
|
||||||
case kHalfPedalDelayMs:
|
|
||||||
case kHalfPedalPitch:
|
|
||||||
case kHalfPedalVel:
|
|
||||||
case kHalfPedalDurMs:
|
|
||||||
case kHalfPedalDnDelayMs:
|
|
||||||
_on_ui_half_pedal_value( app, m.appId, m.uuId, m.value->u.u );
|
|
||||||
break;
|
|
||||||
*/
|
|
||||||
|
|
||||||
case kFragInGainId:
|
case kFragInGainId:
|
||||||
_on_ui_frag_value( app, m.uuId, m.value->u.d);
|
_on_ui_frag_value( app, m.uuId, m.value->u.d);
|
||||||
break;
|
break;
|
||||||
@ -2156,6 +2053,9 @@ namespace cw
|
|||||||
_on_ui_frag_value( app, m.uuId, m.value->u.b );
|
_on_ui_frag_value( app, m.uuId, m.value->u.b );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
if( kVelTblMinId <= m.appId && m.appId < kVelTblMaxId )
|
||||||
|
vtbl::on_ui_value( app->vtH, m);
|
||||||
}
|
}
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
@ -2218,11 +2118,11 @@ namespace cw
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case kPianoMidiCheckId:
|
case kPianoMidiCheckId:
|
||||||
_on_echo_midi_enable( app, m.uuId, kPiano_MRP_DevIdx );
|
_on_echo_midi_enable( app, m.uuId, midi_record_play::kPiano_MRP_DevIdx );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case kSamplerMidiCheckId:
|
case kSamplerMidiCheckId:
|
||||||
_on_echo_midi_enable( app, m.uuId, kSampler_MRP_DevIdx );
|
_on_echo_midi_enable( app, m.uuId, midi_record_play::kSampler_MRP_DevIdx );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case kWetInGainId:
|
case kWetInGainId:
|
||||||
@ -2297,17 +2197,9 @@ namespace cw
|
|||||||
io::uiSendValue( app->ioH, m.uuId, app->cmpBypassFl );
|
io::uiSendValue( app->ioH, m.uuId, app->cmpBypassFl );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
/*
|
if( kVelTblMinId <= m.appId && m.appId <= kVelTblMaxId )
|
||||||
case kHalfPedalPedalVel:
|
vtbl::on_ui_echo( app->vtH, m );
|
||||||
case kHalfPedalDelayMs:
|
|
||||||
case kHalfPedalPitch:
|
|
||||||
case kHalfPedalVel:
|
|
||||||
case kHalfPedalDurMs:
|
|
||||||
case kHalfPedalDnDelayMs:
|
|
||||||
_on_echo_half_pedal( app, m.appId, m.uuId );
|
|
||||||
break;
|
|
||||||
*/
|
|
||||||
|
|
||||||
}
|
}
|
||||||
return rc;
|
return rc;
|
||||||
@ -2423,6 +2315,7 @@ namespace cw
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case io::kExecTId:
|
case io::kExecTId:
|
||||||
|
vtbl::exec(app->vtH);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@ -2442,8 +2335,7 @@ cw::rc_t cw::preset_sel_app::main( const object_t* cfg, int argc, const char* ar
|
|||||||
{
|
{
|
||||||
|
|
||||||
rc_t rc;
|
rc_t rc;
|
||||||
app_t app = { .hpDelayMs=250, .hpPedalVel=127, .hpPitch=64, .hpVel=64, .hpDurMs=500, .hpDnDelayMs=1000,
|
app_t app = { .trackMidiFl = true,
|
||||||
.trackMidiFl = true,
|
|
||||||
.pvWndSmpCnt = 512,
|
.pvWndSmpCnt = 512,
|
||||||
.sdBypassFl = false,
|
.sdBypassFl = false,
|
||||||
.sdInGain = 1.0,
|
.sdInGain = 1.0,
|
||||||
@ -2453,17 +2345,29 @@ cw::rc_t cw::preset_sel_app::main( const object_t* cfg, int argc, const char* ar
|
|||||||
.sdUpr = -1.1,
|
.sdUpr = -1.1,
|
||||||
.sdLwr = 2.0,
|
.sdLwr = 2.0,
|
||||||
.sdMix = 0.0,
|
.sdMix = 0.0,
|
||||||
.cmpBypassFl = false,
|
.cmpBypassFl = false
|
||||||
|
|
||||||
};
|
};
|
||||||
const object_t* params_cfg = nullptr;
|
const object_t* params_cfg = nullptr;
|
||||||
|
|
||||||
|
unsigned vtMapN = vtbl::get_ui_id_map_count();
|
||||||
|
const ui::appIdMap_t* vtMap = vtbl::get_ui_id_map( kPanelDivId );
|
||||||
|
unsigned bigMapN = mapN + vtMapN;
|
||||||
|
ui::appIdMap_t bigMap[ bigMapN ];
|
||||||
|
|
||||||
|
for(unsigned i=0; i<mapN; ++i)
|
||||||
|
bigMap[i] = mapA[i];
|
||||||
|
|
||||||
|
for(unsigned i=0; i<vtMapN; ++i)
|
||||||
|
bigMap[mapN+i] = vtMap[i];
|
||||||
|
|
||||||
|
|
||||||
// Parse the configuration
|
// Parse the configuration
|
||||||
if((rc = _parseCfg(&app,cfg,params_cfg,argc,argv)) != kOkRC )
|
if((rc = _parseCfg(&app,cfg,params_cfg,argc,argv)) != kOkRC )
|
||||||
goto errLabel;
|
goto errLabel;
|
||||||
|
|
||||||
// create the io framework instance
|
// create the io framework instance
|
||||||
if((rc = io::create(app.ioH,cfg,_io_callback,&app,mapA,mapN)) != kOkRC )
|
if((rc = io::create(app.ioH,cfg,_io_callback,&app,bigMap,bigMapN)) != kOkRC )
|
||||||
{
|
{
|
||||||
rc = cwLogError(kOpFailRC,"IO Framework create failed.");
|
rc = cwLogError(kOpFailRC,"IO Framework create failed.");
|
||||||
goto errLabel;
|
goto errLabel;
|
||||||
@ -2498,12 +2402,19 @@ cw::rc_t cw::preset_sel_app::main( const object_t* cfg, int argc, const char* ar
|
|||||||
}
|
}
|
||||||
|
|
||||||
// create the MIDI record-play object
|
// create the MIDI record-play object
|
||||||
if((rc = midi_record_play::create(app.mrpH,app.ioH,*app.midi_play_record_cfg,_midi_play_callback,&app)) != kOkRC )
|
if((rc = midi_record_play::create(app.mrpH,app.ioH,*app.midi_play_record_cfg,app.velTableFname,_midi_play_callback,&app)) != kOkRC )
|
||||||
{
|
{
|
||||||
rc = cwLogError(rc,"MIDI record-play object create failed.");
|
rc = cwLogError(rc,"MIDI record-play object create failed.");
|
||||||
goto errLabel;
|
goto errLabel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// create the vel table tuner
|
||||||
|
if((rc = create( app.vtH, app.ioH, app.mrpH, app.velTableFname, app.velTableBackupDir)) != kOkRC )
|
||||||
|
{
|
||||||
|
rc = cwLogError(rc,"velocity table tuner create failed.");
|
||||||
|
goto errLabel;
|
||||||
|
}
|
||||||
|
|
||||||
// create the IO Flow controller
|
// create the IO Flow controller
|
||||||
if(app.flow_cfg==nullptr || app.flow_proc_dict==nullptr || (rc = io_flow::create(app.ioFlowH,app.ioH,app.crossFadeSrate,app.crossFadeCnt,*app.flow_proc_dict,*app.flow_cfg)) != kOkRC )
|
if(app.flow_cfg==nullptr || app.flow_proc_dict==nullptr || (rc = io_flow::create(app.ioFlowH,app.ioH,app.crossFadeSrate,app.crossFadeCnt,*app.flow_proc_dict,*app.flow_cfg)) != kOkRC )
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user