NAP
MidiOutputPort Class Reference

#include <midioutputport.h>

Public Member Functions

 MidiOutputPort ()=default
 
 MidiOutputPort (MidiService &service)
 
virtual bool start (utility::ErrorState &errorState) override
 
virtual void stop () override
 
MidiServicegetService ()
 
void sendEvent (const MidiEvent &event)
 
int getPortNumber () 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::string mPortName = ""
 Property: 'Port' The name of the port that midi messages will be sent through. 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)
 

Detailed Description

Opens and manages a midi output port that midi messages can be sent to.

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

Constructor & Destructor Documentation

◆ MidiOutputPort() [1/2]

MidiOutputPort ( )
default

◆ MidiOutputPort() [2/2]

MidiOutputPort ( MidiService service)

Member Function Documentation

◆ getPortNumber()

int getPortNumber ( ) const
Returns
: the number of the midi port that messages will be sent through by this object

◆ getService()

MidiService& getService ( )
Returns
the midi device service.

◆ sendEvent()

void sendEvent ( const MidiEvent event)

Sends a midi event through this output port.

Parameters
eventthe event to send.

◆ start()

virtual bool start ( utility::ErrorState errorState)
overridevirtual

Starts the midi output port.

Parameters
errorStatecontains the reason why the port could not be opened.
Returns
if the midi output port opened successfully.

Reimplemented from Device.

◆ stop()

virtual void stop ( )
overridevirtual

Stops the midi output port.

Reimplemented from Device.

Member Data Documentation

◆ mPortName

std::string mPortName = ""

Property: 'Port' The name of the port that midi messages will be sent through.