Commit 8b3d2b6d authored by Hugo Beauzee-Luyssen's avatar Hugo Beauzee-Luyssen

Basic start for medias's metatags. They're stored in the media, and displayed...

Basic start for medias's metatags. They're stored in the media, and displayed in the media property dialog
parent 0ea647d0
......@@ -46,6 +46,7 @@ Media::Media( const QFileInfo* fileInfo)
else
m_mrl = "fake:///" + fileInfo->absoluteFilePath();
m_vlcMedia = new LibVLCpp::Media( m_mrl );
m_metaTags << "Toto" << "titi" << "tutu";
}
Media::~Media()
......@@ -201,3 +202,18 @@ void Media::addAudioFrame( void* datas, unsigned char* buffer, si
m_audioData.frameList.append( frame );
// qDebug() << m_audioData.frameList.size();
}
const QStringList& Media::getMetaTags() const
{
return m_metaTags;
}
void Media::setMetaTags( const QStringList& tags )
{
m_metaTags = tags;
}
bool Media::matchMetaTag( const QString& tag ) const
{
return m_metaTags.contains( tag, Qt::CaseInsensitive );
}
......@@ -126,6 +126,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;
private:
void setFileType();
......@@ -145,6 +149,7 @@ protected:
int* m_audioSpectrum;
audioData m_audioData;
FileType m_fileType;
QStringList m_metaTags;
signals:
void snapshotChanged();
......
#include <QtDebug>
#include <QTime>
#include <QPushButton>
#include <QStringListModel>
#include "MediaProperty.h"
#include "ui_MediaProperty.h"
......@@ -22,6 +24,13 @@ MediaProperty::MediaProperty( const Media* media, QWidget *parent ) :
ui->fpsValueLabel->setText( QString::number( m_media->getFps() ) );
ui->snapshotLabel->setPixmap( m_media->getSnapshot().scaled( 128, 128, Qt::KeepAspectRatio ) );
setWindowTitle( m_media->getFileInfo()->fileName() + " " + tr( "properties" ) );
const QPushButton* button = ui->buttonBox->button( QDialogButtonBox::Apply );
Q_ASSERT( button != NULL);
connect( button, SIGNAL( clicked() ), this, SLOT( apply() ) );
QStringListModel* model = new QStringListModel( media->getMetaTags(), this );
ui->metaTagsView->setModel( model );
}
MediaProperty::~MediaProperty()
......@@ -41,3 +50,8 @@ void MediaProperty::changeEvent( QEvent *e )
break;
}
}
void MediaProperty::apply()
{
}
......@@ -25,6 +25,7 @@
#include <QDialog>
#include "Media.h"
#include <QAbstractButton>
namespace Ui {
class MediaProperty;
......@@ -40,6 +41,9 @@ public:
protected:
void changeEvent(QEvent *e);
private slots:
void apply();
private:
Ui::MediaProperty* ui;
const Media* m_media;
......
......@@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<width>450</width>
<height>300</height>
</rect>
</property>
......@@ -14,9 +14,6 @@
<string/>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="3" column="0" colspan="6">
<widget class="QListWidget" name="listWidget"/>
</item>
<item row="0" column="0">
<widget class="QFrame" name="frame">
<property name="frameShape">
......@@ -197,6 +194,16 @@
</property>
</spacer>
</item>
<item row="3" column="0" colspan="6">
<widget class="QListView" name="metaTagsView"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Metatags :</string>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
......
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