ardour
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
ARDOUR::AsyncMIDIPort Class Reference

#include <async_midi_port.h>

Inheritance diagram for ARDOUR::AsyncMIDIPort:
ARDOUR::MidiPort ARDOUR::Port

Public Member Functions

 AsyncMIDIPort (std::string const &, PortFlags)
 
 ~AsyncMIDIPort ()
 
void cycle_start (pframes_t nframes)
 
void cycle_end (pframes_t nframes)
 
void parse (framecnt_t timestamp)
 
int write (const MIDI::byte *msg, size_t msglen, MIDI::timestamp_t timestamp)
 
int read (MIDI::byte *buf, size_t bufsize)
 
void drain (int check_interval_usecs)
 
void clear ()
 
CrossThreadChannelxthread ()
 
int selectable () const
 
void set_timer (boost::function< framecnt_t(void)> &)
 
- Public Member Functions inherited from ARDOUR::MidiPort
 ~MidiPort ()
 
DataType type () const
 
void cycle_start (pframes_t nframes)
 
void cycle_end (pframes_t nframes)
 
void cycle_split ()
 
void flush_buffers (pframes_t nframes)
 
void transport_stopped ()
 
void realtime_locate ()
 
void reset ()
 
void require_resolve ()
 
bool input_active () const
 
void set_input_active (bool yn)
 
Bufferget_buffer (pframes_t nframes)
 
MidiBufferget_midi_buffer (pframes_t nframes)
 
void set_always_parse (bool yn)
 
void set_trace_on (bool yn)
 
MIDI::Parser & self_parser ()
 
- Public Member Functions inherited from ARDOUR::Port
virtual ~Port ()
 
std::string name () const
 
std::string pretty_name (bool fallback_to_name=false) const
 
int set_name (std::string const &)
 
PortFlags flags () const
 
bool receives_input () const
 
bool sends_output () const
 
bool connected () const
 
int disconnect_all ()
 
int get_connections (std::vector< std::string > &) const
 
bool connected_to (std::string const &) const
 
int connect (std::string const &)
 
int disconnect (std::string const &)
 
bool connected_to (Port *) const
 
virtual int connect (Port *)
 
int disconnect (Port *)
 
void request_input_monitoring (bool)
 
void ensure_input_monitoring (bool)
 
bool monitoring_input () const
 
int reestablish ()
 
int reconnect ()
 
bool last_monitor () const
 
void set_last_monitor (bool yn)
 
PortEngine::PortHandle port_handle ()
 
void get_connected_latency_range (LatencyRange &range, bool playback) const
 
void set_private_latency_range (LatencyRange &range, bool playback)
 
const LatencyRangeprivate_latency_range (bool playback) const
 
void set_public_latency_range (LatencyRange &range, bool playback) const
 
LatencyRange public_latency_range (bool playback) const
 
bool physically_connected () const
 
virtual void increment_port_buffer_offset (pframes_t n)
 
virtual XMLNodeget_state (void) const
 
virtual int set_state (const XMLNode &, int version)
 

Static Public Member Functions

static void set_process_thread (pthread_t)
 
static pthread_t get_process_thread ()
 
static bool is_process_thread ()
 
- Static Public Member Functions inherited from ARDOUR::Port
static void set_connecting_blocked (bool yn)
 
static bool connecting_blocked ()
 
static void set_cycle_framecnt (pframes_t n)
 
static framecnt_t port_offset ()
 
static void set_global_port_buffer_offset (pframes_t off)
 
static void increment_global_port_buffer_offset (pframes_t n)
 

Private Member Functions

int create_port ()
 
void flush (void *jack_port_buffer)
 
void jack_halted ()
 
void make_connections ()
 
void init (std::string const &, Flags)
 
void flush_output_fifo (pframes_t)
 

Private Attributes

bool _currently_in_cycle
 
MIDI::timestamp_t _last_write_timestamp
 
bool have_timer
 
boost::function< framecnt_t(void)> timer
 
RingBuffer< Evoral::Event
< double > > 
output_fifo
 
EventRingBuffer
< MIDI::timestamp_t > 
input_fifo
 
Glib::Threads::Mutex output_fifo_lock
 
CrossThreadChannel _xthread
 
std::string _connections
 
PBD::ScopedConnection connect_connection
 
PBD::ScopedConnection halt_connection
 

Static Private Attributes

static pthread_t _process_thread
 

Additional Inherited Members

- Public Attributes inherited from ARDOUR::Port
PBD::Signal1< void, bool > MonitorInputChanged
 
- Static Public Attributes inherited from ARDOUR::Port
static PBD::Signal2< void,
boost::shared_ptr< Port >
, boost::shared_ptr< Port > > 
PostDisconnect
 
static PBD::Signal0< void > PortDrop
 
static std::string state_node_name = X_("Port")
 
- Protected Member Functions inherited from ARDOUR::MidiPort
 MidiPort (const std::string &name, PortFlags)
 
- Protected Member Functions inherited from ARDOUR::Port
 Port (std::string const &, DataType, PortFlags)
 
- Protected Attributes inherited from ARDOUR::Port
PortEngine::PortHandle _port_handle
 
