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

Solved resolution computation

Removed useless comments
Removed useless constructions of QFileInfo when creating a new Media instance.
Corrected header
parent d156a13c
/*****************************************************************************
* Media.h : Represents a basic container for media informations.
* Clip.h : Represents a basic container for media informations.
*****************************************************************************
* Copyright (C) 2008-2009 the VLMC team
*
......
......@@ -73,11 +73,8 @@ void Library::newMediaLoadingAsked( const QString& filePath )
if ( media->getFileInfo()->absoluteFilePath() == filePath )
return ;
}
//TODO: maybe we should think about taking a reference to a QFileInfo on Clip::Clip() to avoid multiple new...
QFileInfo* fInfo = new QFileInfo( filePath );
media = new Media( fInfo );
media = new Media( filePath );
m_medias[media->getUuid()] = media;
connect( media, SIGNAL( metaDataComputed( Media* ) ), this, SLOT( metaDataComputed( Media* ) ), Qt::DirectConnection );
emit newMediaLoaded( media );
delete fInfo;
}
......@@ -34,17 +34,17 @@ const QString Media::VideoExtensions = "*.mov *.avi *.mkv *.mpg *.mpeg *.wmv *
const QString Media::ImageExtensions = "*.gif *.png *.jpg";
const QString Media::AudioExtensions = "*.mp3 *.oga *.flac *.aac *.wav";
Media::Media( const QFileInfo* fileInfo)
Media::Media( const QString& filePath )
: m_vlcMedia( NULL ), m_snapshot( NULL ), m_length( 0 ),
m_width( 0 ), m_height( 0 )
{
m_uuid = QUuid::createUuid();
m_fileInfo = new QFileInfo( *fileInfo );
m_fileInfo = new QFileInfo( filePath );
setFileType();
if ( m_fileType == Media::Video || m_fileType == Media::Audio )
m_mrl = "file:///" + fileInfo->absoluteFilePath();
m_mrl = "file:///" + m_fileInfo->absoluteFilePath();
else
m_mrl = "fake:///" + fileInfo->absoluteFilePath();
m_mrl = "fake:///" + m_fileInfo->absoluteFilePath();
m_vlcMedia = new LibVLCpp::Media( m_mrl );
}
......
......@@ -69,8 +69,7 @@ public:
Video,
Image
};
Media( const QFileInfo* fileInfo );
// Media( const QString& mrl );
Media( const QString& filePath );
virtual ~Media();
void loadMedia( const QString& mrl );
......
......@@ -25,7 +25,6 @@
#include "AbstractGraphicsMediaItem.h"
#include "Clip.h"
#include "Media.h"
#include "TracksView.h"
class GraphicsMovieItem : public AbstractGraphicsMediaItem
......
......@@ -56,8 +56,6 @@ ListViewMediaItem* LibraryWidget::addClip( Clip* clip )
Media::FileType fileType = clip->getParent()->getFileType();
ListViewMediaItem* item = new ListViewMediaItem( clip, fileType );
//TODO: replace this :
//emit listViewMediaAdded( item->getClip() );
m_clips->append( item );
switch ( fileType )
{
......
......@@ -31,7 +31,6 @@
#include <QWheelEvent>
#include <QGraphicsSceneDragDropEvent>
#include <QApplication>
#include "Media.h"
#include "GraphicsCursorItem.h"
#include "MainWorkflow.h"
#include "TrackWorkflow.h"
......
......@@ -60,7 +60,7 @@ void MetaDataWorker::computeVideoMetaData()
{
//Disabling audio for this specific use of the media
m_currentMedia->addVolatileParam( ":no-audio", ":audio" );
m_currentMedia->addVolatileParam( ":vout=dummy", ":vout=" );
m_currentMedia->addConstantParam( ":vout=dummy" );
connect( m_mediaPlayer, SIGNAL( lengthChanged() ), this, SLOT( entrypointLengthChanged() ) );
}
......@@ -74,8 +74,11 @@ void MetaDataWorker::computeImageMetaData()
void MetaDataWorker::getMetaData()
{
m_mediaIsPlaying = false;
m_lengthHasChanged = false;
m_lengthHasChanged = false;
//In order to wait for the VOUT to be ready:
while ( m_mediaPlayer->getWidth() == 0 )
SleepMS( 1 ); //Ugly isn't it :)
m_currentMedia->setLength( m_mediaPlayer->getLength() );
m_currentMedia->setWidth( m_mediaPlayer->getWidth() );
m_currentMedia->setHeight( m_mediaPlayer->getHeight() );
......
......@@ -30,7 +30,6 @@
#include "Clip.h"
#include "GenericRenderer.h"
//TODO: This should really share a common interface with RenderPreviewWorkflow
class ClipRenderer : public GenericRenderer
{
Q_OBJECT
......
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