Ardour  9.0-pre0-386-g96ef4d20f2
MIDI::IPMIDIPort Class Reference

#include <ipmidi_port.h>

Inheritance diagram for MIDI::IPMIDIPort:
[legend]

Public Member Functions

 IPMIDIPort (int base_port=lowest_ipmidi_port_default, const std::string &ifname=std::string())
 
 IPMIDIPort (const XMLNode &)
 
 ~IPMIDIPort ()
 
XMLNodeget_state () const
 
void set_state (const XMLNode &)
 
int write (const byte *msg, size_t msglen, timestamp_t timestamp)
 
int read (byte *buf, size_t bufsize)
 
void parse (samplecnt_t timestamp)
 
int selectable () const
 
- Public Member Functions inherited from MIDI::Port
 Port (std::string const &, Flags)
 
 Port (const XMLNode &)
 
virtual ~Port ()
 
virtual void drain (int, int)
 
int midimsg (byte *msg, size_t len, timestamp_t timestamp)
 
bool clock (timestamp_t timestamp)
 
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 const int lowest_ipmidi_port_default = 21928
 
- Static Public Attributes inherited from MIDI::Port
static std::string state_node_name
 

Private Member Functions

bool open_sockets (int base_port, const std::string &ifname)
 
void close_sockets ()
 
void init (std::string const &, Flags)
 

Private Attributes

int sockin
 
int sockout
 
struct sockaddr_in addrout
 
Glib::Threads::Mutex write_lock
 

Additional Inherited Members

- Public Types inherited from MIDI::Port
enum  Flags { IsInput = 0x1 , IsOutput = 0x2 }
 
- Protected Member Functions inherited from MIDI::Port
void init (std::string const &, Flags)
 
- Protected Attributes inherited from MIDI::Port
bool _ok
 
std::string _tagname
 
Channel_channel [16]
 
Parser_parser
 
Flags _flags
 
bool _centrally_parsed
 

Detailed Description

Definition at line 59 of file ipmidi_port.h.

Constructor & Destructor Documentation

◆ IPMIDIPort() [1/2]

MIDI::IPMIDIPort::IPMIDIPort ( int  base_port = lowest_ipmidi_port_default,
const std::string &  ifname = std::string() 
)

◆ IPMIDIPort() [2/2]

MIDI::IPMIDIPort::IPMIDIPort ( const XMLNode )

◆ ~IPMIDIPort()

MIDI::IPMIDIPort::~IPMIDIPort ( )

Member Function Documentation

◆ close_sockets()

void MIDI::IPMIDIPort::close_sockets ( )
private

◆ get_state()

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

Reimplemented from MIDI::Port.

◆ init()

void MIDI::IPMIDIPort::init ( std::string const &  ,
Flags   
)
private

◆ open_sockets()

bool MIDI::IPMIDIPort::open_sockets ( int  base_port,
const std::string &  ifname 
)
private

◆ parse()

void MIDI::IPMIDIPort::parse ( samplecnt_t  timestamp)
virtual

Implements MIDI::Port.

◆ read()

int MIDI::IPMIDIPort::read ( byte buf,
size_t  bufsize 
)
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

Implements MIDI::Port.

◆ selectable()

int MIDI::IPMIDIPort::selectable ( ) const
virtual

Get the file descriptor for port.

Returns
File descriptor, or -1 if not selectable.

Implements MIDI::Port.

◆ set_state()

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

Reimplemented from MIDI::Port.

◆ write()

int MIDI::IPMIDIPort::write ( const byte msg,
size_t  msglen,
timestamp_t  timestamp 
)
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

Implements MIDI::Port.

Member Data Documentation

◆ addrout

struct sockaddr_in MIDI::IPMIDIPort::addrout
private

Definition at line 77 of file ipmidi_port.h.

◆ lowest_ipmidi_port_default

const int MIDI::IPMIDIPort::lowest_ipmidi_port_default = 21928
static

Definition at line 73 of file ipmidi_port.h.

◆ sockin

int MIDI::IPMIDIPort::sockin
private

Definition at line 76 of file ipmidi_port.h.

◆ sockout

int MIDI::IPMIDIPort::sockout
private

Definition at line 77 of file ipmidi_port.h.

◆ write_lock

Glib::Threads::Mutex MIDI::IPMIDIPort::write_lock
private

Definition at line 79 of file ipmidi_port.h.


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