com.groovemanager.spi.asio
Class ASIOStaticFunctions

java.lang.Object
  extended by com.groovemanager.spi.asio.ASIOStaticFunctions

final class ASIOStaticFunctions
extends java.lang.Object

This class provides wrapper methods for native ASIO functions

Author:
Manu Robledo

Field Summary
(package private) static long MESSAGE_SELECTOR_kAsioBufferSizeChange
           
(package private) static long MESSAGE_SELECTOR_kAsioEngineVersion
           
(package private) static long MESSAGE_SELECTOR_kAsioLatenciesChanged
           
(package private) static long MESSAGE_SELECTOR_kAsioResetRequest
           
(package private) static long MESSAGE_SELECTOR_kAsioResyncRequest
           
(package private) static long MESSAGE_SELECTOR_kAsioSelectorSupported
           
(package private) static long MESSAGE_SELECTOR_kAsioSupportsTimeCode
           
(package private) static long MESSAGE_SELECTOR_kAsioSupportsTimeInfo
           
 
Constructor Summary
ASIOStaticFunctions()
           
 
Method Summary
(package private) static boolean ASIOCanSampleRate(double sampleRate)
          Wrapper for ASIOCanSampleRate()
(package private) static void ASIOControlPanel()
          Wrapper for ASIOControlPanel()
(package private) static ASIOBufferInfo[] ASIOCreateBuffers(ASIOBufferInfo[] infos, int bufferSize)
          Wrapper for ASIOCreateBuffers()
(package private) static void ASIODisposeBuffers()
          Wrapper for ASIODisposeBuffers()
(package private) static void ASIOExit()
          Wrapper for ASIOExit()
(package private) static void ASIOFuture(int selector, long pointer)
          Wrapper for ASIOFuture()
(package private) static int[] ASIOGetBufferSize()
          Wrapper for ASIOGetBufferSize()
(package private) static int ASIOGetBufferSizeGranularity()
          Wrapper for ASIOGetBufferSize()
(package private) static ASIOChannelInfo ASIOGetChannelinfo(int channel, boolean isInput)
          Wrapper for ASIOGetChannelInfo()
(package private) static int[] ASIOGetChannels()
          Wrapper for ASIOGetChannels()
(package private) static ASIOClockSource[] ASIOGetClockSources(int numSources)
          Wrapper for ASIOGetClockSources()
(package private) static int ASIOGetInputChannels()
          Wrapper for ASIOGetChannels()
(package private) static int ASIOGetInputLatency()
          Wrapper for ASIOGetLatencies()
(package private) static int[] ASIOGetLatencies()
          Wrapper for ASIOGetLatencies()
(package private) static int ASIOGetMaxBufferSize()
          Wrapper for ASIOGetBufferSize()
(package private) static int ASIOGetMinBufferSize()
          Wrapper for ASIOGetBufferSize()
(package private) static int ASIOGetOutputChannels()
          Wrapper for ASIOGetChannels()
(package private) static int ASIOGetOutputLatency()
          Wrapper for ASIOGetLatencies()
(package private) static int ASIOGetPreferredBufferSize()
          Wrapper for ASIOGetBufferSize()
(package private) static double ASIOGetSampleRate()
          Wrapper for ASIOGetSampleRate
(package private) static ASIODriverInfo ASIOInit()
          Wrapper for ASIOInit()
(package private) static void ASIOOutputReady()
          Wrapper for ASIOOutputReady()
(package private) static void ASIOSetClockSource(int index)
          Wrapper for ASIOSetClockSource()
(package private) static void ASIOSetSampleRate(double rate)
          Wrapper for ASIOSetSampleRate
(package private) static void ASIOStart()
          Wrapper for ASIOStart()
(package private) static void ASIOStop()
          Wrapper for ASIOStop()
private static java.nio.ByteBuffer createBuffer(long infoPointer, int index, int capacity)
           
(package private) static java.nio.ByteBuffer[] createBuffers(ASIOBufferInfo info, int asiobuffersize)
          Create two ByteBuffer objects from the buffer half addresses specified in the ASIOBufferInfo
(package private) static long getSystemTime()
          Get the system time reference
private static int jASIOCanSampleRate(ASIOSampleRate rate)
           
private static int jASIOControlPanel()
           
private static int jASIOCreateBuffers(long[] infos, int bufferSize)
           
private static int jASIODisposeBuffers()
           
private static int jASIOExit()
           
private static int jASIOFuture(int selector, long pointer)
           
private static int jASIOGetBufferSize(int[] data)
           
private static int jASIOGetChannelInfo(long pointer)
           
private static int jASIOGetChannels(int[] channels)
           
private static int jASIOGetClockSources(long[] clockPointers)
           
private static int jASIOGetLatencies(int[] latencies)
           
private static int jASIOGetSampleRate(ASIOSampleRate sampleRate)
           
private static int jASIOInit(long pointer)
           
private static int jASIOOutputReady()
           
private static int jASIOSetClockSource(int index)
           
private static int jASIOSetSampleRate(ASIOSampleRate sampleRate)
           
private static int jASIOStart()
           
private static int jASIOStop()
           
private static long kAsioBufferSizeChange()
           
private static long kAsioDisableTimeCodeRead()
           
private static long kAsioEnableTimeCodeRead()
           
private static long kAsioEngineVersion()
           
private static long kAsioLatenciesChanged()
           
private static long kAsioResetRequest()
           
private static long kAsioResyncRequest()
           
private static long kAsioSelectorSupported()
          ASIO message selector for asioMessage()
private static long kAsioSetInputMonitor()
           
private static long kAsioSupportsTimeCode()
           
private static long kAsioSupportsTimeInfo()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MESSAGE_SELECTOR_kAsioBufferSizeChange

static final long MESSAGE_SELECTOR_kAsioBufferSizeChange

MESSAGE_SELECTOR_kAsioEngineVersion

static final long MESSAGE_SELECTOR_kAsioEngineVersion

MESSAGE_SELECTOR_kAsioLatenciesChanged

static final long MESSAGE_SELECTOR_kAsioLatenciesChanged

MESSAGE_SELECTOR_kAsioResetRequest

static final long MESSAGE_SELECTOR_kAsioResetRequest

MESSAGE_SELECTOR_kAsioResyncRequest

static final long MESSAGE_SELECTOR_kAsioResyncRequest

MESSAGE_SELECTOR_kAsioSelectorSupported

static final long MESSAGE_SELECTOR_kAsioSelectorSupported

MESSAGE_SELECTOR_kAsioSupportsTimeCode

static final long MESSAGE_SELECTOR_kAsioSupportsTimeCode

MESSAGE_SELECTOR_kAsioSupportsTimeInfo

static final long MESSAGE_SELECTOR_kAsioSupportsTimeInfo
Constructor Detail

ASIOStaticFunctions

ASIOStaticFunctions()
Method Detail

ASIOCanSampleRate

static boolean ASIOCanSampleRate(double sampleRate)
                          throws ASIOError
Wrapper for ASIOCanSampleRate()

Parameters:
sampleRate - The sample rate to ask the driver for
Returns:
true if the currently loaded driver supports the given rate, false otherwise
Throws:
ASIOError - If ASIOCanSampleRate() fails

ASIOControlPanel

static void ASIOControlPanel()
                      throws ASIOError
Wrapper for ASIOControlPanel()

Throws:
ASIOError - If ASIOControlPanel() fails

ASIOCreateBuffers

static ASIOBufferInfo[] ASIOCreateBuffers(ASIOBufferInfo[] infos,
                                          int bufferSize)
                                   throws ASIOError
Wrapper for ASIOCreateBuffers()

Parameters:
infos - ASIOBufferInfo-Array with information of the channels to prepare the buffers for
bufferSize - The buffersize to use
Returns:
An ASIOBufferInfo-Array with the result information
Throws:
ASIOError - If ASIOCreateBuffer() fails

ASIODisposeBuffers

static void ASIODisposeBuffers()
                        throws ASIOError
Wrapper for ASIODisposeBuffers()

Throws:
ASIOError - If ASIODisposeBuffers() fails

ASIOExit

static void ASIOExit()
              throws ASIOError
Wrapper for ASIOExit()

Throws:
ASIOError - If ASIOExit() fails

ASIOFuture

static void ASIOFuture(int selector,
                       long pointer)
                throws ASIOError
Wrapper for ASIOFuture()

Parameters:
selector - The selector
pointer - The address of the "void* param" parameter
Throws:
ASIOError - If ASIOFuture() fails

ASIOGetBufferSize

static int[] ASIOGetBufferSize()
                        throws ASIOError
Wrapper for ASIOGetBufferSize()

Returns:
An int-Array with the minimum buffer size at position [0], the maximum buffer size az position [1], the preferred buffer size at position [2] and the buffer size granularity at position [3].
Throws:
ASIOError - If ASIOGetBufferSize() fails

ASIOGetBufferSizeGranularity

static int ASIOGetBufferSizeGranularity()
                                 throws ASIOError
Wrapper for ASIOGetBufferSize()

Returns:
The granularity of the buffer size of the currently loaded driver in sample frames
Throws:
ASIOError - If ASIOGetBufferSize() fails

ASIOGetChannelinfo

static ASIOChannelInfo ASIOGetChannelinfo(int channel,
                                          boolean isInput)
                                   throws ASIOError
Wrapper for ASIOGetChannelInfo()

Parameters:
channel - The number of the channel to query (zero-based)
isInput - true if querying an input channel, false otherwise
Returns:
An ASIOChannelInfo instance with infos about that channel
Throws:
ASIOError - If ASIOGetChannelinfo() fails

ASIOGetChannels

static int[] ASIOGetChannels()
                      throws ASIOError
Wrapper for ASIOGetChannels()

Returns:
An int-Array with the number of input channels at position [0] and the number of output channels at position [1]
Throws:
ASIOError - If ASIOGetChannels() fails

ASIOGetClockSources

static ASIOClockSource[] ASIOGetClockSources(int numSources)
                                      throws ASIOError
Wrapper for ASIOGetClockSources()

Parameters:
numSources - The maximum number of sources expected
Returns:
An Array of ASIOClockSource instances
Throws:
ASIOError - If ASIOGetClockSources() fails

ASIOGetInputChannels

static int ASIOGetInputChannels()
                         throws ASIOError
Wrapper for ASIOGetChannels()

Returns:
The number of input channels supported by the currently loaded driver
Throws:
ASIOError - If ASIOGetChannels() fails

ASIOGetInputLatency

static int ASIOGetInputLatency()
                        throws ASIOError
Wrapper for ASIOGetLatencies()

Returns:
The input latency in sample frames
Throws:
ASIOError - If ASIOGetLAtencies() fails

ASIOGetLatencies

static int[] ASIOGetLatencies()
                       throws ASIOError
Wrapper for ASIOGetLatencies()

Returns:
An int-Array with the input latency on position [0] and the output latency on position [1] (in sample frames)
Throws:
ASIOError - If ASIOGetLAtencies() fails

ASIOGetMaxBufferSize

static int ASIOGetMaxBufferSize()
                         throws ASIOError
Wrapper for ASIOGetBufferSize()

Returns:
The maximum buffer size supported by the currently loaded driver in sample frames
Throws:
ASIOError - If ASIOGetBufferSize() fails

ASIOGetMinBufferSize

static int ASIOGetMinBufferSize()
                         throws ASIOError
Wrapper for ASIOGetBufferSize()

Returns:
The minimum buffer size supported by the currently loaded driver in sample frames
Throws:
ASIOError - If ASIOGetBufferSize() fails

ASIOGetOutputChannels

static int ASIOGetOutputChannels()
                          throws ASIOError
Wrapper for ASIOGetChannels()

Returns:
The number of output channels supported by the currently loaded driver
Throws:
ASIOError - If ASIOGetChannels() fails

ASIOGetOutputLatency

static int ASIOGetOutputLatency()
                         throws ASIOError
Wrapper for ASIOGetLatencies()

Returns:
The output latency in sample frames
Throws:
ASIOError - If ASIOGetLAtencies() fails

ASIOGetPreferredBufferSize

static int ASIOGetPreferredBufferSize()
                               throws ASIOError
Wrapper for ASIOGetBufferSize()

Returns:
The preferred buffer size of the currently loaded driver in sample frames
Throws:
ASIOError - If ASIOGetBufferSize() fails

ASIOGetSampleRate

static double ASIOGetSampleRate()
                         throws ASIOError
Wrapper for ASIOGetSampleRate

Returns:
The current sample rate of the currently loaded driver
Throws:
ASIOError - If ASIOGetSampleRate fails

ASIOInit

static ASIODriverInfo ASIOInit()
                        throws ASIOError
Wrapper for ASIOInit()

Returns:
A new ASIODriverInfo instance describing the loaded driver
Throws:
ASIOError - If ASIOInit() fails

ASIOOutputReady

static void ASIOOutputReady()
                     throws ASIOError
Wrapper for ASIOOutputReady()

Throws:
ASIOError - If ASIOOutputReady() fails

ASIOSetClockSource

static void ASIOSetClockSource(int index)
                        throws ASIOError
Wrapper for ASIOSetClockSource()

Parameters:
index - The index of the clock source to select
Throws:
ASIOError - If ASIOSetClockSources() fails

ASIOSetSampleRate

static void ASIOSetSampleRate(double rate)
                       throws ASIOError
Wrapper for ASIOSetSampleRate

Parameters:
rate - The new sample rate to set
Throws:
ASIOError - If ASIOSetSampleRate() fails

ASIOStart

static void ASIOStart()
               throws ASIOError
Wrapper for ASIOStart()

Throws:
ASIOError - If ASIOStart() fails

ASIOStop

static void ASIOStop()
              throws ASIOError
Wrapper for ASIOStop()

Throws:
ASIOError - If ASIOStop() fails

createBuffer

private static java.nio.ByteBuffer createBuffer(long infoPointer,
                                                int index,
                                                int capacity)

createBuffers

static java.nio.ByteBuffer[] createBuffers(ASIOBufferInfo info,
                                           int asiobuffersize)
Create two ByteBuffer objects from the buffer half addresses specified in the ASIOBufferInfo

Parameters:
info - The ASIOBufferInfo gotten from ASIOCreateBuffers()
asiobuffersize - The size of each half buffer in bytes
Returns:
An Array with the two direct ByteBuffers

getSystemTime

static long getSystemTime()
Get the system time reference

Returns:
The system reference time in nano seconds

jASIOCanSampleRate

private static int jASIOCanSampleRate(ASIOSampleRate rate)

jASIOControlPanel

private static int jASIOControlPanel()

jASIOCreateBuffers

private static int jASIOCreateBuffers(long[] infos,
                                      int bufferSize)

jASIODisposeBuffers

private static int jASIODisposeBuffers()

jASIOExit

private static int jASIOExit()

jASIOFuture

private static int jASIOFuture(int selector,
                               long pointer)

jASIOGetBufferSize

private static int jASIOGetBufferSize(int[] data)

jASIOGetChannelInfo

private static int jASIOGetChannelInfo(long pointer)

jASIOGetChannels

private static int jASIOGetChannels(int[] channels)

jASIOGetClockSources

private static int jASIOGetClockSources(long[] clockPointers)

jASIOGetLatencies

private static int jASIOGetLatencies(int[] latencies)

jASIOGetSampleRate

private static int jASIOGetSampleRate(ASIOSampleRate sampleRate)

jASIOInit

private static int jASIOInit(long pointer)

jASIOOutputReady

private static int jASIOOutputReady()

jASIOSetClockSource

private static int jASIOSetClockSource(int index)

jASIOSetSampleRate

private static int jASIOSetSampleRate(ASIOSampleRate sampleRate)

jASIOStart

private static int jASIOStart()

jASIOStop

private static int jASIOStop()

kAsioBufferSizeChange

private static long kAsioBufferSizeChange()

kAsioDisableTimeCodeRead

private static long kAsioDisableTimeCodeRead()

kAsioEnableTimeCodeRead

private static long kAsioEnableTimeCodeRead()

kAsioEngineVersion

private static long kAsioEngineVersion()

kAsioLatenciesChanged

private static long kAsioLatenciesChanged()

kAsioResetRequest

private static long kAsioResetRequest()

kAsioResyncRequest

private static long kAsioResyncRequest()

kAsioSelectorSupported

private static long kAsioSelectorSupported()
ASIO message selector for asioMessage()


kAsioSetInputMonitor

private static long kAsioSetInputMonitor()

kAsioSupportsTimeCode

private static long kAsioSupportsTimeCode()

kAsioSupportsTimeInfo

private static long kAsioSupportsTimeInfo()