History

always let sampler update start and end if it's not playing

Matthew Wang committed 6 years ago

Commit 5f6600e1 parent a9497521 file · +12 −17Browse files

Unified · Split

LEAF/Src/leaf-sampling.c+12−17
@@ -230,10 +230,10 @@ float tSampler_tick (tSampler* const sp) · 229 unmodified lines
230230 {
231231 _tSampler* p = *sp;
232232
233− if (p->active == 0) return 0.f;
234−
235233 attemptStartEndChange(sp);
236234
235+ if (p->active == 0) return 0.f;
236+
237237 if ((p->inc == 0.0f) || (p->len < 2))
238238 {
239239 // p->inCrossfade = 1;
@@ -573,9 +573,8 @@ void tSampler_setStart (tSampler* const sp, int32_t start) · 333 unmodified lines
573573 {
574574 return;
575575 }
576− // if (p->active)
576+ if (p->active) // only bother with these checks if we're actually playing
577577 {
578−
579578 if (start > p->end)
580579 {
581580 tempflip = -1;
@@ -611,11 +610,10 @@ void tSampler_setStart (tSampler* const sp, int32_t start) · 29 unmodified lines
611610 return;
612611 }
613612 }
614− }
615−
616− if (tempflip != p->flip && p->flipStart < 0)
617− {
618− p->flipIdx = 0;
613+ if (tempflip != p->flip && p->flipStart < 0)
614+ {
615+ p->flipIdx = 0;
616+ }
619617 }
620618
621619 p->start = LEAF_clipInt(0, start, p->samp->recordedLength-1);
@@ -634,10 +632,8 @@ void tSampler_setEnd (tSampler* const sp, int32_t end) · 12 unmodified lines
634632 {
635633 return;
636634 }
637− //if (p->active)
635+ if (p->active) // only bother with these checks if we're actually playing
638636 {
639−
640−
641637 if (p->start > end)
642638 {
643639 tempflip = -1;
@@ -673,11 +669,10 @@ void tSampler_setEnd (tSampler* const sp, int32_t end) · 29 unmodified lines
673669 return;
674670 }
675671 }
676− }
677−
678− if (tempflip != p->flip && p->flipStart < 0)
679− {
680− p->flipIdx = 0;
672+ if (tempflip != p->flip && p->flipStart < 0)
673+ {
674+ p->flipIdx = 0;
675+ }
681676 }
682677
683678 p->end = LEAF_clipInt(0, end, p->samp->recordedLength-1);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t