]> git.mxchange.org Git - simgear.git/blobdiff - simgear/sound/soundmgr_openal.cxx
Fix #1783: repeated error message on console
[simgear.git] / simgear / sound / soundmgr_openal.cxx
index 1a16eed78a811978db5cd90146120bbdbf795ac1..a3e1d3d70ec5dc0fab1a701ab68270b79a573472 100644 (file)
@@ -45,7 +45,6 @@
 #include <simgear/debug/logstream.hxx>
 #include <simgear/misc/sg_path.hxx>
 
-using std::string;
 using std::vector;
 
 
@@ -253,7 +252,6 @@ void SGSoundMgr::init()
 
 void SGSoundMgr::reinit()
 {
-#ifndef ENABLE_SOUND
     bool was_active = _active;
 
     if (was_active)
@@ -266,7 +264,6 @@ void SGSoundMgr::reinit()
 
     if (was_active)
         resume();
-#endif
 }
 
 void SGSoundMgr::activate()
@@ -410,7 +407,7 @@ if (isNaN(_velocity.data())) printf("NaN in listener velocity\n");
 }
 
 // add a sample group, return true if successful
-bool SGSoundMgr::add( SGSampleGroup *sgrp, const string& refname )
+bool SGSoundMgr::add( SGSampleGroup *sgrp, const std::string& refname )
 {
     sample_group_map_iterator sample_grp_it = d->_sample_groups.find( refname );
     if ( sample_grp_it != d->_sample_groups.end() ) {
@@ -426,7 +423,7 @@ bool SGSoundMgr::add( SGSampleGroup *sgrp, const string& refname )
 
 
 // remove a sound effect, return true if successful
-bool SGSoundMgr::remove( const string &refname )
+bool SGSoundMgr::remove( const std::string &refname )
 {
     sample_group_map_iterator sample_grp_it = d->_sample_groups.find( refname );
     if ( sample_grp_it == d->_sample_groups.end() ) {
@@ -441,7 +438,7 @@ bool SGSoundMgr::remove( const string &refname )
 
 
 // return true of the specified sound exists in the sound manager system
-bool SGSoundMgr::exists( const string &refname ) {
+bool SGSoundMgr::exists( const std::string &refname ) {
     sample_group_map_iterator sample_grp_it = d->_sample_groups.find( refname );
     return ( sample_grp_it != d->_sample_groups.end() );
 }
@@ -449,7 +446,7 @@ bool SGSoundMgr::exists( const string &refname ) {
 
 // return a pointer to the SGSampleGroup if the specified sound exists
 // in the sound manager system, otherwise return NULL
-SGSampleGroup *SGSoundMgr::find( const string &refname, bool create ) {
+SGSampleGroup *SGSoundMgr::find( const std::string &refname, bool create ) {
     sample_group_map_iterator sample_grp_it = d->_sample_groups.find( refname );
     if ( sample_grp_it == d->_sample_groups.end() ) {
         // sample group was not found.
@@ -526,7 +523,7 @@ unsigned int SGSoundMgr::request_buffer(SGSoundSample *sample)
 #ifdef ENABLE_SOUND
     if ( !sample->is_valid_buffer() ) {
         // sample was not yet loaded or removed again
-        string sample_name = sample->get_sample_name();
+        std::string sample_name = sample->get_sample_name();
         void *sample_data = NULL;
 
         // see if the sample name is already cached
@@ -590,7 +587,7 @@ void SGSoundMgr::release_buffer(SGSoundSample *sample)
 {
     if ( !sample->is_queue() )
     {
-        string sample_name = sample->get_sample_name();
+        std::string sample_name = sample->get_sample_name();
         buffer_map_iterator buffer_it = d->_buffers.find( sample_name );
         if ( buffer_it == d->_buffers.end() ) {
             // buffer was not found
@@ -610,8 +607,11 @@ void SGSoundMgr::release_buffer(SGSoundSample *sample)
     }
 }
 
-bool SGSoundMgr::load(const string &samplepath, void **dbuf, int *fmt,
-                                          size_t *sz, int *frq )
+bool SGSoundMgr::load( const std::string &samplepath,
+                       void **dbuf,
+                       int *fmt,
+                       size_t *sz,
+                       int *frq )
 {
     if ( !is_working() )
         return false;
@@ -670,7 +670,7 @@ vector<const char*> SGSoundMgr::get_available_devices()
 }
 
 
-bool SGSoundMgr::testForError(void *p, string s)
+bool SGSoundMgr::testForError(void *p, std::string s)
 {
    if (p == NULL) {
       SG_LOG( SG_SOUND, SG_ALERT, "Error: " << s);
@@ -680,7 +680,7 @@ bool SGSoundMgr::testForError(void *p, string s)
 }
 
 
-bool SGSoundMgr::testForALError(string s)
+bool SGSoundMgr::testForALError(std::string s)
 {
 #ifdef ENABLE_SOUND
     ALenum error = alGetError();
@@ -693,7 +693,7 @@ bool SGSoundMgr::testForALError(string s)
     return false;
 }
 
-bool SGSoundMgr::testForALCError(string s)
+bool SGSoundMgr::testForALCError(std::string s)
 {
 #ifdef ENABLE_SOUND
     ALCenum error;