예제 #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");
        }
예제 #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);
        }
예제 #3
0
 public static void GetStats(ref int currentalloced, ref int maxalloced, bool blocking)
 {
     Errors.ThrowIfError(GetStats_External(ref currentalloced, ref maxalloced, blocking));
 }
예제 #4
0
 public static void GetStats(ref int currentalloced, ref int maxalloced)
 {
     Errors.ThrowIfError(GetStats_External(ref currentalloced, ref maxalloced, true));
 }
예제 #5
0
 public void Stop()
 {
     Errors.ThrowIfError(Stop(DangerousGetHandle()));
 }
예제 #6
0
 public void SetCallback(ChannelCallbackType callback)
 {
     Errors.ThrowIfError(SetCallback(DangerousGetHandle(), callback));
 }
예제 #7
0
 public void Reset()
 {
     Errors.ThrowIfError(Reset_External(DangerousGetHandle()));
 }