Commit 4c4e1b46 authored by Hugo Beauzee-Luyssen's avatar Hugo Beauzee-Luyssen

And now the clip does build...

parent 93c32273
......@@ -26,7 +26,17 @@
#include "Clip.h"
Clip::Clip( Media* parent, qint64 begin, qint64 end ) : m_parent( parent ), m_begin( begin ), m_end( end )
Clip::Clip( Media* parent ) : m_parent( parent ), m_begin( 0 ), m_end( Clip::UntilEndOfMedia )
{
computeLength();
}
Clip::Clip( Clip* creator, qint64 begin, qint64 end ) : m_parent( creator->getParent() ), m_begin( begin ), m_end( end )
{
computeLength();
}
Clip::~Clip()
{
}
......@@ -40,14 +50,20 @@ qint64 Clip::getEnd() const
return m_end;
}
Media* Clip::getParent() const
Media* Clip::getParent()
{
return m_parent;
}
qint64 Clip::getLength() const
{
return m_length;
}
void Clip::computeLength()
{
if ( m_begin == Clip::UntilEndOfMedia )
return m_parent->getLength() - m_begin;
return m_end - m_begin;
m_length = m_parent->getLength() - m_begin;
else
m_length = m_end - m_begin;
}
......@@ -39,7 +39,9 @@ class Clip : public QObject
public:
static const qint64 UntilEndOfMedia = -1;
Clip( Clip* parent, qint64 begin = 0, qint64 end = UntilEndOfMedia );
Clip( Media* parent );
Clip( Clip* creator, qint64 begin, qint64 end );
virtual ~Clip();
qint64 getBegin() const;
qint64 getEnd() const;
......@@ -47,9 +49,12 @@ class Clip : public QObject
Media* getParent();
private:
void computeLength();
Media* m_parent;
qint64 m_begin;
qint64 m_end;
qint64 m_length;
};
#endif //CLIP_H__
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