Ardour  9.0-pre0-582-g084a23a80d
MIDIControllable Class Reference

#include <midicontrollable.h>

Inheritance diagram for MIDIControllable:
[legend]

Public Types

enum  CtlType { Ctl_Momentary , Ctl_Toggle , Ctl_Dial }
 
enum  Encoder {
  No_enc , Enc_R , Enc_L , Enc_2 ,
  Enc_B
}
 

Public Member Functions

 MIDIControllable (GenericMidiControlProtocol *, MIDI::Parser &, std::shared_ptr< PBD::Controllable >, bool momentary)
 
 MIDIControllable (GenericMidiControlProtocol *, MIDI::Parser &, bool momentary=false)
 
virtual ~MIDIControllable ()
 
int init (const std::string &)
 
void rediscover_controllable ()
 
bool bank_relative () const
 
uint32_t rid () const
 
std::string what () const
 
MIDI::bytewrite_feedback (MIDI::byte *buf, int32_t &bufsize, bool force=false)
 
void midi_rebind (MIDI::channel_t channel=-1)
 
void midi_forget ()
 
void learn_about_external_control ()
 
void stop_learning ()
 
void drop_external_control ()
 
int control_to_midi (float val)
 
float midi_to_control (int val)
 
bool learned () const
 
CtlType get_ctltype () const
 
void set_ctltype (CtlType val)
 
Encoder get_encoder () const
 
void set_encoder (Encoder val)
 
MIDI::Parserget_parser ()
 
void set_controllable (std::shared_ptr< PBD::Controllable >)
 
std::shared_ptr< PBD::Controllableget_controllable () const
 
const std::string & current_uri () const
 
std::string control_description () const
 
XMLNodeget_state () const
 
int set_state (const XMLNode &, int version)
 
void bind_midi (MIDI::channel_t, MIDI::eventType, MIDI::byte)
 
void bind_rpn_value (MIDI::channel_t, uint16_t rpn)
 
void bind_nrpn_value (MIDI::channel_t, uint16_t rpn)
 
void bind_rpn_change (MIDI::channel_t, uint16_t rpn)
 
void bind_nrpn_change (MIDI::channel_t, uint16_t rpn)
 
MIDI::channel_t get_control_channel ()
 
MIDI::eventType get_control_type ()
 
MIDI::byte get_control_additional ()
 
int lookup_controllable ()
 
void bind_remap (std::shared_ptr< ARDOUR::Stripable >)
 
- Public Member Functions inherited from PBD::Stateful
 Stateful ()
 
virtual ~Stateful ()
 
virtual bool apply_change (PropertyBase const &)
 
PropertyChange apply_changes (PropertyList const &)
 
const OwnedPropertyListproperties () const
 
void add_property (PropertyBase &s)
 
void add_extra_xml (XMLNode &)
 
XMLNodeextra_xml (const std::string &str, bool add_if_missing=false)
 
void save_extra_xml (const XMLNode &)
 
const PBD::IDid () const
 
bool set_id (const XMLNode &)
 
void set_id (const std::string &)
 
void reset_id ()
 
void clear_changes ()
 
virtual void clear_owned_changes ()
 
PropertyListget_changes_as_properties (PBD::Command *) const
 
virtual void rdiff (std::vector< PBD::Command * > &) const
 
bool changed () const
 
virtual PropertyListproperty_factory (const XMLNode &) const
 
virtual void suspend_property_changes ()
 
virtual void resume_property_changes ()
 
bool property_changes_suspended () const
 

Private Member Functions

int max_value_for_type () const
 
void drop_controllable ()
 
void midi_receiver (MIDI::Parser &p, MIDI::byte *, size_t)
 
void midi_sense_note (MIDI::Parser &, MIDI::EventTwoBytes *, bool is_on)
 
void midi_sense_note_on (MIDI::Parser &p, MIDI::EventTwoBytes *tb)
 
void midi_sense_note_off (MIDI::Parser &p, MIDI::EventTwoBytes *tb)
 
void midi_sense_controller (MIDI::Parser &, MIDI::EventTwoBytes *)
 
void midi_sense_program_change (MIDI::Parser &, MIDI::byte)
 
void midi_sense_pitchbend (MIDI::Parser &, MIDI::pitchbend_t)
 
void nrpn_value_change (MIDI::Parser &, uint16_t nrpn, float val)
 
