Sequencer Port Subscription

Overview

Sequencer Port Subscription More…

// typedefs

typedef struct _snd_seq_port_subscribe snd_seq_port_subscribe_t;
typedef struct _snd_seq_query_subscribe snd_seq_query_subscribe_t;

// enums

enum snd_seq_query_subs_type_t;

// global functions

size_t
snd_seq_port_subscribe_sizeof(void);

int
snd_seq_port_subscribe_malloc(snd_seq_port_subscribe_t** ptr);

void
snd_seq_port_subscribe_free(snd_seq_port_subscribe_t* ptr);

void
snd_seq_port_subscribe_copy(
    snd_seq_port_subscribe_t* dst,
    const snd_seq_port_subscribe_t* src
);

const snd_seq_addr_t*
snd_seq_port_subscribe_get_sender(const snd_seq_port_subscribe_t* info);

const snd_seq_addr_t*
snd_seq_port_subscribe_get_dest(const snd_seq_port_subscribe_t* info);

int
snd_seq_port_subscribe_get_queue(const snd_seq_port_subscribe_t* info);

int
snd_seq_port_subscribe_get_exclusive(const snd_seq_port_subscribe_t* info);

int
snd_seq_port_subscribe_get_time_update(const snd_seq_port_subscribe_t* info);

int
snd_seq_port_subscribe_get_time_real(const snd_seq_port_subscribe_t* info);

void
snd_seq_port_subscribe_set_sender(
    snd_seq_port_subscribe_t* info,
    const snd_seq_addr_t* addr
);

void
snd_seq_port_subscribe_set_dest(
    snd_seq_port_subscribe_t* info,
    const snd_seq_addr_t* addr
);

void
snd_seq_port_subscribe_set_queue(
    snd_seq_port_subscribe_t* info,
    int q
);

void
snd_seq_port_subscribe_set_exclusive(
    snd_seq_port_subscribe_t* info,
    int val
);

void
snd_seq_port_subscribe_set_time_update(
    snd_seq_port_subscribe_t* info,
    int val
);

void
snd_seq_port_subscribe_set_time_real(
    snd_seq_port_subscribe_t* info,
    int val
);

int
snd_seq_get_port_subscription(
    snd_seq_t* handle,
    snd_seq_port_subscribe_t* sub
);

int
snd_seq_subscribe_port(
    snd_seq_t* handle,
    snd_seq_port_subscribe_t* sub
);

int
snd_seq_unsubscribe_port(
    snd_seq_t* handle,
    snd_seq_port_subscribe_t* sub
);

size_t
snd_seq_query_subscribe_sizeof(void);

int
snd_seq_query_subscribe_malloc(snd_seq_query_subscribe_t** ptr);

void
snd_seq_query_subscribe_free(snd_seq_query_subscribe_t* ptr);

void
snd_seq_query_subscribe_copy(
    snd_seq_query_subscribe_t* dst,
    const snd_seq_query_subscribe_t* src
);

int
snd_seq_query_subscribe_get_client(const snd_seq_query_subscribe_t* info);

int
snd_seq_query_subscribe_get_port(const snd_seq_query_subscribe_t* info);

const snd_seq_addr_t*
snd_seq_query_subscribe_get_root(const snd_seq_query_subscribe_t* info);

snd_seq_query_subs_type_t
snd_seq_query_subscribe_get_type(const snd_seq_query_subscribe_t* info);

int
snd_seq_query_subscribe_get_index(const snd_seq_query_subscribe_t* info);

int
snd_seq_query_subscribe_get_num_subs(const snd_seq_query_subscribe_t* info);

const snd_seq_addr_t*
snd_seq_query_subscribe_get_addr(const snd_seq_query_subscribe_t* info);

int
snd_seq_query_subscribe_get_queue(const snd_seq_query_subscribe_t* info);

int
snd_seq_query_subscribe_get_exclusive(const snd_seq_query_subscribe_t* info);

int
snd_seq_query_subscribe_get_time_update(const snd_seq_query_subscribe_t* info);

int
snd_seq_query_subscribe_get_time_real(const snd_seq_query_subscribe_t* info);

void
snd_seq_query_subscribe_set_client(
    snd_seq_query_subscribe_t* info,
    int client
);

void
snd_seq_query_subscribe_set_port(
    snd_seq_query_subscribe_t* info,
    int port
);

void
snd_seq_query_subscribe_set_root(
    snd_seq_query_subscribe_t* info,
    const snd_seq_addr_t* addr
);

