summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gui/PatchView.cpp9
-rw-r--r--src/gui/PatchView.hpp4
-rw-r--r--src/gui/PatchWindow.cpp47
-rw-r--r--src/gui/PatchWindow.hpp6
-rw-r--r--src/gui/ingen_gui.glade64
5 files changed, 65 insertions, 65 deletions
diff --git a/src/gui/PatchView.cpp b/src/gui/PatchView.cpp
index 02e6fc97..deac1b22 100644
--- a/src/gui/PatchView.cpp
+++ b/src/gui/PatchView.cpp
@@ -47,7 +47,6 @@ PatchView::PatchView(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::X
xml->get_widget("patch_view_process_but", _process_but);
xml->get_widget("patch_view_poly_spin", _poly_spin);
xml->get_widget("patch_view_clear_but", _clear_but);
- xml->get_widget("patch_view_destroy_but", _destroy_but);
xml->get_widget("patch_view_refresh_but", _refresh_but);
xml->get_widget("patch_view_save_but", _save_but);
xml->get_widget("patch_view_zoom_full_but", _zoom_full_but);
@@ -78,7 +77,6 @@ PatchView::set_patch(SharedPtr<PatchModel> patch)
_canvas_scrolledwindow->add(*_canvas);
_poly_spin->set_value(patch->poly());
- _destroy_but->set_sensitive(patch->path() != "/");
for (GraphObject::Properties::const_iterator i = patch->properties().begin();
i != patch->properties().end(); ++i)
@@ -149,6 +147,13 @@ void
PatchView::editable_toggled()
{
const bool editable = _edit_mode_but->get_active();
+ set_editable(editable);
+}
+
+
+void
+PatchView::set_editable(bool editable)
+{
_patch->set_editable(editable);
_canvas->lock(!editable);
}
diff --git a/src/gui/PatchView.hpp b/src/gui/PatchView.hpp
index 77da6263..c88e334a 100644
--- a/src/gui/PatchView.hpp
+++ b/src/gui/PatchView.hpp
@@ -62,6 +62,8 @@ public:
SharedPtr<PatchCanvas> canvas() const { return _canvas; }
SharedPtr<PatchModel> patch() const { return _patch; }
Gtk::Viewport* breadcrumb_container() const { return _breadcrumb_container; }
+
+ void set_editable(bool editable);
static SharedPtr<PatchView> create(SharedPtr<PatchModel> patch);
@@ -77,6 +79,7 @@ private:
void refresh_clicked();
void on_editable_sig(bool locked);
void editable_toggled();
+
void canvas_item_entered(Gnome::Canvas::Item* item);
void canvas_item_left(Gnome::Canvas::Item* item);
@@ -93,7 +96,6 @@ private:
Gtk::ToggleToolButton* _process_but;
Gtk::SpinButton* _poly_spin;
Gtk::ToolButton* _clear_but;
- Gtk::ToolButton* _destroy_but;
Gtk::ToolButton* _refresh_but;
Gtk::ToolButton* _save_but;
Gtk::ToolButton* _zoom_normal_but;
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());
diff --git a/src/gui/PatchWindow.hpp b/src/gui/PatchWindow.hpp
index 3e0c75bf..5cfa2936 100644
--- a/src/gui/PatchWindow.hpp
+++ b/src/gui/PatchWindow.hpp
@@ -78,18 +78,19 @@ private:
void patch_port_removed(SharedPtr<PortModel> port);
void object_entered(ObjectModel* model);
void object_left(ObjectModel* model);
+ void editable_changed(bool editable);
void event_import();
void event_import_location();
void event_save();
void event_save_as();
void event_upload();
+ void event_edit_controls();
void event_copy();
void event_paste();
void event_delete();
void event_select_all();
void event_quit();
- void event_destroy();
void event_clear();
void event_fullscreen_toggled();
void event_status_bar_toggled();
@@ -106,6 +107,7 @@ private:
sigc::connection new_port_connection;
sigc::connection removed_port_connection;
+ sigc::connection edit_mode_connection;
bool _enable_signal;
bool _position_stored;
@@ -117,6 +119,7 @@ private:
Gtk::MenuItem* _menu_save;
Gtk::MenuItem* _menu_save_as;
Gtk::MenuItem* _menu_upload;
+ Gtk::CheckMenuItem* _menu_edit_controls;
Gtk::MenuItem* _menu_cut;
Gtk::MenuItem* _menu_copy;
Gtk::MenuItem* _menu_paste;
@@ -129,7 +132,6 @@ private:
Gtk::CheckMenuItem* _menu_show_status_bar;
Gtk::MenuItem* _menu_fullscreen;
Gtk::MenuItem* _menu_clear;
- Gtk::MenuItem* _menu_destroy_patch;
Gtk::MenuItem* _menu_arrange;
Gtk::MenuItem* _menu_view_engine_window;
Gtk::MenuItem* _menu_view_control_window;
diff --git a/src/gui/ingen_gui.glade b/src/gui/ingen_gui.glade
index 5d249bd4..c94d4e8c 100644
--- a/src/gui/ingen_gui.glade
+++ b/src/gui/ingen_gui.glade
@@ -144,6 +144,21 @@
<child>
<widget class="GtkMenu" id="edit2_menu">
<child>
+ <widget class="GtkCheckMenuItem" id="patch_edit_controls_menuitem">
+ <property name="visible">True</property>
+ <property name="tooltip" translatable="yes">Enable editing of connections and dragging of nodes (disable to manipulate controls)</property>
+ <property name="label" translatable="yes">_Edit connections</property>
+ <property name="use_underline">True</property>
+ <property name="active">True</property>
+ <accelerator key="e" modifiers="" signal="activate"/>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkSeparatorMenuItem" id="menuitem4">
+ <property name="visible">True</property>
+ </widget>
+ </child>
+ <child>
<widget class="GtkImageMenuItem" id="patch_cut_menuitem">
<property name="visible">True</property>
<property name="sensitive">False</property>
@@ -226,22 +241,6 @@
</widget>
</child>
<child>
- <widget class="GtkImageMenuItem" id="patch_destroy_menuitem">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">Destoy this patch (remove it from the engine)</property>
- <property name="label" translatable="yes">_Destroy Patch</property>
- <property name="use_underline">True</property>
- <signal name="activate" handler="on_patch_destroy_menuitem_activate"/>
- <child internal-child="image">
- <widget class="GtkImage" id="image2131">
- <property name="visible">True</property>
- <property name="stock">gtk-delete</property>
- <property name="icon_size">1</property>
- </widget>
- </child>
- </widget>
- </child>
- <child>
<widget class="GtkSeparatorMenuItem" id="menuitem2">
<property name="visible">True</property>
</widget>
@@ -267,7 +266,7 @@
<widget class="GtkImageMenuItem" id="patch_properties_menuitem">
<property name="visible">True</property>
<property name="tooltip" translatable="yes">View/Edit properties for this patch</property>
- <property name="label" translatable="yes">_Properties...</property>
+ <property name="label" translatable="yes">P_roperties...</property>
<property name="use_underline">True</property>
<signal name="activate" handler="on_patch_properties_menuitem_activate"/>
<accelerator key="P" modifiers="GDK_CONTROL_MASK" signal="activate"/>
@@ -1475,7 +1474,7 @@
<child>
<widget class="GtkToggleToolButton" id="patch_view_process_but">
<property name="visible">True</property>
- <property name="tooltip" translatable="yes">Enable DSP processing</property>
+ <property name="tooltip" translatable="yes">Enable patch</property>
<property name="use_underline">True</property>
<property name="stock_id">gtk-execute</property>
<property name="active">True</property>
@@ -1503,10 +1502,12 @@
<child>
<widget class="GtkToolItem" id="toolitem10">
<property name="visible">True</property>
+ <property name="tooltip" translatable="yes">Polyphony</property>
<child>
<widget class="GtkSpinButton" id="patch_view_poly_spin">
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="tooltip" translatable="yes">Patch polyphony</property>
<property name="adjustment">1 1 512 1 10 10</property>
<property name="climb_rate">1</property>
<property name="numeric">True</property>
@@ -1538,18 +1539,9 @@
</packing>
</child>
<child>
- <widget class="GtkSeparatorToolItem" id="separatortoolitem19">
- <property name="visible">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="homogeneous">False</property>
- </packing>
- </child>
- <child>
<widget class="GtkToolButton" id="patch_view_clear_but">
<property name="visible">True</property>
- <property name="tooltip" translatable="yes">Clear (Destroy all children)</property>
+ <property name="tooltip" translatable="yes">Clear patch contents</property>
<property name="use_underline">True</property>
<property name="stock_id">gtk-clear</property>
</widget>
@@ -1558,16 +1550,6 @@
</packing>
</child>
<child>
- <widget class="GtkToolButton" id="patch_view_destroy_but">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">Destroy this patch</property>
- <property name="stock_id">gtk-delete</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- </packing>
- </child>
- <child>
<widget class="GtkSeparatorToolItem" id="separatortoolitem22">
<property name="visible">True</property>
</widget>
@@ -1600,7 +1582,7 @@
<child>
<widget class="GtkToolButton" id="patch_view_zoom_full_but">
<property name="visible">True</property>
- <property name="tooltip" translatable="yes">Fit patch to window</property>
+ <property name="tooltip" translatable="yes">Zoom to contents</property>
<property name="use_underline">True</property>
<property name="stock_id">gtk-zoom-fit</property>
</widget>
@@ -1622,9 +1604,9 @@
<widget class="GtkToggleToolButton" id="patch_view_edit_mode_but">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
- <property name="tooltip" translatable="yes">Enable edit mode to move objects and make connections, disable to play controls ('e' to toggle)</property>
+ <property name="tooltip" translatable="yes">Edit connections</property>
<property name="label" translatable="yes">Edit</property>
- <property name="stock_id">gtk-edit</property>
+ <property name="stock_id">gtk-connect</property>
<property name="active">True</property>
</widget>
<packing>