13
0

Rename can_add_channel slightly and add mysteriously-missing calls to it so that you don't get offered the chance to add ports where none can be added.

git-svn-id: svn://localhost/ardour2/branches/3.0@12349 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Carl Hetherington 2012-05-20 21:56:33 +00:00
parent 78237f3ac3
commit 57bd915d66
4 changed files with 19 additions and 17 deletions

View File

@ -101,13 +101,13 @@ BundleEditorMatrix::get_state (BundleChannel c[2]) const
}
bool
BundleEditorMatrix::can_add_channel (boost::shared_ptr<Bundle> b) const
BundleEditorMatrix::can_add_channels (boost::shared_ptr<Bundle> b) const
{
if (b == _bundle) {
return true;
}
return PortMatrix::can_add_channel (b);
return PortMatrix::can_add_channels (b);
}
void

View File

@ -42,7 +42,7 @@ class BundleEditorMatrix : public PortMatrix
void set_state (ARDOUR::BundleChannel c[2], bool s);
PortMatrixNode::State get_state (ARDOUR::BundleChannel c[2]) const;
bool can_add_channel (boost::shared_ptr<ARDOUR::Bundle>) const;
bool can_add_channels (boost::shared_ptr<ARDOUR::Bundle>) const;
void add_channel (boost::shared_ptr<ARDOUR::Bundle>, ARDOUR::DataType);
bool can_remove_channels (boost::shared_ptr<ARDOUR::Bundle>) const;

View File

@ -411,6 +411,7 @@ PortMatrix::popup_menu (BundleChannel column, BundleChannel row, uint32_t t)
boost::weak_ptr<Bundle> w (bc[dim].bundle);
if (can_add_channels (bc[dim].bundle)) {
/* Start off with options for the `natural' port type */
for (DataType::iterator i = DataType::begin(); i != DataType::end(); ++i) {
if (should_show (*i)) {
@ -426,6 +427,7 @@ PortMatrix::popup_menu (BundleChannel column, BundleChannel row, uint32_t t)
sub.push_back (MenuElem (buf, sigc::bind (sigc::mem_fun (*this, &PortMatrix::add_channel_proxy), w, *i)));
}
}
}
if (can_rename_channels (bc[dim].bundle)) {
snprintf (
@ -677,7 +679,7 @@ PortMatrix::io_from_bundle (boost::shared_ptr<Bundle> b) const
}
bool
PortMatrix::can_add_channel (boost::shared_ptr<Bundle> b) const
PortMatrix::can_add_channels (boost::shared_ptr<Bundle> b) const
{
return io_from_bundle (b);
}

View File

@ -141,7 +141,7 @@ public:
virtual PortMatrixNode::State get_state (ARDOUR::BundleChannel c[2]) const = 0;
virtual bool list_is_global (int) const = 0;
virtual bool can_add_channel (boost::shared_ptr<ARDOUR::Bundle>) const;
virtual bool can_add_channels (boost::shared_ptr<ARDOUR::Bundle>) const;
virtual void add_channel (boost::shared_ptr<ARDOUR::Bundle>, ARDOUR::DataType);
virtual bool can_remove_channels (boost::shared_ptr<ARDOUR::Bundle>) const;
virtual void remove_channel (ARDOUR::BundleChannel);