2020 */
2121#pragma once
2222
23- #include " Common.hpp "
24- # include " PCM.hpp "
25- #include " PresetFactoryManager .hpp"
26- #include " fatal.h "
23+ #include " libprojectM/projectM_export.h "
24+
25+ #include " libprojectM/Common .hpp"
26+ #include " libprojectM/PCM.hpp "
2727
2828#ifdef _WIN32
2929
4141
4242#if USE_THREADS
4343
44- #include " BackgroundWorker.h"
45-
4644#include < mutex>
4745#include < thread>
4846
4947#endif
5048
49+ class BackgroundWorkerSync ;
50+
5151class BeatDetect ;
5252
5353class Pcm ;
@@ -64,7 +64,9 @@ class Pipeline;
6464
6565class PipelineContext ;
6666
67- class ProjectM
67+ class PresetFactoryManager ;
68+
69+ PROJECTM_EXPORT class ProjectM
6870{
6971public:
7072 ProjectM ();
@@ -246,43 +248,43 @@ class ProjectM
246248
247249 class Pcm m_pcm; // !< Audio data buffer and analyzer instance.
248250
249- size_t m_meshX{32 }; // !< Per-point mesh horizontal resolution.
250- size_t m_meshY{24 }; // !< Per-point mesh vertical resolution.
251- size_t m_targetFps{35 }; // !< Target frames per second.
252- size_t m_textureSize{512 }; // !< Render texture size.
253- size_t m_windowWidth{0 }; // !< Render window width. If 0, nothing is rendered.
254- size_t m_windowHeight{0 }; // !< Render window height. If 0, nothing is rendered.
255- double m_presetDuration{30.0 }; // !< Preset duration in seconds.
256- double m_softCutDuration{3.0 }; // !< Soft cut transition time.
257- double m_hardCutDuration{20.0 }; // !< Time after which a hard cut can happen at the earliest.
258- bool m_hardCutEnabled{false }; // !< If true, hard cuts based on beat detection are enabled.
251+ size_t m_meshX{32 }; // !< Per-point mesh horizontal resolution.
252+ size_t m_meshY{24 }; // !< Per-point mesh vertical resolution.
253+ size_t m_targetFps{35 }; // !< Target frames per second.
254+ size_t m_textureSize{512 }; // !< Render texture size.
255+ size_t m_windowWidth{0 }; // !< Render window width. If 0, nothing is rendered.
256+ size_t m_windowHeight{0 }; // !< Render window height. If 0, nothing is rendered.
257+ double m_presetDuration{30.0 }; // !< Preset duration in seconds.
258+ double m_softCutDuration{3.0 }; // !< Soft cut transition time.
259+ double m_hardCutDuration{20.0 }; // !< Time after which a hard cut can happen at the earliest.
260+ bool m_hardCutEnabled{false }; // !< If true, hard cuts based on beat detection are enabled.
259261 float m_hardCutSensitivity{2.0 }; // !< Loudness sensitivity value for hard cuts.
260- float m_beatSensitivity{1.0 }; // !< General beat sensitivity modifier for presets.
261- bool m_aspectCorrection{true }; // !< If true, corrects aspect ratio for non-rectangular windows.
262- float m_easterEgg{0.0 }; // !< Random preset duration modifier. See TimeKeeper class.
262+ float m_beatSensitivity{1.0 }; // !< General beat sensitivity modifier for presets.
263+ bool m_aspectCorrection{true }; // !< If true, corrects aspect ratio for non-rectangular windows.
264+ float m_easterEgg{0.0 }; // !< Random preset duration modifier. See TimeKeeper class.
263265
264266 std::vector<std::string> m_textureSearchPaths; // /!< List of paths to search for texture files
265267
266268 /* * Timing information */
267269 int m_count{0 }; // !< Rendered frame count since start
268270
269- bool m_presetLocked{false }; // !< If true, the preset change event will not be sent.
271+ bool m_presetLocked{false }; // !< If true, the preset change event will not be sent.
270272 bool m_presetChangeNotified{false }; // !< Stores whether the user has been notified that projectM wants to switch the preset.
271273
272- PresetFactoryManager m_presetFactoryManager; // !< Provides access to all available preset factories.
274+ std::unique_ptr< PresetFactoryManager> m_presetFactoryManager; // !< Provides access to all available preset factories.
273275
274276 std::unique_ptr<class PipelineContext > m_pipelineContext; // !< Pipeline context for the first/current preset.
275277 std::unique_ptr<class PipelineContext > m_pipelineContext2; // !< Pipeline context for the next/transitioning preset.
276278
277- std::unique_ptr<Renderer> m_renderer; // !< The Preset renderer.
278- std::unique_ptr<BeatDetect> m_beatDetect; // !< The beat detection class.
279- std::unique_ptr<Preset> m_activePreset; // !< Currently loaded preset.
280- std::unique_ptr<Preset> m_transitioningPreset; // !< Destination preset when smooth preset switching.
281- std::unique_ptr<TimeKeeper> m_timeKeeper; // !< Keeps the different timers used to render and switch presets.
279+ std::unique_ptr<Renderer> m_renderer; // !< The Preset renderer.
280+ std::unique_ptr<BeatDetect> m_beatDetect; // !< The beat detection class.
281+ std::unique_ptr<Preset> m_activePreset; // !< Currently loaded preset.
282+ std::unique_ptr<Preset> m_transitioningPreset; // !< Destination preset when smooth preset switching.
283+ std::unique_ptr<TimeKeeper> m_timeKeeper; // !< Keeps the different timers used to render and switch presets.
282284
283285#if USE_THREADS
284- mutable std::recursive_mutex m_presetSwitchMutex; // !< Mutex for locking preset switching while rendering and vice versa.
285- std::thread m_workerThread; // !< Background worker for preloading presets.
286- BackgroundWorkerSync m_workerSync; // !< Background work synchronizer.
286+ mutable std::recursive_mutex m_presetSwitchMutex; // !< Mutex for locking preset switching while rendering and vice versa.
287+ std::thread m_workerThread; // !< Background worker for preloading presets.
288+ std::unique_ptr< BackgroundWorkerSync> m_workerSync; // !< Background work synchronizer.
287289#endif
288290};
0 commit comments