make it possible to (and actually do) name insert and send ports as "return" and "send" rather than "in" and "out" (#5012)
git-svn-id: svn://localhost/ardour2/branches/3.0@13052 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
@@ -74,8 +74,8 @@ class IO : public SessionObject, public Latent
|
||||
Output
|
||||
};
|
||||
|
||||
IO (Session&, const std::string& name, Direction, DataType default_type = DataType::AUDIO);
|
||||
IO (Session&, const XMLNode&, DataType default_type = DataType::AUDIO);
|
||||
IO (Session&, const std::string& name, Direction, DataType default_type = DataType::AUDIO, bool sendish = false);
|
||||
IO (Session&, const XMLNode&, DataType default_type = DataType::AUDIO, bool sendish = false);
|
||||
|
||||
virtual ~IO();
|
||||
|
||||
@@ -207,6 +207,7 @@ class IO : public SessionObject, public Latent
|
||||
Direction _direction;
|
||||
DataType _default_type;
|
||||
bool _active;
|
||||
bool _sendish;
|
||||
|
||||
private:
|
||||
int connecting_became_legal ();
|
||||
|
||||
@@ -44,10 +44,10 @@ class IOProcessor : public Processor
|
||||
{
|
||||
public:
|
||||
IOProcessor (Session&, bool with_input, bool with_output,
|
||||
const std::string& proc_name, const std::string io_name="",
|
||||
ARDOUR::DataType default_type = DataType::AUDIO);
|
||||
IOProcessor (Session&, boost::shared_ptr<IO> input, boost::shared_ptr<IO> output,
|
||||
const std::string& proc_name, ARDOUR::DataType default_type = DataType::AUDIO);
|
||||
const std::string& proc_name, const std::string io_name="",
|
||||
ARDOUR::DataType default_type = DataType::AUDIO, bool sendish=false);
|
||||
IOProcessor (Session&, boost::shared_ptr<IO> input, boost::shared_ptr<IO> output,
|
||||
const std::string& proc_name, ARDOUR::DataType default_type = DataType::AUDIO);
|
||||
virtual ~IOProcessor ();
|
||||
|
||||
bool set_name (const std::string& str);
|
||||
|
||||
@@ -71,7 +71,7 @@ Delivery::Delivery (Session& s, boost::shared_ptr<IO> io, boost::shared_ptr<Pann
|
||||
/* deliver to a new IO object */
|
||||
|
||||
Delivery::Delivery (Session& s, boost::shared_ptr<Pannable> pannable, boost::shared_ptr<MuteMaster> mm, const string& name, Role r)
|
||||
: IOProcessor(s, false, (role_requires_output_ports (r) ? true : false), name)
|
||||
: IOProcessor(s, false, (role_requires_output_ports (r) ? true : false), name, "", DataType::AUDIO, (r == Send))
|
||||
, _role (r)
|
||||
, _output_buffers (new BufferSet())
|
||||
, _current_gain (1.0)
|
||||
|
||||
@@ -58,10 +58,11 @@ PBD::Signal1<void,ChanCount> IO::PortCountChanged;
|
||||
/** @param default_type The type of port that will be created by ensure_io
|
||||
* and friends if no type is explicitly requested (to avoid breakage).
|
||||
*/
|
||||
IO::IO (Session& s, const string& name, Direction dir, DataType default_type)
|
||||
IO::IO (Session& s, const string& name, Direction dir, DataType default_type, bool sendish)
|
||||
: SessionObject (s, name)
|
||||
, _direction (dir)
|
||||
, _default_type (default_type)
|
||||
, _sendish (sendish)
|
||||
{
|
||||
_active = true;
|
||||
Port::PostDisconnect.connect_same_thread (*this, boost::bind (&IO::disconnect_check, this, _1, _2));
|
||||
@@ -69,10 +70,11 @@ IO::IO (Session& s, const string& name, Direction dir, DataType default_type)
|
||||
setup_bundle ();
|
||||
}
|
||||
|
||||
IO::IO (Session& s, const XMLNode& node, DataType dt)
|
||||
IO::IO (Session& s, const XMLNode& node, DataType dt, bool sendish)
|
||||
: SessionObject(s, "unnamed io")
|
||||
, _direction (Input)
|
||||
, _default_type (dt)
|
||||
, _sendish (sendish)
|
||||
{
|
||||
_active = true;
|
||||
pending_state_node = 0;
|
||||
@@ -1347,10 +1349,18 @@ IO::build_legal_port_name (DataType type)
|
||||
use the (new) translated name.
|
||||
*/
|
||||
|
||||
if (_direction == Input) {
|
||||
suffix += X_("_in");
|
||||
if (_sendish) {
|
||||
if (_direction == Input) {
|
||||
suffix += X_("_return");
|
||||
} else {
|
||||
suffix += X_("_send");
|
||||
}
|
||||
} else {
|
||||
suffix += X_("_out");
|
||||
if (_direction == Input) {
|
||||
suffix += X_("_in");
|
||||
} else {
|
||||
suffix += X_("_out");
|
||||
}
|
||||
}
|
||||
|
||||
// allow up to 4 digits for the output port number, plus the slash, suffix and extra space
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace ARDOUR { class Session; }
|
||||
/* create an IOProcessor that proxies to a new IO object */
|
||||
|
||||
IOProcessor::IOProcessor (Session& s, bool with_input, bool with_output,
|
||||
const string& proc_name, const string io_name, DataType dtype)
|
||||
const string& proc_name, const string io_name, DataType dtype, bool sendish)
|
||||
: Processor(s, proc_name)
|
||||
{
|
||||
/* these are true in this constructor whether we actually create the associated
|
||||
@@ -54,11 +54,11 @@ IOProcessor::IOProcessor (Session& s, bool with_input, bool with_output,
|
||||
_own_output = true;
|
||||
|
||||
if (with_input) {
|
||||
_input.reset (new IO(s, io_name.empty() ? proc_name : io_name, IO::Input, dtype));
|
||||
_input.reset (new IO(s, io_name.empty() ? proc_name : io_name, IO::Input, dtype, sendish));
|
||||
}
|
||||
|
||||
if (with_output) {
|
||||
_output.reset (new IO(s, io_name.empty() ? proc_name : io_name, IO::Output, dtype));
|
||||
_output.reset (new IO(s, io_name.empty() ? proc_name : io_name, IO::Output, dtype, sendish));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ PortInsert::name_and_id_new_insert (Session& s, uint32_t& bitslot)
|
||||
}
|
||||
|
||||
PortInsert::PortInsert (Session& s, boost::shared_ptr<Pannable> pannable, boost::shared_ptr<MuteMaster> mm)
|
||||
: IOProcessor (s, true, true, name_and_id_new_insert (s, _bitslot), "")
|
||||
: IOProcessor (s, true, true, name_and_id_new_insert (s, _bitslot), "", DataType::AUDIO, true)
|
||||
, _out (new Delivery (s, _output, pannable, mm, _name, Delivery::Insert))
|
||||
{
|
||||
_mtdm = 0;
|
||||
|
||||
Reference in New Issue
Block a user