Don't save separate wavs for each selected line
Instead, save a single wav spanning the full range of all selected lines.
This commit is contained in:
parent
254e7564e1
commit
e5251544ea
1 changed files with 9 additions and 3 deletions
|
@ -220,11 +220,17 @@ struct audio_save_clip : public Command {
|
|||
|
||||
void operator()(agi::Context *c) {
|
||||
Selection sel = c->selectionController->GetSelectedSet();
|
||||
if (sel.empty()) return;
|
||||
|
||||
AssTime start = INT_MAX, end = 0;
|
||||
for (Selection::iterator it = sel.begin(); it != sel.end(); ++it) {
|
||||
c->audioController->SaveClip(
|
||||
wxFileSelector(_("Save audio clip"), "", "", "wav", "", wxFD_SAVE|wxFD_OVERWRITE_PROMPT, c->parent),
|
||||
TimeRange((*it)->Start, (*it)->End));
|
||||
start = std::min(start, (*it)->Start);
|
||||
end = std::max(end, (*it)->End);
|
||||
}
|
||||
|
||||
c->audioController->SaveClip(
|
||||
wxFileSelector(_("Save audio clip"), "", "", "wav", "", wxFD_SAVE|wxFD_OVERWRITE_PROMPT, c->parent),
|
||||
TimeRange(start, end));
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue