Commit f13b848e authored by Hugo Beauzee-Luyssen's avatar Hugo Beauzee-Luyssen
Browse files

The length is now updated in the MediaCell

parent 2b0ede49
...@@ -131,7 +131,9 @@ void ImportController::clipSelection( const QUuid& uuid ) ...@@ -131,7 +131,9 @@ void ImportController::clipSelection( const QUuid& uuid )
void ImportController::updateMediaRequested( Media* media ) void ImportController::updateMediaRequested( Media* media )
{ {
m_mediaListController->getCell( media->getUuid() )->setThumbnail( media->getSnapshot() ); ImportMediaCellView* cell = m_mediaListController->getCell( media->getUuid() );
cell->setThumbnail( media->getSnapshot() );
cell->setLength( media->getLengthMS() );
} }
void ImportController::setUIMetaData( Media* media ) void ImportController::setUIMetaData( Media* media )
{ {
......
...@@ -24,6 +24,8 @@ ...@@ -24,6 +24,8 @@
#include "ui_MediaCellView.h" #include "ui_MediaCellView.h"
#include "Library.h" #include "Library.h"
#include "ClipProperty.h" #include "ClipProperty.h"
#include <QTime>
#include <QDebug> #include <QDebug>
MediaCellView::MediaCellView( const QUuid& uuid, QWidget *parent ) : MediaCellView::MediaCellView( const QUuid& uuid, QWidget *parent ) :
...@@ -134,3 +136,10 @@ void MediaCellView::deleteButtonClicked( QWidget*, QMouseEvent* ) ...@@ -134,3 +136,10 @@ void MediaCellView::deleteButtonClicked( QWidget*, QMouseEvent* )
{ {
emit cellDeleted( uuid() ); emit cellDeleted( uuid() );
} }
void MediaCellView::setLength( qint64 length )
{
QTime duration;
duration = duration.addMSecs( length );
m_ui->length->setText( duration.toString( "hh:mm:ss" ) );
}
...@@ -44,6 +44,11 @@ public: ...@@ -44,6 +44,11 @@ public:
void setTitle( const QString& title ); void setTitle( const QString& title );
void setThumbnail( const QPixmap& pixmap ); void setThumbnail( const QPixmap& pixmap );
const QPixmap* getThumbnail() const; const QPixmap* getThumbnail() const;
/**
* \brief Set the length displayed in the cell
* \param length The media length, in ms.
*/
void setLength( qint64 length );
QString title() const; QString title() const;
const QUuid& uuid() const; const QUuid& uuid() const;
const ClickableLabel* nextButton() const; const ClickableLabel* nextButton() const;
......
...@@ -23,6 +23,7 @@ void MediaListViewController::newMediaLoaded( Media* media ) ...@@ -23,6 +23,7 @@ void MediaListViewController::newMediaLoaded( Media* media )
cell->setThumbnail( media->getSnapshot() ); cell->setThumbnail( media->getSnapshot() );
cell->setTitle( media->getFileName() ); cell->setTitle( media->getFileName() );
cell->setLength( media->getLengthMS() );
addCell(cell); addCell(cell);
m_cells->insert( media->getUuid(), cell ); m_cells->insert( media->getUuid(), cell );
} }
......
...@@ -155,7 +155,7 @@ ...@@ -155,7 +155,7 @@
</font> </font>
</property> </property>
<property name="text"> <property name="text">
<string>42</string> <string>0</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
...@@ -185,7 +185,7 @@ ...@@ -185,7 +185,7 @@
</font> </font>
</property> </property>
<property name="text"> <property name="text">
<string>24m45</string> <string>0</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
......
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