-void
-MidiTimeAxisView::send_patch_change ()
-{
- if (!_route) {
- return;
- }
-
- Evoral::PatchChange<Evoral::Beats> empty (Evoral::Beats(), 0, 0, 0);
- PatchChangeDialog d (0, 0, empty, _route->instrument_info(), Gtk::Stock::OK);
-
- if (d.run() == RESPONSE_CANCEL) {
- return;
- }
- Evoral::PatchChange<Evoral::Beats> p (d.patch ());
-
- uint8_t chn = p.channel();
-
- boost::shared_ptr<AutomationControl> bank_msb = _route->automation_control(Evoral::Parameter (MidiCCAutomation, chn, MIDI_CTL_MSB_BANK), true);
- boost::shared_ptr<AutomationControl> bank_lsb = _route->automation_control(Evoral::Parameter (MidiCCAutomation, chn, MIDI_CTL_LSB_BANK), true);
- boost::shared_ptr<AutomationControl> program = _route->automation_control(Evoral::Parameter (MidiPgmChangeAutomation, chn), true);
-
- if (!bank_msb || ! bank_lsb || !program) {
- return;
- }
-
- bank_msb->set_value (p.bank_msb (), Controllable::NoGroup);
- bank_lsb->set_value (p.bank_lsb (), Controllable::NoGroup);
- program->set_value (p.program () , Controllable::NoGroup);
-}
-