Module: sems
Branch: master
Commit: 427f8795b4768426739e2e186e0143432eb50159
URL: 
https://github.com/sems-server/sems/commit/427f8795b4768426739e2e186e0143432eb50159

Author: Stefan Sayer <stefan.sa...@googlemail.com>
Committer: Stefan Sayer <stefan.sa...@googlemail.com>
Date: 2015-06-09T00:12:41+02:00

dsm:mod_conference: flushMixInList action, loop for mix in list

---

Modified: apps/dsm/mods/mod_conference/ModConference.cpp
Modified: apps/dsm/mods/mod_conference/ModConference.h
Modified: doc/dsm/mods/Readme.mod_conference.txt

---

Diff:  
https://github.com/sems-server/sems/commit/427f8795b4768426739e2e186e0143432eb50159.diff
Patch: 
https://github.com/sems-server/sems/commit/427f8795b4768426739e2e186e0143432eb50159.patch

---

diff --git a/apps/dsm/mods/mod_conference/ModConference.cpp 
b/apps/dsm/mods/mod_conference/ModConference.cpp
index 6137989..38aa6f8 100644
--- a/apps/dsm/mods/mod_conference/ModConference.cpp
+++ b/apps/dsm/mods/mod_conference/ModConference.cpp
@@ -51,6 +51,7 @@ MOD_ACTIONEXPORT_BEGIN(MOD_CLS_NAME) {
   DEF_CMD("conference.setupMixIn", ConfSetupMixInAction);
   DEF_CMD("conference.playMixIn",  ConfPlayMixInAction);
   DEF_CMD("conference.playMixInList", ConfPlayMixInListAction);
+  DEF_CMD("conference.flushMixInList", ConfFlushMixInListAction);
 
 } MOD_ACTIONEXPORT_END;
 
@@ -402,9 +403,10 @@ EXEC_ACTION_START(ConfPlayMixInAction) {
 
 } EXEC_ACTION_END;
 
-
+CONST_ACTION_2P(ConfPlayMixInListAction, ',', true);
 EXEC_ACTION_START(ConfPlayMixInListAction) {
-  string filename = resolveVars(arg, sess, sc_sess, event_params);
+  string filename = resolveVars(par1, sess, sc_sess, event_params);
+  bool loop = resolveVars(par2, sess, sc_sess, event_params) == "true";
 
   bool has_playlist = true;
   // get playlist
@@ -434,9 +436,10 @@ EXEC_ACTION_START(ConfPlayMixInListAction) {
     throw DSMException("file", "path", filename);
   }
   sc_sess->transferOwnership(af);
+  af->loop.set(loop);
 
-    DBG("adding file '%s' to mixin playlist\n", filename.c_str());
-    l->addToPlaylist(new AmPlaylistItem(af, NULL));
+  DBG("adding file '%s' to mixin playlist\n", filename.c_str());
+  l->addToPlaylist(new AmPlaylistItem(af, NULL));
 
   if (!has_playlist) {
     // get mixin mixer
@@ -450,3 +453,16 @@ EXEC_ACTION_START(ConfPlayMixInListAction) {
     m->mixin(l);
   }
 } EXEC_ACTION_END;
+
+EXEC_ACTION_START(ConfFlushMixInListAction) {
+  // get playlist
+  DSMDisposableT<AmPlaylist >* l_obj = 
+    getDSMConfChannel<DSMDisposableT<AmPlaylist> >(sc_sess, CONF_AKEY_MIXLIST);
+  if (NULL == l_obj) {
+    DBG("no mix list present - not flushing list\n");
+    EXEC_ACTION_STOP;
+  }
+  AmPlaylist* l = l_obj->get();
+  l->flush();
+  DBG("flushed mixInList\n");
+} EXEC_ACTION_END;
diff --git a/apps/dsm/mods/mod_conference/ModConference.h 
b/apps/dsm/mods/mod_conference/ModConference.h
index 52d59fd..fa4714f 100644
--- a/apps/dsm/mods/mod_conference/ModConference.h
+++ b/apps/dsm/mods/mod_conference/ModConference.h
@@ -95,6 +95,6 @@ DEF_ACTION_1P(ConfTeeLeaveAction);
 
 DEF_ACTION_2P(ConfSetupMixInAction);
 DEF_ACTION_1P(ConfPlayMixInAction);
-DEF_ACTION_1P(ConfPlayMixInListAction);
-
+DEF_ACTION_2P(ConfPlayMixInListAction);
+DEF_ACTION_1P(ConfFlushMixInListAction);
 #endif
diff --git a/doc/dsm/mods/Readme.mod_conference.txt 
b/doc/dsm/mods/Readme.mod_conference.txt
index 71189df..f5063d0 100644
--- a/doc/dsm/mods/Readme.mod_conference.txt
+++ b/doc/dsm/mods/Readme.mod_conference.txt
@@ -49,6 +49,9 @@ conference.setupMixIn(float level, unsigned int seconds)
 conference.playMixIn(string filename)
     - mix in a file
 
-conference.playMixInList(string filename)
+conference.playMixInList(string filename [, loop=true])
     - add a file to the mix-in playlist
     - the list is setup when this is called for the first time and set as 
mixin source 
+
+conference.flushMixInList()
+    - flush mix-in playlist

_______________________________________________
Semsdev mailing list
Semsdev@lists.iptel.org
http://lists.iptel.org/mailman/listinfo/semsdev

Reply via email to