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

ImportController: Now using the new ClipMetadataDisplayer

parent 55de1153
......@@ -22,11 +22,12 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#include "ImportController.h"
#include "ui_ImportController.h"
#include "Clip.h"
#include "ClipMetadataDisplayer.h"
#include "ClipRenderer.h"
#include "ImportController.h"
#include "Library.h"
#include "Media.h"
#include "MediaCellView.h"
......@@ -56,6 +57,7 @@ ImportController::ImportController(QWidget *parent) :
m_mediaListView = new MediaListView( m_stackNav, m_temporaryMedias );
m_tag = new TagWidget( m_ui->tagContainer, 6 );
m_filesModel = new QFileSystemModel( this );
m_metadataDisplayer = new ClipMetadataDisplayer( NULL, m_ui->metadataContainer );
m_stackNav->pushViewController( m_mediaListView );
m_nameFilters << Media::AudioExtensions.split(' ', QString::SkipEmptyParts)
......@@ -132,41 +134,13 @@ ImportController::clipSelection( Clip* clip )
const QUuid& uuid = clip->uuid();
if ( m_currentUuid == uuid )
return ;
setUIMetaData( clip->rootClip() );
m_metadataDisplayer->setWatchedClip( clip );
m_preview->stop();
m_currentUuid = uuid;
m_tag->clipSelected( clip );
emit clipSelected( clip );
}
void
ImportController::setUIMetaData( const Clip* clip )
{
if ( clip != NULL )
{
//Duration
QTime duration;
duration = duration.addSecs( clip->lengthSecond() );
m_ui->durationValueLabel->setText( duration.toString( "hh:mm:ss" ) );
//Filename || title
m_ui->nameValueLabel->setText( clip->getMedia()->fileInfo()->fileName() );
m_ui->nameValueLabel->setWordWrap( true );
setWindowTitle( clip->getMedia()->fileInfo()->fileName() + " " + tr( "properties" ) );
//Resolution
m_ui->resolutionValueLabel->setText( QString::number( clip->getMedia()->width() )
+ " x " + QString::number( clip->getMedia()->height() ) );
//FPS
m_ui->fpsValueLabel->setText( QString::number( clip->getMedia()->fps() ) );
}
else
{
m_ui->durationValueLabel->setText( "--:--:--" );
m_ui->nameValueLabel->setText( "none" );
m_ui->resolutionValueLabel->setText( "-- x --" );
m_ui->fpsValueLabel->setText( "--" );
}
}
void
ImportController::importMedia( const QString &filePath )
{
......@@ -185,8 +159,6 @@ ImportController::importMedia( const QString &filePath )
m_temporaryMedias->addClip( clip );
++m_nbMediaToLoad;
m_ui->progressBar->setMaximum( m_nbMediaToLoad );
connect( media, SIGNAL( metaDataComputed( const Media* ) ),
this, SLOT( metaDataComputed( const Media* ) ) );
}
void
......@@ -327,9 +299,3 @@ ImportController::hideErrors()
m_ui->errorLabelImg->hide();
m_ui->errorLabel->hide();
}
void
ImportController::metaDataComputed( const Media *media )
{
setUIMetaData( media->baseClip() );
}
......@@ -36,8 +36,9 @@
#include <QUuid>
class Clip;
class Media;
class ClipMetadataDisplayer;
class ClipRenderer;
class Media;
class MediaContainer;
class MediaListView;
class PreviewWidget;
......@@ -62,7 +63,6 @@ class ImportController : public QDialog
public:
ImportController(QWidget *parent = 0);
~ImportController();
void setUIMetaData( const Clip *clip );
protected:
void changeEvent( QEvent *e );
......@@ -86,6 +86,7 @@ class ImportController : public QDialog
quint32 m_nbMediaLoaded;
ClipRenderer* m_clipRenderer;
QStringList m_nameFilters;
ClipMetadataDisplayer *m_metadataDisplayer;
public slots:
void accept();
......@@ -99,7 +100,6 @@ class ImportController : public QDialog
void mediaLoaded();
void failedToLoad( Media* media );
void hideErrors();
void metaDataComputed( const Media* media );
signals:
void clipSelected( Clip* );
......
......@@ -14,7 +14,7 @@
<string>Import</string>
</property>
<property name="windowIcon">
<iconset>
<iconset resource="../../../../ressources.qrc">
<normaloff>:/images/images/vlmc.png</normaloff>:/images/images/vlmc.png</iconset>
</property>
<layout class="QVBoxLayout" name="verticalLayout_11">
......@@ -31,7 +31,7 @@
<string/>
</property>
<property name="icon">
<iconset>
<iconset resource="../../../../ressources.qrc">
<normaloff>:/images/forward</normaloff>:/images/forward</iconset>
</property>
</widget>
......@@ -55,7 +55,7 @@
<string/>
</property>
<property name="pixmap">
<pixmap>:/images/error</pixmap>
<pixmap resource="../../../../ressources.qrc">:/images/error</pixmap>
</property>
</widget>
</item>
......@@ -127,87 +127,7 @@
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Media Properties</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="nameLabel">
<property name="text">
<string>Name</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="nameValueLabel">
<property name="text">
<string>unnamed</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="durationLabel">
<property name="text">
<string>Duration</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="durationValueLabel">
<property name="text">
<string>0s</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="resolutionLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Resolution</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLabel" name="resolutionValueLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>0px. x 0px.</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="fpsLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>FPS</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLabel" name="fpsValueLabel">
<property name="text">
<string>0</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="metadataContainer" native="true"/>
</item>
<item>
<widget class="QWidget" name="tagContainer" native="true"/>
......@@ -229,10 +149,10 @@
</widget>
</item>
</layout>
<zorder>buttonBox</zorder>
<zorder>stackViewContainer</zorder>
</widget>
<resources/>
<resources>
<include location="../../../../ressources.qrc"/>
</resources>
<connections>
<connection>
<sender>buttonBox</sender>
......
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