X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=pv%2Fdevices%2Finputfile.cpp;h=13af3db9cd85c791935da6c80bf1a14220d492a0;hb=812c0e3592e51946947b55c54b906bf4a0cb30e9;hp=411877473b9bf30e235b990243c574f7418c1a61;hpb=5237f0c50352b523c6a0c3d7f931081ecdbdecaa;p=pulseview.git diff --git a/pv/devices/inputfile.cpp b/pv/devices/inputfile.cpp index 41187747..13af3db9 100644 --- a/pv/devices/inputfile.cpp +++ b/pv/devices/inputfile.cpp @@ -34,18 +34,26 @@ InputFile::InputFile(const std::shared_ptr &context, const std::string &file_name, std::shared_ptr format, const std::map &options) : + File(file_name), context_(context), input_(format->create_input(options)), - file_name_(file_name), interrupt_(false) { if (!input_) throw QString("Failed to create input"); } -void InputFile::create() { +void InputFile::open() { + if (session_) + close(); + session_ = context_->create_session(); } +void InputFile::close() { + if (session_) + session_->remove_devices(); +} + void InputFile::start() { }