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

Clearly state that a clip length is mesured in frames

parent b541b442
......@@ -42,7 +42,7 @@ AbstractGraphicsMediaItem::AbstractGraphicsMediaItem( Clip* clip ) :
{
m_clipHelper = new ClipHelper( clip );
// Adjust the width
setWidth( clip->length() );
setWidth( clip->nbFrames() );
// Automatically adjust future changes
connect( m_clipHelper, SIGNAL( lengthUpdated() ), this, SLOT( adjustLength() ) );
connect( clip, SIGNAL( unloaded( Clip* ) ),
......
......@@ -92,9 +92,9 @@ Clip::getMedia() const
}
qint64
Clip::length() const
Clip::nbFrames() const
{
return m_length;
return m_nbFrames;
}
qint64
......@@ -109,8 +109,8 @@ Clip::computeLength()
float fps = m_media->source()->fps();
if ( fps < 0.1f )
fps = Clip::DefaultFPS;
m_length = m_end - m_begin;
m_lengthSeconds = qRound64( (float)m_length / fps );
m_nbFrames = m_end - m_begin;
m_lengthSeconds = qRound64( (float)m_nbFrames / fps );
}
const QStringList&
......
......@@ -83,7 +83,7 @@ class Clip : public QObject
/**
\return Returns the clip length in frame.
*/
qint64 length() const;
qint64 nbFrames() const;
/**
\return Returns the clip length in seconds.
......@@ -161,7 +161,7 @@ class Clip : public QObject
/**
* \brief The length in frames
*/
qint64 m_length;
qint64 m_nbFrames;
/**
* \brief The length in seconds (Be carreful, VLC uses MILLIseconds)
*/
......
......@@ -66,7 +66,7 @@ ClipRenderer::setClip( Clip* clip )
return ;
}
m_selectedClip = clip;
if ( clip->length() == 0 )
if ( clip->nbFrames() == 0 )
return ;
updateInfos( clip );
}
......@@ -85,7 +85,7 @@ ClipRenderer::updateInfos( Clip* clip )
void
ClipRenderer::startPreview()
{
if ( m_selectedClip == NULL || m_selectedClip->length() == 0 )
if ( m_selectedClip == NULL || m_selectedClip->nbFrames() == 0 )
return ;
updateInfos( m_selectedClip );
......
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