GUI: prepare for more UX improvements
- add "temporary instrument" to DivEngine - prepare for two things: - instrument preview on file picker (at least built-in one) - instrument selector for banks (#364)
This commit is contained in:
parent
2e52a2855c
commit
b3f1935f2b
3 changed files with 16 additions and 1 deletions
|
|
@ -739,6 +739,7 @@ String DivEngine::getWarnings() {
|
|||
}
|
||||
|
||||
DivInstrument* DivEngine::getIns(int index, DivInstrumentType fallbackType) {
|
||||
if (index==-2 && tempIns!=NULL) return tempIns;
|
||||
if (index<0 || index>=song.insLen) {
|
||||
switch (fallbackType) {
|
||||
case DIV_INS_OPLL:
|
||||
|
|
@ -1363,6 +1364,15 @@ int DivEngine::addInstrumentPtr(DivInstrument* which) {
|
|||
return song.insLen;
|
||||
}
|
||||
|
||||
void DivEngine::loadTempIns(DivInstrument* which) {
|
||||
BUSY_BEGIN;
|
||||
if (tempIns==NULL) {
|
||||
tempIns=new DivInstrument;
|
||||
}
|
||||
memcpy(tempIns,which,sizeof(DivInstrument));
|
||||
BUSY_END;
|
||||
}
|
||||
|
||||
void DivEngine::delInstrument(int index) {
|
||||
BUSY_BEGIN;
|
||||
saveLock.lock();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue