Browse code

dsm: closePlaylist() -> flushPlaylist() in examples/docs

Stefan Sayer authored on 21/12/2013 15:01:34
Showing 8 changed files
... ...
@@ -67,6 +67,7 @@ DSMAction* DSMCoreModule::getAction(const string& from_str) {
67 67
   DEF_CMD("getRecordLength", SCGetRecordLengthAction);
68 68
   DEF_CMD("getRecordDataSize", SCGetRecordDataSizeAction);
69 69
   DEF_CMD("flushPlaylist", SCFlushPlaylistAction);
70
+  DEF_CMD("closePlaylist", SCClosePlaylistAction); // deprecated
70 71
   DEF_CMD("setInOutPlaylist", SCSetInOutPlaylistAction);
71 72
   DEF_CMD("setInputPlaylist", SCSetInputPlaylistAction);
72 73
   DEF_CMD("setOutputPlaylist", SCSetOutputPlaylistAction);
... ...
@@ -398,6 +399,11 @@ EXEC_ACTION_START(SCFlushPlaylistAction) {
398 399
   sc_sess->flushPlaylist();
399 400
 } EXEC_ACTION_END;
400 401
 
402
+EXEC_ACTION_START(SCClosePlaylistAction) {
403
+  WARN("closePlaylist() is deprecated - please use flushPlaylist() instead\n");
404
+  sc_sess->flushPlaylist();
405
+} EXEC_ACTION_END;
406
+
401 407
 
402 408
 EXEC_ACTION_START(SCSetInOutPlaylistAction) {
403 409
   sc_sess->setInOutPlaylist();
... ...
@@ -55,6 +55,7 @@ DEF_ACTION_1P(SCStopRecordAction);
55 55
 DEF_ACTION_1P(SCGetRecordDataSizeAction);
56 56
 DEF_ACTION_1P(SCGetRecordLengthAction);
57 57
 DEF_ACTION_1P(SCFlushPlaylistAction);
58
+DEF_ACTION_1P(SCClosePlaylistAction);
58 59
 DEF_ACTION_1P(SCSetInOutPlaylistAction);
59 60
 DEF_ACTION_1P(SCSetInputPlaylistAction);
60 61
 DEF_ACTION_1P(SCSetOutputPlaylistAction);
... ...
@@ -142,8 +142,7 @@ Playing prompts and file I/O
142 142
  stopRecord()
143 143
  getRecordLength([dst_varname])   -- only while recording! default dst var: record_length
144 144
  getRecordDataSize([dst_varname]) -- only while recording! default dst var: record_data_size
145
- closePlaylist(notify=true)
146
-   if notify=true, send an event
145
+ flushPlaylist()
147 146
  setInOutPlaylist() 
148 147
    set playlist as input and output
149 148
  setInputPlaylist() 
... ...
@@ -4,7 +4,7 @@ Actions:
4 4
    Throws "conference" Exception if conference can not be joined (currently never).
5 5
 
6 6
  conference.leave()
7
-   destroy conference channel. Close playlist first!!!!!
7
+   destroy conference channel. Flush playlist with flushPlaylist() first!!!!!
8 8
    * Sets $errno (script).
9 9
 
10 10
  conference.rejoin(string roomname [, string mode])
... ...
@@ -115,7 +115,7 @@ FUNCTIONS
115 115
     addSeparator(string name[, bool front])
116 116
         add a named separator to playlist
117 117
 
118
-    closePlaylist(bool notify)
118
+    flushPlaylist()
119 119
         close the playlist
120 120
 
121 121
     connectMedia()
... ...
@@ -18,10 +18,10 @@ state ENTER_PIN;
18 18
 transition "got cancel from A leg" (START, RUN_INVITE, ENTER_PIN) - event(#a_status==CANCEL) / stop(true) -> END;
19 19
 
20 20
 transition "pressed a number" ENTER_PIN - key(#key<10) / {
21
-  closePlaylist(false); 
21
+  flushPlaylist(); 
22 22
   append($entered_pin, #key);
23 23
 } -> TEST_PIN;
24
-transition "pressed hash or start" ENTER_PIN - key / closePlaylist(false) -> TEST_PIN_FINAL;
24
+transition "pressed hash or start" ENTER_PIN - key / flushPlaylist() -> TEST_PIN_FINAL;
25 25
 
26 26
 state TEST_PIN
27 27
  enter {
... ...
@@ -133,7 +133,7 @@ transition "one more to cancel" CANCEL_OTHER_CALLEES - test($callee_counter<$db.
133 133
 } -> CANCEL_OTHER_CALLEES;
134 134
 
135 135
 transition "canceled all" CANCEL_OTHER_CALLEES - test($callee_counter==$db.rows) / {
136
-  closePlaylist(false);
136
+  flushPlaylist();
137 137
   dlg.acceptInvite(200, OK);
138 138
   conference.join(@local_tag);
139 139
 } -> CONNECTED;
... ...
@@ -502,14 +502,14 @@ transition "pin doesn't match" TEST_PIN_FINAL - test($pin!=$entered_pin) / {
502 502
 state MATCHING_PIN;
503 503
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
504 504
 
505
-That works, but we want to break the prompt when the user enters a key, so we add closePlaylist(false), which stops playback of currently playing items in the playlist, but doesn't generate an event:
505
+That works, but we want to break the prompt when the user enters a key, so we add flushPlaylist(), which stops playback of currently playing items in the playlist (and doesn't generate an event):
506 506
 
507 507
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
508 508
 transition "pressed a number" ENTER_PIN - key(#key<10) / {
509
-  closePlaylist(false);
509
+  flushPlaylist();
510 510
   append($entered_pin, #key);
511 511
 } -> TEST_PIN;
512
-transition "pressed hash or start" ENTER_PIN - key / closePlaylist(false) -> TEST_PIN_FINAL;
512
+transition "pressed hash or start" ENTER_PIN - key / flushPlaylist() -> TEST_PIN_FINAL;
513 513
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
514 514
 
515 515
 Now I realize we need to pass the id of the caller leg to the callee leg as well, so we can post back events:
... ...
@@ -564,7 +564,7 @@ transition "one more to cancel" CANCEL_OTHER_CALLEES - test($callee_counter<$db.
564 564
 } -> CANCEL_OTHER_CALLEES;
565 565
 
566 566
 transition "canceled all" CANCEL_OTHER_CALLEES - test($callee_counter==$db.rows) / {
567
-  closePlaylist(false);
567
+  flushPlaylist();
568 568
   dlg.acceptInvite(200, OK);
569 569
   conference.join(@local_tag);
570 570
 } -> CONNECTED;