Support Board
Date/Time: Fri, 27 Dec 2024 16:54:13 +0000
Post From: Latest update keeps playing sound files even though i have logic to prevent..
[2016-03-13 12:26:41] |
KhaosTrader - Posts: 128 |
Ok, I put a sound function on the example code, the only part that is important is the playsound part.. SCSFExport scsf_SoundTester(SCStudyInterfaceRef sc) { // Section 1 - Set the configuration variables and defaults if (sc.SetDefaults) { sc.GraphName = "Sound Tester"; // During development set this flag to 1, so the DLL can be rebuilt without restarting Sierra Chart. When development is completed, set it to 0 to improve performance. sc.FreeDLL = 1; sc.AutoLoop = 1; //Automatic looping is enabled. sc.Subgraph[0].Name = "Name"; sc.Subgraph[0].DrawStyle = DRAWSTYLE_LINE; sc.Subgraph[0].PrimaryColor = RGB(0, 255, 0); sc.Input[0].Name = "Float Input"; sc.Input[0].SetFloat(0.0f); return; } // Section 2 - Do data processing here if ( (sc.GetBarHasClosedStatus(sc.Index) == BHCS_BAR_HAS_CLOSED) && sc.Close[sc.Index - 1] > sc.Close[sc.Index] && (!sc.IsFullRecalculation) && (!sc.DownloadingHistoricalData) ) { //const char* p_Symbol; //p_Symbol = sc.Symbol.GetChars(); SCString Buffer; Buffer = "c:\\!TradeAlert_Sounds\\"; Buffer += "CL"; Buffer += "_Short.wav"; sc.PlaySound(Buffer.GetChars(), 1); //sc.AddMessageToLog("Short alert!",0); } } |