foobar2000 SDK  2015-08-03
Data Structures | Typedefs | Functions
input_helpers.h File Reference

Go to the source code of this file.

Data Structures

class  dead_item_filter
 
class  input_helper
 
struct  input_helper::decodeOpen_t
 
class  input_helper_cue
 
class  input_info_read_helper
 
struct  openAudioData_t
 

Typedefs

typedef void(* _input_helper_io_filter) (service_ptr_t< file > &p_file, const char *p_path, t_filesize arg, abort_callback &p_abort)
 

Functions

openAudioData_t openAudioData (playable_location const &loc, bool bSeekable, file::ptr fileHint, abort_callback &aborter)
 

Data Structure Documentation

struct openAudioData_t

openAudioData return value, see openAudioData()

Definition at line 119 of file input_helpers.h.

Data Fields
ptr audioData
spec_t audioSpec

Typedef Documentation

typedef void(* _input_helper_io_filter) (service_ptr_t< file > &p_file, const char *p_path, t_filesize arg, abort_callback &p_abort)

Definition at line 4 of file input_helpers.h.

Function Documentation

openAudioData_t openAudioData ( playable_location const &  loc,
bool  bSeekable,
file::ptr  fileHint,
abort_callback aborter 
)

Opens the specified location as a stream of audio_samples.
Returns a file object that allows you to read the audio data stream as if it was a physical file, together with audio stream format description (sample rate, channel layout).
Please keep in mind that certain features of the returned file object are only as reliable as the underlying file format or decoder implementation allows them to be.
Reported exact file size may be either unavailable or unreliable if the file format does not let us known the exact value without decoding the whole file.
Seeking may be inaccurate with certain file formats.
In general, all file object methods will work as intended on core-supported file formats such as FLAC or WavPack.
However, if you want 100% functionality regardless of file format being worked with, mirror the content to a temp file and let go of the file object returned by openAudioData().

Definition at line 591 of file input_helpers.cpp.

591  {
593  f->init(loc, bSeekable, fileHint, aborter);
594 
595  openAudioData_t oad = {};
596  oad.audioData = f;
597  oad.audioSpec = f->get_spec();
598  return oad;
599 }
Template implementing reference-counting features of service_base. Intended for dynamic instantiation...
Definition: service_impl.h:4
file::ptr audioData
Autopointer class to be used with all services. Manages reference counter calls behind-the-scenes.
Definition: service.h:55
openAudioData return value, see openAudioData()
audio_chunk::spec_t audioSpec