diff --git a/src/internal_modules/roc_sndio/target_sndfile/roc_sndio/sndfile_sink.cpp b/src/internal_modules/roc_sndio/target_sndfile/roc_sndio/sndfile_sink.cpp index 95e71f91b..53b7aa730 100644 --- a/src/internal_modules/roc_sndio/target_sndfile/roc_sndio/sndfile_sink.cpp +++ b/src/internal_modules/roc_sndio/target_sndfile/roc_sndio/sndfile_sink.cpp @@ -183,6 +183,14 @@ bool SndfileSink::open(const char* driver, const char* path) { return true; } +ISink* SndfileSink::to_sink() { + return this; +} + +ISource* SndfileSink::to_source() { + return NULL; +} + DeviceType SndfileSink::type() const { return DeviceType_Sink; } diff --git a/src/internal_modules/roc_sndio/target_sndfile/roc_sndio/sndfile_sink.h b/src/internal_modules/roc_sndio/target_sndfile/roc_sndio/sndfile_sink.h index 6f64d0e99..a23971e98 100644 --- a/src/internal_modules/roc_sndio/target_sndfile/roc_sndio/sndfile_sink.h +++ b/src/internal_modules/roc_sndio/target_sndfile/roc_sndio/sndfile_sink.h @@ -50,6 +50,12 @@ class SndfileSink : public ISink, public core::NonCopyable<> { //! If @p driver or @p path are NULL, defaults are used. bool open(const char* driver, const char* path); + //! Cast IDevice to ISink. + virtual ISink* to_sink(); + + //! Cast IDevice to ISink. + virtual ISource* to_source(); + //! Get device type. virtual DeviceType type() const; diff --git a/src/internal_modules/roc_sndio/target_sndfile/roc_sndio/sndfile_source.cpp b/src/internal_modules/roc_sndio/target_sndfile/roc_sndio/sndfile_source.cpp index 1aab39f69..61f83210c 100644 --- a/src/internal_modules/roc_sndio/target_sndfile/roc_sndio/sndfile_source.cpp +++ b/src/internal_modules/roc_sndio/target_sndfile/roc_sndio/sndfile_source.cpp @@ -72,6 +72,14 @@ bool SndfileSource::open(const char* driver, const char* path) { return true; } +ISink* SndfileSource::to_sink() { + return NULL; +} + +ISource* SndfileSource::to_source() { + return this; +} + DeviceType SndfileSource::type() const { return DeviceType_Source; } diff --git a/src/internal_modules/roc_sndio/target_sndfile/roc_sndio/sndfile_source.h b/src/internal_modules/roc_sndio/target_sndfile/roc_sndio/sndfile_source.h index 1b430fcb1..d30211dc4 100644 --- a/src/internal_modules/roc_sndio/target_sndfile/roc_sndio/sndfile_source.h +++ b/src/internal_modules/roc_sndio/target_sndfile/roc_sndio/sndfile_source.h @@ -51,6 +51,12 @@ class SndfileSource : public ISource, private core::NonCopyable<> { //! If @p driver or @p path are NULL, defaults are used. bool open(const char* driver, const char* path); + //! Cast IDevice to ISink. + virtual ISink* to_sink(); + + //! Cast IDevice to ISink. + virtual ISource* to_source(); + //! Get device type. virtual DeviceType type() const;