type = _default_type;
}
+ ChanCount before = _ports.count ();
+ ChanCount after = before;
+ after.set (type, after.get (type) + 1);
+
+ bool const r = PortCountChanging (after); /* EMIT SIGNAL */
+ if (r) {
+ return -1;
+ }
+
IOChange change;
{
void
IO::set_name_in_state (XMLNode& node, const string& new_name)
{
- const XMLProperty* prop;
-
- if ((prop = node.property ("name")) != 0) {
- node.add_property ("name", new_name);
+ node.add_property (X_("name"), new_name);
+ XMLNodeList children = node.children ();
+ for (XMLNodeIterator i = children.begin(); i != children.end(); ++i) {
+ if ((*i)->name() == X_("Port")) {
+ string const old_name = (*i)->property(X_("name"))->value();
+ string const old_name_second_part = old_name.substr (old_name.find_first_of ("/") + 1);
+ (*i)->add_property (X_("name"), string_compose ("%1/%2", new_name, old_name_second_part));
+ }
}
}
return false;
}
-/** Caller must hold process lock */
+/** Call a processor's ::run() method, giving it our buffers
+ * Caller must hold process lock.
+ */
void
IO::process_input (boost::shared_ptr<Processor> proc, framepos_t start_frame, framepos_t end_frame, pframes_t nframes)
{
/* don't read the data into new buffers - just use the port buffers directly */
+ if (n_ports().n_total() == 0) {
+ /* We have no ports, so nothing to process */
+ return;
+ }
+
_buffers.get_jack_port_addresses (_ports, nframes);
proc->run (_buffers, start_frame, end_frame, nframes, true);
}