- if (sr_session_save_init(_file_name.c_str(),
- data->samplerate(), probes) != SR_OK) {
- _error = tr("Error while saving.");
+ try {
+ auto context = session_.session()->context();
+ auto output_format = context->output_formats()["srzip"];
+ auto device = session_.device();
+ output_ = output_format->create_output(device,
+ {{"filename",
+ Glib::Variant<Glib::ustring>::create(file_name_)}});
+ auto meta = context->create_meta_packet(
+ {{ConfigKey::SAMPLERATE,
+ Glib::Variant<guint64>::create(data->samplerate())}});
+ output_->receive(meta);
+ } catch (Error error) {
+ error_ = tr("Error while saving.");