loop option (from config file)

git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@1630 8eb893ce-cfd4-0310-b710-fb5ebe64c474
sayer/1.4-spce2.6
Stefan Sayer 17 years ago
parent 22fad01ddc
commit 550f84e02c

@ -39,6 +39,7 @@ EXPORT_SESSION_FACTORY(AnnouncementFactory,MOD_NAME);
string AnnouncementFactory::AnnouncePath;
string AnnouncementFactory::AnnounceFile;
bool AnnouncementFactory::Loop = false;
AnnouncementFactory::AnnouncementFactory(const string& _app_name)
: AmSessionFactory(_app_name)
@ -68,6 +69,8 @@ int AnnouncementFactory::onLoad()
return -1;
}
Loop = cfg.getParameter("loop") == "true";
return 0;
}
@ -158,7 +161,10 @@ void AnnouncementDialog::startSession(){
ERROR("Couldn't open file %s.\n", filename.c_str());
throw string("AnnouncementDialog::onSessionStart: Cannot open file\n");
}
if (AnnouncementFactory::Loop)
wav_file.loop.set(true);
setOutput(&wav_file);
}

@ -46,6 +46,7 @@ class AnnouncementFactory: public AmSessionFactory
public:
static string AnnouncePath;
static string AnnounceFile;
static bool Loop;
AnnouncementFactory(const string& _app_name);

@ -5,3 +5,9 @@ announce_path=/usr/local/lib/sems/audio/
#CFGOPTION_SEMS_ANNOUNCEMENT
default_announce=default_en.wav
#ENDCFGOPTION
# optional parameter: loop
# set to "true" to make the announcement loop
# (indefinitely)
#
# loop=true

Loading…
Cancel
Save