NeuralAmpModelerPlugin

Plugin for Neural Amp Modeler
Log | Files | Refs | Submodules | README | LICENSE

commit c133360a9d56eb184ab2df32caf5feb5be8d17cb
parent 0b11d65e2179a066a7d74a3d324e5688b89f1354
Author: Steven Atkinson <[email protected]>
Date:   Wed, 13 Dec 2023 00:28:40 -0800

[BUGFIX] Fix resampler bugs (#408)

* Update iPlug2 submodule

* Update for IDirBrowseControlBase change

* Update NonIntegerResampler -> RealtimeResampler changes

* Prevent crash with NAMFileBrowserControl if menu has submenus

* Retrack official iPlug2 fork

---------

Co-authored-by: Oli Larkin <[email protected]>
Diffstat:
M.gitmodules | 4++--
MNeuralAmpModeler/NeuralAmpModeler.h | 5++---
MNeuralAmpModeler/NeuralAmpModelerControls.h | 24++++++++++++++----------
3 files changed, 18 insertions(+), 15 deletions(-)

diff --git a/.gitmodules b/.gitmodules @@ -1,7 +1,7 @@ [submodule "iPlug2"] path = iPlug2 - # url = https://github.com/iPlug2/iPlug2 - url = https://github.com/sdatkinson/iPlug2.git + url = https://github.com/iPlug2/iPlug2 + # url = https://github.com/sdatkinson/iPlug2.git [submodule "eigen"] path = eigen url = https://gitlab.com/libeigen/eigen.git diff --git a/NeuralAmpModeler/NeuralAmpModeler.h b/NeuralAmpModeler/NeuralAmpModeler.h @@ -9,8 +9,7 @@ #include "IPlug_include_in_plug_hdr.h" #include "ISender.h" -#define M_PI 3.141592653589793238462643383279 // Needed by NonIntegerResampler.h -#include "NonIntegerResampler.h" +#include "RealtimeResampler.h" const int kNumPresets = 1; // The plugin is mono inside @@ -189,7 +188,7 @@ private: bool mFinalized = true; // The resampling wrapper - iplug::NonIntegerResampler<NAM_SAMPLE, 1> mResampler; + iplug::RealtimeResampler<NAM_SAMPLE, 1, 12> mResampler; // Used to check that we don't get too large a block to process. int mMaxExternalBlockSize = 0; diff --git a/NeuralAmpModeler/NeuralAmpModelerControls.h b/NeuralAmpModeler/NeuralAmpModelerControls.h @@ -228,7 +228,7 @@ public: if (pItem) { - mSelectedIndex = mItems.Find(pItem); + mSelectedItemIndex = mItems.Find(pItem); LoadFileAtCurrentIndex(); } } @@ -240,10 +240,10 @@ public: const auto nItems = NItems(); if (nItems == 0) return; - mSelectedIndex--; + mSelectedItemIndex--; - if (mSelectedIndex < 0) - mSelectedIndex = nItems - 1; + if (mSelectedItemIndex < 0) + mSelectedItemIndex = nItems - 1; LoadFileAtCurrentIndex(); }; @@ -252,10 +252,10 @@ public: const auto nItems = NItems(); if (nItems == 0) return; - mSelectedIndex++; + mSelectedItemIndex++; - if (mSelectedIndex >= nItems) - mSelectedIndex = 0; + if (mSelectedItemIndex >= nItems) + mSelectedItemIndex = 0; LoadFileAtCurrentIndex(); }; @@ -304,7 +304,11 @@ public: else { CheckSelectedItem(); - mMainMenu.SetChosenItemIdx(mSelectedIndex); + + if (!mMainMenu.HasSubMenus()) + { + mMainMenu.SetChosenItemIdx(mSelectedItemIndex); + } pCaller->GetUI()->CreatePopupMenu(*this, mMainMenu, pCaller->GetRECT()); } }; @@ -333,7 +337,7 @@ public: void LoadFileAtCurrentIndex() { - if (mSelectedIndex > -1 && mSelectedIndex < NItems()) + if (mSelectedItemIndex > -1 && mSelectedItemIndex < NItems()) { WDL_String fileName, path; GetSelectedFile(fileName); @@ -373,7 +377,7 @@ public: } private: - void SelectFirstFile() { mSelectedIndex = mFiles.GetSize() ? 0 : -1; } + void SelectFirstFile() { mSelectedItemIndex = mFiles.GetSize() ? 0 : -1; } void GetSelectedFileDirectory(WDL_String& path) {