Ardour  9.0-pre0-582-g084a23a80d
MIDI::Port Class Referenceabstract

#include <port.h>

Inheritance diagram for MIDI::Port:
[legend]

Classes

struct  Descriptor
 

Public Types

enum  Flags { IsInput = 0x1 , IsOutput = 0x2 }
 

Public Member Functions

 Port (std::string const &, Flags)
 
 Port (const XMLNode &)
 
virtual ~Port ()
 
virtual XMLNodeget_state () const
 
virtual void set_state (const XMLNode &)
 
virtual int write (const byte *msg, size_t msglen, timestamp_t timestamp)=0
 
virtual int read (byte *buf, size_t bufsize)=0
 
virtual void drain (int, int)
 
int midimsg (byte *msg, size_t len, timestamp_t timestamp)
 
virtual void parse (samplecnt_t timestamp)=0
 
bool clock (timestamp_t timestamp)
 
virtual int selectable () const =0
 
Channelchannel (channel_t chn)
 
Parserparser ()
 
const char * name () const
 
bool ok () const
 
virtual bool centrally_parsed () const
 
void set_centrally_parsed (bool yn)
 
bool receives_input () const
 
bool sends_output () const
 

Static Public Attributes

static std::string state_node_name
 

Protected Member Functions

void init (std::string const &, Flags)
 

Protected Attributes

bool _ok
 
std::string _tagname
 
Channel_channel [16]
 
Parser_parser
 
Flags _flags
 
bool _centrally_parsed
 

Detailed Description

Definition at line 45 of file midi++2/midi++/port.h.

Member Enumeration Documentation

◆ Flags

Enumerator
IsInput 
IsOutput 

Definition at line 47 of file midi++2/midi++/port.h.

Constructor & Destructor Documentation

◆ Port() [1/2]

MIDI::Port::Port ( std::string const &  ,
Flags   
)

◆ Port() [2/2]

MIDI::Port::Port ( const XMLNode )

◆ ~Port()

virtual MIDI::Port::~Port ( )
virtual

Member Function Documentation

◆ centrally_parsed()

virtual bool MIDI::Port::centrally_parsed ( ) const
virtual

◆ channel()

Channel* MIDI::Port::channel ( channel_t  chn)
inline

Definition at line 101 of file midi++2/midi++/port.h.

◆ clock()

bool MIDI::Port::clock ( timestamp_t  timestamp)

◆ drain()

virtual void MIDI::Port::drain ( int  ,
int   
)
inlinevirtual

block until the output FIFO used by non-process threads is empty, checking every check_interval_usecs usecs for current status. Not to be called by a thread that executes any part of a JACK process callback (will simply return immediately in that situation).

Reimplemented in ARDOUR::AsyncMIDIPort.

Definition at line 80 of file midi++2/midi++/port.h.

◆ get_state()

virtual XMLNode& MIDI::Port::get_state ( ) const
virtual

Reimplemented in MIDI::IPMIDIPort.

◆ init()

void MIDI::Port::init ( std::string const &  ,
Flags   
)
protected

◆ midimsg()

int MIDI::Port::midimsg ( byte msg,
size_t  len,
timestamp_t  timestamp 
)
inline

Write a message to port.

Returns
true on success. FIXME: describe semantics here

Definition at line 86 of file midi++2/midi++/port.h.

◆ name()

const char* MIDI::Port::name ( ) const
inline

Definition at line 109 of file midi++2/midi++/port.h.

◆ ok()

bool MIDI::Port::ok ( void  ) const
inline

Definition at line 110 of file midi++2/midi++/port.h.

◆ parse()

virtual void MIDI::Port::parse ( samplecnt_t  timestamp)
pure virtual

◆ parser()

Parser* MIDI::Port::parser ( )
inline

Definition at line 105 of file midi++2/midi++/port.h.

◆ read()

virtual int MIDI::Port::read ( byte buf,
size_t  bufsize 
)
pure virtual

Read raw bytes from a port.

Parameters
bufmemory to store read data in
bufsizesize of buf
Returns
number of bytes successfully read, negative if error

Implemented in ARDOUR::AsyncMIDIPort, and MIDI::IPMIDIPort.

◆ receives_input()

bool MIDI::Port::receives_input ( ) const
inline

Definition at line 115 of file midi++2/midi++/port.h.

◆ selectable()

virtual int MIDI::Port::selectable ( ) const
pure virtual

Get the file descriptor for port.

Returns
File descriptor, or -1 if not selectable.

Implemented in MIDI::IPMIDIPort, and ARDOUR::AsyncMIDIPort.

◆ sends_output()

bool MIDI::Port::sends_output ( ) const
inline

Definition at line 119 of file midi++2/midi++/port.h.

◆ set_centrally_parsed()

void MIDI::Port::set_centrally_parsed ( bool  yn)
inline

Definition at line 113 of file midi++2/midi++/port.h.

◆ set_state()

virtual void MIDI::Port::set_state ( const XMLNode )
virtual

Reimplemented in MIDI::IPMIDIPort.

◆ write()

virtual int MIDI::Port::write ( const byte msg,
size_t  msglen,
timestamp_t  timestamp 
)
pure virtual

Write a message to port.

Parameters
msgRaw MIDI message to send
msglenSize of msg
timestampTime stamp in samples of this message (relative to cycle start)
Returns
number of bytes successfully written

Implemented in ARDOUR::AsyncMIDIPort, and MIDI::IPMIDIPort.

Member Data Documentation

◆ _centrally_parsed

bool MIDI::Port::_centrally_parsed
protected

Definition at line 139 of file midi++2/midi++/port.h.

◆ _channel

Channel* MIDI::Port::_channel[16]
protected

Definition at line 136 of file midi++2/midi++/port.h.

◆ _flags

Flags MIDI::Port::_flags
protected

Definition at line 138 of file midi++2/midi++/port.h.

◆ _ok

bool MIDI::Port::_ok
protected

Definition at line 134 of file midi++2/midi++/port.h.

◆ _parser

Parser* MIDI::Port::_parser
protected

Definition at line 137 of file midi++2/midi++/port.h.

◆ _tagname

std::string MIDI::Port::_tagname
protected

Definition at line 135 of file midi++2/midi++/port.h.

◆ state_node_name

std::string MIDI::Port::state_node_name
static

Definition at line 131 of file midi++2/midi++/port.h.


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