Undo last change, code *was* used after all. Strangely my compiler didn't complain on first try...

Removing the comment about "is this even used?" as well...

Originally committed to SVN as r2927.
This commit is contained in:
Niels Martin Hansen 2009-05-14 21:44:43 +00:00
parent 00df76c4fb
commit b19d604de4
2 changed files with 52 additions and 0 deletions

View File

@ -754,6 +754,57 @@ int AudioKaraoke::SplitSyl (unsigned int n) {
}
//////////////////////////////////
// Apply delta length to syllable
bool AudioKaraoke::SyllableDelta(int n,int delta,int mode) {
wxLogDebug(_T("AudioKaraoke::SyllableDelta(n=%d, delta=%d, mode=%d)"), n, delta, mode);
// Get syllable and next
AudioKaraokeSyllable *curSyl=NULL,*nextSyl=NULL;
curSyl = &syllables.at(n);
int nkar = syllables.size();
if (n < nkar-1) {
nextSyl = &syllables.at(n+1);
}
// Get variables
int len = curSyl->duration;
// Cap delta
int minLen = 0;
if (len + delta < minLen) delta = minLen-len;
if (mode == 0 && nextSyl && (nextSyl->duration - delta) < minLen) delta = nextSyl->duration - minLen;
wxLogDebug(_T("AudioKaraoke::SyllableDelta: nkar=%d, len=%d, minLen=%d, delta=%d"), nkar, len, minLen, delta);
// Apply
if (delta != 0) {
wxLogDebug(_T("AudioKaraoke::SyllableDelta: delta != 0"));
curSyl->duration += delta;
// Normal mode
if (mode == 0 && nextSyl) {
wxLogDebug(_T("AudioKaraoke::SyllableDelta: normal mode"));
nextSyl->duration -= delta;
nextSyl->start_time += delta;
}
// Shift mode
if (mode == 1) {
wxLogDebug(_T("AudioKaraoke::SyllableDelta: shift mode"));
for (int i=n+1;i<nkar;i++) {
syllables.at(i).start_time += delta;
}
}
// Flag update
wxLogDebug(_T("AudioKaraoke::SyllableDelta: return true"));
return true;
}
wxLogDebug(_T("AudioKaraoke::SyllableDelta: return false"));
return false;
}
////////////////////////////////
// Karaoke tag menu constructor
AudioKaraokeTagMenu::AudioKaraokeTagMenu(AudioKaraoke *_kara)

View File

@ -113,6 +113,7 @@ public:
void Commit();
void SetSyllable(int n);
void SetSelection(int start,int end=-1);
bool SyllableDelta(int n,int delta,int mode);
void Join();
void BeginSplit();