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 ());
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;
- }
}
}
}
}
- void edit_clicked (GdkEventButton* ev)
- {
+ void edit_clicked (GdkEventButton* ev)
+ {
if (ev->type != GDK_2BUTTON_PRESS) {
return;
}
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<ArdourWindow*>(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
add (enabled);
add (feedback);
add (protocol_info);
- add (editor);
}
TreeModelColumn<string> name;
TreeModelColumn<bool> enabled;
TreeModelColumn<bool> feedback;
TreeModelColumn<ControlProtocolInfo*> protocol_info;
- TreeModelColumn<Gtk::Window*> editor;
};
Glib::RefPtr<ListStore> _store;
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)
));