Instantiate PipelineContext directly.

The class has no real dependencies and sind we no longer need to hide internal dependencies we can just use it directly.
This commit is contained in:
Kai Blaschke
2022-05-29 16:33:39 +02:00
parent 9dca6e7857
commit 3dbf4ecb4b
2 changed files with 6 additions and 11 deletions

View File

@ -24,7 +24,6 @@
#include "BeatDetect.hpp"
#include "ConfigFile.h"
#include "PCM.hpp" //Sound data handler (buffering, FFT, etc.)
#include "PipelineContext.hpp"
#include "PipelineMerger.hpp"
#include "Preset.hpp"
#include "PresetChooser.hpp"
@ -69,8 +68,6 @@ void ProjectM::ResetTextures()
ProjectM::ProjectM(const std::string& configurationFilename, Flags flags)
: m_flags(flags)
, m_pipelineContext(std::make_unique<class PipelineContext>())
, m_pipelineContext2(std::make_unique<class PipelineContext>())
{
ReadConfig(configurationFilename);
Reset();
@ -79,8 +76,6 @@ ProjectM::ProjectM(const std::string& configurationFilename, Flags flags)
ProjectM::ProjectM(const class Settings& settings, Flags flags)
: m_flags(flags)
, m_pipelineContext(std::make_unique<class PipelineContext>())
, m_pipelineContext2(std::make_unique<class PipelineContext>())
{
ReadSettings(settings);
Reset();
@ -400,12 +395,12 @@ void ProjectM::RenderFrameEndOnSeparatePasses(Pipeline* pipeline)
auto ProjectM::PipelineContext() -> class PipelineContext&
{
return *m_pipelineContext;
return m_pipelineContext;
}
auto ProjectM::PipelineContext2() -> class PipelineContext&
{
return *m_pipelineContext2;
return m_pipelineContext2;
}
void ProjectM::Reset()

View File

@ -22,6 +22,7 @@
#include "Common.hpp"
#include "PCM.hpp"
#include "PipelineContext.hpp"
#include "event.h"
#include "fatal.h"
@ -52,8 +53,6 @@
#endif
class PipelineContext;
class BeatDetect;
class Pcm;
@ -361,10 +360,11 @@ private:
bool m_errorLoadingCurrentPreset{false}; //!< Error flag for preset loading errors.
class PipelineContext m_pipelineContext; //!< Pipeline context for the first/current preset.
class PipelineContext m_pipelineContext2; //!< Pipeline context for the next/transitioning preset.
std::unique_ptr<Renderer> m_renderer; //!< The Preset renderer.
std::unique_ptr<BeatDetect> m_beatDetect; //!< The beat detection class.
std::unique_ptr<class PipelineContext> m_pipelineContext; //!< Pipeline context for the first/current preset.
std::unique_ptr<class PipelineContext> m_pipelineContext2; //!< Pipeline context for the next/transitioning preset.
std::unique_ptr<PresetIterator> m_presetPos; //!< The current position of the directory iterator.
std::unique_ptr<PresetLoader> m_presetLoader; //!< Required by the preset chooser. Manages a loaded preset directory.
std::unique_ptr<PresetChooser> m_presetChooser; //!< Provides accessor functions to choose presets.