Skip to content

Commit

Permalink
wip (build will fail) - Organizing units for better testing and optim…
Browse files Browse the repository at this point in the history
…izing
  • Loading branch information
nathanjhood committed Mar 26, 2024
1 parent 982f503 commit 5ae2c84
Show file tree
Hide file tree
Showing 11 changed files with 518 additions and 439 deletions.
472 changes: 252 additions & 220 deletions CMakeLists.txt

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions Sources/Biquads.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,22 +42,22 @@ namespace ProjectInfo
extern const int versionNumber = 0x10203a7;
}

/// @} group Biquads
/** @} group Biquads */
} // namespace Biquads

/// @} group StoneyDSP
/** @} group StoneyDSP */
} // namespace StoneyDSP

// #ifdef STONEYDSP_BIQUADS_MODULE
#include "Parameters/Parameters.cpp"
#include "Wrapper/Wrapper.cpp"
#include "Processor/Processor.cpp"
#include "Editor/Editor.cpp"
// #endif
// // #ifdef STONEYDSP_BIQUADS_MODULE
// #include "Parameters/Parameters.cpp"
// #include "Wrapper/Wrapper.cpp"
// #include "Processor/Processor.cpp"
// #include "Editor/Editor.cpp"
// // #endif

//==============================================================================
// This creates new instances of the plugin..
juce::AudioProcessor* JUCE_CALLTYPE createPluginFilter()
{
return new StoneyDSP::Biquads::AudioPluginAudioProcessor();
return new StoneyDSP::Biquads::Processor();
}
44 changes: 22 additions & 22 deletions Sources/Biquads.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,22 @@
#include "AppConfig.h"
#endif

#include <juce_audio_basics/juce_audio_basics.h>
#include <juce_audio_devices/juce_audio_devices.h>
#include <juce_audio_formats/juce_audio_formats.h>
#include <juce_audio_plugin_client/juce_audio_plugin_client.h>
#include <juce_audio_processors/juce_audio_processors.h>
#include <juce_audio_utils/juce_audio_utils.h>
#include <juce_core/juce_core.h>
#include <juce_data_structures/juce_data_structures.h>
#include <juce_dsp/juce_dsp.h>
#include <juce_events/juce_events.h>
#include <juce_graphics/juce_graphics.h>
#include <juce_gui_basics/juce_gui_basics.h>
#include <juce_gui_extra/juce_gui_extra.h>

#include <stoneydsp_audio/stoneydsp_audio.h>
#include <stoneydsp_core/stoneydsp_core.h>
// #include <juce_audio_basics/juce_audio_basics.h>
// #include <juce_audio_devices/juce_audio_devices.h>
// #include <juce_audio_formats/juce_audio_formats.h>
// #include <juce_audio_plugin_client/juce_audio_plugin_client.h>
// #include <juce_audio_processors/juce_audio_processors.h>
// #include <juce_audio_utils/juce_audio_utils.h>
// #include <juce_core/juce_core.h>
// #include <juce_data_structures/juce_data_structures.h>
// #include <juce_dsp/juce_dsp.h>
// #include <juce_events/juce_events.h>
// #include <juce_graphics/juce_graphics.h>
// #include <juce_gui_basics/juce_gui_basics.h>
// #include <juce_gui_extra/juce_gui_extra.h>

// #include <stoneydsp_audio/stoneydsp_audio.h>
// #include <stoneydsp_core/stoneydsp_core.h>


#if JUCE_TARGET_HAS_BINARY_DATA
Expand All @@ -64,12 +64,12 @@ namespace StoneyDSP
namespace Biquads
{

class AudioPluginAudioProcessor;

/** @addtogroup Biquads
* @{
*/

// class Processor;

namespace ProjectInfo
{
extern const char* const projectName;
Expand Down Expand Up @@ -99,13 +99,13 @@ struct Polar
template struct Polar<float>;
template struct Polar<double>;

/// @} group Biquads
/** @} group Biquads */
} // namespace Biquads

/// @} group StoneyDSP
/** @} group StoneyDSP */
} // namespace StoneyDSP

#include "Parameters/Parameters.hpp"
#include "Wrapper/Wrapper.hpp"
// #include "Wrapper/Wrapper.hpp"
#include "Processor/Processor.hpp"
#include "Editor/Editor.hpp"
// #include "Editor/Editor.hpp"
8 changes: 6 additions & 2 deletions Sources/Editor/Editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
******************************************************************************/

