control.h   control.h 
skipping to change at line 136 skipping to change at line 136
/** /**
* Call this function to destroy server object. * Call this function to destroy server object.
* *
* @param server server object handle to destroy * @param server server object handle to destroy
*/ */
void void
jackctl_server_destroy( jackctl_server_destroy(
jackctl_server_t * server); jackctl_server_t * server);
/** /**
* Call this function to start JACK server * Call this function to open JACK server
* *
* @param server server object handle * @param server server object handle
* @param driver driver to use * @param driver driver to use
* *
* @return success status: true - success, false - fail * @return success status: true - success, false - fail
*/ */
bool bool
jackctl_server_start( jackctl_server_open(
jackctl_server_t * server, jackctl_server_t * server,
jackctl_driver_t * driver); jackctl_driver_t * driver);
/** /**
* Call this function to start JACK server
*
* @param server server object handle
*
* @return success status: true - success, false - fail
*/
bool
jackctl_server_start(
jackctl_server_t * server);
/**
* Call this function to stop JACK server * Call this function to stop JACK server
* *
* @param server server object handle * @param server server object handle
* *
* @return success status: true - success, false - fail * @return success status: true - success, false - fail
*/ */
bool bool
jackctl_server_stop( jackctl_server_stop(
jackctl_server_t * server); jackctl_server_t * server);
/** /**
* Call this function to close JACK server
*
* @param server server object handle
*
* @return success status: true - success, false - fail
*/
bool
jackctl_server_close(
jackctl_server_t * server);
/**
* Call this function to get list of available drivers. List node data * Call this function to get list of available drivers. List node data
* pointers is a driver object handle (::jackctl_driver_t). * pointers is a driver object handle (::jackctl_driver_t).
* *
* @param server server object handle to get drivers for * @param server server object handle to get drivers for
* *
* @return Single linked list of driver object handles. Must not be * @return Single linked list of driver object handles. Must not be
* modified. Always same for same server object. * modified. Always same for same server object.
*/ */
const JSList * const JSList *
jackctl_server_get_drivers_list( jackctl_server_get_drivers_list(
skipping to change at line 200 skipping to change at line 222
* *
* @return Single linked list of internal client object handles. Must not b e * @return Single linked list of internal client object handles. Must not b e
* modified. Always same for same server object. * modified. Always same for same server object.
*/ */
const JSList * const JSList *
jackctl_server_get_internals_list( jackctl_server_get_internals_list(
jackctl_server_t * server); jackctl_server_t * server);
/** /**
* Call this function to load one internal client. * Call this function to load one internal client.
* (can be used when the server is running)
* *
* @param server server object handle * @param server server object handle
* @param internal internal to use * @param internal internal to use
* *
* @return success status: true - success, false - fail * @return success status: true - success, false - fail
*/ */
bool bool
jackctl_server_load_internal( jackctl_server_load_internal(
jackctl_server_t * server, jackctl_server_t * server,
jackctl_internal_t * internal); jackctl_internal_t * internal);
/** /**
* Call this function to unload one internal client. * Call this function to unload one internal client.
* (can be used when the server is running)
* *
* @param server server object handle * @param server server object handle
* @param internal internal to unload * @param internal internal to unload
* *
* @return success status: true - success, false - fail * @return success status: true - success, false - fail
*/ */
bool bool
jackctl_server_unload_internal( jackctl_server_unload_internal(
jackctl_server_t * server, jackctl_server_t * server,
jackctl_internal_t * internal); jackctl_internal_t * internal);
/** /**
* Call this function to add a slave in the driver slave list. * Call this function to add a slave in the driver slave list.
* (cannot be used when the server is running that is between
* jackctl_server_start and jackctl_server_stop)
* *
* @param server server object handle * @param server server object handle
* @param driver driver to add in the driver slave list. * @param driver driver to add in the driver slave list.
* *
* @return success status: true - success, false - fail * @return success status: true - success, false - fail
*/ */
bool bool
jackctl_server_add_slave(jackctl_server_t * server, jackctl_server_add_slave(jackctl_server_t * server,
jackctl_driver_t * driver); jackctl_driver_t * driver);
/** /**
* Call this function to remove a slave from the driver slave list. * Call this function to remove a slave from the driver slave list.
* (cannot be used when the server is running that is between
* jackctl_server_start and jackctl_server_stop)
* *
* @param server server object handle * @param server server object handle
* @param driver driver to remove from the driver slave list. * @param driver driver to remove from the driver slave list.
* *
* @return success status: true - success, false - fail * @return success status: true - success, false - fail
*/ */
bool bool
jackctl_server_remove_slave(jackctl_server_t * server, jackctl_server_remove_slave(jackctl_server_t * server,
jackctl_driver_t * driver); jackctl_driver_t * driver);
 End of changes. 8 change blocks. 
2 lines changed or deleted 30 lines changed or added


 jack.h   jack.h 
skipping to change at line 203 skipping to change at line 203
/** /**
* @return pid of client. If not available, 0 will be returned. * @return pid of client. If not available, 0 will be returned.
*/ */
int jack_get_client_pid (const char *name) JACK_OPTIONAL_WEAK_EXPORT; int jack_get_client_pid (const char *name) JACK_OPTIONAL_WEAK_EXPORT;
/** /**
* @return the pthread ID of the thread running the JACK client side * @return the pthread ID of the thread running the JACK client side
* code. * code.
*/ */
pthread_t jack_client_thread_id (jack_client_t *) JACK_OPTIONAL_WEAK_EXPORT ; jack_native_thread_t jack_client_thread_id (jack_client_t *) JACK_OPTIONAL_ WEAK_EXPORT;
/*@}*/ /*@}*/
/** /**
* @param client pointer to JACK client structure. * @param client pointer to JACK client structure.
* *
* Check if the JACK subsystem is running with -R (--realtime). * Check if the JACK subsystem is running with -R (--realtime).
* *
* @return 1 if JACK is running realtime, 0 otherwise * @return 1 if JACK is running realtime, 0 otherwise
*/ */
skipping to change at line 526 skipping to change at line 526
* (after jack_activate has been called.) * (after jack_activate has been called.)
* *
* @return 0 on success, otherwise a non-zero error code * @return 0 on success, otherwise a non-zero error code
*/ */
int jack_set_xrun_callback (jack_client_t *, int jack_set_xrun_callback (jack_client_t *,
JackXRunCallback xrun_callback, void *arg) JACK _OPTIONAL_WEAK_EXPORT; JackXRunCallback xrun_callback, void *arg) JACK _OPTIONAL_WEAK_EXPORT;
/*@}*/ /*@}*/
/** /**
* Tell the Jack server to call @a latency_callback whenever it
* is necessary to recompute the latencies for some or all
* Jack ports.
*
* @a latency_callback will be called twice each time it is
* needed, once being passed JackCaptureLatency and once
* JackPlaybackLatency. See @ref LatencyFunctions for
* the definition of each type of latency and related functions.
*
* <b>IMPORTANT: Most JACK clients do NOT need to register a latency
* callback.</b>
*
* Clients that meet any of the following conditions do NOT
* need to register a latency callback:
*
* - have only input ports
* - have only output ports
* - their output is totally unrelated to their input
* - their output is not delayed relative to their input
* (i.e. data that arrives in a given process()
* callback is processed and output again in the
* same callback)
*
* Clients NOT registering a latency callback MUST also
* satisfy this condition:
*
* - have no multiple distinct internal signal pathways
*
* This means that if your client has more than 1 input and
* output port, and considers them always "correlated"
* (e.g. as a stereo pair), then there is only 1 (e.g. stereo)
* signal pathway through the client. This would be true,
* for example, of a stereo FX rack client that has a
* left/right input pair and a left/right output pair.
*
* However, this is somewhat a matter of perspective. The
* same FX rack client could be connected so that its
* two input ports were connected to entirely separate
* sources. Under these conditions, the fact that the client
* does not register a latency callback MAY result
* in port latency values being incorrect.
*
* Clients that do not meet any of those conditions SHOULD
* register a latency callback.
*
* See the documentation for @ref jack_port_set_latency_range()
* on how the callback should operate. Remember that the @a mode
* argument given to the latency callback will need to be
* passed into @ref jack_port_set_latency_range()
*
* @return 0 on success, otherwise a non-zero error code
*/
int jack_set_latency_callback (jack_client_t *,
JackLatencyCallback latency_callback,
void *) JACK_WEAK_EXPORT;
/*@}*/
/**
* @defgroup ServerClientControl Controlling & querying JACK server operati on * @defgroup ServerClientControl Controlling & querying JACK server operati on
* @{ * @{
*/ */
/** /**
* Start/Stop JACK's "freewheel" mode. * Start/Stop JACK's "freewheel" mode.
* *
* When in "freewheel" mode, JACK no longer waits for * When in "freewheel" mode, JACK no longer waits for
* any external event to begin the start of the next process * any external event to begin the start of the next process
* cycle. * cycle.
skipping to change at line 628 skipping to change at line 686
* Create a new port for the client. This is an object used for moving * Create a new port for the client. This is an object used for moving
* data of any type in or out of the client. Ports may be connected * data of any type in or out of the client. Ports may be connected
* in various ways. * in various ways.
* *
* Each port has a short name. The port's full name contains the name * Each port has a short name. The port's full name contains the name
* of the client concatenated with a colon (:) followed by its short * of the client concatenated with a colon (:) followed by its short
* name. The jack_port_name_size() is the maximum length of this full * name. The jack_port_name_size() is the maximum length of this full
* name. Exceeding that will cause the port registration to fail and * name. Exceeding that will cause the port registration to fail and
* return NULL. * return NULL.
* *
* The @a port_name must be unique among all ports owned by this client.
* If the name is not unique, the registration will fail.
*
* All ports have a type, which may be any non-NULL and non-zero * All ports have a type, which may be any non-NULL and non-zero
* length string, passed as an argument. Some port types are built * length string, passed as an argument. Some port types are built
* into the JACK API, currently only JACK_DEFAULT_AUDIO_TYPE. * into the JACK API, currently only JACK_DEFAULT_AUDIO_TYPE.
* *
* @param client pointer to JACK client structure. * @param client pointer to JACK client structure.
* @param port_name non-empty short name for the new port (not * @param port_name non-empty short name for the new port (not
* including the leading @a "client_name:"). * including the leading @a "client_name:"). Must be unique.
* @param port_type port type name. If longer than * @param port_type port type name. If longer than
* jack_port_type_size(), only that many characters are significant. * jack_port_type_size(), only that many characters are significant.
* @param flags @ref JackPortFlags bit mask. * @param flags @ref JackPortFlags bit mask.
* @param buffer_size must be non-zero if this is not a built-in @a * @param buffer_size must be non-zero if this is not a built-in @a
* port_type. Otherwise, it is ignored. * port_type. Otherwise, it is ignored.
* *
* @return jack_port_t pointer on success, otherwise NULL. * @return jack_port_t pointer on success, otherwise NULL.
*/ */
jack_port_t * jack_port_register (jack_client_t *client, jack_port_t * jack_port_register (jack_client_t *client,
const char *port_name, const char *port_name,
skipping to change at line 784 skipping to change at line 845
/** /**
* *
* @deprecated This function will be removed from a future version * @deprecated This function will be removed from a future version
* of JACK. Do not use it. There is no replacement. It has * of JACK. Do not use it. There is no replacement. It has
* turned out to serve essentially no purpose in real-life * turned out to serve essentially no purpose in real-life
* JACK clients. * JACK clients.
*/ */
int jack_port_untie (jack_port_t *port) JACK_OPTIONAL_WEAK_DEPRECATED_EXPOR T; int jack_port_untie (jack_port_t *port) JACK_OPTIONAL_WEAK_DEPRECATED_EXPOR T;
/**
* @return the time (in frames) between data being available or
* delivered at/to a port, and the time at which it arrived at or is
* delivered to the "other side" of the port. E.g. for a physical
* audio output port, this is the time between writing to the port and
* when the signal will leave the connector. For a physical audio
* input port, this is the time between the sound arriving at the
* connector and the corresponding frames being readable from the
* port.
*/
jack_nframes_t jack_port_get_latency (jack_port_t *port) JACK_OPTIONAL_WEAK
_EXPORT;
/**
* The maximum of the sum of the latencies in every
* connection path that can be drawn between the port and other
* ports with the @ref JackPortIsTerminal flag set.
*/
jack_nframes_t jack_port_get_total_latency (jack_client_t *,
jack_port_t *port) JACK_OPTIONA
L_WEAK_EXPORT;
/**
* The port latency is zero by default. Clients that control
* physical hardware with non-zero latency should call this
* to set the latency to its correct value. Note that the value
* should include any systemic latency present "outside" the
* physical hardware controlled by the client. For example,
* for a client controlling a digital audio interface connected
* to an external digital converter, the latency setting should
* include both buffering by the audio interface *and* the converter.
*/
void jack_port_set_latency (jack_port_t *, jack_nframes_t) JACK_OPTIONAL_WE
AK_EXPORT;
/**
* Request a complete recomputation of a port's total latency. This
* can be called by a client that has just changed the internal
* latency of its port using @function jack_port_set_latency
* and wants to ensure that all signal pathways in the graph
* are updated with respect to the values that will be returned
* by @function jack_port_get_total_latency.
*
* @return zero for successful execution of the request. non-zero
* otherwise.
*/
int jack_recompute_total_latency (jack_client_t*, jack_port_t* port) JACK_O
PTIONAL_WEAK_EXPORT;
/**
* Request a complete recomputation of all port latencies. This
* can be called by a client that has just changed the internal
* latency of its port using @function jack_port_set_latency
* and wants to ensure that all signal pathways in the graph
* are updated with respect to the values that will be returned
* by @function jack_port_get_total_latency. It allows a client
* to change multiple port latencies without triggering a
* recompute for each change.
*
* @return zero for successful execution of the request. non-zero
* otherwise.
*/
int jack_recompute_total_latencies (jack_client_t*) JACK_OPTIONAL_WEAK_
EXPORT;
/** /**
* Modify a port's short name. May be called at any time. If the * Modify a port's short name. May be called at any time. If the
* resulting full name (including the @a "client_name:" prefix) is * resulting full name (including the @a "client_name:" prefix) is
* longer than jack_port_name_size(), it will be truncated. * longer than jack_port_name_size(), it will be truncated.
* *
* @return 0 on success, otherwise a non-zero error code. * @return 0 on success, otherwise a non-zero error code.
*/ */
int jack_port_set_name (jack_port_t *port, const char *port_name) JACK_OPTI ONAL_WEAK_EXPORT; int jack_port_set_name (jack_port_t *port, const char *port_name) JACK_OPTI ONAL_WEAK_EXPORT;
/** /**
skipping to change at line 981 skipping to change at line 982
* character. * character.
*/ */
int jack_port_name_size(void) JACK_OPTIONAL_WEAK_EXPORT; int jack_port_name_size(void) JACK_OPTIONAL_WEAK_EXPORT;
/** /**
* @return the maximum number of characters in a JACK port type name * @return the maximum number of characters in a JACK port type name
* including the final NULL character. This value is a constant. * including the final NULL character. This value is a constant.
*/ */
int jack_port_type_size(void) JACK_OPTIONAL_WEAK_EXPORT; int jack_port_type_size(void) JACK_OPTIONAL_WEAK_EXPORT;
/**
* @return the buffersize of a port of type @arg port_type.
*
* this function may only be called in a buffer_size callback.
*/
size_t jack_port_type_get_buffer_size (jack_client_t *client, const char *p
ort_type) JACK_WEAK_EXPORT;
/*@}*/
/**
* @defgroup LatencyFunctions Managing and determining latency
*
* The purpose of JACK's latency API is to allow clients to
* easily answer two questions:
*
* - How long has it been since the data read from a port arrived
* at the edge of the JACK graph (either via a physical port
* or being synthesized from scratch)?
*
* - How long will it be before the data written to a port arrives
* at the edge of a JACK graph?
* To help answering these two questions, all JACK ports have two
* latency values associated with them, both measured in frames:
*
* <b>capture latency</b>: how long since the data read from
* the buffer of a port arrived at at
* a port marked with JackPortIsTerminal.
* The data will have come from the "outside
* world" if the terminal port is also
* marked with JackPortIsPhysical, or
* will have been synthesized by the client
* that owns the terminal port.
*
* <b>playback latency</b>: how long until the data
* written to the buffer of port will reach a port
* marked with JackPortIsTerminal.
*
* Both latencies might potentially have more than one value
* because there may be multiple pathways to/from a given port
* and a terminal port. Latency is therefore generally
* expressed a min/max pair.
*
* In most common setups, the minimum and maximum latency
* are the same, but this design accomodates more complex
* routing, and allows applications (and thus users) to
* detect cases where routing is creating an anomalous
* situation that may either need fixing or more
* sophisticated handling by clients that care about
* latency.
*
* See also @ref jack_set_latency_callback for details on how
* clients that add latency to the signal path should interact
* with JACK to ensure that the correct latency figures are
* used.
* @{
*/
/**
* The port latency is zero by default. Clients that control
* physical hardware with non-zero latency should call this
* to set the latency to its correct value. Note that the value
* should include any systemic latency present "outside" the
* physical hardware controlled by the client. For example,
* for a client controlling a digital audio interface connected
* to an external digital converter, the latency setting should
* include both buffering by the audio interface *and* the converter.
*
* @deprecated This method will be removed in the next major
* release of JACK. It should not be used in new code, and should
* be replaced by a latency callback that calls @ref
* jack_port_set_latency_range().
*/
void jack_port_set_latency (jack_port_t *, jack_nframes_t) JACK_OPTIONAL_WE
AK_DEPRECATED_EXPORT;
/**
* return the latency range defined by @a mode for
* @a port, in frames.
*
* See @ref LatencyFunctions for the definition of each latency value.
*
* This is normally used in the LatencyCallback.
* and therefor safe to execute from callbacks.
*/
void jack_port_get_latency_range (jack_port_t *port, jack_latency_callback_
mode_t mode, jack_latency_range_t *range) JACK_WEAK_EXPORT;
/**
* set the minimum and maximum latencies defined by
* @a mode for @a port, in frames.
*
* See @ref LatencyFunctions for the definition of each latency value.
*
* This function should ONLY be used inside a latency
* callback. The client should determine the current
* value of the latency using @ref jack_port_get_latency_range()
* (called using the same mode as @a mode)
* and then add some number of frames to that reflects
* latency added by the client.
*
* How much latency a client adds will vary
* dramatically. For most clients, the answer is zero
* and there is no reason for them to register a latency
* callback and thus they should never call this
* function.
*
* More complex clients that take an input signal,
* transform it in some way and output the result but
* not during the same process() callback will
* generally know a single constant value to add
* to the value returned by @ref jack_port_get_latency_range().
*
* Such clients would register a latency callback (see
* @ref jack_set_latency_callback) and must know what input
* ports feed which output ports as part of their
* internal state. Their latency callback will update
* the ports' latency values appropriately.
*
* A pseudo-code example will help. The @a mode argument to the latency
* callback will determine whether playback or capture
* latency is being set. The callback will use
* @ref jack_port_set_latency_range() as follows:
*
* \code
* jack_latency_range_t range;
* if (mode == JackPlaybackLatency) {
* foreach input_port in (all self-registered port) {
* jack_port_get_latency_range (port_feeding_input_port, JackPlaybackLate
ncy, &range);
* range.min += min_delay_added_as_signal_flows_from port_feeding to inpu
t_port;
* range.max += max_delay_added_as_signal_flows_from port_feeding to inpu
t_port;
* jack_port_set_latency_range (input_port, JackPlaybackLatency, &range);
* }
* } else if (mode == JackCaptureLatency) {
* foreach output_port in (all self-registered port) {
* jack_port_get_latency_range (port_fed_by_output_port, JackCaptureLaten
cy, &range);
* range.min += min_delay_added_as_signal_flows_from_output_port_to_fed_b
y_port;
* range.max += max_delay_added_as_signal_flows_from_output_port_to_fed_b
y_port;
* jack_port_set_latency_range (output_port, JackCaptureLatency, &range);
* }
* }
* \endcode
*
* In this relatively simple pseudo-code example, it is assumed that
* each input port or output is connected to only 1 output or input
* port respectively.
*
* If a port is connected to more than 1 other port, then the
* range.min and range.max values passed to @ref
* jack_port_set_latency_range() should reflect the minimum and
* maximum values across all connected ports.
*
* See the description of @ref jack_set_latency_callback for more
* information.
*/
void jack_port_set_latency_range (jack_port_t *port, jack_latency_callback_
mode_t mode, jack_latency_range_t *range) JACK_WEAK_EXPORT;
/**
* Request a complete recomputation of all port latencies. This
* can be called by a client that has just changed the internal
* latency of its port using jack_port_set_latency
* and wants to ensure that all signal pathways in the graph
* are updated with respect to the values that will be returned
* by jack_port_get_total_latency. It allows a client
* to change multiple port latencies without triggering a
* recompute for each change.
*
* @return zero for successful execution of the request. non-zero
* otherwise.
*/
int jack_recompute_total_latencies (jack_client_t*) JACK_OPTIONAL_WEAK_EXPO
RT;
/**
* @return the time (in frames) between data being available or
* delivered at/to a port, and the time at which it arrived at or is
* delivered to the "other side" of the port. E.g. for a physical
* audio output port, this is the time between writing to the port and
* when the signal will leave the connector. For a physical audio
* input port, this is the time between the sound arriving at the
* connector and the corresponding frames being readable from the
* port.
*
* @deprecated This method will be removed in the next major
* release of JACK. It should not be used in new code, and should
* be replaced by jack_port_get_latency_range() in any existing
* use cases.
*/
jack_nframes_t jack_port_get_latency (jack_port_t *port) JACK_OPTIONAL_WEAK
_DEPRECATED_EXPORT;
/**
* The maximum of the sum of the latencies in every
* connection path that can be drawn between the port and other
* ports with the @ref JackPortIsTerminal flag set.
*
* @deprecated This method will be removed in the next major
* release of JACK. It should not be used in new code, and should
* be replaced by jack_port_get_latency_range() in any existing
* use cases.
*/
jack_nframes_t jack_port_get_total_latency (jack_client_t *,
jack_port_t *port) JACK_OPTIONAL
_WEAK_DEPRECATED_EXPORT;
/**
* Request a complete recomputation of a port's total latency. This
* can be called by a client that has just changed the internal
* latency of its port using jack_port_set_latency
* and wants to ensure that all signal pathways in the graph
* are updated with respect to the values that will be returned
* by jack_port_get_total_latency.
*
* @return zero for successful execution of the request. non-zero
* otherwise.
*
* @deprecated This method will be removed in the next major
* release of JACK. It should not be used in new code, and should
* be replaced by jack_recompute_total_latencies() in any existing
* use cases.
*/
int jack_recompute_total_latency (jack_client_t*, jack_port_t* port) JACK_O
PTIONAL_WEAK_DEPRECATED_EXPORT;
/*@}*/ /*@}*/
/** /**
* @defgroup PortSearching Looking up ports * @defgroup PortSearching Looking up ports
* @{ * @{
*/ */
/** /**
* @param port_name_pattern A regular expression used to select * @param port_name_pattern A regular expression used to select
* ports by name. If NULL or of zero length, no selection based * ports by name. If NULL or of zero length, no selection based
 End of changes. 6 change blocks. 
67 lines changed or deleted 295 lines changed or added


 midiport.h   midiport.h 
skipping to change at line 27 skipping to change at line 27
*/ */
#ifndef __JACK_MIDIPORT_H #ifndef __JACK_MIDIPORT_H
#define __JACK_MIDIPORT_H #define __JACK_MIDIPORT_H
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#include <jack/weakmacros.h>
#include <jack/types.h> #include <jack/types.h>
#include <stdlib.h> #include <stdlib.h>
#include <jack/weakmacros.h>
/** Type for raw event data contained in @ref jack_midi_event_t. */ /** Type for raw event data contained in @ref jack_midi_event_t. */
typedef unsigned char jack_midi_data_t; typedef unsigned char jack_midi_data_t;
/** A Jack MIDI event. */ /** A Jack MIDI event. */
typedef struct _jack_midi_event typedef struct _jack_midi_event
{ {
jack_nframes_t time; /**< Sample index at which event is valid */ jack_nframes_t time; /**< Sample index at which event is valid */
size_t size; /**< Number of bytes of data in \a buffer */ size_t size; /**< Number of bytes of data in \a buffer */
jack_midi_data_t *buffer; /**< Raw MIDI data */ jack_midi_data_t *buffer; /**< Raw MIDI data */
skipping to change at line 101 skipping to change at line 101
/** Allocate space for an event to be written to an event port buffer. /** Allocate space for an event to be written to an event port buffer.
* *
* Clients are to write the actual event data to be written starting at the * Clients are to write the actual event data to be written starting at the
* pointer returned by this function. Clients must not write more than * pointer returned by this function. Clients must not write more than
* @a data_size bytes into this buffer. Clients must write normalised * @a data_size bytes into this buffer. Clients must write normalised
* MIDI data to the port - no running status and no (1-byte) realtime * MIDI data to the port - no running status and no (1-byte) realtime
* messages interspersed with other messages (realtime messages are fine * messages interspersed with other messages (realtime messages are fine
* when they occur on their own, like other messages). * when they occur on their own, like other messages).
* *
* Events must be written in order, sorted by their sample offsets.
* JACK will not sort the events for you, and will refuse to store
* out-of-order events.
*
* @param port_buffer Buffer to write event to. * @param port_buffer Buffer to write event to.
* @param time Sample offset of event. * @param time Sample offset of event.
* @param data_size Length of event's raw data in bytes. * @param data_size Length of event's raw data in bytes.
* @return Pointer to the beginning of the reserved event's data buffer, or * @return Pointer to the beginning of the reserved event's data buffer, or
* NULL on error (ie not enough space). * NULL on error (ie not enough space).
*/ */
jack_midi_data_t* jack_midi_data_t*
jack_midi_event_reserve(void *port_buffer, jack_midi_event_reserve(void *port_buffer,
jack_nframes_t time, jack_nframes_t time,
size_t data_size) JACK_OPTIONAL_WEAK_EXPORT; size_t data_size) JACK_OPTIONAL_WEAK_EXPORT;
/** Write an event into an event port buffer. /** Write an event into an event port buffer.
* *
* This function is simply a wrapper for @ref jack_midi_event_reserve * This function is simply a wrapper for @ref jack_midi_event_reserve
* which writes the event data into the space reserved in the buffer. * which writes the event data into the space reserved in the buffer.
* The same restrictions on the MIDI data apply. *
* Clients must not write more than
* @a data_size bytes into this buffer. Clients must write normalised
* MIDI data to the port - no running status and no (1-byte) realtime
* messages interspersed with other messages (realtime messages are fine
* when they occur on their own, like other messages).
*
* Events must be written in order, sorted by their sample offsets.
* JACK will not sort the events for you, and will refuse to store
* out-of-order events.
* *
* @param port_buffer Buffer to write event to. * @param port_buffer Buffer to write event to.
* @param time Sample offset of event. * @param time Sample offset of event.
* @param data Message data to be written. * @param data Message data to be written.
* @param data_size Length of @a data in bytes. * @param data_size Length of @a data in bytes.
* @return 0 on success, ENOBUFS if there's not enough space in buffer for event. * @return 0 on success, ENOBUFS if there's not enough space in buffer for event.
*/ */
int int
jack_midi_event_write(void *port_buffer, jack_midi_event_write(void *port_buffer,
jack_nframes_t time, jack_nframes_t time,
 End of changes. 4 change blocks. 
2 lines changed or deleted 15 lines changed or added


 systemdeps.h   systemdeps.h 
skipping to change at line 39 skipping to change at line 39
#ifndef int8_t #ifndef int8_t
typedef char int8_t; typedef char int8_t;
typedef unsigned char uint8_t; typedef unsigned char uint8_t;
typedef short int16_t; typedef short int16_t;
typedef unsigned short uint16_t; typedef unsigned short uint16_t;
typedef long int32_t; typedef long int32_t;
typedef unsigned long uint32_t; typedef unsigned long uint32_t;
typedef LONGLONG int64_t; typedef LONGLONG int64_t;
typedef ULONGLONG uint64_t; typedef ULONGLONG uint64_t;
#endif #endif
#ifndef pthread_t /**
typedef HANDLE pthread_t; * to make jack API independent of different thread implementations,
#endif * we define jack_native_thread_t to HANDLE here.
*/
typedef HANDLE jack_native_thread_t;
#elif __MINGW32__ /* MINGW */ #elif __MINGW32__ /* MINGW */
#include <stdint.h> #include <stdint.h>
#include <sys/types.h> #include <sys/types.h>
#ifndef pthread_t /**
typedef HANDLE pthread_t; * to make jack API independent of different thread implementations,
#endif * we define jack_native_thread_t to HANDLE here.
*/
typedef HANDLE jack_native_thread_t;
#else /* other compilers ...*/ #else /* other compilers ...*/
#include <inttypes.h> #include <inttypes.h>
#include <pthread.h> #include <pthread.h>
#include <sys/types.h> #include <sys/types.h>
#endif #endif
#endif /* WIN32 */ #endif /* WIN32 */
#if defined(__APPLE__) || defined(__linux__) || defined(__sun__) || defined (sun) || defined(__unix__) #if defined(__APPLE__) || defined(__linux__) || defined(__sun__) || defined (sun) || defined(__unix__)
#include <inttypes.h> #include <inttypes.h>
#include <pthread.h> #include <pthread.h>
#include <sys/types.h> #include <sys/types.h>
/**
* to make jack API independent of different thread implementations,
* we define jack_native_thread_t to pthread_t here.
*/
typedef pthread_t jack_native_thread_t;
#endif /* __APPLE__ || __linux__ || __sun__ || sun */ #endif /* __APPLE__ || __linux__ || __sun__ || sun */
#endif #endif
 End of changes. 3 change blocks. 
6 lines changed or deleted 17 lines changed or added


 thread.h   thread.h 
skipping to change at line 31 skipping to change at line 31
#define __jack_thread_h__ #define __jack_thread_h__
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C"
{ {
#endif #endif
#include <jack/systemdeps.h> #include <jack/systemdeps.h>
#include <jack/weakmacros.h> #include <jack/weakmacros.h>
/* use 512KB stack per thread - the default is way too high to be feasible
* with mlockall() on many systems */
#define THREAD_STACK 524288
/** @file thread.h /** @file thread.h
* *
* Library functions to standardize thread creation for JACK and its * Library functions to standardize thread creation for JACK and its
* clients. These interfaces hide some system variations in the * clients. These interfaces hide some system variations in the
* handling of realtime scheduling and associated privileges. * handling of realtime scheduling and associated privileges.
*/ */
/** /**
* @defgroup ClientThreads Creating and managing client threads * @defgroup ClientThreads Creating and managing client threads
* @{ * @{
skipping to change at line 69 skipping to change at line 73
/** /**
* Attempt to enable realtime scheduling for a thread. On some * Attempt to enable realtime scheduling for a thread. On some
* systems that may require special privileges. * systems that may require special privileges.
* *
* @param thread POSIX thread ID. * @param thread POSIX thread ID.
* @param priority requested thread priority. * @param priority requested thread priority.
* *
* @returns 0, if successful; EPERM, if the calling process lacks * @returns 0, if successful; EPERM, if the calling process lacks
* required realtime privileges; otherwise some other error number. * required realtime privileges; otherwise some other error number.
*/ */
int jack_acquire_real_time_scheduling (pthread_t thread, int priority) JACK _OPTIONAL_WEAK_EXPORT; int jack_acquire_real_time_scheduling (jack_native_thread_t thread, int pri ority) JACK_OPTIONAL_WEAK_EXPORT;
/** /**
* Create a thread for JACK or one of its clients. The thread is * Create a thread for JACK or one of its clients. The thread is
* created executing @a start_routine with @a arg as its sole * created executing @a start_routine with @a arg as its sole
* argument. * argument.
* *
* @param client the JACK client for whom the thread is being created. May be * @param client the JACK client for whom the thread is being created. May be
* NULL if the client is being created within the JACK server. * NULL if the client is being created within the JACK server.
* @param thread place to return POSIX thread ID. * @param thread place to return POSIX thread ID.
* @param priority thread priority, if realtime. * @param priority thread priority, if realtime.
* @param realtime true for the thread to use realtime scheduling. On * @param realtime true for the thread to use realtime scheduling. On
* some systems that may require special privileges. * some systems that may require special privileges.
* @param start_routine function the thread calls when it starts. * @param start_routine function the thread calls when it starts.
* @param arg parameter passed to the @a start_routine. * @param arg parameter passed to the @a start_routine.
* *
* @returns 0, if successful; otherwise some error number. * @returns 0, if successful; otherwise some error number.
*/ */
int jack_client_create_thread (jack_client_t* client, int jack_client_create_thread (jack_client_t* client,
pthread_t *thread, jack_native_thread_t *thread,
int priority, int priority,
int realtime, /* boolean */ int realtime, /* boolean */
void *(*start_routine)(void*), void *(*start_routine)(void*),
void *arg) JACK_OPTIONAL_WEAK_EXPORT; void *arg) JACK_OPTIONAL_WEAK_EXPORT;
/** /**
* Drop realtime scheduling for a thread. * Drop realtime scheduling for a thread.
* *
* @param thread POSIX thread ID. * @param thread POSIX thread ID.
* *
* @returns 0, if successful; otherwise an error number. * @returns 0, if successful; otherwise an error number.
*/ */
int jack_drop_real_time_scheduling (pthread_t thread) JACK_OPTIONAL_WEAK_EX PORT; int jack_drop_real_time_scheduling (jack_native_thread_t thread) JACK_OPTIO NAL_WEAK_EXPORT;
/** /**
* Stop the thread, waiting for the thread handler to terminate. * Stop the thread, waiting for the thread handler to terminate.
* *
* @param thread POSIX thread ID. * @param thread POSIX thread ID.
* *
* @returns 0, if successful; otherwise an error number. * @returns 0, if successful; otherwise an error number.
*/ */
int jack_client_stop_thread(jack_client_t* client, pthread_t thread) JACK_O PTIONAL_WEAK_EXPORT; int jack_client_stop_thread(jack_client_t* client, jack_native_thread_t thr ead) JACK_OPTIONAL_WEAK_EXPORT;
/** /**
* Cancel the thread then waits for the thread handler to terminate. * Cancel the thread then waits for the thread handler to terminate.
* *
* @param thread POSIX thread ID. * @param thread POSIX thread ID.
* *
* @returns 0, if successful; otherwise an error number. * @returns 0, if successful; otherwise an error number.
*/ */
int jack_client_kill_thread(jack_client_t* client, pthread_t thread) JACK_ OPTIONAL_WEAK_EXPORT; int jack_client_kill_thread(jack_client_t* client, jack_native_thread_t th read) JACK_OPTIONAL_WEAK_EXPORT;
#ifndef WIN32 #ifndef WIN32
typedef int (*jack_thread_creator_t)(pthread_t*, typedef int (*jack_thread_creator_t)(pthread_t*,
const pthread_attr_t*, const pthread_attr_t*,
void* (*function)(void*), void* (*function)(void*),
void* arg); void* arg);
/** /**
* This function can be used in very very specialized cases * This function can be used in very very specialized cases
* where it is necessary that client threads created by JACK * where it is necessary that client threads created by JACK
 End of changes. 6 change blocks. 
5 lines changed or deleted 9 lines changed or added


 types.h   types.h 
skipping to change at line 31 skipping to change at line 31
#ifndef __jack_types_h__ #ifndef __jack_types_h__
#define __jack_types_h__ #define __jack_types_h__
#include <jack/systemdeps.h> #include <jack/systemdeps.h>
typedef int32_t jack_shmsize_t; typedef int32_t jack_shmsize_t;
/** /**
* Type used to represent sample frame counts. * Type used to represent sample frame counts.
*/ */
typedef uint32_t jack_nframes_t; typedef uint32_t jack_nframes_t;
/** /**
* Maximum value that can be stored in jack_nframes_t * Maximum value that can be stored in jack_nframes_t
*/ */
#define JACK_MAX_FRAMES (4294967295U) /* This should be UINT32_MAX, but C+ + has a problem with that. */ #define JACK_MAX_FRAMES (4294967295U) /* This should be UINT32_MAX, but C ++ has a problem with that. */
/** /**
* Type used to represent the value of free running * Type used to represent the value of free running
* monotonic clock with units of microseconds. * monotonic clock with units of microseconds.
*/ */
typedef uint64_t jack_time_t; typedef uint64_t jack_time_t;
/** /**
* Maximum size of @a load_init string passed to an internal client * Maximum size of @a load_init string passed to an internal client
* jack_initialize() function via jack_internal_client_load(). * jack_initialize() function via jack_internal_client_load().
skipping to change at line 78 skipping to change at line 78
/** /**
* Ports have unique ids. A port registration callback is the only * Ports have unique ids. A port registration callback is the only
* place you ever need to know their value. * place you ever need to know their value.
*/ */
typedef uint32_t jack_port_id_t; typedef uint32_t jack_port_id_t;
typedef uint32_t jack_port_type_id_t; typedef uint32_t jack_port_type_id_t;
/** /**
* @ref jack_options_t bits
*/
enum JackOptions {
/**
* Null value to use when no option bits are needed.
*/
JackNullOption = 0x00,
/**
* Do not automatically start the JACK server when it is not
* already running. This option is always selected if
* \$JACK_NO_START_SERVER is defined in the calling process
* environment.
*/
JackNoStartServer = 0x01,
/**
* Use the exact client name requested. Otherwise, JACK
* automatically generates a unique one, if needed.
*/
JackUseExactName = 0x02,
/**
* Open with optional <em>(char *) server_name</em> parameter.
*/
JackServerName = 0x04,
/**
* Load internal client from optional <em>(char *)
* load_name</em>. Otherwise use the @a client_name.
*/
JackLoadName = 0x08,
/**
* Pass optional <em>(char *) load_init</em> string to the
* jack_initialize() entry point of an internal client.
*/
JackLoadInit = 0x10,
/**
* pass a SessionID Token this allows the sessionmanager to identify t
he client again.
*/
JackSessionID = 0x20
};
/** Valid options for opening an external client. */
#define JackOpenOptions (JackSessionID|JackServerName|JackNoStartServer|Jac
kUseExactName)
/** Valid options for loading an internal client. */
#define JackLoadOptions (JackLoadInit|JackLoadName|JackUseExactName)
/**
* Options for several JACK operations, formed by OR-ing together the
* relevant @ref JackOptions bits.
*/
typedef enum JackOptions jack_options_t;
/**
* @ref jack_status_t bits
*/
enum JackStatus {
/**
* Overall operation failed.
*/
JackFailure = 0x01,
/**
* The operation contained an invalid or unsupported option.
*/
JackInvalidOption = 0x02,
/**
* The desired client name was not unique. With the @ref
* JackUseExactName option this situation is fatal. Otherwise,
* the name was modified by appending a dash and a two-digit
* number in the range "-01" to "-99". The
* jack_get_client_name() function will return the exact string
* that was used. If the specified @a client_name plus these
* extra characters would be too long, the open fails instead.
*/
JackNameNotUnique = 0x04,
/**
* The JACK server was started as a result of this operation.
* Otherwise, it was running already. In either case the caller
* is now connected to jackd, so there is no race condition.
* When the server shuts down, the client will find out.
*/
JackServerStarted = 0x08,
/**
* Unable to connect to the JACK server.
*/
JackServerFailed = 0x10,
/**
* Communication error with the JACK server.
*/
JackServerError = 0x20,
/**
* Requested client does not exist.
*/
JackNoSuchClient = 0x40,
/**
* Unable to load internal client
*/
JackLoadFailure = 0x80,
/**
* Unable to initialize client
*/
JackInitFailure = 0x100,
/**
* Unable to access shared memory
*/
JackShmFailure = 0x200,
/**
* Client's protocol version does not match
*/
JackVersionError = 0x400,
/**
* Backend error
*/
JackBackendError = 0x800,
/**
* Client zombified failure
*/
JackClientZombie = 0x1000
};
/**
* Status word returned from several JACK operations, formed by
* OR-ing together the relevant @ref JackStatus bits.
*/
typedef enum JackStatus jack_status_t;
/**
* @ref jack_latency_callback_mode_t
*/
enum JackLatencyCallbackMode {
/**
* Latency Callback for Capture Latency.
* Input Ports have their latency value setup.
* In the Callback the client needs to set the latency of the output p
orts
*/
JackCaptureLatency,
/**
* Latency Callback for Playback Latency.
* Output Ports have their latency value setup.
* In the Callback the client needs to set the latency of the input po
rts
*/
JackPlaybackLatency
};
/**
* Type of Latency Callback (Capture or Playback)
*/
typedef enum JackLatencyCallbackMode jack_latency_callback_mode_t;
/**
* Prototype for the client supplied function that is called
* by the engine when port latencies need to be recalculated
*
* @param mode playback or capture latency
* @param arg pointer to a client supplied data
*
* @return zero on success, non-zero on error
*/
typedef void (*JackLatencyCallback)(jack_latency_callback_mode_t mode, void
*arg);
/**
* the new latency API operates on Ranges.
*/
struct _jack_latency_range
{
/**
* minimum latency
*/
jack_nframes_t min;
/**
* maximum latency
*/
jack_nframes_t max;
};
typedef struct _jack_latency_range jack_latency_range_t;
/**
* Prototype for the client supplied function that is called * Prototype for the client supplied function that is called
* by the engine anytime there is work to be done. * by the engine anytime there is work to be done.
* *
* @pre nframes == jack_get_buffer_size() * @pre nframes == jack_get_buffer_size()
* @pre nframes == pow(2,x) * @pre nframes == pow(2,x)
* *
* @param nframes number of frames to process * @param nframes number of frames to process
* @param arg pointer to a client supplied structure * @param arg pointer to a client supplied structure
* *
* @return zero on success, non-zero on error * @return zero on success, non-zero on error
skipping to change at line 167 skipping to change at line 366
* @param arg pointer to a client supplied structure * @param arg pointer to a client supplied structure
* *
* @return zero on success, non-zero on error * @return zero on success, non-zero on error
*/ */
typedef int (*JackSampleRateCallback)(jack_nframes_t nframes, void *arg); typedef int (*JackSampleRateCallback)(jack_nframes_t nframes, void *arg);
/** /**
* Prototype for the client supplied function that is called * Prototype for the client supplied function that is called
* whenever a port is registered or unregistered. * whenever a port is registered or unregistered.
* *
* @param arg pointer to a client supplied structure * @param port the ID of the port
* @param arg pointer to a client supplied data
* @param register non-zero if the port is being registered,
* zero if the port is being unregistered
*/ */
typedef void (*JackPortRegistrationCallback)(jack_port_id_t port, int, void *arg); typedef void (*JackPortRegistrationCallback)(jack_port_id_t port, int regis ter, void *arg);
/** /**
* Prototype for the client supplied function that is called * Prototype for the client supplied function that is called
* whenever a client is registered or unregistered. * whenever a client is registered or unregistered.
* *
* @param name a null-terminated string containing the client name * @param name a null-terminated string containing the client name
* @param register non-zero if the client is being registered, * @param register non-zero if the client is being registered,
* zero if the client is being unregistered * zero if the client is being unregistered
* @param arg pointer to a client supplied structure * @param arg pointer to a client supplied structure
*/ */
typedef void (*JackClientRegistrationCallback)(const char* name, int val, v oid *arg); typedef void (*JackClientRegistrationCallback)(const char* name, int regist er, void *arg);
/** /**
* Prototype for the client supplied function that is called * Prototype for the client supplied function that is called
* whenever a port is connected or disconnected. * whenever a port is connected or disconnected.
* *
* @param a one of two ports connected or disconnected * @param a one of two ports connected or disconnected
* @param b one of two ports connected or disconnected * @param b one of two ports connected or disconnected
* @param connect non-zero if ports were connected * @param connect non-zero if ports were connected
* zero if ports were disconnected * zero if ports were disconnected
* @param arg pointer to a client supplied data * @param arg pointer to a client supplied data
skipping to change at line 229 skipping to change at line 431
* the application is responsible to properly use jack_client_close() * the application is responsible to properly use jack_client_close()
* to release client ressources. Warning: jack_client_close() cannot be * to release client ressources. Warning: jack_client_close() cannot be
* safely used inside the shutdown callback and has to be called outside of * safely used inside the shutdown callback and has to be called outside of
* the callback context. * the callback context.
* *
* @param arg pointer to a client supplied structure * @param arg pointer to a client supplied structure
*/ */
typedef void (*JackShutdownCallback)(void *arg); typedef void (*JackShutdownCallback)(void *arg);
/** /**
* Prototype for the client supplied function that is called
* whenever jackd is shutdown. Note that after server shutdown,
* the client pointer is *not* deallocated by libjack,
* the application is responsible to properly use jack_client_close()
* to release client ressources. Warning: jack_client_close() cannot be
* safely used inside the shutdown callback and has to be called outside of
* the callback context.
* @param code a status word, formed by OR-ing together the relevant @ref J
ackStatus bits.
* @param reason a string describing the shutdown reason (backend failure,
server crash... etc...)
* @param arg pointer to a client supplied structure
*/
typedef void (*JackInfoShutdownCallback)(jack_status_t code, const char* re
ason, void *arg);
/**
* Used for the type argument of jack_port_register() for default * Used for the type argument of jack_port_register() for default
* audio ports and midi ports. * audio ports and midi ports.
*/ */
#define JACK_DEFAULT_AUDIO_TYPE "32 bit float mono audio" #define JACK_DEFAULT_AUDIO_TYPE "32 bit float mono audio"
#define JACK_DEFAULT_MIDI_TYPE "8 bit raw midi" #define JACK_DEFAULT_MIDI_TYPE "8 bit raw midi"
/** /**
* For convenience, use this typedef if you want to be able to change * For convenience, use this typedef if you want to be able to change
* between float and double. You may want to typedef sample_t to * between float and double. You may want to typedef sample_t to
* jack_default_audio_sample_t in your application. * jack_default_audio_sample_t in your application.
skipping to change at line 286 skipping to change at line 503
* as well, so that it can be heard/seen/whatever. * as well, so that it can be heard/seen/whatever.
* *
* Clients that do not control physical interfaces * Clients that do not control physical interfaces
* should never create ports with this bit set. * should never create ports with this bit set.
*/ */
JackPortCanMonitor = 0x8, JackPortCanMonitor = 0x8,
/** /**
* JackPortIsTerminal means: * JackPortIsTerminal means:
* *
* for an input port: the data received by the port * for an input port: the data received by the port
* will not be passed on or made * will not be passed on or made
* available at any other port * available at any other port
* *
* for an output port: the data available at the port * for an output port: the data available at the port
* does not originate from any other port * does not originate from any other port
* *
* Audio synthesizers, I/O hardware interface clients, HDR * Audio synthesizers, I/O hardware interface clients, HDR
* systems are examples of clients that would set this flag for * systems are examples of clients that would set this flag for
* their ports. * their ports.
*/ */
JackPortIsTerminal = 0x10, JackPortIsTerminal = 0x10,
/**
* JackPortIsActive means the port has been registered and the
* client is "active", that is jack_activate has been called
*
* JackPortIsActive is on between jack_activate and jack_deactivate.
*/
JackPortIsActive = 0x20
};
/**
* @ref jack_options_t bits
*/
enum JackOptions {
/**
* Null value to use when no option bits are needed.
*/
JackNullOption = 0x00,
/**
* Do not automatically start the JACK server when it is not
* already running. This option is always selected if
* \$JACK_NO_START_SERVER is defined in the calling process
* environment.
*/
JackNoStartServer = 0x01,
/**
* Use the exact client name requested. Otherwise, JACK
* automatically generates a unique one, if needed.
*/
JackUseExactName = 0x02,
/**
* Open with optional <em>(char *) server_name</em> parameter.
*/
JackServerName = 0x04,
/**
* Load internal client from optional <em>(char *)
* load_name</em>. Otherwise use the @a client_name.
*/
JackLoadName = 0x08,
/**
* Pass optional <em>(char *) load_init</em> string to the
* jack_initialize() entry point of an internal client.
*/
JackLoadInit = 0x10
};
/** Valid options for opening an external client. */
#define JackOpenOptions (JackServerName|JackNoStartServer|JackUseExactName)
/** Valid options for loading an internal client. */
#define JackLoadOptions (JackLoadInit|JackLoadName|JackUseExactName)
/**
* Options for several JACK operations, formed by OR-ing together the
* relevant @ref JackOptions bits.
*/
typedef enum JackOptions jack_options_t;
/**
* @ref jack_status_t bits
*/
enum JackStatus {
/**
* Overall operation failed.
*/
JackFailure = 0x01,
/**
* The operation contained an invalid or unsupported option.
*/
JackInvalidOption = 0x02,
/**
* The desired client name was not unique. With the @ref
* JackUseExactName option this situation is fatal. Otherwise,
* the name was modified by appending a dash and a two-digit
* number in the range "-01" to "-99". The
* jack_get_client_name() function will return the exact string
* that was used. If the specified @a client_name plus these
* extra characters would be too long, the open fails instead.
*/
JackNameNotUnique = 0x04,
/**
* The JACK server was started as a result of this operation.
* Otherwise, it was running already. In either case the caller
* is now connected to jackd, so there is no race condition.
* When the server shuts down, the client will find out.
*/
JackServerStarted = 0x08,
/**
* Unable to connect to the JACK server.
*/
JackServerFailed = 0x10,
/**
* Communication error with the JACK server.
*/
JackServerError = 0x20,
/**
* Requested client does not exist.
*/
JackNoSuchClient = 0x40,
/**
* Unable to load internal client
*/
JackLoadFailure = 0x80,
/**
* Unable to initialize client
*/
JackInitFailure = 0x100,
/**
* Unable to access shared memory
*/
JackShmFailure = 0x200,
/**
* Client's protocol version does not match
*/
JackVersionError = 0x400,
/**
* Backend error
*/
JackBackendError = 0x800,
/**
* Client zombified failure
*/
JackClientZombie = 0x1000
}; };
/** /**
* Status word returned from several JACK operations, formed by
* OR-ing together the relevant @ref JackStatus bits.
*/
typedef enum JackStatus jack_status_t;
/**
* Transport states. * Transport states.
*/ */
typedef enum { typedef enum {
/* the order matters for binary compatibility */ /* the order matters for binary compatibility */
JackTransportStopped = 0, /**< Transport halted */ JackTransportStopped = 0, /**< Transport halted */
JackTransportRolling = 1, /**< Transport playing */ JackTransportRolling = 1, /**< Transport playing */
JackTransportLooping = 2, /**< For OLD_TRANSPORT, now ignored */ JackTransportLooping = 2, /**< For OLD_TRANSPORT, now ignored */
JackTransportStarting = 3, /**< Waiting for sync ready */ JackTransportStarting = 3, /**< Waiting for sync ready */
JackTransportNetStarting = 4, /**< Waiting for sync ready on the n etwork*/ JackTransportNetStarting = 4, /**< Waiting for sync ready on the network*/
} jack_transport_state_t; } jack_transport_state_t;
typedef uint64_t jack_unique_t; /**< Unique ID (opaque) */ typedef uint64_t jack_unique_t; /**< Unique ID (opaque) */
/** /**
* Optional struct jack_position_t fields. * Optional struct jack_position_t fields.
*/ */
typedef enum { typedef enum {
JackPositionBBT = 0x10, /**< Bar, Beat, Tick */ JackPositionBBT = 0x10, /**< Bar, Beat, Tick */
JackPositionTimecode = 0x20, /**< External timecode */ JackPositionTimecode = 0x20, /**< External timecode */
JackBBTFrameOffset = 0x40, /**< Frame offset of BBT information JackBBTFrameOffset = 0x40, /**< Frame offset of BBT informatio
*/ n */
JackAudioVideoRatio = 0x80, /**< audio frames per video frame */ JackAudioVideoRatio = 0x80, /**< audio frames per video frame */
JackVideoFrameOffset = 0x100 /**< frame offset of first video frame */ JackVideoFrameOffset = 0x100 /**< frame offset of first video frame */
} jack_position_bits_t; } jack_position_bits_t;
/** all valid position bits */ /** all valid position bits */
#define JACK_POSITION_MASK (JackPositionBBT|JackPositionTimecode) #define JACK_POSITION_MASK (JackPositionBBT|JackPositionTimecode)
#define EXTENDED_TIME_INFO #define EXTENDED_TIME_INFO
typedef struct { typedef struct {
/* these four cannot be set from clients: the server sets them */ /* these four cannot be set from clients: the server sets them */
jack_unique_t unique_1; /**< unique ID */ jack_unique_t unique_1; /**< unique ID */
jack_time_t usecs; /**< monotonic, free-rolling jack_time_t usecs; /**< monotonic, free-rolling */
*/ jack_nframes_t frame_rate; /**< current frame rate (per second
jack_nframes_t frame_rate; /**< current frame rate (per second) ) */
*/ jack_nframes_t frame; /**< frame number, always present *
jack_nframes_t frame; /**< frame number, always present */ /
jack_position_bits_t valid; /**< which other fields are valid */ jack_position_bits_t valid; /**< which other fields are valid * /
/* JackPositionBBT fields: */ /* JackPositionBBT fields: */
int32_t bar; /**< current bar */ int32_t bar; /**< current bar */
int32_t beat; /**< current beat-within-bar */ int32_t beat; /**< current beat-within-bar */
int32_t tick; /**< current tick-within-beat */ int32_t tick; /**< current tick-within-beat */
double bar_start_tick; double bar_start_tick;
float beats_per_bar; /**< time signature "numerator" */ float beats_per_bar; /**< time signature "numerator" */
float beat_type; /**< time signature "denominator" */ float beat_type; /**< time signature "denominator" *
double ticks_per_beat; /
double beats_per_minute; double ticks_per_beat;
double beats_per_minute;
/* JackPositionTimecode fields: (EXPERIMENTAL: could change) */ /* JackPositionTimecode fields: (EXPERIMENTAL: could change) */
double frame_time; /**< current time in seconds */ double frame_time; /**< current time in seconds */
double next_time; /**< next sequential frame_time double next_time; /**< next sequential frame_time
(unless repositioned) */ (unless repositioned) */
/* JackBBTFrameOffset fields: */ /* JackBBTFrameOffset fields: */
jack_nframes_t bbt_offset; /**< frame offset for the BBT fields jack_nframes_t bbt_offset; /**< frame offset for the BBT field s
(the given bar, beat, and tick (the given bar, beat, and tick
values actually refer to a time values actually refer to a time
frame_offset frames before the frame_offset frames before the
start of the cycle), should start of the cycle), should
be assumed to be 0 if be assumed to be 0 if
JackBBTFrameOffset is not JackBBTFrameOffset is not
set. If JackBBTFrameOffset is set. If JackBBTFrameOffset is
set and this value is zero, the BBT set and this value is zero, the BBT
time refers to the first frame of this time refers to the first frame of this
cycle. If the value is positive, cycle. If the value is positive,
skipping to change at line 542 skipping to change at line 612
jack_nframes_t video_offset; /**< audio frame at which the first video jack_nframes_t video_offset; /**< audio frame at which the first video
frame in this cycle occurs. Should frame in this cycle occurs. Should
be assumed to be 0 if JackVideoFrameOffset be assumed to be 0 if JackVideoFrameOffset
is not set. If JackVideoFrameOffset is is not set. If JackVideoFrameOffset is
set, but the value is zero, there is set, but the value is zero, there is
no video frame within this cycle. */ no video frame within this cycle. */
/* For binary compatibility, new fields should be allocated from /* For binary compatibility, new fields should be allocated from
* this padding area with new valid bits controlling access, so * this padding area with new valid bits controlling access, so
* the existing structure size and offsets are preserved. */ * the existing structure size and offsets are preserved. */
int32_t padding[7]; int32_t padding[7];
/* When (unique_1 == unique_2) the contents are consistent. */ /* When (unique_1 == unique_2) the contents are consistent. */
jack_unique_t unique_2; /**< unique ID */ jack_unique_t unique_2; /**< unique ID */
} jack_position_t; } jack_position_t;
/** /**
* Prototype for the @a sync_callback defined by slow-sync clients. * Prototype for the @a sync_callback defined by slow-sync clients.
* When the client is active, this callback is invoked just before * When the client is active, this callback is invoked just before
* process() in the same thread. This occurs once after registration, * process() in the same thread. This occurs once after registration,
* then subsequently whenever some client requests a new position, or * then subsequently whenever some client requests a new position, or
* the transport enters the ::JackTransportStarting state. This * the transport enters the ::JackTransportStarting state. This
* realtime function must not wait. * realtime function must not wait.
skipping to change at line 621 skipping to change at line 691
* for compatibility with the earlier JACK transport implementation. * for compatibility with the earlier JACK transport implementation.
*********************************************************************/ *********************************************************************/
/** /**
* Optional struct jack_transport_info_t fields. * Optional struct jack_transport_info_t fields.
* *
* @see jack_position_bits_t. * @see jack_position_bits_t.
*/ */
typedef enum { typedef enum {
JackTransportState = 0x1, /**< Transport state */ JackTransportState = 0x1, /**< Transport state */
JackTransportPosition = 0x2, /**< Frame number */ JackTransportPosition = 0x2, /**< Frame number */
JackTransportLoop = 0x4, /**< Loop boundaries (ignored) */ JackTransportLoop = 0x4, /**< Loop boundaries (ignored) */
JackTransportSMPTE = 0x8, /**< SMPTE (ignored) */ JackTransportSMPTE = 0x8, /**< SMPTE (ignored) */
JackTransportBBT = 0x10 /**< Bar, Beat, Tick */ JackTransportBBT = 0x10 /**< Bar, Beat, Tick */
} jack_transport_bits_t; } jack_transport_bits_t;
/** /**
* Deprecated struct for transport position information. * Deprecated struct for transport position information.
* *
* @deprecated This is for compatibility with the earlier transport * @deprecated This is for compatibility with the earlier transport
* interface. Use the jack_position_t struct, instead. * interface. Use the jack_position_t struct, instead.
*/ */
typedef struct { typedef struct {
/* these two cannot be set from clients: the server sets them */ /* these two cannot be set from clients: the server sets them */
jack_nframes_t frame_rate; /**< current frame rate (per second) jack_nframes_t frame_rate; /**< current frame rate (per second
*/ ) */
jack_time_t usecs; /**< monotonic, free-rolling */ jack_time_t usecs; /**< monotonic, free-rolling */
jack_transport_bits_t valid; /**< which fields are legal to read */ jack_transport_bits_t valid; /**< which fields are legal to read */
jack_transport_state_t transport_state; jack_transport_state_t transport_state;
jack_nframes_t frame; jack_nframes_t frame;
jack_nframes_t loop_start; jack_nframes_t loop_start;
jack_nframes_t loop_end; jack_nframes_t loop_end;
long smpte_offset; /**< SMPTE offset (from frame 0) */ long smpte_offset; /**< SMPTE offset (from frame 0) */
float smpte_frame_rate; /**< 29.97, 30, 24 etc. */ float smpte_frame_rate; /**< 29.97, 30, 24 etc. */
int bar; int bar;
int beat; int beat;
int tick; int tick;
double bar_start_tick; double bar_start_tick;
float beats_per_bar; float beats_per_bar;
float beat_type; float beat_type;
double ticks_per_beat; double ticks_per_beat;
double beats_per_minute; double beats_per_minute;
} jack_transport_info_t; } jack_transport_info_t;
/**
* Prototype for the client supplied function that is called
* whenever jackd is shutdown. Note that after server shutdown,
* the client pointer is *not* deallocated by libjack,
* the application is responsible to properly use jack_client_close()
* to release client ressources. Warning: jack_client_close() cannot be
* safely used inside the shutdown callback and has to be called outside of
* the callback context.
* @param code a status word, formed by OR-ing together the relevant @ref J
ackStatus bits.
* @param reason a string describing the shutdown reason (backend failure,
server crash... etc...)
* @param arg pointer to a client supplied structure
*/
typedef void (*JackInfoShutdownCallback)(jack_status_t code, const char* re
ason, void *arg);
#endif /* __jack_types_h__ */ #endif /* __jack_types_h__ */
 End of changes. 27 change blocks. 
210 lines changed or deleted 271 lines changed or added


 weakjack.h   weakjack.h 
skipping to change at line 23 skipping to change at line 23
You should have received a copy of the GNU Lesser General Public Licens e You should have received a copy of the GNU Lesser General Public Licens e
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, U SA. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, U SA.
*/ */
#ifndef __weakjack_h__ #ifndef __weakjack_h__
#define __weakjack_h__ #define __weakjack_h__
/**
* @defgroup WeakLinkage managing support for newer/older versions of JACK
* @{ One challenge faced by developers is that of taking advantage of new
features introduced in new versions of [ JACK ] while still
* supporting older versions of the system. Normally, if an application
uses a new feature in a library/API, it is unable to run on
* earlier versions of the library/API that do not support that feature.
Such applications would either fail to launch or crash when
* an attempt to use the feature was made. This problem cane be solved u
sing weakly-linked symbols.
*
* When a symbol in a framework is defined as weakly linked, the symbol
does not have to be present at runtime for a process to
* continue running. The static linker identifies a weakly linked symbol
as such in any code module that references the symbol. The
* dynamic linker uses this same information at runtime to determine whe
ther a process can continue running. If a weakly linked symbol
* is not present in the framework, the code module can continue to run
as long as it does not reference the symbol. However, if the
* symbol is present, the code can use it normally.
*
* (adapted from: http://developer.apple.com/library/mac/#documentat
ion/MacOSX/Conceptual/BPFrameworks/Concepts/WeakLinking.html)
*
* A concrete example will help. Suppose that someone uses a version
* of a JACK client we'll call "Jill". Jill was linked against a version
* of JACK that contains a newer part of the API (say, jack_set_latency_
callback())
* and would like to use it if it is available.
*
* When Jill is run on a system that has a suitably "new" version of
* JACK, this function will be available entirely normally. But if Jill
* is run on a system with an old version of JACK, the function isn't
* available.
*
* With normal symbol linkage, this would create a startup error wheneve
r
* someone tries to run Jill with the "old" version of JACK. However, fu
nctions
* added to JACK after version 0.116.2 are all declared to have "weak" l
inkage
* which means that their abscence doesn't cause an error during program
* startup. Instead, Jill can test whether or not the symbol jack_set_la
tency_callback
* is null or not. If its null, it means that the JACK installed on this
machine
* is too old to support this function. If its not null, then Jill can u
se it
* just like any other function in the API. For example:
*
* \code
* if (jack_set_latency_callback) {
* jack_set_latency_callback (jill_client, jill_latency_callback, arg
);
* }
* \endcode
*
* However, there are clients that may want to use this approach to part
s of the
* the JACK API that predate 0.116.2. For example, they might want to se
e if even
* really old basic parts of the API like jack_client_open() exist at ru
ntime.
*
* Such clients should include <jack/weakjack.h> before any other JACK h
eader.
* This will make the \b entire JACK API be subject to weak linkage, so
that any
* and all functions can be checked for existence at runtime. It is impo
rtant
* to understand that very few clients need to do this - if you use this
* feature you should have a clear reason to do so.
*
*
*/
#ifndef JACK_OPTIONAL_WEAK_EXPORT #ifndef JACK_OPTIONAL_WEAK_EXPORT
/* JACK_OPTIONAL_WEAK_EXPORT needs to be a macro which /* JACK_OPTIONAL_WEAK_EXPORT needs to be a macro which
expands into a compiler directive. If non-null, the directive expands into a compiler directive. If non-null, the directive
must tell the compiler to arrange for weak linkage of must tell the compiler to arrange for weak linkage of
the symbol it used with. For this to work fully may the symbol it used with. For this to work fully may
require linker arguments for the client as well. require linker arguments for the client as well.
*/ */
#ifdef __GNUC__ #ifdef __GNUC__
#define JACK_OPTIONAL_WEAK_EXPORT __attribute__((__weak__)) #define JACK_OPTIONAL_WEAK_EXPORT __attribute__((__weak__))
#else #else
skipping to change at line 52 skipping to change at line 105
as deprecated. For this to work fully may require as deprecated. For this to work fully may require
linker arguments for the client as well. linker arguments for the client as well.
*/ */
#ifdef __GNUC__ #ifdef __GNUC__
#define JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT __attribute__((__weak__,__depr ecated__)) #define JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT __attribute__((__weak__,__depr ecated__))
#else #else
/* Add other things here for non-gcc platforms */ /* Add other things here for non-gcc platforms */
#endif #endif
#endif #endif
/*@}*/
#endif /* weakjack */ #endif /* weakjack */
 End of changes. 2 change blocks. 
0 lines changed or deleted 78 lines changed or added


 weakmacros.h   weakmacros.h 
skipping to change at line 46 skipping to change at line 46
#ifdef __GNUC__ #ifdef __GNUC__
/* JACK_WEAK_EXPORT needs to be a macro which /* JACK_WEAK_EXPORT needs to be a macro which
expands into a compiler directive. If non-null, the directive expands into a compiler directive. If non-null, the directive
must tell the compiler to arrange for weak linkage of must tell the compiler to arrange for weak linkage of
the symbol it used with. For this to work full may the symbol it used with. For this to work full may
require linker arguments in the client as well. require linker arguments in the client as well.
*/ */
#define JACK_WEAK_EXPORT __attribute__((weak)) #define JACK_WEAK_EXPORT __attribute__((weak))
#else #else
/* Add other things here for non-gcc platforms */ /* Add other things here for non-gcc platforms */
#ifdef WIN32
#define JACK_WEAK_EXPORT #define JACK_WEAK_EXPORT
#endif #endif
#endif
#endif #endif
#ifndef JACK_OPTIONAL_WEAK_EXPORT #ifndef JACK_OPTIONAL_WEAK_EXPORT
#define JACK_OPTIONAL_WEAK_EXPORT #define JACK_OPTIONAL_WEAK_EXPORT
#endif #endif
#ifndef JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT #ifndef JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT
#ifdef __GNUC__ #ifdef __GNUC__
#define JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT __attribute__((__deprecated__) ) #define JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT __attribute__((__deprecated__) )
#else #else
/* Add other things here for non-gcc platforms */ /* Add other things here for non-gcc platforms */
#define JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT
#ifdef WIN32
#define JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT
#endif
#endif /* __GNUC__ */ #endif /* __GNUC__ */
#endif #endif
#endif /* __weakmacros_h__ */ #endif /* __weakmacros_h__ */
 End of changes. 3 change blocks. 
1 lines changed or deleted 9 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/