Commit 2fa953c0 authored by luyikei's avatar luyikei Committed by Hugo Beauzée-Luyssen

ClipHelper: Use flags to manage available outputs

Since we don't separate tracks according to TrackType, we have to let ClipHelper know which TrackType(s) are available to generate buffers.
Signed-off-by: 's avatarHugo Beauzée-Luyssen <hugo@beauzee.fr>
parent d8e7058a
......@@ -28,7 +28,8 @@ ClipHelper::ClipHelper( Clip* clip, qint64 begin /*= -1*/, qint64 end /*= -1*/,
const QString& uuid /*= QString()*/ ) :
Helper( begin, end, uuid ),
m_clip( clip ),
m_clipWorkflow( nullptr )
m_clipWorkflow( nullptr ),
m_formats( ClipHelper::None )
{
if ( begin == -1 )
m_begin = clip->begin();
......@@ -75,6 +76,20 @@ ClipHelper::setClipWorkflow( ClipWorkflow* cw )
m_clipWorkflow = cw;
}
ClipHelper::Formats
ClipHelper::formats() const
{
return m_formats;
}
void
ClipHelper::setFormats( Formats formats )
{
if ( formats.testFlag( ClipHelper::None ) )
m_formats = ClipHelper::None;
m_formats = formats;
}
void
ClipHelper::clipDestroyed()
{
......
......@@ -36,6 +36,14 @@ class ClipHelper : public Workflow::Helper
Q_OBJECT
public:
enum Format
{
None = 0,
Audio = 1 << 0,
Video = 1 << 1,
};
Q_DECLARE_FLAGS( Formats, Format )
ClipHelper( Clip* clip, qint64 begin = -1, qint64 end = -1,
const QString& uuid = QString() );
......@@ -53,12 +61,19 @@ class ClipHelper : public Workflow::Helper
ClipWorkflow *clipWorkflow();
void setClipWorkflow( ClipWorkflow* cw );
Formats formats() const;
void setFormats( Formats formats );
private:
Clip* m_clip;
ClipWorkflow* m_clipWorkflow;
Formats m_formats;
private slots:
void clipDestroyed();
};
Q_DECLARE_OPERATORS_FOR_FLAGS( ClipHelper::Formats )
#endif // CLIPHELPER_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