1 2 3 4 5 6 7 8 9 10 11 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 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102
|
/*
* Modification History
*
* 2004-August-9 Jason Rohrer
* Created.
*/
#ifndef PARAMETERIZED_STEREO_SOUND_INCLUDED
#define PARAMETERIZED_STEREO_SOUND_INCLUDED
#include "minorGems/math/geometry/Vector3D.h"
#include "minorGems/graphics/Color.h"
#include "minorGems/util/SimpleVector.h"
#include "ParameterizedSpace.h"
#include "PlayableSound.h"
#include "StereoSoundParameterSpaceControlPoint.h"
/**
* A 1-D space of sound control points.
*
* @author Jason Rohrer.
*/
class ParameterizedStereoSound : public ParameterizedSpace {
public:
/**
* Constructs a sound by reading values from a text file
* stream.
*
* @param inFILE the open file to read from.
* Must be closed by caller.
* @param outError pointer to where error flag should be returned.
* Destination will be set to true if reading the sound
* from inFILE fails.
*/
ParameterizedStereoSound( FILE *inFILE, char *outError );
/**
* Gets a playable sound from this sound space.
*
* @param inParameter the parameter in the range [0,1] to map
* into the sound space.
* @param inSamplesPerSecond the current sample rate.
*
* @return a playable sound
* Can return NULL if this space was not properly initialized.
* Must be destroyed by caller.
*/
PlayableSound *getPlayableSound( double inParameter,
unsigned long inSamplesPerSecond );
/**
* Gets a blended sound control point from this sound space.
*
* @param inParameter the parameter in the range [0,1] to map
* into the sound space.
*
* @return the blended control point.
* Can return NULL if this space was not properly initialized.
* Must be destroyed by caller.
*/
StereoSoundParameterSpaceControlPoint *getBlendedControlPoint(
double inParameter );
/**
* Gets the length of the sound represented by this space.
*
* @return the sound length in seconds.
*/
double getSoundLengthInSeconds();
protected:
double mSoundLengthInSeconds;
// inherit other protected members from ParameterizedSpace
};
#endif
|