X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Frc_option_editor.cc;h=a4d2b5dee2325c9052eb3ec604eb816c0c5569fd;hb=3ddd797e46b232235deb8d79c34b40f35bb2153b;hp=a6e3ab4d3bf661d103a95a9b4a4276e85579e8e5;hpb=390c4806392151849b3ced677277279c616aad2d;p=ardour.git diff --git a/gtk2_ardour/rc_option_editor.cc b/gtk2_ardour/rc_option_editor.cc index a6e3ab4d3b..a4d2b5dee2 100644 --- a/gtk2_ardour/rc_option_editor.cc +++ b/gtk2_ardour/rc_option_editor.cc @@ -583,7 +583,7 @@ class ClipLevelOptions : public OptionEditorBox public: ClipLevelOptions (RCConfiguration* c) : _rc_config (c) - , _clip_level_adjustment (0, -128.0, 2.0, 0.1, 1.0) /* units of dB */ + , _clip_level_adjustment (-.5, -50.0, 0.0, 0.1, 1.0) /* units of dB */ , _clip_level_slider (_clip_level_adjustment) { _clip_level_adjustment.set_value (_rc_config->get_waveform_clip_level ()); @@ -795,17 +795,7 @@ private: if (!was_enabled) { ControlProtocolManager::instance().activate (*cpi); } else { - Gtk::Window* win = r[_model.editor]; - if (win) { - win->hide (); - } - ControlProtocolManager::instance().deactivate (*cpi); - - if (win) { - delete win; - r[_model.editor] = 0; - } } } @@ -817,8 +807,8 @@ private: } } - void edit_clicked (GdkEventButton* ev) - { + void edit_clicked (GdkEventButton* ev) + { if (ev->type != GDK_2BUTTON_PRESS) { return; } @@ -828,26 +818,32 @@ private: TreeModel::Row row; row = *(_view.get_selection()->get_selected()); - - Window* win = row[_model.editor]; - if (win && !win->is_visible()) { - win->present (); - } else { - cpi = row[_model.protocol_info]; - - if (cpi && cpi->protocol && cpi->protocol->has_editor ()) { - Box* box = (Box*) cpi->protocol->get_gui (); - if (box) { - string title = row[_model.name]; - ArdourWindow* win = new ArdourWindow (_parent, title); - win->set_title ("Control Protocol Options"); - win->add (*box); - box->show (); - win->present (); - row[_model.editor] = win; - } - } + if (!row[_model.enabled]) { + return; + } + cpi = row[_model.protocol_info]; + if (!cpi || !cpi->protocol || !cpi->protocol->has_editor ()) { + return; + } + Box* box = (Box*) cpi->protocol->get_gui (); + if (!box) { + return; + } + if (box->get_parent()) { + static_cast(box->get_parent())->present(); + return; } + string title = row[_model.name]; + /* once created, the window is managed by the surface itself (as ->get_parent()) + * Surface's tear_down_gui() is called on session close, when de-activating + * or re-initializing a surface. + * tear_down_gui() hides an deletes the Window if it exists. + */ + ArdourWindow* win = new ArdourWindow (_parent, title); + win->set_title ("Control Protocol Options"); + win->add (*box); + box->show (); + win->present (); } class ControlSurfacesModelColumns : public TreeModelColumnRecord @@ -860,14 +856,12 @@ private: add (enabled); add (feedback); add (protocol_info); - add (editor); } TreeModelColumn name; TreeModelColumn enabled; TreeModelColumn feedback; TreeModelColumn protocol_info; - TreeModelColumn editor; }; Glib::RefPtr _store; @@ -2172,7 +2166,7 @@ RCOptionEditor::RCOptionEditor () add_option (S_("GUI"), new BoolOption ( "super-rapid-clock-update", - _("update transport clock display every 40ms instead of every 100ms"), + _("update transport clock display at FPS instead of every 100ms"), sigc::mem_fun (*_rc_config, &RCConfiguration::get_super_rapid_clock_update), sigc::mem_fun (*_rc_config, &RCConfiguration::set_super_rapid_clock_update) ));