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

And now the clip does build...

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