Fix #450 point 4, playback of drag-retimed karaoke syllables now stops at the right position instead of at the end of line.

Originally committed to SVN as r1382.
This commit is contained in:
Niels Martin Hansen 2007-07-06 01:36:01 +00:00
parent 6d55d1fa11
commit 9043bdecf8

View file

@ -802,7 +802,7 @@ void AudioDisplay::SetScale(float _scale) {
////////////////// //////////////////
// Load from file // Load from file
void AudioDisplay::SetFile(wxString file) { void AudioDisplay::SetFile(wxString file) {
wxLogDebug(_T("AudioDisplay::SetFile(file=%s, vproviderLOL=%p)"), file.c_str()); wxLogDebug(_T("AudioDisplay::SetFile(file=%s)"), file.c_str());
// Unload // Unload
if (file.IsEmpty()) { if (file.IsEmpty()) {
wxLogDebug(_T("AudioDisplay::SetFile: file is empty, just closing audio")); wxLogDebug(_T("AudioDisplay::SetFile: file is empty, just closing audio"));
@ -1611,7 +1611,12 @@ void AudioDisplay::OnMouseEvent(wxMouseEvent& event) {
// Update stuff // Update stuff
if (updated) { if (updated) {
if (diagUpdated) NeedCommit = true; if (diagUpdated) NeedCommit = true;
player->SetEndPosition(GetSampleAtX(selEnd)); if (karaoke->enabled) {
AudioKaraokeSyllable &syl = karaoke->syllables[karaoke->curSyllable];
player->SetEndPosition(GetSampleAtMS(curStartMS + (syl.start_time+syl.duration)*10));
} else {
player->SetEndPosition(GetSampleAtX(selEnd));
}
if (hold != 0) { if (hold != 0) {
wxCursor cursor(wxCURSOR_SIZEWE); wxCursor cursor(wxCURSOR_SIZEWE);
SetCursor(cursor); SetCursor(cursor);