Add command audio/play/current

This is like audio/play/selection except it ignores changes to the
primary range during playback, and always stops when the original end of
the line is reached.

Originally committed to SVN as r6841.
This commit is contained in:
Thomas Goyne 2012-05-23 03:38:44 +00:00
parent 567549c55d
commit c6aa43de72
1 changed files with 15 additions and 1 deletions

View File

@ -228,12 +228,25 @@ struct audio_save_clip : public Command {
}
};
/// Play the current audio selection
struct audio_play_current_selection : public validate_audio_open {
CMD_NAME("audio/play/current")
STR_MENU("Play current audio selection")
STR_DISP("Play current audio selection")
STR_HELP("Play the current audio selection, ignoring changes made while playing")
void operator()(agi::Context *c) {
c->videoController->Stop();
c->audioController->PlayRange(c->audioController->GetPrimaryPlaybackRange());
}
};
/// Play the current audio selection
struct audio_play_selection : public validate_audio_open {
CMD_NAME("audio/play/selection")
STR_MENU("Play audio selection")
STR_DISP("Play audio selection")
STR_HELP("Play selection")
STR_HELP("Play audio until the end of the selection is reached")
void operator()(agi::Context *c) {
c->videoController->Stop();
@ -578,6 +591,7 @@ namespace cmd {
reg(new audio_play_before);
reg(new audio_play_begin);
reg(new audio_play_end);
reg(new audio_play_current_selection);
reg(new audio_play_selection);
reg(new audio_play_to_end);
reg(new audio_play_toggle);