diff options
-rw-r--r-- | gtk2_ardour/audio_time_axis.cc | 2 | ||||
-rw-r--r-- | gtk2_ardour/midi_time_axis.cc | 2 | ||||
-rw-r--r-- | gtk2_ardour/mixer_strip.cc | 2 | ||||
-rw-r--r-- | gtk2_ardour/port_matrix.cc | 13 | ||||
-rw-r--r-- | gtk2_ardour/port_matrix.h | 2 | ||||
-rw-r--r-- | gtk2_ardour/processor_box.cc | 14 | ||||
-rw-r--r-- | gtk2_ardour/processor_box.h | 1 | ||||
-rw-r--r-- | gtk2_ardour/route_params_ui.cc | 4 | ||||
-rw-r--r-- | gtk2_ardour/route_params_ui.h | 2 | ||||
-rw-r--r-- | gtk2_ardour/route_time_axis.cc | 8 | ||||
-rw-r--r-- | gtk2_ardour/route_time_axis.h | 2 | ||||
-rw-r--r-- | gtk2_ardour/route_ui.h | 2 | ||||
-rw-r--r-- | libs/ardour/ardour/route.h | 7 | ||||
-rw-r--r-- | libs/ardour/ardour/session.h | 2 | ||||
-rw-r--r-- | libs/ardour/ardour/types.h | 30 | ||||
-rw-r--r-- | libs/ardour/route.cc | 27 | ||||
-rw-r--r-- | libs/ardour/session.cc | 2 | ||||
-rw-r--r-- | libs/ardour/session_transport.cc | 10 |
18 files changed, 107 insertions, 25 deletions
diff --git a/gtk2_ardour/audio_time_axis.cc b/gtk2_ardour/audio_time_axis.cc index 281bedafe1..e2a9dc80b8 100644 --- a/gtk2_ardour/audio_time_axis.cc +++ b/gtk2_ardour/audio_time_axis.cc @@ -115,7 +115,7 @@ AudioTimeAxisView::AudioTimeAxisView (PublicEditor& ed, Session& sess, boost::sh /* map current state of the route */ - processors_changed (); + processors_changed (RouteProcessorChange ()); reset_processor_automation_curves (); ensure_pan_views (false); update_control_names (); diff --git a/gtk2_ardour/midi_time_axis.cc b/gtk2_ardour/midi_time_axis.cc index 544fee86a4..c05c3fecc6 100644 --- a/gtk2_ardour/midi_time_axis.cc +++ b/gtk2_ardour/midi_time_axis.cc @@ -132,7 +132,7 @@ MidiTimeAxisView::MidiTimeAxisView (PublicEditor& ed, Session& sess, /* map current state of the route */ - processors_changed (); + processors_changed (RouteProcessorChange ()); ensure_xml_node (); diff --git a/gtk2_ardour/mixer_strip.cc b/gtk2_ardour/mixer_strip.cc index 5b26bd5141..73326c8d30 100644 --- a/gtk2_ardour/mixer_strip.cc +++ b/gtk2_ardour/mixer_strip.cc @@ -1609,6 +1609,7 @@ MixerStrip::engine_running () { } +/** Called when the metering point has changed */ void MixerStrip::meter_changed (void *src) { @@ -1635,7 +1636,6 @@ MixerStrip::meter_changed (void *src) gpm.setup_meters (); // reset peak when meter point changes gpm.reset_peak_display(); - set_width_enum (_width, this); } void diff --git a/gtk2_ardour/port_matrix.cc b/gtk2_ardour/port_matrix.cc index ccf240f1bb..f36287836a 100644 --- a/gtk2_ardour/port_matrix.cc +++ b/gtk2_ardour/port_matrix.cc @@ -142,11 +142,22 @@ PortMatrix::reconnect_to_routes () boost::shared_ptr<RouteList> routes = _session.get_routes (); for (RouteList::iterator i = routes->begin(); i != routes->end(); ++i) { _route_connections.push_back ( - (*i)->processors_changed.connect (mem_fun (*this, &PortMatrix::setup_global_ports)) + (*i)->processors_changed.connect (mem_fun (*this, &PortMatrix::route_processors_changed)) ); } } +void +PortMatrix::route_processors_changed (RouteProcessorChange c) +{ + if (c.type == RouteProcessorChange::MeterPointChange) { + /* this change has no impact on the port matrix */ + return; + } + + setup_global_ports (); +} + /** A route has been added to or removed from the session */ void PortMatrix::routes_changed () diff --git a/gtk2_ardour/port_matrix.h b/gtk2_ardour/port_matrix.h index d073740bf5..278b5a7ced 100644 --- a/gtk2_ardour/port_matrix.h +++ b/gtk2_ardour/port_matrix.h @@ -29,6 +29,7 @@ #include <gtkmm/notebook.h> #include <boost/shared_ptr.hpp> #include "ardour/bundle.h" +#include "ardour/types.h" #include "port_group.h" #include "port_matrix_types.h" #include "i18n.h" @@ -178,6 +179,7 @@ private: void remove_notebook_pages (Gtk::Notebook &); void v_page_selected (GtkNotebookPage *, guint); void h_page_selected (GtkNotebookPage *, guint); + void route_processors_changed (ARDOUR::RouteProcessorChange); Gtk::Window* _parent; diff --git a/gtk2_ardour/processor_box.cc b/gtk2_ardour/processor_box.cc index 41a45880ae..1f2fe906c9 100644 --- a/gtk2_ardour/processor_box.cc +++ b/gtk2_ardour/processor_box.cc @@ -318,8 +318,7 @@ ProcessorBox::set_route (boost::shared_ptr<Route> r) no_processor_redisplay = false; _route = r; - connections.push_back (_route->processors_changed.connect ( - mem_fun(*this, &ProcessorBox::redisplay_processors))); + connections.push_back (_route->processors_changed.connect (mem_fun (*this, &ProcessorBox::route_processors_changed))); connections.push_back (_route->GoingAway.connect ( mem_fun (*this, &ProcessorBox::route_going_away))); connections.push_back (_route->NameChanged.connect ( @@ -925,6 +924,17 @@ ProcessorBox::choose_aux (boost::weak_ptr<Route> wr) } void +ProcessorBox::route_processors_changed (RouteProcessorChange c) +{ + if (c.type == RouteProcessorChange::MeterPointChange && c.meter_visibly_changed == false) { + /* the meter has moved, but it was and still is invisible to the user, so nothing to do */ + return; + } + + redisplay_processors (); +} + +void ProcessorBox::redisplay_processors () { ENSURE_GUI_THREAD (mem_fun(*this, &ProcessorBox::redisplay_processors)); diff --git a/gtk2_ardour/processor_box.h b/gtk2_ardour/processor_box.h index 06a4753802..efc91c7a82 100644 --- a/gtk2_ardour/processor_box.h +++ b/gtk2_ardour/processor_box.h @@ -200,6 +200,7 @@ class ProcessorBox : public Gtk::HBox, public PluginInterestedObject void redisplay_processors (); void add_processor_to_display (boost::weak_ptr<ARDOUR::Processor>); void reordered (); + void route_processors_changed (ARDOUR::RouteProcessorChange); void remove_processor_gui (boost::shared_ptr<ARDOUR::Processor>); diff --git a/gtk2_ardour/route_params_ui.cc b/gtk2_ardour/route_params_ui.cc index 888e28aab0..d7037159dc 100644 --- a/gtk2_ardour/route_params_ui.cc +++ b/gtk2_ardour/route_params_ui.cc @@ -480,9 +480,9 @@ RouteParams_UI::route_selected() } void -RouteParams_UI::processors_changed () +RouteParams_UI::processors_changed (RouteProcessorChange c) { - ENSURE_GUI_THREAD(mem_fun(*this, &RouteParams_UI::processors_changed)); + ENSURE_GUI_THREAD (bind (mem_fun (*this, &RouteParams_UI::processors_changed), c)); cleanup_view(); _processor.reset ((Processor*) 0); diff --git a/gtk2_ardour/route_params_ui.h b/gtk2_ardour/route_params_ui.h index 4c79bb0829..4d21805778 100644 --- a/gtk2_ardour/route_params_ui.h +++ b/gtk2_ardour/route_params_ui.h @@ -174,7 +174,7 @@ class RouteParams_UI : public ArdourDialog void cleanup_latency_frame (); void setup_latency_frame (); - void processors_changed (); + void processors_changed (ARDOUR::RouteProcessorChange); void setup_processor_boxes(); void cleanup_processor_boxes(); diff --git a/gtk2_ardour/route_time_axis.cc b/gtk2_ardour/route_time_axis.cc index ce693c2d29..08e9ac11ce 100644 --- a/gtk2_ardour/route_time_axis.cc +++ b/gtk2_ardour/route_time_axis.cc @@ -55,6 +55,7 @@ #include "ardour/route_group.h" #include "ardour/session.h" #include "ardour/session_playlist.h" +#include "ardour/debug.h" #include "ardour/utils.h" #include "evoral/Parameter.hpp" @@ -2118,8 +2119,13 @@ RouteTimeAxisView::processor_menu_item_toggled (RouteTimeAxisView::ProcessorAuto } void -RouteTimeAxisView::processors_changed () +RouteTimeAxisView::processors_changed (RouteProcessorChange c) { + if (c.type == RouteProcessorChange::MeterPointChange) { + /* nothing to do if only the meter point has changed */ + return; + } + using namespace Menu_Helpers; for (list<ProcessorAutomationInfo*>::iterator i = processor_automation.begin(); i != processor_automation.end(); ++i) { diff --git a/gtk2_ardour/route_time_axis.h b/gtk2_ardour/route_time_axis.h index 19715fe99d..f37f32b1fa 100644 --- a/gtk2_ardour/route_time_axis.h +++ b/gtk2_ardour/route_time_axis.h @@ -186,7 +186,7 @@ protected: gint edit_click (GdkEventButton *); - void processors_changed (); + void processors_changed (ARDOUR::RouteProcessorChange); void add_processor_to_subplugin_menu (boost::weak_ptr<ARDOUR::Processor>); void remove_processor_automation_node (ProcessorAutomationNode* pan); diff --git a/gtk2_ardour/route_ui.h b/gtk2_ardour/route_ui.h index ebc686b438..b62b146735 100644 --- a/gtk2_ardour/route_ui.h +++ b/gtk2_ardour/route_ui.h @@ -130,7 +130,7 @@ class RouteUI : public virtual AxisView void solo_changed_so_update_mute (); void mute_changed(void*); void listen_changed(void*); - virtual void processors_changed () {} + virtual void processors_changed (ARDOUR::RouteProcessorChange) {} void route_rec_enable_changed(); void session_rec_enable_changed(); diff --git a/libs/ardour/ardour/route.h b/libs/ardour/ardour/route.h index 6c6acb89bd..984ba5fe95 100644 --- a/libs/ardour/ardour/route.h +++ b/libs/ardour/ardour/route.h @@ -240,10 +240,13 @@ class Route : public SessionObject, public AutomatableControls sigc::signal<void,void*> comment_changed; sigc::signal<void,void*> mute_changed; sigc::signal<void> mute_points_changed; - sigc::signal<void> processors_changed; + + /** the processors have changed; the parameter indicates what changed */ + sigc::signal<void, RouteProcessorChange> processors_changed; sigc::signal<void,void*> record_enable_changed; sigc::signal<void,void*> route_group_changed; - sigc::signal<void,void*> meter_change; + /** the metering point has changed */ + sigc::signal<void,void*> meter_change; sigc::signal<void> signal_latency_changed; sigc::signal<void> initial_delay_changed; diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h index 06f6b5e505..a3505ec587 100644 --- a/libs/ardour/ardour/session.h +++ b/libs/ardour/ardour/session.h @@ -1446,6 +1446,8 @@ class Session : public PBD::StatefulDestructible, public boost::noncopyable boost::shared_ptr<Route> XMLRouteFactory (const XMLNode&, int); + void route_processors_changed (RouteProcessorChange); + /* mixer stuff */ bool solo_update_disabled; diff --git a/libs/ardour/ardour/types.h b/libs/ardour/ardour/types.h index 75c4d20db4..92c26a9448 100644 --- a/libs/ardour/ardour/types.h +++ b/libs/ardour/ardour/types.h @@ -428,6 +428,36 @@ namespace ARDOUR { int64_t space; }; + /** A struct used to describe changes to processors in a route. + * This is useful because objects that respond to a change in processors + * can optimise what work they do based on details of what has changed. + */ + struct RouteProcessorChange { + enum Type { + GeneralChange = 0x0, + MeterPointChange = 0x1 + }; + + RouteProcessorChange () { + type = GeneralChange; + } + + RouteProcessorChange (Type t) { + type = t; + meter_visibly_changed = true; + } + + RouteProcessorChange (Type t, bool m) { + type = t; + meter_visibly_changed = m; + } + + /** type of change; "GeneralChange" means anything could have changed */ + Type type; + /** true if, when a MeterPointChange has occurred, the change is visible to the user */ + bool meter_visibly_changed; + }; + } // namespace ARDOUR diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc index facc507133..d57f542bc4 100644 --- a/libs/ardour/route.cc +++ b/libs/ardour/route.cc @@ -772,7 +772,7 @@ Route::add_processor (boost::shared_ptr<Processor> processor, ProcessorList::ite _output->set_user_latency (0); } - processors_changed (); /* EMIT SIGNAL */ + processors_changed (RouteProcessorChange ()); /* EMIT SIGNAL */ return 0; } @@ -1031,7 +1031,7 @@ Route::add_processors (const ProcessorList& others, ProcessorList::iterator iter _output->set_user_latency (0); } - processors_changed (); /* EMIT SIGNAL */ + processors_changed (RouteProcessorChange ()); /* EMIT SIGNAL */ return 0; } @@ -1231,7 +1231,7 @@ Route::clear_processors (Placement p) processor_max_streams.reset(); _have_internal_generator = false; - processors_changed (); /* EMIT SIGNAL */ + processors_changed (RouteProcessorChange ()); /* EMIT SIGNAL */ if (!already_deleting) { _session.clear_deletion_in_progress(); @@ -1322,7 +1322,7 @@ Route::remove_processor (boost::shared_ptr<Processor> processor, ProcessorStream } processor->drop_references (); - processors_changed (); /* EMIT SIGNAL */ + processors_changed (RouteProcessorChange ()); /* EMIT SIGNAL */ return 0; } @@ -1414,7 +1414,7 @@ Route::remove_processors (const ProcessorList& to_be_deleted, ProcessorStreams* (*i)->drop_references (); } - processors_changed (); /* EMIT SIGNAL */ + processors_changed (RouteProcessorChange ()); /* EMIT SIGNAL */ return 0; } @@ -1654,7 +1654,7 @@ Route::reorder_processors (const ProcessorList& new_order, ProcessorStreams* err } } - processors_changed (); /* EMIT SIGNAL */ + processors_changed (RouteProcessorChange ()); /* EMIT SIGNAL */ return 0; } @@ -2243,7 +2243,7 @@ Route::set_processor_state (const XMLNode& node) the XML state represents a working signal route. */ - processors_changed (); + processors_changed (RouteProcessorChange ()); } void @@ -2683,6 +2683,8 @@ Route::set_meter_point (MeterPoint p, void *src) return; } + bool meter_was_visible_to_user = _meter->display_to_user (); + { Glib::RWLock::WriterLock lm (_processor_lock); ProcessorList as_it_was (_processors); @@ -2723,10 +2725,15 @@ Route::set_meter_point (MeterPoint p, void *src) } } - + _meter_point = p; meter_change (src); /* EMIT SIGNAL */ - processors_changed (); /* EMIT SIGNAL */ + + /* the meter has visibly changed if it is not visible to the user, or if it was and now isn't */ + bool const meter_visibly_changed = _meter->display_to_user() || meter_was_visible_to_user; + + processors_changed (RouteProcessorChange (RouteProcessorChange::MeterPointChange, meter_visibly_changed)); /* EMIT SIGNAL */ + _session.set_dirty (); } @@ -2767,7 +2774,7 @@ Route::put_control_outs_at (Placement p) } } - processors_changed (); /* EMIT SIGNAL */ + processors_changed (RouteProcessorChange ()); /* EMIT SIGNAL */ _session.set_dirty (); } diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index 79d7ccf84c..93293de2b6 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -2174,7 +2174,7 @@ Session::add_routes (RouteList& new_routes, bool save) (*x)->solo_changed.connect (sigc::bind (mem_fun (*this, &Session::route_solo_changed), wpr)); (*x)->mute_changed.connect (mem_fun (*this, &Session::route_mute_changed)); (*x)->output()->changed.connect (mem_fun (*this, &Session::set_worst_io_latencies_x)); - (*x)->processors_changed.connect (bind (mem_fun (*this, &Session::update_latency_compensation), false, false)); + (*x)->processors_changed.connect (mem_fun (*this, &Session::route_processors_changed)); (*x)->route_group_changed.connect (hide (mem_fun (*this, &Session::route_group_changed))); if ((*x)->is_master()) { diff --git a/libs/ardour/session_transport.cc b/libs/ardour/session_transport.cc index f0fc5da6a1..69de9ead2e 100644 --- a/libs/ardour/session_transport.cc +++ b/libs/ardour/session_transport.cc @@ -1421,6 +1421,16 @@ Session::xrun_recovery () } void +Session::route_processors_changed (RouteProcessorChange c) +{ + if (c.type == RouteProcessorChange::MeterPointChange) { + return; + } + + update_latency_compensation (false, false); +} + +void Session::update_latency_compensation (bool with_stop, bool abort) { bool update_jack = false; |