Commit 31a5f9e2 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

ClipMetadataDisplayer: Clear displayed info when the clip is destroyed.

parent 7c29ab81
......@@ -58,14 +58,41 @@ ClipMetadataDisplayer::metadataUpdated( const Media *media )
m_ui->pathValueLabel->setText( media->fileInfo()->absoluteFilePath() );
}
void
ClipMetadataDisplayer::clear()
{
m_ui->durationValueLabel->setText( "---" );
//Filename || title
m_ui->nameValueLabel->setText( "---" );
//Resolution
m_ui->resolutionValueLabel->setText( "---" );
//FPS
m_ui->fpsValueLabel->setText( "---" );
//nb tracks :
m_ui->nbVideoTracksValueLabel->setText( "---" );
m_ui->nbAudioTracksValueLabel->setText( "---" );
//Path:
m_ui->pathValueLabel->setText( "---" );
}
void
ClipMetadataDisplayer::clipDestroyed( Clip* clip )
{
if ( m_watchedClip == clip )
clear();
}
void
ClipMetadataDisplayer::setWatchedClip( const Clip *clip )
{
if ( m_watchedMedia )
disconnect( m_watchedMedia );
if ( m_watchedClip )
disconnect( m_watchedClip );
m_watchedClip = clip;
m_watchedMedia = clip->getMedia();
connect( m_watchedClip, SIGNAL( unloaded( Clip* ) ), this, SLOT( clipDestroyed( Clip* ) ) );
if ( m_watchedMedia->isMetadataComputed() == true )
metadataUpdated( m_watchedMedia );
else
......
......@@ -39,6 +39,7 @@ class ClipMetadataDisplayer : public QWidget
explicit ClipMetadataDisplayer( QWidget *parent = 0 );
void setWatchedClip( const Clip *clip );
void clear();
private:
/**
......@@ -53,6 +54,7 @@ class ClipMetadataDisplayer : public QWidget
private slots:
void metadataUpdated( const Media *media );
void clipDestroyed( Clip* clip );
};
......
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