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