#include <QFileInfo>
#include <cassert>
+#include <memory>
#include <mutex>
#include <stdexcept>
using std::runtime_error;
using std::shared_ptr;
using std::string;
+using std::unique_ptr;
using std::unordered_set;
using std::vector;
const vector<shared_ptr<Channel>> channels = analog->channels();
const unsigned int channel_count = channels.size();
const size_t sample_count = analog->num_samples() / channel_count;
- const float *data = static_cast<const float *>(analog->data_pointer());
bool sweep_beginning = false;
+ unique_ptr<float> data(new float[analog->num_samples()]);
+ analog->get_data_as_float(data.get());
+
if (signalbases_.empty())
update_signals();
+ float *channel_data = data.get();
for (auto channel : channels) {
shared_ptr<data::AnalogSegment> segment;
assert(segment);
// Append the samples in the segment
- segment->append_interleaved_samples(data++, sample_count,
+ segment->append_interleaved_samples(channel_data++, sample_count,
channel_count);
}