Exemple #1
0
 protected virtual void Dispose(bool disposing)
 {
     if (handle != Handle.Zero)
     {
         Dll.Signal_delete(handle);
     }
 }
Exemple #2
0
        public Point GetPosition(int channel)
        {
            Point p = new Point();

            Dll.Spatializer_getPosition(handle, channel, ref p.x, ref p.y);
            return(p);
        }
Exemple #3
0
 protected virtual void Dispose(bool disposing)
 {
     if (handle != Handle.Zero)
     {
         Dll.Spatializer_delete(handle);
         handle = Handle.Zero;
     }
 }
Exemple #4
0
 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);
 }
Exemple #5
0
 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);
 }
Exemple #6
0
 public Spatializer(Session session = null)
 {
     if (session != null)
     {
         this.handle = Dll.Spatializer_create(session.handle);
     }
     else
     {
         this.handle = Dll.Spatializer_create(Handle.Zero);
     }
 }
Exemple #7
0
        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]);
            }
        }
Exemple #8
0
 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);
     }
 }
Exemple #9
0
 public Triangle(double initial, double rate) :
     base(Dll.Triangle_create3(initial, rate))
 {
 }
Exemple #10
0
 public Triangle(double hertz) :
     base(Dll.Triangle_create2(hertz))
 {
 }
Exemple #11
0
 public Triangle(Signal x) :
     base(Dll.Triangle_create1(x.handle))
 {
 }
Exemple #12
0
 public Saw(double hertz, Signal modulation, double index) :
     base(Dll.Saw_create4(hertz, modulation.handle, index))
 {
 }
Exemple #13
0
 public Reverser(Signal signal) :
     base(Dll.Reverser_create(signal.handle))
 {
 }
Exemple #14
0
 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))
 {
 }
Exemple #15
0
 public Envelope(double duration, double amplitude = 1) :
     base(Dll.Envelope_create(duration, amplitude))
 {
 }
Exemple #16
0
 public Square(double initial, double rate) :
     base(Dll.Square_create3(initial, rate))
 {
 }
Exemple #17
0
 public Square(double hertz) :
     base(Dll.Square_create2(hertz))
 {
 }
Exemple #18
0
 public Square(Signal x) :
     base(Dll.Square_create1(x.handle))
 {
 }
Exemple #19
0
 public Sine(double initial, double rate) :
     base(Dll.Sine_create3(initial, rate))
 {
 }
Exemple #20
0
 public Sine(double hertz) :
     base(Dll.Sine_create2(hertz))
 {
 }
Exemple #21
0
 public Sine(Signal x) :
     base(Dll.Sine_create1(x.handle))
 {
 }
Exemple #22
0
 public Triangle(double hertz, Signal modulation, double index) :
     base(Dll.Triangle_create4(hertz, modulation.handle, index))
 {
 }
Exemple #23
0
 public Pwm(double frequency, double dutyCycle) :
     base(Dll.Pwm_create(frequency, dutyCycle))
 {
 }
Exemple #24
0
 public static bool SaveSignal(Signal signal, string name)
 {
     return(Dll.Library_saveSignal(signal.handle, name));
 }
Exemple #25
0
 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));
 }
Exemple #26
0
 public ASR(double a, double s, double r, double amplitude = 1) :
     base(Dll.ASR_create(a, s, r, amplitude))
 {
 }
Exemple #27
0
 public static bool DeleteSignal(string name)
 {
     return(Dll.Library_deleteSignal(name));
 }
Exemple #28
0
 public Saw(double hertz) :
     base(Dll.Saw_create2(hertz))
 {
 }
Exemple #29
0
 public Saw(Signal x) :
     base(Dll.Saw_create1(x.handle))
 {
 }
Exemple #30
0
 public Saw(double initial, double rate) :
     base(Dll.Saw_create3(initial, rate))
 {
 }