- for (AutomationList::const_iterator event = control->list()->begin();
- event != control->list()->end(); ++event) {
- double event_time = (*event)->when;
- double program_number = floor((*event)->value + 0.5);
-
- // Get current value of bank select MSB at time of the program change
- Evoral::Parameter bank_select_msb(MidiCCAutomation, channel, MIDI_CTL_MSB_BANK);
- boost::shared_ptr<Evoral::Control> msb_control = _model->control(bank_select_msb);
- uint8_t msb = 0;
- if (msb_control != 0) {
- msb = uint8_t(floor(msb_control->get_double(true, event_time) + 0.5));
- }
-
- // Get current value of bank select LSB at time of the program change
- Evoral::Parameter bank_select_lsb(MidiCCAutomation, channel, MIDI_CTL_LSB_BANK);
- boost::shared_ptr<Evoral::Control> lsb_control = _model->control(bank_select_lsb);
- uint8_t lsb = 0;
- if (lsb_control != 0) {
- lsb = uint8_t(floor(lsb_control->get_double(true, event_time) + 0.5));