Browse code

loop option (from config file)

git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@1630 8eb893ce-cfd4-0310-b710-fb5ebe64c474

Stefan Sayer authored on 23/02/2010 15:27:00
Showing 3 changed files
... ...
@@ -39,6 +39,7 @@ EXPORT_SESSION_FACTORY(AnnouncementFactory,MOD_NAME);
39 39
 
40 40
 string AnnouncementFactory::AnnouncePath;
41 41
 string AnnouncementFactory::AnnounceFile;
42
+bool   AnnouncementFactory::Loop = false;
42 43
 
43 44
 AnnouncementFactory::AnnouncementFactory(const string& _app_name)
44 45
   : AmSessionFactory(_app_name)
... ...
@@ -68,6 +69,8 @@ int AnnouncementFactory::onLoad()
68 68
     return -1;
69 69
   }
70 70
 
71
+  Loop = cfg.getParameter("loop") == "true";
72
+
71 73
   return 0;
72 74
 }
73 75
 
... ...
@@ -158,7 +161,10 @@ void AnnouncementDialog::startSession(){
158 158
     ERROR("Couldn't open file %s.\n", filename.c_str());
159 159
     throw string("AnnouncementDialog::onSessionStart: Cannot open file\n");
160 160
   }
161
-    
161
+
162
+  if (AnnouncementFactory::Loop) 
163
+    wav_file.loop.set(true);
164
+
162 165
   setOutput(&wav_file);
163 166
 }
164 167
 
... ...
@@ -46,6 +46,7 @@ class AnnouncementFactory: public AmSessionFactory
46 46
 public:
47 47
   static string AnnouncePath;
48 48
   static string AnnounceFile;
49
+  static bool   Loop;
49 50
 
50 51
   AnnouncementFactory(const string& _app_name);
51 52
 
... ...
@@ -5,3 +5,9 @@ announce_path=/usr/local/lib/sems/audio/
5 5
 #CFGOPTION_SEMS_ANNOUNCEMENT
6 6
 default_announce=default_en.wav
7 7
 #ENDCFGOPTION
8
+
9
+# optional parameter: loop
10
+#  set to "true" to make the announcement loop
11
+#  (indefinitely)
12
+#
13
+# loop=true