along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id$
*/
#include <algorithm>
using namespace PBD;
Send::Send (Session& s, Placement p)
- : Redirect (s, s.next_send_name(), p)
+ : Redirect (s, string_compose (_("send %1"), (bitslot = s.next_send_id()) + 1), p)
{
_metering = false;
expected_inputs = 0;
- save_state (_("initial state"));
- RedirectCreated (this); /* EMIT SIGNAL */
+ RedirectCreated (this); /* EMIT SIGNAL */
}
Send::Send (Session& s, const XMLNode& node)
_metering = false;
expected_inputs = 0;
+ bitslot = 0xffffffff;
+
if (set_state (node)) {
throw failed_constructor();
}
- save_state (_("initial state"));
- RedirectCreated (this); /* EMIT SIGNAL */
+ RedirectCreated (this); /* EMIT SIGNAL */
}
Send::Send (const Send& other)
- : Redirect (other._session, other._session.next_send_name(), other.placement())
+ : Redirect (other._session, string_compose (_("send %1"), (bitslot = other._session.next_send_id()) + 1), other.placement())
{
_metering = false;
expected_inputs = 0;
- save_state (_("initial state"));
+
RedirectCreated (this); /* EMIT SIGNAL */
}
Send::state(bool full)
{
XMLNode *node = new XMLNode("Send");
- node->add_child_nocopy (Redirect::state(full));
+ char buf[32];
+ node->add_child_nocopy (Redirect::state (full));
+ snprintf (buf, sizeof (buf), "%" PRIu32, bitslot);
+ node->add_property ("bitslot", buf);
return *node;
}
{
XMLNodeList nlist = node.children();
XMLNodeIterator niter;
-
+ const XMLProperty* prop;
+
+ if ((prop = node.property ("bitslot")) == 0) {
+ bitslot = _session.next_send_id();
+ } else {
+ uint32_t old_bitslot = bitslot;
+ sscanf (prop->value().c_str(), "%" PRIu32, &bitslot);
+
+ if (bitslot != old_bitslot) {
+ _session.mark_send_id (bitslot);
+ }
+ }
+
+ /* Send has regular IO automation (gain, pan) */
+
for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
if ((*niter)->name() == Redirect::state_node_name) {
Redirect::set_state (**niter);
break;
+ } else if ((*niter)->name() == X_("Automation")) {
+ IO::set_automation_state (*(*niter));
}
}
}
void
-Send::run (vector<Sample *>& bufs, uint32_t nbufs, jack_nframes_t nframes, jack_nframes_t offset)
+Send::run (vector<Sample *>& bufs, uint32_t nbufs, nframes_t nframes, nframes_t offset)
{
if (active()) {