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

#include <winmmemidi_output_device.h>

Public Member Functions

 WinMMEMidiOutputDevice (int index)
 
 ~WinMMEMidiOutputDevice ()
 
bool enqueue_midi_event (uint64_t rel_event_time_us, const uint8_t *data, const 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 set_device_name (UINT index)
 
std::string get_error_string (MMRESULT error_code)
 
bool start_midi_output_thread ()
 
bool stop_midi_output_thread ()
 
bool signal (HANDLE semaphore)
 
bool wait (HANDLE semaphore)
 
void midi_output_thread ()
 
bool wait_for_microseconds (int64_t us)
 
void midi_output_callback (UINT msg, DWORD_PTR data, DWORD_PTR timestamp)
 

Static Private Member Functions

static void * midi_output_thread (void *)
 
static void CALLBACK winmm_output_callback (HMIDIOUT handle, UINT msg, DWORD_PTR instance, DWORD_PTR midi_data, DWORD_PTR timestamp)
 

Private Attributes

HMIDIOUT m_handle
 
HANDLE m_queue_semaphore
 
HANDLE m_sysex_semaphore
 
HANDLE m_timer
 
bool m_started
 
bool m_enabled
 
std::string m_name
 
pthread_t m_output_thread_handle
 
bool m_thread_running
 
bool m_thread_quit
 
const std::unique_ptr< PBD::RingBuffer< uint8_t > > m_midi_buffer
 

Detailed Description

Definition at line 37 of file winmmemidi_output_device.h.

Constructor & Destructor Documentation

◆ WinMMEMidiOutputDevice()

ARDOUR::WinMMEMidiOutputDevice::WinMMEMidiOutputDevice ( int  index)

◆ ~WinMMEMidiOutputDevice()

ARDOUR::WinMMEMidiOutputDevice::~WinMMEMidiOutputDevice ( )

Member Function Documentation

◆ close()

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

◆ enqueue_midi_event()

bool ARDOUR::WinMMEMidiOutputDevice::enqueue_midi_event ( uint64_t  rel_event_time_us,
const uint8_t *  data,
const size_t  size 
)

◆ get_enabled()

bool ARDOUR::WinMMEMidiOutputDevice::get_enabled ( )

◆ get_error_string()

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

◆ midi_output_callback()

void ARDOUR::WinMMEMidiOutputDevice::midi_output_callback ( UINT  msg,
DWORD_PTR  data,
DWORD_PTR  timestamp 
)
private

◆ midi_output_thread() [1/2]

void ARDOUR::WinMMEMidiOutputDevice::midi_output_thread ( )
private

◆ midi_output_thread() [2/2]

static void* ARDOUR::WinMMEMidiOutputDevice::midi_output_thread ( void *  )
staticprivate

◆ name()

std::string ARDOUR::WinMMEMidiOutputDevice::name ( ) const
inline

Definition at line 53 of file winmmemidi_output_device.h.

◆ open()

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

◆ set_device_name()

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

◆ set_enabled()

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

◆ signal()

bool ARDOUR::WinMMEMidiOutputDevice::signal ( HANDLE  semaphore)
private

◆ start()

bool ARDOUR::WinMMEMidiOutputDevice::start ( )

◆ start_midi_output_thread()

bool ARDOUR::WinMMEMidiOutputDevice::start_midi_output_thread ( )
private

◆ stop()

bool ARDOUR::WinMMEMidiOutputDevice::stop ( )

◆ stop_midi_output_thread()

bool ARDOUR::WinMMEMidiOutputDevice::stop_midi_output_thread ( )
private

◆ wait()

bool ARDOUR::WinMMEMidiOutputDevice::wait ( HANDLE  semaphore)
private

◆ wait_for_microseconds()

bool ARDOUR::WinMMEMidiOutputDevice::wait_for_microseconds ( int64_t  us)
private

◆ winmm_output_callback()

static void CALLBACK ARDOUR::WinMMEMidiOutputDevice::winmm_output_callback ( HMIDIOUT  handle,
UINT  msg,
DWORD_PTR  instance,
DWORD_PTR  midi_data,
DWORD_PTR  timestamp 
)
staticprivate

Member Data Documentation

◆ m_enabled

bool ARDOUR::WinMMEMidiOutputDevice::m_enabled
private

Definition at line 91 of file winmmemidi_output_device.h.

◆ m_handle

HMIDIOUT ARDOUR::WinMMEMidiOutputDevice::m_handle
private

Definition at line 83 of file winmmemidi_output_device.h.

◆ m_midi_buffer

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

Definition at line 100 of file winmmemidi_output_device.h.

◆ m_name

std::string ARDOUR::WinMMEMidiOutputDevice::m_name
private

Definition at line 93 of file winmmemidi_output_device.h.

◆ m_output_thread_handle

pthread_t ARDOUR::WinMMEMidiOutputDevice::m_output_thread_handle
private

Definition at line 95 of file winmmemidi_output_device.h.

◆ m_queue_semaphore

HANDLE ARDOUR::WinMMEMidiOutputDevice::m_queue_semaphore
private

Definition at line 85 of file winmmemidi_output_device.h.

◆ m_started

bool ARDOUR::WinMMEMidiOutputDevice::m_started
private

Definition at line 90 of file winmmemidi_output_device.h.

◆ m_sysex_semaphore

HANDLE ARDOUR::WinMMEMidiOutputDevice::m_sysex_semaphore
private

Definition at line 86 of file winmmemidi_output_device.h.

◆ m_thread_quit

bool ARDOUR::WinMMEMidiOutputDevice::m_thread_quit
private

Definition at line 98 of file winmmemidi_output_device.h.

◆ m_thread_running

bool ARDOUR::WinMMEMidiOutputDevice::m_thread_running
private

Definition at line 97 of file winmmemidi_output_device.h.

◆ m_timer

HANDLE ARDOUR::WinMMEMidiOutputDevice::m_timer
private

Definition at line 88 of file winmmemidi_output_device.h.


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