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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue