foobar2000 SDK  2015-08-03
Public Member Functions | Static Public Member Functions | Data Fields
t_samplespec

#include <output.h>

Public Member Functions

 t_samplespec ()
 
 t_samplespec (audio_chunk const &in)
 
void fromchunk (const audio_chunk &p_chunk)
 
bool is_valid () const
 
bool operator!= (const t_samplespec &p_spec2) const
 
bool operator== (const t_samplespec &p_spec2) const
 
void reset ()
 
double samples_to_time (t_size p_samples) const
 
t_size time_to_samples (double p_time) const
 

Static Public Member Functions

static t_samplespec g_fromchunk (const audio_chunk &p_chunk)
 

Data Fields

t_uint32 m_channel_config
 
t_uint32 m_channels
 
t_uint32 m_sample_rate
 

Detailed Description

Definition at line 54 of file output.h.

Constructor & Destructor Documentation

t_samplespec::t_samplespec ( )
inline

Definition at line 61 of file output.h.

61 {reset();}
void reset()
Definition: output.h:64
t_samplespec::t_samplespec ( audio_chunk const &  in)
inline

Definition at line 62 of file output.h.

62 {fromchunk(in);}
void fromchunk(const audio_chunk &p_chunk)
Definition: output.h:82

Member Function Documentation

void t_samplespec::fromchunk ( const audio_chunk p_chunk)
inline

Definition at line 82 of file output.h.

82  {
83  m_sample_rate = p_chunk.get_sample_rate();
84  m_channels = p_chunk.get_channels();
86  }
t_uint32 m_channels
Definition: output.h:56
unsigned get_sample_rate() const
Helper, same as get_srate().
Definition: audio_chunk.h:103
virtual unsigned get_channels() const =0
Retrieves channel count of contained audio data.
t_uint32 m_sample_rate
Definition: output.h:55
virtual unsigned get_channel_config() const =0
Retrieves channel map of contained audio data. Conditions where number of channels specified by chann...
t_uint32 m_channel_config
Definition: output.h:56
static t_samplespec t_samplespec::g_fromchunk ( const audio_chunk p_chunk)
inlinestatic

Definition at line 78 of file output.h.

78  {
79  t_samplespec temp; temp.fromchunk(p_chunk); return temp;
80  }
void fromchunk(const audio_chunk &p_chunk)
Definition: output.h:82
bool t_samplespec::is_valid ( ) const
inline

Definition at line 74 of file output.h.

74  {
76  }
t_uint32 m_channels
Definition: output.h:56
t_uint32 m_sample_rate
Definition: output.h:55
static unsigned g_count_channels(unsigned p_config)
Counts channels specified by channel map.
t_uint32 m_channel_config
Definition: output.h:56
bool t_samplespec::operator!= ( const t_samplespec p_spec2) const
inline

Definition at line 70 of file output.h.

70  {
71  return !(*this == p_spec2);
72  }
bool t_samplespec::operator== ( const t_samplespec p_spec2) const
inline

Definition at line 66 of file output.h.

66  {
67  return m_sample_rate == p_spec2.m_sample_rate && m_channels == p_spec2.m_channels && m_channel_config == p_spec2.m_channel_config;
68  }
t_uint32 m_channels
Definition: output.h:56
t_uint32 m_sample_rate
Definition: output.h:55
t_uint32 m_channel_config
Definition: output.h:56
void t_samplespec::reset ( )
inline

Definition at line 64 of file output.h.

t_uint32 m_channels
Definition: output.h:56
t_uint32 m_sample_rate
Definition: output.h:55
t_uint32 m_channel_config
Definition: output.h:56
double t_samplespec::samples_to_time ( t_size  p_samples) const
inline

Definition at line 59 of file output.h.

59 {PFC_ASSERT(is_valid()); return audio_math::samples_to_time(p_samples,m_sample_rate);}
bool is_valid() const
Definition: output.h:74
t_uint32 m_sample_rate
Definition: output.h:55
t_size t_samplespec::time_to_samples ( double  p_time) const
inline

Definition at line 58 of file output.h.

58 {PFC_ASSERT(is_valid());return (t_size)audio_math::time_to_samples(p_time,m_sample_rate);}
bool is_valid() const
Definition: output.h:74
t_uint32 m_sample_rate
Definition: output.h:55
size_t t_size
Definition: int_types.h:48

Field Documentation

t_uint32 t_samplespec::m_channel_config

Definition at line 56 of file output.h.

t_uint32 t_samplespec::m_channels

Definition at line 56 of file output.h.

t_uint32 t_samplespec::m_sample_rate

Definition at line 55 of file output.h.


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