Ardour  9.0-pre0-582-g084a23a80d
plugin_presets_ui.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2018-2019 Robin Gareus <robin@gareus.org>
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 _gtkardour_plugin_presets_ui_h_
20 #define _gtkardour_plugin_presets_ui_h_
21 
22 #include <gtkmm/label.h>
23 #include <gtkmm/liststore.h>
24 #include <gtkmm/scrolledwindow.h>
25 #include <gtkmm/table.h>
26 #include <gtkmm/textview.h>
27 #include <gtkmm/treemodel.h>
28 #include <gtkmm/treestore.h>
29 #include <gtkmm/treeview.h>
30 
31 #include "widgets/ardour_button.h"
32 
33 #include "ardour/plugin_insert.h"
34 
36 {
37 public:
38  PluginPresetsUI (std::shared_ptr<ARDOUR::PluginInsert>);
39 
40 private:
42  void filter_presets ();
43  void preset_selected ();
45  void load_preset ();
46 
47  std::shared_ptr<ARDOUR::PluginInsert> _insert;
49 
50  struct PluginPreset {
51  PluginPreset (ARDOUR::Plugin::PresetRecord const& p, std::string const& b = "", std::string const& t = "")
52  : _preset_record (p)
53  , _bank (b)
54  , _type (t)
55  { }
57  std::string _bank;
58  std::string _type;
59 
60  bool operator< (PluginPreset const& o) const {
62  }
63  };
64 
65  std::vector<PluginPreset> _pps;
66 
69  add (name);
70  add (count);
71  }
74  };
75 
78  add (name);
79  add (description);
81  }
82 
86  };
87 
90  Glib::RefPtr<Gtk::TreeStore> _filter_banks_model;
92 
95  Glib::RefPtr<Gtk::TreeStore> _filter_types_model;
97 
100  Glib::RefPtr<Gtk::TreeStore> _plugin_preset_model;
102 
105 };
106 
107 #endif
void add(TreeModelColumnBase &column)
Glib::RefPtr< Gtk::TreeStore > _filter_banks_model
Glib::RefPtr< Gtk::TreeStore > _filter_types_model
void preset_row_activated(Gtk::TreeModel::Path, Gtk::TreeViewColumn *)
Gtk::TreeView _filter_types_display
TagFilterModelColumns _filter_types_columns
Gtk::ScrolledWindow _types_scroller
Gtk::TextView _preset_desc
void update_preset_list()
PluginPresetsUI(std::shared_ptr< ARDOUR::PluginInsert >)
std::vector< PluginPreset > _pps
PBD::ScopedConnectionList _preset_connections
Gtk::ScrolledWindow _preset_scroller
Gtk::TreeView _filter_banks_display
TagFilterModelColumns _filter_banks_columns
Gtk::ScrolledWindow _banks_scroller
void preset_selected()
void filter_presets()
std::shared_ptr< ARDOUR::PluginInsert > _insert
Gtk::TreeView _plugin_preset_display
Glib::RefPtr< Gtk::TreeStore > _plugin_preset_model
ArdourWidgets::ArdourButton _load_button
PluginPresetModelColumns _plugin_preset_columns
Gtk::TreeModelColumn< std::string > description
Gtk::TreeModelColumn< ARDOUR::Plugin::PresetRecord > plugin_preset
Gtk::TreeModelColumn< std::string > name
bool operator<(PluginPreset const &o) const
ARDOUR::Plugin::PresetRecord _preset_record
PluginPreset(ARDOUR::Plugin::PresetRecord const &p, std::string const &b="", std::string const &t="")
Gtk::TreeModelColumn< size_t > count
Gtk::TreeModelColumn< std::string > name