gdouble yoff = n * ht;
- if (region.source(n).peaks_ready (bind (mem_fun(*this, &CrossfadeEditor::peaks_ready), ®ion, which))) {
+ if (region.source(n).peaks_ready (bind (mem_fun(*this, &CrossfadeEditor::peaks_ready), ®ion, which), peaks_ready_connection)) {
WaveView* waveview = new WaveView (*(canvas->root()));
will be ready by the time we want them. but our API forces us
to provide this, so ..
*/
-
+ peaks_ready_connection.disconnect ();
make_waves (*r, which);
}
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)
{
+ peaks_ready_connection.disconnect ();
Gtkmm2ext::UI::instance()->call_slot (bind (mem_fun(*this, &AudioRegionView::create_one_wave), which, false));
}
int read_peaks (PeakData *peaks, jack_nframes_t npeaks, jack_nframes_t start, jack_nframes_t cnt, double samples_per_unit) const;
int build_peaks ();
- bool peaks_ready (sigc::slot<void>) const;
+ bool peaks_ready (sigc::slot<void>, sigc::connection&) const;
static sigc::signal<void,Source*> SourceCreated;
bool
-Source::peaks_ready (sigc::slot<void> the_slot) const
+Source::peaks_ready (sigc::slot<void> the_slot, sigc::connection& conn) const
{
bool ret;
LockMonitor lm (_lock, __LINE__, __FILE__);
*/
if (!(ret = _peaks_built)) {
- PeaksReady.connect (the_slot);
+ conn = PeaksReady.connect (the_slot);
}
return ret;