diff --git a/include/engine.h b/include/engine.h index bac427a53..917ff894e 100644 --- a/include/engine.h +++ b/include/engine.h @@ -43,6 +43,7 @@ class mainWindow; class mixer; class pianoRoll; class projectNotes; +class ResourcesDB; class song; class songEditor; class ladspa2LMMS; @@ -96,6 +97,11 @@ public: return( s_projectJournal ); } + static ResourcesDB * getResourcesDB( void ) + { + return( s_resourcesDB ); + } + // GUI static mainWindow * getMainWindow( void ) { @@ -168,6 +174,7 @@ private: static mixer * s_mixer; static fxMixer * s_fxMixer; static song * s_song; + static ResourcesDB * s_resourcesDB; static bbTrackContainer * s_bbTrackContainer; static projectJournal * s_projectJournal; static dummyTrackContainer * s_dummyTC; diff --git a/src/core/engine.cpp b/src/core/engine.cpp index 3bf0d0945..aef74d302 100644 --- a/src/core/engine.cpp +++ b/src/core/engine.cpp @@ -24,6 +24,7 @@ * */ +#include #include "engine.h" #include "automation_editor.h" @@ -41,6 +42,7 @@ #include "preset_preview_play_handle.h" #include "project_journal.h" #include "project_notes.h" +#include "resources_db.h" #include "song_editor.h" #include "song.h" @@ -54,6 +56,7 @@ fxMixerView * engine::s_fxMixerView = NULL; mainWindow * engine::s_mainWindow = NULL; bbTrackContainer * engine::s_bbTrackContainer = NULL; song * engine::s_song = NULL; +ResourcesDB * engine::s_resourcesDB = NULL; songEditor * engine::s_songEditor = NULL; automationEditor * engine::s_automationEditor = NULL; bbEditor * engine::s_bbEditor = NULL; @@ -77,6 +80,9 @@ void engine::init( const bool _has_gui ) s_projectJournal = new projectJournal; s_mixer = new mixer; s_song = new song; + s_resourcesDB = new ResourcesDB( configManager::inst()->workingDir() + + QDir::separator() + + ".resourcesdb.xml" ); s_fxMixer = new fxMixer; s_bbTrackContainer = new bbTrackContainer; @@ -151,6 +157,9 @@ void engine::destroy( void ) delete s_song; s_song = NULL; + delete s_resourcesDB; + s_resourcesDB = NULL; + delete configManager::inst(); }