X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=gtk2_ardour%2Froute_params_ui.cc;h=be5b6663f024288fb774d67fef0e966e521e52e8;hb=f77f54a6e29feea04d5aa15969e73df84e020875;hp=cafda5ab9bb349badec8c46a6b8c709334ef1951;hpb=c66955386ecfb86b3dd2b137a8e6e4143711f329;p=ardour.git diff --git a/gtk2_ardour/route_params_ui.cc b/gtk2_ardour/route_params_ui.cc index cafda5ab9b..be5b6663f0 100644 --- a/gtk2_ardour/route_params_ui.cc +++ b/gtk2_ardour/route_params_ui.cc @@ -20,11 +20,10 @@ #include #include -#include +#include #include #include -#include "ardour/ardour.h" #include "ardour/audioengine.h" #include "ardour/audio_track.h" #include "ardour/plugin.h" @@ -34,9 +33,7 @@ #include "ardour/return.h" #include "ardour/route.h" #include "ardour/send.h" -#include "ardour/session.h" -#include "ardour/session.h" -#include "ardour/session_route.h" +#include "ardour/internal_send.h" #include "ardour_ui.h" #include "gui_thread.h" @@ -49,7 +46,6 @@ #include "return_ui.h" #include "route_params_ui.h" #include "send_ui.h" -#include "utils.h" #include "i18n.h" @@ -59,7 +55,7 @@ using namespace Gtk; using namespace Gtkmm2ext; RouteParams_UI::RouteParams_UI () - : ArdourDialog (_("Tracks and Busses")), + : ArdourWindow (_("Tracks and Busses")), latency_apply_button (Stock::APPLY), track_menu(0) { @@ -137,7 +133,7 @@ RouteParams_UI::RouteParams_UI () //global_vpacker.pack_start (list_hpane, true, true); //get_vbox()->pack_start (global_vpacker); - get_vbox()->pack_start (list_hpane); + add (list_hpane); set_name ("RouteParamsWindow"); @@ -151,11 +147,7 @@ RouteParams_UI::RouteParams_UI () add_events (Gdk::KEY_PRESS_MASK|Gdk::KEY_RELEASE_MASK|Gdk::BUTTON_RELEASE_MASK); _plugin_selector = new PluginSelector (PluginManager::instance()); - _plugin_selector->signal_delete_event().connect (sigc::bind (ptr_fun (just_hide_it), - static_cast (_plugin_selector))); - - - signal_delete_event().connect(sigc::bind(ptr_fun(just_hide_it), static_cast(this))); + show_all(); } RouteParams_UI::~RouteParams_UI () @@ -170,7 +162,7 @@ RouteParams_UI::add_routes (RouteList& routes) for (RouteList::iterator x = routes.begin(); x != routes.end(); ++x) { boost::shared_ptr route = (*x); - if (route->is_hidden()) { + if (route->is_auditioner()) { return; } @@ -180,7 +172,7 @@ RouteParams_UI::add_routes (RouteList& routes) //route_select_list.rows().back().select (); - route->PropertyChanged.connect (*this, invalidator (*this), ui_bind (&RouteParams_UI::route_property_changed, this, _1, boost::weak_ptr(route)), gui_context()); + route->PropertyChanged.connect (*this, invalidator (*this), boost::bind (&RouteParams_UI::route_property_changed, this, _1, boost::weak_ptr(route)), gui_context()); route->DropReferences.connect (*this, invalidator (*this), boost::bind (&RouteParams_UI::route_removed, this, boost::weak_ptr(route)), gui_context()); } } @@ -222,6 +214,25 @@ RouteParams_UI::route_property_changed (const PropertyChange& what_changed, boos } } +void +RouteParams_UI::map_frozen() +{ + ENSURE_GUI_THREAD (*this, &RouteParams_UI::map_frozen) + boost::shared_ptr at = boost::dynamic_pointer_cast(_route); + if (at && insert_box) { + switch (at->freeze_state()) { + case AudioTrack::Frozen: + insert_box->set_sensitive (false); + //hide_redirect_editors (); // TODO hide editor windows + break; + default: + insert_box->set_sensitive (true); + // XXX need some way, maybe, to retoggle redirect editors + break; + } + } +} + void RouteParams_UI::setup_processor_boxes() { @@ -234,9 +245,13 @@ RouteParams_UI::setup_processor_boxes() insert_box = new ProcessorBox (_session, boost::bind (&RouteParams_UI::plugin_selector, this), _rr_selection, 0); insert_box->set_route (_route); + boost::shared_ptr at = boost::dynamic_pointer_cast(_route); + if (at) { + at->FreezeChange.connect (route_connections, invalidator (*this), boost::bind (&RouteParams_UI::map_frozen, this), gui_context()); + } redir_hpane.pack1 (*insert_box); - insert_box->ProcessorSelected.connect (sigc::mem_fun(*this, &RouteParams_UI::redirect_selected)); + insert_box->ProcessorSelected.connect (sigc::mem_fun(*this, &RouteParams_UI::redirect_selected)); //note: this indicates a double-click activation, not just a "selection" insert_box->ProcessorUnselected.connect (sigc::mem_fun(*this, &RouteParams_UI::redirect_selected)); redir_hpane.show_all(); @@ -285,7 +300,7 @@ RouteParams_UI::cleanup_latency_frame () void RouteParams_UI::setup_latency_frame () { - latency_widget = new LatencyGUI (*(_route->output()), _session->frame_rate(), _session->engine().frames_per_cycle()); + latency_widget = new LatencyGUI (*(_route->output()), _session->frame_rate(), AudioEngine::instance()->samples_per_cycle()); char buf[128]; snprintf (buf, sizeof (buf), _("Playback delay: %" PRId64 " samples"), _route->initial_delay()); @@ -394,7 +409,7 @@ RouteParams_UI::route_removed (boost::weak_ptr wr) void RouteParams_UI::set_session (Session *sess) { - ArdourDialog::set_session (sess); + ArdourWindow::set_session (sess); route_display_model->clear(); _plugin_selector->set_session (_session); @@ -402,7 +417,7 @@ RouteParams_UI::set_session (Session *sess) if (_session) { boost::shared_ptr r = _session->get_routes(); add_routes (*r); - _session->RouteAdded.connect (_session_connections, invalidator (*this), ui_bind (&RouteParams_UI::add_routes, this, _1), gui_context()); + _session->RouteAdded.connect (_session_connections, invalidator (*this), boost::bind (&RouteParams_UI::add_routes, this, _1), gui_context()); start_updating (); } else { stop_updating (); @@ -461,7 +476,7 @@ RouteParams_UI::route_selected() setup_processor_boxes(); setup_latency_frame (); - route->processors_changed.connect (_route_processors_connection, invalidator (*this), ui_bind (&RouteParams_UI::processors_changed, this, _1), gui_context()); + route->processors_changed.connect (_route_processors_connection, invalidator (*this), boost::bind (&RouteParams_UI::processors_changed, this, _1), gui_context()); track_input_label.set_text (_route->name()); @@ -519,7 +534,12 @@ RouteParams_UI::redirect_selected (boost::shared_ptr proc) boost::shared_ptr plugin_insert; boost::shared_ptr port_insert; - if ((send = boost::dynamic_pointer_cast (proc)) != 0) { + if ((boost::dynamic_pointer_cast (proc)) != 0) { + cleanup_view(); + _processor.reset ((Processor*) 0); + update_title(); + return; + } else if ((send = boost::dynamic_pointer_cast (proc)) != 0) { SendUI *send_ui = new SendUI (this, send, _session);