- don't abort just because a sample wasn't found
- rename to play-audio-sample (not every sound is a message)
This commit is contained in:
parent
8eeafbac8e
commit
1bdea279cd
1 changed files with 11 additions and 5 deletions
|
@ -1154,16 +1154,22 @@ do_gui_redraw (const SGPropertyNode * arg)
|
|||
* overlap.
|
||||
*/
|
||||
static bool
|
||||
do_play_audio_message (const SGPropertyNode * arg)
|
||||
do_play_audio_sample (const SGPropertyNode * arg)
|
||||
{
|
||||
FGFX *fx = (FGFX *)globals->get_subsystem("fx");
|
||||
string path = arg->getStringValue("path");
|
||||
string file = arg->getStringValue("file");
|
||||
double volume = arg->getDoubleValue("volume");
|
||||
// cout << "playing " << path << " / " << file << endl;
|
||||
try {
|
||||
fx->play_message( path, file, volume );
|
||||
|
||||
return true;
|
||||
|
||||
} catch (const sg_io_exception& e) {
|
||||
SG_LOG(SG_GENERAL, SG_ALERT, "play-audio-sample: "
|
||||
"failed to load" << path << '/' << file);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1462,7 +1468,7 @@ static struct {
|
|||
{ "dialog-update", do_dialog_update },
|
||||
{ "dialog-apply", do_dialog_apply },
|
||||
{ "gui-redraw", do_gui_redraw },
|
||||
{ "play-audio-message", do_play_audio_message },
|
||||
{ "play-audio-sample", do_play_audio_sample },
|
||||
{ "presets-commit", do_presets_commit },
|
||||
{ "log-level", do_log_level },
|
||||
{ "replay", do_replay },
|
||||
|
|
Loading…
Reference in a new issue