Remove Engine's has_gui option

This commit is contained in:
Lukas W
2015-01-07 00:22:40 +01:00
parent 748cccd266
commit e0dbfa696e
4 changed files with 17 additions and 18 deletions

View File

@@ -38,8 +38,9 @@
#include "Song.h"
#include "BandLimitedWave.h"
#include "GuiApplication.h"
bool Engine::s_hasGUI = true;
bool Engine::s_suppressMessages = false;
float Engine::s_framesPerTick;
Mixer* Engine::s_mixer = NULL;
@@ -54,10 +55,8 @@ QMap<QString, QString> Engine::s_pluginFileHandling;
void Engine::init( const bool _has_gui )
void Engine::init()
{
s_hasGUI = _has_gui;
// generate (load from file) bandlimited wavetables
BandLimitedWave::generateWaves();
@@ -109,6 +108,11 @@ void Engine::destroy()
delete ConfigManager::inst();
}
bool Engine::hasGUI()
{
return gui != nullptr;
}

View File

@@ -485,7 +485,7 @@ int main( int argc, char * * argv )
else
{
// we're going to render our song
Engine::init( false );
Engine::init();
printf( "loading project...\n" );
Engine::getSong()->loadProject( file_to_load );

View File

@@ -51,8 +51,6 @@ GuiApplication* GuiApplication::instance()
GuiApplication::GuiApplication()
{
s_instance = this;
// Init style and palette
LmmsStyle* lmmsstyle = new LmmsStyle();
QApplication::setStyle(lmmsstyle);
@@ -71,7 +69,9 @@ GuiApplication::GuiApplication()
qApp->processEvents();
// Init central engine which handles all components of LMMS
Engine::init(false);
Engine::init();
s_instance = this;
m_mainWindow = new MainWindow;
@@ -85,11 +85,10 @@ GuiApplication::GuiApplication()
m_mainWindow->finalize();
splashScreen.finish(m_mainWindow);
Engine::s_hasGUI = true;
}
GuiApplication::~GuiApplication()
{
InstrumentTrackView::cleanupWindowCache();
s_instance = nullptr;
}