foobar2000 SDK  2015-08-03
Public Member Functions
visualisation_streamabstract

#include <vis.h>

+ Inheritance diagram for visualisation_stream:

Public Member Functions

 FB2K_MAKE_SERVICE_INTERFACE (visualisation_stream, service_base)
 
virtual bool get_absolute_time (double &p_value)=0
 
virtual bool get_chunk_absolute (audio_chunk &p_chunk, double p_offset, double p_requested_length)=0
 
virtual bool get_spectrum_absolute (audio_chunk &p_chunk, double p_offset, unsigned p_fft_size)=0
 
virtual void make_fake_chunk_absolute (audio_chunk &p_chunk, double p_offset, double p_requested_length)=0
 
virtual void make_fake_spectrum_absolute (audio_chunk &p_chunk, double p_offset, unsigned p_fft_size)=0
 
- 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

- Public Types inherited from service_base
typedef service_base t_interface
 
- Protected Member Functions inherited from service_base
 service_base ()
 
 ~service_base ()
 

Detailed Description

This class provides abstraction for retrieving visualisation data. Instances of visualisation_stream being created/released serve as an indication for visualisation backend to process currently played audio data or shut down when there are no visualisation clients active.
Use visualisation_manager::create_stream to instantiate.

Definition at line 3 of file vis.h.

Member Function Documentation

visualisation_stream::FB2K_MAKE_SERVICE_INTERFACE ( visualisation_stream  ,
service_base   
)
virtual bool visualisation_stream::get_absolute_time ( double &  p_value)
pure virtual

Retrieves absolute playback time since last playback start or seek. You typically pass value retrieved by this function - optionally with offset added - to other visualisation_stream methods.

virtual bool visualisation_stream::get_chunk_absolute ( audio_chunk p_chunk,
double  p_offset,
double  p_requested_length 
)
pure virtual

Retrieves an audio chunk starting at specified offset (see get_absolute_time()), of specified length.

Returns
False when requested timestamp is out of available range, true on success.
virtual bool visualisation_stream::get_spectrum_absolute ( audio_chunk p_chunk,
double  p_offset,
unsigned  p_fft_size 
)
pure virtual

Retrieves spectrum for audio data at specified offset (see get_absolute_time()), with specified FFT size.

Parameters
p_chunkReceives spectrum data. audio_chunk type is used for consistency (since required functionality is identical to provided by audio_chunk), the data is not PCM. Returned sample count is equal to half of FFT size; channels and sample rate are as in audio stream the spectrum was generated from.
p_offsetTimestamp of spectrum to retrieve. See get_absolute_time().
p_fft_sizeFFT size to use for spectrum generation. Must be a power of 2.
Returns
False when requested timestamp is out of available range, true on success.
virtual void visualisation_stream::make_fake_chunk_absolute ( audio_chunk p_chunk,
double  p_offset,
double  p_requested_length 
)
pure virtual

Generates fake audio chunk to display when get_chunk_absolute() fails - e.g. shortly after visualisation_stream creation data for currently played audio might not be available yet. Throws std::exception derivatives on failure.

virtual void visualisation_stream::make_fake_spectrum_absolute ( audio_chunk p_chunk,
double  p_offset,
unsigned  p_fft_size 
)
pure virtual

Generates fake spectrum to display when get_spectrum_absolute() fails - e.g. shortly after visualisation_stream creation data for currently played audio might not be available yet. Throws std::exception derivatives on failure.


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