Skip to content
Extraits de code Groupes Projets
Valider e5251544 rédigé par Thomas Goyne's avatar Thomas Goyne
Parcourir les fichiers

Don't save separate wavs for each selected line

Instead, save a single wav spanning the full range of all selected
lines.
parent 254e7564
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -220,11 +220,17 @@ struct audio_save_clip : public Command { ...@@ -220,11 +220,17 @@ struct audio_save_clip : public Command {
void operator()(agi::Context *c) { void operator()(agi::Context *c) {
Selection sel = c->selectionController->GetSelectedSet(); 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) { for (Selection::iterator it = sel.begin(); it != sel.end(); ++it) {
start = std::min(start, (*it)->Start);
end = std::max(end, (*it)->End);
}
c->audioController->SaveClip( c->audioController->SaveClip(
wxFileSelector(_("Save audio clip"), "", "", "wav", "", wxFD_SAVE|wxFD_OVERWRITE_PROMPT, c->parent), wxFileSelector(_("Save audio clip"), "", "", "wav", "", wxFD_SAVE|wxFD_OVERWRITE_PROMPT, c->parent),
TimeRange((*it)->Start, (*it)->End)); TimeRange(start, end));
}
} }
}; };
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter