summaryrefslogtreecommitdiff
path: root/libs/ardour/insert.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2007-01-05 16:31:15 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2007-01-05 16:31:15 +0000
commit4aac8ae0e51f848706750abd1a448fbabe55daab (patch)
treee0f38192e249a85e0d1d444290262898d9d51976 /libs/ardour/insert.cc
parentd631a8d89fd0a4b72a84c415ca2bdb4c2ca99bbc (diff)
use dynamic bitsets for send + port insert naming; fix up ardev, arval etc more generically
git-svn-id: svn://localhost/ardour2/trunk@1274 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/insert.cc')
-rw-r--r--libs/ardour/insert.cc30
1 files changed, 17 insertions, 13 deletions
diff --git a/libs/ardour/insert.cc b/libs/ardour/insert.cc
index 0416d3e1e4..8231cbbbe6 100644
--- a/libs/ardour/insert.cc
+++ b/libs/ardour/insert.cc
@@ -49,18 +49,13 @@ using namespace std;
using namespace ARDOUR;
using namespace PBD;
-Insert::Insert(Session& s, Placement p)
- : Redirect (s, s.next_insert_name(), p)
+Insert::Insert(Session& s, string name, Placement p)
+ : Redirect (s, name, p)
{
}
-Insert::Insert(Session& s, Placement p, int imin, int imax, int omin, int omax)
- : Redirect (s, s.next_insert_name(), p, imin, imax, omin, omax)
-{
-}
-
-Insert::Insert(Session& s, string name, Placement p)
- : Redirect (s, name, p)
+Insert::Insert(Session& s, string name, Placement p, int imin, int imax, int omin, int omax)
+ : Redirect (s, name, p, imin, imax, omin, omax)
{
}
@@ -833,7 +828,7 @@ PluginInsert::type ()
***************************************************************/
PortInsert::PortInsert (Session& s, Placement p)
- : Insert (s, p, 1, -1, 1, -1)
+ : Insert (s, string_compose (_("insert %1"), (bitslot = s.next_insert_id()) + 1), p, 1, -1, 1, -1)
{
init ();
RedirectCreated (this); /* EMIT SIGNAL */
@@ -841,7 +836,7 @@ PortInsert::PortInsert (Session& s, Placement p)
}
PortInsert::PortInsert (const PortInsert& other)
- : Insert (other._session, other.placement(), 1, -1, 1, -1)
+ : Insert (other._session, string_compose (_("insert %1"), (bitslot = other._session.next_insert_id()) + 1), other.placement(), 1, -1, 1, -1)
{
init ();
RedirectCreated (this); /* EMIT SIGNAL */
@@ -917,9 +912,11 @@ XMLNode&
PortInsert::state (bool full)
{
XMLNode *node = new XMLNode("Insert");
-
+ char buf[32];
node->add_child_nocopy (Redirect::state(full));
- node->add_property("type", "port");
+ node->add_property ("type", "port");
+ snprintf (buf, sizeof (buf), "%" PRIu32, bitslot);
+ node->add_property ("bitslot", buf);
return *node;
}
@@ -942,6 +939,13 @@ PortInsert::set_state(const XMLNode& node)
return -1;
}
+ if ((prop = node.property ("bitslot")) == 0) {
+ bitslot = _session.next_insert_id();
+ } else {
+ sscanf (prop->value().c_str(), "%" PRIu32, &bitslot);
+ _session.mark_insert_id (bitslot);
+ }
+
for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
if ((*niter)->name() == Redirect::state_node_name) {
Redirect::set_state (**niter);