// #ifdef STONEYDSP_BIQUADS_EDITOR_HPP_INCLUDED
// #error "Incorrect usage of 'Editor.cpp'!"
// #endif

#include "Editor.hpp"

namespace StoneyDSP {
Expand Down Expand Up @@ -78,8 +82,8 @@ void AudioPluginAudioProcessorEditor::resized()
redoButton.resized();
}

/// @} group Biquads
/** @} group Biquads */
} // namespace Biquads

/// @} group StoneyDSP
/** @} group StoneyDSP */
} // namespace StoneyDSP
10 changes: 4 additions & 6 deletions Sources/Editor/Editor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@
#pragma once
#define STONEYDSP_BIQUADS_EDITOR_HPP_INCLUDED

// #include "../Biquads.hpp"

// #ifndef STONEYDSP_BIQUADS_HPP_INCLUDED
// // #ifndef STONEYDSP_BIQUADS_HPP_INCLUDED
// #include <juce_audio_basics/juce_audio_basics.h>
// #include <juce_audio_devices/juce_audio_devices.h>
// #include <juce_audio_formats/juce_audio_formats.h>
Expand All @@ -41,7 +39,7 @@
// #include <juce_graphics/juce_graphics.h>
// #include <juce_gui_basics/juce_gui_basics.h>
// #include <juce_gui_extra/juce_gui_extra.h>
// #endif
// // #endif

namespace StoneyDSP {
/** @addtogroup StoneyDSP @{ */
Expand Down Expand Up @@ -75,8 +73,8 @@ class JUCE_API AudioPluginAudioProcessorEditor final : public juce::AudioProcess
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AudioPluginAudioProcessorEditor)
};

/// @} group Biquads
/** @} group Biquads */
} // namespace Biquads

/// @} group StoneyDSP
/** @} group StoneyDSP */
} // namespace StoneyDSP
24 changes: 12 additions & 12 deletions Sources/Parameters/Parameters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
******************************************************************************/

// #ifdef STONEYDSP_BIQUADS_PARAMETERS_HPP_INCLUDED
// #error "Incorrect usage of 'Parameters.cpp'!"
// #endif

#include "Parameters.hpp"

