#include "ardour/return.h"
#include "ardour/session.h"
-#include "i18n.h"
+#include "pbd/i18n.h"
using namespace ARDOUR;
using namespace PBD;
}
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;
}
{
XMLNodeList nlist = node.children();
XMLNodeIterator niter;
- XMLProperty const * prop;
const XMLNode* insert_node = &node;
/* Return has regular IO automation (gain, pan) */
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();
}
}
}
void
-Return::run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, 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;
// 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, 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, nframes, true);
+ _meter->run (bufs, start_sample, end_sample, speed, nframes, true);
}
}