VASamples.h 1.74 KB
Newer Older
Jonas Stienen's avatar
Jonas Stienen committed
1
/*
2
 *  --------------------------------------------------------------------------------------------
Jonas Stienen's avatar
Jonas Stienen committed
3 4
 *
 *    VVV        VVV A
5
 *     VVV      VVV AAA        Virtual Acoustics (VA)
Jonas Stienen's avatar
Jonas Stienen committed
6 7
 *      VVV    VVV   AAA       Real-time auralisation for virtual reality    
 *       VVV  VVV     AAA
8 9
 *        VVVVVV       AAA     (c) Copyright Institute of Technical Acoustics (ITA)
 *         VVVV         AAA        RWTH Aachen University (http://www.akustik.rwth-aachen.de)
Jonas Stienen's avatar
Jonas Stienen committed
10
 *
11
 *  --------------------------------------------------------------------------------------------
Jonas Stienen's avatar
Jonas Stienen committed
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
 */
  
// $Id: VASamples.h 2199 2011-11-23 21:30:53Z stienen $

#ifndef VA_INCLUDE_GUARD_VABASE_SAMPLES
#define VA_INCLUDE_GUARD_VABASE_SAMPLES

#include <VABaseDefinitions.h>
#include <vector>

//! Data base class for audio samples
/**
  * Not thread-safe. Uses 32-bit floating type.
  *
  * This class is the basis for any time data set.
  * VA provides network transmission, i.e. using
  * the VAStruct as transport container.
  *
  * In VACore, this class is derived for extended
  * functionality, i.e. for impulse responses.
  */
class VABASE_API CVASampleBuffer
{
public:
	CVASampleBuffer();
	CVASampleBuffer( int iNumSamples, bool bZeroInit = true );
	CVASampleBuffer( const CVASampleBuffer& );
	virtual ~CVASampleBuffer();

	//! Number of samples, zero if buffer is uninitialized
	int GetNumSamples() const;

	//! Pointer to first sample of buffer in memory
	float* GetData();

	//! Pointer to first sample of buffer in memory
	const float* GetDataReadOnly() const;

	//! Sets all samples to zero
	void SetZero();

	std::vector< float > vfSamples; //!< Vector of audio samples, 32-bit floating point precision


	CVASampleBuffer& operator=( const CVASampleBuffer& );
};

#endif // VA_INCLUDE_GUARD_VABASE_SAMPLES