parent
9ef3ec19bc
commit
c5df68f8af
6 changed files with 94 additions and 7 deletions
|
|
@ -2686,12 +2686,17 @@ void DivEngine::unmuteAll() {
|
|||
BUSY_END;
|
||||
}
|
||||
|
||||
int DivEngine::addInstrument(int refChan) {
|
||||
int DivEngine::addInstrument(int refChan, DivInstrumentType fallbackType) {
|
||||
if (song.ins.size()>=256) return -1;
|
||||
BUSY_BEGIN;
|
||||
DivInstrument* ins=new DivInstrument;
|
||||
int insCount=(int)song.ins.size();
|
||||
DivInstrumentType prefType=getPreferInsType(refChan);
|
||||
DivInstrumentType prefType;
|
||||
if (refChan<0) {
|
||||
prefType=fallbackType;
|
||||
} else {
|
||||
prefType=getPreferInsType(refChan);
|
||||
}
|
||||
switch (prefType) {
|
||||
case DIV_INS_OPLL:
|
||||
*ins=song.nullInsOPLL;
|
||||
|
|
@ -2705,8 +2710,10 @@ int DivEngine::addInstrument(int refChan) {
|
|||
default:
|
||||
break;
|
||||
}
|
||||
if (sysOfChan[refChan]==DIV_SYSTEM_QSOUND) {
|
||||
*ins=song.nullInsQSound;
|
||||
if (refChan>=0) {
|
||||
if (sysOfChan[refChan]==DIV_SYSTEM_QSOUND) {
|
||||
*ins=song.nullInsQSound;
|
||||
}
|
||||
}
|
||||
ins->name=fmt::sprintf("Instrument %d",insCount);
|
||||
if (prefType!=DIV_INS_NULL) {
|
||||
|
|
|
|||
|
|
@ -759,7 +759,7 @@ class DivEngine {
|
|||
bool isExporting();
|
||||
|
||||
// add instrument
|
||||
int addInstrument(int refChan=0);
|
||||
int addInstrument(int refChan=0, DivInstrumentType fallbackType=DIV_INS_STD);
|
||||
|
||||
// add instrument from pointer
|
||||
int addInstrumentPtr(DivInstrument* which);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue