示例#1
0
 /// <summary>
 ///     Returns the running state of the effect at a specified position in the effect chain of the voice.
 /// </summary>
 /// <param name="effectIndex">Zero-based index of an effect in the effect chain of the voice.</param>
 /// <param name="enabled">Returns true if the effect is enabled. If the effect is disabled, returns false.</param>
 public unsafe void GetEffectStateNative(int effectIndex, out NativeBool enabled)
 {
     fixed(void *p = &enabled)
     {
         LocalInterop.Calli1(UnsafeBasePtr, effectIndex, p, ((void **)(*(void **)UnsafeBasePtr))[5]);
     }
 }
示例#2
0
        /// <summary>
        ///     Returns the voice's current cursor position data.
        /// </summary>
        /// <param name="flags">
        ///     <b>XAudio2.8 only:</b> Flags controlling which voice state data should be returned.
        ///     Valid values are <see cref="GetVoiceStateFlags.Default" /> or <see cref="GetVoiceStateFlags.NoSamplesPlayed" />.
        ///     The default value is <see cref="GetVoiceStateFlags.Default" />. If you specify
        ///     <see cref="GetVoiceStateFlags.NoSamplesPlayed" />, GetState
        ///     returns only the buffer state, not the sampler state.
        ///     GetState takes roughly one-third as much time to complete when you specify
        ///     <see cref="GetVoiceStateFlags.NoSamplesPlayed" />.
        /// </param>
        /// <returns><see cref="VoiceState" /> structure containing the state of the voice.</returns>
        /// <remarks>If the <see cref="XAudio2Voice.Version"/> is not <see cref="XAudio2Version.XAudio2_8"/> the <paramref name="flags"/> parameter will be ignored.</remarks>
        public unsafe VoiceState GetState(GetVoiceStateFlags flags)
        {
            if (Version == XAudio2Version.XAudio2_7)
            {
                VoiceState voiceState = default(VoiceState);
                LocalInterop.Calli1(UnsafeBasePtr, &voiceState, ((void **)(*(void **)UnsafeBasePtr))[25]);
                return(voiceState);
            }
            if (Version == XAudio2Version.XAudio2_8)
            {
                VoiceState voiceState = default(VoiceState);
                LocalInterop.Calli1(UnsafeBasePtr, &voiceState, flags, ((void **)(*(void **)UnsafeBasePtr))[25]);
                return(voiceState);
            }

            throw new Exception("Invalid XAudio2 Version.");
        }
示例#3
0
        /// <summary>
        ///     Returns the frequency adjustment ratio of the voi
        /// </summary>
        /// <returns>Current frequency adjustment ratio if successful.</returns>
        public unsafe float GetFrequencyRatio()
        {
            float value = default(float);

            return(LocalInterop.Calli1(UnsafeBasePtr, &value, ((void **)(*(void **)UnsafeBasePtr))[27]));
        }