foobar2000 SDK
2015-08-03
|
#include <vis.h>
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 () | |
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.
visualisation_stream::FB2K_MAKE_SERVICE_INTERFACE | ( | visualisation_stream | , |
service_base | |||
) |
|
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.
|
pure virtual |
Retrieves an audio chunk starting at specified offset (see get_absolute_time()), of specified length.
|
pure virtual |
Retrieves spectrum for audio data at specified offset (see get_absolute_time()), with specified FFT size.
p_chunk | Receives 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_offset | Timestamp of spectrum to retrieve. See get_absolute_time(). |
p_fft_size | FFT size to use for spectrum generation. Must be a power of 2. |
|
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.
|
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.