Less signedness warnings and probably a fix for setting the tag string

Originally committed to SVN as r33.
This commit is contained in:
Fredrik Mellbin 2006-01-28 15:11:59 +00:00
parent f22e1825ce
commit 7012a6b0b2
2 changed files with 9 additions and 9 deletions

View File

@ -52,7 +52,7 @@ KaraokeSyllable::KaraokeSyllable() {
position = 0; position = 0;
display_w = 0; display_w = 0;
display_x = 0; display_x = 0;
tag = _T('\\k'); tag = _T("\\k");
pending_splits.clear(); pending_splits.clear();
selected = false; selected = false;
original_tagdata = 0; original_tagdata = 0;
@ -331,7 +331,7 @@ void AudioKaraoke::OnPaint(wxPaintEvent &event) {
if (syl.pending_splits.size() > 0) { if (syl.pending_splits.size() > 0) {
wxArrayInt widths; wxArrayInt widths;
if (dc.GetPartialTextExtents(temptext, widths)) { if (dc.GetPartialTextExtents(temptext, widths)) {
for (int i = 0; i < syl.pending_splits.size(); i++) { for (unsigned int i = 0; i < syl.pending_splits.size(); i++) {
dc.SetPen(wxSystemSettings::GetColour(wxSYS_COLOUR_GRAYTEXT)); dc.SetPen(wxSystemSettings::GetColour(wxSYS_COLOUR_GRAYTEXT));
dc.DrawLine(dx+4+widths[syl.pending_splits[i]], 0, dx+4+widths[syl.pending_splits[i]], h); dc.DrawLine(dx+4+widths[syl.pending_splits[i]], 0, dx+4+widths[syl.pending_splits[i]], h);
} }
@ -417,7 +417,7 @@ void AudioKaraoke::OnMouse(wxMouseEvent &event) {
if (syl.contents.Len() >= 2) { if (syl.contents.Len() >= 2) {
int lastx = widths[0]; int lastx = widths[0];
split_cursor_syl = syli; split_cursor_syl = syli;
for (int i = 1; i < widths.size()-1; i++) { for (unsigned int i = 1; i < widths.size()-1; i++) {
//wxLogDebug(_T("rx=%d, lastx=%d, widths[i]=%d, i=%d, widths.size()=%d, syli=%d"), rx, lastx, widths[i], i, widths.size(), syli); //wxLogDebug(_T("rx=%d, lastx=%d, widths[i]=%d, i=%d, widths.size()=%d, syli=%d"), rx, lastx, widths[i], i, widths.size(), syli);
if (lastx - rx < widths[i] - rx) { if (lastx - rx < widths[i] - rx) {
if (rx - lastx < widths[i] - rx) { if (rx - lastx < widths[i] - rx) {
@ -574,7 +574,7 @@ void AudioKaraoke::BeginSplit() {
void AudioKaraoke::EndSplit(bool commit) { void AudioKaraoke::EndSplit(bool commit) {
splitting = false; splitting = false;
bool hasSplit = false; bool hasSplit = false;
for (int i = 0; i < syllables.size(); i ++) { for (unsigned int i = 0; i < syllables.size(); i ++) {
if (syllables[i].pending_splits.size() > 0) { if (syllables[i].pending_splits.size() > 0) {
if (commit) { if (commit) {
SplitSyl(i); SplitSyl(i);
@ -600,7 +600,7 @@ void AudioKaraoke::EndSplit(bool commit) {
///////////////////////////////////////////////// /////////////////////////////////////////////////
// Split a syllable using the pending_slits data // Split a syllable using the pending_slits data
int AudioKaraoke::SplitSyl (int n) { int AudioKaraoke::SplitSyl (unsigned int n) {
syllables.reserve(syllables.size() + syllables[n].pending_splits.size()); syllables.reserve(syllables.size() + syllables[n].pending_splits.size());
// Start by sorting the split points // Start by sorting the split points
@ -615,7 +615,7 @@ int AudioKaraoke::SplitSyl (int n) {
int curpos = syllables[n].position + syllables[n].length; int curpos = syllables[n].position + syllables[n].length;
// For each split, make a new syllable // For each split, make a new syllable
for (int i = 0; i < syllables[n].pending_splits.size(); i++) { for (unsigned int i = 0; i < syllables[n].pending_splits.size(); i++) {
KaraokeSyllable temp; KaraokeSyllable temp;
if (i < syllables[n].pending_splits.size()-1) { if (i < syllables[n].pending_splits.size()-1) {
// in the middle // in the middle
@ -635,10 +635,10 @@ int AudioKaraoke::SplitSyl (int n) {
// Fix this, so they'll always add up // Fix this, so they'll always add up
// Use an unfair method, just adding 1 to each syllable one after another, until it's correct // Use an unfair method, just adding 1 to each syllable one after another, until it's correct
int newDuration = 0; int newDuration = 0;
for (int j = n; j < syllables[n].pending_splits.size()+n+1; j++) { for (unsigned int j = n; j < syllables[n].pending_splits.size()+n+1; j++) {
newDuration += syllables[j].length; newDuration += syllables[j].length;
} }
int k = n; unsigned int k = n;
while (newDuration < originalDuration) { while (newDuration < originalDuration) {
syllables[k].length++; syllables[k].length++;
k++; k++;

View File

@ -96,7 +96,7 @@ private:
bool ParseDialogue(AssDialogue *diag); bool ParseDialogue(AssDialogue *diag);
int GetSylAtX(int x); int GetSylAtX(int x);
int SplitSyl(int n); int SplitSyl(unsigned int n);
void OnPaint(wxPaintEvent &event); void OnPaint(wxPaintEvent &event);
void OnSize(wxSizeEvent &event); void OnSize(wxSizeEvent &event);