Skip to content

Commit

Permalink
Rename Engine to LmmsCore, but typedef'd as Engine to prevent name co…
Browse files Browse the repository at this point in the history
…nflicts with ZASFx
  • Loading branch information
Wallacoloo committed Jun 20, 2015
1 parent 96a1d41 commit 76605e1
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 23 deletions.
4 changes: 2 additions & 2 deletions include/ConfigManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
#include "MemoryManager.h"
#include "lmmsversion.h"

class Engine;
class LmmsCore;


const QString PROJECTS_PATH = "projects/";
Expand Down Expand Up @@ -272,7 +272,7 @@ class EXPORT ConfigManager
settingsMap m_settings;


friend class Engine;
friend class LmmsCore;

} ;

Expand Down
12 changes: 7 additions & 5 deletions include/Engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class Song;
class Ladspa2LMMS;


class EXPORT Engine : public QObject
class EXPORT LmmsCore : public QObject
{
Q_OBJECT
public:
Expand Down Expand Up @@ -91,11 +91,11 @@ class EXPORT Engine : public QObject
}
static void updateFramesPerTick();

static inline Engine * inst()
static inline LmmsCore * inst()
{
if( s_instanceOfMe == NULL )
{
s_instanceOfMe = new Engine();
s_instanceOfMe = new LmmsCore();
}
return s_instanceOfMe;
}
Expand Down Expand Up @@ -128,12 +128,14 @@ class EXPORT Engine : public QObject
static Ladspa2LMMS * s_ladspaManager;

// even though most methods are static, an instance is needed for Qt slots/signals
static Engine * s_instanceOfMe;
static LmmsCore * s_instanceOfMe;

friend class GuiApplication;
};



// define the class as "LmmsCore" to avoid symbol name clashes with ZynAddSubFx's Engine class,
// but typedef to Engine so that the rest of Lmms can pretend the name clash doesn't exist.
typedef LmmsCore Engine;

#endif
2 changes: 1 addition & 1 deletion include/Ladspa2LMMS.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class EXPORT Ladspa2LMMS : public LadspaManager
l_sortable_plugin_t m_analysisTools;
l_sortable_plugin_t m_otherPlugins;

friend class Engine;
friend class LmmsCore;

} ;

Expand Down
2 changes: 1 addition & 1 deletion include/Mixer.h
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ class EXPORT Mixer : public QObject

MixerProfiler m_profiler;

friend class Engine;
friend class LmmsCore;
friend class MixerWorkerThread;

} ;
Expand Down
2 changes: 1 addition & 1 deletion include/Song.h
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ private slots:
VstSyncController m_vstSyncController;


friend class Engine;
friend class LmmsCore;
friend class SongEditor;
friend class mainWindow;
friend class ControllerRackView;
Expand Down
26 changes: 13 additions & 13 deletions src/core/Engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,21 +38,21 @@

#include "GuiApplication.h"

float Engine::s_framesPerTick;
Mixer* Engine::s_mixer = NULL;
FxMixer * Engine::s_fxMixer = NULL;
BBTrackContainer * Engine::s_bbTrackContainer = NULL;
Song * Engine::s_song = NULL;
ProjectJournal * Engine::s_projectJournal = NULL;
Ladspa2LMMS * Engine::s_ladspaManager = NULL;
DummyTrackContainer * Engine::s_dummyTC = NULL;
float LmmsCore::s_framesPerTick;
Mixer* LmmsCore::s_mixer = NULL;
FxMixer * LmmsCore::s_fxMixer = NULL;
BBTrackContainer * LmmsCore::s_bbTrackContainer = NULL;
Song * LmmsCore::s_song = NULL;
ProjectJournal * LmmsCore::s_projectJournal = NULL;
Ladspa2LMMS * LmmsCore::s_ladspaManager = NULL;
DummyTrackContainer * LmmsCore::s_dummyTC = NULL;




void Engine::init()
void LmmsCore::init()
{
Engine *engine = inst();
LmmsCore *engine = inst();

emit engine->initProgress(tr("Generating wavetables"));
// generate (load from file) bandlimited wavetables
Expand Down Expand Up @@ -82,7 +82,7 @@ void Engine::init()



void Engine::destroy()
void LmmsCore::destroy()
{
s_projectJournal->stopAllJournalling();
s_mixer->stopProcessing();
Expand Down Expand Up @@ -110,10 +110,10 @@ void Engine::destroy()



void Engine::updateFramesPerTick()
void LmmsCore::updateFramesPerTick()
{
s_framesPerTick = s_mixer->processingSampleRate() * 60.0f * 4 /
DefaultTicksPerTact / s_song->getTempo();
}

Engine * Engine::s_instanceOfMe = NULL;
LmmsCore * LmmsCore::s_instanceOfMe = NULL;

0 comments on commit 76605e1

Please sign in to comment.