NAP
Public Member Functions | Public Attributes | List of all members
MidiInputPort Class Reference

#include <midiport/midiinputport.h>

Public Member Functions

 MidiInputPort ()=default
 
 MidiInputPort (MidiService &service)
 
virtual bool start (utility::ErrorState &errorState) override
 
virtual void stop () override
 
MidiServicegetService ()
 
void receiveEvent (std::unique_ptr< MidiEvent > event)
 
const std::vector< int > getPortNumbers () const
 
std::string getPortNames () const
 
- Public Member Functions inherited from Resource
 Resource ()
 
- Public Member Functions inherited from Object
 Object ()
 
virtual ~Object ()
 
virtual bool init (utility::ErrorState &errorState)
 
virtual void onDestroy ()
 
 Object (Object &)=delete
 
Objectoperator= (const Object &)=delete
 
 Object (Object &&)=delete
 
Objectoperator= (Object &&)=delete
 

Public Attributes

std::vector< std::string > mPortNames
 Property: 'Ports' names of ports this object opens and listens to. When left empty all ports are opened. More...
 
bool mDebugOutput = false
 Property: 'EnableDebugOutput' If true, incoming messages will be logged for debugging purposes. More...
 
- Public Attributes inherited from Object
std::string mID
 Property: 'mID' unique name of the object. Used as an identifier by the system. More...
 

Additional Inherited Members

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

Description

Opens and manages one or more midi input ports that are monitored for incoming midi messages. Messages will be parsed and passed on to the midi service for processing. When no 'Ports' are specified all ports are opened.

Inheritance diagram for MidiInputPort:
[legend]
Collaboration diagram for MidiInputPort:
[legend]

Constructor & Destructor Documentation

◆ MidiInputPort() [1/2]

MidiInputPort ( )
default

◆ MidiInputPort() [2/2]

MidiInputPort ( MidiService service)

Member Function Documentation

◆ getPortNames()

std::string getPortNames ( ) const
Returns
: A string summing up all ports listened to separated by ,

◆ getPortNumbers()

const std::vector<int> getPortNumbers ( ) const
Returns
: The midi port number thas this object is listening to

◆ getService()

MidiService& getService ( )
Returns
: the midi service that this input port is registered to

◆ receiveEvent()

void receiveEvent ( std::unique_ptr< MidiEvent event)

Called internally by the midi callback.

◆ start()

virtual bool start ( utility::ErrorState errorState)
overridevirtual

Starts the midi input port.

Parameters
errorStatecontains the error if the port could not be opened.
Returns
if the input port opened successfully.

Reimplemented from Device.

◆ stop()

virtual void stop ( )
overridevirtual

Stops the midi input port.

Reimplemented from Device.

Member Data Documentation

◆ mDebugOutput

bool mDebugOutput = false

Property: 'EnableDebugOutput' If true, incoming messages will be logged for debugging purposes.

◆ mPortNames

std::vector<std::string> mPortNames

Property: 'Ports' names of ports this object opens and listens to. When left empty all ports are opened.

The name of the ports that will be listened to for incoming messages. If left empty all available ports will be opened and listened to.