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>
19 typedef signed short AL_SOUND_FORMAT;
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)
55 ALSoundExtractor( boost::shared_ptr<AL::ALBroker> pBroker, std::string pName );
59 virtual std::string version(
void) {
return "";}
60 virtual void startDetection(
void);
61 virtual void stopDetection(
void);
68 QI_API_DEPRECATED
void setDebugMode(
const bool &pbSetOrUnset =
true)
70 qiLogWarning(
"audio.alsoundextractor",
"The call to setDebugMode() is "
71 "now deprectated. This functionnality is now handled by qi/log");
72 fbDebugMode = pbSetOrUnset;
81 qiLogWarning(
"audio.alsoundextractor",
"The call to getDebugMode() is "
82 "now deprectated. This functionnality is now handled by qi/log");
87 virtual void process(
const int & nbOfChannels,
88 const int & nbrOfSamplesByChannel,
89 const AL_SOUND_FORMAT * buffer,
90 const ALValue & timestamp){}
93 QI_API_DEPRECATED
virtual void processSound(
const int nbOfChannels,
94 const int nbrOfSamplesByChannel,
95 const AL_SOUND_FORMAT* buffer);
97 QI_API_DEPRECATED
virtual void processSoundRemote(
const int & nbOfChannels,
98 const int & nbrOfSamplesByChannel,
99 const ALValue & buffer);
103 void processRemote(
const int & nbOfChannels,
104 const int & nbrOfSamplesByChannel,
105 const ALValue & timestamp,
106 const ALValue & buffer);
108 void xStartDetection(
const int pPeriod,
109 const float pPrecision)
114 virtual void xUpdateParameters(
const int pPeriod,
115 const float pPrecision){}
117 void xStopDetection(
void)
122 virtual std::vector<std::string> getOutputNames();
128 boost::shared_ptr<ALProxy> audioDevice;
129 ALValue fNullTimestamp;