Browse Source

AudioProcessorEditorHostContext: Fix naming of getContextMenuForParameter

v6.1.6
reuk 4 years ago
parent
commit
068dffdb8c
No known key found for this signature in database GPG Key ID: 9ADCD339CFC98A11
4 changed files with 18 additions and 7 deletions
  1. +1
    -1
      examples/Plugins/DSPModulePluginDemo.h
  2. +4
    -4
      modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp
  3. +12
    -1
      modules/juce_audio_processors/processors/juce_AudioProcessorEditorHostContext.h
  4. +1
    -1
      modules/juce_audio_processors/processors/juce_GenericAudioProcessorEditor.cpp

+ 1
- 1
examples/Plugins/DSPModulePluginDemo.h View File

@@ -1712,7 +1712,7 @@ private:
{
if (e.mods.isRightButtonDown())
if (auto* c = editor.getHostContext())
if (auto menuInfo = c->getContextMenuForParameterIndex (&param))
if (auto menuInfo = c->getContextMenuForParameter (&param))
menuInfo->getEquivalentPopupMenu().showMenuAsync (PopupMenu::Options{}.withTargetComponent (this)
.withMousePosition());
}


+ 4
- 4
modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp View File

@@ -582,7 +582,7 @@ private:
cachedParamValues = CachedParamValues { { vstParamIDs.begin(), vstParamIDs.end() } };
}
Vst::ParamID generateVSTParamIDForParam (AudioProcessorParameter* param)
Vst::ParamID generateVSTParamIDForParam (const AudioProcessorParameter* param)
{
auto juceParamID = LegacyAudioParameter::getParamID (param, false);
@@ -1579,7 +1579,7 @@ private:
Steinberg::IPlugView* viewIn)
: processor (processorIn), editor (editorIn), componentHandler (handler), view (viewIn) {}
std::unique_ptr<HostProvidedContextMenu> getContextMenuForParameterIndex (const AudioProcessorParameter* parameter) const override
std::unique_ptr<HostProvidedContextMenu> getContextMenuForParameter (const AudioProcessorParameter* parameter) const override
{
if (componentHandler == nullptr || view == nullptr)
return {};
@@ -2214,7 +2214,7 @@ public:
#ifdef JucePlugin_PreferredChannelConfigurations
short configs[][2] = { JucePlugin_PreferredChannelConfigurations };
const int numConfigs = sizeof (configs) / sizeof (short[2]);
const int numConfigs = numElementsInArray (configs);
ignoreUnused (numConfigs);
jassert (numConfigs > 0 && (configs[0][0] > 0 || configs[0][1] > 0));
@@ -2763,7 +2763,7 @@ public:
#ifdef JucePlugin_PreferredChannelConfigurations
short configs[][2] = {JucePlugin_PreferredChannelConfigurations};
const int numConfigs = sizeof (configs) / sizeof (short[2]);
const int numConfigs = numElementsInArray (configs);
bool hasOnlyZeroChannels = true;


+ 12
- 1
modules/juce_audio_processors/processors/juce_AudioProcessorEditorHostContext.h View File

@@ -72,7 +72,18 @@ struct AudioProcessorEditorHostContext
/** Returns an object which can be used to display a context menu for the
parameter with the given index.
*/
virtual std::unique_ptr<HostProvidedContextMenu> getContextMenuForParameterIndex (const AudioProcessorParameter *) const = 0;
virtual std::unique_ptr<HostProvidedContextMenu> getContextMenuForParameter (const AudioProcessorParameter *) const = 0;
/** The naming of this function is misleading. Use getContextMenuForParameter() instead.
Returns an object which can be used to display a context menu for the
parameter with the given index.
*/
[[deprecated ("The naming of this function has been fixed, use getContextMenuForParameter instead")]]
virtual std::unique_ptr<HostProvidedContextMenu> getContextMenuForParameterIndex (const AudioProcessorParameter * p) const
{
return getContextMenuForParameter (p);
}
};
} // namespace juce

+ 1
- 1
modules/juce_audio_processors/processors/juce_GenericAudioProcessorEditor.cpp View File

@@ -452,7 +452,7 @@ public:
{
if (e.mods.isRightButtonDown())
if (auto* context = editor.getHostContext())
if (auto menu = context->getContextMenuForParameterIndex (&parameter))
if (auto menu = context->getContextMenuForParameter (&parameter))
menu->getEquivalentPopupMenu().showMenuAsync (PopupMenu::Options().withTargetComponent (this)
.withMousePosition());
}


Loading…
Cancel
Save