[vlmc-devel] Main: Remove main.cpp and merge it to guimain.cpp
Jean-Baptiste Kempf
git at videolan.org
Sun Mar 2 16:27:57 CET 2014
vlmc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Sun Mar 2 15:33:45 2014 +0100| [c764ab1637c87b35cb01921fea535569ec17dbcd] | committer: Jean-Baptiste Kempf
Main: Remove main.cpp and merge it to guimain.cpp
> http://git.videolan.org/gitweb.cgi/vlmc.git/?a=commit;h=c764ab1637c87b35cb01921fea535569ec17dbcd
---
src/CMakeLists.txt | 2 +-
src/Main/guimain.cpp | 57 +++++++++++++++++++++++++++++++++++++++++--
src/Main/main.cpp | 65 --------------------------------------------------
3 files changed, 56 insertions(+), 68 deletions(-)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 9e3a483..326a347 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -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
)
diff --git a/src/Main/guimain.cpp b/src/Main/guimain.cpp
index b5c3098..08cfbe1 100644
--- a/src/Main/guimain.cpp
+++ b/src/Main/guimain.cpp
@@ -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
+}
+
+
diff --git a/src/Main/main.cpp b/src/Main/main.cpp
deleted file mode 100644
index 5e9829e..0000000
--- a/src/Main/main.cpp
+++ /dev/null
@@ -1,65 +0,0 @@
-/*****************************************************************************
- * main.cpp: VLMC main for non GUI mode
- *****************************************************************************
- * Copyright (C) 2008-2009 the VLMC team
- *
- * Authors: Hugo Beauzée-Luyssen <beauze.h at 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();
-}
-
More information about the Vlmc-devel
mailing list