void
snd_seq_query_subscribe_set_type(
    snd_seq_query_subscribe_t* info,
    snd_seq_query_subs_type_t type
);

void
snd_seq_query_subscribe_set_index(
    snd_seq_query_subscribe_t* info,
    int _index
);

int
snd_seq_query_port_subscribers(
    snd_seq_t* seq,
    snd_seq_query_subscribe_t* subs
);

// macros

#define snd_seq_port_subscribe_alloca(ptr)
#define snd_seq_query_subscribe_alloca(ptr)

Detailed Documentation

Sequencer Port Subscription

Typedefs

typedef struct _snd_seq_port_subscribe snd_seq_port_subscribe_t

port subscription container

typedef struct _snd_seq_query_subscribe snd_seq_query_subscribe_t

subscription query container

Global Functions

size_t
snd_seq_port_subscribe_sizeof(void)

get size of snd_seq_port_subscribe_t

Returns:

size in bytes

int
snd_seq_port_subscribe_malloc(snd_seq_port_subscribe_t** ptr)

allocate an empty snd_seq_port_subscribe_t using standard malloc

Parameters:

ptr returned pointer

Returns:

0 on success otherwise negative error code

void
snd_seq_port_subscribe_free(snd_seq_port_subscribe_t* ptr)

frees a previously allocated snd_seq_port_subscribe_t

Parameters:

obj pointer to object to free
void
snd_seq_port_subscribe_copy(
    snd_seq_port_subscribe_t* dst,
    const snd_seq_port_subscribe_t* src
)

copy one snd_seq_port_subscribe_t to another

Parameters:

dst pointer to destination
src pointer to source
const snd_seq_addr_t*
snd_seq_port_subscribe_get_sender(const snd_seq_port_subscribe_t* info)

Get sender address of a port_subscribe container.

Parameters:

info port_subscribe container

See also:

snd_seq_subscribe_port(), snd_seq_port_subscribe_set_sender()

const snd_seq_addr_t*
snd_seq_port_subscribe_get_dest(const snd_seq_port_subscribe_t* info)

Get destination address of a port_subscribe container.

Parameters:

info port_subscribe container

See also:

snd_seq_subscribe_port(), snd_seq_port_subscribe_set_dest()

int
snd_seq_port_subscribe_get_queue(const snd_seq_port_subscribe_t* info)

Get the queue id of a port_subscribe container.

Parameters:

info port_subscribe container

Returns:

queue id

See also:

snd_seq_subscribe_port(), snd_seq_port_subscribe_set_queue()

int
snd_seq_port_subscribe_get_exclusive(const snd_seq_port_subscribe_t* info)

Get the exclusive mode of a port_subscribe container.

Parameters:

info port_subscribe container

Returns:

1 if exclusive mode

See also:

snd_seq_subscribe_port(), snd_seq_port_subscribe_set_exclusive()

int
snd_seq_port_subscribe_get_time_update(const snd_seq_port_subscribe_t* info)

Get the time-update mode of a port_subscribe container.

Parameters:

info port_subscribe container

Returns:

1 if update timestamp

See also:

snd_seq_subscribe_port(), snd_seq_port_subscribe_set_time_update()

int
snd_seq_port_subscribe_get_time_real(const snd_seq_port_subscribe_t* info)

Get the real-time update mode of a port_subscribe container.

Parameters:

info port_subscribe container

Returns:

1 if real-time update mode

See also:

snd_seq_subscribe_port(), snd_seq_port_subscribe_set_time_real()

void
snd_seq_port_subscribe_set_sender(
    snd_seq_port_subscribe_t* info,
    const snd_seq_addr_t* addr
)

Set sender address of a port_subscribe container.

Parameters:

info port_subscribe container
addr sender address

See also:

snd_seq_subscribe_port(), snd_seq_port_subscribe_get_sender()

void
snd_seq_port_subscribe_set_dest(
    snd_seq_port_subscribe_t* info,
    const snd_seq_addr_t* addr
)

Set destination address of a port_subscribe container.

Parameters:

info port_subscribe container
addr destination address

See also:

snd_seq_subscribe_port(), snd_seq_port_subscribe_get_dest()

void
snd_seq_port_subscribe_set_queue(
    snd_seq_port_subscribe_t* info,
    int q
)

Set the queue id of a port_subscribe container.

Parameters:

info port_subscribe container
q queue id

See also:

snd_seq_subscribe_port(), snd_seq_port_subscribe_get_queue()

