mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-03 20:29:35 +01:00
fix clicking when processors become active/inactive; reduce crazy 2.5sec delay for quit dialog
git-svn-id: svn://localhost/ardour2/branches/3.0@5402 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
2093d59a96
commit
f411496289
20 changed files with 121 additions and 63 deletions
|
|
@ -75,7 +75,7 @@ Amp::run (BufferSet& bufs, sframes_t start_frame, sframes_t end_frame, nframes_t
|
|||
{
|
||||
gain_t mute_gain;
|
||||
|
||||
if (!_active) {
|
||||
if (!_active && !_pending_active) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -159,6 +159,8 @@ Amp::run (BufferSet& bufs, sframes_t start_frame, sframes_t end_frame, nframes_t
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
_active = _pending_active;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ class Processor : public SessionObject, public AutomatableControls, public Laten
|
|||
virtual bool visible() const { return true; }
|
||||
virtual void set_visible (bool) {}
|
||||
|
||||
bool active () const { return _active; }
|
||||
bool active () const { return _pending_active; }
|
||||
|
||||
bool get_next_ab_is_active () const { return _next_ab_is_active; }
|
||||
void set_next_ab_is_active (bool yn) { _next_ab_is_active = yn; }
|
||||
|
|
@ -73,8 +73,8 @@ class Processor : public SessionObject, public AutomatableControls, public Laten
|
|||
virtual void run (BufferSet& bufs, sframes_t start_frame, sframes_t end_frame, nframes_t nframes) {}
|
||||
virtual void silence (nframes_t nframes) {}
|
||||
|
||||
virtual void activate () { _active = true; ActiveChanged(); }
|
||||
virtual void deactivate () { _active = false; ActiveChanged(); }
|
||||
virtual void activate () { _pending_active = true; ActiveChanged(); }
|
||||
virtual void deactivate () { _pending_active = false; ActiveChanged(); }
|
||||
|
||||
virtual bool configure_io (ChanCount in, ChanCount out);
|
||||
|
||||
|
|
|
|||
|
|
@ -280,15 +280,22 @@ Delivery::run (BufferSet& bufs, sframes_t start_frame, sframes_t end_frame, nfra
|
|||
{
|
||||
assert (_output);
|
||||
|
||||
if (!_active || _output->n_ports ().get (_output->default_type()) == 0) {
|
||||
return;
|
||||
PortSet& ports (_output->ports());
|
||||
gain_t tgain;
|
||||
|
||||
if (_output->n_ports ().get (_output->default_type()) == 0) {
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (!_active && !_pending_active) {
|
||||
_output->silence (nframes);
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* this setup is not just for our purposes, but for anything that comes after us in the
|
||||
processing pathway that wants to use this->output_buffers() for some reason.
|
||||
*/
|
||||
|
||||
PortSet& ports (_output->ports());
|
||||
output_buffers().attach_buffers (ports, nframes, _output_offset);
|
||||
|
||||
// this Delivery processor is not a derived type, and thus we assume
|
||||
|
|
@ -296,7 +303,7 @@ Delivery::run (BufferSet& bufs, sframes_t start_frame, sframes_t end_frame, nfra
|
|||
// the main output stage of a Route). Contrast with Send::run()
|
||||
// which cannot do this.
|
||||
|
||||
gain_t tgain = target_gain ();
|
||||
tgain = target_gain ();
|
||||
|
||||
if (tgain != _current_gain) {
|
||||
|
||||
|
|
@ -310,11 +317,10 @@ Delivery::run (BufferSet& bufs, sframes_t start_frame, sframes_t end_frame, nfra
|
|||
/* we were quiet last time, and we're still supposed to be quiet.
|
||||
Silence the outputs, and make sure the buffers are quiet too,
|
||||
*/
|
||||
|
||||
|
||||
_output->silence (nframes);
|
||||
Amp::apply_simple_gain (bufs, nframes, 0.0);
|
||||
|
||||
return;
|
||||
goto out;
|
||||
|
||||
} else if (tgain != 1.0) {
|
||||
|
||||
|
|
@ -341,6 +347,9 @@ Delivery::run (BufferSet& bufs, sframes_t start_frame, sframes_t end_frame, nfra
|
|||
_output->copy_to_outputs (bufs, DataType::MIDI, nframes, _output_offset);
|
||||
}
|
||||
}
|
||||
|
||||
out:
|
||||
_active = _pending_active;
|
||||
}
|
||||
|
||||
XMLNode&
|
||||
|
|
@ -495,6 +504,12 @@ Delivery::flush (nframes_t nframes)
|
|||
gain_t
|
||||
Delivery::target_gain ()
|
||||
{
|
||||
/* if we've been requested to deactivate, our target gain is zero */
|
||||
|
||||
if (!_pending_active) {
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
/* if we've been told not to output because its a monitoring situation and
|
||||
we're not monitoring, then be quiet.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -46,7 +46,11 @@ InternalReturn::InternalReturn (Session& s, const XMLNode& node)
|
|||
void
|
||||
InternalReturn::run (BufferSet& bufs, sframes_t start_frame, sframes_t end_frame, nframes_t nframes)
|
||||
{
|
||||
/* XXX no lock here, just atomic fetch */
|
||||
if (!_active && !_pending_active) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* no lock here, just atomic fetch */
|
||||
|
||||
if (g_atomic_int_get(&user_count) == 0) {
|
||||
/* nothing to do - nobody is feeding us anything */
|
||||
|
|
@ -54,6 +58,7 @@ InternalReturn::run (BufferSet& bufs, sframes_t start_frame, sframes_t end_frame
|
|||
}
|
||||
|
||||
bufs.merge_from (buffers, nframes);
|
||||
_active = _pending_active;
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ InternalSend::send_to_going_away ()
|
|||
void
|
||||
InternalSend::run (BufferSet& bufs, sframes_t start_frame, sframes_t end_frame, nframes_t nframes)
|
||||
{
|
||||
if (!_active || !target || !_send_to) {
|
||||
if ((!_active && !_pending_active) || !target || !_send_to) {
|
||||
_meter->reset ();
|
||||
return;
|
||||
}
|
||||
|
|
@ -102,7 +102,7 @@ InternalSend::run (BufferSet& bufs, sframes_t start_frame, sframes_t end_frame,
|
|||
|
||||
_meter->reset ();
|
||||
Amp::apply_simple_gain (sendbufs, nframes, 0.0);
|
||||
return;
|
||||
goto out;
|
||||
|
||||
} else if (tgain != 1.0) {
|
||||
|
||||
|
|
@ -130,6 +130,9 @@ InternalSend::run (BufferSet& bufs, sframes_t start_frame, sframes_t end_frame,
|
|||
/* deliver to target */
|
||||
|
||||
target->merge_from (sendbufs, nframes);
|
||||
|
||||
out:
|
||||
_active = _pending_active;
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ Metering::update_meters()
|
|||
void
|
||||
PeakMeter::run (BufferSet& bufs, sframes_t start_frame, sframes_t end_frame, nframes_t nframes)
|
||||
{
|
||||
if (!_active) {
|
||||
if (!_active && !_pending_active) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -111,6 +111,8 @@ PeakMeter::run (BufferSet& bufs, sframes_t start_frame, sframes_t end_frame, nfr
|
|||
for (uint32_t i = n; i < _peak_power.size(); ++i) {
|
||||
_peak_power[i] = 0.0f;
|
||||
}
|
||||
|
||||
_active = _pending_active;
|
||||
}
|
||||
|
||||
PeakMeter::PeakMeter (Session& s, const XMLNode& node)
|
||||
|
|
|
|||
|
|
@ -377,13 +377,14 @@ PluginInsert::silence (nframes_t nframes)
|
|||
void
|
||||
PluginInsert::run (BufferSet& bufs, sframes_t start_frame, sframes_t end_frame, nframes_t nframes)
|
||||
{
|
||||
if (active()) {
|
||||
if (_active || _pending_active) {
|
||||
|
||||
if (_session.transport_rolling()) {
|
||||
automation_run (bufs, nframes);
|
||||
} else {
|
||||
connect_and_run (bufs, nframes, 0, false);
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
/* FIXME: type, audio only */
|
||||
|
|
@ -402,6 +403,8 @@ PluginInsert::run (BufferSet& bufs, sframes_t start_frame, sframes_t end_frame,
|
|||
|
||||
bufs.count().set_audio(out);
|
||||
}
|
||||
|
||||
_active = _pending_active;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -72,14 +72,17 @@ PortInsert::run (BufferSet& bufs, sframes_t start_frame, sframes_t end_frame, nf
|
|||
return;
|
||||
}
|
||||
|
||||
if (!active()) {
|
||||
if (!_active && !_pending_active) {
|
||||
/* deliver silence */
|
||||
silence (nframes);
|
||||
return;
|
||||
goto out;
|
||||
}
|
||||
|
||||
_out->run (bufs, start_frame, end_frame, nframes);
|
||||
_input->collect_input (bufs, nframes, ChanCount::ZERO);
|
||||
|
||||
out:
|
||||
_active = _pending_active;
|
||||
}
|
||||
|
||||
XMLNode&
|
||||
|
|
|
|||
|
|
@ -65,6 +65,7 @@ const string Processor::state_node_name = "Processor";
|
|||
Processor::Processor(Session& session, const string& name)
|
||||
: SessionObject(session, name)
|
||||
, AutomatableControls(session)
|
||||
, _pending_active(false)
|
||||
, _active(false)
|
||||
, _next_ab_is_active(false)
|
||||
, _configured(false)
|
||||
|
|
@ -75,12 +76,14 @@ Processor::Processor(Session& session, const string& name)
|
|||
Processor::Processor (Session& session, const XMLNode& node)
|
||||
: SessionObject(session, "renameMe")
|
||||
, AutomatableControls(session)
|
||||
, _pending_active(false)
|
||||
, _active(false)
|
||||
, _next_ab_is_active(false)
|
||||
, _configured(false)
|
||||
, _gui(0)
|
||||
{
|
||||
set_state (node);
|
||||
_pending_active = _active;
|
||||
}
|
||||
|
||||
XMLNode&
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@ Return::set_state(const XMLNode& node)
|
|||
void
|
||||
Return::run (BufferSet& bufs, sframes_t start_frame, sframes_t end_frame, nframes_t nframes)
|
||||
{
|
||||
if (!active() || _input->n_ports() == ChanCount::ZERO) {
|
||||
if ((!_active && !_pending_active) || _input->n_ports() == ChanCount::ZERO) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -141,6 +141,8 @@ Return::run (BufferSet& bufs, sframes_t start_frame, sframes_t end_frame, nframe
|
|||
_meter->run (bufs, start_frame, end_frame, nframes);
|
||||
}
|
||||
}
|
||||
|
||||
_active = _pending_active;
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
|
|||
|
|
@ -86,8 +86,16 @@ Send::deactivate ()
|
|||
void
|
||||
Send::run (BufferSet& bufs, sframes_t start_frame, sframes_t end_frame, nframes_t nframes)
|
||||
{
|
||||
if (!_active || _output->n_ports() == ChanCount::ZERO) {
|
||||
if (_output->n_ports() == ChanCount::ZERO) {
|
||||
_meter->reset ();
|
||||
_active = _pending_active;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!_active && !_pending_active) {
|
||||
_meter->reset ();
|
||||
_output->silence (nframes);
|
||||
_active = _pending_active;
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -118,6 +126,8 @@ Send::run (BufferSet& bufs, sframes_t start_frame, sframes_t end_frame, nframes_
|
|||
_meter->run (*_output_buffers, start_frame, end_frame, nframes);
|
||||
}
|
||||
}
|
||||
|
||||
/* _active was set to _pending_active by Delivery::run() */
|
||||
}
|
||||
|
||||
XMLNode&
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue