GUI: add a setting (select asset om load)
This commit is contained in:
parent
bcd2602624
commit
37190d1c2d
|
@ -3616,28 +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;
|
int instrumentCount=-1;
|
||||||
for (DivInstrument* i: instruments) {
|
for (DivInstrument* i: instruments) {
|
||||||
instrumentCount = e->addInstrumentPtr(i);
|
instrumentCount=e->addInstrumentPtr(i);
|
||||||
}
|
}
|
||||||
if (instrumentCount >= 0) {
|
if (instrumentCount>=0 && settings.selectAssetOnLoad) {
|
||||||
curIns = instrumentCount - 1;
|
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) {
|
||||||
int waveCount = -1;
|
int waveCount=-1;
|
||||||
waveCount = e->addWavePtr(droppedWave);
|
waveCount=e->addWavePtr(droppedWave);
|
||||||
if (waveCount >= 0) {
|
if (waveCount>=0 && settings.selectAssetOnLoad) {
|
||||||
curWave = waveCount - 1;
|
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) {
|
||||||
int sampleCount = -1;
|
int sampleCount=-1;
|
||||||
sampleCount = e->addSamplePtr(droppedSample);
|
sampleCount=e->addSamplePtr(droppedSample);
|
||||||
if (sampleCount >= 0) {
|
if (sampleCount>=0 && settings.selectAssetOnLoad) {
|
||||||
curSample = sampleCount;
|
curSample=sampleCount;
|
||||||
|
updateSampleTex=true;
|
||||||
}
|
}
|
||||||
nextWindow=GUI_WINDOW_SAMPLE_LIST;
|
nextWindow=GUI_WINDOW_SAMPLE_LIST;
|
||||||
MARK_MODIFIED;
|
MARK_MODIFIED;
|
||||||
|
@ -5168,12 +5169,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;
|
int instrumentCount=-1;
|
||||||
for (DivInstrument* i: instruments) {
|
for (DivInstrument* i: instruments) {
|
||||||
instrumentCount = e->addInstrumentPtr(i);
|
instrumentCount=e->addInstrumentPtr(i);
|
||||||
}
|
}
|
||||||
if (instrumentCount >= 0) {
|
if (instrumentCount>=0 && settings.selectAssetOnLoad) {
|
||||||
curIns = instrumentCount - 1;
|
curIns=instrumentCount-1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5223,8 +5224,8 @@ bool FurnaceGUI::loop() {
|
||||||
showError("cannot load wavetable! ("+e->getLastError()+")");
|
showError("cannot load wavetable! ("+e->getLastError()+")");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
int waveCount = -1;
|
int waveCount=-1;
|
||||||
waveCount = e->addWavePtr(wave);
|
waveCount=e->addWavePtr(wave);
|
||||||
if (waveCount==-1) {
|
if (waveCount==-1) {
|
||||||
if (fileDialog->getFileName().size()>1) {
|
if (fileDialog->getFileName().size()>1) {
|
||||||
warn=true;
|
warn=true;
|
||||||
|
@ -5233,7 +5234,9 @@ bool FurnaceGUI::loop() {
|
||||||
showError("cannot load wavetable! ("+e->getLastError()+")");
|
showError("cannot load wavetable! ("+e->getLastError()+")");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
curWave = waveCount -1;
|
if (settings.selectAssetOnLoad) {
|
||||||
|
curWave=waveCount-1;
|
||||||
|
}
|
||||||
MARK_MODIFIED;
|
MARK_MODIFIED;
|
||||||
RESET_WAVE_MACRO_ZOOM;
|
RESET_WAVE_MACRO_ZOOM;
|
||||||
}
|
}
|
||||||
|
@ -7776,15 +7779,15 @@ FurnaceGUI::FurnaceGUI():
|
||||||
|
|
||||||
waveGenAmp[0]=1.0f;
|
waveGenAmp[0]=1.0f;
|
||||||
waveGenFMCon0[0]=false;
|
waveGenFMCon0[0]=false;
|
||||||
waveGenFMCon1[0]= true;
|
waveGenFMCon1[0]=true;
|
||||||
waveGenFMCon2[1]= true;
|
waveGenFMCon2[1]=true;
|
||||||
waveGenFMCon3[2] = true;
|
waveGenFMCon3[2]=true;
|
||||||
waveGenFMCon4[0]= false;
|
waveGenFMCon4[0]=false;
|
||||||
|
|
||||||
waveGenFMCon0[4] = false;
|
waveGenFMCon0[4]=false;
|
||||||
waveGenFMCon1[4] = false;
|
waveGenFMCon1[4]=false;
|
||||||
waveGenFMCon2[4] = false;
|
waveGenFMCon2[4]=false;
|
||||||
waveGenFMCon3[4] = true;
|
waveGenFMCon3[4]=true;
|
||||||
|
|
||||||
memset(keyHit,0,sizeof(float)*DIV_MAX_CHANS);
|
memset(keyHit,0,sizeof(float)*DIV_MAX_CHANS);
|
||||||
memset(keyHit1,0,sizeof(float)*DIV_MAX_CHANS);
|
memset(keyHit1,0,sizeof(float)*DIV_MAX_CHANS);
|
||||||
|
|
|
@ -1638,6 +1638,7 @@ class FurnaceGUI {
|
||||||
int fontBitmap;
|
int fontBitmap;
|
||||||
int fontAutoHint;
|
int fontAutoHint;
|
||||||
int fontAntiAlias;
|
int fontAntiAlias;
|
||||||
|
int selectAssetOnLoad;
|
||||||
unsigned int maxUndoSteps;
|
unsigned int maxUndoSteps;
|
||||||
String mainFontPath;
|
String mainFontPath;
|
||||||
String headFontPath;
|
String headFontPath;
|
||||||
|
@ -1832,6 +1833,7 @@ class FurnaceGUI {
|
||||||
fontBitmap(0),
|
fontBitmap(0),
|
||||||
fontAutoHint(1),
|
fontAutoHint(1),
|
||||||
fontAntiAlias(1),
|
fontAntiAlias(1),
|
||||||
|
selectAssetOnLoad(1),
|
||||||
maxUndoSteps(100),
|
maxUndoSteps(100),
|
||||||
mainFontPath(""),
|
mainFontPath(""),
|
||||||
headFontPath(""),
|
headFontPath(""),
|
||||||
|
|
|
@ -2370,6 +2370,12 @@ void FurnaceGUI::drawSettings() {
|
||||||
settingsChanged=true;
|
settingsChanged=true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool selectAssetOnLoadB=settings.selectAssetOnLoad;
|
||||||
|
if (ImGui::Checkbox("Select asset after opening one",&selectAssetOnLoadB)) {
|
||||||
|
settings.selectAssetOnLoad=selectAssetOnLoadB;
|
||||||
|
settingsChanged=true;
|
||||||
|
}
|
||||||
|
|
||||||
END_SECTION;
|
END_SECTION;
|
||||||
}
|
}
|
||||||
CONFIG_SECTION("Appearance") {
|
CONFIG_SECTION("Appearance") {
|
||||||
|
@ -3799,6 +3805,7 @@ void FurnaceGUI::syncSettings() {
|
||||||
settings.fontBitmap=e->getConfInt("fontBitmap",0);
|
settings.fontBitmap=e->getConfInt("fontBitmap",0);
|
||||||
settings.fontAutoHint=e->getConfInt("fontAutoHint",1);
|
settings.fontAutoHint=e->getConfInt("fontAutoHint",1);
|
||||||
settings.fontAntiAlias=e->getConfInt("fontAntiAlias",1);
|
settings.fontAntiAlias=e->getConfInt("fontAntiAlias",1);
|
||||||
|
settings.selectAssetOnLoad=e->getConfInt("selectAssetOnLoad",1);
|
||||||
|
|
||||||
clampSetting(settings.mainFontSize,2,96);
|
clampSetting(settings.mainFontSize,2,96);
|
||||||
clampSetting(settings.headFontSize,2,96);
|
clampSetting(settings.headFontSize,2,96);
|
||||||
|
@ -3964,6 +3971,7 @@ void FurnaceGUI::syncSettings() {
|
||||||
clampSetting(settings.fontBitmap,0,1);
|
clampSetting(settings.fontBitmap,0,1);
|
||||||
clampSetting(settings.fontAutoHint,0,2);
|
clampSetting(settings.fontAutoHint,0,2);
|
||||||
clampSetting(settings.fontAntiAlias,0,1);
|
clampSetting(settings.fontAntiAlias,0,1);
|
||||||
|
clampSetting(settings.selectAssetOnLoad,0,1);
|
||||||
|
|
||||||
if (settings.exportLoops<0.0) settings.exportLoops=0.0;
|
if (settings.exportLoops<0.0) settings.exportLoops=0.0;
|
||||||
if (settings.exportFadeOut<0.0) settings.exportFadeOut=0.0;
|
if (settings.exportFadeOut<0.0) settings.exportFadeOut=0.0;
|
||||||
|
@ -4244,6 +4252,7 @@ void FurnaceGUI::commitSettings() {
|
||||||
e->setConf("fontBitmap",settings.fontBitmap);
|
e->setConf("fontBitmap",settings.fontBitmap);
|
||||||
e->setConf("fontAutoHint",settings.fontAutoHint);
|
e->setConf("fontAutoHint",settings.fontAutoHint);
|
||||||
e->setConf("fontAntiAlias",settings.fontAntiAlias);
|
e->setConf("fontAntiAlias",settings.fontAntiAlias);
|
||||||
|
e->setConf("selectAssetOnLoad",settings.selectAssetOnLoad);
|
||||||
|
|
||||||
// colors
|
// colors
|
||||||
for (int i=0; i<GUI_COLOR_MAX; i++) {
|
for (int i=0; i<GUI_COLOR_MAX; i++) {
|
||||||
|
|
Loading…
Reference in a new issue