another TLSF vs realloc-pool shootout
[ardour.git] / libs / ardour / ardour / instrument_info.h
index d4c9bf4f4629e8f83755f65ad47a51a9924136aa..8e08c8b4b72397203c4ae814074ddaa0c9727f8e 100644 (file)
 #include <string>
 #include <stdint.h>
 
+#include <boost/weak_ptr.hpp>
+
 #include "pbd/signals.h"
 
-#include <boost/weak_ptr.hpp>
+#include "evoral/Parameter.hpp"
+
+#include "midi++/libmidi_visibility.h"
+#include "ardour/libardour_visibility.h"
+
+namespace MIDI {
+       namespace Name {
+               class ChannelNameSet;
+               class Patch;
+               typedef std::list<boost::shared_ptr<Patch> > PatchNameList;
+       }
+}
 
 namespace ARDOUR {
 
 class Processor;
 
-class InstrumentInfo {
+class LIBARDOUR_API InstrumentInfo {
   public:
     InstrumentInfo();
     ~InstrumentInfo ();
@@ -39,15 +52,27 @@ class 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;
 
+    boost::shared_ptr<MIDI::Name::ChannelNameSet> get_patches (uint8_t channel);
+
     PBD::Signal0<void> Changed;
 
+    static const MIDI::Name::PatchNameList& general_midi_patches();
+
   private:
     std::string external_instrument_model;
     std::string external_instrument_mode;
 
     boost::weak_ptr<ARDOUR::Processor> internal_instrument;
+
+    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;
 };
 
 } /* namespace ARDOUR */