summaryrefslogtreecommitdiff
path: root/libs/ardour/ardour/midi_patch_manager.h
diff options
context:
space:
mode:
authorHans Baier <hansfbaier@googlemail.com>2008-12-09 08:35:02 +0000
committerHans Baier <hansfbaier@googlemail.com>2008-12-09 08:35:02 +0000
commitf8480d6392e6d0e61aa39e564904ba67822f711e (patch)
tree043e60f68e059097c7b2782e6522f76202e4c08f /libs/ardour/ardour/midi_patch_manager.h
parent457f06855e30ebdfeae0a5dfe39cb8f52422a912 (diff)
* moved /midi_patch_manager.* to libs/ardour
* GUI improvement: do away with the midi channel expander git-svn-id: svn://localhost/ardour2/branches/3.0@4305 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/ardour/midi_patch_manager.h')
-rw-r--r--libs/ardour/ardour/midi_patch_manager.h81
1 files changed, 81 insertions, 0 deletions
diff --git a/libs/ardour/ardour/midi_patch_manager.h b/libs/ardour/ardour/midi_patch_manager.h
new file mode 100644
index 0000000000..3591f87d89
--- /dev/null
+++ b/libs/ardour/ardour/midi_patch_manager.h
@@ -0,0 +1,81 @@
+/*
+ Copyright (C) 2008 Hans Baier
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+ $Id$
+*/
+
+#ifndef MIDI_PATCH_MANAGER_H_
+#define MIDI_PATCH_MANAGER_H_
+
+#include <midi++/midnam_patch.h>
+
+namespace ARDOUR {
+ class Session;
+}
+
+namespace MIDI
+{
+
+namespace Name
+{
+
+class MidiPatchManager
+{
+ /// Singleton
+private:
+ MidiPatchManager() {};
+ MidiPatchManager( const MidiPatchManager& );
+ MidiPatchManager& operator= (const MidiPatchManager&);
+
+ static MidiPatchManager* _manager;
+
+public:
+ typedef std::map<std::string, boost::shared_ptr<MIDINameDocument> > MidiNameDocuments;
+
+ virtual ~MidiPatchManager() { _manager = 0; }
+
+ static MidiPatchManager& instance() {
+ if (_manager == 0) {
+ _manager = new MidiPatchManager();
+ }
+ return *_manager;
+ }
+
+ void set_session (ARDOUR::Session&);
+
+ boost::shared_ptr<MIDINameDocument> document_by_model(std::string model_name)
+ { return _documents[model_name]; }
+
+ boost::shared_ptr<MasterDeviceNames> master_device_by_model(std::string model_name)
+ { return _master_devices_by_model[model_name]; }
+
+ const MasterDeviceNames::Models& all_models() const { return _all_models; }
+
+private:
+ void drop_session();
+ void refresh();
+
+ ARDOUR::Session* _session;
+ MidiNameDocuments _documents;
+ MIDINameDocument::MasterDeviceNamesList _master_devices_by_model;
+ MasterDeviceNames::Models _all_models;
+};
+
+} // namespace Name
+
+} // namespace MIDI
+#endif /* MIDI_PATCH_MANAGER_H_ */