Make Bundles work a bit better. A few include optimisations.
[ardour.git] / gtk2_ardour / ghostregion.cc
index 6384baffa03c9647014f6b70dd07f6dfbfc9ea70..7b92ab815b14b28ef203c621bca75fcc0dd5f889 100644 (file)
@@ -43,7 +43,7 @@ GhostRegion::GhostRegion (ArdourCanvas::Group* parent, TimeAxisView& tv, TimeAxi
        base_rect = new ArdourCanvas::SimpleRect (*group);
        base_rect->property_x1() = (double) 0.0;
        base_rect->property_y1() = (double) 0.0;
-       base_rect->property_y2() = (double) trackview.height;
+       base_rect->property_y2() = (double) trackview.current_height();
        base_rect->property_outline_what() = (guint32) 0;
 
        if (!is_automation_ghost()) {
@@ -59,9 +59,9 @@ GhostRegion::GhostRegion (ArdourCanvas::Group* parent, TimeAxisView& tv, TimeAxi
 
 GhostRegion::~GhostRegion ()
 {
-       /*GoingAway (this);
+       GoingAway (this);
        delete base_rect;
-       delete group;*/
+       delete group;
 }
 
 void
@@ -73,7 +73,7 @@ GhostRegion::set_duration (double units)
 void
 GhostRegion::set_height ()
 {
-       base_rect->property_y2() = (double) trackview.height;
+       base_rect->property_y2() = (double) trackview.current_height();
 }
 
 void
@@ -101,7 +101,7 @@ GhostRegion::is_automation_ghost() {
 }
 
 AudioGhostRegion::AudioGhostRegion(TimeAxisView& tv, TimeAxisView& source_tv, double initial_unit_pos)
-       : GhostRegion(tv.ghost_group, tv, source_tv, initial_unit_pos) {
+       : GhostRegion(tv.ghost_group(), tv, source_tv, initial_unit_pos) {
 }
 
 void
@@ -121,7 +121,7 @@ AudioGhostRegion::set_height ()
 
        GhostRegion::set_height();
 
-       ht = ((trackview.height) / (double) waves.size());
+       ht = ((trackview.current_height()) / (double) waves.size());
        
        for (n = 0, i = waves.begin(); i != waves.end(); ++i, ++n) {
                gdouble yoff = n * ht;
@@ -157,7 +157,7 @@ AudioGhostRegion::set_colors ()
  * no range controller in these tracks. maybe show the whole range.
  */
 MidiGhostRegion::MidiGhostRegion(TimeAxisView& tv, TimeAxisView& source_tv, double initial_unit_pos)
-       : GhostRegion(tv.ghost_group, tv, source_tv, initial_unit_pos)
+       : GhostRegion(tv.ghost_group(), tv, source_tv, initial_unit_pos)
 {
 
        base_rect->lower_to_bottom();
@@ -174,7 +174,7 @@ MidiGhostRegion::~MidiGhostRegion()
        //clear_events();
 }
 
-MidiGhostRegion::Event::Event(ArdourCanvas::CanvasMidiEvent* e)
+MidiGhostRegion::Event::Event(ArdourCanvas::CanvasNoteEvent* e)
        : event(e)
 {
 }