aboutsummaryrefslogtreecommitdiffstats
path: root/lib/file/file_source_c.cc
diff options
context:
space:
mode:
authorDimitri Stolnikov <horiz0n@gmx.net>2014-03-10 17:16:05 +0100
committerDimitri Stolnikov <horiz0n@gmx.net>2014-03-10 17:16:05 +0100
commite0d1fb0377e49cd8ba07906b21bbe41c8705f1b6 (patch)
treef28dad7f19851e220d719f449677b08ee1f5a98b /lib/file/file_source_c.cc
parent66109099132946b77c5e0b4603384a9194bf6694 (diff)
file: expose seek function in public API
Diffstat (limited to 'lib/file/file_source_c.cc')
-rw-r--r--lib/file/file_source_c.cc17
1 files changed, 10 insertions, 7 deletions
diff --git a/lib/file/file_source_c.cc b/lib/file/file_source_c.cc
index d4a0f1f..671c6c9 100644
--- a/lib/file/file_source_c.cc
+++ b/lib/file/file_source_c.cc
@@ -26,7 +26,6 @@
#include <boost/format.hpp>
#include <gnuradio/io_signature.h>
-#include <gnuradio/blocks/file_source.h>
#include "file_source_c.h"
@@ -78,18 +77,17 @@ file_source_c::file_source_c(const std::string &args) :
_file_rate = _rate;
- gr::blocks::file_source::sptr src = \
- gr::blocks::file_source::make( sizeof(gr_complex),
- filename.c_str(),
- repeat );
+ _source = gr::blocks::file_source::make( sizeof(gr_complex),
+ filename.c_str(),
+ repeat );
_throttle = gr::blocks::throttle::make( sizeof(gr_complex), _file_rate );
if (throttle) {
- connect( src, 0, _throttle, 0 );
+ connect( _source, 0, _throttle, 0 );
connect( _throttle, 0, self(), 0 );
} else {
- connect( src, 0, self(), 0 );
+ connect( _source, 0, self(), 0 );
}
}
@@ -122,6 +120,11 @@ size_t file_source_c::get_num_channels( void )
return 1;
}
+bool file_source_c::seek( long seek_point, int whence , size_t chan )
+{
+ return _source->seek( seek_point, whence );
+}
+
osmosdr::meta_range_t file_source_c::get_sample_rates( void )
{
osmosdr::meta_range_t range;