//todo: create DSP from description
        //public DSP CreateDSP(ref DspDescription description)
        //{
        //    DSP_DESCRIPTION d = description.ToFmod();
        //    FMOD.DSP dsp;
        //    _system.createDSP(ref d, out dsp).Check();
        //    return DSP.FromFmod(dsp);
        //}

        public DSP CreateDSP(DspType type)
        {
            FMOD.DSP dsp;
            _system.createDSPByType((DSP_TYPE)type, out dsp).Check();

            return(DSP.FromFmod(dsp));
        }
示例#2
0
        public void AddEffect(DspType effect)
        {
            var dsp = _system.CreateDspByType(effect);

            _effects.Add(dsp);
            EffectAdded?.Invoke(this, EventArgs.Empty);
        }
示例#3
0
文件: Dsp.cs 项目: nathanchere/nFMOD
        /// <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");
        }
示例#4
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");
        }
示例#5
0
 private static extern Result FMOD_DSP_GetType(IntPtr dsp, out DspType type);
		internal static extern Result FMOD_System_CreateDSPByType(IntPtr systemHandle, DspType dspType, ref IntPtr dspHandle);
示例#7
0
文件: Dsp.cs 项目: nathanchere/nFMOD
 protected static extern ErrorCode CreateDspByType(IntPtr system, DspType type, ref IntPtr dsp);
示例#8
0
文件: Dsp.cs 项目: nathanchere/nFMOD
 protected static extern ErrorCode CreateDSPByType(IntPtr system, DspType dsptype, ref int Dsp);
示例#9
0
 protected static extern ErrorCode CreateDSPByType(IntPtr system, DspType dsptype, ref int Dsp);
示例#10
0
 internal static extern Result FMOD_System_CreateDSPByType(IntPtr systemHandle, DspType dspType, ref IntPtr dspHandle);
示例#11
0
 public Result GetType(out DspType type)
 {
     return(FMOD_DSP_GetType(RawPtr, out type));
 }
示例#12
0
 private static extern Result FMOD_System_CreateDSPByType(IntPtr system, DspType type, out IntPtr dsp);
示例#13
0
 protected static extern ErrorCode GetType(IntPtr dsp, ref DspType type);
示例#14
0
 protected static extern ErrorCode CreateDspByType(IntPtr system, DspType type, ref IntPtr dsp);
示例#15
0
		/// <summary>
		/// Create a Dsp by DspType
		/// </summary>
		/// <param name="type">The type of Dsp to create</param>
		/// <returns>A new Dsp</returns>
		public Dsp CreateDsp(DspType type)
		{
			currentResult = Result.Ok;
			IntPtr dspHandle = new IntPtr();
			Dsp dsp = null;

			try
			{
				currentResult = NativeMethods.FMOD_System_CreateDSPByType(handle, type, ref dspHandle);
			}
			catch (System.Runtime.InteropServices.ExternalException)
			{
				currentResult = Result.InvalidParameterError;
			}
			
			if (currentResult == Result.Ok)
			{
				dsp = new Dsp();
				dsp.Handle = dspHandle;				
			}

			return dsp;
		}
示例#16
0
 public Dsp CreateDsp(DspType type)
 {
     var result = Dsp.GetInstance(this, type);
     _dsps.Add(result.DangerousGetHandle(), result);
     return result;
 }
示例#17
0
文件: Dsp.cs 项目: nathanchere/nFMOD
 protected static extern ErrorCode GetType(IntPtr dsp, ref DspType type);