From eb26bc51b9b38cd5af64c0758dcb8d14b693bb9a Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Fri, 27 Apr 2012 19:07:15 +0000 Subject: [PATCH] Add commit commands which always stay and always advance regardless of the auto advance setting Originally committed to SVN as r6719. --- aegisub/src/command/audio.cpp | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/aegisub/src/command/audio.cpp b/aegisub/src/command/audio.cpp index 561b19be8..764033163 100644 --- a/aegisub/src/command/audio.cpp +++ b/aegisub/src/command/audio.cpp @@ -347,6 +347,37 @@ struct audio_commit : public validate_audio_open { } }; +/// Commit any pending audio timing changes and move to the next line +/// @todo maybe move to time? +struct audio_commit_next : public validate_audio_open { + CMD_NAME("audio/commit/next") + STR_MENU("Commit and move to next line") + STR_DISP("Commit and move to next line") + STR_HELP("Commit and move to next line") + + void operator()(agi::Context *c) { + AudioTimingController *tc = c->audioController->GetTimingController(); + if (tc) { + tc->Commit(); + tc->Next(AudioTimingController::LINE); + } + } +}; + +/// Commit any pending audio timing changes and stay on the current line +/// @todo maybe move to time? +struct audio_commit_stay : public validate_audio_open { + CMD_NAME("audio/commit/stay") + STR_MENU("Commit and stay on current line") + STR_DISP("Commit and stay on current line") + STR_HELP("Commit and stay on current line") + + void operator()(agi::Context *c) { + AudioTimingController *tc = c->audioController->GetTimingController(); + if (tc) tc->Commit(); + } +}; + /// Scroll the audio display to the current selection struct audio_go_to : public validate_audio_open { CMD_NAME("audio/go_to") @@ -500,6 +531,8 @@ namespace cmd { reg(new audio_autoscroll); reg(new audio_close); reg(new audio_commit); + reg(new audio_commit_next); + reg(new audio_commit_stay); reg(new audio_go_to); reg(new audio_open); reg(new audio_open_blank);