Add audio/commit/default command

This command commits the current line, advances to the next line (even
if Auto Next on Commit is disabled), and resets the next line's time to
the default timing as if the next line was zero-timed. Add a default
hotkey of Shift-G, but don't bother with a toolbar button for now as
demand for this turned out to be fairly low.

Closes #946.

Originally committed to SVN as r6720.
This commit is contained in:
Thomas Goyne 2012-04-27 19:07:21 +00:00
parent eb26bc51b9
commit 8b854283b7
2 changed files with 27 additions and 3 deletions

View File

@ -335,7 +335,7 @@ struct audio_commit : public validate_audio_open {
CMD_NAME("audio/commit")
STR_MENU("Commit")
STR_DISP("Commit")
STR_HELP("Commit")
STR_HELP("Commit any pending audio timing changes")
void operator()(agi::Context *c) {
AudioTimingController *tc = c->audioController->GetTimingController();
@ -347,13 +347,30 @@ struct audio_commit : public validate_audio_open {
}
};
/// Commit any pending audio timing changes
/// @todo maybe move to time?
struct audio_commit_default : public validate_audio_open {
CMD_NAME("audio/commit/default")
STR_MENU("Commit and use default timing for next line")
STR_DISP("Commit and use default timing for next line")
STR_HELP("Commit any pending audio timing changes and reset the next line's times to the default")
void operator()(agi::Context *c) {
AudioTimingController *tc = c->audioController->GetTimingController();
if (tc) {
tc->Commit();
tc->Next(AudioTimingController::LINE_RESET_DEFAULT);
}
}
};
/// 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")
STR_HELP("Commit any pending audio timing changes and move to the next line")
void operator()(agi::Context *c) {
AudioTimingController *tc = c->audioController->GetTimingController();
@ -370,7 +387,7 @@ 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")
STR_HELP("Commit any pending audio timing changes and stay on the current line")
void operator()(agi::Context *c) {
AudioTimingController *tc = c->audioController->GetTimingController();
@ -531,6 +548,7 @@ namespace cmd {
reg(new audio_autoscroll);
reg(new audio_close);
reg(new audio_commit);
reg(new audio_commit_default);
reg(new audio_commit_next);
reg(new audio_commit_stay);
reg(new audio_go_to);

View File

@ -367,6 +367,12 @@
"key" : "G"
}
],
"audio/commit/default" : [
{
"modifiers" : [ "Shift" ],
"key" : "G"
}
],
"time/lead/in" : [
{
"modifiers" : [],