2009-06-21 05:24:30 +02:00
|
|
|
#ifndef IAUDIOMANAGER_H
|
|
|
|
#define IAUDIOMANAGER_H
|
|
|
|
#include <string>
|
2009-08-08 07:51:32 +02:00
|
|
|
#include "IListener.h"
|
2009-08-11 19:57:20 +02:00
|
|
|
#include "IAudioCapture.h"
|
2009-06-21 05:24:30 +02:00
|
|
|
|
|
|
|
#ifndef CAUDIO_STATIC_LIB
|
2009-08-08 07:51:32 +02:00
|
|
|
|
2009-06-21 05:24:30 +02:00
|
|
|
#ifdef CAUDIO_EXPORTS
|
|
|
|
#define CAUDIO_API __declspec(dllexport)
|
|
|
|
#else
|
|
|
|
#define CAUDIO_API//! __declspec(dllimport)
|
2009-08-08 07:51:32 +02:00
|
|
|
#endif // CAUDIO_EXPORTS
|
|
|
|
|
2009-06-21 05:24:30 +02:00
|
|
|
#else
|
|
|
|
#define CAUDIO_API
|
2009-08-08 07:51:32 +02:00
|
|
|
#endif // CAUDIO_STATIC_LIB
|
|
|
|
|
2009-06-21 05:24:30 +02:00
|
|
|
namespace cAudio
|
|
|
|
{
|
|
|
|
class IAudio;
|
2009-08-26 01:56:35 +02:00
|
|
|
class IAudioDecoderFactory;
|
2009-06-21 05:24:30 +02:00
|
|
|
|
|
|
|
class IAudioManager
|
|
|
|
{
|
|
|
|
public:
|
2009-08-26 01:56:35 +02:00
|
|
|
//!Inits the audio manager calling the alut/etc start ups
|
|
|
|
virtual void init(int argc,char* argv[]) = 0;
|
2009-08-08 07:51:32 +02:00
|
|
|
//!Shuts everything down
|
2009-08-26 01:56:35 +02:00
|
|
|
virtual void shutDown() = 0;
|
|
|
|
//!Updates the cAudio playback
|
|
|
|
virtual void update() = 0;
|
2009-08-11 19:57:20 +02:00
|
|
|
//!Returns an IAudio object by its "name" and 0 if the name is not found
|
2009-08-26 01:56:35 +02:00
|
|
|
virtual IAudio *getSound(std::string identifier) = 0;
|
|
|
|
//!Releases "ALL" cAudio objects (but does not shutdown the manager)
|
|
|
|
virtual void release() = 0;
|
2009-08-11 19:57:20 +02:00
|
|
|
|
2009-08-08 07:51:32 +02:00
|
|
|
//!Creates the cAudio object
|
2009-08-26 01:56:35 +02:00
|
|
|
virtual IAudio* createFromFile(const std::string& identifier,const std::string& file,bool stream = false) = 0;
|
|
|
|
//!Loads audio from memory or virtual file system
|
|
|
|
virtual IAudio* createFromMemory(const std::string& identifier,const char* data, size_t length, std::string ext) = 0;
|
|
|
|
//!Loads raw audio from memory.
|
2009-08-11 19:57:20 +02:00
|
|
|
virtual IAudio* createFromRaw(const std::string& identifier,const char* data, size_t length, unsigned int frequency, AudioFormats format) = 0;
|
|
|
|
|
2009-08-08 07:51:32 +02:00
|
|
|
//!Register Audio Codec
|
2009-08-11 19:57:20 +02:00
|
|
|
virtual bool registerAudioDecoder(IAudioDecoderFactory* factory, std::string extension) = 0;
|
|
|
|
//!Unregister Audio Codec (allows you to prevent an file type from being playable with new sound sources)
|
|
|
|
//!Note that all current sound sources will still continue to use any currently allocated decoders.
|
|
|
|
virtual void unRegisterAudioDecoder(std::string extension) = 0;
|
|
|
|
//!Returns whether an audio decoder is currently registered for this file type
|
|
|
|
virtual bool isAudioDecoderRegistered(std::string extension) = 0;
|
|
|
|
//!Returns a registered audio decoder factory
|
|
|
|
virtual IAudioDecoderFactory* getAudioDecoderFactory(std::string extension) = 0;
|
|
|
|
|
2009-08-26 01:56:35 +02:00
|
|
|
//!Allows you to set the listener position (DEPRECIATED! USE getListener() INSTEAD!)
|
|
|
|
virtual void setListenerPos(float x,float y,float z) = 0;
|
|
|
|
//!set the listeners orientation (DEPRECIATED! USE getListener() INSTEAD!)
|
2009-08-08 07:51:32 +02:00
|
|
|
virtual void setListenerOrientation(float ux,float uy,float uz) = 0;
|
|
|
|
|
2009-08-11 19:57:20 +02:00
|
|
|
//!Returns an interface for the listener
|
2009-08-08 07:51:32 +02:00
|
|
|
virtual IListener* getListener() = 0;
|
2009-08-11 19:57:20 +02:00
|
|
|
//!Returns an interface for audio capture
|
|
|
|
virtual IAudioCapture* getAudioCapture() = 0;
|
2009-08-08 07:51:32 +02:00
|
|
|
|
|
|
|
virtual ~IAudioManager() {}
|
2009-06-21 05:24:30 +02:00
|
|
|
protected:
|
|
|
|
private:
|
|
|
|
};
|
|
|
|
|
|
|
|
CAUDIO_API IAudioManager* getAudioManager(void);
|
|
|
|
}
|
|
|
|
#endif //! IAUDIOMANAGER_H
|