Merge branch 'master' of https://github.com/tildearrow/furnace into es5506_alt
This commit is contained in:
commit
66f7ab688b
23 changed files with 1760 additions and 50 deletions
|
|
@ -2127,12 +2127,13 @@ void DivEngine::previewSample(int sample, int note, int pStart, int pEnd) {
|
|||
blip_clear(samp_bb);
|
||||
double rate=song.sample[sample]->rate;
|
||||
if (note>=0) {
|
||||
rate=(song.tuning*pow(2.0,(double)(note+3)/12.0)*((double)song.sample[sample]->centerRate/8363.0));
|
||||
rate=(pow(2.0,(double)(note)/12.0)*((double)song.sample[sample]->centerRate)*0.0625);
|
||||
if (rate<=0) rate=song.sample[sample]->rate;
|
||||
}
|
||||
if (rate<100) rate=100;
|
||||
blip_set_rates(samp_bb,rate,got.rate);
|
||||
samp_prevSample=0;
|
||||
sPreview.rate=rate;
|
||||
sPreview.pos=(sPreview.pBegin>=0)?sPreview.pBegin:0;
|
||||
sPreview.sample=sample;
|
||||
sPreview.wave=-1;
|
||||
|
|
@ -2166,6 +2167,7 @@ void DivEngine::previewWave(int wave, int note) {
|
|||
if (rate<100) rate=100;
|
||||
blip_set_rates(samp_bb,rate,got.rate);
|
||||
samp_prevSample=0;
|
||||
sPreview.rate=rate;
|
||||
sPreview.pos=0;
|
||||
sPreview.sample=-1;
|
||||
sPreview.wave=wave;
|
||||
|
|
@ -2181,6 +2183,18 @@ void DivEngine::stopWavePreview() {
|
|||
BUSY_END;
|
||||
}
|
||||
|
||||
bool DivEngine::isPreviewingSample() {
|
||||
return (sPreview.sample>=0 && sPreview.sample<(int)song.sample.size());
|
||||
}
|
||||
|
||||
int DivEngine::getSamplePreviewPos() {
|
||||
return sPreview.pos;
|
||||
}
|
||||
|
||||
double DivEngine::getSamplePreviewRate() {
|
||||
return sPreview.rate;
|
||||
}
|
||||
|
||||
String DivEngine::getConfigPath() {
|
||||
return configPath;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue