8 #ifndef _LIBALAUDIO_ALAUDIO_ALSOUNDEXTRACTOR_H_
9 #define _LIBALAUDIO_ALAUDIO_ALSOUNDEXTRACTOR_H_
12 #include <alvalue/alvalue.h>
13 #include <boost/shared_ptr.hpp>
17 #include <qi/macro.hpp>
24 #define DESACTIVATE_ALL_DEV_INFO // define me to desactivate all debug or trace info (should be defined on public release version)
26 #ifndef DESACTIVATE_ALL_DEV_INFO
27 # define AL_SOUND_EXTRACTOR_DEBUG_PRINTF(...) if ( getDebugMode() ) { printf(__VA_ARGS__); }
28 # define AL_SOUND_EXTRACTOR_DEBUG_LOG(onestr) if ( getDebugMode() ) { fLoggerProxy->debug( getName(), std::string( onestr ) ); }
29 # define AL_SOUND_EXTRACTOR_INFO_LOG(onestr) if ( getDebugMode() ) { fLoggerProxy->info( getName(), std::string( onestr ) ); }
30 # define AL_SOUND_EXTRACTOR_ERROR_LOG(onestr) if ( getDebugMode() ) { fLoggerProxy->error( getName(), std::string( onestr ) ); }
32 # define AL_SOUND_EXTRACTOR_DEBUG_PRINTF(...)
33 # define AL_SOUND_EXTRACTOR_DEBUG_LOG(onestr)
34 # define AL_SOUND_EXTRACTOR_INFO_LOG(onestr)
35 # define AL_SOUND_EXTRACTOR_ERROR_LOG(onestr)
59 ALSoundExtractor( boost::shared_ptr<AL::ALBroker> pBroker, std::string pName );
63 virtual std::string
version(
void) {
return "";}
72 QI_API_DEPRECATED
void setDebugMode(
const bool &pbSetOrUnset =
true)
74 qiLogWarning(
"audio.alsoundextractor",
"The call to setDebugMode() is "
75 "now deprectated. This functionnality is now handled by qi/log");
85 qiLogWarning(
"audio.alsoundextractor",
"The call to getDebugMode() is "
86 "now deprectated. This functionnality is now handled by qi/log");
91 virtual void process(
const int & nbOfChannels,
92 const int & nbrOfSamplesByChannel,
94 const ALValue & timestamp);
97 QI_API_DEPRECATED
virtual void processSound(
const int nbOfChannels,
98 const int nbrOfSamplesByChannel,
102 const int & nbrOfSamplesByChannel,
103 const ALValue & buffer);
106 void processRemote(
const int & nbOfChannels,
107 const int & nbrOfSamplesByChannel,
108 const ALValue & timestamp,
109 const ALValue & buffer);
111 void xStartDetection(
const int pPeriod,
112 const float pPrecision)
117 virtual void xUpdateParameters(
const int pPeriod,
118 const float pPrecision){}
120 void xStopDetection(
void)
125 virtual std::vector<std::string> getOutputNames();
virtual std::string version(void)
QI_API_DEPRECATED bool getDebugMode(void)
QI_API_DEPRECATED void setDebugMode(const bool &pbSetOrUnset=true)
ALSoundExtractor(boost::shared_ptr< AL::ALBroker > pBroker, std::string pName)
virtual void process(const int &nbOfChannels, const int &nbrOfSamplesByChannel, const AL_SOUND_FORMAT *buffer, const ALValue ×tamp)
virtual QI_API_DEPRECATED void processSoundRemote(const int &nbOfChannels, const int &nbrOfSamplesByChannel, const ALValue &buffer)
signed short AL_SOUND_FORMAT
virtual void startDetection(void)
virtual QI_API_DEPRECATED void processSound(const int nbOfChannels, const int nbrOfSamplesByChannel, const AL_SOUND_FORMAT *buffer)
virtual void stopDetection(void)
virtual ~ALSoundExtractor()
boost::shared_ptr< ALProxy > audioDevice