diff options
Diffstat (limited to 'lily/midi-item.cc')
-rw-r--r-- | lily/midi-item.cc | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/lily/midi-item.cc b/lily/midi-item.cc index 7f064e24a8..47ccd787c3 100644 --- a/lily/midi-item.cc +++ b/lily/midi-item.cc @@ -54,6 +54,8 @@ Midi_item::get_midi (Audio_item *a) else if (Audio_control_function_value_change *i = dynamic_cast<Audio_control_function_value_change *> (a)) return new Midi_control_function_value_change (i); + else if (Audio_control_change *i = dynamic_cast<Audio_control_change *> (a)) + return new Midi_control_change (i); else assert (0); @@ -111,6 +113,12 @@ Midi_control_function_value_change { } +Midi_control_change::Midi_control_change (Audio_control_change *ai) + : Midi_channel_item (ai), + audio_ (ai) +{ +} + Midi_item::~Midi_item () { } @@ -123,6 +131,10 @@ Midi_control_function_value_change::~Midi_control_function_value_change () { } +Midi_control_change::~Midi_control_change () +{ +} + string int2midi_varint_string (int i) { @@ -388,6 +400,16 @@ Midi_control_function_value_change::to_string () const return str; } +string +Midi_control_change::to_string () const +{ + Byte status_byte = (char) (0xB0 + channel_); + string str = ::to_string ((char)status_byte); + str += ::to_string ((char) (audio_->control_)); + str += ::to_string ((char) (audio_->value_)); + return str; +} + char const * Midi_item::name () const { |