Ardour  8.12
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 #ifndef __ardour_instrument_info_h__
20 #define __ardour_instrument_info_h__
21 
22 #include <memory>
23 #include <stdint.h>
24 #include <string>
25 
26 #include "pbd/signals.h"
27 
28 #include "evoral/Parameter.h"
29 
32 
33 namespace MIDI {
34  namespace Name {
35  class ChannelNameSet;
36  class Patch;
37  class ValueNameList;
38  class MasterDeviceNames;
39  class ControlNameList;
40  typedef std::list<std::shared_ptr<Patch> > PatchNameList;
41  }
42 }
43 
44 namespace ARDOUR {
45 
46 class Processor;
47 
49 {
50 public:
53 
54  std::string model () const;
55  std::string mode () const;
56 
57  void set_external_instrument (const std::string& model, const std::string& mode);
58  void set_internal_instrument (std::shared_ptr<ARDOUR::Processor>);
59 
60  std::string get_note_name (uint16_t bank, uint8_t program, uint8_t channel, uint8_t note) const;
61 
62  std::string get_patch_name (uint16_t bank, uint8_t program, uint8_t channel) const;
63  std::string get_patch_name_without (uint16_t bank, uint8_t program, uint8_t channel) const;
64  std::string get_controller_name (Evoral::Parameter param) const;
65 
66  std::shared_ptr<MIDI::Name::MasterDeviceNames> master_device_names () const;
67 
68  std::shared_ptr<MIDI::Name::ChannelNameSet> get_patches (uint8_t channel);
69  std::shared_ptr<MIDI::Name::ControlNameList> control_name_list (uint8_t channel);
70 
71  std::shared_ptr<const MIDI::Name::ValueNameList> value_name_list_by_control (uint8_t channel, uint8_t number) const;
72 
73  size_t master_controller_count () const;
74  uint16_t channels_for_control_list (std::string const& ctrl_name_list) const;
75 
76  PBD::Signal0<void> Changed;
77 
78  bool have_custom_plugin_info () const;
79 
80 private:
81  std::string get_patch_name (uint16_t bank, uint8_t program, uint8_t channel, bool with_extra) const;
82 
84  {
85  _plugin_model = "";
86  _plugin_mode = "";
87  }
88 
89  void emit_changed ();
90 
93 
94  mutable std::string _plugin_model;
95  mutable std::string _plugin_mode;
96 
97  std::weak_ptr<ARDOUR::Processor> internal_instrument;
98 
100 };
101 
102 }
103 
104 #endif /* __ardour_instrument_info_h__ */
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
PBD::Signal0< void > Changed
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
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