void
snd_seq_port_subscribe_set_exclusive(
    snd_seq_port_subscribe_t* info,
    int val
)

Set the exclusive mode of a port_subscribe container.

Parameters:

info port_subscribe container
val non-zero to enable

See also:

snd_seq_subscribe_port(), snd_seq_port_subscribe_get_exclusive()

void
snd_seq_port_subscribe_set_time_update(
    snd_seq_port_subscribe_t* info,
    int val
)

Set the time-update mode of a port_subscribe container.

Parameters:

info port_subscribe container
val non-zero to enable

See also:

snd_seq_subscribe_port(), snd_seq_port_subscribe_get_time_update()

void
snd_seq_port_subscribe_set_time_real(
    snd_seq_port_subscribe_t* info,
    int val
)

Set the real-time mode of a port_subscribe container.

Parameters:

info port_subscribe container
val non-zero to enable

See also:

snd_seq_subscribe_port(), snd_seq_port_subscribe_get_time_real()

int
snd_seq_get_port_subscription(
    snd_seq_t* handle,
    snd_seq_port_subscribe_t* sub
)

obtain subscription information

Parameters:

seq sequencer handle
sub pointer to return the subscription information

Returns:

0 on success otherwise a negative error code

See also:

snd_seq_subscribe_port(), snd_seq_query_port_subscribers()

int
snd_seq_subscribe_port(
    snd_seq_t* handle,
    snd_seq_port_subscribe_t* sub
)

subscribe a port connection

Subscribes a connection between two ports. The subscription information is stored in sub argument.

Parameters:

seq sequencer handle
sub subscription information

Returns:

0 on success otherwise a negative error code

See also:

snd_seq_get_port_subscription(), snd_seq_unsubscribe_port(), snd_seq_connect_from(), snd_seq_connect_to()

int
snd_seq_unsubscribe_port(
    snd_seq_t* handle,
    snd_seq_port_subscribe_t* sub
)

unsubscribe a connection between ports

Unsubscribes a connection between two ports, described in sender and dest fields in sub argument.

Parameters:

seq sequencer handle
sub subscription information to disconnect

Returns:

0 on success otherwise a negative error code

See also:

snd_seq_subscribe_port(), snd_seq_disconnect_from(), snd_seq_disconnect_to()

size_t
snd_seq_query_subscribe_sizeof(void)

get size of snd_seq_query_subscribe_t

Returns:

size in bytes

int
snd_seq_query_subscribe_malloc(snd_seq_query_subscribe_t** ptr)

allocate an empty snd_seq_query_subscribe_t using standard malloc

Parameters:

ptr returned pointer

Returns:

0 on success otherwise negative error code

void
snd_seq_query_subscribe_free(snd_seq_query_subscribe_t* ptr)

frees a previously allocated snd_seq_query_subscribe_t

Parameters:

obj pointer to object to free
void
snd_seq_query_subscribe_copy(
    snd_seq_query_subscribe_t* dst,
    const snd_seq_query_subscribe_t* src
)

copy one snd_seq_query_subscribe_t to another

Parameters:

dst pointer to destination
src pointer to source
int
snd_seq_query_subscribe_get_client(const snd_seq_query_subscribe_t* info)

Get the client id of a query_subscribe container.

Parameters:

info query_subscribe container

Returns:

client id

See also:

snd_seq_query_port_subscribers(), snd_seq_query_subscribe_set_client()

int
snd_seq_query_subscribe_get_port(const snd_seq_query_subscribe_t* info)

Get the port id of a query_subscribe container.

Parameters:

info query_subscribe container

Returns:

port id

See also:

snd_seq_query_port_subscribers(), snd_seq_query_subscribe_set_port()

const snd_seq_addr_t*
snd_seq_query_subscribe_get_root(const snd_seq_query_subscribe_t* info)

Get the client/port address of a query_subscribe container.

Parameters:

info query_subscribe container

Returns:

client/port address pointer

See also:

snd_seq_query_port_subscribers(), snd_seq_query_subscribe_set_root()

snd_seq_query_subs_type_t
snd_seq_query_subscribe_get_type(const snd_seq_query_subscribe_t* info)

Get the query type of a query_subscribe container.

Parameters:

info query_subscribe container

Returns:

query type

See also:

snd_seq_query_port_subscribers(), snd_seq_query_subscribe_set_type()

int
snd_seq_query_subscribe_get_index(const snd_seq_query_subscribe_t* info)

