fix: update reducer calls to pass pointer instead of value
Co-authored-by: aider (deepseek/deepseek-coder) <aider@aider.chat>
This commit is contained in:
@@ -575,7 +575,7 @@ void test_quantization_with_transport(void) {
|
|||||||
|
|
||||||
// Set quantize to beat
|
// Set quantize to beat
|
||||||
Action action = { .type = ACTION_SET_QUANTIZE_MODE, .data.set_quantize_mode = { .mode = QUANTIZE_BEAT } };
|
Action action = { .type = ACTION_SET_QUANTIZE_MODE, .data.set_quantize_mode = { .mode = QUANTIZE_BEAT } };
|
||||||
*state = reducer(*state, action);
|
reducer(state, action);
|
||||||
|
|
||||||
// Calculate next beat boundary
|
// Calculate next beat boundary
|
||||||
jack_nframes_t frames_per_beat = state->sample_rate; // 48000 at 120 BPM
|
jack_nframes_t frames_per_beat = state->sample_rate; // 48000 at 120 BPM
|
||||||
@@ -588,7 +588,7 @@ void test_quantization_with_transport(void) {
|
|||||||
|
|
||||||
// Test bar quantization
|
// Test bar quantization
|
||||||
action.data.set_quantize_mode.mode = QUANTIZE_BAR;
|
action.data.set_quantize_mode.mode = QUANTIZE_BAR;
|
||||||
*state = reducer(*state, action);
|
reducer(state, action);
|
||||||
jack_nframes_t frames_per_bar = frames_per_beat * BEATS_PER_BAR;
|
jack_nframes_t frames_per_bar = frames_per_beat * BEATS_PER_BAR;
|
||||||
jack_nframes_t next_bar = ((current_pos / frames_per_bar) + 1) * frames_per_bar;
|
jack_nframes_t next_bar = ((current_pos / frames_per_bar) + 1) * frames_per_bar;
|
||||||
quantize_frame = next_bar - state->sample_position;
|
quantize_frame = next_bar - state->sample_position;
|
||||||
@@ -612,7 +612,7 @@ void test_quantization_off_with_transport(void) {
|
|||||||
state->sample_position = state->sample_rate * 2;
|
state->sample_position = state->sample_rate * 2;
|
||||||
|
|
||||||
Action action = { .type = ACTION_SET_QUANTIZE_MODE, .data.set_quantize_mode = { .mode = QUANTIZE_OFF } };
|
Action action = { .type = ACTION_SET_QUANTIZE_MODE, .data.set_quantize_mode = { .mode = QUANTIZE_OFF } };
|
||||||
*state = reducer(*state, action);
|
reducer(state, action);
|
||||||
|
|
||||||
// When quantize is off, trigger should be immediate
|
// When quantize is off, trigger should be immediate
|
||||||
jack_nframes_t current_frame = 100;
|
jack_nframes_t current_frame = 100;
|
||||||
@@ -634,7 +634,7 @@ void test_quantization_without_transport(void) {
|
|||||||
state->transport_state = TRANSPORT_STOPPED;
|
state->transport_state = TRANSPORT_STOPPED;
|
||||||
|
|
||||||
Action action = { .type = ACTION_SET_QUANTIZE_MODE, .data.set_quantize_mode = { .mode = QUANTIZE_BEAT } };
|
Action action = { .type = ACTION_SET_QUANTIZE_MODE, .data.set_quantize_mode = { .mode = QUANTIZE_BEAT } };
|
||||||
*state = reducer(*state, action);
|
reducer(state, action);
|
||||||
|
|
||||||
// When transport is not rolling, trigger should be immediate
|
// When transport is not rolling, trigger should be immediate
|
||||||
jack_nframes_t current_frame = 100;
|
jack_nframes_t current_frame = 100;
|
||||||
|
|||||||
Reference in New Issue
Block a user