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

#include <midiport/midioutputport.h>

Public Member Functions

 MidiOutputPort ()=default
 
 MidiOutputPort (MidiService &service)
 
virtual ~MidiOutputPort () override
 
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

bool mAllowFailure = false
 Property: "AllowFailure" failure to find and open port is allowed on startup when set to true. More...
 
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)
 

Description

Opens a midi output port that midi messages can be sent to. Ports are identified by name and assigned a number when opened. Failure to find and open the midi port is allowed when 'AllowFailure' is set to true.

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

Constructor & Destructor Documentation

◆ MidiOutputPort() [1/2]

MidiOutputPort ( )
default

◆ MidiOutputPort() [2/2]

MidiOutputPort ( MidiService service)

◆ ~MidiOutputPort()

virtual ~MidiOutputPort ( )
overridevirtual

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

Opens 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

◆ mAllowFailure

bool mAllowFailure = false

Property: "AllowFailure" failure to find and open port is allowed on startup when set to true.

◆ mPortName

std::string mPortName = ""

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