Commit 4e7a52a9 authored by Hugo Beauzee-Luyssen's avatar Hugo Beauzee-Luyssen

applying HACKING on Media.{h,cpp}

parent 331a9524
......@@ -42,20 +42,20 @@ ClipProperty::ClipProperty( Clip* clip, QWidget *parent ) :
//Duration
ui->durationValueLabel->setText( duration.toString( "hh:mm:ss" ) );
//Filename || title
ui->nameValueLabel->setText( m_clip->getParent()->getFileInfo()->fileName() );
setWindowTitle( m_clip->getParent()->getFileInfo()->fileName() + " " + tr( "properties" ) );
ui->nameValueLabel->setText( m_clip->getParent()->fileInfo()->fileName() );
setWindowTitle( m_clip->getParent()->fileInfo()->fileName() + " " + tr( "properties" ) );
//Resolution
ui->resolutionValueLabel->setText( QString::number( m_clip->getParent()->getWidth() )
+ " x " + QString::number( m_clip->getParent()->getHeight() ) );
ui->resolutionValueLabel->setText( QString::number( m_clip->getParent()->width() )
+ " x " + QString::number( m_clip->getParent()->height() ) );
//FPS
ui->fpsValueLabel->setText( QString::number( m_clip->getParent()->getFps() ) );
ui->fpsValueLabel->setText( QString::number( m_clip->getParent()->fps() ) );
//Snapshot
ui->snapshotLabel->setPixmap( m_clip->getParent()->getSnapshot().scaled( 128, 128, Qt::KeepAspectRatio ) );
ui->snapshotLabel->setPixmap( m_clip->getParent()->snapshot().scaled( 128, 128, Qt::KeepAspectRatio ) );
//nb tracks :
ui->nbVideoTracksValueLabel->setText(
QString::number( m_clip->getParent()->getNbVideoTracks() ) );
QString::number( m_clip->getParent()->nbVideoTracks() ) );
ui->nbAudioTracksValueLabel->setText(
QString::number( m_clip->getParent()->getNbAudioTracks() ) );
QString::number( m_clip->getParent()->nbAudioTracks() ) );
//Metatags
const QPushButton* button = ui->buttonBox->button( QDialogButtonBox::Apply );
Q_ASSERT( button != NULL);
......
......@@ -73,7 +73,7 @@ void TagWidget::mediaSelected( Media* media )
for (int i = 0; i < m_buttonList.count(); i++)
{
static_cast<QPushButton*>( m_buttonList[i])->setEnabled( true );
if ( m_currentMedia->getMetaTags().contains( static_cast<QPushButton*>(m_buttonList[i])->text() ) )
if ( m_currentMedia->metaTags().contains( static_cast<QPushButton*>(m_buttonList[i])->text() ) )
static_cast<QPushButton*>(m_buttonList[i])->setChecked( true );
else
static_cast<QPushButton*>(m_buttonList[i])->setChecked( false );
......@@ -93,7 +93,7 @@ void TagWidget:: buttonTagClicked()
{
if ( m_currentMedia != NULL )
{
QStringList tagList = m_currentMedia->getMetaTags();
QStringList tagList = m_currentMedia->metaTags();
for (int i = 0; i < m_buttonList.count(); i++)
{
QPushButton* button = static_cast<QPushButton*>(m_buttonList[i]);
......@@ -112,11 +112,11 @@ void TagWidget::setTagTextEdit()
QString tags;
if ( m_currentMedia != NULL )
{
for( int i = 0; i < m_currentMedia->getMetaTags().count(); i++ )
for( int i = 0; i < m_currentMedia->metaTags().count(); i++ )
if (i == 0)
tags += m_currentMedia->getMetaTags()[i];
tags += m_currentMedia->metaTags()[i];
else
tags += "," + m_currentMedia->getMetaTags()[i];
tags += "," + m_currentMedia->metaTags()[i];
m_ui->TagTextEdit->setText(tags);
setButtonList( m_defaultTagList );
}
......
......@@ -175,13 +175,13 @@ ImportController::clipSelection( const QUuid& uuid )
void
ImportController::updateMediaRequested( Media *media )
{
if ( m_temporaryMedias.contains( media->getUuid() ) == false )
if ( m_temporaryMedias.contains( media->uuid() ) == false )
return ;
ImportMediaCellView* cell = m_mediaListController->cell( media->getUuid() );
ImportMediaCellView* cell = m_mediaListController->cell( media->uuid() );
if ( cell == NULL )
return;
cell->setThumbnail( media->getSnapshot() );
cell->setLength( media->getLengthMS() );
cell->setThumbnail( media->snapshot() );
cell->setLength( media->lengthMS() );
}
void
......@@ -191,17 +191,17 @@ ImportController::setUIMetaData( Media* media )
{
//Duration
QTime duration;
duration = duration.addMSecs( media->getLengthMS() );
duration = duration.addMSecs( media->lengthMS() );
m_ui->durationValueLabel->setText( duration.toString( "hh:mm:ss" ) );
//Filename || title
m_ui->nameValueLabel->setText( media->getFileInfo()->fileName() );
m_ui->nameValueLabel->setText( media->fileInfo()->fileName() );
m_ui->nameValueLabel->setWordWrap( true );
setWindowTitle( media->getFileInfo()->fileName() + " " + tr( "properties" ) );
setWindowTitle( media->fileInfo()->fileName() + " " + tr( "properties" ) );
//Resolution
m_ui->resolutionValueLabel->setText( QString::number( media->getWidth() )
+ " x " + QString::number( media->getHeight() ) );
m_ui->resolutionValueLabel->setText( QString::number( media->width() )
+ " x " + QString::number( media->height() ) );
//FPS
m_ui->fpsValueLabel->setText( QString::number( media->getFps() ) );
m_ui->fpsValueLabel->setText( QString::number( media->fps() ) );
}
else
{
......@@ -219,13 +219,13 @@ ImportController::setUIMetaData( Clip* clip )
qint64 length = clip->getLengthSecond();
time = time.addSecs( length );
m_ui->durationValueLabel->setText( time.toString( "hh:mm:ss" ) );
m_ui->nameValueLabel->setText( clip->getParent()->getFileInfo()->fileName() );
m_ui->nameValueLabel->setText( clip->getParent()->fileInfo()->fileName() );
m_ui->nameValueLabel->setWordWrap( true );
setWindowTitle( clip->getParent()->getFileInfo()->fileName() + " " +
setWindowTitle( clip->getParent()->fileInfo()->fileName() + " " +
tr( "properties" ) );
m_ui->resolutionValueLabel->setText( QString::number( clip->getParent()->getWidth() )
+ " x " + QString::number( clip->getParent()->getHeight() ) );
m_ui->fpsValueLabel->setText( QString::number( clip->getParent()->getFps() ) );
m_ui->resolutionValueLabel->setText( QString::number( clip->getParent()->width() )
+ " x " + QString::number( clip->getParent()->height() ) );
m_ui->fpsValueLabel->setText( QString::number( clip->getParent()->fps() ) );
}
void
......@@ -234,7 +234,7 @@ ImportController::importMedia( const QString &filePath )
++m_nbMediaToLoad;
m_ui->progressBar->setMaximum( m_nbMediaToLoad );
foreach ( Media* media, m_temporaryMedias.values() )
if ( media->getFileInfo()->filePath() == filePath )
if ( media->fileInfo()->filePath() == filePath )
return ;
if ( Library::getInstance()->mediaAlreadyLoaded( filePath ) == true )
return ;
......@@ -246,7 +246,7 @@ ImportController::importMedia( const QString &filePath )
this, SLOT( updateMediaRequested( Media* ) ) );
connect( media, SIGNAL( snapshotComputed( Media* ) ),
this, SLOT( mediaLoaded() ) );
m_temporaryMedias[media->getUuid()] = media;
m_temporaryMedias[media->uuid()] = media;
MetaDataManager::getInstance()->computeMediaMetadata( media );
m_mediaListController->addMedia( media );
}
......@@ -454,11 +454,11 @@ void
ImportController::failedToLoad( Media *media )
{
m_ui->errorLabel->setText( tr( "Failed to load %1").arg(
media->getFileInfo()->fileName() ) );
media->fileInfo()->fileName() ) );
m_ui->errorLabelImg->show();
m_ui->errorLabel->show();
QTimer::singleShot( 3000, this, SLOT( hideErrors() ) );
mediaDeletion( media->getUuid() );
mediaDeletion( media->uuid() );
}
void
......
......@@ -39,7 +39,7 @@ ImportMediaListController::~ImportMediaListController()
void
ImportMediaListController::addMedia( Media* media )
{
ImportMediaCellView* cell = new ImportMediaCellView( media->getUuid() );
ImportMediaCellView* cell = new ImportMediaCellView( media->uuid() );
connect( cell, SIGNAL( cellSelected( const QUuid& ) ),
this, SIGNAL( mediaSelected( const QUuid& ) ) );
connect( cell, SIGNAL( cellDeleted( const QUuid& ) ),
......@@ -47,11 +47,11 @@ ImportMediaListController::addMedia( Media* media )
connect( cell, SIGNAL( arrowClicked( const QUuid& ) ),
this, SIGNAL( showClipListAsked( const QUuid& ) ) );
cell->setTitle( media->getFileName() );
cell->setThumbnail( media->getSnapshot() );
cell->setTitle( media->fileName() );
cell->setThumbnail( media->snapshot() );
addCell( cell );
m_mediaCellList->insert( media->getUuid(), cell );
m_mediaCellList->insert( media->uuid(), cell );
if ( media->baseClip() == NULL )
connect( media, SIGNAL( metaDataComputed( Media* ) ), cell, SLOT( enableCell() ) );
}
......@@ -59,7 +59,7 @@ ImportMediaListController::addMedia( Media* media )
void
ImportMediaListController::metaDataComputed( Media* media )
{
m_mediaCellList->value( media->getUuid() )->setThumbnail( media->getSnapshot() );
m_mediaCellList->value( media->uuid() )->setThumbnail( media->snapshot() );
}
ImportMediaCellView*
......@@ -98,8 +98,8 @@ ImportMediaListController::addClip( Clip* clip )
size.setNum( m_mediaCellList->size() + 1 );
cell->setTitle( clip->getParent()->getFileName() + "_" + size );
cell->setThumbnail( clip->getParent()->getSnapshot() );
cell->setTitle( clip->getParent()->fileName() + "_" + size );
cell->setThumbnail( clip->getParent()->snapshot() );
cell->setLength( clip->getLengthSecond(), false );
cell->setEnabled( true );
addCell( cell );
......@@ -147,7 +147,7 @@ ImportMediaListController::clipAdded( Clip* clip )
{
if ( clip->getParent() == 0 )
return ;
const QUuid& uuid = clip->getParent()->getUuid();
const QUuid& uuid = clip->getParent()->uuid();
if ( m_mediaCellList->contains( uuid ) )
m_mediaCellList->value( uuid )->incrementClipCount();
}
......
......@@ -66,10 +66,10 @@ void ClipListViewController::addClip( Clip* clip )
connect( cell, SIGNAL( cellSelected( QUuid ) ), this, SLOT( cellSelection( const QUuid& ) ) );
connect( cell, SIGNAL( cellDeleted( const QUuid& ) ), this, SLOT( clipDeletion( const QUuid& ) ) );
cell->setThumbnail( clip->getParent()->getSnapshot() );
cell->setThumbnail( clip->getParent()->snapshot() );
QString number;
number.setNum( m_cells.size() + 1 );
cell->setTitle( clip->getParent()->getFileName() + number );
cell->setTitle( clip->getParent()->fileName() + number );
cell->setLength( clip->getLengthSecond(), false );
addCell( cell );
m_cells.insert( clip->getUuid(), cell );
......
......@@ -139,7 +139,8 @@ void MediaCellView::mouseMoveEvent( QMouseEvent* event )
Media* parent = Library::getInstance()->clip( m_uuid )->getParent();
if ( 0 == parent )
return ;
drag->setPixmap( Library::getInstance()->clip( m_uuid )->getParent()->getSnapshot().scaled( 100, 100, Qt::KeepAspectRatio ) );
drag->setPixmap( Library::getInstance()->clip( m_uuid )->getParent()->
snapshot().scaled( 100, 100, Qt::KeepAspectRatio ) );
drag->exec( Qt::CopyAction | Qt::MoveAction, Qt::CopyAction );
}
......
......@@ -40,7 +40,7 @@ MediaListViewController::~MediaListViewController()
void MediaListViewController::newMediaLoaded( Media* media )
{
MediaCellView* cell = new MediaCellView( media->getUuid() );
MediaCellView* cell = new MediaCellView( media->uuid() );
connect( cell, SIGNAL ( cellSelected( QUuid ) ),
this, SLOT ( cellSelection( QUuid ) ) );
......@@ -51,13 +51,13 @@ void MediaListViewController::newMediaLoaded( Media* media )
connect( media, SIGNAL( snapshotComputed( Media* ) ),
this, SLOT( updateCell( Media* ) ) );
cell->setNbClips( media->clips()->size() );
cell->setThumbnail( media->getSnapshot() );
cell->setTitle( media->getFileName() );
cell->setLength( media->getLengthMS() );
cell->setThumbnail( media->snapshot() );
cell->setTitle( media->fileName() );
cell->setLength( media->lengthMS() );
if ( media->baseClip() != NULL )
cell->setEnabled(true);
addCell(cell);
m_cells->insert( media->getUuid(), cell );
m_cells->insert( media->uuid(), cell );
}
void MediaListViewController::cellSelection( const QUuid& uuid )
......@@ -90,12 +90,12 @@ void MediaListViewController::mediaRemoved( const QUuid& uuid )
void MediaListViewController::updateCell( Media* media )
{
MediaCellView* cell = qobject_cast<MediaCellView*>( m_cells->value( media->getUuid(), NULL ) );
MediaCellView* cell = qobject_cast<MediaCellView*>( m_cells->value( media->uuid(), NULL ) );
if ( cell != NULL )
{
cell->setNbClips( media->clips()->size() );
cell->setLength( media->getLengthMS() );
cell->setThumbnail( media->getSnapshot() );
cell->setLength( media->lengthMS() );
cell->setThumbnail( media->snapshot() );
cell->setEnabled(true);
}
}
......@@ -119,7 +119,7 @@ void MediaListViewController::newClipAdded( Clip* clip )
{
if ( clip->getParent() == 0 )
return ;
const QUuid& uuid = clip->getParent()->getUuid();
const QUuid& uuid = clip->getParent()->uuid();
if ( m_cells->contains( uuid ) )
{
......
......@@ -208,13 +208,13 @@ void AbstractGraphicsMediaItem::resize( qint64 size, From from )
if ( size < 1 )
return;
if ( clip()->getParent()->getFileType() != Media::Image )
if ( clip()->getParent()->fileType() != Media::Image )
if ( size > clip()->getMaxEnd() )
return;
if ( from == BEGINNING )
{
if ( clip()->getParent()->getFileType() != Media::Image )
if ( clip()->getParent()->fileType() != Media::Image )
if ( clip()->getBegin() + size > clip()->getMaxEnd() )
return;
//FIXME
......@@ -223,7 +223,7 @@ void AbstractGraphicsMediaItem::resize( qint64 size, From from )
}
else
{
if ( clip()->getParent()->getFileType() != Media::Image )
if ( clip()->getParent()->fileType() != Media::Image )
{
qint64 newBegin = qMax( clip()->getEnd() - size, (qint64)0 );
if ( clip()->getMaxBegin() > newBegin )
......
......@@ -33,10 +33,10 @@ GraphicsAudioItem::GraphicsAudioItem( Clip* clip ) : m_clip( clip )
{
setFlags( QGraphicsItem::ItemIsSelectable );
QTime length = QTime().addMSecs( clip->getParent()->getLengthMS() );
QTime length = QTime().addMSecs( clip->getParent()->lengthMS() );
QString tooltip( tr( "<p style='white-space:pre'><b>Name:</b> %1"
"<br><b>Length:</b> %2" )
.arg( clip->getParent()->getFileName() )
.arg( clip->getParent()->fileName() )
.arg( length.toString("hh:mm:ss.zzz") ) );
setToolTip( tooltip );
setAcceptHoverEvents( true );
......@@ -157,7 +157,7 @@ void GraphicsAudioItem::paintTitle( QPainter* painter, const QStyleOptionGraphic
// Initiate the font metrics calculation
QFontMetrics fm( painter->font() );
QString text = m_clip->getParent()->getFileName();
QString text = m_clip->getParent()->fileName();
// Get the transformations required to map the text on the viewport
QTransform viewPortTransform = Timeline::getInstance()->tracksView()->viewportTransform();
......
......@@ -33,10 +33,10 @@ GraphicsMovieItem::GraphicsMovieItem( Clip* clip ) : m_clip( clip )
{
setFlags( QGraphicsItem::ItemIsSelectable );
QTime length = QTime().addMSecs( clip->getParent()->getLengthMS() );
QTime length = QTime().addMSecs( clip->getParent()->lengthMS() );
QString tooltip( tr( "<p style='white-space:pre'><b>Name:</b> %1"
"<br><b>Length:</b> %2" )
.arg( clip->getParent()->getFileName() )
.arg( clip->getParent()->fileName() )
.arg( length.toString("hh:mm:ss.zzz") ) );
setToolTip( tooltip );
setAcceptHoverEvents( true );
......@@ -156,7 +156,7 @@ void GraphicsMovieItem::paintTitle( QPainter* painter, const QStyleOptionGraphic
// Initiate the font metrics calculation
QFontMetrics fm( painter->font() );
QString text = m_clip->getParent()->getFileName();
QString text = m_clip->getParent()->fileName();
// Get the transformations required to map the text on the viewport
QTransform viewPortTransform = Timeline::getInstance()->tracksView()->viewportTransform();
......
......@@ -196,7 +196,7 @@ TracksView::deleteMedia( const QUuid &uuid )
// is the one we would like to remove.
foreach( item, items )
{
if ( item->clip()->getParent()->getUuid() ==
if ( item->clip()->getParent()->uuid() ==
uuid )
{
// This item needs to be removed.
......
......@@ -106,7 +106,7 @@ Library::addMedia( const QFileInfo& fileInfo, const QString& uuid )
foreach( Media* it, m_medias.values() )
{
if ( it->getFileInfo()->filePath() == media->getFileInfo()->filePath() )
if ( it->fileInfo()->filePath() == media->fileInfo()->filePath() )
{
delete media;
return;
......@@ -120,14 +120,14 @@ Library::addMedia( const QFileInfo& fileInfo, const QString& uuid )
void
Library::addMedia( Media *media )
{
m_medias[media->getUuid()] = media;
m_medias[media->uuid()] = media;
emit newMediaLoaded( media );
}
void
Library::addClip( Clip* clip )
{
Media* media = m_medias[clip->getParent()->getUuid()];
Media* media = m_medias[clip->getParent()->uuid()];
media->addClip( clip );
}
......@@ -136,7 +136,7 @@ Library::mediaAlreadyLoaded( const QFileInfo& fileInfo )
{
foreach( Media* media, m_medias.values() )
{
if ( media->getFileInfo()->filePath() == fileInfo.filePath() )
if ( media->fileInfo()->filePath() == fileInfo.filePath() )
return true;
}
return false;
......@@ -188,12 +188,12 @@ Library::loadProject( const QDomElement& medias )
for ( ; it != end; ++it )
{
if ( it.value()->getFileInfo()->absoluteFilePath() == path )
if ( it.value()->fileInfo()->absoluteFilePath() == path )
{
media = it.value();
media->setUuid( QUuid( uuid ) );
m_medias.erase( it );
m_medias[media->getUuid()] = media;
m_medias[media->uuid()] = media;
break ;
}
}
......@@ -246,10 +246,10 @@ Library::saveProject( QDomDocument& doc, QDomElement& rootNode )
QDomElement mrl = doc.createElement( "path" );
QDomCharacterData text;
text = doc.createTextNode( it.value()->getFileInfo()->absoluteFilePath() );
text = doc.createTextNode( it.value()->fileInfo()->absoluteFilePath() );
QDomElement uuid = doc.createElement( "uuid" );
QDomCharacterData text2 = doc.createTextNode( it.value()->getUuid().toString() );
QDomCharacterData text2 = doc.createTextNode( it.value()->uuid().toString() );
mrl.appendChild( text );
uuid.appendChild( text2 );
......@@ -266,7 +266,7 @@ Library::saveProject( QDomDocument& doc, QDomElement& rootNode )
clip.setAttribute( "begin", c->getBegin() );
clip.setAttribute( "end", c->getEnd() );
clip.setAttribute( "uuid", c->getUuid() );
clip.setAttribute( "parentUuid", c->getParent()->getUuid() );
clip.setAttribute( "parentUuid", c->getParent()->uuid() );
clips.appendChild( clip );
}
media.appendChild( clips );
......
......@@ -34,9 +34,9 @@ const int Clip::DefaultFPS = 30;
Clip::Clip( Media* parent ) :
m_parent( parent ),
m_begin( 0 ),
m_end( parent->getNbFrames() ),
m_end( parent->nbFrames() ),
m_maxBegin( 0 ),
m_maxEnd( parent->getNbFrames() )
m_maxEnd( parent->nbFrames() )
{
m_Uuid = QUuid::createUuid();
computeLength();
......@@ -61,11 +61,11 @@ Clip::Clip( Media* parent, qint64 begin, qint64 end /*= -1*/ ) :
m_maxEnd( end )
{
//FIXME: WTF ?
Q_ASSERT( parent->getInputType() == Media::File || ( begin == 0 && end == m_parent->getNbFrames() ) );
Q_ASSERT( parent->inputType() == Media::File || ( begin == 0 && end == m_parent->nbFrames() ) );
if ( parent->getInputType() == Media::File && end < 0 )
if ( parent->inputType() == Media::File && end < 0 )
{
m_end = parent->getNbFrames();
m_end = parent->nbFrames();
m_maxEnd = m_end;
}
m_Uuid = QUuid::createUuid();
......@@ -141,9 +141,9 @@ qint64 Clip::getLengthSecond() const
void Clip::computeLength()
{
if ( m_parent->getInputType() == Media::File )
if ( m_parent->inputType() == Media::File )
{
float fps = m_parent->getFps();
float fps = m_parent->fps();
if ( fps < 0.1f )
fps = Clip::DefaultFPS;
m_length = m_end - m_begin;
......
......@@ -134,7 +134,7 @@ void Media::setSnapshot( QPixmap* snapshot )
m_snapshot = snapshot;
}
const QPixmap& Media::getSnapshot() const
const QPixmap& Media::snapshot() const
{
if ( m_snapshot != NULL )
return *m_snapshot;
......@@ -143,12 +143,12 @@ const QPixmap& Media::getSnapshot() const
return *Media::defaultSnapshot;
}
const QUuid& Media::getUuid() const
const QUuid& Media::uuid() const
{
return m_uuid;
}
const QFileInfo* Media::getFileInfo() const
const QFileInfo* Media::fileInfo() const
{
return m_fileInfo;
}
......@@ -158,12 +158,12 @@ void Media::setLength( qint64 length )
m_lengthMS = length;
}
qint64 Media::getLengthMS() const
qint64 Media::lengthMS() const
{
return m_lengthMS;
}
int Media::getWidth() const
int Media::width() const
{
return m_width;
}
......@@ -173,7 +173,7 @@ void Media::setWidth( int width )
m_width = width;
}
int Media::getHeight() const
int Media::height() const
{
return m_height;
}
......@@ -183,7 +183,7 @@ void Media::setHeight( int height )
m_height = height;
}
float Media::getFps() const
float Media::fps() const
{
return m_fps;
}
......@@ -193,7 +193,7 @@ void Media::setFps( float fps )
m_fps = fps;
}
Media::FileType Media::getFileType() const
Media::FileType Media::fileType() const
{
return m_fileType;
}
......@@ -212,10 +212,10 @@ void Media::emitSnapshotComputed()
void Media::emitAudioSpectrumComuted()
{
emit audioSpectrumComputed( this->getUuid() );
emit audioSpectrumComputed( this->uuid() );
}
Media::InputType Media::getInputType() const
Media::InputType Media::inputType() const
{
return m_inputType;
}
......@@ -230,22 +230,22 @@ void Media::setNbFrames( qint64 nbFrames )
m_nbFrames = nbFrames;
}
qint64 Media::getNbFrames() const
qint64 Media::nbFrames() const
{
return m_nbFrames;
}
const QString& Media::getMrl() const
const QString& Media::mrl() const
{
return m_mrl;
}
const QString& Media::getFileName() const
const QString& Media::fileName() const
{
return m_fileName;
}
const QStringList& Media::getMetaTags() const
const QStringList& Media::metaTags() const
{
return m_metaTags;
}
......@@ -303,13 +303,13 @@ Media::setNbVideoTrack( int nbTracks )
}
int
Media::getNbAudioTracks() const
Media::nbAudioTracks() const
{
return m_nbAudioTracks;
}
int
Media::getNbVideoTracks() const
Media::nbVideoTracks() const
{
return m_nbVideoTracks;
}
......@@ -70,7 +70,8 @@ public:
virtual ~Media();
/**
* \brief This method adds a parameter that will stay constant though the whole life of this media (unless it is explicitely overided), even if it is cloned.
* \brief This method adds a parameter that will stay constant though the whole life
* of this media (unless it is explicitely overided), even if it is cloned.
*/
void addConstantParam( const QString& param );
/**
......@@ -78,20 +79,20 @@ public:
*/
void addVolatileParam( const QString& param, const QString& defaultValue );
void flushVolatileParameters();
LibVLCpp::Media* getVLCMedia() { return m_vlcMedia; }
LibVLCpp::Media *vlcMedia() { return m_vlcMedia; }
void setSnapshot( QPixmap* snapshot );
const QPixmap& getSnapshot() const;
const QPixmap &snapshot() const;
const QFileInfo* getFileInfo() const;
const QString& getMrl() const;
const QString& getFileName() const;
const QFileInfo *fileInfo() const;
const QString &mrl() const;
const QString &fileName() const;
/**
\return Returns the length of this media (ie the
video duration) in milliseconds.
*/
qint64 getLengthMS() const;
qint64 lengthMS() const;
/**
\brief This methods is most of an entry point for the
MetadataManager than enything else.
......@@ -101,35 +102,35 @@ public:
void setLength( qint64 length );
void setNbFrames( qint64 nbFrames );
int getWidth() const;
int width() const;
void setWidth( int width );
int getHeight() const;
int height() const;
void setHeight( int height );
float getFps() const;
float fps() const;
void setFps( float fps );
qint64 getNbFrames() const;
qint64 nbFrames() const;
const QUuid& getUuid() const;
const QUuid &uuid() const;
void setUuid( const QUuid& uuid );
bool hasAudioTrack() const;
bool hasVideoTrack() const;
void setNbAudioTrack( int nbTrack );
void setNbVideoTrack( int nbTrack );
int getNbAudioTracks() const;
int getNbVideoTracks() const;
int nbAudioTracks() const;
int nbVideoTracks() const;
FileType getFileType() const;
FileType fileType() const;
static const QString VideoExtensions;
static const QString AudioExtensions;
static const QString ImageExtensions;
InputType getInputType() const;
InputType inputType() const;
static const QString streamPrefix;
const QStringList& getMetaTags() const;
const QStringList& metaTags() const;
void setMetaTags( const QStringList& tags );
bool matchMetaTag( const QString& tag ) const;
......@@ -144,7 +145,7 @@ public:
Clip* clip( const QUuid& uuid ) const { return m_clips[uuid]; }
const QHash<QUuid, Clip*>* clips() const { return &m_clips; }
QList<int>* getAudioValues() { return m_audioValueList; }
QList<int>* audioValues() { return m_audioValueList; }
const Clip* baseClip() const { return m_baseClip; }
......
......@@ -53,14 +53,14 @@ MetaDataWorker::~MetaDataWorker()
void
MetaDataWorker::compute()
{
if ( m_media->getFileType() == Media::Video ||
m_media->getFileType() == Media::Audio )
if ( m_media->fileType() == Media::Video ||
m_media->fileType() == Media::Audio )
computeDynamicFileMetaData();
else if ( m_media->getFileType() == Media::Image )
else if ( m_media->fileType() == Media::Image )
computeImageMetaData();
m_media->addConstantParam( ":vout=dummy" );
m_mediaPlayer->setMedia( m_media->getVLCMedia() );
m_mediaPlayer->setMedia( m_media->vlcMedia() );
connect( m_mediaPlayer, SIGNAL( playing() ),
this, SLOT( entrypointPlaying() ), Qt::QueuedConnection );
connect( m_mediaPlayer, SIGNAL( errorEncountered() ), this, SLOT( failure() ) );
......@@ -72,7 +72,7 @@ void
MetaDataWorker::computeDynamicFileMetaData()
{
//Disabling audio for this specific use of the media