Finished merging of SSA mode with standard mode and fixed auto-commit to work with it.

Originally committed to SVN as r720.
This commit is contained in:
Rodrigo Braz Monteiro 2007-01-06 03:40:58 +00:00
parent b3ddefa5ee
commit 7bdcb03fba
2 changed files with 37 additions and 35 deletions

View file

@ -495,7 +495,7 @@ void AudioBox::OnPlayToEnd(wxCommandEvent &event) {
// Commit changes
void AudioBox::OnCommit(wxCommandEvent &event) {
audioDisplay->SetFocus();
audioDisplay->CommitChanges();
audioDisplay->CommitChanges(true);
}

View file

@ -1150,27 +1150,27 @@ void AudioDisplay::CommitChanges (bool nextLine) {
// Loaded?
if (!loaded) return;
// Check validity
bool wasKaraSplitting = false;
bool validCommit = true;
if (!box->audioKaraoke->splitting) {
// Check if there's any need to commit
if (!NeedCommit) return;
// Check if selection is valid
if (curEndMS < curStartMS) return;
if (!NeedCommit || curEndMS < curStartMS) validCommit = false;
}
// Reset flags
diagUpdated = false;
NeedCommit = false;
// Update karaoke
int karSyl = 0;
bool wasKaraSplitting = false;
if (karaoke->enabled) {
wasKaraSplitting = box->audioKaraoke->splitting;
karaoke->Commit();
karSyl = karaoke->curSyllable;
}
// Commit ok?
if (validCommit) {
// Reset flags
diagUpdated = false;
NeedCommit = false;
// Update dialogues
blockUpdate = true;
wxArrayInt sel = grid->GetSelection();
@ -1194,6 +1194,7 @@ void AudioDisplay::CommitChanges (bool nextLine) {
grid->CommitChanges();
karaoke->curSyllable = karSyl;
blockUpdate = false;
}
// Next line
if (nextLine && Options.AsBool(_T("Audio Next Line on Commit")) && !wasKaraSplitting) {
@ -1599,12 +1600,13 @@ void AudioDisplay::OnMouseEvent(wxMouseEvent& event) {
if (hold != 0) {
// Dragging
if (buttonIsDown) {
// Drag from nothing
// Drag from nothing or straight timing
if (hold == 3 && buttonIsDown) {
if (!karMode) {
if (leftIsDown) curStartMS = GetMSAtX(x);
else curEndMS = GetMSAtX(x);
updated = true;
diagUpdated = true;
if (x != lastX) {
selStart = x;
@ -1834,13 +1836,13 @@ void AudioDisplay::OnKeyDown(wxKeyEvent &event) {
// Accept
if (Hotkeys.IsPressed(_T("Audio Commit"))) {
CommitChanges();
ChangeLine(1);
CommitChanges(true);
//ChangeLine(1);
}
// Accept (SSA's "Grab times")
if (Hotkeys.IsPressed(_T("Audio Commit Alt"))) {
CommitChanges();
CommitChanges(true);
}
// Accept (stay)