mirror of
https://github.com/tildearrow/furnace.git
synced 2024-11-24 05:25:12 +00:00
prepare for better ins del safety
This commit is contained in:
parent
fea783eaac
commit
0545775de6
3 changed files with 12 additions and 0 deletions
|
@ -196,6 +196,11 @@ class DivDispatch {
|
||||||
*/
|
*/
|
||||||
void setSkipRegisterWrites(bool value);
|
void setSkipRegisterWrites(bool value);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* notify deletion of an instrument.
|
||||||
|
*/
|
||||||
|
virtual void notifyInsDeletion(void* ins);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* force-retrigger instruments.
|
* force-retrigger instruments.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -2706,6 +2706,9 @@ int DivEngine::addInstrument(int refChan) {
|
||||||
void DivEngine::delInstrument(int index) {
|
void DivEngine::delInstrument(int index) {
|
||||||
isBusy.lock();
|
isBusy.lock();
|
||||||
if (index>=0 && index<(int)song.ins.size()) {
|
if (index>=0 && index<(int)song.ins.size()) {
|
||||||
|
for (int i=0; i<song.systemLen; i++) {
|
||||||
|
disCont[i].dispatch->notifyInsDeletion(song.ins[index]);
|
||||||
|
}
|
||||||
delete song.ins[index];
|
delete song.ins[index];
|
||||||
song.ins.erase(song.ins.begin()+index);
|
song.ins.erase(song.ins.begin()+index);
|
||||||
song.insLen=song.ins.size();
|
song.insLen=song.ins.size();
|
||||||
|
|
|
@ -46,6 +46,10 @@ void DivDispatch::setSkipRegisterWrites(bool value) {
|
||||||
skipRegisterWrites=value;
|
skipRegisterWrites=value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DivDispatch::notifyInsDeletion(void* ins) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
void DivDispatch::forceIns() {
|
void DivDispatch::forceIns() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue