From bb8bf97474863c14e6f22bdbeb4d77990e830e1d Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 22 Nov 2008 09:12:58 +0000 Subject: Add option to hide port labels. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@1767 a436a847-0d15-0410-975c-d299462d15a1 --- src/gui/Configuration.cpp | 5 +- src/gui/Configuration.hpp | 4 +- src/gui/NodeModule.cpp | 2 +- src/gui/PatchCanvas.cpp | 13 + src/gui/PatchCanvas.hpp | 7 +- src/gui/PatchWindow.cpp | 18 + src/gui/PatchWindow.hpp | 2 + src/gui/ingen_gui.glade | 1004 +++++++++++++++++++++++---------------------- 8 files changed, 545 insertions(+), 510 deletions(-) diff --git a/src/gui/Configuration.cpp b/src/gui/Configuration.cpp index 758dc744..381d17fb 100644 --- a/src/gui/Configuration.cpp +++ b/src/gui/Configuration.cpp @@ -40,7 +40,6 @@ Configuration::Configuration() , _audio_port_color( 0x244678C0) , _control_port_color(0x4A8A0EC0) , _event_port_color( 0x960909C0) -// , _midi_port_color( 0x960909C0) // , _osc_port_color( 0x5C3566C0) { } @@ -92,9 +91,7 @@ Configuration::get_port_color(const PortModel* p) return _audio_port_color; } else if (p->type().is_event()) { return _event_port_color; - }/* else if (p->type().is_midi()) { - return _midi_port_color; - } else if (p->type().is_osc()) { + } /*else if (p->type().is_osc()) { return _osc_port_color; }*/ diff --git a/src/gui/Configuration.hpp b/src/gui/Configuration.hpp index 124b41c8..6ce66776 100644 --- a/src/gui/Configuration.hpp +++ b/src/gui/Configuration.hpp @@ -53,7 +53,7 @@ public: uint32_t get_port_color(const PortModel* pi); - enum NameStyle { PATH, HUMAN }; + enum NameStyle { PATH, HUMAN, NONE }; NameStyle name_style() const { return _name_style; } void set_name_style(NameStyle s) { _name_style = s; } @@ -67,8 +67,6 @@ private: uint32_t _audio_port_color; uint32_t _control_port_color; uint32_t _event_port_color; - //uint32_t _midi_port_color; - //uint32_t _osc_port_color; }; diff --git a/src/gui/NodeModule.cpp b/src/gui/NodeModule.cpp index 512bdebb..c80137de 100644 --- a/src/gui/NodeModule.cpp +++ b/src/gui/NodeModule.cpp @@ -136,7 +136,7 @@ NodeModule::show_human_names(bool b) resize(); } - + void NodeModule::value_changed(uint32_t index, const Atom& value) { diff --git a/src/gui/PatchCanvas.cpp b/src/gui/PatchCanvas.cpp index c2cef4c8..41794c74 100644 --- a/src/gui/PatchCanvas.cpp +++ b/src/gui/PatchCanvas.cpp @@ -60,6 +60,7 @@ PatchCanvas::PatchCanvas(SharedPtr patch, int width, int height) , _last_click_y(0) , _refresh_menu(false) , _human_names(true) + , _show_port_names(true) , _menu(NULL) , _internal_menu(NULL) , _classless_menu(NULL) @@ -285,6 +286,18 @@ PatchCanvas::show_human_names(bool b) } } + +void +PatchCanvas::show_port_names(bool b) +{ + _show_port_names = b; + for (ItemList::iterator m = _items.begin(); m != _items.end(); ++m) { + boost::shared_ptr mod = boost::dynamic_pointer_cast(*m); + if (mod) + mod->show_port_labels(b); + } +} + void PatchCanvas::add_plugin(SharedPtr p) diff --git a/src/gui/PatchCanvas.hpp b/src/gui/PatchCanvas.hpp index 5896957e..127b5bd3 100644 --- a/src/gui/PatchCanvas.hpp +++ b/src/gui/PatchCanvas.hpp @@ -59,14 +59,10 @@ public: virtual ~PatchCanvas() {} - /*boost::shared_ptr find_module(const string& name) { - return boost::dynamic_pointer_cast( - Canvas::get_item(name)); - }*/ - void build(); void arrange(bool use_length_hints); void show_human_names(bool show); + void show_port_names(bool show); void add_plugin(SharedPtr pm); void add_node(SharedPtr nm); @@ -137,6 +133,7 @@ private: bool _refresh_menu; bool _human_names; + bool _show_port_names; Gtk::Menu* _menu; Gtk::Menu* _internal_menu; Gtk::Menu* _classless_menu; diff --git a/src/gui/PatchWindow.cpp b/src/gui/PatchWindow.cpp index 13413b5c..fbc85d34 100644 --- a/src/gui/PatchWindow.cpp +++ b/src/gui/PatchWindow.cpp @@ -75,6 +75,7 @@ PatchWindow::PatchWindow(BaseObjectType* cobject, const Glib::RefPtrget_widget("patch_properties_menuitem", _menu_view_patch_properties); xml->get_widget("patch_fullscreen_menuitem", _menu_fullscreen); xml->get_widget("patch_human_names_menuitem", _menu_human_names); + xml->get_widget("patch_show_port_names_menuitem", _menu_show_port_names); 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); @@ -112,6 +113,8 @@ PatchWindow::PatchWindow(BaseObjectType* cobject, const Glib::RefPtrsignal_activate().connect( sigc::mem_fun(this, &PatchWindow::event_human_names_toggled)); + _menu_show_port_names->signal_activate().connect( + sigc::mem_fun(this, &PatchWindow::event_port_names_toggled)); _menu_arrange->signal_activate().connect( sigc::mem_fun(this, &PatchWindow::event_arrange)); _menu_view_engine_window->signal_activate().connect( @@ -546,5 +549,20 @@ PatchWindow::event_human_names_toggled() } +void +PatchWindow::event_port_names_toggled() +{ + _view->canvas()->show_port_names(_menu_show_port_names->get_active()); + if (_menu_show_port_names->get_active()) { + App::instance().configuration()->set_name_style(Configuration::NONE); + } else { + if (_menu_human_names->get_active()) + App::instance().configuration()->set_name_style(Configuration::HUMAN); + else + App::instance().configuration()->set_name_style(Configuration::PATH); + } +} + + } // namespace GUI } // namespace Ingen diff --git a/src/gui/PatchWindow.hpp b/src/gui/PatchWindow.hpp index 3673e1a8..62adf4c8 100644 --- a/src/gui/PatchWindow.hpp +++ b/src/gui/PatchWindow.hpp @@ -97,6 +97,7 @@ private: void event_clear(); void event_fullscreen_toggled(); void event_human_names_toggled(); + void event_port_names_toggled(); void event_arrange(); void event_show_properties(); void event_show_controls(); @@ -127,6 +128,7 @@ private: Gtk::MenuItem* _menu_close; Gtk::MenuItem* _menu_quit; Gtk::CheckMenuItem* _menu_human_names; + Gtk::CheckMenuItem* _menu_show_port_names; Gtk::MenuItem* _menu_fullscreen; Gtk::MenuItem* _menu_clear; Gtk::MenuItem* _menu_destroy_patch; diff --git a/src/gui/ingen_gui.glade b/src/gui/ingen_gui.glade index 6f9eca6e..9328893b 100644 --- a/src/gui/ingen_gui.glade +++ b/src/gui/ingen_gui.glade @@ -311,6 +311,16 @@ + + + True + Show labels on ports + Port _Names + True + True + + + @@ -497,62 +507,53 @@ 3 12 - + True - True - Clear filter text (show all plugins) - gtk-clear - True - 0 + 1 + Node Name: + True - 2 - 3 + 2 + 3 GTK_FILL - + True - Name contains: + 1 + 2 + 1 + 2 GTK_FILL - - + True - True - True - Search string to filter plugin list - * - 1 - 2 - 6 + 1 + 2 + GTK_FILL + GTK_FILL - + True - False - True - Add selected plugin to patch - gtk-add - True - 0 2 3 - 2 - 3 + 1 + 2 GTK_FILL - + GTK_FILL @@ -595,51 +596,60 @@ - + True + False + True + Add selected plugin to patch + gtk-add + True + 0 2 3 - 1 - 2 + 2 + 3 GTK_FILL - GTK_FILL + - + True + True + True + Search string to filter plugin list + * - 1 - 2 - GTK_FILL - GTK_FILL + 1 + 2 + 6 - + True + Name contains: - 1 - 2 - 1 - 2 GTK_FILL + - + True - 1 - Node Name: - True + True + Clear filter text (show all plugins) + gtk-clear + True + 0 - 2 - 3 + 2 + 3 GTK_FILL @@ -671,61 +681,61 @@ 2 2 - + True - True - True - * - True + 0 + Name: - 1 - 2 - - 4 + GTK_FILL + GTK_EXPAND + 5 - + True - True - 1 0 100 1 10 10 - 1 + 0 + Polyphony: - 1 - 2 1 2 GTK_FILL - - 4 + GTK_EXPAND + 5 - + True - 0 - Polyphony: + True + 1 0 100 1 10 10 + 1 + 1 + 2 1 2 GTK_FILL - GTK_EXPAND - 5 + + 4 - + True - 0 - Name: + True + True + * + True - GTK_FILL - GTK_EXPAND - 5 + 1 + 2 + + 4 @@ -827,71 +837,63 @@ 12 4 - + True - - - True - True - Specify the name for the new patch - Specify: - True - 0 - True - load_subpatch_name_from_file_radio - - - False - False - - - - - True - False - True - Specify the name for the new patch - * - True - - - False - 1 - - + 0 + <b>Name: </b> + True - 3 - 4 - GTK_FILL + GTK_FILL + - + True 0 + <b>Polyphony: </b> + True - 2 - 3 + 1 + 2 GTK_FILL - + True True - Set polyphony to the same value as the parent (containing) patch - Same as parent (?) + Use the name stored in the patch file + Load from file True 0 + True True - load_subpatch_poly_from_file_radio - 2 - 3 + 1 + 2 + GTK_FILL + + + + + + True + True + Use the polyphony value stored in the patch file + Load from file + True + 0 + True + True + + + 1 + 2 1 2 GTK_FILL @@ -942,19 +944,19 @@ - + True True - Use the polyphony value stored in the patch file - Load from file + Set polyphony to the same value as the parent (containing) patch + Same as parent (?) True 0 - True True + load_subpatch_poly_from_file_radio - 1 - 2 + 2 + 3 1 2 GTK_FILL @@ -962,47 +964,55 @@ - - True - True - Use the name stored in the patch file - Load from file - True - 0 - True - True - - - 1 - 2 - GTK_FILL - - - - - + True 0 - <b>Polyphony: </b> - True - 1 - 2 + 2 + 3 GTK_FILL - + True - 0 - <b>Name: </b> - True + + + True + True + Specify the name for the new patch + Specify: + True + 0 + True + load_subpatch_name_from_file_radio + + + False + False + + + + + True + False + True + Specify the name for the new patch + * + True + + + False + 1 + + - GTK_FILL - + 3 + 4 + GTK_FILL @@ -1063,6 +1073,54 @@ 4 12 4 + + + True + 0 + <b>Polyphony: </b> + True + + + GTK_FILL + + + + + + True + True + Use the same polyphony as the current patch + Keep current + True + 0 + True + True + + + 1 + 2 + GTK_FILL + + + + + + True + True + Use the polyphony value stored in the patch file + Load from file + True + 0 + True + load_patch_poly_from_current_radio + + + 2 + 3 + GTK_FILL + + + True @@ -1103,54 +1161,6 @@ GTK_FILL - - - True - True - Use the polyphony value stored in the patch file - Load from file - True - 0 - True - load_patch_poly_from_current_radio - - - 2 - 3 - GTK_FILL - - - - - - True - True - Use the same polyphony as the current patch - Keep current - True - 0 - True - True - - - 1 - 2 - GTK_FILL - - - - - - True - 0 - <b>Polyphony: </b> - True - - - GTK_FILL - - - False @@ -1217,15 +1227,15 @@ - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - + True 0 1 @@ -1240,7 +1250,7 @@ - + True 1 0 @@ -1248,66 +1258,137 @@ 1 4 - + + True + + + + + 1 + + + + + True + True + 0 + True + + + False + 2 + + + + + False + False + + + + + 4 + 5 + 8 + + + + + True + + + True + 0 + + + True + True + GTK_POLICY_NEVER + GTK_POLICY_AUTOMATIC + + True + GTK_SHADOW_NONE + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + + + + + + + + True + True + + + True + True + Apply changed controls to all voices + All Voices + True + 0 + True + - 1 + False + False - + True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 12 - 0 -9.9999999999999999e+45 1.0000000000000001e+63 1 10 10 - 4 - True + 5 + + + True + True + Apply changed controls to one voice only + Specific Voice: + True + 0 + True + control_panel_all_voices_radio + + + False + False + + + + + True + False + True + Voice control changes are applied to + 1 1 100 1 10 10 + 1 + True + + + 1 + + False - 2 + False + 1 False - False - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 9.0923076923076922e+136 -1e+113 1e+137 0 0 0 - 63 - False - - - False + 5 1 - - 3 - 4 - 8 - - - - - True - - - 1 - 2 - GTK_FILL - @@ -1570,113 +1651,25 @@ - + True - - - True - 0 - - - True - True - GTK_POLICY_NEVER - GTK_POLICY_AUTOMATIC - - - True - GTK_SHADOW_NONE - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - - - - - - - - - True - True - - - True - True - Apply changed controls to all voices - All Voices - True - 0 - True - - - False - False - - - - - True - 5 - - - True - True - Apply changed controls to one voice only - Specific Voice: - True - 0 - True - control_panel_all_voices_radio - - - False - False - - - - - True - False - True - Voice control changes are applied to - 1 1 100 1 10 10 - 1 - True - - - 1 - - - - - False - False - 1 - - - - - False - 5 - 1 - - + + 1 + 2 + GTK_FILL + - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - + True 0 1 @@ -1691,7 +1684,7 @@ - + True 1 0 @@ -1699,7 +1692,7 @@ 1 4 - + True @@ -1709,11 +1702,14 @@ - + True True - 0 - True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 12 + 0 -9.9999999999999999e+45 1.0000000000000001e+63 1 10 10 + 4 + True False @@ -1726,10 +1722,24 @@ False + + + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 9.0923076923076922e+136 -1e+113 1e+137 0 0 0 + 63 + False + + + False + 1 + + - 4 - 5 + 3 + 4 8 @@ -1821,51 +1831,51 @@ 2 2 - + True - 0 + <b>Patch Search Path: </b> + True - 1 - 2 GTK_FILL - + True - <i>Example: /foo/bar:/home/john/patches:/usr/share/om/patches</i> - True + True + * 1 2 - 1 - 2 - GTK_FILL - + True - True - * + <i>Example: /foo/bar:/home/john/patches:/usr/share/om/patches</i> + True 1 2 + 1 + 2 + GTK_FILL - + True - <b>Patch Search Path: </b> - True + 0 + 1 + 2 GTK_FILL @@ -1943,18 +1953,16 @@ 8 8 - + True - Author: + Name: - 1 - 2 GTK_FILL - + True True * @@ -1962,12 +1970,10 @@ 1 2 - 1 - 2 - + True True * @@ -1975,14 +1981,18 @@ 1 2 + 1 + 2 - + True - Name: + Author: + 1 + 2 GTK_FILL @@ -2268,7 +2278,7 @@ 10 6 - + True 0 - @@ -2276,34 +2286,28 @@ 1 2 - 2 - 3 GTK_FILL - + True 0 - Name: + Type: - 2 - 3 GTK_FILL - + True 0 - - + URI: - 1 - 2 1 2 GTK_FILL @@ -2311,12 +2315,14 @@ - + True 0 - URI: + - + 1 + 2 1 2 GTK_FILL @@ -2324,18 +2330,20 @@ - + True 0 - Type: + Name: + 2 + 3 GTK_FILL - + True 0 - @@ -2343,6 +2351,8 @@ 1 2 + 2 + 3 GTK_FILL @@ -2495,33 +2505,64 @@ Contributors: 2 8 - + True - 0 + + + True + False + True + 16180 1 65535 1 10 10 + 1 + True + + + False + False + + + + + 1 + 2 + 1 + 2 + GTK_FILL + 8 + + + + + True + + + True + True + * + True + 28 + osc.udp://localhost:16180 + + 1 2 - 2 - 3 GTK_FILL - + GTK_FILL + 8 - + True - False True - Use internal engine + Connect to running server at: True 0 True - connect_server_radiobutton - 2 - 3 GTK_FILL @@ -2544,66 +2585,35 @@ Contributors: - + True + False True - Connect to running server at: + Use internal engine True 0 True + connect_server_radiobutton + 2 + 3 GTK_FILL - + True - - - True - True - * - True - 28 - osc.udp://localhost:16180 - - + 0 1 2 + 2 + 3 GTK_FILL - GTK_FILL - 8 - - - - - True - - - True - False - True - 16180 1 65535 1 10 10 - 1 - True - - - False - False - - - - - 1 - 2 - 1 - 2 - GTK_FILL - 8 + @@ -2926,26 +2936,19 @@ Contributors: 2 8 - - True - 0 - Short Name: - - - 1 - 2 - GTK_FILL - - - - - + True - 0 - Symbol: + True + Enter a short name suitable for use as an identifier or filename. + +The first character must be one of _, a-z or A-Z and subsequenct characters can be from _, a-z, A-Z or 0-9. + + * + True - GTK_FILL + 1 + 2 @@ -2966,19 +2969,26 @@ Contributors: - + True - True - Enter a short name suitable for use as an identifier or filename. - -The first character must be one of _, a-z or A-Z and subsequenct characters can be from _, a-z, A-Z or 0-9. - - * - True + 0 + Symbol: - 1 - 2 + GTK_FILL + + + + + + True + 0 + Short Name: + + + 1 + 2 + GTK_FILL @@ -3121,26 +3131,17 @@ Thank you for contributing. 2 4 - - True - 0 - Maximum Value: - - - 1 - 2 - GTK_FILL - - - - - + True - 0 - Minimum Value: + True + 0 -100000000 100000000 1 10 10 + 1 + 5 + True - GTK_FILL + 1 + 2 @@ -3162,17 +3163,26 @@ Thank you for contributing. - + True - True - 0 -100000000 100000000 1 10 10 - 1 - 5 - True + 0 + Minimum Value: - 1 - 2 + GTK_FILL + + + + + + True + 0 + Maximum Value: + + + 1 + 2 + GTK_FILL -- cgit v1.2.1