예제 #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);
        }