summaryrefslogtreecommitdiff
path: root/gtk2_ardour/instrument_selector.h
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2014-12-24 18:39:15 -0500
committerDavid Robillard <d@drobilla.net>2014-12-24 18:39:15 -0500
commit10ad55fcf59c6a89ed42c9a78024e184e153d81e (patch)
tree0ab520a491575fcc97d4b24cf284fb9c28ae5eef /gtk2_ardour/instrument_selector.h
parent49b7a468052951cfb46a4205c02007ac62f0141d (diff)
Factor out instrument selector.
Diffstat (limited to 'gtk2_ardour/instrument_selector.h')
-rw-r--r--gtk2_ardour/instrument_selector.h61
1 files changed, 61 insertions, 0 deletions
diff --git a/gtk2_ardour/instrument_selector.h b/gtk2_ardour/instrument_selector.h
new file mode 100644
index 0000000000..81beff6ffb
--- /dev/null
+++ b/gtk2_ardour/instrument_selector.h
@@ -0,0 +1,61 @@
+/*
+ Copyright (C) 2000-2014 Paul Davis
+
+ 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.
+*/
+
+#ifndef __gtk_ardour_instrument_selector_h__
+#define __gtk_ardour_instrument_selector_h__
+
+#include <string>
+
+#include <gtkmm/combobox.h>
+#include <gtkmm/comboboxtext.h>
+#include <gtkmm/treemodel.h>
+#include <gtkmm/liststore.h>
+
+#include "ardour/plugin.h"
+#include "ardour/types.h"
+#include "ardour/template_utils.h"
+
+#include "ardour_dialog.h"
+
+class Editor;
+
+class InstrumentSelector : public Gtk::ComboBox
+{
+public:
+ InstrumentSelector();
+
+ ARDOUR::PluginInfoPtr selected_instrument();
+
+private:
+ struct InstrumentListColumns : public Gtk::TreeModel::ColumnRecord {
+ InstrumentListColumns() {
+ add(name);
+ add(info_ptr);
+ }
+ Gtk::TreeModelColumn<std::string> name;
+ Gtk::TreeModelColumn<ARDOUR::PluginInfoPtr> info_ptr;
+ };
+
+ void build_instrument_list();
+
+ Glib::RefPtr<Gtk::ListStore> _instrument_list;
+ InstrumentListColumns _instrument_list_columns;
+ uint32_t _reasonable_synth_id;
+};
+
+#endif /* __gtk_ardour_instrument_selector_h__ */