protected virtual void Dispose(bool disposing) { if (handle != Handle.Zero) { Dll.Signal_delete(handle); } }
public Point GetPosition(int channel) { Point p = new Point(); Dll.Spatializer_getPosition(handle, channel, ref p.x, ref p.y); return(p); }
protected virtual void Dispose(bool disposing) { if (handle != Handle.Zero) { Dll.Spatializer_delete(handle); handle = Handle.Zero; } }
public static bool ImportSignal(out Signal signal, string filePath, FileFormat format = FileFormat.Auto, int sampleRate = 48000) { signal = new Signal(Dll.Library_importSignal(filePath, (int)format, sampleRate)); if (signal.handle == Handle.Zero) { return(false); } return(true); }
public static bool LoadSignal(out Signal signal, string name) { signal = new Signal(Dll.Library_loadSignal(name)); if (signal.handle == Handle.Zero) { return(false); } return(true); }
public Spatializer(Session session = null) { if (session != null) { this.handle = Dll.Spatializer_create(session.handle); } else { this.handle = Dll.Spatializer_create(Handle.Zero); } }
public Session() { handle = Dll.Session_create(); int dev_count = Dll.Session_getAvailableDevicesCount(handle); this.availableDevices = new Device[dev_count]; int[] indices = new int[dev_count]; Dll.Session_getAvailableDevices(handle, indices); for (int i = 0; i < dev_count; ++i) { this.availableDevices[i] = new Device(handle, indices[i]); } }
internal Device(Handle session, int index) { this.index = index; if (this.index != -1) { int size = Dll.Device_nameLength(session, index); StringBuilder buf = new StringBuilder(size + 1); Dll.Device_name(session, index, buf); this.name = buf.ToString(); this.isDefault = Dll.Device_isDefault(session, index); this.api = (API)Dll.Device_api(session, index); size = Dll.Device_apiNameLength(session, index); buf = new StringBuilder(size + 1); Dll.Device_apiName(session, index, buf); this.apiName = buf.ToString(); this.isApiDefault = Dll.Device_isApiDefault(session, index); this.maxChannels = Dll.Device_maxChannels(session, index); size = Dll.Device_sampleRatesCount(session, index); this.sampleRates = new int[size]; Dll.Device_sampleRates(session, index, sampleRates); this.defaultSampleRate = Dll.Device_defaultSampleRate(session, index); } }
public Triangle(double initial, double rate) : base(Dll.Triangle_create3(initial, rate)) { }
public Triangle(double hertz) : base(Dll.Triangle_create2(hertz)) { }
public Triangle(Signal x) : base(Dll.Triangle_create1(x.handle)) { }
public Saw(double hertz, Signal modulation, double index) : base(Dll.Saw_create4(hertz, modulation.handle, index)) { }
public Reverser(Signal signal) : base(Dll.Reverser_create(signal.handle)) { }
public ADSR(double a, double d, double s, double r, double amplitude1 = 1, double amplitude2 = 0.5) : base(Dll.ADSR_create(a, d, s, r, amplitude1, amplitude2)) { }
public Envelope(double duration, double amplitude = 1) : base(Dll.Envelope_create(duration, amplitude)) { }
public Square(double initial, double rate) : base(Dll.Square_create3(initial, rate)) { }
public Square(double hertz) : base(Dll.Square_create2(hertz)) { }
public Square(Signal x) : base(Dll.Square_create1(x.handle)) { }
public Sine(double initial, double rate) : base(Dll.Sine_create3(initial, rate)) { }
public Sine(double hertz) : base(Dll.Sine_create2(hertz)) { }
public Sine(Signal x) : base(Dll.Sine_create1(x.handle)) { }
public Triangle(double hertz, Signal modulation, double index) : base(Dll.Triangle_create4(hertz, modulation.handle, index)) { }
public Pwm(double frequency, double dutyCycle) : base(Dll.Pwm_create(frequency, dutyCycle)) { }
public static bool SaveSignal(Signal signal, string name) { return(Dll.Library_saveSignal(signal.handle, name)); }
public static bool ExportSignal(Signal signal, string filePath, FileFormat format = FileFormat.Auto, int sampleRate = 48000, double maxLength = 60) { return(Dll.Library_exportSignal(signal.handle, filePath, (int)format, sampleRate, maxLength)); }
public ASR(double a, double s, double r, double amplitude = 1) : base(Dll.ASR_create(a, s, r, amplitude)) { }
public static bool DeleteSignal(string name) { return(Dll.Library_deleteSignal(name)); }
public Saw(double hertz) : base(Dll.Saw_create2(hertz)) { }
public Saw(Signal x) : base(Dll.Saw_create1(x.handle)) { }
public Saw(double initial, double rate) : base(Dll.Saw_create3(initial, rate)) { }