Documentation
¶
Index ¶
- Constants
- Variables
- func CoInitialize(p uintptr) (hr uintptr)
- func CoUninitialize()
- func ListDrivers() (drivers map[string]*ASIODriver, err error)
- func RegOpenKey(key syscall.Handle, subkey string, desiredAccess uint32) (handle syscall.Handle, err error)
- type ASIODriver
- type ASIOTime
- type BufferInfo
- type Callbacks
- type ChannelInfo
- type Error
- type GUID
- type IASIO
- func (drv *IASIO) AsIUnknown() *IUnknown
- func (drv *IASIO) CanSampleRate(sampleRate float64) (err error)
- func (drv *IASIO) ControlPanel() (err error)
- func (drv *IASIO) CreateBuffers(bufferDescriptors []BufferInfo, bufferSize int, callbacks Callbacks) (err error)
- func (drv *IASIO) DisposeBuffers() (err error)
- func (drv *IASIO) GetBufferSize() (minSize, maxSize, preferredSize, granularity int, err error)
- func (drv *IASIO) GetChannelInfo(channel int, isInput bool) (info *ChannelInfo, err error)
- func (drv *IASIO) GetChannels() (numInputChannels, numOutputChannels int, err error)
- func (drv *IASIO) GetDriverName() string
- func (drv *IASIO) GetDriverVersion() int32
- func (drv *IASIO) GetErrorMessage() string
- func (drv *IASIO) GetLatencies() (inputLatency, outputLatency int, err error)
- func (drv *IASIO) GetSampleRate() (sampleRate float64, err error)
- func (drv *IASIO) Init(sysHandle uintptr) (ok bool)
- func (drv *IASIO) OutputReady() bool
- func (drv *IASIO) SetSampleRate(sampleRate float64) (err error)
- func (drv *IASIO) Start() (err error)
- func (drv *IASIO) Stop() (err error)
- type IUnknown
- type SampleType
Constants ¶
const ( ASE_OK = 0 // This value will be returned whenever the call succeeded ASE_SUCCESS = 0x3f4847a0 // unique success return value for ASIOFuture calls )
Special ASIO error values:
const ( ASE_NotPresent = -1000 + iota // hardware input or output is not present or available ASE_HWMalfunction // hardware is malfunctioning (can be returned by any ASIO function) ASE_InvalidParameter // input parameter invalid ASE_InvalidMode // hardware is in a bad mode or used in a bad mode ASE_SPNotAdvancing // hardware is not running when sample position is inquired ASE_NoClock // sample clock or rate cannot be determined or is not present ASE_NoMemory // not enough memory for completing the request )
Known ASIO error values:
const ( CLSCTX_INPROC_SERVER = 1 CLSCTX_LOCAL_SERVER = 4 )
Variables ¶
var ( ErrorNotPresent = &Error{errno: ASE_NotPresent, msg: "hardware input or output is not present or available"} ErrorHWMalfunction = &Error{errno: ASE_HWMalfunction, msg: "hardware is malfunctioning (can be returned by any ASIO function)"} ErrorInvalidParameter = &Error{errno: ASE_InvalidParameter, msg: "input parameter invalid"} ErrorInvalidMode = &Error{errno: ASE_InvalidMode, msg: "hardware is in a bad mode or used in a bad mode"} ErrorSPNotAdvancing = &Error{errno: ASE_SPNotAdvancing, msg: "hardware is not running when sample position is inquired"} ErrorNoClock = &Error{errno: ASE_NoClock, msg: "sample clock or rate cannot be determined or is not present"} ErrorNoMemory = &Error{errno: ASE_NoMemory, msg: "not enough memory for completing the request"} )
Fixed instances of errors:
var (
IID_NULL = &GUID{0x00000000, 0x0000, 0x0000, [8]byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}
)
Functions ¶
func CoInitialize ¶
func CoUninitialize ¶
func CoUninitialize()
func ListDrivers ¶
func ListDrivers() (drivers map[string]*ASIODriver, err error)
Enumerate list of ASIO drivers registered on the system
Types ¶
type ASIODriver ¶
func (*ASIODriver) Close ¶
func (drv *ASIODriver) Close()
func (*ASIODriver) Open ¶
func (drv *ASIODriver) Open() (err error)
type BufferInfo ¶
type ChannelInfo ¶
type IASIO ¶
type IASIO struct {
// contains filtered or unexported fields
}
COM Interface for ASIO driver
func (*IASIO) CanSampleRate ¶
virtual ASIOError canSampleRate(ASIOSampleRate sampleRate) = 0;
func (*IASIO) ControlPanel ¶
virtual ASIOError controlPanel() = 0;
func (*IASIO) CreateBuffers ¶
func (drv *IASIO) CreateBuffers(bufferDescriptors []BufferInfo, bufferSize int, callbacks Callbacks) (err error)
virtual ASIOError createBuffers(ASIOBufferInfo *bufferInfos, long numChannels, long bufferSize, ASIOCallbacks *callbacks) = 0;
func (*IASIO) DisposeBuffers ¶
virtual ASIOError disposeBuffers() = 0;
func (*IASIO) GetBufferSize ¶
virtual ASIOError getBufferSize(long *minSize, long *maxSize, long *preferredSize, long *granularity) = 0;
func (*IASIO) GetChannelInfo ¶
func (drv *IASIO) GetChannelInfo(channel int, isInput bool) (info *ChannelInfo, err error)
virtual ASIOError getChannelInfo(ASIOChannelInfo *info) = 0;
func (*IASIO) GetChannels ¶
virtual ASIOError getChannels(long *numInputChannels, long *numOutputChannels) = 0;
func (*IASIO) GetDriverName ¶
virtual void getDriverName(char *name) = 0;
func (*IASIO) GetDriverVersion ¶
virtual long getDriverVersion() = 0;
func (*IASIO) GetErrorMessage ¶
virtual void getErrorMessage(char *string) = 0;
func (*IASIO) GetLatencies ¶
virtual ASIOError getLatencies(long *inputLatency, long *outputLatency) = 0;
func (*IASIO) GetSampleRate ¶
virtual ASIOError getSampleRate(ASIOSampleRate *sampleRate) = 0;
func (*IASIO) OutputReady ¶
virtual ASIOError outputReady() = 0;
func (*IASIO) SetSampleRate ¶
virtual ASIOError setSampleRate(ASIOSampleRate sampleRate) = 0;
type SampleType ¶
type SampleType int32
const ( ASIOSTInt16MSB SampleType = 0 ASIOSTInt24MSB SampleType = 1 // used for 20 bits as well ASIOSTInt32MSB SampleType = 2 ASIOSTFloat32MSB SampleType = 3 // IEEE 754 32 bit float ASIOSTFloat64MSB SampleType = 4 // IEEE 754 64 bit double float // these are used for 32 bit data buffer, with different alignment of the data inside // 32 bit PCI bus systems can be more easily used with these ASIOSTInt32MSB16 SampleType = 8 // 32 bit data with 16 bit alignment ASIOSTInt32MSB18 SampleType = 9 // 32 bit data with 18 bit alignment ASIOSTInt32MSB20 SampleType = 10 // 32 bit data with 20 bit alignment ASIOSTInt32MSB24 SampleType = 11 // 32 bit data with 24 bit alignment ASIOSTInt16LSB SampleType = 16 ASIOSTInt24LSB SampleType = 17 // used for 20 bits as well ASIOSTInt32LSB SampleType = 18 ASIOSTFloat32LSB SampleType = 19 // IEEE 754 32 bit float, as found on Intel x86 architecture ASIOSTFloat64LSB SampleType = 20 // IEEE 754 64 bit double float, as found on Intel x86 architecture // these are used for 32 bit data buffer, with different alignment of the data inside // 32 bit PCI bus systems can more easily used with these ASIOSTInt32LSB16 SampleType = 24 // 32 bit data with 18 bit alignment ASIOSTInt32LSB18 SampleType = 25 // 32 bit data with 18 bit alignment ASIOSTInt32LSB20 SampleType = 26 // 32 bit data with 20 bit alignment ASIOSTInt32LSB24 SampleType = 27 // 32 bit data with 24 bit alignment // ASIO DSD format. ASIOSTDSDInt8LSB1 SampleType = 32 // DSD 1 bit data, 8 samples per byte. First sample in Least significant bit. ASIOSTDSDInt8MSB1 SampleType = 33 // DSD 1 bit data, 8 samples per byte. First sample in Most significant bit. ASIOSTDSDInt8NER8 SampleType = 40 // DSD 8 bit data, 1 sample per byte. No Endianness required. )