Commit 863c0709 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

Fix outdated metadata related signals/slots

parent a84e083e
......@@ -158,7 +158,7 @@ ImportController::importMedia( const QString &filePath )
return ;
Media* media = m_temporaryMedias->addMedia( filePath );
connect( media, SIGNAL( metaDataComputed( const Media* ) ), this, SLOT( mediaLoaded() ) );
connect( media, SIGNAL( metaDataComputed() ), this, SLOT( mediaLoaded() ) );
if ( media == NULL )
{
vlmcCritical() << "An error occurred while loading media:" << filePath;
......
......@@ -69,10 +69,10 @@ MediaCellView::MediaCellView( Clip* clip, QWidget *parent ) :
connect( MetaDataManager::getInstance(), SIGNAL( startingComputing( const Media* )),
this, SLOT( metadataComputingStarted( const Media* ) ), Qt::DirectConnection );
}
connect( clip->getMedia(), SIGNAL( metaDataComputed(const Media*) ),
this, SLOT( metadataUpdated( const Media*) ) );
connect( clip->getMedia(), SIGNAL( metaDataComputed() ),
this, SLOT( metadataUpdated() ) );
// Snapshot generation will generate a QPixmap, which has to be done on GUI thread
connect( clip->getMedia(), SIGNAL( snapshotComputed() ),
connect( clip->getMedia(), SIGNAL( snapshotAvailable() ),
this, SLOT( snapshotUpdated() ), Qt::QueuedConnection );
setThumbnail( clip->getMedia()->snapshot() );
......@@ -98,13 +98,13 @@ MediaCellView::metadataComputingStarted( const Media *media )
}
void
MediaCellView::metadataUpdated( const Media *media )
MediaCellView::metadataUpdated()
{
setLength( media->source()->length() );
setLength( m_clip->getMedia()->source()->length() );
m_ui->thumbnail->setEnabled( true );
//If the media is a Video or an Image, we must wait for the snapshot to be computer
//before allowing deletion.
if ( media->fileType() == Media::Audio )
if ( m_clip->getMedia()->fileType() == Media::Audio )
m_ui->delLabel->setEnabled( true );
}
......
......@@ -75,7 +75,7 @@ public slots:
private slots:
void snapshotUpdated();
void metadataComputingStarted( const Media *media );
void metadataUpdated( const Media *media );
void metadataUpdated();
void nbClipUpdated();
signals:
......
......@@ -37,17 +37,17 @@ ClipMetadataDisplayer::ClipMetadataDisplayer( QWidget *parent /*= NULL*/ ) :
}
void
ClipMetadataDisplayer::metadataUpdated( const Media *media )
ClipMetadataDisplayer::metadataUpdated()
{
QTime duration;
duration = duration.addSecs( m_watchedClip->lengthSecond() );
const Backend::ISource* source = media->source();
const Backend::ISource* source = m_watchedMedia->source();
updateInterface();
//Duration
m_ui->durationValueLabel->setText( duration.toString( "hh:mm:ss" ) );
//Filename || title
m_ui->nameValueLabel->setText( media->fileInfo()->fileName() );
m_ui->nameValueLabel->setText( m_watchedMedia->fileInfo()->fileName() );
//Resolution
m_ui->resolutionValueLabel->setText( QString::number( source->width() )
+ " x " + QString::number( source->height() ) );
......@@ -57,9 +57,9 @@ ClipMetadataDisplayer::metadataUpdated( const Media *media )
m_ui->nbVideoTracksValueLabel->setText( QString::number( source->nbVideoTracks() ) );
m_ui->nbAudioTracksValueLabel->setText( QString::number( source->nbAudioTracks() ) );
//Path:
m_ui->pathValueLabel->setText( media->fileInfo()->absoluteFilePath() );
m_ui->pathValueLabel->setText( m_watchedMedia->fileInfo()->absoluteFilePath() );
//Workspace:
workspaceStateChanged( media->isInWorkspace() );
workspaceStateChanged( m_watchedMedia->isInWorkspace() );
}
void
......@@ -98,11 +98,11 @@ ClipMetadataDisplayer::setWatchedClip( const Clip *clip )
m_watchedMedia = clip->getMedia();
connect( m_watchedClip, SIGNAL( unloaded( Clip* ) ), this, SLOT( clipDestroyed( Clip* ) ) );
if ( m_watchedMedia->isMetadataComputed() == true )
metadataUpdated( m_watchedMedia );
metadataUpdated();
else
{
connect( m_watchedMedia, SIGNAL( metaDataComputed(const Media*) ),
this, SLOT( metadataUpdated( const Media*) ) );
connect( m_watchedMedia, SIGNAL( metaDataComputed() ),
this, SLOT( metadataUpdated() ) );
}
connect( m_watchedMedia, SIGNAL( workspaceStateChanged( bool ) ),
this, SLOT( workspaceStateChanged( bool ) ) );
......
......@@ -53,7 +53,7 @@ class ClipMetadataDisplayer : public QWidget
const Media *m_watchedMedia;
private slots:
void metadataUpdated( const Media *media );
void metadataUpdated();
void workspaceStateChanged( bool state );
void clipDestroyed( Clip* clip );
......
......@@ -47,8 +47,8 @@ Clip::Clip( Media *media, qint64 begin /*= 0*/, qint64 end /*= -1*/, const QStri
m_childs = new MediaContainer( this );
m_rootClip = media->baseClip();
computeLength();
connect( media, SIGNAL( metaDataComputed( const Media* ) ),
this, SLOT( mediaMetadataUpdated( const Media* ) ) );
connect( media, SIGNAL( metaDataComputed() ),
this, SLOT( mediaMetadataUpdated() ) );
}
Clip::Clip( Clip *parent, qint64 begin /*= -1*/, qint64 end /*= -1*/,
......@@ -281,9 +281,9 @@ Clip::isChild( const QUuid &uuid) const
}
void
Clip::mediaMetadataUpdated( const Media *media )
Clip::mediaMetadataUpdated()
{
Q_ASSERT ( isRootClip() == true && m_media == media );
Q_ASSERT ( isRootClip() == true );
if ( m_end == 0 )
{
m_begin = 0;
......
......@@ -187,7 +187,7 @@ class Clip : public QObject
Clip* m_parent;
private slots:
void mediaMetadataUpdated( const Media* media );
void mediaMetadataUpdated();
signals:
/**
......
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