JUCE-7.0.12-0-g4f43011b96 JUCE-7.0.12-0-g4f43011b96
JUCE — C++ application framework with suport for VST, VST3, LV2 audio plug-ins

« « « Anklang Documentation
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | List of all members
Steinberg::Vst::IComponentHandler3 Class Referenceabstract

Extended host callback interface Vst::IComponentHandler3 for an edit controller. More...

#include "ivstcontextmenu.h"

Inheritance diagram for Steinberg::Vst::IComponentHandler3:
Steinberg::FUnknown

Public Member Functions

virtual IContextMenu *PLUGIN_API createContextMenu (IPlugView *plugView, const ParamID *paramID)=0
 Creates a host context menu for a plug-in:
 
- Public Member Functions inherited from Steinberg::FUnknown
virtual tresult PLUGIN_API queryInterface (const TUID _iid, void **obj)=0
 Query for a pointer to the specified interface.
 
virtual uint32 PLUGIN_API addRef ()=0
 Adds a reference and returns the new reference count.
 
virtual uint32 PLUGIN_API release ()=0
 Releases a reference and returns the new reference count.
 

Static Public Attributes

static const FUID iid
 
- Static Public Attributes inherited from Steinberg::FUnknown
static const FUID iid
 

Detailed Description

Extended host callback interface Vst::IComponentHandler3 for an edit controller.

A plug-in can ask the host to create a context menu for a given exported parameter ID or a generic context menu.
The host may pre-fill this context menu with specific items regarding the parameter ID like "Show automation for parameter", "MIDI learn" etc...
The plug-in can use the context menu in two ways :

Note: You can and should use this even if you do not add your own items to the menu as this is considered to be a big user value.

See also
IContextMenu
IContextMenuTarget

Examples

//------------------------------------------------------------------------
class PluginContextMenuTarget : public IContextMenuTarget, public FObject
{
public:
PluginContextMenuTarget () {}
virtual tresult PLUGIN_API executeMenuItem (int32 tag)
{
// this will be called if the user has executed one of the menu items of the plug-in.
// It will not be called for items of the host.
switch (tag)
{
case 1: break;
case 2: break;
}
return kResultTrue;
}
OBJ_METHODS(PluginContextMenuTarget, FObject)
DEF_INTERFACE (IContextMenuTarget)
};
// The following is the code to create the context menu
void popupContextMenu (IComponentHandler* componentHandler, IPlugView* view, const ParamID* paramID, UCoord x, UCoord y)
{
if (componentHandler == 0 || view == 0)
return;
FUnknownPtr<IComponentHandler3> handler (componentHandler);
if (handler == 0)
return;
IContextMenu* menu = handler->createContextMenu (view, paramID);
if (menu)
{
// here you can add your entries (optional)
PluginContextMenuTarget* target = new PluginContextMenuTarget ();
IContextMenu::Item item = {0};
UString128 ("My Item 1").copyTo (item.name, 128);
item.tag = 1;
menu->addItem (item, target);
UString128 ("My Item 2").copyTo (item.name, 128);
item.tag = 2;
menu->addItem (item, target);
target->release ();
//--end of adding new entries
// here the the context menu will be pop-up (and it waits a user interaction)
menu->popup (x, y);
menu->release ();
}
}
Implements FUnknown and IDependent.
Definition fobject.h:84
Context Menu Item Target interface: Vst::IContextMenuTarget.
#define DEFINE_INTERFACES
Start defining interfaces.
Definition fobject.h:387
#define DEF_INTERFACE(InterfaceName)
Add a interfaces.
Definition fobject.h:394
#define END_DEFINE_INTERFACES(BaseClass)
End defining interfaces.
Definition fobject.h:400
#define REFCOUNT_METHODS(BaseClass)
Delegate refcount functions to BaseClass.
Definition fobject.h:360
uint32 ParamID
parameter identifier
Definition vsttypes.h:81
UStringBuffer< 128 > UString128
128 character UTF-16 string
Definition ustring.h:108

Definition at line 118 of file ivstcontextmenu.h.

Member Function Documentation

◆ createContextMenu()

virtual IContextMenu *PLUGIN_API Steinberg::Vst::IComponentHandler3::createContextMenu ( IPlugView plugView,
const ParamID paramID 
)
pure virtual

Creates a host context menu for a plug-in:

  • If paramID is zero, the host may create a generic context menu.
  • The IPlugView object must be valid.
  • The return IContextMenu object needs to be released afterwards by the plug-in.

Member Data Documentation

◆ iid

const FUID Steinberg::Vst::IComponentHandler3::iid
static

Definition at line 128 of file ivstcontextmenu.h.


The documentation for this class was generated from the following file: