libpsynth 0.2.1
Classes | Functions
packed_sample_reference

Represents a reference proxy to a sample operating over a bit range whose offset is fixed at compile time. More...

Classes

class  psynth::sound::packed_sample_reference< BitField, FirstBit, NumBits, false >
 A constant subbyte sample reference whose bit offset is fixed at compile time. More...
class  psynth::sound::packed_sample_reference< BitField, FirstBit, NumBits, true >
 A mutable subbyte sample reference whose bit offset is fixed at compile time. More...

Functions

template<typename BF , int FB, int NB, bool M, typename R >
void std::swap (const psynth::sound::packed_sample_reference< BF, FB, NB, M > x, R &y)
 swap for packed_sample_reference
template<typename BF , int FB, int NB, bool M>
void std::swap (typename psynth::sound::packed_sample_reference< BF, FB, NB, M >::value_type &x, const psynth::sound::packed_sample_reference< BF, FB, NB, M > y)
 swap for packed_sample_reference
template<typename BF , int FB, int NB, bool M>
void std::swap (const psynth::sound::packed_sample_reference< BF, FB, NB, M > x, const psynth::sound::packed_sample_reference< BF, FB, NB, M > y)
 swap for packed_sample_reference

Detailed Description

Represents a reference proxy to a sample operating over a bit range whose offset is fixed at compile time.

Models SampleConcept

Example:

   // Reference to a 2-bit sample starting at bit 1 (i.e. the second bit)
   typedef const packed_sample_reference<uint16_t,1,2,true> bits2_1_ref_t;

   uint16_t data=0;
   bits2_1_ref_t sample_ref(&data);
   sample_ref = sample_traits<bits2_1_ref_t>::max_value();   // == 3
   assert(data == 6);                                          // == 3<<1 == 6

Function Documentation

template<typename BF , int FB, int NB, bool M, typename R >
void std::swap ( const psynth::sound::packed_sample_reference< BF, FB, NB, M >  x,
R &  y 
) [inline]

swap for packed_sample_reference

template<typename BF , int FB, int NB, bool M>
void std::swap ( const psynth::sound::packed_sample_reference< BF, FB, NB, M >  x,
const psynth::sound::packed_sample_reference< BF, FB, NB, M >  y 
) [inline]

swap for packed_sample_reference

template<typename BF , int FB, int NB, bool M>
void std::swap ( typename psynth::sound::packed_sample_reference< BF, FB, NB, M >::value_type &  x,
const psynth::sound::packed_sample_reference< BF, FB, NB, M >  y 
) [inline]

swap for packed_sample_reference