Tidy dropped frame status bar message

This commit is contained in:
Bill Somerville 2020-08-08 19:40:42 +01:00
parent 02e19b687f
commit 2e413713a3
No known key found for this signature in database
GPG Key ID: D864B06D1E81618F
2 changed files with 2 additions and 1 deletions

View File

@ -163,6 +163,7 @@ void SoundInput::reset (bool report_dropped_frames)
{
auto lost_usec = m_stream->elapsedUSecs () - m_stream->processedUSecs () - cummulative_lost_usec_;
Q_EMIT dropped_frames (m_stream->format ().framesForDuration (lost_usec), lost_usec);
qDebug () << "SoundInput::reset: frames dropped:" << m_stream->format ().framesForDuration (lost_usec) << "sec:" << lost_usec / 1.e6;
}
cummulative_lost_usec_ = m_stream->elapsedUSecs () - m_stream->processedUSecs ();
}

View File

@ -474,7 +474,7 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple,
connect(m_soundInput, &SoundInput::error, this, &MainWindow::showSoundInError);
// connect(m_soundInput, &SoundInput::status, this, &MainWindow::showStatusMessage);
connect (m_soundInput, &SoundInput::dropped_frames, this, [this] (qint32 dropped_frames, qint64 usec) {
showStatusMessage (tr ("%1 (%2 sec) audio frames dropped").arg (dropped_frames).arg (usec / 1.e6));
showStatusMessage (tr ("%1 (%2 sec) audio frames dropped").arg (dropped_frames).arg (usec / 1.e6, 5, 'f', 3));
});
connect (&m_audioThread, &QThread::finished, m_soundInput, &QObject::deleteLater);