summaryrefslogtreecommitdiffstats
path: root/src/gui/PatchWindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/PatchWindow.cpp')
-rw-r--r--src/gui/PatchWindow.cpp47
1 files changed, 28 insertions, 19 deletions
diff --git a/src/gui/PatchWindow.cpp b/src/gui/PatchWindow.cpp
index 280682ba..0863b770 100644
--- a/src/gui/PatchWindow.cpp
+++ b/src/gui/PatchWindow.cpp
@@ -69,6 +69,7 @@ PatchWindow::PatchWindow(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glad
xml->get_widget("patch_save_menuitem", _menu_save);
xml->get_widget("patch_save_as_menuitem", _menu_save_as);
xml->get_widget("patch_upload_menuitem", _menu_upload);
+ xml->get_widget("patch_edit_controls_menuitem", _menu_edit_controls);
xml->get_widget("patch_cut_menuitem", _menu_cut);
xml->get_widget("patch_copy_menuitem", _menu_copy);
xml->get_widget("patch_paste_menuitem", _menu_paste);
@@ -85,7 +86,6 @@ PatchWindow::PatchWindow(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glad
xml->get_widget("patch_status_bar_menuitem", _menu_show_status_bar);
xml->get_widget("patch_arrange_menuitem", _menu_arrange);
xml->get_widget("patch_clear_menuitem", _menu_clear);
- xml->get_widget("patch_destroy_menuitem", _menu_destroy_patch);
xml->get_widget("patch_view_messages_window_menuitem", _menu_view_messages_window);
xml->get_widget("patch_view_patch_tree_window_menuitem", _menu_view_patch_tree_window);
xml->get_widget("patch_help_about_menuitem", _menu_help_about);
@@ -106,6 +106,8 @@ PatchWindow::PatchWindow(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glad
sigc::mem_fun(this, &PatchWindow::event_save_as));
_menu_upload->signal_activate().connect(
sigc::mem_fun(this, &PatchWindow::event_upload));
+ _menu_edit_controls->signal_activate().connect(
+ sigc::mem_fun(this, &PatchWindow::event_edit_controls));
_menu_copy->signal_activate().connect(
sigc::mem_fun(this, &PatchWindow::event_copy));
_menu_paste->signal_activate().connect(
@@ -132,8 +134,6 @@ PatchWindow::PatchWindow(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glad
sigc::mem_fun(this, &PatchWindow::event_show_controls));
_menu_view_patch_properties->signal_activate().connect(
sigc::mem_fun(this, &PatchWindow::event_show_properties));
- _menu_destroy_patch->signal_activate().connect(
- sigc::mem_fun(this, &PatchWindow::event_destroy));
_menu_clear->signal_activate().connect(
sigc::mem_fun(this, &PatchWindow::event_clear));
_menu_view_messages_window->signal_activate().connect(
@@ -195,6 +195,7 @@ PatchWindow::set_patch(SharedPtr<PatchModel> patch, SharedPtr<PatchView> view)
new_port_connection.disconnect();
removed_port_connection.disconnect();
+ edit_mode_connection.disconnect();
_entered_connection.disconnect();
_left_connection.disconnect();
@@ -247,15 +248,13 @@ PatchWindow::set_patch(SharedPtr<PatchModel> patch, SharedPtr<PatchView> view)
set_title(_patch->path() + " - Ingen");
- //m_properties_window->patch_model(pc->patch_model());
-
- if (patch->path() == "/")
- _menu_destroy_patch->set_sensitive(false);
- else
- _menu_destroy_patch->set_sensitive(true);
-
- new_port_connection = patch->signal_new_port.connect(sigc::mem_fun(this, &PatchWindow::patch_port_added));
- removed_port_connection = patch->signal_removed_port.connect(sigc::mem_fun(this, &PatchWindow::patch_port_removed));
+ new_port_connection = patch->signal_new_port.connect(
+ sigc::mem_fun(this, &PatchWindow::patch_port_added));
+ removed_port_connection = patch->signal_removed_port.connect(
+ sigc::mem_fun(this, &PatchWindow::patch_port_removed));
+ removed_port_connection = patch->signal_editable.connect(
+ sigc::mem_fun(this, &PatchWindow::editable_changed));
+
show_all();
_view->signal_object_entered.connect(sigc::mem_fun(this, &PatchWindow::object_entered));
@@ -334,6 +333,15 @@ PatchWindow::object_left(ObjectModel* model)
void
+PatchWindow::editable_changed(bool editable)
+{
+ //const Atom& enabled = _patch->get_variable("ingen:enabled");
+ _menu_edit_controls->set_active(editable);
+}
+
+
+
+void
PatchWindow::event_show_engine()
{
if (_patch)
@@ -454,6 +462,14 @@ PatchWindow::event_upload()
void
+PatchWindow::event_edit_controls()
+{
+ if (_view)
+ _view->set_editable(_menu_edit_controls->get_active());
+}
+
+
+void
PatchWindow::event_copy()
{
if (_view)
@@ -562,13 +578,6 @@ PatchWindow::event_quit()
void
-PatchWindow::event_destroy()
-{
- App::instance().engine()->destroy(_patch->path());
-}
-
-
-void
PatchWindow::event_clear()
{
App::instance().engine()->clear_patch(_patch->path());