]> git.mxchange.org Git - flightgear.git/blobdiff - src/ATCDCL/ATCVoice.hxx
#545: Fix ATC chatter sound settings being ignored
[flightgear.git] / src / ATCDCL / ATCVoice.hxx
index 0bc501c2065498f901dcfa8122bf6d65fe8520fb..5128cc55dda2fc0654d3405f59370b6e3946de69 100644 (file)
 #define _FG_ATC_VOICE
 
 #include <simgear/compiler.h>
-
-#if defined( SG_HAVE_STD_INCLUDES ) || defined( __BORLANDC__ ) || (__APPLE__)
-#  include <fstream>
-#else
-#  include <fstream.h>
-#endif
+#include <simgear/structure/SGSharedPtr.hxx>
 
 #include <map>
-#include <list>
 #include <string>
 
-#include <simgear/sound/sample_openal.hxx>
-
-SG_USING_STD(map);
-SG_USING_STD(list);
-SG_USING_STD(string);
-
+class SGSoundSample;
 
 struct WordData {
        unsigned int offset;    // Offset of beginning of word sample into raw sound sample
@@ -61,16 +50,15 @@ public:
        bool LoadVoice(const std::string& voice);
        
        // Given a desired message, return a pointer to the data buffer and write the buffer length into len.
-       // Sets dataOK = true if the returned buffer is valid.
-       unsigned char* WriteMessage(char* message, int& len, bool& dataOK);
-
+       // Sets len to something other than 0 if the returned buffer is valid.
+       void* WriteMessage(const std::string& message, size_t *len);
 
 private:
 
        // the sound and word position data
        char* rawSoundData;
-       unsigned int rawDataSize;
-        SGSoundSample *SoundData;
+       size_t rawDataSize;
+        SGSharedPtr<SGSoundSample> SoundData;
 
        // A map of words vs. byte position and length in rawSoundData
        atc_word_map_type wordMap;