mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-09 16:24:57 +01:00
Add API to count named MIDNAM controls
This commit is contained in:
parent
37bbc70179
commit
20ee430fda
2 changed files with 19 additions and 0 deletions
|
|
@ -68,6 +68,8 @@ public:
|
||||||
|
|
||||||
boost::shared_ptr<const MIDI::Name::ValueNameList> value_name_list_by_control (uint8_t channel, uint8_t number) const;
|
boost::shared_ptr<const MIDI::Name::ValueNameList> value_name_list_by_control (uint8_t channel, uint8_t number) const;
|
||||||
|
|
||||||
|
size_t master_controller_count () const;
|
||||||
|
|
||||||
PBD::Signal0<void> Changed;
|
PBD::Signal0<void> Changed;
|
||||||
|
|
||||||
bool have_custom_plugin_info () const;
|
bool have_custom_plugin_info () const;
|
||||||
|
|
|
||||||
|
|
@ -176,6 +176,23 @@ InstrumentInfo::control_name_list (uint8_t channel)
|
||||||
return dev_names->control_name_list (chan_names->control_list_name ());
|
return dev_names->control_name_list (chan_names->control_list_name ());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
size_t
|
||||||
|
InstrumentInfo::master_controller_count () const
|
||||||
|
{
|
||||||
|
boost::shared_ptr<MasterDeviceNames> const& dev_names (MidiPatchManager::instance ().master_device_by_model (model ()));
|
||||||
|
if (!dev_names) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
MasterDeviceNames::ControlNameLists const& ctllist (dev_names->controls());
|
||||||
|
|
||||||
|
size_t total_ctrls = 0;
|
||||||
|
for (MasterDeviceNames::ControlNameLists::const_iterator l = ctllist.begin(); l != ctllist.end(); ++l) {
|
||||||
|
boost::shared_ptr<ControlNameList> const& name_list = l->second;
|
||||||
|
total_ctrls += name_list->controls().size();
|
||||||
|
}
|
||||||
|
return total_ctrls;
|
||||||
|
}
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
MasterDeviceNames::ControlNameLists const&
|
MasterDeviceNames::ControlNameLists const&
|
||||||
InstrumentInfo::master_control_names () const
|
InstrumentInfo::master_control_names () const
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue