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 :
- add its own items to the menu via the IContextMenu interface and call IContextMenu::popup(..) to create the pop-up. See the Examples.
- extract the host menu items and add them to a context menu created by the plug-in.
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
- For example, Cubase adds its owned entries in the context menu opened with right-click on an exported parameter when the plug-in uses createContextMenu.
- Adding plug-in specific items to the context menu:
{
public:
PluginContextMenuTarget () {}
{
switch (tag)
{
case 1: break;
case 2: break;
}
}
};
void popupContextMenu (IComponentHandler* componentHandler, IPlugView* view,
const ParamID* paramID,
UCoord x,
UCoord y)
{
if (componentHandler == 0 || view == 0)
return;
FUnknownPtr<IComponentHandler3>
handler (componentHandler);
return;
IContextMenu* menu =
handler->createContextMenu (view, paramID);
if (menu)
{
PluginContextMenuTarget* target = new PluginContextMenuTarget ();
item.tag = 1;
menu->addItem (item, target);
item.tag = 2;
menu->addItem (item, target);
target->release ();
menu->release ();
}
}
FObject()
default constructor...
Definition fobject.h:85
const UString & copyTo(char16 *dst, int32 dstSize) const
Definition ustring.cpp:125
int y
Definition inflate.c:1588
unsigned x[BMAX+1]
Definition inflate.c:1586
#define DEFINE_INTERFACES
Definition fobject.h:378
#define DEF_INTERFACE(InterfaceName)
Definition fobject.h:385
#define OBJ_METHODS(className, baseClass)
Definition fobject.h:339
#define END_DEFINE_INTERFACES(BaseClass)
Definition fobject.h:391
#define REFCOUNT_METHODS(BaseClass)
Definition fobject.h:351
uint32 ParamID
parameter identifier
Definition vsttypes.h:75
UStringBuffer< 128 > UString128
128 character UTF-16 string
Definition ustring.h:108
int int32
Definition ftypes.h:50
@ kResultTrue
Definition funknown.h:194
int32 UCoord
Definition ftypes.h:135
int32 tresult
Definition ftypes.h:76
void handler(int signal)
Definition fileio.c:1632