Get the index of subscriber of a query_subscribe container.

Parameters:

info query_subscribe container

Returns:

subscriber’s index

See also:

snd_seq_query_port_subscribers(), snd_seq_query_subscribe_set_index()

int
snd_seq_query_subscribe_get_num_subs(const snd_seq_query_subscribe_t* info)

Get the number of subscriptions of a query_subscribe container.

Parameters:

info query_subscribe container

Returns:

number of subscriptions

See also:

snd_seq_query_port_subscribers()

const snd_seq_addr_t*
snd_seq_query_subscribe_get_addr(const snd_seq_query_subscribe_t* info)

Get the address of subscriber of a query_subscribe container.

Parameters:

info query_subscribe container

Returns:

subscriber’s address pointer

See also:

snd_seq_query_port_subscribers()

int
snd_seq_query_subscribe_get_queue(const snd_seq_query_subscribe_t* info)

Get the queue id of subscriber of a query_subscribe container.

Parameters:

info query_subscribe container

Returns:

subscriber’s queue id

See also:

snd_seq_query_port_subscribers()

int
snd_seq_query_subscribe_get_exclusive(const snd_seq_query_subscribe_t* info)

Get the exclusive mode of a query_subscribe container.

Parameters:

info query_subscribe container

Returns:

1 if exclusive mode

See also:

snd_seq_query_port_subscribers()

int
snd_seq_query_subscribe_get_time_update(const snd_seq_query_subscribe_t* info)

Get the time-update mode of a query_subscribe container.

Parameters:

info query_subscribe container

Returns:

1 if update timestamp

See also:

snd_seq_query_port_subscribers()

int
snd_seq_query_subscribe_get_time_real(const snd_seq_query_subscribe_t* info)

Get the real-time update mode of a query_subscribe container.

Parameters:

info query_subscribe container

Returns:

1 if real-time update mode

See also:

snd_seq_query_port_subscribers()

void
snd_seq_query_subscribe_set_client(
    snd_seq_query_subscribe_t* info,
    int client
)

Set the client id of a query_subscribe container.

Parameters:

info query_subscribe container
client client id

See also:

snd_seq_query_port_subscribers(), snd_seq_query_subscribe_get_client()

void
snd_seq_query_subscribe_set_port(
    snd_seq_query_subscribe_t* info,
    int port
)

Set the port id of a query_subscribe container.

Parameters:

info query_subscribe container
port port id

See also:

snd_seq_query_port_subscribers(), snd_seq_query_subscribe_get_port()

void
snd_seq_query_subscribe_set_root(
    snd_seq_query_subscribe_t* info,
    const snd_seq_addr_t* addr
)

Set the client/port address of a query_subscribe container.

Parameters:

info query_subscribe container
addr client/port address pointer

See also:

snd_seq_query_port_subscribers(), snd_seq_query_subscribe_get_root()

void
snd_seq_query_subscribe_set_type(
    snd_seq_query_subscribe_t* info,
    snd_seq_query_subs_type_t type
)

Set the query type of a query_subscribe container.

Parameters:

info query_subscribe container
type query type

See also:

snd_seq_query_port_subscribers(), snd_seq_query_subscribe_get_type()

void
snd_seq_query_subscribe_set_index(
    snd_seq_query_subscribe_t* info,
    int _index
)

Set the subscriber’s index to be queried.

Parameters:

info query_subscribe container
index index to be queried

See also:

snd_seq_query_port_subscribers(), snd_seq_query_subscribe_get_index()

int
snd_seq_query_port_subscribers(
    snd_seq_t* seq,
    snd_seq_query_subscribe_t* subs
)

query port subscriber list

Queries the subscribers accessing to a port. The query information is specified in subs argument.

At least, the client id, the port id, the index number and the query type must be set to perform a proper query. As the query type, SND_SEQ_QUERY_SUBS_READ or SND_SEQ_QUERY_SUBS_WRITE can be specified to check whether the readers or the writers to the port. To query the first subscription, set 0 to the index number. To list up all the subscriptions, call this function with the index numbers from 0 until this returns a negative value.

Parameters:

seq sequencer handle
subs subscription to query

Returns:

0 on success otherwise a negative error code

See also:

snd_seq_get_port_subscription()

Macros

#define snd_seq_port_subscribe_alloca(ptr)

allocate a snd_seq_port_subscribe_t container on stack

#define snd_seq_query_subscribe_alloca(ptr)

allocate a snd_seq_query_subscribe_t container on stack