diff --git a/Editor/StudioSetupWidget.cpp b/Editor/StudioSetupWidget.cpp index 15b3db4..6640bfa 100644 --- a/Editor/StudioSetupWidget.cpp +++ b/Editor/StudioSetupWidget.cpp @@ -14,6 +14,28 @@ using namespace std::literals; +struct EffectIntrospection { + struct Field { + enum class Type { + Invalid, + UInt32, + UInt32x8, + Float, + }; + + Type m_tp{}; + std::string_view m_name; + float m_min{}; + float m_max{}; + float m_default{}; + }; + amuse::EffectType m_tp; + std::string_view m_name; + std::string_view m_description; + std::array m_fields; +}; + +namespace { constexpr EffectIntrospection ReverbStdIntrospective = { amuse::EffectType::ReverbStd, "Reverb Std"sv, @@ -111,7 +133,7 @@ constexpr std::array ChorusSetters{ &amuse::EffectChorus::setPeriod, }; -static constexpr const EffectIntrospection* GetEffectIntrospection(amuse::EffectType type) { +constexpr const EffectIntrospection* GetEffectIntrospection(amuse::EffectType type) { switch (type) { case amuse::EffectType::ReverbStd: return &ReverbStdIntrospective; @@ -127,7 +149,7 @@ static constexpr const EffectIntrospection* GetEffectIntrospection(amuse::Effect } template -static T GetEffectParm(const amuse::EffectBaseTypeless* effect, int idx, int chanIdx) { +T GetEffectParm(const amuse::EffectBaseTypeless* effect, int idx, int chanIdx) { switch (effect->Isa()) { case amuse::EffectType::ReverbStd: return (static_cast*>(effect)->*ReverbStdGetters[idx])(); @@ -143,7 +165,7 @@ static T GetEffectParm(const amuse::EffectBaseTypeless* effect, int idx, int cha } template -static void SetEffectParm(amuse::EffectBaseTypeless* effect, int idx, int chanIdx, T val) { +void SetEffectParm(amuse::EffectBaseTypeless* effect, int idx, int chanIdx, T val) { switch (effect->Isa()) { case amuse::EffectType::ReverbStd: (static_cast*>(effect)->*ReverbStdSetters[idx])(val); @@ -170,6 +192,21 @@ constexpr std::array ChanNames{ QT_TRANSLATE_NOOP("Uint32X8Popup", "Side Left"), QT_TRANSLATE_NOOP("Uint32X8Popup", "Side Right"), }; +constexpr std::array EffectStrings{ + QT_TRANSLATE_NOOP("EffectCatalogue", "Reverb Standard"), + QT_TRANSLATE_NOOP("EffectCatalogue", "Reverb High"), + QT_TRANSLATE_NOOP("EffectCatalogue", "Delay"), + QT_TRANSLATE_NOOP("EffectCatalogue", "Chorus"), +}; + +constexpr std::array EffectDocStrings{ + QT_TRANSLATE_NOOP("EffectCatalogue", "Reverb Standard"), + QT_TRANSLATE_NOOP("EffectCatalogue", "Reverb High"), + QT_TRANSLATE_NOOP("EffectCatalogue", "Delay"), + QT_TRANSLATE_NOOP("EffectCatalogue", "Chorus"), +}; +} // Anonymous namespace + Uint32X8Popup::Uint32X8Popup(int min, int max, QWidget* parent) : QFrame(parent, Qt::Popup) { setAttribute(Qt::WA_WindowPropagation); setAttribute(Qt::WA_X11NetWmWindowTypeCombo); @@ -714,20 +751,6 @@ EffectCatalogueItem::EffectCatalogueItem(const EffectCatalogueItem& other, QWidg EffectCatalogueItem::~EffectCatalogueItem() = default; -constexpr std::array EffectStrings{ - QT_TRANSLATE_NOOP("EffectCatalogue", "Reverb Standard"), - QT_TRANSLATE_NOOP("EffectCatalogue", "Reverb High"), - QT_TRANSLATE_NOOP("EffectCatalogue", "Delay"), - QT_TRANSLATE_NOOP("EffectCatalogue", "Chorus"), -}; - -constexpr std::array EffectDocStrings{ - QT_TRANSLATE_NOOP("EffectCatalogue", "Reverb Standard"), - QT_TRANSLATE_NOOP("EffectCatalogue", "Reverb High"), - QT_TRANSLATE_NOOP("EffectCatalogue", "Delay"), - QT_TRANSLATE_NOOP("EffectCatalogue", "Chorus"), -}; - EffectCatalogue::EffectCatalogue(QWidget* parent) : QTreeWidget(parent) { setSelectionMode(QAbstractItemView::NoSelection); setColumnCount(1); diff --git a/Editor/StudioSetupWidget.hpp b/Editor/StudioSetupWidget.hpp index d87540f..758a0c4 100644 --- a/Editor/StudioSetupWidget.hpp +++ b/Editor/StudioSetupWidget.hpp @@ -17,8 +17,6 @@ #include "EditorWidget.hpp" -class EffectListing; - namespace amuse { class EffectBaseTypeless; class Studio; @@ -27,26 +25,9 @@ class Submix; enum class EffectType; } // namespace amuse -struct EffectIntrospection { - struct Field { - enum class Type { - Invalid, - UInt32, - UInt32x8, - Float, - }; +class EffectListing; - Type m_tp{}; - std::string_view m_name; - float m_min{}; - float m_max{}; - float m_default{}; - }; - amuse::EffectType m_tp; - std::string_view m_name; - std::string_view m_description; - std::array m_fields; -}; +struct EffectIntrospection; class Uint32X8Popup : public QFrame { Q_OBJECT