}
void
-RouteParams_UI::add_route (boost::shared_ptr<Route> route)
+RouteParams_UI::add_routes (Session::RouteList& routes)
{
- ENSURE_GUI_THREAD(bind (mem_fun(*this, &RouteParams_UI::add_route), route));
+ ENSURE_GUI_THREAD(bind (mem_fun(*this, &RouteParams_UI::add_routes), routes));
- if (route->hidden()) {
- return;
- }
-
- TreeModel::Row row = *(route_display_model->append());
- row[route_display_columns.text] = route->name();
- row[route_display_columns.route] = route;
+ for (Session::RouteList::iterator x = routes.begin(); x != routes.end(); ++x) {
+ boost::shared_ptr<Route> route = (*x);
- //route_select_list.rows().back().select ();
-
- route->name_changed.connect (bind (mem_fun(*this, &RouteParams_UI::route_name_changed), route));
- route->GoingAway.connect (bind (mem_fun(*this, &RouteParams_UI::route_removed), route));
+ if (route->hidden()) {
+ return;
+ }
+
+ TreeModel::Row row = *(route_display_model->append());
+ row[route_display_columns.text] = route->name();
+ row[route_display_columns.route] = route;
+
+ //route_select_list.rows().back().select ();
+
+ route->name_changed.connect (bind (mem_fun(*this, &RouteParams_UI::route_name_changed), route));
+ route->GoingAway.connect (bind (mem_fun(*this, &RouteParams_UI::route_removed), route));
+ }
}
route_display_model->clear();
if (session) {
- session->foreach_route (this, &RouteParams_UI::add_route);
- session->going_away.connect (mem_fun(*this, &ArdourDialog::session_gone));
- session->RouteAdded.connect (mem_fun(*this, &RouteParams_UI::add_route));
+ boost::shared_ptr<Session::RouteList> r = session->get_routes();
+ add_routes (*r);
+ session->GoingAway.connect (mem_fun(*this, &ArdourDialog::session_gone));
+ session->RouteAdded.connect (mem_fun(*this, &RouteParams_UI::add_routes));
start_updating ();
} else {
stop_updating ();
(MenuElem (_("Add Track/Bus"),
mem_fun (*(ARDOUR_UI::instance()), &ARDOUR_UI::add_route)));
}
- track_menu->popup (1, 0);
+ track_menu->popup (1, gtk_get_current_event_time());
}
if (place == PreFader) {
cleanup_pre_view();
- _pre_plugin_conn = send->GoingAway.connect (mem_fun(*this, &RouteParams_UI::redirect_going_away));
+ _pre_plugin_conn = send->GoingAway.connect (bind (mem_fun(*this, &RouteParams_UI::redirect_going_away), redirect));
_active_pre_view = send_ui;
pre_redir_hpane.add2 (*_active_pre_view);
}
else {
cleanup_post_view();
- _post_plugin_conn = send->GoingAway.connect (mem_fun(*this, &RouteParams_UI::redirect_going_away));
+ _post_plugin_conn = send->GoingAway.connect (bind (mem_fun(*this, &RouteParams_UI::redirect_going_away), redirect));
_active_post_view = send_ui;
post_redir_hpane.add2 (*_active_post_view);
if ((plugin_insert = boost::dynamic_pointer_cast<PluginInsert> (insert)) != 0) {
- LadspaPluginUI *plugin_ui = new LadspaPluginUI (session->engine(), plugin_insert, true);
+ LadspaPluginUI *plugin_ui = new LadspaPluginUI (plugin_insert, true);
if (place == PreFader) {
cleanup_pre_view();
if (place == PreFader) {
cleanup_pre_view();
- _pre_plugin_conn = port_insert->GoingAway.connect (mem_fun(*this, &RouteParams_UI::redirect_going_away));
+ _pre_plugin_conn = port_insert->GoingAway.connect (bind (mem_fun(*this, &RouteParams_UI::redirect_going_away), redirect));
_active_pre_view = portinsert_ui;
pre_redir_hpane.pack2 (*_active_pre_view);
portinsert_ui->redisplay();
}
else {
cleanup_post_view();
- _post_plugin_conn = port_insert->GoingAway.connect (mem_fun(*this, &RouteParams_UI::redirect_going_away));
+ _post_plugin_conn = port_insert->GoingAway.connect (bind (mem_fun(*this, &RouteParams_UI::redirect_going_away), redirect));
_active_post_view = portinsert_ui;
post_redir_hpane.pack2 (*_active_post_view);
portinsert_ui->redisplay();
}
void
-RouteParams_UI::plugin_going_away (Plugin *plugin, Placement place)
+RouteParams_UI::plugin_going_away (Placement place)
{
- ENSURE_GUI_THREAD(bind (mem_fun(*this, &RouteParams_UI::plugin_going_away), plugin, place));
+ ENSURE_GUI_THREAD(bind (mem_fun(*this, &RouteParams_UI::plugin_going_away), place));
// delete the current view without calling finish
}
void
-RouteParams_UI::redirect_going_away (ARDOUR::Redirect *plugin)
+RouteParams_UI::redirect_going_away (boost::shared_ptr<ARDOUR::Redirect> redirect)
{
- ENSURE_GUI_THREAD(bind (mem_fun(*this, &RouteParams_UI::redirect_going_away), plugin));
+ ENSURE_GUI_THREAD(bind (mem_fun(*this, &RouteParams_UI::redirect_going_away), redirect));
printf ("redirect going away\n");
// delete the current view without calling finish
- if (plugin == _pre_redirect.get()) {
+ if (redirect == _pre_redirect) {
cleanup_pre_view (false);
_pre_redirect.reset ((Redirect*) 0);
- }
- else if (plugin == _post_redirect.get()) {
+ } else if (redirect == _post_redirect) {
cleanup_post_view (false);
_post_redirect.reset ((Redirect*) 0);
}