diff --git a/app/node/input.cpp b/app/node/input.cpp index 890cb57e5..ecc4906d8 100644 --- a/app/node/input.cpp +++ b/app/node/input.cpp @@ -366,6 +366,8 @@ QString NodeInput::ValueToString(const DataType& data_type, const QVariant &valu || data_type == kBuffer) { // These data types need no XML representation return QString(); + } else if (data_type == kInt) { + return QString::number(value.value()); } else { if (value.canConvert()) { return value.toString(); @@ -397,6 +399,8 @@ QVariant NodeInput::StringToValue(const DataType& data_type, const QString &stri QStringList vals = string.split(':'); return QVariant::fromValue(Color(vals.at(0).toFloat(), vals.at(1).toFloat(), vals.at(2).toFloat(), vals.at(3).toFloat())); + } else if (data_type == kInt) { + return QVariant::fromValue(string.toLongLong()); } else if (data_type == kRational) { return QVariant::fromValue(rational::fromString(string)); } else { diff --git a/app/widget/audiomonitor/audiomonitor.cpp b/app/widget/audiomonitor/audiomonitor.cpp index 86b53a8df..a4cbd853d 100644 --- a/app/widget/audiomonitor/audiomonitor.cpp +++ b/app/widget/audiomonitor/audiomonitor.cpp @@ -275,23 +275,33 @@ void AudioMonitor::UpdateValuesFromFile(QVector& v) // Determines how many milliseconds have passed since last update qint64 current_time = QDateTime::currentMSecsSinceEpoch(); qint64 time_passed = current_time - last_time_; + int abs_speed = qAbs(playback_speed_); + + // Multiply by speed if the speed is not 1 + if (abs_speed != 1) { + time_passed *= abs_speed; + } // Convert ms to float seconds and determine how many bytes that is qint64 bytes_to_read = params_.time_to_bytes(static_cast(time_passed) * 0.001); if (playback_speed_ < 0) { + // If reversing, jump back by the amount of bytes we're going to read bytes_to_read = qMin(bytes_to_read, file_.pos()); file_.seek(file_.pos() - bytes_to_read); } + // Read bytes in from file QByteArray b = file_.read(bytes_to_read); if (playback_speed_ < 0) { + // If reversing, head back to where we were before the read so that the next read starts + // from where we left off file_.seek(file_.pos() - bytes_to_read); } - int abs_speed = qAbs(playback_speed_); + // If speed is not 1, transform it here if (abs_speed != 1) { int sample_sz = params_.samples_to_bytes(1); int in_nb_samples = params_.bytes_to_samples(b.size()); @@ -299,8 +309,8 @@ void AudioMonitor::UpdateValuesFromFile(QVector& v) QByteArray speed_adjusted(out_nb_samples * sample_sz, Qt::Uninitialized); for (int i=0;isetCurrentWidget(play_btn_); - playpause_stack_->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Expanding); + + // Hack to conform the play/pause button size to the other buttons (QStackedWidget has a + // different size policy by default) + playpause_stack_->setSizePolicy(prev_frame_btn_->sizePolicy()); // Next Frame Button next_frame_btn_ = new QPushButton();