com.groovemanager.spi.asio
Class ASIOSampleRate

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

final class ASIOSampleRate
extends NativeClass

This is a wrapper class for the native ASIOSampleRate struct

Author:
Manu Robledo

Constructor Summary
ASIOSampleRate()
          Constructs a new ASIOSampleRate and creates a corresponding native instance
ASIOSampleRate(double value)
          Constructs a new ASIOSampleRate and creates a corresponding native instance with the given value
ASIOSampleRate(long pointer)
          Constructs a new ASIOSampleRate 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
private static void convertBack(ByteBuffer buffer, double value)
          Convert from double to a native representation
private static double convertToDouble(ByteBuffer buffer)
          Convert from an 8 byte DirectByteBuffer to a double value
protected  long createClass()
          Create a new native instance and return its address
(package private)  double doubleValue()
          Get the value of this SampleRate
(package private)  void setValue(double d)
          Set the value of this sample rate
 
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
 

Constructor Detail

ASIOSampleRate

public ASIOSampleRate()
Constructs a new ASIOSampleRate and creates a corresponding native instance


ASIOSampleRate

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

Parameters:
pointer - The native address of the native ASIOSampleRate instance

ASIOSampleRate

public ASIOSampleRate(double value)
Constructs a new ASIOSampleRate and creates a corresponding native instance with the given value

Method Detail

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

doubleValue

double doubleValue()
Get the value of this SampleRate

Returns:
The value of this SampleRate

setValue

void setValue(double d)
Set the value of this sample rate

Parameters:
d - The new value

convertToDouble

private static double convertToDouble(ByteBuffer buffer)
Convert from an 8 byte DirectByteBuffer to a double value

Parameters:
buffer - The DirectByteBuffer created in native code
Returns:
The double value

convertBack

private static void convertBack(ByteBuffer buffer,
                                double value)
Convert from double to a native representation

Parameters:
buffer - The buffer to copy the value to
value - The double value to be converted