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