void rpn_value_change (MIDI::Parser &, uint16_t nrpn, float val)
 
void rpn_change (MIDI::Parser &, uint16_t nrpn, int direction)
 
void nrpn_change (MIDI::Parser &, uint16_t nrpn, int direction)
 

Private Attributes

GenericMidiControlProtocol_surface
 
std::shared_ptr< PBD::Controllable_controllable
 
std::string _current_uri
 
MIDI::Parser_parser
 
bool setting
 
int last_value
 
int last_incoming
 
float last_controllable_value
 
bool _momentary
 
bool _is_gain_controller
 
bool _learned
 
CtlType _ctltype
 
Encoder _encoder
 
int midi_msg_id
 
PBD::ScopedConnection midi_sense_connection [2]
 
PBD::ScopedConnection midi_learn_connection
 
PBD::ScopedConnection controllable_death_connection
 
PBD::ScopedConnection controllable_remapped_connection
 
MIDI::eventType control_type
 
MIDI::byte control_additional
 
MIDI::channel_t control_channel
 
std::string _control_description
 
int16_t control_rpn
 
int16_t control_nrpn
 
uint32_t _rid
 
std::string _what
 
bool _bank_relative
 
Glib::Threads::Mutex controllable_lock
 

Additional Inherited Members

- Public Attributes inherited from PBD::Stateful
PBD::Signal< void(const PropertyChange &)> PropertyChanged
 
- Static Public Attributes inherited from PBD::Stateful
static int current_state_version
 
static int loading_state_version
 
- Protected Member Functions inherited from PBD::Stateful
void add_instant_xml (XMLNode &, const std::string &directory_path)
 
XMLNodeinstant_xml (const std::string &str, const std::string &directory_path)
 
void add_properties (XMLNode &) const
 
PropertyChange set_values (XMLNode const &)
 
virtual void post_set (const PropertyChange &)
 
virtual void send_change (const PropertyChange &)
 
virtual void mid_thaw (const PropertyChange &)
 
bool regenerate_xml_or_string_ids () const
 
- Protected Attributes inherited from PBD::Stateful
XMLNode_extra_xml
 
XMLNode_instant_xml
 
PBD::PropertyChange _pending_changed
 
Glib::Threads::Mutex _lock
 
std::string _xml_node_name
 name of node to use for this object in XML More...
 
OwnedPropertyList_properties
 

Detailed Description

Definition at line 49 of file midicontrollable.h.

Member Enumeration Documentation

◆ CtlType

Enumerator
Ctl_Momentary 
Ctl_Toggle 
Ctl_Dial 

Definition at line 63 of file midicontrollable.h.

◆ Encoder

Enumerator
No_enc 
Enc_R 
Enc_L 
Enc_2 
Enc_B 

Definition at line 69 of file midicontrollable.h.

Constructor & Destructor Documentation

◆ MIDIControllable() [1/2]

MIDIControllable::MIDIControllable ( GenericMidiControlProtocol ,
MIDI::Parser ,
std::shared_ptr< PBD::Controllable ,
bool  momentary 
)

◆ MIDIControllable() [2/2]

MIDIControllable::MIDIControllable ( GenericMidiControlProtocol ,
MIDI::Parser ,
bool  momentary = false 
)

◆ ~MIDIControllable()

virtual MIDIControllable::~MIDIControllable ( )
virtual

Member Function Documentation

◆ bank_relative()

bool MIDIControllable::bank_relative ( ) const
inline

Definition at line 59 of file midicontrollable.h.

◆ bind_midi()

void MIDIControllable::bind_midi ( MIDI::channel_t  ,
MIDI::eventType  ,
MIDI::byte   
)

◆ bind_nrpn_change()

void MIDIControllable::bind_nrpn_change ( MIDI::channel_t  ,
uint16_t  rpn 
)

◆ bind_nrpn_value()

void MIDIControllable::bind_nrpn_value ( MIDI::channel_t  ,
uint16_t  rpn 
)

◆ bind_remap()

void MIDIControllable::bind_remap ( std::shared_ptr< ARDOUR::Stripable )

◆ bind_rpn_change()

void MIDIControllable::bind_rpn_change ( MIDI::channel_t  ,
uint16_t  rpn 
)

◆ bind_rpn_value()

void MIDIControllable::bind_rpn_value ( MIDI::channel_t  ,
uint16_t  rpn 
)

◆ control_description()

std::string MIDIControllable::control_description ( ) const
inline