framecnt_t _port_buffer_offset
 
LatencyRange _private_playback_latency
 
LatencyRange _private_capture_latency
 
- Static Protected Attributes inherited from ARDOUR::Port
static bool _connecting_blocked = false
 
static pframes_t _global_port_buffer_offset = 0
 
static pframes_t _cycle_nframes = 0
 

Detailed Description

Definition at line 44 of file async_midi_port.h.

Constructor & Destructor Documentation

AsyncMIDIPort::AsyncMIDIPort ( std::string const &  ,
PortFlags   
)

Definition at line 44 of file async_midi_port.cc.

AsyncMIDIPort::~AsyncMIDIPort ( )

Definition at line 56 of file async_midi_port.cc.

Member Function Documentation

void ARDOUR::AsyncMIDIPort::clear ( )
inline

Definition at line 64 of file async_midi_port.h.

int ARDOUR::AsyncMIDIPort::create_port ( )
private
void AsyncMIDIPort::cycle_end ( pframes_t  nframes)
virtual

Implements ARDOUR::Port.

Definition at line 140 of file async_midi_port.cc.

void AsyncMIDIPort::cycle_start ( pframes_t  nframes)
virtual

Reimplemented from ARDOUR::Port.

Definition at line 99 of file async_midi_port.cc.

void AsyncMIDIPort::drain ( int  check_interval_usecs)

wait for the output FIFO to be emptied by successive process() callbacks.

Cannot be called from a processing thread.

Definition at line 159 of file async_midi_port.cc.

void ARDOUR::AsyncMIDIPort::flush ( void *  jack_port_buffer)
private
void AsyncMIDIPort::flush_output_fifo ( pframes_t  )
private

Definition at line 68 of file async_midi_port.cc.

static pthread_t ARDOUR::AsyncMIDIPort::get_process_thread ( )
inlinestatic

Definition at line 77 of file async_midi_port.h.

void ARDOUR::AsyncMIDIPort::init ( std::string const &  ,
Flags   
)
private
bool AsyncMIDIPort::is_process_thread ( )
static

Definition at line 314 of file async_midi_port.cc.

void ARDOUR::AsyncMIDIPort::jack_halted ( )
private
void ARDOUR::AsyncMIDIPort::make_connections ( )
private
void AsyncMIDIPort::parse ( framecnt_t  timestamp)

Definition at line 299 of file async_midi_port.cc.

int AsyncMIDIPort::read ( MIDI::byte *  buf,
size_t  bufsize 
)

Definition at line 277 of file async_midi_port.cc.

int ARDOUR::AsyncMIDIPort::selectable ( ) const
inline

Definition at line 73 of file async_midi_port.h.

void AsyncMIDIPort::set_process_thread ( pthread_t  thr)
static

Definition at line 308 of file async_midi_port.cc.

void AsyncMIDIPort::set_timer ( boost::function< framecnt_t(void)> &  )

Definition at line 61 of file async_midi_port.cc.

int AsyncMIDIPort::write ( const MIDI::byte *  msg,
size_t  msglen,
MIDI::timestamp_t  timestamp 
)

Definition at line 184 of file async_midi_port.cc.

CrossThreadChannel& ARDOUR::AsyncMIDIPort::xthread ( )
inline

Definition at line 68 of file async_midi_port.h.

Member Data Documentation

std::string ARDOUR::AsyncMIDIPort::_connections
private

Channel used to signal to the MidiControlUI that input has arrived

Definition at line 94 of file async_midi_port.h.

bool ARDOUR::AsyncMIDIPort::_currently_in_cycle
private

Definition at line 81 of file async_midi_port.h.

MIDI::timestamp_t ARDOUR::AsyncMIDIPort::_last_write_timestamp
private

Definition at line 82 of file async_midi_port.h.

pthread_t AsyncMIDIPort::_process_thread
staticprivate

Definition at line 104 of file async_midi_port.h.

CrossThreadChannel ARDOUR::AsyncMIDIPort::_xthread
private

Definition at line 88 of file async_midi_port.h.

PBD::ScopedConnection ARDOUR::AsyncMIDIPort::connect_connection
private

Definition at line 95 of file async_midi_port.h.

PBD::ScopedConnection ARDOUR::AsyncMIDIPort::halt_connection
private

Definition at line 96 of file async_midi_port.h.

bool ARDOUR::AsyncMIDIPort::have_timer
private

Definition at line 83 of file async_midi_port.h.

EventRingBuffer<MIDI::timestamp_t> ARDOUR::AsyncMIDIPort::input_fifo
private

Definition at line 86 of file async_midi_port.h.

RingBuffer< Evoral::Event<double> > ARDOUR::AsyncMIDIPort::output_fifo
private

Definition at line 85 of file async_midi_port.h.

Glib::Threads::Mutex ARDOUR::AsyncMIDIPort::output_fifo_lock
private

Definition at line 87 of file async_midi_port.h.

boost::function<framecnt_t (void)> ARDOUR::AsyncMIDIPort::timer
private

Definition at line 84 of file async_midi_port.h.


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