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

Correcting length computation

parent 394e27b1
......@@ -75,10 +75,11 @@ qint64 Clip::getLength() const
void Clip::computeLength()
{
qDebug() << "Begin:" << m_begin << "End:" << m_end << "Parent length" << m_parent->getLength();
float fps = m_parent->getFps();
if ( fps < 0.1f )
fps = FPS;
qint64 nbMs = (qint64)( ( m_end - m_begin ) * (float)m_parent->getLength() );
m_length = (nbMs / 1000) * FPS;
qDebug() << "Computing length. nbMs:" << nbMs << "m_length:" << m_length;
m_length = (nbMs / 1000) * fps;
}
const QUuid& Clip::getUuid() const
......
......@@ -228,7 +228,6 @@ bool Media::matchMetaTag( const QString& tag ) const
void Media::emitMetaDataComputed()
{
qDebug() << "Emmiting";
emit metaDataComputed();
emit metaDataComputed( this );
}
......@@ -140,8 +140,7 @@ void TracksView::dragEnterEvent( QDragEnterEvent* event )
if ( m_dragItem ) delete m_dragItem;
m_dragItem = new GraphicsMovieItem( clip );
m_dragItem->setWidth( ( int ) ( ( (double)clip->getLength() / 1000 ) *
( (clip->getParent()->getFps() > 0) ? clip->getParent()->getFps() : m_fps) ) );
m_dragItem->setWidth( ( int ) ( clip->getLength() ) );
m_dragItem->setHeight( tracksHeight() );
m_dragItem->setPos( mappedXPos, 0 );
m_dragItem->setParentItem( m_layout->itemAt( 0 )->graphicsItem() );
......
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