/// <summary> /// Plays a sound. /// </summary> private void PlaySound(CheckersSounds sound) { // Play sound if (settings.MuteSounds) { return; } string soundFileName = settings.sounds[(int)sound]; string fileName = ((Path.IsPathRooted(soundFileName)) ? (soundFileName) : (Path.GetDirectoryName(Application.ExecutablePath) + "\\Sounds\\" + soundFileName)); // Play sound sndPlaySound(fileName, IntPtr.Zero, (SoundFlags.SND_FileName | SoundFlags.SND_ASYNC | SoundFlags.SND_NOWAIT)); }
/// <summary> /// Plays a sound. /// </summary> private void PlaySound(CheckersSounds sound) { // Play sound if(settings.MuteSounds) return; string soundFileName = settings.sounds[(int)sound]; string fileName = ((Path.IsPathRooted(soundFileName)) ? (soundFileName) : (Path.GetDirectoryName(Application.ExecutablePath) + "\\Sounds\\" + soundFileName)); // Play sound sndPlaySound(fileName, IntPtr.Zero, (SoundFlags.SND_FileName | SoundFlags.SND_ASYNC | SoundFlags.SND_NOWAIT)); }