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