Public Member Functions | Public Attributes | Protected Member Functions | List of all members
MidiInputComponentInstance Class Reference

#include <midiinputcomponent.h>

Public Member Functions

 MidiInputComponentInstance (EntityInstance &entity, Component &resource)
bool init (utility::ErrorState &errorState) override
virtual ~MidiInputComponentInstance ()
nap::Signal< const MidiEvent & > * getMessageReceived ()
- Public Member Functions inherited from ComponentInstance
 ComponentInstance (EntityInstance &entity, Component &resource)
virtual void update (double deltaTime)
nap::EntityInstancegetEntityInstance () const
nap::ComponentgetComponent () const
template<typename T >
T * getComponent () const
virtual bool init (utility::ErrorState &errorState)
- Public Member Functions inherited from Object
 Object ()
virtual ~Object ()
virtual void onDestroy ()
 Object (Object &)=delete
Objectoperator= (const Object &)=delete
 Object (Object &&)=delete
Objectoperator= (Object &&)=delete

Public Attributes

nap::Signal< const MidiEvent & > messageReceived
std::vector< std::string > mPorts
std::vector< MidiValuemChannels
std::vector< MidiValuemNumbers
std::vector< MidiEvent::TypemTypes
- Public Attributes inherited from Object
std::string mID
 Property: 'mID' unique name of the object. Used as an identifier by the system. More...

Protected Member Functions

void trigger (const MidiEvent &event)

Additional Inherited Members

- Static Public Member Functions inherited from Object
static bool isIDProperty (rtti::Instance &object, const rtti::Property &property)


Instance of component that filters incoming midi messages and makes them available for other components by emitting a signal.

Inheritance diagram for MidiInputComponentInstance:
Collaboration diagram for MidiInputComponentInstance:

Constructor & Destructor Documentation

◆ MidiInputComponentInstance()

MidiInputComponentInstance ( EntityInstance entity,
Component resource 

◆ ~MidiInputComponentInstance()

virtual ~MidiInputComponentInstance ( )

Member Function Documentation

◆ getMessageReceived()

nap::Signal<const MidiEvent&>* getMessageReceived ( )

◆ init()

bool init ( utility::ErrorState errorState)

Initializes this component based on it's resource.

errorStatecontains the error when initialization fails.
if initialization succeeded.

Reimplemented from ComponentInstance.

◆ trigger()

void trigger ( const MidiEvent event)

This is triggered by the service when a new midi message is received

Member Data Documentation

◆ mChannels

std::vector<MidiValue> mChannels

Filter specifying what midi channels to listen to. Empty means all channels.

◆ messageReceived

nap::Signal<const MidiEvent&> messageReceived

Signal emitted when a midi message is received that passes the filter settings

◆ mNumbers

std::vector<MidiValue> mNumbers

Filter specifying what number bytes (like cc numbers) to listen to. Empty means all numbers.

◆ mPorts

std::vector<std::string> mPorts

Filter specifying input ports that will be listened to. Empty means all ports.

◆ mTypes

std::vector<MidiEvent::Type> mTypes

Filter specifying what event types to listen to. Empty means all types.