diff options
Diffstat (limited to 'src/uscxml/plugins/invoker/miles/SpatialAudio.h')
-rw-r--r-- | src/uscxml/plugins/invoker/miles/SpatialAudio.h | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/src/uscxml/plugins/invoker/miles/SpatialAudio.h b/src/uscxml/plugins/invoker/miles/SpatialAudio.h new file mode 100644 index 0000000..bb0886f --- /dev/null +++ b/src/uscxml/plugins/invoker/miles/SpatialAudio.h @@ -0,0 +1,55 @@ +#ifndef SPATIALAUDIO_H_EH11SAQC +#define SPATIALAUDIO_H_EH11SAQC + +#include <map> +#include <uscxml/Interpreter.h> + +extern "C" { +# include "miles/audio.h" +# include "miles/audio_codec.h" +# include "miles/audio_device.h" +} + +namespace uscxml { + +class SpatialAudio : public InvokerImpl { +public: + SpatialAudio(); + virtual ~SpatialAudio(); + virtual Invoker* create(Interpreter* interpreter); + + virtual std::set<std::string> getNames() { + std::set<std::string> names; + names.insert("spatial-audio"); + names.insert("audio"); + names.insert("http://www.smartvortex.eu/mmi/spatial-audio"); + names.insert("http://www.smartvortex.eu/mmi/spatial-audio/"); + return names; + } + + virtual Data getDataModelVariables(); + virtual void send(SendRequest& req); + virtual void cancel(const std::string sendId); + virtual void invoke(InvokeRequest& req); + virtual void sendToParent(SendRequest& req); + + void getPosFromParams(std::map<std::string, std::list<std::string> >& params, float* position); + static float posToRadian(std::string& position); + +protected: + std::string _invokeId; + Interpreter* _invokedInterpreter; + + std::stringstream _dataStream; + + float* _pos; + float* _listener; + bool _audioDevOpen; + int _audioDevIndex; + struct miles_audio_device* _audioDev; + +}; + +} + +#endif /* end of include guard: SPATIALAUDIO_H_EH11SAQC */ |