//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//
// $Id$
string path_str = node->getStringValue("path");
SGPath path( globals->get_fg_root() );
if (path_str.empty()) {
- SG_LOG(SG_GENERAL, SG_ALERT, "Incorrect path in configuration file.");
+ SG_LOG(SG_GENERAL, SG_ALERT, "No path in /sim/sound/path");
return;
}
readProperties(path.str(), &root);
} catch (const sg_exception &) {
SG_LOG(SG_GENERAL, SG_ALERT,
- "Incorrect path specified in configuration file");
+ "Error reading file '" << path.str() << '\'');
return;
}
{
SGSoundMgr *smgr = globals->get_soundmgr();
+ if (smgr->is_working() == false) {
+ return;
+ }
+
// command sound manger
bool pause = _pause->getBoolValue();
if ( pause != last_pause ) {
void
FGFX::play_message( SGSoundSample *_sample )
{
- _sample->set_volume( 1.0 );
_samplequeue.push( _sample );
}
void
-FGFX::play_message( const string path, const string fname )
+FGFX::play_message( const string path, const string fname, double volume )
{
+ if (globals->get_soundmgr()->is_working() == false) {
+ return;
+ }
SGSoundSample *sample;
sample = new SGSoundSample( path.c_str(), fname.c_str() );
+ sample->set_volume( volume );
play_message( sample );
}