Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
roc::sndio::SndfileSource Class Reference

Sndfile source. More...

#include <sndfile_source.h>

Inheritance diagram for roc::sndio::SndfileSource:
Collaboration diagram for roc::sndio::SndfileSource:

Public Member Functions

 SndfileSource (core::IArena &arena, const Config &config)
 Initialize. More...
 
bool is_valid () const
 Check if the object was successfully constructed. More...
 
bool open (const char *driver, const char *path)
 Open input file or device. More...
 
virtual ISinkto_sink ()
 Cast IDevice to ISink. More...
 
virtual ISourceto_source ()
 Cast IDevice to ISink. More...
 
virtual DeviceType type () const
 Get device type. More...
 
virtual DeviceState state () const
 Get device state. More...
 
virtual void pause ()
 Pause reading. More...
 
virtual bool resume ()
 Resume paused reading. More...
 
virtual bool restart ()
 Restart reading from the beginning. More...
 
virtual audio::SampleSpec sample_spec () const
 Get sample specification of the source. More...
 
virtual core::nanoseconds_t latency () const
 Get latency of the source. More...
 
virtual bool has_latency () const
 Check if the source supports latency reports. More...
 
virtual bool has_clock () const
 Check if the source has own clock. More...
 
virtual void reclock (core::nanoseconds_t timestamp)
 Adjust source clock to match consumer clock. More...
 
virtual bool read (audio::Frame &)
 Read frame. More...
 
- Public Member Functions inherited from roc::core::ListNode< Tag >
ListDatalist_data () const
 Get pointer to internal data. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from roc::core::ListNode< Tag >
static ListNodelist_node (ListData *data)
 Get pointer to parent node from pointer to internal data. More...
 

Detailed Description

Sndfile source.

Remarks
Reads samples from input file. Supports multiple drivers for different file types.

Definition at line 34 of file sndfile_source.h.

Constructor & Destructor Documentation

◆ SndfileSource()

roc::sndio::SndfileSource::SndfileSource ( core::IArena arena,
const Config config 
)

Initialize.

Member Function Documentation

◆ has_clock()

virtual bool roc::sndio::SndfileSource::has_clock ( ) const
virtual

Check if the source has own clock.

Implements roc::sndio::IDevice.

◆ has_latency()

virtual bool roc::sndio::SndfileSource::has_latency ( ) const
virtual

Check if the source supports latency reports.

Implements roc::sndio::IDevice.

◆ is_valid()

bool roc::sndio::SndfileSource::is_valid ( ) const

Check if the object was successfully constructed.

◆ latency()

virtual core::nanoseconds_t roc::sndio::SndfileSource::latency ( ) const
virtual

Get latency of the source.

Implements roc::sndio::IDevice.

◆ open()

bool roc::sndio::SndfileSource::open ( const char *  driver,
const char *  path 
)

Open input file or device.

Parameters

  • driver is input format name;
  • path is input file name, "-" for stdin.
Remarks
If driver is NULL, default is used.

◆ pause()

virtual void roc::sndio::SndfileSource::pause ( )
virtual

Pause reading.

Implements roc::sndio::IDevice.

◆ read()

virtual bool roc::sndio::SndfileSource::read ( audio::Frame )
virtual

Read frame.

Implements roc::audio::IFrameReader.

◆ reclock()

virtual void roc::sndio::SndfileSource::reclock ( core::nanoseconds_t  timestamp)
virtual

Adjust source clock to match consumer clock.

Implements roc::sndio::ISource.

◆ restart()

virtual bool roc::sndio::SndfileSource::restart ( )
virtual

Restart reading from the beginning.

Implements roc::sndio::IDevice.

◆ resume()

virtual bool roc::sndio::SndfileSource::resume ( )
virtual

Resume paused reading.

Implements roc::sndio::IDevice.

◆ sample_spec()

virtual audio::SampleSpec roc::sndio::SndfileSource::sample_spec ( ) const
virtual

Get sample specification of the source.

Implements roc::sndio::IDevice.

◆ state()

virtual DeviceState roc::sndio::SndfileSource::state ( ) const
virtual

Get device state.

Implements roc::sndio::IDevice.

◆ to_sink()

virtual ISink* roc::sndio::SndfileSource::to_sink ( )
virtual

Cast IDevice to ISink.

Implements roc::sndio::IDevice.

◆ to_source()

virtual ISource* roc::sndio::SndfileSource::to_source ( )
virtual

Cast IDevice to ISink.

Implements roc::sndio::IDevice.

◆ type()

virtual DeviceType roc::sndio::SndfileSource::type ( ) const
virtual

Get device type.

Implements roc::sndio::IDevice.


The documentation for this class was generated from the following file: