_have_internal_generator = false;
_declickable = false;
_pending_declick = true;
+ _remote_control_id = 0;
_edit_group = 0;
_mix_group = 0;
}
}
+void
+Route::set_remote_control_id (uint32_t id)
+{
+ if (id != _remote_control_id) {
+ _remote_control_id = id;
+ RemoteControlIDChanged ();
+ }
+}
+
+uint32_t
+Route::remote_control_id() const
+{
+ return _remote_control_id;
+}
+
long
Route::order_key (string name) const
{
IO *co;
bool mute_audible;
bool solo_audible;
- bool no_monitor = (Config->get_use_hardware_monitoring() || Config->get_no_sw_monitoring ());
+ bool no_monitor = (Config->get_use_hardware_monitoring() || !Config->get_use_sw_monitoring ());
gain_t* gab = _session.gain_automation_buffer();
declick = _pending_declick;
-------------------------------------------------------------------------------------------------- */
if (with_redirects) {
- TentativeLockMonitor rm (redirect_lock, __LINE__, __FILE__);
+ TentativeRWLockMonitor rm (redirect_lock, false, __LINE__, __FILE__);
if (rm.locked()) {
if (mute_gain > 0 || !_mute_affects_pre_fader) {
for (i = _redirects.begin(); i != _redirects.end(); ++i) {
// AND software monitoring required
- !Config->get_no_sw_monitoring())) {
+ Config->get_use_sw_monitoring())) {
if (apply_gain_automation) {
}
}
- if (apply_gain_automation) {
+ if (apply_gain_automation && _session.transport_rolling()) {
_effective_gain = gab[nframes-1];
}
if (post_fader_work) {
- TentativeLockMonitor rm (redirect_lock, __LINE__, __FILE__);
+ TentativeRWLockMonitor rm (redirect_lock, false, __LINE__, __FILE__);
if (rm.locked()) {
if (mute_gain > 0 || !_mute_affects_post_fader) {
for (i = _redirects.begin(); i != _redirects.end(); ++i) {
}
{
- LockMonitor lm (redirect_lock, __LINE__, __FILE__);
+ RWLockMonitor lm (redirect_lock, true, __LINE__, __FILE__);
PluginInsert* pi;
PortInsert* porti;
}
{
- LockMonitor lm (redirect_lock, __LINE__, __FILE__);
+ RWLockMonitor lm (redirect_lock, true, __LINE__, __FILE__);
RedirectList::iterator existing_end = _redirects.end();
--existing_end;
}
{
- LockMonitor lm (redirect_lock, __LINE__, __FILE__);
+ RWLockMonitor lm (redirect_lock, true, __LINE__, __FILE__);
for (RedirectList::iterator i = _redirects.begin(); i != _redirects.end(); ++i) {
delete *i;
redirect_max_outs = 0;
{
- LockMonitor lm (redirect_lock, __LINE__, __FILE__);
+ RWLockMonitor lm (redirect_lock, true, __LINE__, __FILE__);
RedirectList::iterator i;
bool removed = false;
int
Route::reset_plugin_counts (uint32_t* lpc)
{
- LockMonitor lm (redirect_lock, __LINE__, __FILE__);
+ RWLockMonitor lm (redirect_lock, true, __LINE__, __FILE__);
return _reset_plugin_counts (lpc);
}
RedirectList to_be_deleted;
{
- LockMonitor lm (redirect_lock, __LINE__, __FILE__);
+ RWLockMonitor lm (redirect_lock, true, __LINE__, __FILE__);
RedirectList::iterator tmp;
RedirectList the_copy;
void
Route::all_redirects_flip ()
{
- LockMonitor lm (redirect_lock, __LINE__, __FILE__);
+ RWLockMonitor lm (redirect_lock, false, __LINE__, __FILE__);
if (_redirects.empty()) {
return;
void
Route::all_redirects_active (bool state)
{
- LockMonitor lm (redirect_lock, __LINE__, __FILE__);
+ RWLockMonitor lm (redirect_lock, false, __LINE__, __FILE__);
if (_redirects.empty()) {
return;
{
{
RedirectSorter comparator;
- LockMonitor lm (redirect_lock, __LINE__, __FILE__);
+ RWLockMonitor lm (redirect_lock, true, __LINE__, __FILE__);
uint32_t old_rmo = redirect_max_outs;
/* the sweet power of C++ ... */
} else {
- error << compose(_("unknown Insert type \"%1\"; ignored"), prop->value()) << endmsg;
+ error << string_compose(_("unknown Insert type \"%1\"; ignored"), prop->value()) << endmsg;
}
add_redirect (insert, this);
if (node.name() != "Route"){
- error << compose(_("Bad node sent to Route::set_state() [%1]"), node.name()) << endmsg;
+ error << string_compose(_("Bad node sent to Route::set_state() [%1]"), node.name()) << endmsg;
return -1;
}
if ((prop = node.property ("edit-group")) != 0) {
RouteGroup* edit_group = _session.edit_group_by_name(prop->value());
if(edit_group == 0) {
- error << compose(_("Route %1: unknown edit group \"%2 in saved state (ignored)"), _name, prop->value()) << endmsg;
+ error << string_compose(_("Route %1: unknown edit group \"%2 in saved state (ignored)"), _name, prop->value()) << endmsg;
} else {
set_edit_group(edit_group, this);
}
while (remaining.length()) {
if ((equal = remaining.find_first_of ('=')) == string::npos || equal == remaining.length()) {
- error << compose (_("badly formed order key string in state file! [%1] ... ignored."), remaining)
+ error << string_compose (_("badly formed order key string in state file! [%1] ... ignored."), remaining)
<< endmsg;
} else {
if (sscanf (remaining.substr (equal+1).c_str(), "%ld", &n) != 1) {
- error << compose (_("badly formed order key string in state file! [%1] ... ignored."), remaining)
+ error << string_compose (_("badly formed order key string in state file! [%1] ... ignored."), remaining)
<< endmsg;
} else {
set_order_key (remaining.substr (0, equal), n);
if ((prop = node.property ("mix-group")) != 0) {
RouteGroup* mix_group = _session.mix_group_by_name(prop->value());
if (mix_group == 0) {
- error << compose(_("Route %1: unknown mix group \"%2 in saved state (ignored)"), _name, prop->value()) << endmsg;
+ error << string_compose(_("Route %1: unknown mix group \"%2 in saved state (ignored)"), _name, prop->value()) << endmsg;
} else {
set_mix_group(mix_group, this);
}
if (get_midi_node_info (child, ev, chn, additional)) {
_midi_mute_control.set_control_type (chn, ev, additional);
} else {
- error << compose(_("MIDI mute control specification for %1 is incomplete, so it has been ignored"), _name) << endmsg;
+ error << string_compose(_("MIDI mute control specification for %1 is incomplete, so it has been ignored"), _name) << endmsg;
}
}
else if (child->name() == "solo") {
if (get_midi_node_info (child, ev, chn, additional)) {
_midi_solo_control.set_control_type (chn, ev, additional);
} else {
- error << compose(_("MIDI mute control specification for %1 is incomplete, so it has been ignored"), _name) << endmsg;
+ error << string_compose(_("MIDI mute control specification for %1 is incomplete, so it has been ignored"), _name) << endmsg;
}
}
}
{
- TentativeLockMonitor lm (redirect_lock, __LINE__, __FILE__);
+ TentativeRWLockMonitor lm (redirect_lock, false, __LINE__, __FILE__);
if (lm.locked()) {
for (RedirectList::iterator i = _redirects.begin(); i != _redirects.end(); ++i) {
{
jack_nframes_t now = _session.transport_frame();
- if (!did_locate) {
- automation_snapshot (now);
- }
-
{
- LockMonitor lm (redirect_lock, __LINE__, __FILE__);
+ RWLockMonitor lm (redirect_lock, false, __LINE__, __FILE__);
+
+ if (!did_locate) {
+ automation_snapshot (now);
+ }
+
for (RedirectList::iterator i = _redirects.begin(); i != _redirects.end(); ++i) {
if (Config->get_plugins_stop_with_transport() && can_flush_redirects) {
}
apply_gain_automation = false;
-
+
if (n_inputs()) {
passthru (start_frame, end_frame, nframes, offset, 0, false);
} else {
Route::roll (jack_nframes_t nframes, jack_nframes_t start_frame, jack_nframes_t end_frame, jack_nframes_t offset, int declick,
bool can_record, bool rec_monitors_input)
{
- automation_snapshot (_session.transport_frame());
-
+ {
+ TentativeRWLockMonitor lm(redirect_lock, false, __LINE__, __FILE__);
+ if (lm.locked()) {
+ // automation snapshot can also be called from the non-rt context
+ // and it uses the redirect list, so we take the lock out here
+ automation_snapshot (_session.transport_frame());
+ }
+ }
+
if ((n_outputs() == 0 && _redirects.empty()) || n_inputs() == 0 || !_active) {
silence (nframes, offset);
return 0;
}
- jack_nframes_t unused;
+ jack_nframes_t unused = 0;
if ((nframes = check_initial_delay (nframes, offset, unused)) == 0) {
return 0;
}
_silent = false;
+
apply_gain_automation = false;
{
TentativeLockMonitor am (automation_lock, __LINE__, __FILE__);
- if (am.locked()) {
+ if (am.locked() && _session.transport_rolling()) {
jack_nframes_t start_frame = end_frame - nframes;
if (_session.get_midi_feedback()) {
{
- LockMonitor lm (redirect_lock, __LINE__, __FILE__);
+ RWLockMonitor lm (redirect_lock, false, __LINE__, __FILE__);
for (RedirectList::iterator i = _redirects.begin(); i != _redirects.end(); ++i) {
(*i)->send_all_midi_feedback ();
}
buf = _midi_mute_control.write_feedback (buf, bufsize, _muted);
{
- LockMonitor lm (redirect_lock, __LINE__, __FILE__);
+ RWLockMonitor lm (redirect_lock, false, __LINE__, __FILE__);
for (RedirectList::iterator i = _redirects.begin(); i != _redirects.end(); ++i) {
buf = (*i)->write_midi_feedback (buf, bufsize);
}
this is called from the RT audio thread.
*/
- LockMonitor lm (redirect_lock, __LINE__, __FILE__);
+ RWLockMonitor lm (redirect_lock, false, __LINE__, __FILE__);
for (RedirectList::iterator i = _redirects.begin(); i != _redirects.end(); ++i) {
(*i)->deactivate ();
if (get_control_info (ch, ev, additional)) {
data.controller_number = additional;
data.value = val;
-
+ last_written = value;
+
route._session.send_midi_message (get_port(), ev, ch, data);
}
}