summaryrefslogtreecommitdiff
path: root/libs/ardour/instrument_info.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2012-06-12 04:05:10 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2012-06-12 04:05:10 +0000
commit557f56a7f2173fdf9b01dfb3f3410f227d05f8e2 (patch)
tree2ebd0a0655fadffcb962591355fd0d4a9c7e7ce6 /libs/ardour/instrument_info.cc
parentcf0753a4bd4ed23d40fd06e8d1dec4f0b46da6fc (diff)
more changes to patch change/plugin preset support - replace regexp replacement with boost::replace_all(), actually find programs/patches in the data we have, and more. notable changes to constructors and structure of various MIDI::Name objects
git-svn-id: svn://localhost/ardour2/branches/3.0@12667 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/instrument_info.cc')
-rw-r--r--libs/ardour/instrument_info.cc14
1 files changed, 6 insertions, 8 deletions
diff --git a/libs/ardour/instrument_info.cc b/libs/ardour/instrument_info.cc
index c83f7ae321..a2e1605b72 100644
--- a/libs/ardour/instrument_info.cc
+++ b/libs/ardour/instrument_info.cc
@@ -88,7 +88,7 @@ InstrumentInfo::get_patch_name (uint16_t bank, uint8_t program, uint8_t channel)
return get_plugin_patch_name (p, bank, program, channel);
}
- MIDI::Name::PatchPrimaryKey patch_key (bank, program);
+ MIDI::Name::PatchPrimaryKey patch_key (program, bank);
boost::shared_ptr<MIDI::Name::Patch> patch =
MIDI::Name::MidiPatchManager::instance().find_patch (external_instrument_model,
@@ -149,20 +149,18 @@ InstrumentInfo::plugin_programs_to_channel_name_set (boost::shared_ptr<Processor
for (n = 0, i = presets.begin(); i != presets.end(); ++i, ++n) {
if ((*i).number >= 0) {
- patch_list.push_back (boost::shared_ptr<Patch> (new Patch (string_compose ("%1", n), (*i).label)));
+ patch_list.push_back (boost::shared_ptr<Patch> (new Patch ((*i).label, n)));
} else {
- patch_list.push_back (boost::shared_ptr<Patch> (new Patch (string_compose ("%1", n),
- string_compose ("program %1", n))));
+ patch_list.push_back (boost::shared_ptr<Patch> (new Patch (string_compose ("program %1", n), n)));
}
}
} else {
for (int n = 0; n < 127; ++n) {
- patch_list.push_back (boost::shared_ptr<Patch> (new Patch (string_compose ("%1", n),
- string_compose ("program %1", n))));
+ patch_list.push_back (boost::shared_ptr<Patch> (new Patch (string_compose ("program %1", n), n)));
}
}
- boost::shared_ptr<PatchBank> pb (new PatchBank (p->name()));
+ boost::shared_ptr<PatchBank> pb (new PatchBank (0, p->name()));
pb->set_patch_name_list (patch_list);
ChannelNameSet::PatchBanks patch_banks;
@@ -179,7 +177,7 @@ InstrumentInfo::general_midi_patches()
{
if (_gm_patches.empty()) {
for (int n = 0; n < 128; n++) {
- _gm_patches.push_back (boost::shared_ptr<Patch> (new Patch (string_compose ("%1", n), general_midi_program_names[n])));
+ _gm_patches.push_back (boost::shared_ptr<Patch> (new Patch (general_midi_program_names[n], n)));
}
}