some (unfinished) work on incorporating Ben's rev 6919 changes regarding track select...
[ardour.git] / gtk2_ardour / port_matrix_component.cc
index f728f7bd8536660ec15f7f3de95c7bd15239aa7d..b2425dcef45ddd9e768dd1154bf57b518e70a9c1 100644 (file)
@@ -24,7 +24,8 @@
 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),
@@ -40,7 +41,7 @@ PortMatrixComponent::PortMatrixComponent (PortMatrix* m, PortMatrixBody* b)
 PortMatrixComponent::~PortMatrixComponent ()
 {
        if (_pixmap) {
-               gdk_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) {
-                       gdk_pixmap_unref (_pixmap);
+                       g_object_unref (_pixmap);
                }
                _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 += (*i)->bundle->nchannels();
+                       s += _matrix->count_of_our_type ((*i)->bundle->nchannels());
                }
        }
 
@@ -168,7 +169,7 @@ PortMatrixComponent::channel_to_position (ARDOUR::BundleChannel bc, boost::share
                if (_matrix->show_only_bundles()) {
                        p += 1;
                } else {
-                       p += (*i)->bundle->nchannels ();
+                       p += _matrix->count_of_our_type ((*i)->bundle->nchannels());
                }
        }
 
@@ -194,7 +195,7 @@ PortMatrixComponent::position_to_channel (double p, double, boost::shared_ptr<co
                        
                } else {
                        
-                       uint32_t const s = (*j)->bundle->nchannels ();
+                       uint32_t const s = _matrix->count_of_our_type ((*j)->bundle->nchannels());
                        if (p < s) {
                                return ARDOUR::BundleChannel ((*j)->bundle, p);
                        } else {