updated some casts and warnings
This commit is contained in:
@@ -142,7 +142,6 @@ void TextEffect::redraw(double timecode) {
|
||||
|
||||
switch (halign_field->get_combo_data(timecode).toInt()) {
|
||||
case Qt::AlignLeft: text_x = 0; break;
|
||||
case Qt::AlignHCenter: text_x = (width/2) - (fm.width(lines.at(i))/2); break;
|
||||
case Qt::AlignRight: text_x = width - fm.width(lines.at(i)); break;
|
||||
case Qt::AlignJustify:
|
||||
// add spaces until the string is too big
|
||||
@@ -167,12 +166,23 @@ void TextEffect::redraw(double timecode) {
|
||||
}
|
||||
}
|
||||
break;
|
||||
case Qt::AlignHCenter:
|
||||
default:
|
||||
text_x = (width/2) - (fm.width(lines.at(i))/2);
|
||||
break;
|
||||
}
|
||||
|
||||
switch (valign_field->get_combo_data(timecode).toInt()) {
|
||||
case Qt::AlignTop: text_y = (fm.height()*i)+fm.ascent(); break;
|
||||
case Qt::AlignVCenter: text_y = ((height/2) - (text_height/2) - fm.descent()) + (fm.height()*(i+1)); break;
|
||||
case Qt::AlignBottom: text_y = (height - text_height - fm.descent()) + (fm.height()*(i+1)); break;
|
||||
case Qt::AlignTop:
|
||||
text_y = (fm.height()*i)+fm.ascent();
|
||||
break;
|
||||
case Qt::AlignBottom:
|
||||
text_y = (height - text_height - fm.descent()) + (fm.height()*(i+1));
|
||||
break;
|
||||
case Qt::AlignVCenter:
|
||||
default:
|
||||
text_y = ((height/2) - (text_height/2) - fm.descent()) + (fm.height()*(i+1));
|
||||
break;
|
||||
}
|
||||
|
||||
path.addText(text_x, text_y, font, lines.at(i));
|
||||
|
||||
@@ -31,26 +31,22 @@ void ToneEffect::process_audio(double timecode_start, double timecode_end, quint
|
||||
for (int i=0;i<nb_bytes;i+=4) {
|
||||
double timecode = timecode_start+(interval*i);
|
||||
|
||||
qint16 left_tone_sample = qSin((2*M_PI*sinX*freq_val->get_double_value(timecode, true))/parent_clip->sequence->audio_frequency)*log_volume(amount_val->get_double_value(timecode, true)*0.01)*INT16_MAX;
|
||||
qint16 left_tone_sample = qint16(qRound(qSin((2*M_PI*sinX*freq_val->get_double_value(timecode, true))/parent_clip->sequence->audio_frequency)*log_volume(amount_val->get_double_value(timecode, true)*0.01)*INT16_MAX));
|
||||
qint16 right_tone_sample = left_tone_sample;
|
||||
|
||||
// mix with source audio
|
||||
if (mix_val->get_bool_value(timecode, true)) {
|
||||
qint16 left_sample = (qint16) (((samples[i+1] & 0xFF) << 8) | (samples[i] & 0xFF));
|
||||
qint16 right_sample = (qint16) (((samples[i+3] & 0xFF) << 8) | (samples[i+2] & 0xFF));
|
||||
qint16 left_sample = qint16(((samples[i+1] & 0xFF) << 8) | (samples[i] & 0xFF));
|
||||
qint16 right_sample = qint16(((samples[i+3] & 0xFF) << 8) | (samples[i+2] & 0xFF));
|
||||
left_tone_sample = mix_audio_sample(left_tone_sample, left_sample);
|
||||
right_tone_sample = mix_audio_sample(right_tone_sample, right_sample);
|
||||
}
|
||||
|
||||
samples[i+3] = (quint8) (right_tone_sample >> 8);
|
||||
samples[i+2] = (quint8) right_tone_sample;
|
||||
samples[i+1] = (quint8) (left_tone_sample >> 8);
|
||||
samples[i] = (quint8) left_tone_sample;
|
||||
samples[i+3] = quint8(right_tone_sample >> 8);
|
||||
samples[i+2] = quint8(right_tone_sample);
|
||||
samples[i+1] = quint8(left_tone_sample >> 8);
|
||||
samples[i] = quint8(left_tone_sample);
|
||||
|
||||
int presin = sinX;
|
||||
sinX++;
|
||||
if (sinX < presin) {
|
||||
qWarning() << "Tone effect overflowed";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user