diff options
author | David Robillard <d@drobilla.net> | 2006-11-19 16:45:16 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2006-11-19 16:45:16 +0000 |
commit | ef6b25432d9c46d71b08c0f7d5f2686df428c4e8 (patch) | |
tree | 9b30d87b6670aadce365c9b112321dd674a0bab4 /gtk2_ardour/redirect_box.cc | |
parent | af105afe6cde5b0088647cea7d5e4e3314f8478b (diff) |
Merged with trunk R1141
git-svn-id: svn://localhost/ardour2/branches/midi@1142 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/redirect_box.cc')
-rw-r--r-- | gtk2_ardour/redirect_box.cc | 63 |
1 files changed, 43 insertions, 20 deletions
diff --git a/gtk2_ardour/redirect_box.cc b/gtk2_ardour/redirect_box.cc index 35b96a410f..f2ee2a5b8f 100644 --- a/gtk2_ardour/redirect_box.cc +++ b/gtk2_ardour/redirect_box.cc @@ -923,7 +923,7 @@ RedirectBox::edit_redirect (boost::shared_ptr<Redirect> redirect) if ((insert = boost::dynamic_pointer_cast<Insert> (redirect)) == 0) { - /* its a send */ + /* it's a send */ if (!_session.engine().connected()) { return; @@ -967,30 +967,21 @@ RedirectBox::edit_redirect (boost::shared_ptr<Redirect> redirect) PluginUIWindow *plugin_ui; if (plugin_insert->get_gui() == 0) { - - string title; - string maker = plugin_insert->plugin()->maker(); - string::size_type email_pos; - - if ((email_pos = maker.find_first_of ('<')) != string::npos) { - maker = maker.substr (0, email_pos - 1); - } - - if (maker.length() > 32) { - maker = maker.substr (0, 32); - maker += " ..."; - } - - title = string_compose(_("ardour: %1: %2 (by %3)"), _route->name(), plugin_insert->name(), maker); - + plugin_ui = new PluginUIWindow (plugin_insert); + if (_owner_is_mixer) { ARDOUR_UI::instance()->the_mixer()->ensure_float (*plugin_ui); } else { ARDOUR_UI::instance()->the_editor().ensure_float (*plugin_ui); } - plugin_ui->set_title (title); + + plugin_ui->set_title (generate_redirect_title (plugin_insert)); plugin_insert->set_gui (plugin_ui); + + // change window title when route name is changed + _route->name_changed.connect (bind (mem_fun(*this, &RedirectBox::route_name_changed), plugin_ui, plugin_insert)); + } else { plugin_ui = reinterpret_cast<PluginUIWindow *> (plugin_insert->get_gui()); @@ -1069,8 +1060,12 @@ RedirectBox::register_actions () /* new stuff */ ActionManager::register_action (popup_act_grp, X_("newplugin"), _("New Plugin ..."), sigc::ptr_fun (RedirectBox::rb_choose_plugin)); - ActionManager::register_action (popup_act_grp, X_("newinsert"), _("New Insert"), sigc::ptr_fun (RedirectBox::rb_choose_insert)); - ActionManager::register_action (popup_act_grp, X_("newsend"), _("New Send ..."), sigc::ptr_fun (RedirectBox::rb_choose_send)); + + act = ActionManager::register_action (popup_act_grp, X_("newinsert"), _("New Insert"), sigc::ptr_fun (RedirectBox::rb_choose_insert)); + ActionManager::jack_sensitive_actions.push_back (act); + act = ActionManager::register_action (popup_act_grp, X_("newsend"), _("New Send ..."), sigc::ptr_fun (RedirectBox::rb_choose_send)); + ActionManager::jack_sensitive_actions.push_back (act); + ActionManager::register_action (popup_act_grp, X_("clear"), _("Clear"), sigc::ptr_fun (RedirectBox::rb_clear)); /* standard editing stuff */ @@ -1097,6 +1092,8 @@ RedirectBox::register_actions () ActionManager::plugin_selection_sensitive_actions.push_back(act); ActionManager::add_action_group (popup_act_grp); + + } void @@ -1242,3 +1239,29 @@ RedirectBox::rb_edit () _current_redirect_box->for_selected_redirects (&RedirectBox::edit_redirect); } +void +RedirectBox::route_name_changed (void* src, PluginUIWindow* plugin_ui, boost::shared_ptr<PluginInsert> pi) +{ + ENSURE_GUI_THREAD(bind (mem_fun (*this, &RedirectBox::route_name_changed), src, plugin_ui, pi)); + + plugin_ui->set_title (generate_redirect_title (pi)); +} + +string +RedirectBox::generate_redirect_title (boost::shared_ptr<PluginInsert> pi) +{ + string maker = pi->plugin()->maker(); + string::size_type email_pos; + + if ((email_pos = maker.find_first_of ('<')) != string::npos) { + maker = maker.substr (0, email_pos - 1); + } + + if (maker.length() > 32) { + maker = maker.substr (0, 32); + maker += " ..."; + } + + return string_compose(_("ardour: %1: %2 (by %3)"), _route->name(), pi->name(), maker); +} + |