probably fix cleanup issues, but testing required
[ardour.git] / gtk2_ardour / audio_streamview.cc
index 349f472e6eac3aef9dca3343b42544028062e433..14036bc569c3603e23f537a95491ae2cb6239bdd 100644 (file)
@@ -48,6 +48,8 @@
 #include "utils.h"
 #include "color.h"
 
+#include "i18n.h"
+
 using namespace ARDOUR;
 using namespace PBD;
 using namespace Editing;
@@ -130,7 +132,7 @@ AudioStreamView::set_amplitude_above_axis (gdouble app)
 void
 AudioStreamView::add_region_view_internal (boost::shared_ptr<Region> r, bool wait_for_waves)
 {
-       AudioRegionView *region_view;
+       AudioRegionView *region_view = 0;
 
        ENSURE_GUI_THREAD (bind (mem_fun (*this, &AudioStreamView::add_region_view), r));
 
@@ -167,12 +169,25 @@ AudioStreamView::add_region_view_internal (boost::shared_ptr<Region> r, bool wai
                region_view = new TapeAudioRegionView (canvas_group, _trackview, region, 
                                                       _samples_per_unit, region_color);
                break;
+       default:
+               fatal << string_compose (_("programming error: %1"), "illegal track mode in ::add_region_view_internal") << endmsg;
+               /*NOTREACHED*/
+
        }
 
        region_view->init (region_color, wait_for_waves);
        region_view->set_amplitude_above_axis(_amplitude_above_axis);
        region_views.push_front (region_view);
 
+       
+       /* if its the special single-sample length that we use for rec-regions, make it 
+          insensitive to events 
+       */
+
+       if (region->length() == 1) {
+               region_view->set_sensitive (false);
+       }
+
        /* if this was the first one, then lets query the waveform scale and shape.
           otherwise, we set it to the current value */