Commit 825a3896 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen
Browse files

NotificationZone: Remove progress(float) overload

parent 847d0c11
......@@ -54,12 +54,6 @@ NotificationZone::notify( const QString &message )
m_timer->start();
}
void
NotificationZone::progressUpdated( float ratio )
{
progressUpdated( static_cast<int>( ratio * 100.0f ) );
}
void
NotificationZone::progressUpdated( int percent )
{
......
......@@ -47,12 +47,7 @@ class NotificationZone : public QWidget, public Singleton<NotificationZone>
public slots:
void notify( const QString& message );
/**
* \brief Update the progress bar.
*
* \param ratio The progress ratio, from 0.0 to 1.0
*/
void progressUpdated( float ratio );
/**
* \brief Update the progress bar.
*
......
......@@ -42,8 +42,7 @@ Transcoder::Transcoder( Media* media )
connect( this, &Transcoder::notify,
NotificationZone::instance(), &NotificationZone::notify );
connect( this, &Transcoder::progress,
NotificationZone::instance(),
static_cast<void(NotificationZone::*)(float)>(&NotificationZone::progressUpdated) );
NotificationZone::instance(), &NotificationZone::progressUpdated );
m_eventWatcher = new Backend::VLC::RendererEventWatcher;
}
......@@ -66,7 +65,9 @@ Transcoder::transcodeToPs()
m_destinationFile = outputDir + '/' + m_media->fileInfo()->baseName() + ".ps";
m_renderer->setOutputFile( qPrintable( m_destinationFile ) );
m_renderer->setName( qPrintable( QString( "Transcoder " ) + m_media->fileInfo()->baseName() ) );
connect( m_eventWatcher, &Backend::VLC::RendererEventWatcher::positionChanged, this, &Transcoder::progress );
connect( m_eventWatcher, &Backend::VLC::RendererEventWatcher::positionChanged, [this](float pos) {
emit progress(static_cast<int>( pos * 100 ) );
});
connect( m_eventWatcher, &Backend::VLC::RendererEventWatcher::endReached, this, &Transcoder::transcodeFinished );
emit notify( "Transcoding " + m_media->fileInfo()->absoluteFilePath() + " to " + m_destinationFile );
m_renderer->start();
......
......@@ -56,7 +56,7 @@ class Transcoder : public QObject
void transcodeFinished();
signals:
void progress( float pos );
void progress( int percent );
void done();
//used for notification:
void notify( QString );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment