X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Freturn.cc;h=74b1cbeb32e4295045b6442fb54b252d4f2fb3fb;hb=9bf40bde3aed831791108bfccc4b1e10b071afdc;hp=cb61b0767aa025a2d2e569de509b79db6f58bea5;hpb=e9a8ccc7e2826d8fe91eff34ee8a0683a7f7aac6;p=ardour.git diff --git a/libs/ardour/return.cc b/libs/ardour/return.cc index cb61b0767a..74b1cbeb32 100644 --- a/libs/ardour/return.cc +++ b/libs/ardour/return.cc @@ -30,7 +30,7 @@ #include "ardour/return.h" #include "ardour/session.h" -#include "i18n.h" +#include "pbd/i18n.h" using namespace ARDOUR; using namespace PBD; @@ -64,19 +64,11 @@ Return::~Return () } XMLNode& -Return::get_state(void) +Return::state() { - return state (true); -} - -XMLNode& -Return::state(bool full) -{ - XMLNode& node = IOProcessor::state(full); - char buf[32]; - node.add_property ("type", "return"); - snprintf (buf, sizeof (buf), "%" PRIu32, _bitslot); - node.add_property ("bitslot", buf); + XMLNode& node = IOProcessor::state (); + node.set_property ("type", "return"); + node.set_property ("bitslot", _bitslot); return node; } @@ -86,7 +78,6 @@ Return::set_state (const XMLNode& node, int version) { XMLNodeList nlist = node.children(); XMLNodeIterator niter; - XMLProperty const * prop; const XMLNode* insert_node = &node; /* Return has regular IO automation (gain, pan) */ @@ -102,12 +93,13 @@ Return::set_state (const XMLNode& node, int version) IOProcessor::set_state (*insert_node, version); if (!node.property ("ignore-bitslot")) { - if ((prop = node.property ("bitslot")) == 0) { - _bitslot = _session.next_return_id(); - } else { + uint32_t bitslot; + if (node.get_property ("bitslot", bitslot)) { _session.unmark_return_id (_bitslot); - sscanf (prop->value().c_str(), "%" PRIu32, &_bitslot); + _bitslot = bitslot; _session.mark_return_id (_bitslot); + } else { + _bitslot = _session.next_return_id(); } } @@ -115,7 +107,7 @@ Return::set_state (const XMLNode& node, int version) } void -Return::run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, double speed, pframes_t nframes, bool) +Return::run (BufferSet& bufs, samplepos_t start_sample, samplepos_t end_sample, double speed, pframes_t nframes, bool) { if ((!_active && !_pending_active) || _input->n_ports() == ChanCount::ZERO) { return; @@ -126,14 +118,14 @@ Return::run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, doub // Can't automate gain for sends or returns yet because we need different buffers // so that we don't overwrite the main automation data for the route amp - // _amp->setup_gain_automation (start_frame, end_frame, nframes); - _amp->run (bufs, start_frame, end_frame, speed, nframes, true); + // _amp->setup_gain_automation (start_sample, end_sample, nframes); + _amp->run (bufs, start_sample, end_sample, speed, nframes, true); if (_metering) { if (_amp->gain_control()->get_value() == 0) { _meter->reset(); } else { - _meter->run (bufs, start_frame, end_frame, speed, nframes, true); + _meter->run (bufs, start_sample, end_sample, speed, nframes, true); } }