audio_chunk_impl_t< t_alloc > Class Template Reference

Implementation of audio_chunk. Takes pfc allocator template as template parameter. More...

#include <audio_chunk.h>

Inheritance diagram for audio_chunk_impl_t< t_alloc >:

audio_chunk

List of all members.

Public Member Functions

 audio_chunk_impl_t ()
 audio_chunk_impl_t (const audio_sample *src, unsigned samples, unsigned nch, unsigned srate)
 audio_chunk_impl_t (const audio_chunk &p_source)
 audio_chunk_impl_t (const t_self &p_source)
virtual audio_sampleget_data ()
virtual const audio_sampleget_data () const
virtual t_size get_data_size () const
 Retrieves size of allocated buffer space, in audio_samples.
virtual void set_data_size (t_size new_size)
 Resizes audio data buffer to specified size. Throws std::bad_alloc on failure.
virtual unsigned get_srate () const
 Retrieves sample rate of contained audio data.
virtual void set_srate (unsigned val)
 Sets sample rate of contained audio data.
virtual unsigned get_channels () const
 Retrieves channel count of contained audio data.
virtual unsigned get_channel_config () const
 Retrieves channel map of contained audio data. Conditions where number of channels specified by channel map don't match get_channels() return value should not be possible.
virtual void set_channels (unsigned val, unsigned setup)
 Sets channel count / channel map.
void set_channels (unsigned val)
 Helper; sets channel count to specified value and uses default channel map for this channel count.
virtual t_size get_sample_count () const
virtual void set_sample_count (t_size val)
 Sets number of valid samples in the buffer. WARNING: sample count * channel count should never be above allocated buffer size.
const t_selfoperator= (const audio_chunk &p_source)
const t_selfoperator= (const t_self &p_source)


Detailed Description

template<template< typename > class t_alloc = pfc::alloc_standard>
class audio_chunk_impl_t< t_alloc >

Implementation of audio_chunk. Takes pfc allocator template as template parameter.

Constructor & Destructor Documentation

template<template< typename > class t_alloc = pfc::alloc_standard>
audio_chunk_impl_t< t_alloc >::audio_chunk_impl_t (  )  [inline]

template<template< typename > class t_alloc = pfc::alloc_standard>
audio_chunk_impl_t< t_alloc >::audio_chunk_impl_t ( const audio_sample src,
unsigned  samples,
unsigned  nch,
unsigned  srate 
) [inline]

template<template< typename > class t_alloc = pfc::alloc_standard>
audio_chunk_impl_t< t_alloc >::audio_chunk_impl_t ( const audio_chunk p_source  )  [inline]

template<template< typename > class t_alloc = pfc::alloc_standard>
audio_chunk_impl_t< t_alloc >::audio_chunk_impl_t ( const t_self p_source  )  [inline]


Member Function Documentation

template<template< typename > class t_alloc = pfc::alloc_standard>
virtual audio_sample* audio_chunk_impl_t< t_alloc >::get_data (  )  [inline, virtual]

Retrieves audio data buffer pointer (non-const version). Returned pointer is for temporary use only; it is valid until next set_data_size call, or until the object is destroyed.
Size of returned buffer is equal to get_data_size() return value (in audio_samples). Amount of actual data may be smaller, depending on sample count and channel count. Conditions where sample count * channel count are greater than data size should not be possible.

Implements audio_chunk.

template<template< typename > class t_alloc = pfc::alloc_standard>
virtual const audio_sample* audio_chunk_impl_t< t_alloc >::get_data (  )  const [inline, virtual]

Retrieves audio data buffer pointer (const version). Returned pointer is for temporary use only; it is valid until next set_data_size call, or until the object is destroyed.
Size of returned buffer is equal to get_data_size() return value (in audio_samples). Amount of actual data may be smaller, depending on sample count and channel count. Conditions where sample count * channel count are greater than data size should not be possible.

Implements audio_chunk.

template<template< typename > class t_alloc = pfc::alloc_standard>
virtual t_size audio_chunk_impl_t< t_alloc >::get_data_size (  )  const [inline, virtual]

Retrieves size of allocated buffer space, in audio_samples.

Implements audio_chunk.

template<template< typename > class t_alloc = pfc::alloc_standard>
virtual void audio_chunk_impl_t< t_alloc >::set_data_size ( t_size  p_new_size  )  [inline, virtual]

Resizes audio data buffer to specified size. Throws std::bad_alloc on failure.

Implements audio_chunk.

template<template< typename > class t_alloc = pfc::alloc_standard>
virtual unsigned audio_chunk_impl_t< t_alloc >::get_srate (  )  const [inline, virtual]

Retrieves sample rate of contained audio data.

Implements audio_chunk.

template<template< typename > class t_alloc = pfc::alloc_standard>
virtual void audio_chunk_impl_t< t_alloc >::set_srate ( unsigned  val  )  [inline, virtual]

Sets sample rate of contained audio data.

Implements audio_chunk.

template<template< typename > class t_alloc = pfc::alloc_standard>
virtual unsigned audio_chunk_impl_t< t_alloc >::get_channels (  )  const [inline, virtual]

Retrieves channel count of contained audio data.

Implements audio_chunk.

template<template< typename > class t_alloc = pfc::alloc_standard>
virtual unsigned audio_chunk_impl_t< t_alloc >::get_channel_config (  )  const [inline, virtual]

Retrieves channel map of contained audio data. Conditions where number of channels specified by channel map don't match get_channels() return value should not be possible.

Implements audio_chunk.

template<template< typename > class t_alloc = pfc::alloc_standard>
virtual void audio_chunk_impl_t< t_alloc >::set_channels ( unsigned  p_count,
unsigned  p_config 
) [inline, virtual]

Sets channel count / channel map.

Implements audio_chunk.

template<template< typename > class t_alloc = pfc::alloc_standard>
void audio_chunk_impl_t< t_alloc >::set_channels ( unsigned  val  )  [inline]

Helper; sets channel count to specified value and uses default channel map for this channel count.

Reimplemented from audio_chunk.

template<template< typename > class t_alloc = pfc::alloc_standard>
virtual t_size audio_chunk_impl_t< t_alloc >::get_sample_count (  )  const [inline, virtual]

Retrieves number of valid samples in the buffer.
Note that a "sample" means a unit of interleaved PCM data representing states of each channel at given point of time, not a single PCM value.
For an example, duration of contained audio data is equal to sample count / sample rate, while actual size of contained data is equal to sample count * channel count.

Implements audio_chunk.

template<template< typename > class t_alloc = pfc::alloc_standard>
virtual void audio_chunk_impl_t< t_alloc >::set_sample_count ( t_size  val  )  [inline, virtual]

Sets number of valid samples in the buffer. WARNING: sample count * channel count should never be above allocated buffer size.

Implements audio_chunk.

template<template< typename > class t_alloc = pfc::alloc_standard>
const t_self& audio_chunk_impl_t< t_alloc >::operator= ( const audio_chunk p_source  )  [inline]

Reimplemented from audio_chunk.

template<template< typename > class t_alloc = pfc::alloc_standard>
const t_self& audio_chunk_impl_t< t_alloc >::operator= ( const t_self p_source  )  [inline]


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

Generated on Fri Apr 25 18:49:40 2008 for foobar2000 SDK by  doxygen 1.5.5