public final class SapaProcessor
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
SapaProcessor.AudioDeviceControlListener
This listener interface that provides callback methods for audio source change events.
|
static interface |
SapaProcessor.MessageListener
This listener interface that provides callback methods to receive messages and data from the processing module.
|
static interface |
SapaProcessor.StatusListener
This listener interface that provides callback methods for status change events when the processing module terminates.
|
Constructor and Description |
---|
SapaProcessor(android.content.Context context,
SapaPluginInfo info,
SapaProcessor.StatusListener listener)
Creates a SapaProcessor instance with the specified processing module plug-in.
|
SapaProcessor(android.content.Context context,
SapaPluginInfo info,
SapaProcessor.StatusListener listener,
java.lang.String args)
Creates a SapaProcessor instance with the specified processing module plug-in with the specified message.
|
Modifier and Type | Method and Description |
---|---|
boolean |
activate()
Activate the processing module.
|
boolean |
deactivate()
Deactivate the processing module.
|
SapaPort |
getPort(java.lang.String portName)
get the valid port of the processor
|
java.util.List<SapaPort> |
getPorts()
get all of the processor's port
|
java.nio.ByteBuffer |
queryData(java.lang.String query,
int extra)
Requests data from the processing module.
|
void |
sendCommand(java.lang.String command)
Send the specified command to the processing module.
|
void |
sendStream(java.nio.ByteBuffer stream,
int id)
Send a MIDI to the processing module with ID.
|
void |
setAudioDeviceControlListener(SapaProcessor.AudioDeviceControlListener listener)
Set the specified AudioDeviceControlListener instance to receive audio source change events
|
void |
setByPassEnabled(boolean enable)
enable/disable ByPass of the processing module.
|
void |
setMessageListener(SapaProcessor.MessageListener listener)
Set the specified MessageListener instance to receive messages and data from the processing module.
|
void |
setStatusListener(SapaProcessor.StatusListener listener)
Set the specified StatusListener instance to receive status change events when the processing module terminates.
|
void |
setTransportEnabled(boolean enable)
Enable or disable transport.
|
public SapaProcessor(android.content.Context context, SapaPluginInfo info, SapaProcessor.StatusListener listener)
context
- The Context for your application.info
- The processing module plug-in information object.listener
- The StatusListener instance to receive status change events when the processing module terminates.public SapaProcessor(android.content.Context context, SapaPluginInfo info, SapaProcessor.StatusListener listener, java.lang.String args)
context
- The Context for your application.info
- The processing module plug-in information object.listener
- The StatusListener instance to receive status change events when the processing module terminates.args
- The additional parameters for setting up the custom processing module plug-in.public SapaPort getPort(java.lang.String portName) throws android.util.AndroidRuntimeException
portName
- a port name to getandroid.util.AndroidRuntimeException
- Thrown if an error occurs while getting a portpublic java.util.List<SapaPort> getPorts() throws android.util.AndroidRuntimeException
android.util.AndroidRuntimeException
- Thrown if an error occurs while getting a portpublic void sendCommand(java.lang.String command) throws java.lang.IllegalArgumentException, java.lang.RuntimeException
command
- The command string for the processing module.java.lang.IllegalArgumentException
- Thrown if the command passed is not valid.java.lang.RuntimeException
- Thrown if an error occurs while sending the command.public void sendStream(java.nio.ByteBuffer stream, int id) throws java.lang.IllegalArgumentException, java.lang.RuntimeException
stream
- a stream that you made. ( user can define ) It is only valid between Application and the processing module.id
- an identification numberjava.lang.IllegalArgumentException
- if arguments is not validjava.lang.RuntimeException
- if error while sending a commandpublic boolean activate()
public boolean deactivate()
public void setByPassEnabled(boolean enable)
enable
- Set to true to enable bypass, set to false to disable bypass.public void setTransportEnabled(boolean enable)
enable
- Set to true to enable transport, set to false to disable transport.public java.nio.ByteBuffer queryData(java.lang.String query, int extra) throws java.lang.IllegalArgumentException
query
- The query to be executed.extra
- An extra value for custom processing module plug-ins.java.lang.IllegalArgumentException
- Thrown if the parameters passed are not valid.public final void setMessageListener(SapaProcessor.MessageListener listener)
listener
- The MessageListener interface. to receive messages and data from the processing module.public void setStatusListener(SapaProcessor.StatusListener listener)
listener
- The StatusListener instance to receive status change events when the processing module terminates.public void setAudioDeviceControlListener(SapaProcessor.AudioDeviceControlListener listener)
listener
- The AudioDeviceControlListener instance to receive audio source change events.