LMMS
Loading...
Searching...
No Matches
Steinberg::Vst::IMidiLearn Class Referenceabstract

#include <ivstmidilearn.h>

Inheritance diagram for Steinberg::Vst::IMidiLearn:
Steinberg::FUnknown

Public Member Functions

virtual tresult PLUGIN_API onLiveMIDIControllerInput (int32 busIndex, int16 channel, CtrlNumber midiCC)=0
Public Member Functions inherited from Steinberg::FUnknown
virtual tresult PLUGIN_API queryInterface (const TUID _iid, void **obj)=0
virtual uint32 PLUGIN_API addRef ()=0
virtual uint32 PLUGIN_API release ()=0

Static Public Attributes

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

Detailed Description

MIDI Learn interface: Vst::IMidiLearn

If this interface is implemented by the edit controller, the host will call this method whenever there is live MIDI-CC input for the plug-in. This way, the plug-in can change its MIDI-CC parameter mapping and inform the host via the IComponentHandler::restartComponent with the kMidiCCAssignmentChanged flag. Use this if you want to implement custom MIDI-Learn functionality in your plug-in.

//------------------------------------------------
// in MyController class declaration
class MyController : public Vst::EditController, public Vst::IMidiLearn
{
// ...
//--- IMidiLearn ---------------------------------
tresult PLUGIN_API onLiveMIDIControllerInput (int32 busIndex, int16 channel,
// ...
// ...
//...
}
//------------------------------------------------
// in mycontroller.cpp
#include "pluginterfaces/vst/ivstmidilearn.h
namespace Steinberg {
namespace Vst {
DEF_CLASS_IID (IMidiLearn)
}
}
//------------------------------------------------------------------------
tresult PLUGIN_API MyController::onLiveMIDIControllerInput (int32 busIndex,
int16 channel, CtrlNumber midiCC)
{
// if we are not in doMIDILearn (triggered by a UI button for example)
// or wrong channel then return
if (!doMIDILearn || busIndex != 0 || channel != 0 || midiLearnParamID == InvalidParamID)
return kResultFalse;
// adapt our internal MIDICC -> parameterID mapping
midiCCMapping[midiCC] = midiLearnParamID;
// new mapping then inform the host that our MIDI assignment has changed
if (auto componentHandler = getComponentHandler ())
{
componentHandler->restartComponent (kMidiCCAssignmentChanged);
}
return kResultTrue;
}
Definition vsteditcontroller.h:62
Definition ivstmidilearn.h:90
virtual tresult PLUGIN_API onLiveMIDIControllerInput(int32 busIndex, int16 channel, CtrlNumber midiCC)=0
#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 SMTG_OVERRIDE
Definition fplatform.h:241
int16 CtrlNumber
MIDI controller number (see ControllerNumbers for allowed values).
Definition vsttypes.h:77
@ kMidiCCAssignmentChanged
Definition ivsteditcontroller.h:123
short int16
Definition ftypes.h:43
int int32
Definition ftypes.h:50
@ kResultTrue
Definition funknown.h:194
int32 tresult
Definition ftypes.h:76

Member Function Documentation

◆ onLiveMIDIControllerInput()

virtual tresult PLUGIN_API Steinberg::Vst::IMidiLearn::onLiveMIDIControllerInput ( int32 busIndex,
int16 channel,
CtrlNumber midiCC )
pure virtual

Called on live input MIDI-CC change associated to a given bus index and MIDI channel

Member Data Documentation

◆ iid

const FUID Steinberg::Vst::IMidiLearn::iid
static

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