summaryrefslogtreecommitdiffstats
path: root/src/libs/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/libs/gui')
-rw-r--r--src/libs/gui/PatchCanvas.cpp31
-rw-r--r--src/libs/gui/PatchCanvas.hpp1
2 files changed, 30 insertions, 2 deletions
diff --git a/src/libs/gui/PatchCanvas.cpp b/src/libs/gui/PatchCanvas.cpp
index 4960d5d4..b26c5737 100644
--- a/src/libs/gui/PatchCanvas.cpp
+++ b/src/libs/gui/PatchCanvas.cpp
@@ -112,6 +112,8 @@ PatchCanvas::PatchCanvas(SharedPtr<PatchModel> patch, int width, int height)
_menu_add_button_control->signal_activate().connect(
sigc::bind(sigc::mem_fun(this, &PatchCanvas::menu_add_control), BUTTON));*/
+ build_internal_menu();
+
#ifdef HAVE_SLV2
build_plugin_menu();
#endif
@@ -131,6 +133,31 @@ PatchCanvas::PatchCanvas(SharedPtr<PatchModel> patch, int width, int height)
}
+void
+PatchCanvas::build_internal_menu()
+{
+ _menu->items().push_back(Gtk::Menu_Helpers::ImageMenuElem("Internal",
+ *(manage(new Gtk::Image(Gtk::Stock::EXECUTE, Gtk::ICON_SIZE_MENU)))));
+
+ Gtk::MenuItem* internal_menu_item = &(_menu->items().back());
+ Gtk::Menu* internal_menu = Gtk::manage(new Gtk::Menu());
+ internal_menu_item->set_submenu(*internal_menu);
+
+ const Store::Plugins& plugins = App::instance().store()->plugins();
+
+ // Add LV2 plugins
+ for (Store::Plugins::const_iterator i = plugins.begin(); i != plugins.end(); ++i) {
+ SharedPtr<PluginModel> p = i->second;
+ if (p->type() == Plugin::Internal) {
+ internal_menu->items().push_back(Gtk::Menu_Helpers::MenuElem(p->name(),
+ sigc::bind(sigc::mem_fun(this, &PatchCanvas::load_plugin), p)));
+ }
+ }
+
+ _menu->reorder_child(*internal_menu_item, 2);
+}
+
+
#ifdef HAVE_SLV2
size_t
PatchCanvas::build_plugin_class_menu(Gtk::Menu* menu,
@@ -162,7 +189,7 @@ PatchCanvas::build_plugin_class_menu(Gtk::Menu* menu,
const Store::Plugins& plugins = App::instance().store()->plugins();
- // Add plugins
+ // Add LV2 plugins
for (Store::Plugins::const_iterator i = plugins.begin(); i != plugins.end(); ++i) {
SLV2Plugin p = i->second->slv2_plugin();
@@ -196,7 +223,7 @@ PatchCanvas::build_plugin_menu()
Gtk::MenuItem* plugin_menu_item = &(_menu->items().back());
Gtk::Menu* plugin_menu = Gtk::manage(new Gtk::Menu());
plugin_menu_item->set_submenu(*plugin_menu);
- _menu->reorder_child(*plugin_menu_item, 2);
+ _menu->reorder_child(*plugin_menu_item, 3);
SLV2PluginClass lv2_plugin = slv2_world_get_plugin_class(PluginModel::slv2_world());
SLV2PluginClasses classes = slv2_world_get_plugin_classes(PluginModel::slv2_world());
diff --git a/src/libs/gui/PatchCanvas.hpp b/src/libs/gui/PatchCanvas.hpp
index 98a1635d..dfebab7e 100644
--- a/src/libs/gui/PatchCanvas.hpp
+++ b/src/libs/gui/PatchCanvas.hpp
@@ -94,6 +94,7 @@ private:
void menu_load_patch();
void load_plugin(SharedPtr<PluginModel> plugin);
+ void build_internal_menu();
#ifdef HAVE_SLV2
void build_plugin_menu();
size_t build_plugin_class_menu(Gtk::Menu* menu,