X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;ds=sidebyside;f=pv%2Fdevices%2Finputfile.hpp;h=e08832f608d6247e9febce369f32c3b8aea843e5;hb=97378470ded88af84edaa0f1063d10d834475665;hp=55688fd453394f4bd00980a75456fbc76b26f918;hpb=5237f0c50352b523c6a0c3d7f931081ecdbdecaa;p=pulseview.git
diff --git a/pv/devices/inputfile.hpp b/pv/devices/inputfile.hpp
index 55688fd..e08832f 100644
--- a/pv/devices/inputfile.hpp
+++ b/pv/devices/inputfile.hpp
@@ -14,8 +14,7 @@
* 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
+ * along with this program; if not, see .
*/
#ifndef PULSEVIEW_PV_DEVICE_INPUTFILE_HPP
@@ -25,23 +24,43 @@
#include
-#include "device.hpp"
+#include "file.hpp"
+
+#include
+
+using std::atomic;
+using std::ifstream;
+using std::map;
+using std::shared_ptr;
+using std::streamsize;
+using std::string;
namespace pv {
namespace devices {
-class InputFile final : public Device
+class InputFile final : public File
{
private:
- static const std::streamsize BufferSize;
+ static const streamsize BufferSize;
public:
- InputFile(const std::shared_ptr &context,
- const std::string &file_name,
- std::shared_ptr format,
- const std::map &options);
+ InputFile(const shared_ptr &context,
+ const string &file_name,
+ shared_ptr format,
+ const map &options);
+
+ /**
+ * Constructor that loads a file using the metadata saved by
+ * save_meta_to_settings() before.
+ */
+ InputFile(const shared_ptr &context,
+ QSettings &settings);
+
+ void save_meta_to_settings(QSettings &settings);
+
+ void open();
- void create();
+ void close();
void start();
@@ -50,11 +69,13 @@ public:
void stop();
private:
- const std::shared_ptr context_;
- const std::shared_ptr input_;
- const std::string file_name_;
+ const shared_ptr context_;
+ shared_ptr format_;
+ map options_;
+ shared_ptr input_;
- std::atomic interrupt_;
+ ifstream *f;
+ atomic interrupt_;
};
} // namespace devices