const double pixels_offset = pp.pixels_offset();
const double samplerate = segment->samplerate();
- const double start_time = segment->start_time();
+ const pv::util::Timestamp& start_time = segment->start_time();
const int64_t last_sample = segment->get_sample_count() - 1;
const double samples_per_pixel = samplerate * pp.scale();
- const double start = samplerate * (pp.offset() - start_time);
- const double end = start + samples_per_pixel * pp.width();
+ const pv::util::Timestamp start = samplerate * (pp.offset() - start_time);
+ const pv::util::Timestamp end = start + samples_per_pixel * pp.width();
- const int64_t start_sample = min(max((int64_t)floor(start),
+ const int64_t start_sample = min(max(floor(start).convert_to<int64_t>(),
(int64_t)0), last_sample);
- const int64_t end_sample = min(max((int64_t)ceil(end) + 1,
+ const int64_t end_sample = min(max((ceil(end) + 1).convert_to<int64_t>(),
(int64_t)0), last_sample);
if (samples_per_pixel < EnvelopeThreshold)
QRectF *const rects = new QRectF[e.length];
QRectF *rect = rects;
- for(uint64_t sample = 0; sample < e.length-1; sample++) {
+ for (uint64_t sample = 0; sample < e.length-1; sample++) {
const float x = ((e.scale * sample + e.start) /
samples_per_pixel - pixels_offset) + left;
const AnalogSegment::EnvelopeSample *const s =
const float t = y - min(s->min, (s+1)->max) * scale_;
float h = b - t;
- if(h >= 0.0f && h <= 1.0f)
+ if (h >= 0.0f && h <= 1.0f)
h = 1.0f;
- if(h <= 0.0f && h >= -1.0f)
+ if (h <= 0.0f && h >= -1.0f)
h = -1.0f;
*rect++ = QRectF(x, t, 1.0f, h);