wave+sample drag&drop, and supporting swap via ctrl-drag
This commit is contained in:
parent
6ffc495c81
commit
32ea140a61
5 changed files with 104 additions and 33 deletions
|
|
@ -3262,6 +3262,39 @@ bool DivEngine::swapInstruments(int a, int b) {
|
|||
return true;
|
||||
}
|
||||
|
||||
bool DivEngine::swapWaves(int a, int b) {
|
||||
if (a<0 || a>=(int)song.wave.size() || b<0 || b>=(int)song.wave.size()) return false;
|
||||
BUSY_BEGIN;
|
||||
DivWavetable* temp=song.wave[a];
|
||||
saveLock.lock();
|
||||
song.wave[a]=song.wave[b];
|
||||
song.wave[b]=temp;
|
||||
exchangeWave(a,b);
|
||||
moveAsset(song.waveDir,a,b);
|
||||
saveLock.unlock();
|
||||
BUSY_END;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool DivEngine::swapSamples(int a, int b) {
|
||||
if (a<0 || a>=(int)song.sample.size() || b<0 || b>=(int)song.sample.size()) return false;
|
||||
BUSY_BEGIN;
|
||||
sPreview.sample=-1;
|
||||
sPreview.pos=0;
|
||||
sPreview.dir=false;
|
||||
DivSample* temp=song.sample[a];
|
||||
saveLock.lock();
|
||||
song.sample[a]=song.sample[b];
|
||||
song.sample[b]=temp;
|
||||
exchangeSample(a,b);
|
||||
moveAsset(song.sampleDir,a,b);
|
||||
saveLock.unlock();
|
||||
renderSamples();
|
||||
BUSY_END;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void DivEngine::autoPatchbay() {
|
||||
song.patchbay.clear();
|
||||
for (unsigned int i=0; i<song.systemLen; i++) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue