public void LoopEngineSound(Model.Level.Planes.Plane p) { if (p.IsEnemy) { return; } // Console.WriteLine("Loop engine. faulty: " + p.IsEngineFaulty); SelectEngineIdleSound(p); LoopDXSound(currentEngineIdleSound, -1200); }
public void OnEngineRepaired(Model.Level.Planes.Plane p) { if (!p.IsEnemy) { if (currentEngineIdleSound != null && currentEngineIdleSound.Status.Playing) { HaltDXSound(currentEngineIdleSound); LoopEngineSound(p); } } }
public void PlayStartEngineSound(Model.Level.Planes.Plane p, EventHandler startHandler) { if (ProblemWithSound) { return; } startEngineSound.Ending += startHandler; if (EngineConfig.CurrentPlayerPlaneType == PlaneType.P47) { // LoopDXSound(engineIdleSound, -1000); Play(startEngineSound); } else { //LoopDXSound(engineIdleSound2, -1000); Play(startEngineSound2); } LoopEngineSound(p); }
public void SetEngineFrequency(Model.Level.Planes.Plane p) { if (ProblemWithSound) { return; } try { if (currentEngineIdleSound == null) { SelectEngineIdleSound(p); } if (currentEngineIdleSound != null) { currentEngineIdleSound.Frequency = currentEngineIdleSound.Format.SamplesPerSecond + (int)p.AirscrewSpeed * 7; } } catch (Exception) { ProblemWithSound = true; } }
private void SelectEngineIdleSound(Model.Level.Planes.Plane p) { if (p.IsEngineFaulty) { currentEngineIdleSound = engineIdleFaultySound; } else { if (EngineConfig.CurrentPlayerPlaneType == PlaneType.P47) { currentEngineIdleSound = engineIdleSound; } else if (EngineConfig.CurrentPlayerPlaneType == PlaneType.F4U) { currentEngineIdleSound = engineIdleSound2; } else { currentEngineIdleSound = engineIdleSound3; } } }
public void HaltEngineSound(Model.Level.Planes.Plane p) { // Console.WriteLine("dzwiek - gaszenie"); HaltDXSound(currentEngineIdleSound); }