#ifndef _OF_SAMPLE_SOUND
#define _OF_SAMPLE_SOUND

#include "fmod.h"
#include "ofFmodUtils.h"


//		TO DO :
//		---------------------------
// 		-fft via fmod, as in the last time...
// 		-close fmod if it's up
// 		-streaming	(long mp3s, urls, etc)
//		-loadSoundForStreaming(char * fileName);
//		---------------------------

// 		interesting:
//		http://www.compuphase.com/mp3/mp3loops.htm


// ---------------------------------------------------------------------------- SOUND SYSTEM FMOD

// --------------------- global functions:
void ofSoundStopAll();
void ofSoundSetVolume(float vol);
void ofSoundSetUseSpectrum(bool use);
float * ofSoundGetSpectrum(int nBands);			// max 512...

// --------------------- player functions:
class ofSoundPlayer{	

	public:

		
		ofSoundPlayer();
		
		void  	loadSound(char * fileName);
		void 	unloadSound();
		void  	play();
		void  	stop();
		
		void 	setVolume(float vol);
		void 	setPan(float vol);
		void 	setSpeed(float spd);
		void 	setPaused(bool bP);
		void  	setLoop(bool bLp);
		void 	setMultiPlay(bool bMp);
		void 	setPosition(float pct);	// 0 = start, 1 = end;
		
		float  	getPosition();
		bool 	getIsPlaying(); 	
		float 	getSpeed();	
		float 	getPan();		

		bool 	bMultiPlay;
		bool 	bLoop;
		bool 	bLoadedOk;
		bool  	bPaused;
		int 	channel;				// in Fmod, what channel am I playing on?
		float 	pan;					// 0 - 1
		float 	volume;				// 0 - 1
		float 	internalFreq;		// 44100 ?
		float 	speed;				// -n to n, 1 = normal, -1 backwards
		int 	length;				// in samples;
		
		FSOUND_SAMPLE  * samp;
		

};

#endif // _OF_SAMPLE_SOUND
