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

#include <midi_channel_filter.h>

Public Member Functions

 MidiChannelFilter ()
 
void filter (BufferSet &bufs)
 
bool filter (uint8_t *buf, uint32_t len)
 
bool set_channel_mode (ChannelMode mode, uint16_t mask)
 
bool set_channel_mask (uint16_t mask)
 
void get_mode_and_mask (ChannelMode *mode, uint16_t *mask) const
 
ChannelMode get_channel_mode () const
 
uint16_t get_channel_mask () const
 

Public Attributes

PBD::Signal< void()> ChannelMaskChanged
 
PBD::Signal< void()> ChannelModeChanged
 

Private Attributes

std::atomic< uint32_t > _mode_mask
 16 bits mode, 16 bits mask More...
 

Detailed Description

Filter/mapper for MIDI channels.

Channel mapping is configured by setting a mode and "mask", where the meaning of the mask depends on the mode.

If mode is FilterChannels, each mask bit represents a midi channel (bit 0 = channel 0, bit 1 = channel 1, ...). Only events whose channel corresponds to a 1 bit will be passed.

If mode is ForceChannel, mask is simply a channel number which all events will be forced to.

Definition at line 47 of file midi_channel_filter.h.

Constructor & Destructor Documentation

◆ MidiChannelFilter()

ARDOUR::MidiChannelFilter::MidiChannelFilter ( )

Member Function Documentation

◆ filter() [1/2]

void ARDOUR::MidiChannelFilter::filter ( BufferSet bufs)

Filter bufs in-place.

◆ filter() [2/2]

bool ARDOUR::MidiChannelFilter::filter ( uint8_t *  buf,
uint32_t  len 
)

Filter/map a MIDI message by channel.

May modify the channel in buf if necessary.

Returns
true if this event should be filtered out.

◆ get_channel_mask()

uint16_t ARDOUR::MidiChannelFilter::get_channel_mask ( ) const
inline

Definition at line 84 of file midi_channel_filter.h.

◆ get_channel_mode()

ChannelMode ARDOUR::MidiChannelFilter::get_channel_mode ( ) const
inline

Definition at line 80 of file midi_channel_filter.h.

◆ get_mode_and_mask()

void ARDOUR::MidiChannelFilter::get_mode_and_mask ( ChannelMode mode,
uint16_t *  mask 
) const
inline

Atomically get both the channel mode and mask.

Definition at line 74 of file midi_channel_filter.h.

◆ set_channel_mask()

bool ARDOUR::MidiChannelFilter::set_channel_mask ( uint16_t  mask)

Atomically set the channel mask for the current mode.

Returns
true iff configuration changed.

◆ set_channel_mode()

bool ARDOUR::MidiChannelFilter::set_channel_mode ( ChannelMode  mode,
uint16_t  mask 
)

Atomically set the channel mode and corresponding mask.

Returns
true iff configuration changed.

Member Data Documentation

◆ _mode_mask

std::atomic<uint32_t> ARDOUR::MidiChannelFilter::_mode_mask
private

16 bits mode, 16 bits mask

Definition at line 92 of file midi_channel_filter.h.

◆ ChannelMaskChanged

PBD::Signal<void()> ARDOUR::MidiChannelFilter::ChannelMaskChanged

Definition at line 88 of file midi_channel_filter.h.

◆ ChannelModeChanged

PBD::Signal<void()> ARDOUR::MidiChannelFilter::ChannelModeChanged

Definition at line 89 of file midi_channel_filter.h.


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