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

Adding a default value for Clip CTOR

If end is -1, the end of the parent media will be used
parent ab52cbc9
...@@ -43,9 +43,13 @@ Clip::Clip( Clip* creator, qint64 begin, qint64 end ) : m_parent( creator->getPa ...@@ -43,9 +43,13 @@ Clip::Clip( Clip* creator, qint64 begin, qint64 end ) : m_parent( creator->getPa
computeLength(); computeLength();
} }
Clip::Clip( Media* parent, qint64 begin, qint64 end ) : m_parent( parent ), m_begin( begin ), m_end( end ) Clip::Clip( Media* parent, qint64 begin, qint64 end /*= -1*/ ) : m_parent( parent ), m_begin( begin ), m_end( end )
{ {
//FIXME: WTF ?
Q_ASSERT( parent->getInputType() == Media::File || ( begin == 0 && end == m_parent->getNbFrames() ) ); Q_ASSERT( parent->getInputType() == Media::File || ( begin == 0 && end == m_parent->getNbFrames() ) );
if ( parent->getInputType() == Media::File && end < 0 )
m_end = parent->getNbFrames();
m_Uuid = QUuid::createUuid(); m_Uuid = QUuid::createUuid();
computeLength(); computeLength();
} }
......
...@@ -43,7 +43,7 @@ class Clip : public QObject ...@@ -43,7 +43,7 @@ class Clip : public QObject
public: public:
static const int DefaultFPS; static const int DefaultFPS;
Clip( Media* parent ); Clip( Media* parent );
Clip( Media* parent, qint64 begin, qint64 end ); Clip( Media* parent, qint64 begin, qint64 end = -1 );
Clip( Clip* creator, qint64 begin, qint64 end ); Clip( Clip* creator, qint64 begin, qint64 end );
Clip( Clip* clip ); Clip( Clip* clip );
Clip( const QUuid& uuid, qint64 begin = 0, qint64 end = -1 ); Clip( const QUuid& uuid, qint64 begin = 0, qint64 end = -1 );
......
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