/* map current state of the route */
- processors_changed ();
+ processors_changed (RouteProcessorChange ());
reset_processor_automation_curves ();
ensure_pan_views (false);
update_control_names ();
/* map current state of the route */
- processors_changed ();
+ processors_changed (RouteProcessorChange ());
ensure_xml_node ();
{
}
+/** Called when the metering point has changed */
void
MixerStrip::meter_changed (void *src)
{
gpm.setup_meters ();
// reset peak when meter point changes
gpm.reset_peak_display();
- set_width_enum (_width, this);
}
void
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 ()
#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"
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;
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 (
_session.add_internal_sends (target, PreFader, rlist);
}
+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 ()
{
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>);
}
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);
void cleanup_latency_frame ();
void setup_latency_frame ();
- void processors_changed ();
+ void processors_changed (ARDOUR::RouteProcessorChange);
void setup_processor_boxes();
void cleanup_processor_boxes();
#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"
}
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) {
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);
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();
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;
boost::shared_ptr<Route> XMLRouteFactory (const XMLNode&, int);
+ void route_processors_changed (RouteProcessorChange);
+
/* mixer stuff */
bool solo_update_disabled;
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
_output->set_user_latency (0);
}
- processors_changed (); /* EMIT SIGNAL */
+ processors_changed (RouteProcessorChange ()); /* EMIT SIGNAL */
return 0;
}
_output->set_user_latency (0);
}
- processors_changed (); /* EMIT SIGNAL */
+ processors_changed (RouteProcessorChange ()); /* EMIT SIGNAL */
return 0;
}
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();
}
processor->drop_references ();
- processors_changed (); /* EMIT SIGNAL */
+ processors_changed (RouteProcessorChange ()); /* EMIT SIGNAL */
return 0;
}
(*i)->drop_references ();
}
- processors_changed (); /* EMIT SIGNAL */
+ processors_changed (RouteProcessorChange ()); /* EMIT SIGNAL */
return 0;
}
}
}
- processors_changed (); /* EMIT SIGNAL */
+ processors_changed (RouteProcessorChange ()); /* EMIT SIGNAL */
return 0;
}
the XML state represents a working signal route.
*/
- processors_changed ();
+ processors_changed (RouteProcessorChange ());
}
void
return;
}
+ bool meter_was_visible_to_user = _meter->display_to_user ();
+
{
Glib::RWLock::WriterLock lm (_processor_lock);
ProcessorList as_it_was (_processors);
}
}
-
+
_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 ();
}
}
}
- processors_changed (); /* EMIT SIGNAL */
+ processors_changed (RouteProcessorChange ()); /* EMIT SIGNAL */
_session.set_dirty ();
}
(*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()) {
}
}
+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)
{