Announcement

Collapse
No announcement yet.

Repeated playing of Audio Alert

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Repeated playing of Audio Alert

    The CCI Alert with Audio I downloaded as well as the audio alert I put in the attached MACD Color bar repeats itself constantly until the condition reverses itself and then the reversed alert keeps playing.

    Can someone write in the play once command or send me one...thanks

    Dave D

    Both files attached

  • #2
    Hi Dave D,

    fwiw, to attach both files create a zip file and upload it since the forum only allows one download and has size limits.

    Alternatively copy and paste the code for each efs between "PHP" and "/PHP" but replace the quotation marks for each with the open bracket [ and the close bracket ] like "[/PHP]" without the quotation marks.

    In any case, if you add a global variable above "function premain()" or right above "function main()" such as:

    var vLastAlert = -1;
    function preMain(){
    Then add " && vLastAlert != 1" to your first conditional statment, " && vLastAlert != 2" to your second conditional statment, etc
    i.e.,
    say your 1st conditional is:

    PHP Code:
    if( Var1 Var2){
           do 
    the first thing
    }else if( Var13 Var4){
           do 
    the second thing

    change it to
    PHP Code:
    if( Var1 Var2 && vLastAlert != 1){
           do 
    the first thing
           vLastAlert 
    1;
    }else if( 
    Var13 Var4 && vLastAlert != 2){
           do 
    the second thing
          vLastAlert 
    2;

    That should execute first condition or alarm only once until the second or other condition or alarm changes the value of vLastAlert.

    Here: http://forum.esignalcentral.com/show...acer#post47926
    Alexis uses Flag1 and Flag2 in place of vLastAlert but it is the same principle.

    wayne
    Last edited by waynecd; 02-06-2009, 09:59 PM.

    Comment

    Working...
    X