Commit f95c5407 authored by Hugo Beauzee-Luyssen's avatar Hugo Beauzee-Luyssen

Adding metatags into Media.

parent 402ccb7b
......@@ -133,6 +133,8 @@ bool Clip::matchMetaTag( const QString& tag ) const
{
if ( tag.length() == 0 )
return true;
if ( m_parent->matchMetaTag( tag ) == true )
return true;
QString metaTag;
foreach ( metaTag, m_metaTags )
{
......@@ -140,7 +142,6 @@ bool Clip::matchMetaTag( const QString& tag ) const
return true;
}
return false;
// m_metaTags.contains( tag, Qt::CaseInsensitive );
}
const QString& Clip::getNotes() const
......@@ -180,7 +181,6 @@ Clip* Clip::split( qint64 endFrame )
{
Q_ASSERT( endFrame != m_end );
Clip* newClip = new Clip( this, endFrame, m_end );
qDebug() << "Created new clip. begin:" << newClip->m_begin << "end:" << newClip->m_end;
m_end = endFrame;
computeLength();
return newClip;
......
......@@ -253,3 +253,26 @@ const QString& Media::getFileName() const
{
return m_fileName;
}
const QStringList& Media::getMetaTags() const
{
return m_metaTags;
}
void Media::setMetaTags( const QStringList& tags )
{
m_metaTags = tags;
}
bool Media::matchMetaTag( const QString& tag ) const
{
if ( tag.length() == 0 )
return true;
QString metaTag;
foreach ( metaTag, m_metaTags )
{
if ( metaTag.startsWith( tag, Qt::CaseInsensitive ) == true )
return true;
}
return false;
}
......@@ -137,6 +137,10 @@ public:
QVector<int*> getAudioFrameList() { return m_audioData.frameList; }
unsigned int getAudioNbSample() { return m_audioData.nbSample; }
const QStringList& getMetaTags() const;
void setMetaTags( const QStringList& tags );
bool matchMetaTag( const QString& tag ) const;
void emitMetaDataComputed();
private:
......@@ -161,6 +165,7 @@ protected:
FileType m_fileType;
InputType m_inputType;
QString m_fileName;
QStringList m_metaTags;
signals:
void metaDataComputed();
......
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