summaryrefslogtreecommitdiff
path: root/libs/ardour/port_manager.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2016-06-20 12:47:05 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2016-09-27 14:59:30 -0500
commit185051042359ee498443a5a90a75b1e332e274e5 (patch)
tree87fa6aa20b6ea0b4c4e25bd42da893624afb9f84 /libs/ardour/port_manager.cc
parent4e1d3f6416bed2ac79fbf15ead80968bdd036afd (diff)
change PortManager API to allow specifying additional flags when registering a port
Diffstat (limited to 'libs/ardour/port_manager.cc')
-rw-r--r--libs/ardour/port_manager.cc20
1 files changed, 12 insertions, 8 deletions
diff --git a/libs/ardour/port_manager.cc b/libs/ardour/port_manager.cc
index a5af8f2fe1..c6b2c0b47d 100644
--- a/libs/ardour/port_manager.cc
+++ b/libs/ardour/port_manager.cc
@@ -294,24 +294,28 @@ PortManager::port_registration_failure (const std::string& portname)
}
boost::shared_ptr<Port>
-PortManager::register_port (DataType dtype, const string& portname, bool input, bool async)
+PortManager::register_port (DataType dtype, const string& portname, bool input, bool async, PortFlags flags)
{
boost::shared_ptr<Port> newport;
+ /* limit the possible flags that can be set */
+
+ flags = PortFlags (flags & (Hidden|Shadow|IsTerminal));
+
try {
if (dtype == DataType::AUDIO) {
DEBUG_TRACE (DEBUG::Ports, string_compose ("registering AUDIO port %1, input %2\n",
portname, input));
- newport.reset (new AudioPort (portname, (input ? IsInput : IsOutput)));
+ newport.reset (new AudioPort (portname, PortFlags ((input ? IsInput : IsOutput) | flags)));
} else if (dtype == DataType::MIDI) {
if (async) {
DEBUG_TRACE (DEBUG::Ports, string_compose ("registering ASYNC MIDI port %1, input %2\n",
portname, input));
- newport.reset (new AsyncMIDIPort (portname, (input ? IsInput : IsOutput)));
+ newport.reset (new AsyncMIDIPort (portname, PortFlags ((input ? IsInput : IsOutput) | flags)));
} else {
DEBUG_TRACE (DEBUG::Ports, string_compose ("registering MIDI port %1, input %2\n",
portname, input));
- newport.reset (new MidiPort (portname, (input ? IsInput : IsOutput)));
+ newport.reset (new MidiPort (portname, PortFlags ((input ? IsInput : IsOutput) | flags)));
}
} else {
throw PortRegistrationFailure("unable to create port (unknown type)");
@@ -339,15 +343,15 @@ PortManager::register_port (DataType dtype, const string& portname, bool input,
}
boost::shared_ptr<Port>
-PortManager::register_input_port (DataType type, const string& portname, bool async)
+PortManager::register_input_port (DataType type, const string& portname, bool async, PortFlags extra_flags)
{
- return register_port (type, portname, true, async);
+ return register_port (type, portname, true, async, extra_flags);
}
boost::shared_ptr<Port>
-PortManager::register_output_port (DataType type, const string& portname, bool async)
+PortManager::register_output_port (DataType type, const string& portname, bool async, PortFlags extra_flags)
{
- return register_port (type, portname, false, async);
+ return register_port (type, portname, false, async, extra_flags);
}
int