//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)); }
public void AddEffect(DspType effect) { var dsp = _system.CreateDspByType(effect); _effects.Add(dsp); EffectAdded?.Invoke(this, EventArgs.Empty); }
/// <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"); }
/// <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"); }
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);
protected static extern ErrorCode CreateDspByType(IntPtr system, DspType type, ref IntPtr dsp);
protected static extern ErrorCode CreateDSPByType(IntPtr system, DspType dsptype, ref int Dsp);
protected static extern ErrorCode CreateDSPByType(IntPtr system, DspType dsptype, ref int Dsp);
internal static extern Result FMOD_System_CreateDSPByType(IntPtr systemHandle, DspType dspType, ref IntPtr dspHandle);
public Result GetType(out DspType type) { return(FMOD_DSP_GetType(RawPtr, out type)); }
private static extern Result FMOD_System_CreateDSPByType(IntPtr system, DspType type, out IntPtr dsp);
protected static extern ErrorCode GetType(IntPtr dsp, ref DspType type);
protected static extern ErrorCode CreateDspByType(IntPtr system, DspType type, ref IntPtr dsp);
/// <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; }
public Dsp CreateDsp(DspType type) { var result = Dsp.GetInstance(this, type); _dsps.Add(result.DangerousGetHandle(), result); return result; }
protected static extern ErrorCode GetType(IntPtr dsp, ref DspType type);