Esempio n. 1
0
 /// <summary>
 /// Retrieves the speaker configuration.
 /// </summary>
 /// <param name="speakerConfig">Retrieves the speaker configuration.</param>
 /// <returns>DSResult</returns>
 public DSResult GetSpeakerConfigNative(out DSSpeakerConfigurations speakerConfig)
 {
     fixed(void *pspeakerConfig = &speakerConfig)
     {
         return(InteropCalls.CalliMethodPtr(UnsafeBasePtr, pspeakerConfig, ((void **)(*(void **)UnsafeBasePtr))[8]));
     }
 }
Esempio n. 2
0
        /// <summary>
        /// Combines a <see cref="DSSpeakerGeometry"/> value with a <see cref="DSSpeakerConfigurations"/> value.
        /// </summary>
        /// <param name="speakerConfiguration">Must be <see cref="DSSpeakerConfigurations.Stereo"/>.</param>
        /// <param name="speakerGeometry">The <see cref="DSSpeakerGeometry"/> value to combine with the <paramref name="speakerConfiguration"/>.</param>
        /// <returns>Combination out of the <paramref name="speakerConfiguration"/> and the <paramref name="speakerGeometry"/> value.</returns>
        /// <exception cref="ArgumentException">Must be stereo.; speakerConfiguration</exception>
        public DSSpeakerConfigurations CombineSpeakerConfiguration(DSSpeakerConfigurations speakerConfiguration, DSSpeakerGeometry speakerGeometry)
        {
            if (speakerConfiguration != DSSpeakerConfigurations.Stereo)
            {
                throw new ArgumentException("Must be stereo.", "speakerConfiguration");
            }

            int c = (int)speakerConfiguration;
            int g = (int)speakerGeometry;

            return((DSSpeakerConfigurations)(((byte)c) | (byte)g << 16));
        }
Esempio n. 3
0
 /// <summary>
 /// Specifies the speaker configuration of the device.
 /// </summary>
 /// <param name="speakerConfig">The speaker configuration.</param>
 /// <remarks>
 /// In Windows Vista and later versions of Windows, <see cref="GetSpeakerConfig"/> is a NOP. For Windows Vista and later versions, the speaker configuration is a system setting that should not be modified by an application. End users can set the speaker configuration through control panels.
 /// For more information, see <see href="https://msdn.microsoft.com/en-us/library/windows/desktop/microsoft.directx_sdk.idirectsound8.idirectsound8.setspeakerconfig(v=vs.85).aspx"/>.
 /// </remarks>
 public void SetSpeakerConfig(DSSpeakerConfigurations speakerConfig)
 {
     DirectSoundException.Try(SetSpeakerConfigNative(speakerConfig), "IDirectSound8", "SetSpeakerConfig");
 }
Esempio n. 4
0
 /// <summary>
 /// Specifies the speaker configuration of the device.
 /// </summary>
 /// <param name="speakerConfig">The speaker configuration.</param>
 /// <returns>DSResult</returns>
 /// <remarks>
 /// In Windows Vista and later versions of Windows, <see cref="GetSpeakerConfig"/> is a NOP. For Windows Vista and later versions, the speaker configuration is a system setting that should not be modified by an application. End users can set the speaker configuration through control panels.
 /// For more information, see <see href="https://msdn.microsoft.com/en-us/library/windows/desktop/microsoft.directx_sdk.idirectsound8.idirectsound8.setspeakerconfig(v=vs.85).aspx"/>.
 /// </remarks>
 public DSResult SetSpeakerConfigNative(DSSpeakerConfigurations speakerConfig)
 {
     return(InteropCalls.CalliMethodPtr(UnsafeBasePtr, (int)speakerConfig, ((void **)(*(void **)UnsafeBasePtr))[9]));
 }