X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=pv%2Fdevices%2Finputfile.hpp;fp=pv%2Fdevices%2Finputfile.hpp;h=55688fd453394f4bd00980a75456fbc76b26f918;hb=5237f0c50352b523c6a0c3d7f931081ecdbdecaa;hp=0000000000000000000000000000000000000000;hpb=e6c1382ebf0994e55e9470724df985a1b7750709;p=pulseview.git diff --git a/pv/devices/inputfile.hpp b/pv/devices/inputfile.hpp new file mode 100644 index 0000000..55688fd --- /dev/null +++ b/pv/devices/inputfile.hpp @@ -0,0 +1,64 @@ +/* + * This file is part of the PulseView project. + * + * Copyright (C) 2015 Joel Holdsworth + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef PULSEVIEW_PV_DEVICE_INPUTFILE_HPP +#define PULSEVIEW_PV_DEVICE_INPUTFILE_HPP + +#include + +#include + +#include "device.hpp" + +namespace pv { +namespace devices { + +class InputFile final : public Device +{ +private: + static const std::streamsize BufferSize; + +public: + InputFile(const std::shared_ptr &context, + const std::string &file_name, + std::shared_ptr format, + const std::map &options); + + void create(); + + void start(); + + void run(); + + void stop(); + +private: + const std::shared_ptr context_; + const std::shared_ptr input_; + const std::string file_name_; + + std::atomic interrupt_; +}; + +} // namespace devices +} // namespace pv + +#endif // PULSEVIEW_PV_SESSIONS_INPUTFILE_HPP +