Commit 6fd5068c authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

Add a Project class to handle all core project specific classed.

This is the project counterpart of the Main/Core class
parent 011ce34b
......@@ -28,6 +28,7 @@ SET(VLMC_SRCS
Library/Library.cpp
Library/MediaContainer.cpp
Main/Core.cpp
Main/Project.cpp
Main/main.cpp
Media/Clip.cpp
Media/Media.cpp
......
......@@ -24,7 +24,7 @@
#include "config.h"
#include "Commands.h"
#include "Main/Project.h"
#include "Media/Clip.h"
#include "Workflow/ClipHelper.h"
#include "EffectsEngine/EffectHelper.h"
......@@ -37,7 +37,7 @@
void
Commands::trigger( QUndoCommand* command )
{
UndoStack::getInstance()->push( command );
Project::getInstance()->undoStack()->push( command );
}
#else
void
......@@ -52,7 +52,7 @@ Commands::Generic::Generic() :
{
//This is connected using a direct connection to ensure the view can be refreshed
//just after the signal has been emited.
connect( UndoStack::getInstance(), SIGNAL( retranslateRequired() ),
connect( Project::getInstance()->undoStack(), SIGNAL( retranslateRequired() ),
this, SLOT( retranslate() ), Qt::DirectConnection );
}
......
......@@ -22,6 +22,7 @@
#include "EffectsEngine/EffectHelper.h"
#include "EffectsEngine/EffectUser.h"
#include "Main/Project.h"
#include "Workflow/MainWorkflow.h"
EffectHelper::EffectHelper( EffectInstance *effectInstance, qint64 begin, qint64 end,
......@@ -30,8 +31,8 @@ EffectHelper::EffectHelper( EffectInstance *effectInstance, qint64 begin, qint64
m_effectInstance( effectInstance ),
m_target( NULL )
{
if ( MainWorkflow::getInstance()->getLengthFrame() > 0 )
m_end = MainWorkflow::getInstance()->getLengthFrame();
if ( Project::getInstance()->workflow()->getLengthFrame() > 0 )
m_end = Project::getInstance()->workflow()->getLengthFrame();
else
m_end = Effect::TrackEffectDefaultLength;
}
......
......@@ -34,6 +34,7 @@
#include <QSettings>
#include "Main/Core.h"
#include "Main/Project.h"
#include "Library/Library.h"
#include "Tools/VlmcDebug.h"
#include "Tools/VlmcLogger.h"
......@@ -114,12 +115,12 @@ MainWindow::MainWindow( Backend::IBackend* backend, QWidget *parent ) :
this, SLOT( projectUpdated( const QString&, bool ) ) );
// Undo/Redo
connect( UndoStack::getInstance( this ), SIGNAL( canRedoChanged( bool ) ),
connect( Project::getInstance()->undoStack(), SIGNAL( canRedoChanged( bool ) ),
this, SLOT( canRedoChanged( bool ) ) );
connect( UndoStack::getInstance( this ), SIGNAL( canUndoChanged( bool ) ),
connect( Project::getInstance()->undoStack(), SIGNAL( canUndoChanged( bool ) ),
this, SLOT( canUndoChanged( bool ) ) );
canRedoChanged( UndoStack::getInstance( this )->canRedo() );
canUndoChanged( UndoStack::getInstance( this )->canUndo() );
canRedoChanged( Project::getInstance()->undoStack()->canRedo() );
canUndoChanged( Project::getInstance()->undoStack()->canUndo() );
//Connecting Library stuff:
const ClipRenderer* clipRenderer = qobject_cast<const ClipRenderer*>( m_clipPreview->getGenericRenderer() );
......@@ -128,7 +129,7 @@ MainWindow::MainWindow( Backend::IBackend* backend, QWidget *parent ) :
clipRenderer, SLOT( setClip( Clip* ) ) );
connect( m_mediaLibrary, SIGNAL( importRequired() ),
this, SLOT( on_actionImport_triggered() ) );
connect( Library::getInstance(), SIGNAL( clipRemoved( const QUuid& ) ),
connect( Project::getInstance()->library(), SIGNAL( clipRemoved( const QUuid& ) ),
clipRenderer, SLOT( clipUnloaded( const QUuid& ) ) );
//FIXME: Lazy init this
......@@ -464,7 +465,8 @@ MainWindow::setupUndoRedoWidget()
QT_TRANSLATE_NOOP( "DockWidgetManager", "History" ),
Qt::AllDockWidgetAreas,
QDockWidget::AllDockWidgetFeatures );
QWidget *undoRedoWidget = UndoStack::getInstance( dockedWidget );
// FIXME: This will break undo stack layout, though we need to split the UI part form the actual stack
QWidget *undoRedoWidget = Project::getInstance()->undoStack();
DockWidgetManager::getInstance()->addDockedWidget( dockedWidget, undoRedoWidget, Qt::TopDockWidgetArea );
}
......@@ -625,7 +627,7 @@ MainWindow::on_actionAbout_triggered()
bool
MainWindow::checkVideoLength()
{
if ( MainWorkflow::getInstance()->getLengthFrame() <= 0 )
if ( Project::getInstance()->workflow()->getLengthFrame() <= 0 )
{
QMessageBox::warning( NULL, tr ( "VLMC Renderer" ), tr( "There is nothing to render." ) );
return false;
......@@ -832,13 +834,13 @@ MainWindow::on_actionClose_Project_triggered()
void
MainWindow::on_actionUndo_triggered()
{
UndoStack::getInstance( this )->undo();
Project::getInstance()->undoStack()->undo();
}
void
MainWindow::on_actionRedo_triggered()
{
UndoStack::getInstance( this )->redo();
Project::getInstance()->undoStack()->redo();
}
void
......
......@@ -100,7 +100,7 @@ private:
/**
* \brief Will check if there is any video on the Project Timeline.
* \return true, if ( MainWorkflow::getInstance()->getLengthFrame() > 0 )
* \return true, if ( Project::getInstance()->workflow()->getLengthFrame() > 0 )
* else false
*/
bool checkVideoLength();
......
......@@ -26,17 +26,17 @@
#include <QUndoView>
#include "Commands/KeyboardShortcutHelper.h"
#include "Tools/QSingleton.hpp"
class QUndoStack;
class QUndoCommand;
class UndoStack : public QUndoView, public QSingleton<UndoStack>
class UndoStack : public QUndoView
{
Q_OBJECT
Q_DISABLE_COPY( UndoStack );
public:
UndoStack( QWidget* parent );
void push( QUndoCommand *command );
void beginMacro( const QString &text );
void endMacro();
......@@ -47,8 +47,6 @@ class UndoStack : public QUndoView, public QSingleton<UndoStack>
void changeEvent( QEvent *event );
private:
UndoStack( QWidget* parent );
QUndoStack* m_undoStack;
public slots:
......@@ -61,8 +59,6 @@ class UndoStack : public QUndoView, public QSingleton<UndoStack>
void canRedoChanged( bool canRedo );
void canUndoChanged( bool canUndo );
void retranslateRequired();
friend class QSingleton<UndoStack>;
};
#endif // UNDOSTACK_H
......@@ -23,6 +23,7 @@
#include "WorkflowFileRendererDialog.h"
#include "Main/Project.h"
#include "vlmc.h"
#include "Workflow/MainWorkflow.h"
#include "Renderer/WorkflowFileRenderer.h"
......@@ -67,7 +68,7 @@ WorkflowFileRendererDialog::updatePreview( const uchar* buff )
void
WorkflowFileRendererDialog::frameChanged( qint64 frame )
{
qint64 totalFrames = MainWorkflow::getInstance()->getLengthFrame();
qint64 totalFrames = Project::getInstance()->workflow()->getLengthFrame();
if ( frame <= totalFrames )
{
......
......@@ -26,6 +26,7 @@
#include "ui_ImportController.h"
#include "Main/Core.h"
#include "Main/Project.h"
#include "Media/Clip.h"
#include "Renderer/ClipRenderer.h"
#include "Backend/ISource.h"
......@@ -155,7 +156,7 @@ void
ImportController::importMedia( const QString &filePath )
{
vlmcDebug() << "Importing" << filePath;
if ( Library::getInstance()->mediaAlreadyLoaded( filePath ) == true ||
if ( Project::getInstance()->library()->mediaAlreadyLoaded( filePath ) == true ||
m_temporaryMedias->mediaAlreadyLoaded( filePath ) == true )
return ;
......@@ -240,7 +241,7 @@ ImportController::accept()
{
if ( clip->getMedia()->source()->length() == 0 )
invalidMedias = true;
Library::getInstance()->addClip( clip );
Project::getInstance()->library()->addClip( clip );
}
if ( invalidMedias == true )
handleInvalidMedias();
......
......@@ -24,6 +24,7 @@
#include "MediaCellView.h"
#include "ui_MediaCellView.h"
#include "Main/Project.h"
#include "Media/Clip.h"
#include "ClipProperty.h"
#include "Backend/ISource.h"
......@@ -228,7 +229,7 @@ MediaCellView::mouseMoveEvent( QMouseEvent* event )
void
MediaCellView::deleteButtonClicked( QWidget*, QMouseEvent* )
{
if ( MainWorkflow::getInstance()->contains( m_clip->uuid() ) == true )
if ( Project::getInstance()->workflow()->contains( m_clip->uuid() ) == true )
{
QMessageBox msgBox;
msgBox.setText( tr( "This clip or some of its children are contained in the timeline." ) );
......@@ -292,10 +293,10 @@ MediaCellView::contextMenuEvent( QContextMenuEvent *event )
return ;
if ( copyInWorkspace == selectedAction )
{
if ( Workspace::getInstance()->copyToWorkspace( m_clip->getMedia() ) == false )
if ( Project::getInstance()->workspace()->copyToWorkspace( m_clip->getMedia() ) == false )
{
QMessageBox::warning( NULL, tr( "Can't copy to workspace" ),
tr( "Can't copy this media to workspace: %1" ).arg( Workspace::getInstance()->lastError() ) );
tr( "Can't copy this media to workspace: %1" ).arg( Project::getInstance()->workspace()->lastError() ) );
}
}
}
......@@ -22,6 +22,7 @@
#include "MediaLibrary.h"
#include "Main/Project.h"
#include "Media/Clip.h"
#include "Library/Library.h"
#include "Media/Media.h"
......@@ -41,7 +42,7 @@ MediaLibrary::MediaLibrary(QWidget *parent) : QWidget(parent),
setAcceptDrops( true );
StackViewController *nav = new StackViewController( m_ui->mediaListContainer );
m_mediaListView = new MediaListView( nav, Library::getInstance() );
m_mediaListView = new MediaListView( nav, Project::getInstance()->library() );
nav->pushViewController( m_mediaListView );
connect( m_ui->importButton, SIGNAL( clicked() ),
......@@ -165,7 +166,7 @@ MediaLibrary::dropEvent( QDropEvent *event )
return;
}
Q_ASSERT( Library::getInstance() != NULL );
Q_ASSERT( Project::getInstance()->library() != NULL );
foreach ( const QUrl &url, fileList )
{
......@@ -174,13 +175,13 @@ MediaLibrary::dropEvent( QDropEvent *event )
if ( fileName.isEmpty() )
continue;
Media *media = Library::getInstance()->addMedia( fileName );
Media *media = Project::getInstance()->library()->addMedia( fileName );
if ( media != NULL )
{
Clip* clip = new Clip( media );
media->setBaseClip( clip );
Library::getInstance()->addClip( clip );
Project::getInstance()->library()->addClip( clip );
event->accept();
}
else
......
......@@ -23,6 +23,7 @@
#include "GuiProjectManager.h"
#include "Main/Core.h"
#include "Main/Project.h"
#include "Library/Library.h"
#include "Workflow/MainWorkflow.h"
#include "Settings/SettingsManager.h"
......@@ -37,9 +38,9 @@
GUIProjectManager::GUIProjectManager()
{
connect( this, SIGNAL( projectClosed() ), Library::getInstance(), SLOT( clear() ) );
connect( this, SIGNAL( projectClosed() ), MainWorkflow::getInstance(), SLOT( clear() ) );
connect( Library::getInstance(), SIGNAL( cleanStateChanged( bool ) ),
connect( this, SIGNAL( projectClosed() ), Project::getInstance()->library(), SLOT( clear() ) );
connect( this, SIGNAL( projectClosed() ), Project::getInstance()->workflow(), SLOT( clear() ) );
connect( Project::getInstance()->library(), SIGNAL( cleanStateChanged( bool ) ),
this, SLOT( cleanChanged( bool ) ) );
//Automatic save part :
......@@ -148,7 +149,7 @@ GUIProjectManager::createNewProjectFile( bool saveAs )
appendToRecentProject( projectName() );
if ( relocate == true )
Workspace::getInstance()->copyAllToWorkspace();
Project::getInstance()->workspace()->copyAllToWorkspace();
emit projectUpdated( projectName(), true );
}
return true;
......
......@@ -21,6 +21,8 @@
*****************************************************************************/
#include <QList>
#include "Main/Project.h"
#include "TracksView.h"
#include "GraphicsTrack.h"
#include "Workflow/MainWorkflow.h"
......@@ -33,7 +35,7 @@ GraphicsTrack::GraphicsTrack( Workflow::TrackType type, quint32 trackNumber,
m_type = type;
m_trackNumber = trackNumber;
m_enabled = true;
m_trackWorkflow = MainWorkflow::getInstance()->track( type, trackNumber );
m_trackWorkflow = Project::getInstance()->workflow()->track( type, trackNumber );
setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
setContentsMargins( 0, 0, 0, 0 );
......@@ -62,9 +64,9 @@ GraphicsTrack::setTrackEnabled( bool enabled )
m_enabled = enabled;
if( enabled )
MainWorkflow::getInstance()->unmuteTrack( m_trackNumber, m_type );
Project::getInstance()->workflow()->unmuteTrack( m_trackNumber, m_type );
else
MainWorkflow::getInstance()->muteTrack( m_trackNumber, m_type );
Project::getInstance()->workflow()->muteTrack( m_trackNumber, m_type );
}
bool
......
......@@ -22,6 +22,7 @@
#include "Timeline.h"
#include "Main/Project.h"
#include "Media/Clip.h"
#include "Workflow/ClipHelper.h"
#include "TracksView.h"
......@@ -44,7 +45,7 @@ Timeline::Timeline( WorkflowRenderer* renderer, QWidget *parent ) :
m_instance = this;
m_ui.setupUi( this );
m_mainWorkflow = MainWorkflow::getInstance();
m_mainWorkflow = Project::getInstance()->workflow();
m_tracksScene = new TracksScene( this );
m_tracksView = new TracksView( m_tracksScene, m_mainWorkflow, m_renderer, m_ui.tracksFrame );
......@@ -114,7 +115,6 @@ Timeline::Timeline( WorkflowRenderer* renderer, QWidget *parent ) :
Timeline::~Timeline()
{
MainWorkflow::destroyInstance();
}
void
......
......@@ -28,6 +28,7 @@
#include "GraphicsAudioItem.h"
#include "GraphicsMovieItem.h"
#include "GraphicsTrack.h"
#include "Main/Project.h"
#include "Settings/SettingsManager.h"
#include "Timeline.h"
#include "Workflow/TrackWorkflow.h"
......@@ -106,7 +107,7 @@ TracksScene::askRemoveSelectedItems()
}
}
UndoStack::getInstance()->beginMacro( "Remove clip(s)" );
Project::getInstance()->undoStack()->beginMacro( "Remove clip(s)" );
QList<QGraphicsItem*> items = selectedItems();
for (int i = 0; i < items.size(); ++i )
......@@ -133,5 +134,5 @@ TracksScene::askRemoveSelectedItems()
}
}
UndoStack::getInstance()->endMacro();
Project::getInstance()->undoStack()->endMacro();
}
......@@ -23,6 +23,7 @@
#include "TracksView.h"
#include "Main/Core.h"
#include "Main/Project.h"
#include "Workflow/ClipHelper.h"
#include "Workflow/ClipWorkflow.h"
#include "Commands/Commands.h"
......@@ -375,7 +376,7 @@ void
TracksView::clipDragEnterEvent( QDragEnterEvent *event )
{
const QString fullId = QString( event->mimeData()->data( "vlmc/uuid" ) );
Clip *clip = Library::getInstance()->clip( fullId );
Clip *clip = Project::getInstance()->library()->clip( fullId );
if ( clip == NULL )
return;
bool hasVideo = clip->getMedia()->source()->hasVideo();
......@@ -799,7 +800,7 @@ TracksView::dropEvent( QDropEvent *event )
if ( m_dragAudioItem != NULL || m_dragVideoItem != NULL )
{
UndoStack::getInstance()->beginMacro( "Add clip" );
Project::getInstance()->undoStack()->beginMacro( "Add clip" );
if ( m_dragAudioItem )
{
......@@ -835,7 +836,7 @@ TracksView::dropEvent( QDropEvent *event )
m_dragVideoItem = NULL;
}
UndoStack::getInstance()->endMacro();
Project::getInstance()->undoStack()->endMacro();
m_lastKnownTrack = NULL;
}
......@@ -1183,7 +1184,7 @@ TracksView::mouseReleaseEvent( QMouseEvent *event )
}
}
else
UndoStack::getInstance()->beginMacro( "Move clip" );
Project::getInstance()->undoStack()->beginMacro( "Move clip" );
m_actionItem->triggerMove( target, targetPos );
// Update the linked item too
if ( m_actionItem->groupItem() )
......@@ -1194,7 +1195,7 @@ TracksView::mouseReleaseEvent( QMouseEvent *event )
}
if ( effectItem == NULL )
UndoStack::getInstance()->endMacro();
Project::getInstance()->undoStack()->endMacro();
m_actionItem->m_oldTrack = m_actionItem->track()->trackWorkflow();
m_actionRelativeX = -1;
......
......@@ -30,7 +30,6 @@
#ifndef LIBRARY_H
#define LIBRARY_H
#include "Tools/Singleton.hpp"
#include "MediaContainer.h"
#include <QObject>
......@@ -45,21 +44,20 @@ class Media;
* \class Library
* \brief Library Object that handles public Clips
*/
class Library : public MediaContainer, public Singleton<Library>
class Library : public MediaContainer
{
Q_OBJECT
Q_DISABLE_COPY( Library );
public:
Library();
virtual ~Library(){}
virtual void addMedia( Media* media );
virtual Media *addMedia( const QFileInfo &fileInfo );
virtual bool addClip( Clip *clip );
bool isInCleanState() const;
private:
Library();
virtual ~Library(){}
void setCleanState( bool newState );
private:
......@@ -86,7 +84,6 @@ signals:
void projectLoaded();
void cleanStateChanged( bool newState );
friend class Singleton<Library>;
friend class Workspace;
};
......
/*****************************************************************************
* Project.cpp: Handles all core project components
*****************************************************************************
* Copyright (C) 2008-2014 VideoLAN
*
* Authors: Hugo Beauzée-Luyssen <hugo@beauzee.fr>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#include "Project.h"
#include "Library/Library.h"
#include "Workflow/MainWorkflow.h"
#include "Gui/UndoStack.h"
#include "Project/Workspace.h"
Project::Project()
{
m_library = new Library;
m_workflow = new MainWorkflow;
m_undoStack = new UndoStack( NULL );
m_workspace = new Workspace;
}
Project::~Project()
{
delete m_workspace;
delete m_undoStack;
delete m_workflow;
delete m_library;
}
Library*
Project::library()
{
return m_library;
}
MainWorkflow*
Project::workflow()
{
return m_workflow;
}
UndoStack*
Project::undoStack()
{
return m_undoStack;
}
Workspace*
Project::workspace()
{
return m_workspace;
}
/*****************************************************************************
* Project.h: Handles all core project components
*****************************************************************************
* Copyright (C) 2008-2014 VideoLAN
*
* Authors: Hugo Beauzée-Luyssen <hugo@beauzee.fr>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef PROJECT_H
#define PROJECT_H
#include "Tools/Singleton.hpp"
class Library;
class UndoStack;
class MainWorkflow;
class Workspace;
class Project : public Singleton<Project>
{
private:
Project();
~Project();
public:
// Insert settings here
Library* library();
MainWorkflow* workflow();
UndoStack* undoStack();
Workspace* workspace();
private:
Library* m_library;
MainWorkflow* m_workflow;
UndoStack* m_undoStack;
Workspace* m_workspace;
friend class Singleton<Project>;
};
#endif // PROJECT_H
......@@ -23,6 +23,7 @@
#include "config.h"
#include "Main/Core.h"
#include "Main/Project.h"
#include "Library/Library.h"
#include "Workflow/MainWorkflow.h"
#include "Gui/project/GuiProjectManager.h"
......@@ -87,9 +88,7 @@ ProjectManager::ProjectManager() : m_projectFile( NULL ), m_needSave( false )
VLMC_CREATE_PRIVATE_PROJECT_STRING( "vlmc/Workspace", "" );
//We have to wait for the library to be loaded before loading the workflow
connect( Library::getInstance(), SIGNAL( projectLoaded() ), this, SLOT( loadWorkflow() ) );
//Create the workspace:
Workspace::getInstance();
connect( Project::getInstance()->library(), SIGNAL( projectLoaded() ), this, SLOT( loadWorkflow() ) );
}
ProjectManager::~ProjectManager()
......@@ -111,7 +110,7 @@ ProjectManager::loadWorkflow()
QDomElement root = m_domDocument->documentElement();
bool savedState;
MainWorkflow::getInstance()->loadProject( root );
Project::getInstance()->workflow()->loadProject( root );
loadTimeline( root );
if ( m_projectFile != NULL )
{
......@@ -163,7 +162,7 @@ ProjectManager::loadProject( const QString& fileName )
Core::getInstance()->settings()->load( root );
Core::getInstance()->settings()->setValue( "vlmc/Workspace", fInfo.absolutePath(), SettingsManager::Project );
Timeline::getInstance()->renderer()->loadProject( root );
Library::getInstance()->loadProject( root );
Project::getInstance()->library()->loadProject( root );
}
void
......@@ -186,8 +185,8 @@ ProjectManager::__saveProject( const QString &fileName )
project.writeStartDocument();
project.writeStartElement( "vlmc" );
Library::getInstance()->saveProject( project );
MainWorkflow::getInstance()->saveProject( project );
Project::getInstance()->library()->saveProject( project );
Project::getInstance()->workflow()->saveProject( project );
Timeline::getInstance()->renderer()->saveProject( project );
Core::getInstance()->settings()->save( project );
saveTimeline( project );
......
......@@ -22,6 +22,7 @@
#include "Workspace.h"
#include "Main/Project.h"
#include "Media/Clip.h"
#include "Library/Library.h"
#include "Media/Media.h"
......@@ -177,10 +178,10 @@ Workspace::pathInProjectDir( const Media *media )
void
Workspace::copyAllToWorkspace()
{
if ( Library::getInstance()->m_clips.size() == 0 )
if ( Project::getInstance()->library()->m_clips.size() == 0 )
return ;
QHash<QUuid, Clip*>::iterator it = Library::getInstance()->m_clips.begin();
QHash<QUuid, Clip*>::iterator ite = Library::getInstance()->m_clips.end();
QHash<QUuid, Clip*>::iterator it = Project::getInstance()->library()->m_clips.begin();
QHash<QUuid, Clip*>::iterator ite = Project::getInstance()->library()->m_clips.end();
{
QMutexLocker lock( m_mediasToCopyMutex );
......
......@@ -23,7 +23,6 @@
#ifndef WORKSPACE_H
#define WORKSPACE_H
#include "Tools/Singleton.hpp"
#include "Tools/ErrorHandler.h"
#include <QObject>
......@@ -35,13 +34,15 @@ class Media;
class QFileInfo;
class QMutex;
class Workspace : public QObject, public Singleton<Workspace>, public ErrorHandler
class Workspace : public QObject, public ErrorHandler
{
Q_OBJECT
public:
static const QString workspacePrefix;
Workspace();
~Workspace();
static bool isInProjectDir( const QString &path );
static bool isInProjectDir( const QFileInfo &fInfo );
static bool isInProjectDir( const Media *media );
......@@ -50,8 +51,6 @@ class Workspace : public QObject, public Singleton<Workspace>, public ErrorHandl
bool copyToWorkspace( Media* media );
void copyAllToWorkspace();
private:
Workspace();
~Workspace();
void startCopyWorker( Media *media );
private:
QQueue<Media*> m_mediasToCopy;
......@@ -65,8 +64,6 @@ class Workspace : public QObject, public Singleton<Workspace>, public ErrorHandl
signals:
void notify( QString );
friend class Singleton<Workspace>;
};
#endif // WORKSPACE_H
......@@ -33,6 +33,7 @@
#include "WorkflowRenderer.h"
#include "Main/Project.h"
#include "Media/Clip.h"
#include "EffectsEngine/EffectInstance.h"
#include "GenericRenderer.h"
......@@ -45,7 +46,7 @@
#include "Workflow/Types.h"
WorkflowRenderer::WorkflowRenderer( Backend::IBackend* backend ) :
m_mainWorkflow( MainWorkflow::getInstance() ),
m_mainWorkflow( Project::getInstance()->workflow() ),
m_stopping( false ),
m_outputFps( 0.0f ),
m_aspectRatio( "" ),
......