Ardour  9.0-pre0-582-g084a23a80d
instrument_info.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012-2016 Paul Davis <paul@linuxaudiosystems.com>
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License along
15  * with this program; if not, write to the Free Software Foundation, Inc.,
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17  */
18 
19 #pragma once
20 
21 #include <memory>
22 #include <stdint.h>
23 #include <string>
24 
25 #include "pbd/signals.h"
26 
27 #include "evoral/Parameter.h"
28 
31 
32 namespace MIDI {
33  namespace Name {
34  class ChannelNameSet;
35  class Patch;
36  class ValueNameList;
37  class MasterDeviceNames;
38  class ControlNameList;
39  typedef std::list<std::shared_ptr<Patch> > PatchNameList;
40  }
41 }
42 
43 namespace ARDOUR {
44 
45 class Processor;
46 
48 {
49 public:
52 
53  std::string model () const;
54  std::string mode () const;
55 
56  void set_external_instrument (const std::string& model, const std::string& mode);
57  void set_internal_instrument (std::shared_ptr<ARDOUR::Processor>);
58 
59  std::string get_note_name (uint16_t bank, uint8_t program, uint8_t channel, uint8_t note) const;
60 
61  std::string get_patch_name (uint16_t bank, uint8_t program, uint8_t channel) const;
62  std::string get_patch_name_without (uint16_t bank, uint8_t program, uint8_t channel) const;
63  std::string get_controller_name (Evoral::Parameter param) const;
64 
65  std::shared_ptr<MIDI::Name::MasterDeviceNames> master_device_names () const;
66 
67  std::shared_ptr<MIDI::Name::ChannelNameSet> get_patches (uint8_t channel);
68  std::shared_ptr<MIDI::Name::ControlNameList> control_name_list (uint8_t channel);
69 
70  std::shared_ptr<const MIDI::Name::ValueNameList> value_name_list_by_control (uint8_t channel, uint8_t number) const;
71 
72  size_t master_controller_count () const;
73  uint16_t channels_for_control_list (std::string const& ctrl_name_list) const;
74 
76 
77  bool have_custom_plugin_info () const;
78 
79 private:
80  std::string get_patch_name (uint16_t bank, uint8_t program, uint8_t channel, bool with_extra) const;
81 
83  {
84  _plugin_model = "";
85  _plugin_mode = "";
86  }
87 
88  void emit_changed ();
89 
92 
93  mutable std::string _plugin_model;
94  mutable std::string _plugin_mode;
95 
96  std::weak_ptr<ARDOUR::Processor> internal_instrument;
97 
99 };
100 
101 }
102 
std::shared_ptr< MIDI::Name::ControlNameList > control_name_list(uint8_t channel)
std::shared_ptr< MIDI::Name::MasterDeviceNames > master_device_names() const
std::string get_patch_name(uint16_t bank, uint8_t program, uint8_t channel, bool with_extra) const
std::string _external_instrument_model
size_t master_controller_count() const
void set_internal_instrument(std::shared_ptr< ARDOUR::Processor >)
uint16_t channels_for_control_list(std::string const &ctrl_name_list) const
std::string get_patch_name_without(uint16_t bank, uint8_t program, uint8_t channel) const
std::shared_ptr< MIDI::Name::ChannelNameSet > get_patches(uint8_t channel)
std::string get_controller_name(Evoral::Parameter param) const
std::string model() const
std::string mode() const
PBD::Signal< void()> Changed
std::shared_ptr< const MIDI::Name::ValueNameList > value_name_list_by_control(uint8_t channel, uint8_t number) const
void set_external_instrument(const std::string &model, const std::string &mode)
std::string _external_instrument_mode
std::string get_note_name(uint16_t bank, uint8_t program, uint8_t channel, uint8_t note) const
PBD::ScopedConnection _midnam_changed
bool have_custom_plugin_info() const
std::string get_patch_name(uint16_t bank, uint8_t program, uint8_t channel) const
std::weak_ptr< ARDOUR::Processor > internal_instrument
#define LIBARDOUR_API
std::list< std::shared_ptr< Patch > > PatchNameList