parent
8aa0813bb9
commit
b519713222
|
@ -237,56 +237,60 @@ bool DivConfig::loadFromBase64(const char* buf) {
|
|||
}
|
||||
|
||||
bool DivConfig::getBool(String key, bool fallback) const {
|
||||
try {
|
||||
String val=conf.at(key);
|
||||
if (val=="true") {
|
||||
auto val=conf.find(key);
|
||||
if (val!=conf.cend()) {
|
||||
if (val->second=="true") {
|
||||
return true;
|
||||
} else if (val=="false") {
|
||||
} else if (val->second=="false") {
|
||||
return false;
|
||||
}
|
||||
} catch (std::out_of_range& e) {
|
||||
}
|
||||
return fallback;
|
||||
}
|
||||
|
||||
int DivConfig::getInt(String key, int fallback) const {
|
||||
try {
|
||||
String val=conf.at(key);
|
||||
int ret=std::stoi(val);
|
||||
return ret;
|
||||
} catch (std::out_of_range& e) {
|
||||
} catch (std::invalid_argument& e) {
|
||||
auto val=conf.find(key);
|
||||
if (val!=conf.cend()) {
|
||||
try {
|
||||
int ret=std::stoi(val->second);
|
||||
return ret;
|
||||
} catch (std::out_of_range& e) {
|
||||
} catch (std::invalid_argument& e) {
|
||||
}
|
||||
}
|
||||
return fallback;
|
||||
}
|
||||
|
||||
float DivConfig::getFloat(String key, float fallback) const {
|
||||
try {
|
||||
String val=conf.at(key);
|
||||
float ret=std::stof(val);
|
||||
return ret;
|
||||
} catch (std::out_of_range& e) {
|
||||
} catch (std::invalid_argument& e) {
|
||||
auto val=conf.find(key);
|
||||
if (val!=conf.cend()) {
|
||||
try {
|
||||
float ret=std::stof(val->second);
|
||||
return ret;
|
||||
} catch (std::out_of_range& e) {
|
||||
} catch (std::invalid_argument& e) {
|
||||
}
|
||||
}
|
||||
return fallback;
|
||||
}
|
||||
|
||||
double DivConfig::getDouble(String key, double fallback) const {
|
||||
try {
|
||||
String val=conf.at(key);
|
||||
double ret=std::stod(val);
|
||||
return ret;
|
||||
} catch (std::out_of_range& e) {
|
||||
} catch (std::invalid_argument& e) {
|
||||
auto val=conf.find(key);
|
||||
if (val!=conf.cend()) {
|
||||
try {
|
||||
double ret=std::stod(val->second);
|
||||
return ret;
|
||||
} catch (std::out_of_range& e) {
|
||||
} catch (std::invalid_argument& e) {
|
||||
}
|
||||
}
|
||||
return fallback;
|
||||
}
|
||||
|
||||
String DivConfig::getString(String key, String fallback) const {
|
||||
try {
|
||||
String val=conf.at(key);
|
||||
return val;
|
||||
} catch (std::out_of_range& e) {
|
||||
auto val=conf.find(key);
|
||||
if (val!=conf.cend()) {
|
||||
return val->second;
|
||||
}
|
||||
return fallback;
|
||||
}
|
||||
|
@ -294,37 +298,34 @@ String DivConfig::getString(String key, String fallback) const {
|
|||
std::vector<int> DivConfig::getIntList(String key, std::initializer_list<int> fallback) const {
|
||||
String next;
|
||||
std::vector<int> ret;
|
||||
try {
|
||||
String val=conf.at(key);
|
||||
|
||||
for (char i: val) {
|
||||
if (i==',') {
|
||||
auto val=conf.find(key);
|
||||
if (val!=conf.cend()) {
|
||||
try {
|
||||
for (char i: val->second) {
|
||||
if (i==',') {
|
||||
int num=std::stoi(next);
|
||||
ret.push_back(num);
|
||||
next="";
|
||||
} else {
|
||||
next+=i;
|
||||
}
|
||||
}
|
||||
if (!next.empty()) {
|
||||
int num=std::stoi(next);
|
||||
ret.push_back(num);
|
||||
next="";
|
||||
} else {
|
||||
next+=i;
|
||||
}
|
||||
}
|
||||
if (!next.empty()) {
|
||||
int num=std::stoi(next);
|
||||
ret.push_back(num);
|
||||
}
|
||||
|
||||
return ret;
|
||||
} catch (std::out_of_range& e) {
|
||||
} catch (std::invalid_argument& e) {
|
||||
return ret;
|
||||
} catch (std::out_of_range& e) {
|
||||
} catch (std::invalid_argument& e) {
|
||||
}
|
||||
}
|
||||
return fallback;
|
||||
}
|
||||
|
||||
bool DivConfig::has(String key) const {
|
||||
try {
|
||||
String test=conf.at(key);
|
||||
} catch (std::out_of_range& e) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
auto val=conf.find(key);
|
||||
return (val!=conf.cend());
|
||||
}
|
||||
|
||||
void DivConfig::set(String key, bool value) {
|
||||
|
|
189
src/gui/gui.cpp
189
src/gui/gui.cpp
|
@ -610,10 +610,11 @@ void FurnaceGUI::autoDetectSystem() {
|
|||
std::map<DivSystem,int> sysCountMap;
|
||||
std::map<DivSystem,DivConfig> sysConfMap;
|
||||
for (int i=0; i<e->song.systemLen; i++) {
|
||||
try {
|
||||
sysCountMap.at(e->song.system[i])++;
|
||||
} catch (std::exception& ex) {
|
||||
auto it=sysCountMap.find(e->song.system[i]);
|
||||
if (it==sysCountMap.cend()) {
|
||||
sysCountMap[e->song.system[i]]=1;
|
||||
} else {
|
||||
it->second++;
|
||||
}
|
||||
sysConfMap[e->song.system[i]]=e->song.systemFlags[i];
|
||||
}
|
||||
|
@ -631,10 +632,11 @@ void FurnaceGUI::autoDetectSystem() {
|
|||
defCountMap.clear();
|
||||
defConfMap.clear();
|
||||
for (FurnaceGUISysDefChip& k: j.orig) {
|
||||
try {
|
||||
defCountMap.at(k.sys)++;
|
||||
} catch (std::exception& ex) {
|
||||
auto it=defCountMap.find(k.sys);
|
||||
if (it==defCountMap.cend()) {
|
||||
defCountMap[k.sys]=1;
|
||||
} else {
|
||||
it->second++;
|
||||
}
|
||||
DivConfig dc;
|
||||
dc.loadFromMemory(k.flags);
|
||||
|
@ -647,27 +649,37 @@ void FurnaceGUI::autoDetectSystem() {
|
|||
logV("- %s: %d",e->getSystemName(k.first),k.second);
|
||||
}*/
|
||||
for (std::pair<DivSystem,int> k: defCountMap) {
|
||||
try {
|
||||
if (sysCountMap.at(k.first)!=k.second) {
|
||||
isMatch=false;
|
||||
break;
|
||||
}
|
||||
DivConfig& sysDC=sysConfMap.at(k.first);
|
||||
for (std::pair<String,String> l: defConfMap.at(k.first).configMap()) {
|
||||
if (!sysDC.has(l.first)) {
|
||||
isMatch=false;
|
||||
break;
|
||||
}
|
||||
if (sysDC.getString(l.first,"")!=l.second) {
|
||||
isMatch=false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!isMatch) break;
|
||||
} catch (std::exception& ex) {
|
||||
auto countI=sysCountMap.find(k.first);
|
||||
if (countI==sysCountMap.cend()) {
|
||||
isMatch=false;
|
||||
break;
|
||||
} else if (countI->second!=k.second) {
|
||||
isMatch=false;
|
||||
break;
|
||||
}
|
||||
|
||||
auto confI=sysConfMap.find(k.first);
|
||||
if (confI==sysConfMap.cend()) {
|
||||
isMatch=false;
|
||||
break;
|
||||
}
|
||||
DivConfig& sysDC=confI->second;
|
||||
auto defConfI=defConfMap.find(k.first);
|
||||
if (defConfI==defConfMap.cend()) {
|
||||
isMatch=false;
|
||||
break;
|
||||
}
|
||||
for (std::pair<String,String> l: defConfI->second.configMap()) {
|
||||
if (!sysDC.has(l.first)) {
|
||||
isMatch=false;
|
||||
break;
|
||||
}
|
||||
if (sysDC.getString(l.first,"")!=l.second) {
|
||||
isMatch=false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!isMatch) break;
|
||||
}
|
||||
if (isMatch) {
|
||||
logV("match found!");
|
||||
|
@ -1097,8 +1109,9 @@ void FurnaceGUI::previewNote(int refChan, int note, bool autoNote) {
|
|||
}
|
||||
|
||||
void FurnaceGUI::stopPreviewNote(SDL_Scancode scancode, bool autoNote) {
|
||||
try {
|
||||
int key=noteKeys.at(scancode);
|
||||
auto it=noteKeys.find(scancode);
|
||||
if (it!=noteKeys.cend()) {
|
||||
int key=it->second;
|
||||
int num=12*curOctave+key;
|
||||
if (num<-60) num=-60; // C-(-5)
|
||||
if (num>119) num=119; // B-9
|
||||
|
@ -1110,7 +1123,6 @@ void FurnaceGUI::stopPreviewNote(SDL_Scancode scancode, bool autoNote) {
|
|||
e->synchronized([this,num]() {
|
||||
e->autoNoteOff(-1,num);
|
||||
});
|
||||
} catch (std::out_of_range& e) {
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1310,8 +1322,9 @@ void FurnaceGUI::keyDown(SDL_Event& ev) {
|
|||
break;
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
int num=valueKeys.at(ev.key.keysym.sym);
|
||||
auto it=valueKeys.find(ev.key.keysym.sym);
|
||||
if (it!=valueKeys.cend()) {
|
||||
int num=it->second;
|
||||
switch (latchTarget) {
|
||||
case 1: // instrument
|
||||
changeLatch(latchIns);
|
||||
|
@ -1326,7 +1339,6 @@ void FurnaceGUI::keyDown(SDL_Event& ev) {
|
|||
changeLatch(latchEffectVal);
|
||||
break;
|
||||
}
|
||||
} catch (std::out_of_range& e) {
|
||||
}
|
||||
}
|
||||
return;
|
||||
|
@ -1339,8 +1351,9 @@ void FurnaceGUI::keyDown(SDL_Event& ev) {
|
|||
alterSampleMap(true,-1);
|
||||
return;
|
||||
}
|
||||
try {
|
||||
int key=noteKeys.at(ev.key.keysym.scancode);
|
||||
auto it=noteKeys.find(ev.key.keysym.scancode);
|
||||
if (it!=noteKeys.cend()) {
|
||||
int key=it->second;
|
||||
int num=12*curOctave+key;
|
||||
|
||||
if (num<-60) num=-60; // C-(-5)
|
||||
|
@ -1348,7 +1361,6 @@ void FurnaceGUI::keyDown(SDL_Event& ev) {
|
|||
|
||||
alterSampleMap(true,num);
|
||||
return;
|
||||
} catch (std::out_of_range& e) {
|
||||
}
|
||||
} else {
|
||||
// TODO: map?
|
||||
|
@ -1356,34 +1368,35 @@ void FurnaceGUI::keyDown(SDL_Event& ev) {
|
|||
alterSampleMap(false,-1);
|
||||
return;
|
||||
}
|
||||
try {
|
||||
int num=valueKeys.at(ev.key.keysym.sym);
|
||||
auto it=valueKeys.find(ev.key.keysym.sym);
|
||||
if (it!=valueKeys.cend()) {
|
||||
int num=it->second;
|
||||
if (num<10) {
|
||||
alterSampleMap(false,num);
|
||||
return;
|
||||
}
|
||||
} catch (std::out_of_range& e) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// PER-WINDOW KEYS
|
||||
switch (curWindow) {
|
||||
case GUI_WINDOW_PATTERN:
|
||||
try {
|
||||
int action=actionMapPat.at(mapped);
|
||||
case GUI_WINDOW_PATTERN: {
|
||||
auto actionI=actionMapPat.find(mapped);
|
||||
if (actionI!=actionMapPat.cend()) {
|
||||
int action=actionI->second;
|
||||
if (action>0) {
|
||||
doAction(action);
|
||||
return;
|
||||
}
|
||||
} catch (std::out_of_range& e) {
|
||||
}
|
||||
// pattern input otherwise
|
||||
if (mapped&(FURKMOD_ALT|FURKMOD_CTRL|FURKMOD_META|FURKMOD_SHIFT)) break;
|
||||
if (!ev.key.repeat) {
|
||||
if (cursor.xFine==0) { // note
|
||||
try {
|
||||
int key=noteKeys.at(ev.key.keysym.scancode);
|
||||
auto it=noteKeys.find(ev.key.keysym.scancode);
|
||||
if (it!=noteKeys.cend()) {
|
||||
int key=it->second;
|
||||
int num=12*curOctave+key;
|
||||
|
||||
if (num<-60) num=-60; // C-(-5)
|
||||
|
@ -1392,31 +1405,32 @@ void FurnaceGUI::keyDown(SDL_Event& ev) {
|
|||
if (edit) {
|
||||
noteInput(num,key);
|
||||
}
|
||||
} catch (std::out_of_range& e) {
|
||||
}
|
||||
} else if (edit) { // value
|
||||
try {
|
||||
int num=valueKeys.at(ev.key.keysym.sym);
|
||||
auto it=valueKeys.find(ev.key.keysym.sym);
|
||||
if (it!=valueKeys.cend()) {
|
||||
int num=it->second;
|
||||
valueInput(num);
|
||||
} catch (std::out_of_range& e) {
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case GUI_WINDOW_ORDERS:
|
||||
try {
|
||||
int action=actionMapOrders.at(mapped);
|
||||
}
|
||||
case GUI_WINDOW_ORDERS: {
|
||||
auto actionI=actionMapOrders.find(mapped);
|
||||
if (actionI!=actionMapOrders.cend()) {
|
||||
int action=actionI->second;
|
||||
if (action>0) {
|
||||
doAction(action);
|
||||
return;
|
||||
}
|
||||
} catch (std::out_of_range& e) {
|
||||
}
|
||||
// order input otherwise
|
||||
if (mapped&(FURKMOD_ALT|FURKMOD_CTRL|FURKMOD_META|FURKMOD_SHIFT)) break;
|
||||
if (orderEditMode!=0) {
|
||||
try {
|
||||
int num=valueKeys.at(ev.key.keysym.sym);
|
||||
auto it=valueKeys.find(ev.key.keysym.sym);
|
||||
if (it!=valueKeys.cend()) {
|
||||
int num=it->second;
|
||||
if (orderCursor>=0 && orderCursor<e->getTotalChannelCount()) {
|
||||
prepareUndo(GUI_UNDO_CHANGE_ORDER);
|
||||
e->lockSave([this,num]() {
|
||||
|
@ -1440,62 +1454,66 @@ void FurnaceGUI::keyDown(SDL_Event& ev) {
|
|||
e->walkSong(loopOrder,loopRow,loopEnd);
|
||||
makeUndo(GUI_UNDO_CHANGE_ORDER);
|
||||
}
|
||||
} catch (std::out_of_range& e) {
|
||||
}
|
||||
}
|
||||
break;
|
||||
case GUI_WINDOW_SAMPLE_EDIT:
|
||||
try {
|
||||
int action=actionMapSample.at(mapped);
|
||||
}
|
||||
case GUI_WINDOW_SAMPLE_EDIT: {
|
||||
auto actionI=actionMapSample.find(mapped);
|
||||
if (actionI!=actionMapSample.cend()) {
|
||||
int action=actionI->second;
|
||||
if (action>0) {
|
||||
doAction(action);
|
||||
return;
|
||||
}
|
||||
} catch (std::out_of_range& e) {
|
||||
}
|
||||
break;
|
||||
case GUI_WINDOW_INS_LIST:
|
||||
try {
|
||||
int action=actionMapInsList.at(mapped);
|
||||
}
|
||||
case GUI_WINDOW_INS_LIST: {
|
||||
auto actionI=actionMapInsList.find(mapped);
|
||||
if (actionI!=actionMapInsList.cend()) {
|
||||
int action=actionI->second;
|
||||
if (action>0) {
|
||||
doAction(action);
|
||||
return;
|
||||
}
|
||||
} catch (std::out_of_range& e) {
|
||||
}
|
||||
break;
|
||||
case GUI_WINDOW_WAVE_LIST:
|
||||
try {
|
||||
int action=actionMapWaveList.at(mapped);
|
||||
}
|
||||
case GUI_WINDOW_WAVE_LIST: {
|
||||
auto actionI=actionMapWaveList.find(mapped);
|
||||
if (actionI!=actionMapWaveList.cend()) {
|
||||
int action=actionI->second;
|
||||
if (action>0) {
|
||||
doAction(action);
|
||||
return;
|
||||
}
|
||||
} catch (std::out_of_range& e) {
|
||||
}
|
||||
break;
|
||||
case GUI_WINDOW_SAMPLE_LIST:
|
||||
try {
|
||||
int action=actionMapSampleList.at(mapped);
|
||||
}
|
||||
case GUI_WINDOW_SAMPLE_LIST: {
|
||||
auto actionI=actionMapSampleList.find(mapped);
|
||||
if (actionI!=actionMapSampleList.cend()) {
|
||||
int action=actionI->second;
|
||||
if (action>0) {
|
||||
doAction(action);
|
||||
return;
|
||||
}
|
||||
} catch (std::out_of_range& e) {
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
// GLOBAL KEYS
|
||||
try {
|
||||
int action=actionMapGlobal.at(mapped);
|
||||
auto actionI=actionMapGlobal.find(mapped);
|
||||
if (actionI!=actionMapGlobal.cend()) {
|
||||
int action=actionI->second;
|
||||
if (action>0) {
|
||||
doAction(action);
|
||||
return;
|
||||
}
|
||||
} catch (std::out_of_range& e) {
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2981,9 +2999,10 @@ int FurnaceGUI::processEvent(SDL_Event* ev) {
|
|||
if (settings.notePreviewBehavior==0) return 1;
|
||||
switch (curWindow) {
|
||||
case GUI_WINDOW_SAMPLE_EDIT:
|
||||
case GUI_WINDOW_SAMPLE_LIST:
|
||||
try {
|
||||
int key=noteKeys.at(ev->key.keysym.scancode);
|
||||
case GUI_WINDOW_SAMPLE_LIST: {
|
||||
auto it=noteKeys.find(ev->key.keysym.scancode);
|
||||
if (it!=noteKeys.cend()) {
|
||||
int key=it->second;
|
||||
int num=12*curOctave+key;
|
||||
if (key!=100 && key!=101 && key!=102) {
|
||||
int pStart=-1;
|
||||
|
@ -3004,13 +3023,14 @@ int FurnaceGUI::processEvent(SDL_Event* ev) {
|
|||
samplePreviewKey=ev->key.keysym.scancode;
|
||||
samplePreviewNote=num;
|
||||
}
|
||||
} catch (std::out_of_range& e) {
|
||||
}
|
||||
break;
|
||||
}
|
||||
case GUI_WINDOW_WAVE_LIST:
|
||||
case GUI_WINDOW_WAVE_EDIT:
|
||||
try {
|
||||
int key=noteKeys.at(ev->key.keysym.scancode);
|
||||
case GUI_WINDOW_WAVE_EDIT: {
|
||||
auto it=noteKeys.find(ev->key.keysym.scancode);
|
||||
if (it!=noteKeys.cend()) {
|
||||
int key=it->second;
|
||||
int num=12*curOctave+key;
|
||||
if (key!=100 && key!=101 && key!=102) {
|
||||
e->previewWave(curWave,num);
|
||||
|
@ -3018,9 +3038,9 @@ int FurnaceGUI::processEvent(SDL_Event* ev) {
|
|||
wavePreviewKey=ev->key.keysym.scancode;
|
||||
wavePreviewNote=num;
|
||||
}
|
||||
} catch (std::out_of_range& e) {
|
||||
}
|
||||
break;
|
||||
}
|
||||
case GUI_WINDOW_ORDERS: // ignore here
|
||||
break;
|
||||
case GUI_WINDOW_PATTERN:
|
||||
|
@ -3030,9 +3050,10 @@ int FurnaceGUI::processEvent(SDL_Event* ev) {
|
|||
if (edit && cursor.xFine!=0) break;
|
||||
}
|
||||
// fall-through
|
||||
default:
|
||||
try {
|
||||
int key=noteKeys.at(ev->key.keysym.scancode);
|
||||
default: {
|
||||
auto it=noteKeys.find(ev->key.keysym.scancode);
|
||||
if (it!=noteKeys.cend()) {
|
||||
int key=it->second;
|
||||
int num=12*curOctave+key;
|
||||
|
||||
if (num<-60) num=-60; // C-(-5)
|
||||
|
@ -3041,9 +3062,9 @@ int FurnaceGUI::processEvent(SDL_Event* ev) {
|
|||
if (key!=100 && key!=101 && key!=102) {
|
||||
previewNote(cursor.xCoarse,num);
|
||||
}
|
||||
} catch (std::out_of_range& e) {
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (ev->type==SDL_KEYUP) {
|
||||
|
|
|
@ -337,9 +337,11 @@ void FurnaceGUI::drawMixer() {
|
|||
if (selectedSubPort>=0) {
|
||||
portDragActive=true;
|
||||
ImGui::InhibitInertialScroll();
|
||||
try {
|
||||
subPortPos=portPos.at((selectedPortSet<<4)|selectedSubPort);
|
||||
} catch (std::out_of_range& e) {
|
||||
|
||||
auto subPortI=portPos.find((selectedPortSet<<4)|selectedSubPort);
|
||||
if (subPortI!=portPos.cend()) {
|
||||
subPortPos=subPortI->second;
|
||||
} else {
|
||||
portDragActive=false;
|
||||
}
|
||||
}
|
||||
|
@ -353,9 +355,10 @@ void FurnaceGUI::drawMixer() {
|
|||
if (selectedSubPort>=0) {
|
||||
portDragActive=true;
|
||||
ImGui::InhibitInertialScroll();
|
||||
try {
|
||||
subPortPos=portPos.at((selectedPortSet<<4)|selectedSubPort);
|
||||
} catch (std::out_of_range& e) {
|
||||
auto subPortI=portPos.find((selectedPortSet<<4)|selectedSubPort);
|
||||
if (subPortI!=portPos.cend()) {
|
||||
subPortPos=subPortI->second;
|
||||
} else {
|
||||
portDragActive=false;
|
||||
}
|
||||
}
|
||||
|
@ -365,9 +368,10 @@ void FurnaceGUI::drawMixer() {
|
|||
if (selectedSubPort>=0) {
|
||||
portDragActive=true;
|
||||
ImGui::InhibitInertialScroll();
|
||||
try {
|
||||
subPortPos=portPos.at((selectedPortSet<<4)|selectedSubPort);
|
||||
} catch (std::out_of_range& e) {
|
||||
auto subPortI=portPos.find((selectedPortSet<<4)|selectedSubPort);
|
||||
if (subPortI!=portPos.cend()) {
|
||||
subPortPos=subPortI->second;
|
||||
} else {
|
||||
portDragActive=false;
|
||||
}
|
||||
}
|
||||
|
@ -380,9 +384,10 @@ void FurnaceGUI::drawMixer() {
|
|||
if (selectedSubPort>=0) {
|
||||
portDragActive=true;
|
||||
ImGui::InhibitInertialScroll();
|
||||
try {
|
||||
subPortPos=portPos.at((selectedPortSet<<4)|selectedSubPort);
|
||||
} catch (std::out_of_range& e) {
|
||||
auto subPortI=portPos.find((selectedPortSet<<4)|selectedSubPort);
|
||||
if (subPortI!=portPos.cend()) {
|
||||
subPortPos=subPortI->second;
|
||||
} else {
|
||||
portDragActive=false;
|
||||
}
|
||||
}
|
||||
|
@ -415,22 +420,24 @@ void FurnaceGUI::drawMixer() {
|
|||
// draw connections
|
||||
for (unsigned int i: e->song.patchbay) {
|
||||
if ((i>>20)==selectedPortSet) continue;
|
||||
try {
|
||||
ImVec2 portSrc=portPos.at(i>>16);
|
||||
ImVec2 portDest=portPos.at(0x10000|(i&0xffff));
|
||||
auto portSrcI=portPos.find(i>>16);
|
||||
auto portDestI=portPos.find(0x10000|(i&0xffff));
|
||||
if (portSrcI!=portPos.cend() && portDestI!=portPos.cend()) {
|
||||
ImVec2 portSrc=portSrcI->second;
|
||||
ImVec2 portDest=portDestI->second;
|
||||
dl->AddLine(portSrc,portDest,ImGui::GetColorU32(uiColors[GUI_COLOR_PATCHBAY_CONNECTION_BG]),2.0f*dpiScale);
|
||||
} catch (std::out_of_range& e) {
|
||||
}
|
||||
}
|
||||
|
||||
// foreground
|
||||
for (unsigned int i: e->song.patchbay) {
|
||||
if ((i>>20)!=selectedPortSet) continue;
|
||||
try {
|
||||
ImVec2 portSrc=portPos.at(i>>16);
|
||||
ImVec2 portDest=portPos.at(0x10000|(i&0xffff));
|
||||
auto portSrcI=portPos.find(i>>16);
|
||||
auto portDestI=portPos.find(0x10000|(i&0xffff));
|
||||
if (portSrcI!=portPos.cend() && portDestI!=portPos.cend()) {
|
||||
ImVec2 portSrc=portSrcI->second;
|
||||
ImVec2 portDest=portDestI->second;
|
||||
dl->AddLine(portSrc,portDest,ImGui::GetColorU32(uiColors[GUI_COLOR_PATCHBAY_CONNECTION]),2.0f*dpiScale);
|
||||
} catch (std::out_of_range& e) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue