mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-10 16:46:35 +01:00
Fix Patch Change Naming when plugins change (Route::reset_instrument_info)
This commit is contained in:
parent
e7ca514887
commit
c0b6d8bfdf
1 changed files with 18 additions and 2 deletions
|
|
@ -58,9 +58,25 @@ InstrumentInfo::set_external_instrument (const string& model, const string& mode
|
|||
void
|
||||
InstrumentInfo::set_internal_instrument (boost::shared_ptr<Processor> p)
|
||||
{
|
||||
external_instrument_mode = "";
|
||||
|
||||
boost::shared_ptr<PluginInsert> pi = boost::dynamic_pointer_cast<PluginInsert>(p);
|
||||
if (pi && pi->plugin ()->has_midnam ()) {
|
||||
/* really back hack, following MidiTimeAxisView::model_changed()
|
||||
*
|
||||
* InstrumentInfo::get_plugin_patch_name() needs to be overhauled,
|
||||
* it limits all PluginInsert to generic-midi or only numbers.
|
||||
*/
|
||||
internal_instrument.reset ();
|
||||
external_instrument_model = pi->plugin ()->midnam_model ();
|
||||
const std::list<std::string> device_modes = MIDI::Name::MidiPatchManager::instance().custom_device_mode_names_by_model (external_instrument_model);
|
||||
if (device_modes.size() > 0) {
|
||||
external_instrument_mode = device_modes.front();
|
||||
}
|
||||
} else {
|
||||
internal_instrument = p;
|
||||
external_instrument_model = (_("Unknown"));
|
||||
external_instrument_mode = "";
|
||||
}
|
||||
Changed(); /* EMIT SIGNAL */
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue