Skip to content

Commit

Permalink
Ensure consistent behaviour when triggered by auto loop mode
Browse files Browse the repository at this point in the history
  • Loading branch information
jonfryd committed Nov 23, 2024
1 parent 91b033e commit 60eb97e
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1472,15 +1472,10 @@ void Display::input() {
break;
case SDLK_COMMA:
case SDLK_KP_COMMA:
buffer_play_loop_mode_ = buffer_play_loop_mode_ != Loop::pingpong ? Loop::pingpong : Loop::off;
play_ = false;
tick_playback_ = true;
set_buffer_play_loop_mode(buffer_play_loop_mode_ != Loop::pingpong ? Loop::pingpong : Loop::off);
break;
case SDLK_PERIOD:
buffer_play_loop_mode_ = buffer_play_loop_mode_ != Loop::forwardonly ? Loop::forwardonly : Loop::off;
buffer_play_forward_ = true;
play_ = false;
tick_playback_ = true;
set_buffer_play_loop_mode(buffer_play_loop_mode_ != Loop::forwardonly ? Loop::forwardonly : Loop::off);
break;
case SDLK_1:
case SDLK_KP_1:
Expand Down Expand Up @@ -1662,6 +1657,12 @@ Display::Loop Display::get_buffer_play_loop_mode() const {

void Display::set_buffer_play_loop_mode(const Display::Loop& mode) {
buffer_play_loop_mode_ = mode;
play_ = false;
tick_playback_ = true;

if (mode == Loop::forwardonly) {
buffer_play_forward_ = true;
}
}

bool Display::get_buffer_play_forward() const {
Expand Down

0 comments on commit 60eb97e

Please sign in to comment.