Skip to content

Commit

Permalink
Attempted fix for #234 (#242)
Browse files Browse the repository at this point in the history
* Attempted fix for #234

* Apply clang-format

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
jatinchowdhury18 and github-actions[bot] committed Nov 19, 2022
1 parent 8afa344 commit b85dcae
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 15 deletions.
6 changes: 2 additions & 4 deletions src/BYOD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,13 @@ void BYOD::getStateInformation (MemoryBlock& destData)
void BYOD::setStateInformation (const void* data, int sizeInBytes)
{
stateManager->loadState (getXmlFromBinary (data, sizeInBytes).get());

if (wrapperType == WrapperType::wrapperType_AudioUnitv3)
{
// In the AUv3 we need to alert the hsot about parmaeter tree changes
// _after_ the host has finished loading the plugin state.
Timer::callAfterDelay (500, [this]
{
updateHostDisplay (ChangeDetails{}.withParameterInfoChanged (true));
});
{ updateHostDisplay (ChangeDetails {}.withParameterInfoChanged (true)); });
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/gui/toolbar/presets/PresetsComp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ int PresetsComp::addBasicPresetOptions (PopupMenu* menu, int optionID)
optionID = addPresetMenuItem (menu,
optionID,
"Delete Preset",
[&, safeParent = SafePointer {getParentComponent() }]
[&, safeParent = SafePointer { getParentComponent() }]
{
if (auto* currentPreset = manager.getCurrentPreset())
{
Expand Down
2 changes: 1 addition & 1 deletion src/gui/toolbar/presets/PresetsSaveDialog.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "PresetsSaveDialog.h"
#include "state/presets/PresetInfoHelpers.h"
#include "gui/utils/ErrorMessageView.h"
#include "state/presets/PresetInfoHelpers.h"

namespace
{
Expand Down
16 changes: 8 additions & 8 deletions src/gui/utils/ErrorMessageView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@ BYODPluginEditor* findTopLevelEditor (Component* currentComponent)
void ErrorMessageView::showErrorMessage (const String& title, const String& message, const String& buttonText, Component* comp)
{
// similar to:
// NativeMessageBox::showAsync (MessageBoxOptions()
// .withIconType (MessageBoxIconType::WarningIcon)
// .withTitle (title)
// .withMessage (message)
// .withButton (buttonText)
// .withAssociatedComponent (comp),
// nullptr);
// NativeMessageBox::showAsync (MessageBoxOptions()
// .withIconType (MessageBoxIconType::WarningIcon)
// .withTitle (title)
// .withMessage (message)
// .withButton (buttonText)
// .withAssociatedComponent (comp),
// nullptr);

if (auto* topLevelEditor = findTopLevelEditor (comp))
{
Expand All @@ -67,7 +67,7 @@ void ErrorMessageView::showErrorMessage (const String& title, const String& mess
bool ErrorMessageView::showYesNoBox (const juce::String& title, const juce::String& message, juce::Component* comp)
{
// similar to:
// return NativeMessageBox::showYesNoBox (MessageBoxIconType::WarningIcon, title, message, comp) == 1;
// return NativeMessageBox::showYesNoBox (MessageBoxIconType::WarningIcon, title, message, comp) == 1;

if (auto* topLevelEditor = findTopLevelEditor (comp))
{
Expand Down
4 changes: 3 additions & 1 deletion src/processors/chain/ChainIOProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,9 @@ dsp::AudioBlock<float> ChainIOProcessor::processAudioInput (const AudioBuffer<fl
if (oversampling.updateOSFactor())
{
sampleRateChanged = true;
latencyChangedCallbackFunc ((int) oversampling.getLatencySamples());
mainThreadAction->call ([this]
{ latencyChangedCallbackFunc ((int) oversampling.getLatencySamples()); },
true);
}

const auto useStereo = processChannelInputs (buffer);
Expand Down
2 changes: 2 additions & 0 deletions src/processors/chain/ChainIOProcessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,7 @@ class ChainIOProcessor

bool isPrepared = false;

chowdsp::SharedDeferredAction mainThreadAction;

JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ChainIOProcessor)
};

0 comments on commit b85dcae

Please sign in to comment.