projects
/
ardour.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix cURL/SSL
[ardour.git]
/
gtk2_ardour
/
port_matrix_component.cc
diff --git
a/gtk2_ardour/port_matrix_component.cc
b/gtk2_ardour/port_matrix_component.cc
index d98c557c3a3a8aff74e2842ba7812142f83715f1..5e11527d299fefc4f4369d7021905a0541320979 100644
(file)
--- a/
gtk2_ardour/port_matrix_component.cc
+++ b/
gtk2_ardour/port_matrix_component.cc
@@
-24,7
+24,8
@@
using namespace std;
/** Constructor.
using namespace std;
/** Constructor.
- * @param p Port matrix that we're in.
+ * @param m Port matrix that we're in.
+ * @param b Port matrix body that we're in.
*/
PortMatrixComponent::PortMatrixComponent (PortMatrix* m, PortMatrixBody* b)
: _matrix (m),
*/
PortMatrixComponent::PortMatrixComponent (PortMatrix* m, PortMatrixBody* b)
: _matrix (m),
@@
-40,7
+41,7
@@
PortMatrixComponent::PortMatrixComponent (PortMatrix* m, PortMatrixBody* b)
PortMatrixComponent::~PortMatrixComponent ()
{
if (_pixmap) {
PortMatrixComponent::~PortMatrixComponent ()
{
if (_pixmap) {
- g
dk_pixmap
_unref (_pixmap);
+ g
_object
_unref (_pixmap);
}
}
}
}
@@
-73,7
+74,7
@@
PortMatrixComponent::get_pixmap (GdkDrawable *drawable)
/* make a pixmap of the right size */
if (_pixmap) {
/* make a pixmap of the right size */
if (_pixmap) {
- g
dk_pixmap
_unref (_pixmap);
+ g
_object
_unref (_pixmap);
}
_pixmap = gdk_pixmap_new (drawable, _width, _height, -1);
}
_pixmap = gdk_pixmap_new (drawable, _width, _height, -1);
@@
-131,7
+132,7
@@
PortMatrixComponent::group_size (boost::shared_ptr<const PortGroup> g) const
s = bundles.size();
} else {
for (PortGroup::BundleList::const_iterator i = bundles.begin(); i != bundles.end(); ++i) {
s = bundles.size();
} else {
for (PortGroup::BundleList::const_iterator i = bundles.begin(); i != bundles.end(); ++i) {
- s +=
i->bundle->nchannels(
);
+ s +=
_matrix->count_of_our_type_min_1 ((*i)->bundle->nchannels()
);
}
}
}
}
@@
-139,7
+140,7
@@
PortMatrixComponent::group_size (boost::shared_ptr<const PortGroup> g) const
}
/** @param bc Channel.
}
/** @param bc Channel.
- * @param group
s List of groups
.
+ * @param group
Group
.
* @return Position of bc in groups in grid units, taking show_only_bundles into account.
*/
uint32_t
* @return Position of bc in groups in grid units, taking show_only_bundles into account.
*/
uint32_t
@@
-151,24
+152,24
@@
PortMatrixComponent::channel_to_position (ARDOUR::BundleChannel bc, boost::share
for (PortGroup::BundleList::const_iterator i = bundles.begin(); i != bundles.end(); ++i) {
for (PortGroup::BundleList::const_iterator i = bundles.begin(); i != bundles.end(); ++i) {
- if (
i
->bundle == bc.bundle) {
+ if (
(*i)
->bundle == bc.bundle) {
/* found the bundle */
/* found the bundle */
-
+
if (_matrix->show_only_bundles()) {
return p;
} else {
if (_matrix->show_only_bundles()) {
return p;
} else {
- return p + bc.
channel
;
+ return p + bc.
bundle->overall_channel_to_type (_matrix->type (), bc.channel)
;
}
}
-
+
}
/* move past this bundle */
}
/* move past this bundle */
-
+
if (_matrix->show_only_bundles()) {
p += 1;
} else {
if (_matrix->show_only_bundles()) {
p += 1;
} else {
- p +=
i->bundle->nchannels (
);
+ p +=
_matrix->count_of_our_type_min_1 ((*i)->bundle->nchannels()
);
}
}
}
}
@@
-180,30
+181,36
@@
ARDOUR::BundleChannel
PortMatrixComponent::position_to_channel (double p, double, boost::shared_ptr<const PortGroup> group) const
{
p /= grid_spacing ();
PortMatrixComponent::position_to_channel (double p, double, boost::shared_ptr<const PortGroup> group) const
{
p /= grid_spacing ();
-
+
PortGroup::BundleList const & bundles = group->bundles ();
for (PortGroup::BundleList::const_iterator j = bundles.begin(); j != bundles.end(); ++j) {
if (_matrix->show_only_bundles()) {
PortGroup::BundleList const & bundles = group->bundles ();
for (PortGroup::BundleList::const_iterator j = bundles.begin(); j != bundles.end(); ++j) {
if (_matrix->show_only_bundles()) {
-
+
if (p < 1) {
if (p < 1) {
- return ARDOUR::BundleChannel (
j
->bundle, -1);
+ return ARDOUR::BundleChannel (
(*j)
->bundle, -1);
} else {
p -= 1;
}
} else {
p -= 1;
}
-
+
} else {
} else {
-
- uint32_t const s = j->bundle->nchannels ();
+
+ ARDOUR::ChanCount const N = (*j)->bundle->nchannels ();
+
+ uint32_t const s = _matrix->count_of_our_type_min_1 (N);
if (p < s) {
if (p < s) {
- return ARDOUR::BundleChannel (j->bundle, p);
+ if (p < _matrix->count_of_our_type (N)) {
+ return ARDOUR::BundleChannel ((*j)->bundle, (*j)->bundle->type_channel_to_overall (_matrix->type (), p));
+ } else {
+ return ARDOUR::BundleChannel (boost::shared_ptr<ARDOUR::Bundle> (), -1);
+ }
} else {
p -= s;
}
} else {
p -= s;
}
-
+
}
}
-
+
}
}
-
+
return ARDOUR::BundleChannel (boost::shared_ptr<ARDOUR::Bundle> (), -1);
}
return ARDOUR::BundleChannel (boost::shared_ptr<ARDOUR::Bundle> (), -1);
}