Ejemplo n.º 1
0
        /// <summary>
        /// Kind of like a DSP factory. But not.
        /// </summary>
        internal static Dsp GetInstance(FmodSystem system, DspType type)
        {
            IntPtr handle = IntPtr.Zero;

            Errors.ThrowIfError(CreateDspByType(system.DangerousGetHandle(), type, ref handle));

            if (type == DspType.Oscillator)
            {
                return(new Oscillator(handle, system));
            }
            ;

            // TODO: implement other types
            throw new NotSupportedException("DSP type " + type + " not currently supported by nFMOD");
        }
Ejemplo n.º 2
0
        public Channel Play(Channel channel = null)
        {
            IntPtr result = channel == null
                ? IntPtr.Zero
                : Channel.DangerousGetHandle()
            ;

            Errors.ThrowIfError(PlayDsp(Parent.DangerousGetHandle(), ChannelIndex.Free, DangerousGetHandle(), false, ref result));

            Channel = channel == null
                ? new Channel(result)
                : channel;

            return(Channel);
        }
Ejemplo n.º 3
0
 public static void GetStats(ref int currentalloced, ref int maxalloced, bool blocking)
 {
     Errors.ThrowIfError(GetStats_External(ref currentalloced, ref maxalloced, blocking));
 }
Ejemplo n.º 4
0
 public static void GetStats(ref int currentalloced, ref int maxalloced)
 {
     Errors.ThrowIfError(GetStats_External(ref currentalloced, ref maxalloced, true));
 }
Ejemplo n.º 5
0
 public void Stop()
 {
     Errors.ThrowIfError(Stop(DangerousGetHandle()));
 }
Ejemplo n.º 6
0
 public void SetCallback(ChannelCallbackType callback)
 {
     Errors.ThrowIfError(SetCallback(DangerousGetHandle(), callback));
 }
Ejemplo n.º 7
0
 public void Reset()
 {
     Errors.ThrowIfError(Reset_External(DangerousGetHandle()));
 }