cwIoPresetSelApp.cpp : Added use of cwVelTableTuner
This commit is contained in:
parent
67361c928b
commit
6c97b62d6f
@ -24,6 +24,7 @@
|
||||
#include "cwFlowCross.h"
|
||||
#include "cwIoFlow.h"
|
||||
#include "cwPresetSel.h"
|
||||
#include "cwVelTableTuner.h"
|
||||
|
||||
#define INVALID_LOC (0)
|
||||
|
||||
@ -90,15 +91,6 @@ namespace cw
|
||||
kAMtrOut0Id,
|
||||
kAMtrOut1Id,
|
||||
|
||||
/*
|
||||
kHalfPedalPedalVel,
|
||||
kHalfPedalDelayMs,
|
||||
kHalfPedalPitch,
|
||||
kHalfPedalVel,
|
||||
kHalfPedalDurMs,
|
||||
kHalfPedalDnDelayMs,
|
||||
*/
|
||||
|
||||
kLogId,
|
||||
|
||||
kFragListId,
|
||||
@ -121,14 +113,10 @@ namespace cw
|
||||
kFragPlayBtnId,
|
||||
kFragPlaySeqBtnId,
|
||||
kFragPlayAllBtnId,
|
||||
kFragNoteId
|
||||
kFragNoteId,
|
||||
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
kPiano_MRP_DevIdx = 1,
|
||||
kSampler_MRP_DevIdx = 0
|
||||
kVelTblMinId = vtbl::kVtMinId,
|
||||
kVelTblMaxId = vtbl::kVtMaxId
|
||||
};
|
||||
|
||||
enum
|
||||
@ -177,15 +165,6 @@ namespace cw
|
||||
{ kPanelDivId, kInsertBtnId, "insertBtnId" },
|
||||
{ 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, kSdBypassId, "sdBypassId" },
|
||||
{ kPanelDivId, kSdInGainId, "sdInGainId" },
|
||||
@ -205,6 +184,7 @@ namespace cw
|
||||
|
||||
{ kPanelDivId, kLogId, "logId" },
|
||||
|
||||
|
||||
{ kPanelDivId, kFragListId, "fragListId" },
|
||||
{ kFragListId, kFragPanelId, "fragPanelId" },
|
||||
{ kFragPanelId, kFragMeasId, "fragMeasId" },
|
||||
@ -222,6 +202,8 @@ namespace cw
|
||||
{ kFragPanelId, kFragPlayAllBtnId, "fragPlayAllBtnId" },
|
||||
{ kFragPanelId, kFragNoteId, "fragNoteId" },
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
unsigned mapN = sizeof(mapA)/sizeof(mapA[0]);
|
||||
@ -248,6 +230,8 @@ namespace cw
|
||||
const char* record_fn_ext;
|
||||
const char* record_backup_dir;
|
||||
const char* scoreFn;
|
||||
const char* velTableFname;
|
||||
const char* velTableBackupDir;
|
||||
const object_t* midi_play_record_cfg;
|
||||
const object_t* presets_cfg;
|
||||
object_t* flow_proc_dict;
|
||||
@ -275,6 +259,7 @@ namespace cw
|
||||
unsigned end_play_loc;
|
||||
|
||||
preset_sel::handle_t psH;
|
||||
vtbl::handle_t vtH;
|
||||
io_flow::handle_t ioFlowH;
|
||||
|
||||
double crossFadeSrate;
|
||||
@ -282,13 +267,6 @@ namespace cw
|
||||
|
||||
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)
|
||||
unsigned seqStartedFl; // set by the first seq idle callback
|
||||
unsigned seqFragId; //
|
||||
@ -316,25 +294,25 @@ namespace cw
|
||||
|
||||
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];
|
||||
goto found_fl;
|
||||
}
|
||||
|
||||
if( strcmp(argv[i],"score_fn")==0 )
|
||||
if( textCompare(argv[i],"score_fn") == 0 )
|
||||
{
|
||||
app->scoreFn = argv[i+1];
|
||||
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 );
|
||||
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 );
|
||||
goto found_fl;
|
||||
@ -369,8 +347,10 @@ namespace cw
|
||||
"record_fn", app->record_fn,
|
||||
"record_fn_ext", app->record_fn_ext,
|
||||
"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,
|
||||
"vel_table_fname", app->velTableFname,
|
||||
"vel_table_backup_dir", app->velTableBackupDir,
|
||||
"presets", app->presets_cfg,
|
||||
"crossFadeSrate", app->crossFadeSrate,
|
||||
"crossFadeCount", app->crossFadeCnt,
|
||||
@ -476,6 +456,7 @@ namespace cw
|
||||
mem::release((char*&)app.record_backup_dir);
|
||||
mem::release((char*&)app.record_dir);
|
||||
mem::release((char*&)app.scoreFn);
|
||||
vtbl::destroy(app.vtH);
|
||||
preset_sel::destroy(app.psH);
|
||||
io_flow::destroy(app.ioFlowH);
|
||||
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 );
|
||||
|
||||
_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 )
|
||||
{
|
||||
@ -589,7 +570,7 @@ namespace cw
|
||||
switch( actionId )
|
||||
{
|
||||
case midi_record_play::kPlayerStoppedActionId:
|
||||
app->seqStartedFl=false;
|
||||
app->seqStartedFl = false;
|
||||
_do_stop_play(app);
|
||||
_set_status(app,"Done");
|
||||
break;
|
||||
@ -648,7 +629,7 @@ namespace cw
|
||||
const io::midi_msg_t& m = *msg.u.midi;
|
||||
const midi::packet_t* pkt = m.pkt;
|
||||
// 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( pkt->msgArray == NULL )
|
||||
@ -666,7 +647,7 @@ namespace cw
|
||||
|
||||
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 );
|
||||
}
|
||||
|
||||
@ -757,8 +738,6 @@ namespace cw
|
||||
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 )
|
||||
{
|
||||
unsigned frameIdx = 0;
|
||||
@ -919,7 +898,7 @@ namespace cw
|
||||
rc_t rc = kOkRC;
|
||||
|
||||
// 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->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
|
||||
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;
|
||||
|
||||
@ -1089,7 +1068,7 @@ namespace cw
|
||||
unsigned btnIdA[] = { kFragPlayBtnId, kFragPlaySeqBtnId, kFragPlayAllBtnId };
|
||||
unsigned btnIdN = sizeof(btnIdA)/sizeof(btnIdA[0]);
|
||||
|
||||
for(unsigned i=0; i<btnIdN; ++i)
|
||||
for(unsigned i = 0; i<btnIdN; ++i)
|
||||
{
|
||||
unsigned btnUuId;
|
||||
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 )
|
||||
{
|
||||
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) );
|
||||
}
|
||||
|
||||
@ -1287,7 +1266,7 @@ namespace cw
|
||||
|
||||
|
||||
// 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 )
|
||||
goto errLabel;
|
||||
|
||||
@ -1329,7 +1308,7 @@ namespace cw
|
||||
//preset_sel::report( 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;
|
||||
|
||||
@ -1402,7 +1381,7 @@ namespace cw
|
||||
midiEventCntRef = 0;
|
||||
|
||||
// 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);
|
||||
goto errLabel;
|
||||
@ -1410,7 +1389,7 @@ namespace cw
|
||||
|
||||
// get the count of MIDI events
|
||||
if((e = score::base_event( app->scoreH )) != nullptr )
|
||||
for(; e!=nullptr; e=e->link)
|
||||
for(; e != nullptr; e=e->link)
|
||||
if( e->status != 0 )
|
||||
midiEventN += 1;
|
||||
|
||||
@ -1428,7 +1407,7 @@ namespace cw
|
||||
m = mem::allocZ<midi_record_play::midi_msg_t>( midiEventN );
|
||||
|
||||
// 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 )
|
||||
{
|
||||
time::millisecondsToSpec(m[i].timestamp, (unsigned)(e->sec*1000) );
|
||||
@ -1575,7 +1554,7 @@ namespace cw
|
||||
return false;
|
||||
|
||||
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;
|
||||
}
|
||||
@ -1763,7 +1742,7 @@ namespace cw
|
||||
|
||||
rc_t _on_echo_master_value( app_t* app, unsigned varId, unsigned uuId )
|
||||
{
|
||||
rc_t rc = kOkRC;
|
||||
rc_t rc= kOkRC;
|
||||
double val = 0;
|
||||
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);
|
||||
@ -1791,7 +1770,7 @@ namespace cw
|
||||
unsigned n = std::min(agd->chCnt,2U);
|
||||
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 );
|
||||
|
||||
@ -1814,13 +1793,13 @@ namespace cw
|
||||
switch( m.appId )
|
||||
{
|
||||
case kPvWndSmpCntId:
|
||||
var_label="wndSmpN";
|
||||
var_label = "wndSmpN";
|
||||
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 );
|
||||
break;
|
||||
|
||||
case kSdBypassId:
|
||||
var_label="bypass";
|
||||
var_label = "bypass";
|
||||
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 );
|
||||
break;
|
||||
@ -1861,7 +1840,7 @@ namespace cw
|
||||
break;
|
||||
|
||||
case kCmpBypassId:
|
||||
var_label="cmp-bypass";
|
||||
var_label = "cmp-bypass";
|
||||
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 );
|
||||
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 rc = kOkRC;
|
||||
@ -2000,7 +1907,8 @@ namespace cw
|
||||
//io_flow::report(app->ioFlowH);
|
||||
//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);
|
||||
io::realTimeReport(app->ioH);
|
||||
//io::realTimeReport(app->ioH);
|
||||
midi_record_play::report(app->mrpH);
|
||||
break;
|
||||
|
||||
case kSaveBtnId:
|
||||
@ -2037,11 +1945,11 @@ namespace cw
|
||||
break;
|
||||
|
||||
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;
|
||||
|
||||
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;
|
||||
|
||||
case kWetInGainId:
|
||||
@ -2093,17 +2001,6 @@ namespace cw
|
||||
_on_sd_control(app,m);
|
||||
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:
|
||||
_on_ui_frag_value( app, m.uuId, m.value->u.d);
|
||||
break;
|
||||
@ -2156,6 +2053,9 @@ namespace cw
|
||||
_on_ui_frag_value( app, m.uuId, m.value->u.b );
|
||||
break;
|
||||
|
||||
default:
|
||||
if( kVelTblMinId <= m.appId && m.appId < kVelTblMaxId )
|
||||
vtbl::on_ui_value( app->vtH, m);
|
||||
}
|
||||
|
||||
return rc;
|
||||
@ -2218,11 +2118,11 @@ namespace cw
|
||||
break;
|
||||
|
||||
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;
|
||||
|
||||
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;
|
||||
|
||||
case kWetInGainId:
|
||||
@ -2297,17 +2197,9 @@ namespace cw
|
||||
io::uiSendValue( app->ioH, m.uuId, app->cmpBypassFl );
|
||||
break;
|
||||
|
||||
|
||||
/*
|
||||
case kHalfPedalPedalVel:
|
||||
case kHalfPedalDelayMs:
|
||||
case kHalfPedalPitch:
|
||||
case kHalfPedalVel:
|
||||
case kHalfPedalDurMs:
|
||||
case kHalfPedalDnDelayMs:
|
||||
_on_echo_half_pedal( app, m.appId, m.uuId );
|
||||
break;
|
||||
*/
|
||||
default:
|
||||
if( kVelTblMinId <= m.appId && m.appId <= kVelTblMaxId )
|
||||
vtbl::on_ui_echo( app->vtH, m );
|
||||
|
||||
}
|
||||
return rc;
|
||||
@ -2423,6 +2315,7 @@ namespace cw
|
||||
break;
|
||||
|
||||
case io::kExecTId:
|
||||
vtbl::exec(app->vtH);
|
||||
break;
|
||||
|
||||
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;
|
||||
app_t app = { .hpDelayMs=250, .hpPedalVel=127, .hpPitch=64, .hpVel=64, .hpDurMs=500, .hpDnDelayMs=1000,
|
||||
.trackMidiFl = true,
|
||||
app_t app = { .trackMidiFl = true,
|
||||
.pvWndSmpCnt = 512,
|
||||
.sdBypassFl = false,
|
||||
.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,
|
||||
.sdLwr = 2.0,
|
||||
.sdMix = 0.0,
|
||||
.cmpBypassFl = false,
|
||||
.cmpBypassFl = false
|
||||
|
||||
};
|
||||
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
|
||||
if((rc = _parseCfg(&app,cfg,params_cfg,argc,argv)) != kOkRC )
|
||||
goto errLabel;
|
||||
|
||||
// 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.");
|
||||
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
|
||||
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.");
|
||||
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
|
||||
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