+ selected_sample_range_ = make_pair(0, numeric_limits<uint64_t>::max());
+ on_export_all_rows_from_here();
+}
+
+void DecodeTrace::on_export_row_with_cursor()
+{
+ const View *view = owner_->view();
+ assert(view);
+
+ if (!view->cursors()->enabled())
+ return;
+
+ const double samplerate = session_.get_samplerate();
+
+ const pv::util::Timestamp& start_time = view->cursors()->first()->time();
+ const pv::util::Timestamp& end_time = view->cursors()->second()->time();
+
+ const uint64_t start_sample = (uint64_t)max(
+ 0.0, start_time.convert_to<double>() * samplerate);
+ const uint64_t end_sample = (uint64_t)max(
+ 0.0, end_time.convert_to<double>() * samplerate);
+
+ // Are both cursors negative and thus were clamped to 0?
+ if ((start_sample == 0) && (end_sample == 0))
+ return;
+
+ selected_sample_range_ = make_pair(start_sample, end_sample);
+ on_export_row_from_here();
+}
+
+void DecodeTrace::on_export_all_rows_with_cursor()
+{
+ const View *view = owner_->view();
+ assert(view);
+
+ if (!view->cursors()->enabled())
+ return;
+
+ const double samplerate = session_.get_samplerate();
+
+ const pv::util::Timestamp& start_time = view->cursors()->first()->time();
+ const pv::util::Timestamp& end_time = view->cursors()->second()->time();
+
+ const uint64_t start_sample = (uint64_t)max(
+ 0.0, start_time.convert_to<double>() * samplerate);
+ const uint64_t end_sample = (uint64_t)max(
+ 0.0, end_time.convert_to<double>() * samplerate);
+
+ // Are both cursors negative and thus were clamped to 0?
+ if ((start_sample == 0) && (end_sample == 0))
+ return;
+
+ selected_sample_range_ = make_pair(start_sample, end_sample);