void
WaveView::image_ready ()
{
- DEBUG_TRACE (DEBUG::WaveView, string_compose ("queue draw for %1 at %2 (vis = %3 bbox = %4 CR %5)\n", this, g_get_monotonic_time(), visible(), _bounding_box, current_request));
+ DEBUG_TRACE (DEBUG::WaveView, string_compose ("queue draw for %1 at %2 (vis = %3 CR %4)\n", this, g_get_monotonic_time(), visible(), current_request));
redraw ();
}
outline_context->stroke ();
} else {
- const double height_2 = _height * .5;
+ const int height_zero = floor( _height * .5);
for (int i = 0; i < n_peaks; ++i) {
}
}
- /* zero line, show only if there is enough spread */
+ /* zero line, show only if there is enough spread
+ or the waveform line does not cross zero line */
- if (tips[i].spread >= 5.0 && show_zero_line()) {
- zero_context->move_to (i, floor(height_2));
+ if (show_zero_line() && ((tips[i].spread >= 5.0) || (tips[i].top > height_zero ) || (tips[i].bot < height_zero)) ) {
+ zero_context->move_to (i, height_zero);
zero_context->rel_line_to (1.0, 0);
}
boost::shared_ptr<WaveViewCache::Entry>
WaveView::cache_request_result (boost::shared_ptr<WaveViewThreadRequest> req) const
{
+
boost::shared_ptr<WaveViewCache::Entry> ret (new WaveViewCache::Entry (req->channel,
req->height,
req->amplitude,
if (peaks_read > 0) {
+ /* region amplitude will have been used to generate the
+ * peak values already, but not the visual-only
+ * amplitude_above_axis. So apply that here before
+ * rendering.
+ */
+
if (_amplitude_above_axis != 1.0) {
for (framecnt_t i = 0; i < n_peaks; ++i) {
peaks[i].max *= _amplitude_above_axis;