diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2009-07-21 03:23:57 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2009-07-21 03:23:57 +0000 |
commit | 20342cf2644fee7b04d6cfdc4fc686897837a01b (patch) | |
tree | cde2cbeb36402a003148c21aa92c1b27c5a418b5 /libs/ardour | |
parent | 769e2c3feb2ce30056bfb8ec6eb7ec6a1d4324c6 (diff) |
first part of fixing up send/return metering ; make send-controlling faders work ; fixes from 2.X for key editor and untranslatable string; use standard name for surfaces lib version in wiimote wscript
git-svn-id: svn://localhost/ardour2/branches/3.0@5400 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour')
-rw-r--r-- | libs/ardour/ardour/processor.h | 4 | ||||
-rw-r--r-- | libs/ardour/ardour/send.h | 4 | ||||
-rw-r--r-- | libs/ardour/crossfade.cc | 3 | ||||
-rw-r--r-- | libs/ardour/internal_send.cc | 4 | ||||
-rw-r--r-- | libs/ardour/meter.cc | 6 | ||||
-rw-r--r-- | libs/ardour/route.cc | 18 | ||||
-rw-r--r-- | libs/ardour/send.cc | 28 | ||||
-rw-r--r-- | libs/ardour/session.cc | 5 |
8 files changed, 58 insertions, 14 deletions
diff --git a/libs/ardour/ardour/processor.h b/libs/ardour/ardour/processor.h index d49c3a206b..2df10e9c69 100644 --- a/libs/ardour/ardour/processor.h +++ b/libs/ardour/ardour/processor.h @@ -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) {} - void activate () { _active = true; ActiveChanged(); } - void deactivate () { _active = false; ActiveChanged(); } + virtual void activate () { _active = true; ActiveChanged(); } + virtual void deactivate () { _active = false; ActiveChanged(); } virtual bool configure_io (ChanCount in, ChanCount out); diff --git a/libs/ardour/ardour/send.h b/libs/ardour/ardour/send.h index d4b9bca1b3..dc57a72519 100644 --- a/libs/ardour/ardour/send.h +++ b/libs/ardour/ardour/send.h @@ -60,6 +60,10 @@ class Send : public Delivery void run (BufferSet& bufs, sframes_t start_frame, sframes_t end_frame, nframes_t nframes); bool can_support_io_configuration (const ChanCount& in, ChanCount& out) const; + bool configure_io (ChanCount in, ChanCount out); + + void activate (); + void deactivate (); bool set_name (const std::string& str); diff --git a/libs/ardour/crossfade.cc b/libs/ardour/crossfade.cc index 62169a48df..006d32508e 100644 --- a/libs/ardour/crossfade.cc +++ b/libs/ardour/crossfade.cc @@ -96,6 +96,7 @@ Crossfade::Crossfade (boost::shared_ptr<AudioRegion> a, boost::shared_ptr<AudioR { _in_update = false; _fixed = false; + _follow_overlap = false; if (compute (a, b, model)) { throw failed_constructor(); @@ -104,8 +105,6 @@ Crossfade::Crossfade (boost::shared_ptr<AudioRegion> a, boost::shared_ptr<AudioR _active = act; initialize (); - - } Crossfade::Crossfade (const Playlist& playlist, XMLNode& node) diff --git a/libs/ardour/internal_send.cc b/libs/ardour/internal_send.cc index 540a6869e1..7ca9319a1e 100644 --- a/libs/ardour/internal_send.cc +++ b/libs/ardour/internal_send.cc @@ -83,7 +83,7 @@ InternalSend::run (BufferSet& bufs, sframes_t start_frame, sframes_t end_frame, BufferSet& sendbufs = _session.get_mix_buffers (bufs.count()); sendbufs.read_from (bufs, nframes); assert(sendbufs.count() == bufs.count()); - + /* gain control */ gain_t tgain = target_gain (); @@ -106,7 +106,7 @@ InternalSend::run (BufferSet& bufs, sframes_t start_frame, sframes_t end_frame, } else if (tgain != 1.0) { - /* target gain has not changed, but is not unity */ + /* target gain has not changed, but is not zero or unity */ Amp::apply_simple_gain (sendbufs, nframes, tgain); } diff --git a/libs/ardour/meter.cc b/libs/ardour/meter.cc index 3bc12f20d6..ba5ccf1501 100644 --- a/libs/ardour/meter.cc +++ b/libs/ardour/meter.cc @@ -177,6 +177,10 @@ PeakMeter::configure_io (ChanCount in, ChanCount out) void PeakMeter::meter () { + if (!_active) { + return; + } + assert(_visible_peak_power.size() == _peak_power.size()); const size_t limit = _peak_power.size(); @@ -187,7 +191,7 @@ PeakMeter::meter () float new_peak = _peak_power[n]; /* XXX we should use atomic exchange from here ... */ _peak_power[n] = 0; /* ... to here */ - + /* compute new visible value using falloff */ if (new_peak > 0.0) { diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc index 216c199041..26c0cc6616 100644 --- a/libs/ardour/route.cc +++ b/libs/ardour/route.cc @@ -695,9 +695,7 @@ Route::add_processor (boost::shared_ptr<Processor> processor, ProcessorList::ite } // XXX: do we want to emit the signal here ? change call order. - if (!boost::dynamic_pointer_cast<InternalSend>(processor)) { - processor->activate (); - } + processor->activate (); processor->ActiveChanged.connect (bind (mem_fun (_session, &Session::update_latency_compensation), false, false)); _output->set_user_latency (0); @@ -1344,6 +1342,7 @@ Route::configure_processors_unlocked (ProcessorStreams* err) // Ensure route outputs match last processor's outputs if (out != _output->n_ports ()) { + cerr << "For " << _name << " out/last mismatch - out = " << out << " vs. " << _output->n_ports() << endl; _output->ensure_io (out, false, this); } @@ -2649,7 +2648,20 @@ void Route::meter () { Glib::RWLock::ReaderLock rm (_processor_lock, Glib::TRY_LOCK); + _meter->meter (); + + for (ProcessorList::iterator i = _processors.begin(); i != _processors.end(); ++i) { + + boost::shared_ptr<Send> s; + boost::shared_ptr<Return> r; + + if ((s = boost::dynamic_pointer_cast<Send> (*i)) != 0) { + s->meter()->meter(); + } else if ((r = boost::dynamic_pointer_cast<Return> (*i)) != 0) { + r->meter()->meter (); + } + } } boost::shared_ptr<Panner> diff --git a/libs/ardour/send.cc b/libs/ardour/send.cc index a4db60fc68..ea4c16a416 100644 --- a/libs/ardour/send.cc +++ b/libs/ardour/send.cc @@ -66,6 +66,24 @@ Send::~Send () } void +Send::activate () +{ + _amp->activate (); + _meter->activate (); + + Processor::activate (); +} + +void +Send::deactivate () +{ + _amp->deactivate (); + _meter->deactivate (); + + Processor::deactivate (); +} + +void Send::run (BufferSet& bufs, sframes_t start_frame, sframes_t end_frame, nframes_t nframes) { if (!_active || _output->n_ports() == ChanCount::ZERO) { @@ -155,6 +173,16 @@ Send::can_support_io_configuration (const ChanCount& in, ChanCount& out) const return true; } +bool +Send::configure_io (ChanCount in, ChanCount out) +{ + if (!_amp->configure_io (in, out) || !_meter->configure_io (in, out)) { + return false; + } + + return Processor::configure_io (in, out); +} + /** Set up the XML description of a send so that its name is unique. * @param state XML send state. * @param session Session. diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index ba6353ae39..4ed908dc7d 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -1592,7 +1592,7 @@ Session::new_midi_track (TrackMode mode, RouteGroup* route_group, uint32_t how_m } - if (track->output()->ensure_io (ChanCount(DataType::AUDIO, 1), false, this)) { + if (track->output()->ensure_io (ChanCount(DataType::MIDI, 1), false, this)) { error << "cannot configure 1 in/1 out configuration for new midi track" << endmsg; goto failed; } @@ -3784,11 +3784,8 @@ Session::ensure_buffers (ChanCount howmany) for (DataType::iterator t = DataType::begin(); t != DataType::end(); ++t) { size_t count = std::max(_scratch_buffers->available().get(*t), howmany.get(*t)); - cerr << "Ensure bufs for scratch at " << _scratch_buffers << " mirror ? " << _scratch_buffers->is_mirror() << endl; _scratch_buffers->ensure_buffers (*t, count, _engine.raw_buffer_size(*t)); - cerr << "Ensure bufs for mix at " << _mix_buffers << " mirror ? " << _mix_buffers->is_mirror() << endl; _mix_buffers->ensure_buffers (*t, count, _engine.raw_buffer_size(*t)); - cerr << "Ensure bufs for silent at " << _silent_buffers << " mirror ? " << _silent_buffers->is_mirror() << endl; _silent_buffers->ensure_buffers (*t, count, _engine.raw_buffer_size(*t)); } |