libpsynth 0.2.1
Public Types | Public Member Functions | Public Attributes
psynth::synth::scaler< Range > Class Template Reference

Scaler implementation using the RubberBand library. More...

#include <scaler.hpp>

List of all members.

Public Types

typedef Range range

Public Member Functions

 static_assert (std::is_same< soundtouch::SAMPLETYPE, float >::value,"Soundtouch SAMPLETYPE must be flaot.")
 static_assert (scaler_support< Range >::is_supported::value,"Soundtouch supports only interleaved bits32sf ranges.")
 scaler (std::size_t frame_rate)
 Constructor.
void set_tempo (float tempo)
 Sets the tempo factor.
void set_rate (float rate)
 Sets the new sampling rate factor.
void set_pitch (float pitch)
 Sets the new pitch factor.
void set_frame_rate (int samplerate)
 Sets the sample rate of the original signal.
float tempo ()
 Returns the tempo scaling factor.
float rate ()
 Returns the rate scaling factor.
float pitch ()
 Returns the pitch scaling factor.
std::size_t available ()
 Returns the ammount of data availible in the scaler.
std::size_t receive (const Range &data)
 Pops some data already processed in the scaler.
void update (const Range &data)
 Push some data for scaling.
void clear ()
 Clears all the data left in the scaler.

Public Attributes

float _tempo
float _rate
float _pitch
soundtouch::SoundTouch _st

Detailed Description

template<class Range>
class psynth::synth::scaler< Range >

Scaler implementation using the RubberBand library.

See also:
Scaler

Member Typedef Documentation

template<class Range>
typedef Range psynth::synth::scaler< Range >::range

Constructor & Destructor Documentation

template<class Range>
psynth::synth::scaler< Range >::scaler ( std::size_t  frame_rate) [inline]

Constructor.


Member Function Documentation

template<class Range>
std::size_t psynth::synth::scaler< Range >::available ( ) [inline]

Returns the ammount of data availible in the scaler.

template<class Range>
void psynth::synth::scaler< Range >::clear ( ) [inline]

Clears all the data left in the scaler.

template<class Range>
float psynth::synth::scaler< Range >::pitch ( ) [inline]

Returns the pitch scaling factor.

template<class Range>
float psynth::synth::scaler< Range >::rate ( ) [inline]

Returns the rate scaling factor.

template<class Range>
std::size_t psynth::synth::scaler< Range >::receive ( const Range &  data) [inline]

Pops some data already processed in the scaler.

Parameters:
dataThe buffer to store the data. It will be stored in interleaved format.
samplesThe maximum number of samples to receive.
Returns:
The actual number of samples received.
template<class Range>
void psynth::synth::scaler< Range >::set_frame_rate ( int  samplerate) [inline]

Sets the sample rate of the original signal.

Parameters:
samplerateThe sampling rate.
template<class Range>
void psynth::synth::scaler< Range >::set_pitch ( float  pitch) [inline]

Sets the new pitch factor.

Parameters:
pitchThe new pitch factor.
template<class Range>
void psynth::synth::scaler< Range >::set_rate ( float  rate) [inline]

Sets the new sampling rate factor.

Parameters:
rateThe new rate factor.
template<class Range>
void psynth::synth::scaler< Range >::set_tempo ( float  tempo) [inline]

Sets the tempo factor.

Parameters:
tempoThe new tempo factor.
template<class Range>
psynth::synth::scaler< Range >::static_assert ( scaler_support< Range >::is_supported::value  ,
"Soundtouch supports only interleaved bits32sf ranges."   
)
template<class Range>
psynth::synth::scaler< Range >::static_assert ( std::is_same< soundtouch::SAMPLETYPE, float >::value  ,
"Soundtouch SAMPLETYPE must be flaot."   
)
template<class Range>
float psynth::synth::scaler< Range >::tempo ( ) [inline]

Returns the tempo scaling factor.

template<class Range>
void psynth::synth::scaler< Range >::update ( const Range &  data) [inline]

Push some data for scaling.

Parameters:
dataThe buffer with the data to scale in interleaved format.
samplesThe number of samples to push.

Member Data Documentation

template<class Range>
float psynth::synth::scaler< Range >::_pitch
template<class Range>
float psynth::synth::scaler< Range >::_rate
template<class Range>
soundtouch::SoundTouch psynth::synth::scaler< Range >::_st
template<class Range>
float psynth::synth::scaler< Range >::_tempo

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