net.sf.jack4j
Class AbstractJackClient

java.lang.Object
  extended by net.sf.jack4j.JackClient
      extended by net.sf.jack4j.AbstractJackClient
Direct Known Subclasses:
MidiSeq, MidiSine, WavPlayer, WavRecorder

public class AbstractJackClient
extends JackClient

Convenient implementation of JackClient that correctly defines all callbacks.

Inherited classes still have to call JackClient.setDefaultThreadInitCallback() and other necessary setDefaultXXXCallback methods to ensure that the callbacks are actually called.

Author:
repa

Constructor Summary
AbstractJackClient(java.lang.String clientName, boolean useExactName, boolean canStartServer, java.lang.String serverName)
          Simply calls inherited constructor.
 
Method Summary
 int bufferSizeCallback(int newBufferSize)
          This implementation only returns 0.
 void clientRegistrationCallback(java.lang.String clientName, boolean registered)
          This implementation does nothing.
 void freewheelCallback(boolean onoff)
          This implementation does nothing.
 int graphOrderCallback()
          This implementation only returns 0.
 void portConnectCallback(long portAId, long portBId, boolean connected)
          This implementation does nothing.
 void portRegistrationCallback(long portId, boolean registered)
          This implementation does nothing.
 int process(int bufferSize)
          This implementation only returns 0.
 int sampleRateCallback(int newSampleRate)
          This implementation only returns 0.
 void threadInitCallback()
          This implementation does nothing.
 int xRunCallback()
          This implementation only returns 0.
 
Methods inherited from class net.sf.jack4j.JackClient
activate, addAudioPort, addMidiPort, addPort, close, connect, cpuLoad, deactivate, disconnect, finalize, framesSinceCycleStart, framesToTime, frameTime, getAllPortConnections, getBufferSize, getCallbackStruct, getClientHandle, getClientName, getClientThread, getPorts, getPorts, getSampleRate, getStatistics, getTotalPortLatency, internalClientByName, isActive, isMine, isOpen, isProcessMethodSynchronized, isRealtime, isShutdown, lastFrameTime, loadInternalClient, localPort, localPortNames, portById, portByName, recomputeTotalLatencies, recomputeTotalPortLatency, removePort, requestPortMonitorByName, setAllDefaultCallbacks, setBufferSize, setBufferSizeCallback, setClientRegistrationCallback, setDefaultBufferSizeCallback, setDefaultClientRegistrationCallback, setDefaultFreewheelCallback, setDefaultGraphOrderCallback, setDefaultPortConnectCallback, setDefaultPortRegistrationCallback, setDefaultProcessCallback, setDefaultSampleRateCallback, setDefaultShutdownCallback, setDefaultThreadInitCallback, setDefaultXRunCallback, setFreewheel, setFreewheelCallback, setGraphOrderCallback, setPortConnectCallback, setPortRegistrationCallback, setProcessCallback, setProcessMethodSynchronized, setSampleRateCallback, setShutdownCallback, setThreadInitCallback, setXRunCallback, threadWait, time, timeToFrames
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractJackClient

public AbstractJackClient(java.lang.String clientName,
                          boolean useExactName,
                          boolean canStartServer,
                          java.lang.String serverName)
                   throws JackException
Simply calls inherited constructor.

Throws:
JackException
Method Detail

bufferSizeCallback

public int bufferSizeCallback(int newBufferSize)
                       throws java.lang.Exception
This implementation only returns 0.

Specified by:
bufferSizeCallback in class JackClient
Throws:
java.lang.Exception
See Also:
JackClient.bufferSizeCallback(int)

clientRegistrationCallback

public void clientRegistrationCallback(java.lang.String clientName,
                                       boolean registered)
                                throws java.lang.Exception
This implementation does nothing.

Specified by:
clientRegistrationCallback in class JackClient
Parameters:
clientName - name of the other client
registered - true if the client is registered, false if it's unregistered
Throws:
java.lang.Exception
See Also:
JackClient.clientRegistrationCallback(java.lang.String, boolean)

freewheelCallback

public void freewheelCallback(boolean onoff)
                       throws java.lang.Exception
This implementation does nothing.

Specified by:
freewheelCallback in class JackClient
Throws:
java.lang.Exception
See Also:
JackClient.freewheelCallback(boolean)

graphOrderCallback

public int graphOrderCallback()
                       throws java.lang.Exception
This implementation only returns 0.

Specified by:
graphOrderCallback in class JackClient
Throws:
java.lang.Exception
See Also:
JackClient.graphOrderCallback()

portConnectCallback

public void portConnectCallback(long portAId,
                                long portBId,
                                boolean connected)
                         throws java.lang.Exception
This implementation does nothing.

Specified by:
portConnectCallback in class JackClient
Parameters:
portAId - unique ID of one of two ports connected or disconnected
portBId - unique ID of one of two ports connected or disconnected
connected - true if the connection is established, false if it's removed
Throws:
java.lang.Exception
See Also:
JackClient.portConnectCallback(long, long, boolean)

portRegistrationCallback

public void portRegistrationCallback(long portId,
                                     boolean registered)
                              throws java.lang.Exception
This implementation does nothing.

Specified by:
portRegistrationCallback in class JackClient
Parameters:
portId - unique port ID (see JackClient.portById(long))
registered - true if the port is registered, false if it's unregistered
Throws:
java.lang.Exception
See Also:
JackClient.portRegistrationCallback(long, boolean)

process

public int process(int bufferSize)
            throws java.lang.Exception
This implementation only returns 0.

Specified by:
process in class JackClient
Throws:
java.lang.Exception
See Also:
JackClient.process(int)

sampleRateCallback

public int sampleRateCallback(int newSampleRate)
                       throws java.lang.Exception
This implementation only returns 0.

Specified by:
sampleRateCallback in class JackClient
Throws:
java.lang.Exception
See Also:
JackClient.sampleRateCallback(int)

threadInitCallback

public void threadInitCallback()
                        throws java.lang.Exception
This implementation does nothing.

Specified by:
threadInitCallback in class JackClient
Throws:
java.lang.Exception
See Also:
JackClient.threadInitCallback()

xRunCallback

public int xRunCallback()
                 throws java.lang.Exception
This implementation only returns 0.

Specified by:
xRunCallback in class JackClient
Throws:
java.lang.Exception
See Also:
JackClient.xRunCallback()


Copyright © 2008 Ondrej Par. All Rights Reserved.