示例#1
0
        /// <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));
        }
示例#2
0
 /// <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));
 }