jack.client

Types 18

aliasThreadInitDelegate = void delegate()

High-level object-oriented JACK client.

Uses D delegates for callbacks and provides a more ergonomic API over the raw C bindings.

aliasProcessDelegate = int delegate(NFrames nframes)
aliasShutdownDelegate = void delegate()
aliasInfoShutdownDelegate = void delegate(JackStatus code, string reason)
aliasFreewheelDelegate = void delegate(bool starting)
aliasBufferSizeDelegate = int delegate(NFrames nframes)
aliasSampleRateDelegate = int delegate(NFrames nframes)
aliasClientRegistrationDelegate = void delegate(string name, bool registered)
aliasPortRegistrationDelegate = void delegate(PortId port, bool registered)
aliasPortConnectDelegate = void delegate(PortId a, PortId b, bool connected)
aliasPortRenameDelegate = void delegate(PortId port, string oldName, string newName)
aliasGraphOrderDelegate = int delegate()
aliasXRunDelegate = int delegate()
aliasLatencyDelegate = void delegate(JackLatencyCallbackMode mode)
aliasSyncDelegate = int delegate(JackTransportState state, Position * pos)
aliasTimebaseDelegate = void delegate(JackTransportState state, NFrames nframes, Position * pos, bool newPos)
aliasProcessThreadDelegate = void * delegate()
classClient
Fields
jack_client_t * handle_
ThreadInitDelegate threadInitDg_
ProcessDelegate processDg_
ShutdownDelegate shutdownDg_
InfoShutdownDelegate infoShutdownDg_
FreewheelDelegate freewheelDg_
BufferSizeDelegate bufferSizeDg_
SampleRateDelegate sampleRateDg_
ClientRegistrationDelegate clientRegistrationDg_
PortRegistrationDelegate portRegistrationDg_
PortConnectDelegate portConnectDg_
PortRenameDelegate portRenameDg_
GraphOrderDelegate graphOrderDg_
XRunDelegate xrunDg_
LatencyDelegate latencyDg_
SyncDelegate syncDg_
TimebaseDelegate timebaseDg_
ProcessThreadDelegate processThreadDg_
Methods
int getMaxNameLength() static @nogc nothrowGet maximum JACK client name length. Real-time safe. Returns: Maximum JACK client name length
void open(string clientName, JackOptions options = JackOptions.NullOption, string serverName = null)Open a JACK client. Not real-time safe. Params: clientName = Client name to register with the JACK server options = Option flags (defaults to JackOptions.NullOption) serverName = Name of the server...
void close()Close JACK client. Not real-time safe. Throws: JackException on failure
void activate()Activate JACK client. Not real-time safe. Throws: JackException on failure
void deactivate()Deactivate JACK client. Not real-time safe. Throws: JackException on failure
jack_client_t * handle() @property @nogc nothrowGet C jack_client_t handle. Real-time safe.
bool isOpen() @property const @nogc nothrowIs JACK client connection open? Real-time safe.
string name() @propertyGet client name. Not real-time safe.
bool isRealtime() @property @nogc nothrowIs JACK server running in real-time? Real-time safe.
float cpuLoad() @property @nogc nothrowGet CPU load. Real-time safe.
NFrames sampleRate() @property @nogc nothrowGet sample rate. Real-time safe.
NFrames bufferSize() @property @nogc nothrowGet buffer size. Real-time safe.
bool setBufferSize(NFrames nframes) @nogc nothrowSet buffer size Params: nframes = Buffer size in frames Returns: true on success, false otherwise
void freewheel(bool on) @propertySet freewheel state. Not real-time safe. Params: on = true to enable freewheeling (JACK server processes data as fast as possible, for faster than realtime rendering), false otherwise Throws: JackE...
void syncTimeout(JackTime timeout) @propertySet timeout value for slow-sync clients. Not real-time safe. Params: timeout = The timeout in microseconds Throws: JackException on failure
NativeThread threadId() @property @nogc nothrowGet the thread ID for the running JACK client
NFrames cycleWait() @nogc nothrowWait until the JACK client should process data. Used with the non-callback API. Returns: Number of frames to process
void cycleSignal(int status = 0) @nogc nothrowSignal next clients in the JACK call graph. Used with the non-callback API. Params: status = A status value, if non-zero calling thread should exit (defaults to 0)
Port registerPort(string portName, string portType, JackPortFlags flags, ulong bufferSize = 0)Register a port Params: portName = Name of the port portType = The type of port, such as JACK_DEFAULT_AUDIO_TYPE or JACK_DEFAULT_MIDI_TYPE flags = Port flags bufferSize = Must be non-zero if the po...
Port registerAudioOut(string name)Register an audio output port (convenience method) Params: name = The port name Returns: The new audio output Port Throws: JackException on failure
Port registerAudioIn(string name)Register an audio input port (convenience method) Params: name = The port name Returns: The new audio input Port Throws: JackException on failure
Port registerMidiOut(string name)Register a MIDI output port (convenience method) Params: name = The port name Returns: The new MIDI output Port Throws: JackException on failure
Port registerMidiIn(string name)Register a MIDI input port (convenience method) Params: name = The port name Returns: The new MIDI input Port Throws: JackException on failure
void unregisterPort(Port port)Unregister a port Params: port = The port Throws: JackException on failure
bool portIsMine(Port port) @nogc nothrowCheck if port belongs to this client Params: port = The port Returns: true if the port belongs to this client
void connect(string src, string dst)Connect the named ports Params: src = The source port name dest = The destination port name Throws: JackException on failure
void disconnect(string src, string dst)Disconnect the named ports Params: src = The source port name dest = The destination port name Throws: JackException on failure
void disconnectPort(Port port)Disconnect a port Params: port = The port to disconnect Throws: JackException on failure
string[] getAllConnections(Port port)Get all connections for a port Differs from Port.getConnections() in that this should not be called from a callback and the caller does not need to be the owner of the port. Params: port = The port...
string[] getPorts(string namePattern = null, string typePattern = null, JackPortFlags flags = cast(JackPortFlags) 0)Get ports for this client Params: namePattern = Regular expression for matching ports by name. A null value will match any name (default) typePattern = Regular expression for matching ports by type...
Port portByName(const(char) * name) @nogc nothrowGet a Port by name. Real-time safe. Params: name = The port name (zero terminated string) Returns: The Port which will be a null valued port (isNull()) if not found
Port portByName(string name)Get a Port by name. NOT real-time safe (may allocate). Params: name = The port name Returns: The Port which will be a null valued port (isNull()) if not found
Port portById(PortId id) @nogc nothrowGet a Port by ID. Real-time safe. Params: id = The ID of the port Returns: The Port which will be a null valued port (isNull()) if not found
size_t portTypeBufferSize(const(char) * portType) @nogc nothrowGet the buffer size of a port of a given type. Real-time safe. Should only be called in a buffer size callback. Params: portType = Should be passed a zero terminated C string of port type Returns: ...
size_t portTypeBufferSize(string portType)Get the buffer size of a port of a given type. Not real-time safe (may allocate). Should only be called in a buffer size callback. Params: portType = Port type name Returns: Size of the port buffer...
void requestMonitorByPortName(string portName, bool on)Request to monitor a port by name. NOT real-time safe (may allocate and throw). Params: portName = The port name on = true to enable monitoring, false to disable it Throws: JackException on failure
bool recomputeTotalLatencies() @nogc nothrowRequest latency recompute. Can be called by a client after updating a port latencies. Real-time safe. Returns: true on success, false otherwise
void transportStart() @nogc nothrowStart transport. Real-time safe.
void transportStop() @nogc nothrowStop transport. Real-time safe.
bool transportLocate(NFrames frame) @nogc nothrowReposition the transport to a new frame number. Real-time safe. Params: frame = The frame number of the new position Returns: true on success, false otherwise
JackTransportState transportQuery(Position * pos = null) @nogc nothrowQuery the transport state and position. Real-time safe. Params: pos = Pointer to store position information to or null to retrieve position info Returns: The state of the transport
bool transportReposition(const(Position) * pos) @nogc nothrowRequest transport reposition. Real-time safe. Params: pos = The new position Returns: true on success, false otherwise
NFrames currentTransportFrame() @nogc nothrowGet estimate of transport frame. Returns: Current transport frame
bool releaseTimebase() @nogc nothrowCalled by the timebase master to release itself as master. Real-time safe. Returns: true on success, false otherwise
NFrames framesSinceCycleStart() @nogc nothrowGet the number of estimated frames that have passed since the JACK server started this cycle. Real-time safe. Returns: Estimated frame count
NFrames frameTime() @nogc nothrowGet estimated time in frames. Intended for other threads (not called by process callbacks). Returns: Estimated time in frames
NFrames lastFrameTime() @nogc nothrowGet the last frame time for the current cycle. This is intended to be called from process callbacks. Real-time safe. It will return the same time for a given callback cycle.
JackTime frameToTime(NFrames frames) @nogc nothrowConvert frames to time. Real-time safe. Params: frames = Frame count Returns: Estimated time in microseconds
NFrames timeToFrames(JackTime time) @nogc nothrowConvert time to frames. Real-time safe. Params: time = The time in microseconds Returns: Estimated frame count
void threadInitCallback(ShutdownDelegate dg) @propertySet thread init callback which is called once after the thread is created which will call the other callbacks. Notification callback, does not need to be real-time safe. Throws: JackException on fa...
void processCallback(ProcessDelegate dg) @propertySet process callback. Should be real-time safe. No memory allocation or other system calls should be performed in the delegate callback. Throws: JackException on failure
void shutdownCallback(ShutdownDelegate dg) @propertySet shutdown callback. Notification callback, does not need to be real-time safe.
void infoShutdownCallback(InfoShutdownDelegate dg) @propertySet info shutdown callback. Notification callback, does not need to be real-time safe.
void freewheelCallback(FreewheelDelegate dg) @propertySet freewheel mode changed callback. Notification callback, does not need to be real-time safe. Throws: JackException on failure
void bufferSizeCallback(BufferSizeDelegate dg) @propertySet buffer size changed callback. Notification callback, does not need to be real-time safe. Throws: JackException on failure
void sampleRateCallback(SampleRateDelegate dg) @propertySet sample rate changed callback. Notification callback, does not need to be real-time safe. Throws: JackException on failure
void clientRegistrationCallback(ClientRegistrationDelegate dg) @propertySet client registration callback. Notification callback, does not need to be real-time safe. Throws: JackException on failure
void portRegistrationCallback(PortRegistrationDelegate dg) @propertySet port registration callback. Notification callback, does not need to be real-time safe. Throws: JackException on failure
void portConnectCallback(PortConnectDelegate dg) @propertySet port connect/disconnect callback. Notification callback, does not need to be real-time safe. Throws: JackException on failure
void portRenameCallback(PortRenameDelegate dg) @propertySet port rename callback. Notification callback, does not need to be real-time safe. Throws: JackException on failure
void graphOrderCallback(GraphOrderDelegate dg) @propertySet graph order callback. Notification callback, does not need to be real-time safe. Throws: JackException on failure
void xrunCallback(XRunDelegate dg) @propertySet xrun (overrun/underrun) callback. Notification callback, does not need to be real-time safe. Throws: JackException on failure
void latencyCallback(LatencyDelegate dg) @propertySet latency update callback. Notification callback, does not need to be real-time safe. Throws: JackException on failure
void syncCallback(SyncDelegate dg) @propertySet a slow-sync client callback. Notification callback, does not need to be real-time safe. Throws: JackException on failure
void timebaseCallback(bool conditional, TimebaseDelegate dg) @propertySet a timebase master callback. Notification callback, does not need to be real-time safe. Params: conditional = true for a conditional request (fails if there is already a master) dg = The callbac...
void processThreadCallback(ProcessThreadDelegate dg) @propertySet the non-callback API thread delegate. Used when not using the usual process callback with processCallback(). Used in conjunction with cycleWait() and cycleSignal(). Should be real-time safe. No...
void threadInitTrampoline(void * arg) static
int processTrampoline(jack_nframes_t nframes, void * arg) static
void shutdownTrampoline(void * arg) static
void infoShutdownTrampoline(jack_status_t code, const(char) * reason, void * arg) static
void freewheelTrampoline(int starting, void * arg) static
int bufferSizeTrampoline(jack_nframes_t nframes, void * arg) static
int sampleRateTrampoline(jack_nframes_t nframes, void * arg) static
void clientRegistrationTrampoline(const(char) * name, int register_, void * arg) static
void portRegistrationTrampoline(jack_port_id_t port, int register_, void * arg) static
void portConnectTrampoline(jack_port_id_t a, jack_port_id_t b, int connect, void * arg) static
void portRenameTrampoline(jack_port_id_t port, const(char) * old_name, const(char) * new_name, void * arg) static
int graphOrderTrampoline(void * arg) static
int xrunTrampoline(void * arg) static
void latencyTrampoline(jack_latency_callback_mode_t mode, void * arg) static
int syncTrampoline(jack_transport_state_t state, jack_position_t * pos, void * arg) static
void timebaseTrampoline(jack_transport_state_t state, jack_nframes_t nframes, jack_position_t * pos, int new_pos, void * arg) static
void * processThreadTrampoline(void * arg) static
Constructors
Destructors