ardour
Public Member Functions | Public Attributes | Private Attributes | List of all members
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::Signal0< void > ChannelMaskChanged
 
PBD::Signal0< void > ChannelModeChanged
 

Private Attributes

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

ARDOUR::MidiChannelFilter::MidiChannelFilter ( )

Definition at line 27 of file midi_channel_filter.cc.

Member Function Documentation

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

Filter bufs in-place.

Definition at line 32 of file midi_channel_filter.cc.

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.

Definition at line 72 of file midi_channel_filter.cc.

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

Definition at line 84 of file midi_channel_filter.h.

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

Definition at line 80 of file midi_channel_filter.h.

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.

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

Atomically set the channel mask for the current mode.

Returns
true iff configuration changed.

Definition at line 127 of file midi_channel_filter.cc.

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

Atomically set the channel mode and corresponding mask.

Returns
true iff configuration changed.

Definition at line 110 of file midi_channel_filter.cc.

Member Data Documentation

uint32_t ARDOUR::MidiChannelFilter::_mode_mask
private

16 bits mode, 16 bits mask

Definition at line 92 of file midi_channel_filter.h.

PBD::Signal0<void> ARDOUR::MidiChannelFilter::ChannelMaskChanged

Definition at line 88 of file midi_channel_filter.h.

PBD::Signal0<void> ARDOUR::MidiChannelFilter::ChannelModeChanged

Definition at line 89 of file midi_channel_filter.h.


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