foobar2000 SDK  2015-08-03
Public Types | Public Member Functions
dspabstract

#include <dsp.h>

+ Inheritance diagram for dsp:

Public Types

enum  { END_OF_TRACK = 1, FLUSH = 2 }
 
- Public Types inherited from service_base
typedef service_base t_interface
 

Public Member Functions

 FB2K_MAKE_SERVICE_INTERFACE (dsp, service_base)
 
virtual void flush ()=0
 
virtual double get_latency ()=0
 
virtual bool need_track_change_mark ()=0
 
virtual void run (dsp_chunk_list *p_chunk_list, const metadb_handle_ptr &p_cur_file, int p_flags)=0
 
void run_abortable (dsp_chunk_list *p_chunk_list, const metadb_handle_ptr &p_cur_file, int p_flags, abort_callback &p_abort)
 
- Public Member Functions inherited from service_base
template<typename outPtr_t >
bool cast (outPtr_t &outPtr)
 
virtual int service_add_ref ()=0 throw ()
 
virtual bool service_query (service_ptr_t< service_base > &p_out, const GUID &p_guid)
 
template<class T >
bool service_query_t (service_ptr_t< T > &p_out)
 
virtual int service_release ()=0 throw ()
 

Additional Inherited Members

- Protected Member Functions inherited from service_base
 service_base ()
 
 ~service_base ()
 

Detailed Description

Instance of a DSP.
Implementation: Derive from dsp_impl_base instead of deriving from dsp directly.
Instantiation: Use dsp_entry static helper methods to instantiate DSPs, or dsp_chain_config / dsp_manager to deal with entire DSP chains.

Definition at line 46 of file dsp.h.

Member Enumeration Documentation

anonymous enum
Enumerator
END_OF_TRACK 

Flush whatever you need to when tracks change.

FLUSH 

Flush everything.

Definition at line 48 of file dsp.h.

48  {
50  END_OF_TRACK = 1,
52  FLUSH = 2
53  };
Flush everything.
Definition: dsp.h:52
Flush whatever you need to when tracks change.
Definition: dsp.h:50

Member Function Documentation

dsp::FB2K_MAKE_SERVICE_INTERFACE ( dsp  ,
service_base   
)
virtual void dsp::flush ( )
pure virtual

Flushes the DSP (reinitializes / drops any buffered data). Called after seeking, etc.

virtual double dsp::get_latency ( )
pure virtual

Retrieves amount of data buffered by the DSP, for syncing visualisation.

Returns
Amount of buffered audio data, in seconds.
virtual bool dsp::need_track_change_mark ( )
pure virtual

Returns true if DSP needs to know exact track change point (eg. for crossfading, removing silence).
Signaling this will force-flush any DSPs placed before this DSP so when it gets END_OF_TRACK, relevant chunks contain last samples of the track.
Signaling this will often break regular gapless playback so don't use it unless you have reasons to.

virtual void dsp::run ( dsp_chunk_list p_chunk_list,
const metadb_handle_ptr p_cur_file,
int  p_flags 
)
pure virtual
Parameters
p_chunk_listList of chunks to process. The implementation may alter the list in any way, inserting chunks of different sample rate / channel configuration etc.
p_cur_fileOptional, location of currently decoded file. May be null.
p_flagsFlags. Can be null, or a combination of END_OF_TRACK and FLUSH constants.

Implemented in dsp_v2.

void dsp::run_abortable ( dsp_chunk_list p_chunk_list,
const metadb_handle_ptr p_cur_file,
int  p_flags,
abort_callback p_abort 
)

Definition at line 378 of file dsp.cpp.

378  {
379  service_ptr_t<dsp_v2> this_v2;
380  if (this->service_query_t(this_v2)) this_v2->run_v2(p_chunk_list,p_cur_file,p_flags,p_abort);
381  else run(p_chunk_list,p_cur_file,p_flags);
382 }
virtual void run(dsp_chunk_list *p_chunk_list, const metadb_handle_ptr &p_cur_file, int p_flags)=0
bool service_query_t(service_ptr_t< T > &p_out)
Queries whether the object supports specific interface and retrieves a pointer to that interface...
Definition: service.h:350
Autopointer class to be used with all services. Manages reference counter calls behind-the-scenes.
Definition: service.h:55

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