namespace StoneyDSP {
Expand All @@ -30,18 +34,14 @@ namespace StoneyDSP {
namespace Biquads {
/** @addtogroup Biquads @{ */

AudioPluginAudioProcessorParameters::AudioPluginAudioProcessorParameters(AudioPluginAudioProcessor& p /* , juce::AudioProcessorValueTreeState& apvts */)
Parameters::Parameters(Processor& p)
: audioProcessor (p)
, undoManagerPtr (std::make_unique<juce::UndoManager>())
, undoManager (*undoManagerPtr.get())
, apvtsPtr (std::make_unique<juce::AudioProcessorValueTreeState>(p, &undoManager, juce::Identifier { "Parameters" }, createParameterLayout()))
, apvts (*apvtsPtr.get())
, undoManager ()
, apvts (p, &undoManager, juce::Identifier { "Parameters" }, createParameterLayout())
{
jassert(undoManagerPtr != nullptr);
jassert(apvtsPtr != nullptr);
}

void AudioPluginAudioProcessorParameters::setParameterLayout(juce::AudioProcessorValueTreeState::ParameterLayout& newParameterLayout)
void Parameters::setParameterLayout(juce::AudioProcessorValueTreeState::ParameterLayout& newParameterLayout)
{
const auto dBMax = juce::Decibels::gainToDecibels(16.0f);
const auto dBMin = juce::Decibels::gainToDecibels(0.0625f);
Expand Down Expand Up @@ -180,7 +180,7 @@ void AudioPluginAudioProcessorParameters::setParameterLayout(juce::AudioProcesso
const auto bandsString = juce::StringArray({ "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O" });
}

juce::AudioProcessorValueTreeState::ParameterLayout AudioPluginAudioProcessorParameters::createParameterLayout()
juce::AudioProcessorValueTreeState::ParameterLayout Parameters::createParameterLayout()
{
juce::AudioProcessorValueTreeState::ParameterLayout parameterLayout;

Expand All @@ -189,15 +189,15 @@ juce::AudioProcessorValueTreeState::ParameterLayout AudioPluginAudioProcessorPar
return parameterLayout;
}

juce::AudioProcessorParameterGroup AudioPluginAudioProcessorParameters::createParameterGroup()
juce::AudioProcessorParameterGroup Parameters::createParameterGroup()
{
juce::AudioProcessorParameterGroup parameterGroup;

return parameterGroup;
}
//==============================================================================
/// @} group Biquads
/** @} group Biquads */
} // namespace Biquads

/// @} group StoneyDSP
/** @} group StoneyDSP */
} // namespace StoneyDSP
53 changes: 32 additions & 21 deletions Sources/Parameters/Parameters.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,33 +25,41 @@
#pragma once
#define STONEYDSP_BIQUADS_PARAMETERS_HPP_INCLUDED

// #include "../Biquads.hpp"

// #ifndef STONEYDSP_BIQUADS_HPP_INCLUDED
// #include <juce_audio_basics/juce_audio_basics.h> // depends: juce_core
// #include <juce_audio_processors/juce_audio_processors.h> // depends: juce_gui_extra, juce_audio_basics
// #include <juce_core/juce_core.h> //
// #include <juce_data_structures/juce_data_structures.h> // depends: juce_events
// #include <juce_events/juce_events.h> // depends: juce_core
// #include <juce_graphics/juce_graphics.h> // depends: juce_events
// #include <juce_gui_basics/juce_gui_basics.h> // depends: juce_graphics, juce_data_structures
// #include <juce_gui_extra/juce_gui_extra.h> // depends: juce_gui_basics
#include <juce_audio_basics/juce_audio_basics.h> // depends: juce_core
#include <juce_audio_processors/juce_audio_processors.h> // depends: juce_gui_extra, juce_audio_basics
#include <juce_core/juce_core.h> //
#include <juce_data_structures/juce_data_structures.h> // depends: juce_events
#include <juce_events/juce_events.h> // depends: juce_core
#include <juce_graphics/juce_graphics.h> // depends: juce_events
#include <juce_gui_basics/juce_gui_basics.h> // depends: juce_graphics, juce_data_structures
#include <juce_gui_extra/juce_gui_extra.h> // depends: juce_gui_basics
// #endif // STONEYDSP_BIQUADS_HPP_INCLUDED

#include "Processor.hpp"

namespace StoneyDSP {
/** @addtogroup StoneyDSP @{ */

namespace Biquads {
/** @addtogroup Biquads @{ */

class AudioPluginAudioProcessor;
// namespace ProjectInfo
// {
// extern const char* const projectName = "Biquads";
// extern const char* const companyName = "StoneyDSP";
// extern const char* const versionString = "1.2.3.167";
// extern const int versionNumber = 0x10203a7;
// }

class AudioPluginAudioProcessorParameters
// class Processor;

class Parameters
{
public:
//==========================================================================
/** Constructor. */
AudioPluginAudioProcessorParameters(AudioPluginAudioProcessor& p);
Parameters(Processor& p);

//==============================================================================
juce::UndoManager& getUndoManager() { return undoManager; }
Expand Down Expand Up @@ -84,19 +92,22 @@ class AudioPluginAudioProcessorParameters
//==========================================================================
// This reference is provided as a quick way for the wrapper to
// access the processor object that created it.
AudioPluginAudioProcessor& audioProcessor;
Processor& audioProcessor;

// std::unique_ptr<juce::UndoManager> undoManagerPtr { nullptr };
// juce::UndoManager& undoManager;

std::unique_ptr<juce::UndoManager> undoManagerPtr { nullptr };
juce::UndoManager& undoManager;
// std::unique_ptr<juce::AudioProcessorValueTreeState> apvtsPtr { nullptr };
// juce::AudioProcessorValueTreeState& apvts;

std::unique_ptr<juce::AudioProcessorValueTreeState> apvtsPtr { nullptr };
juce::AudioProcessorValueTreeState& apvts;
juce::UndoManager undoManager;
juce::AudioProcessorValueTreeState apvts;

JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(AudioPluginAudioProcessorParameters)
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(Parameters)
};

/// @} group Biquads
/** @} group Biquads */
} // namespace Biquads

/// @} group StoneyDSP
/** @} group StoneyDSP */
} // namespace StoneyDSP
Loading

0 comments on commit 5ae2c84

Please sign in to comment.