Unified · Split
| @@ -230,10 +230,10 @@ float tSampler_tick (tSampler* const sp) · 229 unmodified lines | |||
| 230 | { | 230 | { |
| 231 | _tSampler* p = *sp; | 231 | _tSampler* p = *sp; |
| 232 | 232 | ||
| 233 | if (p->active == 0) return 0.f; | ||
| 234 | |||
| 235 | attemptStartEndChange(sp); | 233 | attemptStartEndChange(sp); |
| 236 | 234 | ||
| 235 | if (p->active == 0) return 0.f; | ||
| 236 | |||
| 237 | if ((p->inc == 0.0f) || (p->len < 2)) | 237 | if ((p->inc == 0.0f) || (p->len < 2)) |
| 238 | { | 238 | { |
| 239 | // p->inCrossfade = 1; | 239 | // p->inCrossfade = 1; |
| @@ -573,9 +573,8 @@ void tSampler_setStart (tSampler* const sp, int32_t start) · 333 unmodified lines | |||
| 573 | { | 573 | { |
| 574 | return; | 574 | return; |
| 575 | } | 575 | } |
| 576 | // if (p->active) | 576 | if (p->active) // only bother with these checks if we're actually playing |
| 577 | { | 577 | { |
| 578 | |||
| 579 | if (start > p->end) | 578 | if (start > p->end) |
| 580 | { | 579 | { |
| 581 | tempflip = -1; | 580 | tempflip = -1; |
| @@ -611,11 +610,10 @@ void tSampler_setStart (tSampler* const sp, int32_t start) · 29 unmodified lines | |||
| 611 | return; | 610 | return; |
| 612 | } | 611 | } |
| 613 | } | 612 | } |
| 614 | } | 613 | if (tempflip != p->flip && p->flipStart < 0) |
| 615 | 614 | { | |
| 616 | if (tempflip != p->flip && p->flipStart < 0) | 615 | p->flipIdx = 0; |
| 617 | { | 616 | } |
| 618 | p->flipIdx = 0; | ||
| 619 | } | 617 | } |
| 620 | 618 | ||
| 621 | p->start = LEAF_clipInt(0, start, p->samp->recordedLength-1); | 619 | 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 | |||
| 634 | { | 632 | { |
| 635 | return; | 633 | return; |
| 636 | } | 634 | } |
| 637 | //if (p->active) | 635 | if (p->active) // only bother with these checks if we're actually playing |
| 638 | { | 636 | { |
| 639 | |||
| 640 | |||
| 641 | if (p->start > end) | 637 | if (p->start > end) |
| 642 | { | 638 | { |
| 643 | tempflip = -1; | 639 | tempflip = -1; |
| @@ -673,11 +669,10 @@ void tSampler_setEnd (tSampler* const sp, int32_t end) · 29 unmodified lines | |||
| 673 | return; | 669 | return; |
| 674 | } | 670 | } |
| 675 | } | 671 | } |
| 676 | } | 672 | if (tempflip != p->flip && p->flipStart < 0) |
| 677 | 673 | { | |
| 678 | if (tempflip != p->flip && p->flipStart < 0) | 674 | p->flipIdx = 0; |
| 679 | { | 675 | } |
| 680 | p->flipIdx = 0; | ||
| 681 | } | 676 | } |
| 682 | 677 | ||
| 683 | p->end = LEAF_clipInt(0, end, p->samp->recordedLength-1); | 678 | p->end = LEAF_clipInt(0, end, p->samp->recordedLength-1); |