Definition at line 101 of file midicontrollable.h.

◆ control_to_midi()

int MIDIControllable::control_to_midi ( float  val)

◆ current_uri()

const std::string& MIDIControllable::current_uri ( ) const
inline

Definition at line 99 of file midicontrollable.h.

◆ drop_controllable()

void MIDIControllable::drop_controllable ( )
private

◆ drop_external_control()

void MIDIControllable::drop_external_control ( )

◆ get_control_additional()

MIDI::byte MIDIControllable::get_control_additional ( )
inline

Definition at line 114 of file midicontrollable.h.

◆ get_control_channel()

MIDI::channel_t MIDIControllable::get_control_channel ( )
inline

Definition at line 112 of file midicontrollable.h.

◆ get_control_type()

MIDI::eventType MIDIControllable::get_control_type ( )
inline

Definition at line 113 of file midicontrollable.h.

◆ get_controllable()

std::shared_ptr<PBD::Controllable> MIDIControllable::get_controllable ( ) const

◆ get_ctltype()

CtlType MIDIControllable::get_ctltype ( ) const
inline

Definition at line 90 of file midicontrollable.h.

◆ get_encoder()

Encoder MIDIControllable::get_encoder ( ) const
inline

Definition at line 93 of file midicontrollable.h.

◆ get_parser()

MIDI::Parser& MIDIControllable::get_parser ( )
inline

Definition at line 96 of file midicontrollable.h.

◆ get_state()

XMLNode& MIDIControllable::get_state ( ) const
virtual

Implements PBD::Stateful.

◆ init()

int MIDIControllable::init ( const std::string &  )

◆ learn_about_external_control()

void MIDIControllable::learn_about_external_control ( )

◆ learned()

bool MIDIControllable::learned ( ) const
inline

Definition at line 88 of file midicontrollable.h.

◆ lookup_controllable()

int MIDIControllable::lookup_controllable ( )

◆ max_value_for_type()

int MIDIControllable::max_value_for_type ( ) const
private

◆ midi_forget()

void MIDIControllable::midi_forget ( )

◆ midi_rebind()

void MIDIControllable::midi_rebind ( MIDI::channel_t  channel = -1)

◆ midi_receiver()

void MIDIControllable::midi_receiver ( MIDI::Parser p,
MIDI::byte ,
size_t   
)
private

◆ midi_sense_controller()

void MIDIControllable::midi_sense_controller ( MIDI::Parser ,
MIDI::EventTwoBytes  
)
private

◆ midi_sense_note()

void MIDIControllable::midi_sense_note ( MIDI::Parser ,
MIDI::EventTwoBytes ,
bool  is_on 
)
private

◆ midi_sense_note_off()

void MIDIControllable::midi_sense_note_off ( MIDI::Parser p,
MIDI::EventTwoBytes tb 
)
private

◆ midi_sense_note_on()

void MIDIControllable::midi_sense_note_on ( MIDI::Parser p,
MIDI::EventTwoBytes tb 
)
private

◆ midi_sense_pitchbend()

void MIDIControllable::midi_sense_pitchbend ( MIDI::Parser ,
MIDI::pitchbend_t   
)
private

◆ midi_sense_program_change()

void MIDIControllable::midi_sense_program_change ( MIDI::Parser ,
MIDI::byte   
)
private

◆ midi_to_control()

float MIDIControllable::midi_to_control ( int  val)

◆ nrpn_change()

void MIDIControllable::nrpn_change ( MIDI::Parser ,
uint16_t  nrpn,
int  direction 
)
private

◆ nrpn_value_change()

void MIDIControllable::nrpn_value_change ( MIDI::Parser ,
uint16_t  nrpn,
float  val 
)
private

◆ rediscover_controllable()

void MIDIControllable::rediscover_controllable ( )

◆ rid()

uint32_t MIDIControllable::rid ( ) const
inline

Definition at line 60 of file midicontrollable.h.

◆ rpn_change()

void MIDIControllable::rpn_change ( MIDI::Parser ,
uint16_t  nrpn,
int  direction 
)
private

◆ rpn_value_change()

void MIDIControllable::rpn_value_change ( MIDI::Parser ,
uint16_t  nrpn,
float  val 
)
private

◆ set_controllable()

void MIDIControllable::set_controllable ( std::shared_ptr< PBD::Controllable )

◆ set_ctltype()

