Commit f431b53c authored by luyikei's avatar luyikei
Browse files

Make Helper more abstract

parent 96544b60
......@@ -45,7 +45,7 @@ conv( std::string str, SettingValue::Type type )
EffectHelper::EffectHelper( const char* id, qint64 begin, qint64 end,
const QString &uuid ) :
Helper( begin, end, uuid ),
Helper( uuid ),
m_filter( new Backend::MLT::MLTFilter( id ) ),
m_service( nullptr ),
m_filterInfo( nullptr )
......@@ -63,7 +63,7 @@ EffectHelper::EffectHelper( const QString& id, qint64 begin, qint64 end, const Q
}
EffectHelper::EffectHelper( Backend::IFilter *filter, const QString& uuid )
: Helper( filter->begin(), filter->end(), uuid )
: Helper( uuid )
, m_filter( dynamic_cast<Backend::MLT::MLTFilter*>( filter ) )
, m_service( nullptr )
, m_filterInfo( nullptr )
......
......@@ -35,7 +35,7 @@
#include <QVariant>
Clip::Clip( Media *media, qint64 begin /*= 0*/, qint64 end /*= Backend::IProducer::EndOfMedia */, const QString& uuid /*= QString()*/ ) :
Workflow::Helper( begin, end, uuid ),
Workflow::Helper( uuid ),
m_media( media ),
m_producer( m_media->producer()->cut( begin, end ) ),
m_parent( media->baseClip() ),
......@@ -47,7 +47,7 @@ Clip::Clip( Media *media, qint64 begin /*= 0*/, qint64 end /*= Backend::IProduce
Clip::Clip( Clip *parent, qint64 begin /*= -1*/, qint64 end /*= -2*/,
const QString &uuid /*= QString()*/ ) :
Workflow::Helper( begin, end, uuid ),
Workflow::Helper( uuid ),
m_media( parent->media() ),
m_rootClip( parent->rootClip() ),
m_parent( parent )
......
......@@ -24,9 +24,7 @@
using namespace Workflow;
Helper::Helper( qint64 begin /*= 0*/, qint64 end /*= -1*/, const QString &uuid/* = QString()*/ ) :
m_begin( begin ),
m_end( end )
Helper::Helper( const QString &uuid/* = QString()*/ )
{
if ( uuid.isNull() == true )
m_uuid = QUuid::createUuid();
......@@ -38,46 +36,6 @@ Helper::~Helper()
{
}
qint64
Helper::begin() const
{
return m_begin;
}
qint64
Helper::end() const
{
return m_end;
}
void
Helper::setBegin( qint64 begin )
{
m_begin = begin;
emit lengthUpdated();
}
void
Helper::setEnd(qint64 end)
{
m_end = end;
emit lengthUpdated();
}
void
Helper::setBoundaries( qint64 begin, qint64 end )
{
m_begin = begin;
m_end = end;
emit lengthUpdated();
}
qint64
Helper::length() const
{
return m_end - m_begin;
}
const QUuid&
Helper::uuid() const
{
......
......@@ -34,21 +34,19 @@ namespace Workflow
Q_OBJECT
protected: //This class is not meant to be used by itself.
Helper( qint64 begin = 0, qint64 end = -1, const QString &uuid = QString() );
Helper( const QString &uuid = QString() );
~Helper();
public:
virtual const QUuid& uuid() const;
virtual qint64 begin() const;
virtual qint64 end() const;
virtual void setBegin( qint64 begin );
virtual void setEnd( qint64 end );
virtual qint64 length() const;
virtual void setBoundaries( qint64 begin, qint64 end );
virtual qint64 begin() const = 0;
virtual qint64 end() const = 0;
virtual void setBegin( qint64 begin ) = 0;
virtual void setEnd( qint64 end ) = 0;
virtual qint64 length() const = 0;
virtual void setBoundaries( qint64 begin, qint64 end ) = 0;
protected:
qint64 m_begin;
qint64 m_end;
QUuid m_uuid;
signals:
......
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