*/
if (which < nchans) {
- tmp_waves[which] = (wave);
+ tmp_waves[which] = wave;
} else {
/* n-channel track, >n-channel source */
}
}
}
- if (n == nwaves) {
+ 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);
manage_zero_line ();
}
}
+ cerr << "done that time\n";
}
void
#include "taperegionview.h"
#include "audio_time_axis.h"
+#include "gui_thread.h"
#include "i18n.h"
set_colors ();
// ColorChanged.connect (mem_fun (*this, &AudioRegionView::color_handler));
+
+ /* every time the wave data changes and peaks are ready, redraw */
+
+ for (uint32_t n = 0; n < region.n_channels(); ++n) {
+ region.source(n).PeaksReady.connect (bind (mem_fun(*this, &TapeAudioRegionView::update), n));
+ }
+
}
TapeAudioRegionView::~TapeAudioRegionView()
{
}
+void
+TapeAudioRegionView::update (uint32_t n)
+{
+ /* check that all waves are build and ready */
+
+ if (!tmp_waves.empty()) {
+ return;
+ }
+
+ ENSURE_GUI_THREAD (bind (mem_fun(*this, &TapeAudioRegionView::update), n));
+
+ cerr << "peaks ready for channel " << n << endl;
+
+ cerr << "tmp waves size = " << tmp_waves.size() << " waves size = " << waves.size() << endl;
+
+ 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;
+ }
+
+ /* this triggers a cache invalidation and redraw in the waveview */
+
+ waves[n]->property_data_src() = ®ion;
+}
+
void
TapeAudioRegionView::set_frame_color ()
{
void init (double amplitude_above_axis, Gdk::Color& base_color, bool wait_for_waves);
void set_frame_color ();
+ void update (uint32_t n);
};
#endif /* __gtk_ardour_tape_audio_region_view_h__ */
{
LockMonitor lm (_lock, __LINE__, __FILE__);
- jack_nframes_t oldlen;
+ jack_nframes_t old_file_pos;
if (_capture_start && _capture_end) {
_capture_start = false;
}
}
- oldlen = _length;
+ old_file_pos = file_pos;
if (file_pos + cnt > _length) {
_length = file_pos + cnt;
}
pbr = pending_peak_builds.back();
}
- if (pbr && pbr->frame + pbr->cnt == oldlen) {
+ if (pbr && pbr->frame + pbr->cnt == old_file_pos) {
/* the last PBR extended to the start of the current write,
so just extend it again.
pbr->cnt += cnt;
} else {
- pending_peak_builds.push_back (new PeakBuildRecord (oldlen, cnt));
+ pending_peak_builds.push_back (new PeakBuildRecord (old_file_pos, cnt));
}
_peaks_built = false;
}
-
}
-
if (_build_peakfiles) {
queue_for_peaks (*this);
}
if (_build_peakfiles) {
PeakBuildRecord *pbr = 0;
-
+
if (pending_peak_builds.size()) {
pbr = pending_peak_builds.back();
}
pending_peak_builds.clear ();
}
-
#ifdef DEBUG_PEAK_BUILD
cerr << "build peaks with " << pending_peak_builds.size() << " requests pending\n";
#endif