Commit c764ab16 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Main: Remove main.cpp and merge it to guimain.cpp

parent ae625ad2
......@@ -27,6 +27,7 @@ SET(VLMC_SRCS
EffectsEngine/EffectSettingValue.cpp
Library/Library.cpp
Library/MediaContainer.cpp
Main/guimain.cpp
Media/Clip.cpp
Media/Media.cpp
Metadata/MetaDataManager.cpp
......@@ -168,7 +169,6 @@ ELSE(NOT WITH_GUI)
Gui/wizard/ProjectWizard.cpp
Gui/wizard/VideoPage.cpp
Gui/wizard/WelcomePage.cpp
Main/guimain.cpp
Media/Transcoder.cpp #Won't be needed without the import, so let's put it in GUI list
)
......
......@@ -28,10 +28,15 @@
#include "config.h"
#include "MainWindow.h"
#include "project/GuiProjectManager.h"
#include "IntroDialog.h"
#include "LanguageHelper.h"
#include "Workflow/Types.h"
#include "Tools/VlmcDebug.h"
#include "Renderer/ConsoleRenderer.h"
#include "Renderer/WorkflowFileRenderer.h"
#include "project/GuiProjectManager.h"
#include "Project/ProjectManager.h"
#include <QApplication>
#include <QColor>
......@@ -52,7 +57,7 @@
* \return Return value of vlmc
*/
int
VLMCmain( int argc, char **argv )
VLMCGuimain( int argc, char **argv )
{
#ifdef Q_WS_X11
XInitThreads();
......@@ -134,3 +139,51 @@ VLMCmain( int argc, char **argv )
w.show();
return app.exec();
}
/**
* VLMC Entry point
* \brief this is the VLMC entry point
* \param argc
* \param argv
* \return Return value of vlmc
*/
int
VLMCCoremain( int argc, char **argv )
{
QCoreApplication app( argc, argv );
app.setApplicationName( "VLMC" );
app.setOrganizationName( "VideoLAN" );
app.setOrganizationDomain( "vlmc.org" );
app.setApplicationVersion( PROJECT_VERSION );
qRegisterMetaType<Workflow::TrackType>( "Workflow::TrackType" );
qRegisterMetaType<Vlmc::FrameChangedReason>( "Vlmc::FrameChangedReason" );
qRegisterMetaType<QVariant>( "QVariant" );
if ( app.arguments().count() < 3 )
{
vlmcCritical() << "Usage: ./vlmc project.vlmc output_file";
return 1;
}
#ifndef WITH_GUI
ConsoleRenderer renderer;
ProjectManager *pm = ProjectManager::getInstance();
QCoreApplication::connect( pm, SIGNAL( projectLoaded() ), &renderer, SLOT( startRender() ) );
pm->loadProject( app.arguments()[1] );
#endif
return app.exec();
}
int
VLMCmain( int argc, char **argv )
{
#ifdef WITH_GUI
return VLMCGuimain( argc, argv );
#else
return VLMCCoremain( argc, argv );
#endif
}
/*****************************************************************************
* main.cpp: VLMC main for non GUI mode
*****************************************************************************
* Copyright (C) 2008-2009 the VLMC team
*
* Authors: Hugo Beauzée-Luyssen <beauze.h@gmail.com>
*
* 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 "config.h"
#include "ConsoleRenderer.h"
#include "ProjectManager.h"
#include "VlmcDebug.h"
#include "WorkflowFileRenderer.h"
#include <QCoreApplication>
#include <QMetaType>
#include <QVariant>
/**
* VLMC Entry point
* \brief this is the VLMC entry point
* \param argc
* \param argv
* \return Return value of vlmc
*/
int
VLMCmain( int argc, char **argv )
{
QCoreApplication app( argc, argv );
app.setApplicationName( "VLMC" );
app.setOrganizationName( "VideoLAN" );
app.setOrganizationDomain( "vlmc.org" );
app.setApplicationVersion( PROJECT_VERSION );
qRegisterMetaType<Workflow::TrackType>( "Workflow::TrackType" );
qRegisterMetaType<Vlmc::FrameChangedReason>( "Vlmc::FrameChangedReason" );
qRegisterMetaType<QVariant>( "QVariant" );
if ( app.arguments().count() < 3 )
{
vlmcCritical() << "Usage: ./vlmc project.vlmc output_file";
return 1;
}
ProjectManager *pm = ProjectManager::getInstance();
ConsoleRenderer renderer;
QCoreApplication::connect( pm, SIGNAL( projectLoaded() ), &renderer, SLOT( startRender() ) );
pm->loadProject( app.arguments()[1] );
return app.exec();
}
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