X-Git-Url: http://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fdevices%2Finputfile.cpp;fp=pv%2Fdevices%2Finputfile.cpp;h=3ddc8ae00db06042b97f5e10f599560b3d69b22b;hp=13af3db9cd85c791935da6c80bf1a14220d492a0;hb=2ad82c2e40b6865481733913a2c32735602f63c4;hpb=a3f678a7cad210fe796f4a76370996a1284da6d4 diff --git a/pv/devices/inputfile.cpp b/pv/devices/inputfile.cpp index 13af3db9..3ddc8ae0 100644 --- a/pv/devices/inputfile.cpp +++ b/pv/devices/inputfile.cpp @@ -37,27 +37,32 @@ InputFile::InputFile(const std::shared_ptr &context, File(file_name), context_(context), input_(format->create_input(options)), - interrupt_(false) { + interrupt_(false) +{ if (!input_) throw QString("Failed to create input"); } -void InputFile::open() { +void InputFile::open() +{ if (session_) close(); session_ = context_->create_session(); } -void InputFile::close() { +void InputFile::close() +{ if (session_) session_->remove_devices(); } -void InputFile::start() { +void InputFile::start() +{ } -void InputFile::run() { +void InputFile::run() +{ char buffer[BufferSize]; bool need_device = true; @@ -92,7 +97,8 @@ void InputFile::run() { input_->end(); } -void InputFile::stop() { +void InputFile::stop() +{ interrupt_ = true; }