mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-16 03:36:32 +01:00
add new API to InstrumentInfo to get program names in a very slightly different format
This commit is contained in:
parent
428ed8ae1b
commit
027caa4207
2 changed files with 19 additions and 1 deletions
|
|
@ -52,6 +52,7 @@ class LIBARDOUR_API InstrumentInfo {
|
|||
void set_internal_instrument (boost::shared_ptr<ARDOUR::Processor>);
|
||||
|
||||
std::string get_patch_name (uint16_t bank, uint8_t program, uint8_t channel) const;
|
||||
std::string get_patch_name_without (uint16_t bank, uint8_t program, uint8_t channel) const;
|
||||
std::string get_controller_name (Evoral::Parameter param) const;
|
||||
std::string get_instrument_name () const;
|
||||
|
||||
|
|
@ -70,6 +71,7 @@ class LIBARDOUR_API InstrumentInfo {
|
|||
boost::shared_ptr<MIDI::Name::ChannelNameSet> plugin_programs_to_channel_name_set (boost::shared_ptr<Processor> p);
|
||||
std::string get_plugin_patch_name (boost::shared_ptr<ARDOUR::Processor>, uint16_t bank, uint8_t program, uint8_t channel) const;
|
||||
|
||||
std::string get_patch_name (uint16_t bank, uint8_t program, uint8_t channel, bool with_extra) const;
|
||||
static MIDI::Name::PatchNameList _gm_patches;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -81,6 +81,18 @@ InstrumentInfo::get_instrument_name () const
|
|||
|
||||
string
|
||||
InstrumentInfo::get_patch_name (uint16_t bank, uint8_t program, uint8_t channel) const
|
||||
{
|
||||
return get_patch_name (bank, program, channel, true);
|
||||
}
|
||||
|
||||
string
|
||||
InstrumentInfo::get_patch_name_without (uint16_t bank, uint8_t program, uint8_t channel) const
|
||||
{
|
||||
return get_patch_name (bank, program, channel, false);
|
||||
}
|
||||
|
||||
string
|
||||
InstrumentInfo::get_patch_name (uint16_t bank, uint8_t program, uint8_t channel, bool with_extra) const
|
||||
{
|
||||
boost::shared_ptr<Processor> p = internal_instrument.lock();
|
||||
if (p) {
|
||||
|
|
@ -100,7 +112,11 @@ InstrumentInfo::get_patch_name (uint16_t bank, uint8_t program, uint8_t channel)
|
|||
|
||||
#define MIDI_BP_ZERO ((Config->get_first_midi_bank_is_zero())?0:1)
|
||||
|
||||
return string_compose ("prg %1 bnk %2",program + MIDI_BP_ZERO , bank + MIDI_BP_ZERO);
|
||||
if (with_extra) {
|
||||
return string_compose ("prg %1 bnk %2",program + MIDI_BP_ZERO , bank + MIDI_BP_ZERO);
|
||||
} else {
|
||||
return string_compose ("%1", program + MIDI_BP_ZERO);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue