Merge pull request #1507 from ColinKinloch/select_opened
Select loaded instrument on open
This commit is contained in:
commit
bcd2602624
|
|
@ -3616,17 +3616,29 @@ bool FurnaceGUI::loop() {
|
||||||
if (!e->getWarnings().empty()) {
|
if (!e->getWarnings().empty()) {
|
||||||
showWarning(e->getWarnings(),GUI_WARN_GENERIC);
|
showWarning(e->getWarnings(),GUI_WARN_GENERIC);
|
||||||
}
|
}
|
||||||
|
int instrumentCount = -1;
|
||||||
for (DivInstrument* i: instruments) {
|
for (DivInstrument* i: instruments) {
|
||||||
e->addInstrumentPtr(i);
|
instrumentCount = e->addInstrumentPtr(i);
|
||||||
|
}
|
||||||
|
if (instrumentCount >= 0) {
|
||||||
|
curIns = instrumentCount - 1;
|
||||||
}
|
}
|
||||||
nextWindow=GUI_WINDOW_INS_LIST;
|
nextWindow=GUI_WINDOW_INS_LIST;
|
||||||
MARK_MODIFIED;
|
MARK_MODIFIED;
|
||||||
} else if ((droppedWave=e->waveFromFile(ev.drop.file,false))!=NULL) {
|
} else if ((droppedWave=e->waveFromFile(ev.drop.file,false))!=NULL) {
|
||||||
e->addWavePtr(droppedWave);
|
int waveCount = -1;
|
||||||
|
waveCount = e->addWavePtr(droppedWave);
|
||||||
|
if (waveCount >= 0) {
|
||||||
|
curWave = waveCount - 1;
|
||||||
|
}
|
||||||
nextWindow=GUI_WINDOW_WAVE_LIST;
|
nextWindow=GUI_WINDOW_WAVE_LIST;
|
||||||
MARK_MODIFIED;
|
MARK_MODIFIED;
|
||||||
} else if ((droppedSample=e->sampleFromFile(ev.drop.file))!=NULL) {
|
} else if ((droppedSample=e->sampleFromFile(ev.drop.file))!=NULL) {
|
||||||
e->addSamplePtr(droppedSample);
|
int sampleCount = -1;
|
||||||
|
sampleCount = e->addSamplePtr(droppedSample);
|
||||||
|
if (sampleCount >= 0) {
|
||||||
|
curSample = sampleCount;
|
||||||
|
}
|
||||||
nextWindow=GUI_WINDOW_SAMPLE_LIST;
|
nextWindow=GUI_WINDOW_SAMPLE_LIST;
|
||||||
MARK_MODIFIED;
|
MARK_MODIFIED;
|
||||||
} else if (modified) {
|
} else if (modified) {
|
||||||
|
|
@ -5156,8 +5168,12 @@ bool FurnaceGUI::loop() {
|
||||||
displayPendingIns=true;
|
displayPendingIns=true;
|
||||||
pendingInsSingle=false;
|
pendingInsSingle=false;
|
||||||
} else { // load the only instrument
|
} else { // load the only instrument
|
||||||
|
int instrumentCount = -1;
|
||||||
for (DivInstrument* i: instruments) {
|
for (DivInstrument* i: instruments) {
|
||||||
e->addInstrumentPtr(i);
|
instrumentCount = e->addInstrumentPtr(i);
|
||||||
|
}
|
||||||
|
if (instrumentCount >= 0) {
|
||||||
|
curIns = instrumentCount - 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -5207,7 +5223,9 @@ bool FurnaceGUI::loop() {
|
||||||
showError("cannot load wavetable! ("+e->getLastError()+")");
|
showError("cannot load wavetable! ("+e->getLastError()+")");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (e->addWavePtr(wave)==-1) {
|
int waveCount = -1;
|
||||||
|
waveCount = e->addWavePtr(wave);
|
||||||
|
if (waveCount==-1) {
|
||||||
if (fileDialog->getFileName().size()>1) {
|
if (fileDialog->getFileName().size()>1) {
|
||||||
warn=true;
|
warn=true;
|
||||||
errs+=fmt::sprintf("- %s: %s\n",i,e->getLastError());
|
errs+=fmt::sprintf("- %s: %s\n",i,e->getLastError());
|
||||||
|
|
@ -5215,6 +5233,7 @@ bool FurnaceGUI::loop() {
|
||||||
showError("cannot load wavetable! ("+e->getLastError()+")");
|
showError("cannot load wavetable! ("+e->getLastError()+")");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
curWave = waveCount -1;
|
||||||
MARK_MODIFIED;
|
MARK_MODIFIED;
|
||||||
RESET_WAVE_MACRO_ZOOM;
|
RESET_WAVE_MACRO_ZOOM;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue