static void OnRunning(XtStream stream, bool running, ulong error, object user) { string evt = running ? "Started" : "Stopped"; Console.WriteLine("Stream event: " + evt + ", new state: " + stream.IsRunning() + "."); if (error != 0) { Console.WriteLine(XtAudio.GetErrorInfo(error).ToString()); } }
void OnRunning(XtStream stream, bool running, ulong error, object user) { bool evt = running; bool newState = stream.IsRunning(); BeginInvoke(new Action(() => { string evtDesc = running ? "Started" : "Stopped"; AddMessage(() => "Stream event: " + evtDesc + ", new state: " + newState + "."); if (error != 0) { AddMessage(() => XtAudio.GetErrorInfo(error).ToString()); } _stop.Enabled = running; panel.Enabled = !running; _start.Enabled = !running; _bufferSize.Enabled = !running; _streamType.Enabled = !running; _streamNative.Enabled = !running; _outputMaster.Enabled = !running; _secondaryInput.Enabled = !running; _secondaryOutput.Enabled = !running; _streamInterleaved.Enabled = !running; })); }