forked from mia/Aegisub
Karaoke join back to working state.
Originally committed to SVN as r1315.
This commit is contained in:
parent
7082e21765
commit
e09ebcf442
1 changed files with 8 additions and 2 deletions
|
@ -582,14 +582,18 @@ void AudioKaraoke::Join() {
|
||||||
// Loop
|
// Loop
|
||||||
for (size_t i=0;i<syls;i++) {
|
for (size_t i=0;i<syls;i++) {
|
||||||
curSyl = &syllables.at(i);
|
curSyl = &syllables.at(i);
|
||||||
|
wxLogDebug(_T("AudioKaraoke::Join: syllable %d, text='%s', unstripped_text='%s', duration=%d"), i, curSyl->text.c_str(), curSyl->unstripped_text.c_str(), curSyl->duration);
|
||||||
if (curSyl->selected) {
|
if (curSyl->selected) {
|
||||||
if (!gotOne) {
|
if (!gotOne) {
|
||||||
gotOne = true;
|
gotOne = true;
|
||||||
first = i;
|
first = i;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
syllables.at(i-1).duration += curSyl->duration;
|
AudioKaraokeSyllable &work = syllables.at(first);
|
||||||
syllables.at(i-1).unstripped_text += curSyl->unstripped_text;
|
wxLogDebug(_T("AudioKaraoke::Join: worksyl %d, text='%s', unstripped_text='%s', duration=%d"), i, work.text.c_str(), work.unstripped_text.c_str(), work.duration);
|
||||||
|
work.duration += curSyl->duration;
|
||||||
|
work.text += curSyl->text;
|
||||||
|
work.unstripped_text += curSyl->unstripped_text;
|
||||||
syllables.erase(syllables.begin()+i);
|
syllables.erase(syllables.begin()+i);
|
||||||
i--;
|
i--;
|
||||||
syls--;
|
syls--;
|
||||||
|
@ -605,6 +609,8 @@ void AudioKaraoke::Join() {
|
||||||
display->NeedCommit = true;
|
display->NeedCommit = true;
|
||||||
display->Update();
|
display->Update();
|
||||||
Refresh(false);
|
Refresh(false);
|
||||||
|
|
||||||
|
wxLogDebug(_T("AudioKaraoke::Join: returning"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue