Nsound  0.9.4
Classes | Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
Nsound::AudioPlaybackRt Class Reference

#include <Nsound/AudioPlaybackRt.h>

Classes

struct  Driver
 

Public Member Functions

 AudioPlaybackRt (float64 sample_rate=44100.0, uint32 channels=1, uint32 n_buffers=3, float64 buffer_size_sec=-1.0)
 
 ~AudioPlaybackRt ()
 
uint32 getSamplesPerBuffer () const
 
float64 getActualLatencySeconds () const
 
void setBufferUnderrunMode (BufferUnderrunMode bum)
 
std::string getInfo ()
 Returns information about the backend driver. More...
 
void play (const AudioStream &a)
 Writes samples to the internal circular buffer to be played. More...
 
void play (const Buffer &b)
 Writes samples to the internal circular buffer to be played. More...
 
void play (float64 sample)
 Writes sample to the internal circular buffer to be played. More...
 
void play (float64 left, float64 right)
 Writes sample to the internal circular buffer to be played. More...
 
void stop ()
 Stops playback. More...
 
std::string debug_print ()
 
AudioPlaybackRtDebug get_debug_info () const
 
void _swig_shadow ()
 

Static Public Member Functions

static void use_jack (bool flag)
 

Private Types

typedef std::vector< int16Int16Vector
 
typedef std::vector
< Int16Vector * > 
Pool
 

Private Member Functions

 AudioPlaybackRt (const AudioPlaybackRt &copy)
 
AudioPlaybackRtoperator= (const AudioPlaybackRt &rhs)
 
int _callback (const void *input, void *output, const uint32 frame_count, const PaStreamCallbackTimeInfo *time_info, PaStreamCallbackFlags status_flags)
 
void _start ()
 

Static Private Member Functions

static int _pa_callback (const void *input, void *output, unsigned long frame_count, const PaStreamCallbackTimeInfo *time_info, PaStreamCallbackFlags status_flags, void *ap_obj)
 

Private Attributes

float64 sample_rate_
 
uint32 channels_
 
BufferUnderrunMode underrun_mode_
 
uint32 underrun_count_
 
uint32 overrun_count_
 
uint32 unknown_error_count_
 
uint32 stop_error_count_
 
uint32 pa_underrun_count_
 
uint32 pa_overrun_count_
 
std::vector< uint32n_history_
 
Sinesine_
 
Pool pool_
 
uint32 pool_size_
 
Pool::iterator pool_begin_
 
Pool::iterator pool_end_
 
uint32 n_ready_
 
Pool::iterator rd_ptr_
 
Pool::iterator wr_ptr_
 
uint32 wr_index_
 
Driver driver_
 
float64 actual_latency_sec_
 

Static Private Attributes

static bool use_jack_ = false
 

Detailed Description

Definition at line 90 of file AudioPlaybackRt.h.

Member Typedef Documentation

typedef std::vector< int16 > Nsound::AudioPlaybackRt::Int16Vector
private

Definition at line 159 of file AudioPlaybackRt.h.

typedef std::vector< Int16Vector * > Nsound::AudioPlaybackRt::Pool
private

Definition at line 160 of file AudioPlaybackRt.h.

Constructor & Destructor Documentation

Nsound::AudioPlaybackRt::AudioPlaybackRt ( float64  sample_rate = 44100.0,
uint32  channels = 1,
uint32  n_buffers = 3,
float64  buffer_size_sec = -1.0 
)

Definition at line 73 of file AudioPlaybackRt.cc.

References M_THROW.

74  {
75  M_THROW("Nsound was not compiled with portaudio.");
76  }
#define M_THROW(message)
Definition: Macros.h:108
Nsound::AudioPlaybackRt::~AudioPlaybackRt ( )

Definition at line 78 of file AudioPlaybackRt.cc.

78 {}
Nsound::AudioPlaybackRt::AudioPlaybackRt ( const AudioPlaybackRt copy)
inlineprivate

Definition at line 136 of file AudioPlaybackRt.h.

136 {}

Member Function Documentation

static void Nsound::AudioPlaybackRt::use_jack ( bool  flag)
inlinestatic

Definition at line 94 of file AudioPlaybackRt.h.

References use_jack_.

94 { use_jack_ = flag; }
uint32 Nsound::AudioPlaybackRt::getSamplesPerBuffer ( ) const
inline
float64 Nsound::AudioPlaybackRt::getActualLatencySeconds ( ) const
inline

Definition at line 105 of file AudioPlaybackRt.h.

References actual_latency_sec_.

105 { return actual_latency_sec_; }
void Nsound::AudioPlaybackRt::setBufferUnderrunMode ( BufferUnderrunMode  bum)

Definition at line 79 of file AudioPlaybackRt.cc.

79 {}
std::string Nsound::AudioPlaybackRt::getInfo ( )

Returns information about the backend driver.

Definition at line 80 of file AudioPlaybackRt.cc.

80 { return "nsound was compiled without rt playback"; }
void Nsound::AudioPlaybackRt::play ( const AudioStream a)

Writes samples to the internal circular buffer to be played.

Definition at line 81 of file AudioPlaybackRt.cc.

Referenced by Nsound::operator>>().

81 {}
void Nsound::AudioPlaybackRt::play ( const Buffer b)

Writes samples to the internal circular buffer to be played.

Definition at line 82 of file AudioPlaybackRt.cc.

82 {}
void Nsound::AudioPlaybackRt::play ( float64  sample)

Writes sample to the internal circular buffer to be played.

Definition at line 83 of file AudioPlaybackRt.cc.

83 {}
void Nsound::AudioPlaybackRt::play ( float64  left,
float64  right 
)

Writes sample to the internal circular buffer to be played.

Definition at line 84 of file AudioPlaybackRt.cc.

84 {}
void Nsound::AudioPlaybackRt::stop ( )

Stops playback.

Definition at line 85 of file AudioPlaybackRt.cc.

85 {}
std::string Nsound::AudioPlaybackRt::debug_print ( )

Definition at line 86 of file AudioPlaybackRt.cc.

86 { return "nsound was compiled without rt playback"; }
AudioPlaybackRtDebug Nsound::AudioPlaybackRt::get_debug_info ( ) const

Definition at line 88 of file AudioPlaybackRt.cc.

88 { return AudioPlaybackRtDebug(); }
void Nsound::AudioPlaybackRt::_swig_shadow ( )
inline

Definition at line 131 of file AudioPlaybackRt.h.

131 {}
AudioPlaybackRt& Nsound::AudioPlaybackRt::operator= ( const AudioPlaybackRt rhs)
inlineprivate

Definition at line 137 of file AudioPlaybackRt.h.

137 {return *this;}
int Nsound::AudioPlaybackRt::_callback ( const void *  input,
void *  output,
const uint32  frame_count,
const PaStreamCallbackTimeInfo time_info,
PaStreamCallbackFlags  status_flags 
)
private
static int Nsound::AudioPlaybackRt::_pa_callback ( const void *  input,
void *  output,
unsigned long  frame_count,
const PaStreamCallbackTimeInfo time_info,
PaStreamCallbackFlags  status_flags,
void *  ap_obj 
)
staticprivate
void Nsound::AudioPlaybackRt::_start ( )
private

Member Data Documentation

float64 Nsound::AudioPlaybackRt::sample_rate_
private

Definition at line 165 of file AudioPlaybackRt.h.

uint32 Nsound::AudioPlaybackRt::channels_
private

Definition at line 166 of file AudioPlaybackRt.h.

BufferUnderrunMode Nsound::AudioPlaybackRt::underrun_mode_
private

Definition at line 168 of file AudioPlaybackRt.h.

uint32 Nsound::AudioPlaybackRt::underrun_count_
private

Definition at line 170 of file AudioPlaybackRt.h.

uint32 Nsound::AudioPlaybackRt::overrun_count_
private

Definition at line 171 of file AudioPlaybackRt.h.

uint32 Nsound::AudioPlaybackRt::unknown_error_count_
private

Definition at line 172 of file AudioPlaybackRt.h.

uint32 Nsound::AudioPlaybackRt::stop_error_count_
private

Definition at line 173 of file AudioPlaybackRt.h.

uint32 Nsound::AudioPlaybackRt::pa_underrun_count_
private

Definition at line 175 of file AudioPlaybackRt.h.

uint32 Nsound::AudioPlaybackRt::pa_overrun_count_
private

Definition at line 176 of file AudioPlaybackRt.h.

std::vector<uint32> Nsound::AudioPlaybackRt::n_history_
private

Definition at line 178 of file AudioPlaybackRt.h.

Sine* Nsound::AudioPlaybackRt::sine_
private

Definition at line 180 of file AudioPlaybackRt.h.

Pool Nsound::AudioPlaybackRt::pool_
private

Definition at line 182 of file AudioPlaybackRt.h.

uint32 Nsound::AudioPlaybackRt::pool_size_
private

Definition at line 183 of file AudioPlaybackRt.h.

Pool::iterator Nsound::AudioPlaybackRt::pool_begin_
private

Definition at line 185 of file AudioPlaybackRt.h.

Pool::iterator Nsound::AudioPlaybackRt::pool_end_
private

Definition at line 186 of file AudioPlaybackRt.h.

uint32 Nsound::AudioPlaybackRt::n_ready_
private

Definition at line 191 of file AudioPlaybackRt.h.

Pool::iterator Nsound::AudioPlaybackRt::rd_ptr_
private

Definition at line 194 of file AudioPlaybackRt.h.

Pool::iterator Nsound::AudioPlaybackRt::wr_ptr_
private

Definition at line 195 of file AudioPlaybackRt.h.

uint32 Nsound::AudioPlaybackRt::wr_index_
private

Definition at line 197 of file AudioPlaybackRt.h.

Driver Nsound::AudioPlaybackRt::driver_
private

Definition at line 220 of file AudioPlaybackRt.h.

Referenced by getSamplesPerBuffer().

float64 Nsound::AudioPlaybackRt::actual_latency_sec_
private

Definition at line 222 of file AudioPlaybackRt.h.

Referenced by getActualLatencySeconds().

bool Nsound::AudioPlaybackRt::use_jack_ = false
staticprivate

Definition at line 224 of file AudioPlaybackRt.h.

Referenced by use_jack().


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