summaryrefslogtreecommitdiff
path: root/gr-blocks/include/blocks/file_source.h
diff options
context:
space:
mode:
authorTom Rondeau2012-12-11 22:48:03 -0500
committerTom Rondeau2012-12-11 22:58:21 -0500
commit95968f9e32cf8ea7b8f632f431f91adf49a353a7 (patch)
tree9311b3af77c6f09ef93a900a647aa3ae8eaf17f0 /gr-blocks/include/blocks/file_source.h
parentee53cca50e3f39ddc1d44669c3ea9f0d73d32022 (diff)
downloadgnuradio-95968f9e32cf8ea7b8f632f431f91adf49a353a7.tar.gz
gnuradio-95968f9e32cf8ea7b8f632f431f91adf49a353a7.tar.bz2
gnuradio-95968f9e32cf8ea7b8f632f431f91adf49a353a7.zip
blocks: apply changes to file source in core to one in gr-blocks.
Diffstat (limited to 'gr-blocks/include/blocks/file_source.h')
-rw-r--r--gr-blocks/include/blocks/file_source.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/gr-blocks/include/blocks/file_source.h b/gr-blocks/include/blocks/file_source.h
index 6207cdf70..1a12aa905 100644
--- a/gr-blocks/include/blocks/file_source.h
+++ b/gr-blocks/include/blocks/file_source.h
@@ -40,6 +40,21 @@ namespace gr {
// gr::blocks::file_source::sptr
typedef boost::shared_ptr<file_source> sptr;
+ /*!
+ * \brief Create a file source.
+ *
+ * Opens \p filename as a source of items into a flowgraph. The
+ * data is expected to be in binary format, item after item. The
+ * \p itemsize of the block determines the conversion from bits
+ * to items.
+ *
+ * If \p repeat is turned on, the file will repeat the file after
+ * it's reached the end.
+ *
+ * \param itemsize the size of each item in the file, in bytes
+ * \param filename name of the file to source from
+ * \param repeat repeat file from start
+ */
static sptr make(size_t itemsize, const char *filename, bool repeat = false);
/*!
@@ -49,6 +64,19 @@ namespace gr {
* \param whence one of SEEK_SET, SEEK_CUR, SEEK_END (man fseek)
*/
virtual bool seek(long seek_point, int whence) = 0;
+
+ /*!
+ * \brief Opens a new file.
+ *
+ * \param filename name of the file to source from
+ * \param repeat repeat file from start
+ */
+ virtual void open(const char *filename, bool repeat) = 0;
+
+ /*!
+ * \brief Close the file handle.
+ */
+ virtual void close() = 0;
};
} /* namespace blocks */