#include <simgear/sound/soundmgr_openal.hxx>
#include <math.h>
#include <string>
+#include <memory>
using std::string;
if(voice) {
string buf = vPtr->WriteMessage((char*)pending_transmission.c_str(), voice);
if(voice && (volume > 0.05)) {
+ std::auto_ptr<unsigned char> ptr( buf.c_str() );
SGSoundSample* simple =
- new SGSoundSample((unsigned char*)buf.c_str(), buf.length(), 8000 );
+ new SGSoundSample(ptr, buf.length(), 8000 );
// TODO - at the moment the volume can't be changed
// after the transmission has started.
simple->set_volume(volume);
#include "ATC.hxx"
#include <iostream>
+#include <memory>
#include <simgear/sound/soundmgr_openal.hxx>
#include <simgear/structure/exception.hxx>
// >>> Beware: must pass a (new) object to the (add) method,
// >>> because the (remove) method is going to do a (delete)
// >>> whether that's what you want or not.
- std::auto_ptr<unsigned char> ptr;
- ptr.reset((unsigned char*) buf.c_str());
+ std::auto_ptr<unsigned char> ptr( (unsigned char*)buf.c_str() );
SGSoundSample *simple =
new SGSoundSample(ptr, buf.length(), 8000);
// TODO - at the moment the volume can't be changed
// $Id$
+#include <memory>
+
#include "beacon.hxx"
#include <simgear/structure/exception.hxx>
// $Id$
+#include <memory>
+
#include <simgear/constants.h>
#include "morse.hxx"