Ardour  9.0-pre0-582-g084a23a80d
ARDOUR::WinMMEMidiInputDevice Class Reference

#include <winmmemidi_input_device.h>

Public Member Functions

 WinMMEMidiInputDevice (int index)
 
 ~WinMMEMidiInputDevice ()
 
bool dequeue_midi_event (uint64_t timestamp_start, uint64_t timestamp_end, uint64_t &timestamp, uint8_t *data, size_t &size)
 
bool start ()
 
bool stop ()
 
void set_enabled (bool enable)
 
bool get_enabled ()
 
std::string name () const
 

Private Member Functions

bool open (UINT index, std::string &error_msg)
 
bool close (std::string &error_msg)
 
bool add_sysex_buffer (std::string &error_msg)
 
bool set_device_name (UINT index)
 
std::string get_error_string (MMRESULT error_code)
 
void handle_short_msg (const uint8_t *midi_data, uint32_t timestamp)
 
void handle_sysex_msg (MIDIHDR *const midi_header, uint32_t timestamp)
 
bool enqueue_midi_msg (const uint8_t *midi_data, size_t size, uint32_t timestamp)
 

Static Private Member Functions

static void CALLBACK winmm_input_callback (HMIDIIN handle, UINT msg, DWORD_PTR instance, DWORD_PTR midi_msg, DWORD timestamp)
 

Private Attributes

HMIDIIN m_handle
 
MIDIHDR m_sysex_header
 
bool m_started
 
std::string m_name
 
const std::unique_ptr< PBD::RingBuffer< uint8_t > > m_midi_buffer
 
std::unique_ptr< uint8_t[]> m_sysex_buffer
 

Detailed Description

Definition at line 35 of file winmmemidi_input_device.h.

Constructor & Destructor Documentation

◆ WinMMEMidiInputDevice()

ARDOUR::WinMMEMidiInputDevice::WinMMEMidiInputDevice ( int  index)

◆ ~WinMMEMidiInputDevice()

ARDOUR::WinMMEMidiInputDevice::~WinMMEMidiInputDevice ( )

Member Function Documentation

◆ add_sysex_buffer()

bool ARDOUR::WinMMEMidiInputDevice::add_sysex_buffer ( std::string &  error_msg)
private

◆ close()

bool ARDOUR::WinMMEMidiInputDevice::close ( std::string &  error_msg)
private

◆ dequeue_midi_event()

bool ARDOUR::WinMMEMidiInputDevice::dequeue_midi_event ( uint64_t  timestamp_start,
uint64_t  timestamp_end,
uint64_t &  timestamp,
uint8_t *  data,
size_t &  size 
)

Dequeue events that have accumulated in winmm_input_callback.

This is called by the audio processing thread/callback to transfer events into midi ports before processing.

◆ enqueue_midi_msg()

bool ARDOUR::WinMMEMidiInputDevice::enqueue_midi_msg ( const uint8_t *  midi_data,
size_t  size,
uint32_t  timestamp 
)
private

◆ get_enabled()

bool ARDOUR::WinMMEMidiInputDevice::get_enabled ( )

◆ get_error_string()

std::string ARDOUR::WinMMEMidiInputDevice::get_error_string ( MMRESULT  error_code)
private

◆ handle_short_msg()

void ARDOUR::WinMMEMidiInputDevice::handle_short_msg ( const uint8_t *  midi_data,
uint32_t  timestamp 
)
private

◆ handle_sysex_msg()

void ARDOUR::WinMMEMidiInputDevice::handle_sysex_msg ( MIDIHDR *const  midi_header,
uint32_t  timestamp 
)
private

◆ name()

std::string ARDOUR::WinMMEMidiInputDevice::name ( ) const
inline
Returns
Name of midi device

Definition at line 65 of file winmmemidi_input_device.h.

◆ open()

bool ARDOUR::WinMMEMidiInputDevice::open ( UINT  index,
std::string &  error_msg 
)
private

◆ set_device_name()

bool ARDOUR::WinMMEMidiInputDevice::set_device_name ( UINT  index)
private

◆ set_enabled()

void ARDOUR::WinMMEMidiInputDevice::set_enabled ( bool  enable)

◆ start()

bool ARDOUR::WinMMEMidiInputDevice::start ( )

◆ stop()

bool ARDOUR::WinMMEMidiInputDevice::stop ( )

◆ winmm_input_callback()

static void CALLBACK ARDOUR::WinMMEMidiInputDevice::winmm_input_callback ( HMIDIIN  handle,
UINT  msg,
DWORD_PTR  instance,
DWORD_PTR  midi_msg,
DWORD  timestamp 
)
staticprivate

Member Data Documentation

◆ m_handle

HMIDIIN ARDOUR::WinMMEMidiInputDevice::m_handle
private

Definition at line 89 of file winmmemidi_input_device.h.

◆ m_midi_buffer

const std::unique_ptr<PBD::RingBuffer<uint8_t> > ARDOUR::WinMMEMidiInputDevice::m_midi_buffer
private

Definition at line 97 of file winmmemidi_input_device.h.

◆ m_name

std::string ARDOUR::WinMMEMidiInputDevice::m_name
private

Definition at line 94 of file winmmemidi_input_device.h.

◆ m_started

bool ARDOUR::WinMMEMidiInputDevice::m_started
private

Definition at line 92 of file winmmemidi_input_device.h.

◆ m_sysex_buffer

std::unique_ptr<uint8_t[]> ARDOUR::WinMMEMidiInputDevice::m_sysex_buffer
private

Definition at line 98 of file winmmemidi_input_device.h.

◆ m_sysex_header

MIDIHDR ARDOUR::WinMMEMidiInputDevice::m_sysex_header
private

Definition at line 90 of file winmmemidi_input_device.h.


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