mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-08 07:45:00 +01:00
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:
parent
78237f3ac3
commit
57bd915d66
4 changed files with 19 additions and 17 deletions
|
|
@ -101,13 +101,13 @@ BundleEditorMatrix::get_state (BundleChannel c[2]) const
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
BundleEditorMatrix::can_add_channel (boost::shared_ptr<Bundle> b) const
|
BundleEditorMatrix::can_add_channels (boost::shared_ptr<Bundle> b) const
|
||||||
{
|
{
|
||||||
if (b == _bundle) {
|
if (b == _bundle) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return PortMatrix::can_add_channel (b);
|
return PortMatrix::can_add_channels (b);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ class BundleEditorMatrix : public PortMatrix
|
||||||
void set_state (ARDOUR::BundleChannel c[2], bool s);
|
void set_state (ARDOUR::BundleChannel c[2], bool s);
|
||||||
PortMatrixNode::State get_state (ARDOUR::BundleChannel c[2]) const;
|
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);
|
void add_channel (boost::shared_ptr<ARDOUR::Bundle>, ARDOUR::DataType);
|
||||||
bool can_remove_channels (boost::shared_ptr<ARDOUR::Bundle>) const;
|
bool can_remove_channels (boost::shared_ptr<ARDOUR::Bundle>) const;
|
||||||
|
|
|
||||||
|
|
@ -411,19 +411,21 @@ PortMatrix::popup_menu (BundleChannel column, BundleChannel row, uint32_t t)
|
||||||
|
|
||||||
boost::weak_ptr<Bundle> w (bc[dim].bundle);
|
boost::weak_ptr<Bundle> w (bc[dim].bundle);
|
||||||
|
|
||||||
/* Start off with options for the `natural' port type */
|
if (can_add_channels (bc[dim].bundle)) {
|
||||||
for (DataType::iterator i = DataType::begin(); i != DataType::end(); ++i) {
|
/* Start off with options for the `natural' port type */
|
||||||
if (should_show (*i)) {
|
for (DataType::iterator i = DataType::begin(); i != DataType::end(); ++i) {
|
||||||
snprintf (buf, sizeof (buf), _("Add %s %s"), (*i).to_i18n_string(), channel_noun().c_str());
|
if (should_show (*i)) {
|
||||||
sub.push_back (MenuElem (buf, sigc::bind (sigc::mem_fun (*this, &PortMatrix::add_channel_proxy), w, *i)));
|
snprintf (buf, sizeof (buf), _("Add %s %s"), (*i).to_i18n_string(), channel_noun().c_str());
|
||||||
|
sub.push_back (MenuElem (buf, sigc::bind (sigc::mem_fun (*this, &PortMatrix::add_channel_proxy), w, *i)));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
/* Now add other ones */
|
||||||
/* Now add other ones */
|
for (DataType::iterator i = DataType::begin(); i != DataType::end(); ++i) {
|
||||||
for (DataType::iterator i = DataType::begin(); i != DataType::end(); ++i) {
|
if (!should_show (*i)) {
|
||||||
if (!should_show (*i)) {
|
snprintf (buf, sizeof (buf), _("Add %s %s"), (*i).to_i18n_string(), channel_noun().c_str());
|
||||||
snprintf (buf, sizeof (buf), _("Add %s %s"), (*i).to_i18n_string(), channel_noun().c_str());
|
sub.push_back (MenuElem (buf, sigc::bind (sigc::mem_fun (*this, &PortMatrix::add_channel_proxy), w, *i)));
|
||||||
sub.push_back (MenuElem (buf, sigc::bind (sigc::mem_fun (*this, &PortMatrix::add_channel_proxy), w, *i)));
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -677,7 +679,7 @@ PortMatrix::io_from_bundle (boost::shared_ptr<Bundle> b) const
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
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);
|
return io_from_bundle (b);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -141,7 +141,7 @@ public:
|
||||||
virtual PortMatrixNode::State get_state (ARDOUR::BundleChannel c[2]) const = 0;
|
virtual PortMatrixNode::State get_state (ARDOUR::BundleChannel c[2]) const = 0;
|
||||||
virtual bool list_is_global (int) 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 void add_channel (boost::shared_ptr<ARDOUR::Bundle>, ARDOUR::DataType);
|
||||||
virtual bool can_remove_channels (boost::shared_ptr<ARDOUR::Bundle>) const;
|
virtual bool can_remove_channels (boost::shared_ptr<ARDOUR::Bundle>) const;
|
||||||
virtual void remove_channel (ARDOUR::BundleChannel);
|
virtual void remove_channel (ARDOUR::BundleChannel);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue