com.groovemanager.spi.asio
Class AsioDrivers

java.lang.Object
  extended by com.groovemanager.spi.asio.NativeClass
      extended by com.groovemanager.spi.asio.AsioDrivers

final class AsioDrivers
extends NativeClass

This is a wrapper class for the native AsioDrivers class

Author:
Manu Robledo

Field Summary
private static int MAX_DRIVERS
          Number of maximum expected drivers
 
Constructor Summary
AsioDrivers()
          Constructs a new AsioDrivers instance and creates a corresponding native instance
AsioDrivers(long pointer)
          Constructs a new AsioDrivers instance that corresponds to an existing native instance, which is specified by the pointer
 
Method Summary
protected  void cleanUp()
          Delete the corresponding native instance to this class
protected  long createClass()
          Create a new native instance and return its address
(package private)  int getCurrentDriverIndex()
          Get the index of the currently loaded driver if any
(package private)  String getCurrentDriverName()
          Get the name of the currently loaded driver if any
private  String getDriverName(int i)
           
(package private)  String[] getDriverNames()
          Get the names of all installed ASIO drivers for user selection
(package private)  boolean loadDriver(String name)
          Load the driver with the given name
private  int prepareDriverNames(int maxDrivers)
           
(package private)  void removeCurrentDriver()
          Unload the currently loaded driver if any
 
Methods inherited from class com.groovemanager.spi.asio.NativeClass
finalize, getPointer
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_DRIVERS

private static final int MAX_DRIVERS
Number of maximum expected drivers

See Also:
Constant Field Values
Constructor Detail

AsioDrivers

AsioDrivers()
Constructs a new AsioDrivers instance and creates a corresponding native instance


AsioDrivers

AsioDrivers(long pointer)
Constructs a new AsioDrivers instance that corresponds to an existing native instance, which is specified by the pointer

Parameters:
pointer - The native address of the native AsioDrivers instance
Method Detail

loadDriver

boolean loadDriver(String name)
Load the driver with the given name

Parameters:
name - The name of the driver that should be loaded. The name should be derived from getDriverNames()
Returns:
true if the driver could be loaded, false otherwise

prepareDriverNames

private int prepareDriverNames(int maxDrivers)

getDriverName

private String getDriverName(int i)

getCurrentDriverName

String getCurrentDriverName()
Get the name of the currently loaded driver if any

Returns:
The name of the currently loaded driver or an empty String, if no driver is loaded.

getCurrentDriverIndex

int getCurrentDriverIndex()
Get the index of the currently loaded driver if any

Returns:
The index of the currently loaded driver or -1 if no driver is loaded.

removeCurrentDriver

void removeCurrentDriver()
Unload the currently loaded driver if any


getDriverNames

String[] getDriverNames()
Get the names of all installed ASIO drivers for user selection


createClass

protected long createClass()
Description copied from class: NativeClass
Create a new native instance and return its address

Specified by:
createClass in class NativeClass
Returns:
The address of the new created native instance

cleanUp

protected void cleanUp()
Description copied from class: NativeClass
Delete the corresponding native instance to this class

Specified by:
cleanUp in class NativeClass