Merging from trunk
[ardour.git] / gtk2_ardour / regionview.cc
index c47694233fe57e9490f816d8c2e894fea95f31ca..114aaf5da37f2232d66c512c404bb47f3fddda87 100644 (file)
@@ -27,8 +27,8 @@
 
 #include <ardour/playlist.h>
 #include <ardour/audioregion.h>
-#include <ardour/sndfilesource.h>
-#include <ardour/diskstream.h>
+#include <ardour/audiosource.h>
+#include <ardour/audio_diskstream.h>
 
 #include "streamview.h"
 #include "regionview.h"
@@ -49,6 +49,7 @@
 
 using namespace sigc;
 using namespace ARDOUR;
+using namespace PBD;
 using namespace Editing;
 using namespace ArdourCanvas;
 
@@ -866,11 +867,15 @@ AudioRegionView::region_renamed ()
                str = region.name();
        }
 
+       if (region.speed_mismatch (trackview.session().frame_rate())) {
+               str = string ("*") + str;
+       }
+
        if (region.muted()) {
                str = string ("!") + str;
        }
 
-       set_item_name (region.name(), this);
+       set_item_name (str, this);
        set_name_text (str);
 }
 
@@ -987,12 +992,10 @@ AudioRegionView::create_waves ()
 
        uint32_t nchans = atv.get_diskstream()->n_channels();
        
-//     if (wait_for_waves) {
-               /* in tmp_waves, set up null pointers for each channel so the vector is allocated */
-               for (uint32_t n = 0; n < nchans; ++n) {
-                       tmp_waves.push_back (0);
-               }
-//     }
+       /* in tmp_waves, set up null pointers for each channel so the vector is allocated */
+       for (uint32_t n = 0; n < nchans; ++n) {
+               tmp_waves.push_back (0);
+       }
        
        for (uint32_t n = 0; n < nchans; ++n) {
                
@@ -1100,8 +1103,12 @@ AudioRegionView::create_one_wave (uint32_t which, bool direct)
 void
 AudioRegionView::peaks_ready_handler (uint32_t which)
 {
-       peaks_ready_connection.disconnect ();
        Gtkmm2ext::UI::instance()->call_slot (bind (mem_fun(*this, &AudioRegionView::create_one_wave), which, false));
+
+       if (!waves.empty()) {
+               /* all waves created, don't hook into peaks ready anymore */
+               peaks_ready_connection.disconnect ();           
+       }
 }
 
 void
@@ -1228,12 +1235,6 @@ AudioRegionView::set_waveform_shape (WaveformShape shape)
        }
 }
 
-std::string
-AudioRegionView::get_item_name ()
-{
-       return region.name();
-}
-
 void
 AudioRegionView::move (double x_delta, double y_delta)
 {