using namespace PBD;
uint32_t Route::order_key_cnt = 0;
-
+sigc::signal<void> Route::SyncOrderKeys;
Route::Route (Session& sess, string name, int input_min, int input_max, int output_min, int output_max, Flag flg, DataType default_type)
: IO (sess, name, input_min, input_max, output_min, output_max, default_type),
_phase_invert = false;
_denormal_protection = false;
order_keys[strdup (N_("signal"))] = order_key_cnt++;
- _active = true;
_silent = false;
_meter_point = MeterPostFader;
_initial_delay = 0;
Route::set_order_key (const char* name, long n)
{
order_keys[strdup(name)] = n;
+
+ if (Config->get_sync_all_route_ordering()) {
+ for (OrderKeys::iterator x = order_keys.begin(); x != order_keys.end(); ++x) {
+ x->second = n;
+ }
+ }
+
_session.set_dirty ();
}
+void
+Route::sync_order_keys ()
+{
+ uint32_t key;
+
+ if (order_keys.empty()) {
+ return;
+ }
+
+ OrderKeys::iterator x = order_keys.begin();
+ key = x->second;
+ ++x;
+
+ for (; x != order_keys.end(); ++x) {
+ x->second = key;
+ }
+}
+
void
Route::inc_gain (gain_t fraction, void *src)
{
// OR recording
- // h/w monitoring not in use
+ // AND software monitoring required
- (!Config->get_monitoring_model() == HardwareMonitoring &&
-
- // AND software monitoring required
-
- Config->get_monitoring_model() == SoftwareMonitoring)) {
+ (Config->get_monitoring_model() == SoftwareMonitoring)) {
if (apply_gain_automation) {
-------------------------------------------------------------------------------------------------- */
if (meter && (_meter_point == MeterPostFader)) {
-// cerr << "meter post" << endl;
if ((_gain == 0 && !apply_gain_automation) || dmg == 0) {
uint32_t no = n_outputs();
}
(*i).in = required_inputs;
- (*i).out = (*i).insert->compute_output_streams ((*i).cnt);
+
+ if (((*i).out = (*i).insert->compute_output_streams ((*i).cnt)) < 0) {
+ if (err_streams) {
+ *err_streams = required_inputs;
+ }
+ return -1;
+ }
required_inputs = (*i).out;
}
node->add_property("default-type", _default_type.to_string());
- node->add_property("active", _active?"yes":"no");
node->add_property("muted", _muted?"yes":"no");
node->add_property("soloed", _soloed?"yes":"no");
node->add_property("phase-invert", _phase_invert?"yes":"no");
if ((prop = node.property ("type")) != 0) {
boost::shared_ptr<Insert> insert;
+ bool have_insert = false;
- if (prop->value() == "ladspa" || prop->value() == "Ladspa" || prop->value() == "vst") {
-
+ if (prop->value() == "ladspa" || prop->value() == "Ladspa" ||
+ prop->value() == "lv2" ||
+ prop->value() == "vst" ||
+ prop->value() == "audiounit") {
+
insert.reset (new PluginInsert(_session, node));
+ have_insert = true;
} else if (prop->value() == "port") {
insert.reset (new PortInsert (_session, node));
+ have_insert = true;
} else {
error << string_compose(_("unknown Insert type \"%1\"; ignored"), prop->value()) << endmsg;
}
- add_redirect (insert, this);
+ if (have_insert) {
+ add_redirect (insert, this);
+ }
} else {
error << _("Insert XML node has no type property") << endmsg;
set_denormal_protection (prop->value()=="yes"?true:false, this);
}
- if ((prop = node.property (X_("active"))) != 0) {
- set_active (prop->value() == "yes");
- }
-
if ((prop = node.property (X_("muted"))) != 0) {
bool yn = prop->value()=="yes"?true:false;
/* now connect to the named ports */
for (uint32_t n = 0; n < limit; ++n) {
- if (_control_outs->connect_output (_control_outs->output (n), ports[n], this)) {
+ if (_control_outs->connect_output (_control_outs->output (n), ports[n % ports.size()], this)) {
error << string_compose (_("could not connect %1 to %2"), _control_outs->output(n)->name(), ports[n]) << endmsg;
return -1;
}
return onoff;
}
-void
-Route::set_active (bool yn)
-{
- _active = yn;
- active_changed(); /* EMIT SIGNAL */
-}
-
void
Route::handle_transport_stopped (bool abort_ignored, bool did_locate, bool can_flush_redirects)
{