void MIDIControllable::set_ctltype ( CtlType  val)
inline

Definition at line 91 of file midicontrollable.h.

◆ set_encoder()

void MIDIControllable::set_encoder ( Encoder  val)
inline

Definition at line 94 of file midicontrollable.h.

◆ set_state()

int MIDIControllable::set_state ( const XMLNode ,
int  version 
)
virtual

Implements PBD::Stateful.

◆ stop_learning()

void MIDIControllable::stop_learning ( )

◆ what()

std::string MIDIControllable::what ( ) const
inline

Definition at line 61 of file midicontrollable.h.

◆ write_feedback()

MIDI::byte* MIDIControllable::write_feedback ( MIDI::byte buf,
int32_t &  bufsize,
bool  force = false 
)

Member Data Documentation

◆ _bank_relative

bool MIDIControllable::_bank_relative
private

Definition at line 151 of file midicontrollable.h.

◆ _control_description

std::string MIDIControllable::_control_description
private

Definition at line 146 of file midicontrollable.h.

◆ _controllable

std::shared_ptr<PBD::Controllable> MIDIControllable::_controllable
private

Definition at line 125 of file midicontrollable.h.

◆ _ctltype

CtlType MIDIControllable::_ctltype
private

Definition at line 135 of file midicontrollable.h.

◆ _current_uri

std::string MIDIControllable::_current_uri
private

Definition at line 126 of file midicontrollable.h.

◆ _encoder

Encoder MIDIControllable::_encoder
private

Definition at line 136 of file midicontrollable.h.

◆ _is_gain_controller

bool MIDIControllable::_is_gain_controller
private

Definition at line 133 of file midicontrollable.h.

◆ _learned

bool MIDIControllable::_learned
private

Definition at line 134 of file midicontrollable.h.

◆ _momentary

bool MIDIControllable::_momentary
private

Definition at line 132 of file midicontrollable.h.

◆ _parser

MIDI::Parser& MIDIControllable::_parser
private

Definition at line 127 of file midicontrollable.h.

◆ _rid

uint32_t MIDIControllable::_rid
private

Definition at line 149 of file midicontrollable.h.

◆ _surface

GenericMidiControlProtocol* MIDIControllable::_surface
private

Definition at line 124 of file midicontrollable.h.

◆ _what

std::string MIDIControllable::_what
private

Definition at line 150 of file midicontrollable.h.

◆ control_additional

MIDI::byte MIDIControllable::control_additional
private

Definition at line 144 of file midicontrollable.h.

◆ control_channel

MIDI::channel_t MIDIControllable::control_channel
private

Definition at line 145 of file midicontrollable.h.

◆ control_nrpn

int16_t MIDIControllable::control_nrpn
private

Definition at line 148 of file midicontrollable.h.

◆ control_rpn

int16_t MIDIControllable::control_rpn
private

Definition at line 147 of file midicontrollable.h.

◆ control_type

MIDI::eventType MIDIControllable::control_type
private

the type of MIDI message that is used for this control

Definition at line 143 of file midicontrollable.h.

◆ controllable_death_connection

PBD::ScopedConnection MIDIControllable::controllable_death_connection
private

Definition at line 140 of file midicontrollable.h.

◆ controllable_lock

Glib::Threads::Mutex MIDIControllable::controllable_lock
private

Definition at line 154 of file midicontrollable.h.

◆ controllable_remapped_connection

PBD::ScopedConnection MIDIControllable::controllable_remapped_connection
private

Definition at line 141 of file midicontrollable.h.

◆ last_controllable_value

float MIDIControllable::last_controllable_value
private

Definition at line 131 of file midicontrollable.h.

◆ last_incoming

int MIDIControllable::last_incoming
private

Definition at line 130 of file midicontrollable.h.

◆ last_value

int MIDIControllable::last_value
private

Definition at line 129 of file midicontrollable.h.

◆ midi_learn_connection

PBD::ScopedConnection MIDIControllable::midi_learn_connection
private

Definition at line 139 of file midicontrollable.h.

◆ midi_msg_id

int MIDIControllable::midi_msg_id
private

Definition at line 137 of file midicontrollable.h.

◆ midi_sense_connection

PBD::ScopedConnection MIDIControllable::midi_sense_connection[2]
private

Definition at line 138 of file midicontrollable.h.

◆ setting

bool MIDIControllable::setting
private

Definition at line 128 of file midicontrollable.h.


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