#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"
using namespace sigc;
using namespace ARDOUR;
+using namespace PBD;
using namespace Editing;
using namespace ArdourCanvas;
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);
}
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) {
wave_caches.push_back (WaveView::create_cache ());
if (wait_for_waves) {
- if (region.source(n).peaks_ready (bind (mem_fun(*this, &AudioRegionView::peaks_ready_handler), n))) {
+ if (region.source(n).peaks_ready (bind (mem_fun(*this, &AudioRegionView::peaks_ready_handler), n), peaks_ready_connection)) {
create_one_wave (n, true);
} else {
create_zero_line = false;
}
}
- cerr << "wave ready, n = " << n << " nwaves = " << nwaves << " new wave = " << wave
- << " tmp[" << which << "] = " << tmp_waves[which] << endl;
-
if (n == nwaves && waves.empty()) {
/* all waves are ready */
tmp_waves.resize(nwaves);
-
- for (uint32_t x = 0; x < tmp_waves.size(); ++x) {
- cerr << "tmp_waves[" << x << "] = " << tmp_waves[x] << endl;
- }
-
waves = tmp_waves;
tmp_waves.clear ();
- cerr << "all waves ready, copied over ...\n";
-
- for (uint32_t x = 0; x < waves.size(); ++x) {
- cerr << "waves[" << x << "] = " << waves[x] << endl;
- }
-
- for (vector<WaveView*>::iterator i = waves.begin(); i != waves.end(); ++i) {
- cerr << "iterator[" << distance (i, waves.begin()) << "] = " << (*i) << endl;
- }
- cerr << "--------\n";
-
if (!zero_line) {
zero_line = new ArdourCanvas::SimpleLine (*group);
zero_line->property_x1() = (gdouble) 1.0;
manage_zero_line ();
}
}
- cerr << "done that time\n";
}
void
AudioRegionView::peaks_ready_handler (uint32_t which)
{
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
}
}
-std::string
-AudioRegionView::get_item_name ()
-{
- return region.name();
-}
-
void
AudioRegionView::move (double x_delta, double y_delta)
{