Skip to content
Snippets Groups Projects
Commit 772705e4 authored by David Huss's avatar David Huss :speech_balloon:
Browse files

Loop bounds are now copied over to fresh buffers

This is fixes a minor inconvenience where new buffers didn't have their
loop start and loop length set.

Changelog: fix
parent 52d622bc
Branches fix-buffer
Tags
No related merge requests found
......@@ -170,6 +170,7 @@ class Looper {
float grain_spread = 2.0f;
float grain_variation = 0.0f;
float volume = 1.0f;
bool fresh = true;
RecPitchMode rec_pitch_mode = REC_PITCH_MODE_NORMAL;
RecStartMode rec_start_mode = REC_START_MODE_BUFFER;
PlaybackState playback_state = PLAYBACK_STATE_LOOP;
......
......@@ -336,26 +336,46 @@ class Ui {
button_1.onPress([this, n](){
previous_buffer = active_buffer;
active_buffer = ACTIVE_BUFFER_A;
if (this->activeLooper()->fresh) {
this->activeLooper()->fresh = false;
this->activeLooper()->SetLoop(this->previousLooper()->loop_start_f, this->previousLooper()->loop_length_f);
}
waveform_cache_dirty = true;
});
button_2.onPress([this, n](){
previous_buffer = active_buffer;
active_buffer = ACTIVE_BUFFER_B;
if (this->activeLooper()->fresh) {
this->activeLooper()->fresh = false;
this->activeLooper()->SetLoop(this->previousLooper()->loop_start_f, this->previousLooper()->loop_length_f);
}
waveform_cache_dirty = true;
});
button_3.onPress([this, n](){
previous_buffer = active_buffer;
active_buffer = ACTIVE_BUFFER_C;
if (this->activeLooper()->fresh) {
this->activeLooper()->fresh = false;
this->activeLooper()->SetLoop(this->previousLooper()->loop_start_f, this->previousLooper()->loop_length_f);
}
waveform_cache_dirty = true;
});
button_4.onPress([this, n](){
previous_buffer = active_buffer;
active_buffer = ACTIVE_BUFFER_D;
if (this->activeLooper()->fresh) {
this->activeLooper()->fresh = false;
this->activeLooper()->SetLoop(this->previousLooper()->loop_start_f, this->previousLooper()->loop_length_f);
}
waveform_cache_dirty = true;
});
button_5.onPress([this, n](){
previous_buffer = active_buffer;
active_buffer = ACTIVE_BUFFER_E;
if (this->activeLooper()->fresh) {
this->activeLooper()->fresh = false;
this->activeLooper()->SetLoop(this->previousLooper()->loop_start_f, this->previousLooper()->loop_length_f);
}
waveform_cache_dirty = true;
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment