Class AsioDriver
Main AsioDriver Class. To use this class, you need to query first the GetAsioDriverNames() and then use the GetAsioDriverByName to instantiate the correct AsioDriver. This is the first AsioDriver binding fully implemented in C#!
Contributor: Alexandre Mutel - email: alexandre_mutel at yahoo.fr
public class AsioDriver
- Inheritance
-
AsioDriver
- Inherited Members
Methods
CanSampleRate(double)
Determines whether this instance can use the specified sample rate.
public bool CanSampleRate(double sampleRate)
Parameters
sampleRatedoubleThe sample rate.
Returns
- bool
trueif this instance [can sample rate] the specified sample rate; otherwise,false.
ControlPanel()
Controls the panel.
public void ControlPanel()
CreateBuffers(nint, int, int, ref AsioCallbacks)
Creates the buffers.
public void CreateBuffers(nint bufferInfos, int numChannels, int bufferSize, ref AsioCallbacks callbacks)
Parameters
bufferInfosnintThe buffer infos.
numChannelsintThe num channels.
bufferSizeintSize of the buffer.
callbacksAsioCallbacksThe callbacks.
DisposeBuffers()
Disposes the buffers.
public AsioError DisposeBuffers()
Returns
Future(int, nint)
Futures the specified selector.
public void Future(int selector, nint opt)
Parameters
GetAsioDriverByGuid(Guid)
Instantiate the ASIO driver by GUID.
public static AsioDriver GetAsioDriverByGuid(Guid guid)
Parameters
guidGuidThe GUID.
Returns
- AsioDriver
an AsioDriver instance
GetAsioDriverByName(string)
Instantiate a AsioDriver given its name.
public static AsioDriver GetAsioDriverByName(string name)
Parameters
namestringThe name of the driver
Returns
- AsioDriver
an AsioDriver instance
GetAsioDriverNames()
Gets the ASIO driver names installed.
public static string[] GetAsioDriverNames()
Returns
- string[]
a list of driver names. Use this name to GetAsioDriverByName
GetBufferSize(out int, out int, out int, out int)
Gets the size of the buffer.
public void GetBufferSize(out int minSize, out int maxSize, out int preferredSize, out int granularity)
Parameters
minSizeintSize of the min.
maxSizeintSize of the max.
preferredSizeintSize of the preferred.
granularityintThe granularity.
GetChannelInfo(int, bool)
Gets the channel info.
public AsioChannelInfo GetChannelInfo(int channelNumber, bool trueForInputInfo)
Parameters
Returns
- AsioChannelInfo
Channel Info
GetChannels(out int, out int)
Gets the number of channels.
public void GetChannels(out int numInputChannels, out int numOutputChannels)
Parameters
GetClockSources(int)
Enumerates the clock sources available to the driver (Internal, Word Clock, S/PDIF, ADAT, …).
Each entry's IsCurrentSource indicates whether the driver is
currently locked to it; the Index is the value to pass to
SetClockSource(int). The driver may signal kAsioResetRequest in response
to a clock-source change, which surfaces via AsioDevice.DriverResetRequest.
public AsioClockSource[] GetClockSources(int maxSources = 16)
Parameters
maxSourcesintUpper bound on the number of sources to retrieve. 16 is generous — even high-end interfaces rarely report more than 8.
Returns
GetDriverName()
Gets the name of the driver.
public string GetDriverName()
Returns
GetDriverVersion()
Gets the driver version.
public int GetDriverVersion()
Returns
GetErrorMessage()
Gets the error message.
public string GetErrorMessage()
Returns
GetLatencies(out int, out int)
Gets the latencies (n.b. does not throw an exception)
public AsioError GetLatencies(out int inputLatency, out int outputLatency)
Parameters
Returns
GetSamplePosition(out Asio64Bit, out Asio64Bit)
Gets the current sample position and the host system time (in nanoseconds) at which it was sampled.
public void GetSamplePosition(out Asio64Bit samplePos, out Asio64Bit timeStamp)
Parameters
samplePosAsio64BitSample position since
Start(), as a 64-bit ASIO value.timeStampAsio64BitSystem time in nanoseconds corresponding to
samplePos.
GetSampleRate()
Gets the sample rate.
public double GetSampleRate()
Returns
Init(nint)
Inits the AsioDriver..
public bool Init(nint sysHandle)
Parameters
sysHandlenintThe sys handle.
Returns
OutputReady()
Notifies OutputReady to the AsioDriver.
public AsioError OutputReady()
Returns
ReleaseComAsioDriver()
Releases this instance.
public void ReleaseComAsioDriver()
SetClockSource(int)
Sets the clock source. Use one of the Index values returned by GetClockSources(int).
public void SetClockSource(int reference)
Parameters
referenceintClock source index reported by the driver.
SetSampleRate(double)
Sets the sample rate.
public void SetSampleRate(double sampleRate)
Parameters
sampleRatedoubleThe sample rate.
Start()
Starts this instance.
public void Start()
Stop()
Stops this instance.
public AsioError Stop()