Sequencer Client Interface

Overview

Sequencer Client Interface Moreā€¦

// typedefs

typedef struct _snd_seq_client_info snd_seq_client_info_t;
typedef struct _snd_seq_client_pool snd_seq_client_pool_t;

// enums

enum snd_seq_client_type_t;

// global functions

size_t
snd_seq_client_info_sizeof(void);

int
snd_seq_client_info_malloc(snd_seq_client_info_t** ptr);

void
snd_seq_client_info_free(snd_seq_client_info_t* ptr);

void
snd_seq_client_info_copy(
    snd_seq_client_info_t* dst,
    const snd_seq_client_info_t* src
);

int
snd_seq_client_info_get_client(const snd_seq_client_info_t* info);

snd_seq_client_type_t
snd_seq_client_info_get_type(const snd_seq_client_info_t* info);

const char*
snd_seq_client_info_get_name(snd_seq_client_info_t* info);

int
snd_seq_client_info_get_broadcast_filter(const snd_seq_client_info_t* info);

int
snd_seq_client_info_get_error_bounce(const snd_seq_client_info_t* info);

int
snd_seq_client_info_get_card(const snd_seq_client_info_t* info);

int
snd_seq_client_info_get_pid(const snd_seq_client_info_t* info);

const unsigned char*
snd_seq_client_info_get_event_filter(const snd_seq_client_info_t* info);

int
snd_seq_client_info_get_num_ports(const snd_seq_client_info_t* info);

int
snd_seq_client_info_get_event_lost(const snd_seq_client_info_t* info);

void
snd_seq_client_info_set_client(
    snd_seq_client_info_t* info,
    int client
);

void
snd_seq_client_info_set_name(
    snd_seq_client_info_t* info,
    const char* name
);

void
snd_seq_client_info_set_broadcast_filter(
    snd_seq_client_info_t* info,
    int val
);

void
snd_seq_client_info_set_error_bounce(
    snd_seq_client_info_t* info,
    int val
);

void
snd_seq_client_info_set_event_filter(
    snd_seq_client_info_t* info,
    unsigned char* filter
);

void
snd_seq_client_info_event_filter_clear(snd_seq_client_info_t* info);

void
snd_seq_client_info_event_filter_add(
    snd_seq_client_info_t* info,
    int event_type
);

void
snd_seq_client_info_event_filter_del(
    snd_seq_client_info_t* info,
    int event_type
);

int
snd_seq_client_info_event_filter_check(
    snd_seq_client_info_t* info,
    int event_type
);

int
snd_seq_get_client_info(
    snd_seq_t* handle,
    snd_seq_client_info_t* info
);

int
snd_seq_get_any_client_info(
    snd_seq_t* handle,
    int client,
    snd_seq_client_info_t* info
);

int
snd_seq_set_client_info(
    snd_seq_t* handle,
    snd_seq_client_info_t* info
);

int
snd_seq_query_next_client(
    snd_seq_t* handle,
    snd_seq_client_info_t* info
);

size_t
snd_seq_client_pool_sizeof(void);

int
snd_seq_client_pool_malloc(snd_seq_client_pool_t** ptr);

void
snd_seq_client_pool_free(snd_seq_client_pool_t* ptr);

void
snd_seq_client_pool_copy(
    snd_seq_client_pool_t* dst,
    const snd_seq_client_pool_t* src
);

int
snd_seq_client_pool_get_client(const snd_seq_client_pool_t* info);

size_t
snd_seq_client_pool_get_output_pool(const snd_seq_client_pool_t* info);

size_t
snd_seq_client_pool_get_input_pool(const snd_seq_client_pool_t* info);

size_t
snd_seq_client_pool_get_output_room(const snd_seq_client_pool_t* info);

size_t
snd_seq_client_pool_get_output_free(const snd_seq_client_pool_t* info);

size_t
snd_seq_client_pool_get_input_free(const snd_seq_client_pool_t* info);

void
snd_seq_client_pool_set_output_pool(
    snd_seq_client_pool_t* info,
    size_t size
);

void
snd_seq_client_pool_set_input_pool(
    snd_seq_client_pool_t* info,
    size_t size
);

void
snd_seq_client_pool_set_output_room(
    snd_seq_client_pool_t* info,
    size_t size
);

int
snd_seq_get_client_pool(
    snd_seq_t* handle,
    snd_seq_client_pool_t* info
);

int
snd_seq_set_client_pool(
    snd_seq_t* handle,
    snd_seq_client_pool_t* info
);

// macros

#define snd_seq_client_info_alloca(ptr)
#define snd_seq_client_pool_alloca(ptr)

Detailed Documentation

Sequencer Client Interface

Typedefs

typedef struct _snd_seq_client_info snd_seq_client_info_t

client information container

typedef struct _snd_seq_client_pool snd_seq_client_pool_t

client pool information container

Global Functions

size_t
snd_seq_client_info_sizeof(void)

get size of snd_seq_client_info_t

Returns:

size in bytes

int
snd_seq_client_info_malloc(snd_seq_client_info_t** ptr)

allocate an empty snd_seq_client_info_t using standard malloc

Parameters:

ptr

returned pointer

Returns:

0 on success otherwise negative error code

void
snd_seq_client_info_free(snd_seq_client_info_t* ptr)

frees a previously allocated snd_seq_client_info_t

Parameters:

obj

pointer to object to free

void
snd_seq_client_info_copy(
    snd_seq_client_info_t* dst,
    const snd_seq_client_info_t* src
)

copy one snd_seq_client_info_t to another

Parameters:

dst

pointer to destination

src

pointer to source

int
snd_seq_client_info_get_client(const snd_seq_client_info_t* info)

Get client id of a client_info container.

Parameters:

info

client_info container

Returns:

client id

See also:

snd_seq_get_client_info(), snd_seq_client_info_set_client(), snd_seq_client_id()

snd_seq_client_type_t
snd_seq_client_info_get_type(const snd_seq_client_info_t* info)

Get client type of a client_info container.

The client type is either SND_SEQ_KERNEL_CLIENT or SND_SEQ_USER_CLIENT for kernel or user client respectively.

Parameters:

info

client_info container

Returns:

client type

See also:

snd_seq_get_client_info()

const char*
snd_seq_client_info_get_name(snd_seq_client_info_t* info)

Get the name of a client_info container.

Parameters:

info

client_info container

Returns:

name string

See also:

snd_seq_get_client_info(), snd_seq_client_info_set_name()

int
snd_seq_client_info_get_broadcast_filter(const snd_seq_client_info_t* info)

Get the broadcast filter usage of a client_info container.

Parameters:

info

client_info container

Returns:

1 if broadcast is accepted

See also:

snd_seq_get_client_info(), snd_seq_client_info_set_broadcast_filter()

int
snd_seq_client_info_get_error_bounce(const snd_seq_client_info_t* info)

Get the error-bounce usage of a client_info container.

Parameters:

info

client_info container

Returns:

1 if error-bounce is enabled

See also:

snd_seq_get_client_info(), snd_seq_client_info_set_error_bounce()

int
snd_seq_client_info_get_card(const snd_seq_client_info_t* info)

Get the sound card number.

Only available for SND_SEQ_KERNEL_CLIENT clients.

Parameters:

info

client_info container

Returns:

card number or -1 if value is not available.

int
snd_seq_client_info_get_pid(const snd_seq_client_info_t* info)

Get the owning PID.

Only available for SND_SEQ_USER_CLIENT clients.

Parameters:

info

client_info container

Returns:

pid or -1 if value is not available.

const unsigned char*
snd_seq_client_info_get_event_filter(const snd_seq_client_info_t* info)

(DEPRECATED) Get the event filter bitmap of a client_info container

Use snd_seq_client_info_event_filter_check() instead.

Parameters:

info

client_info container

Returns:

NULL if no event filter, or pointer to event filter bitmap

See also:

snd_seq_client_info_event_filter_add(), snd_seq_client_info_event_filter_del(), snd_seq_client_info_event_filter_check(), snd_seq_client_info_event_filter_clear(), snd_seq_get_client_info()

int
snd_seq_client_info_get_num_ports(const snd_seq_client_info_t* info)

Get the number of opened ports of a client_info container.

Parameters:

info

client_info container

Returns:

number of opened ports

See also:

snd_seq_get_client_info()

int
snd_seq_client_info_get_event_lost(const snd_seq_client_info_t* info)

Get the number of lost events of a client_info container.

Parameters:

info

client_info container

Returns:

number of lost events

See also:

snd_seq_get_client_info()

void
snd_seq_client_info_set_client(
    snd_seq_client_info_t* info,
    int client
)

Set the client id of a client_info container.

Parameters:

info

client_info container

client

client id

See also:

snd_seq_get_client_info(), snd_seq_client_info_get_client()

void
snd_seq_client_info_set_name(
    snd_seq_client_info_t* info,
    const char* name
)

Set the name of a client_info container.

Parameters:

info

client_info container

name

name string

See also:

snd_seq_get_client_info(), snd_seq_client_info_get_name(), snd_seq_set_client_name()

void
snd_seq_client_info_set_broadcast_filter(
    snd_seq_client_info_t* info,
    int val
)

Set the broadcast filter usage of a client_info container.

Parameters:

info

client_info container

val

non-zero if broadcast is accepted

See also:

snd_seq_get_client_info(), snd_seq_client_info_get_broadcast_filter()

void
snd_seq_client_info_set_error_bounce(
    snd_seq_client_info_t* info,
    int val
)

Set the error-bounce usage of a client_info container.

Parameters:

info

client_info container

val

non-zero if error is bounced

See also:

snd_seq_get_client_info(), snd_seq_client_info_get_error_bounce()

void
snd_seq_client_info_set_event_filter(
    snd_seq_client_info_t* info,
    unsigned char* filter
)

(DEPRECATED) Set the event filter bitmap of a client_info container

Use snd_seq_client_info_event_filter_add instead.

Parameters:

info

client_info container

filter

event filter bitmap, pass NULL for no event filtering

See also:

snd_seq_client_info_event_filter_add(), snd_seq_client_info_event_filter_del(), snd_seq_client_info_event_filter_check(), snd_seq_client_info_event_filter_clear(), snd_seq_set_client_info()

void
snd_seq_client_info_event_filter_clear(snd_seq_client_info_t* info)

Disable event filtering of a client_info container.

Remove all event types added with snd_seq_client_info_event_filter_add and clear the event filtering flag of this client_info container.

Parameters:

info

client_info container

See also:

snd_seq_client_info_event_filter_add(), snd_seq_client_info_event_filter_del(), snd_seq_client_info_event_filter_check(), snd_seq_get_client_info(), snd_seq_set_client_info()

void
snd_seq_client_info_event_filter_add(
    snd_seq_client_info_t* info,
    int event_type
)

Add an event type to the event filtering of a client_info container.

Set the event filtering flag of this client_info and add the specified event type to the filter bitmap of this client_info container.

Parameters:

info

client_info container

event_type

event type to be added

See also:

snd_seq_get_client_info(), snd_seq_set_client_info(), snd_seq_client_info_event_filter_del(), snd_seq_client_info_event_filter_check(), snd_seq_client_info_event_filter_clear()

void
snd_seq_client_info_event_filter_del(
    snd_seq_client_info_t* info,
    int event_type
)

Remove an event type from the event filtering of a client_info container.

Removes the specified event from the filter bitmap of this client_info container. It will not clear the event filtering flag, use snd_seq_client_info_event_filter_clear instead.

Parameters:

info

client_info container

event_type

event type to be removed

See also:

snd_seq_get_client_info(), snd_seq_set_client_info(), snd_seq_client_info_event_filter_add(), snd_seq_client_info_event_filter_check(), snd_seq_client_info_event_filter_clear()

int
snd_seq_client_info_event_filter_check(
    snd_seq_client_info_t* info,
    int event_type
)

Check if an event type is present in the event filtering of a client_info container.

Test if the event type is in the filter bitmap of this client_info container.

Parameters:

info

client_info container

event_type

event type to be checked

Returns:

1 if the event type is present, 0 otherwise

See also:

snd_seq_get_client_info(), snd_seq_set_client_info(), snd_seq_client_info_event_filter_add(), snd_seq_client_info_event_filter_del(), snd_seq_client_info_event_filter_clear()

int
snd_seq_get_client_info(
    snd_seq_t* handle,
    snd_seq_client_info_t* info
)

obtain the current client information

Obtains the information of the current client stored on info. client and type fields are ignored.

Parameters:

seq

sequencer handle

info

the pointer to be stored

Returns:

0 on success otherwise a negative error code

See also:

snd_seq_get_any_client_info(), snd_seq_set_client_info(), snd_seq_query_next_client()

int
snd_seq_get_any_client_info(
    snd_seq_t* handle,
    int client,
    snd_seq_client_info_t* info
)

obtain the information of the given client

Obtains the information of the client with a client id specified by info argument. The obtained information is written on info parameter.

Parameters:

seq

sequencer handle

client

client id

info

the pointer to be stored

Returns:

0 on success otherwise a negative error code

See also:

snd_seq_get_client_info()

int
snd_seq_set_client_info(
    snd_seq_t* handle,
    snd_seq_client_info_t* info
)

set the current client information

Obtains the information of the current client stored on info. client and type fields are ignored.

Parameters:

seq

sequencer handle

info

the client info data to set

Returns:

0 on success otherwise a negative error code

See also:

snd_seq_get_client_info()

int
snd_seq_query_next_client(
    snd_seq_t* handle,
    snd_seq_client_info_t* info
)

query the next client

Queries the next client. The search begins at the client with an id one greater than client field in info. If a client is found, its attributes are stored in info, and zero is returned. Otherwise returns a negative error code.

Parameters:

seq

sequencer handle

info

query pattern and result

See also:

snd_seq_get_any_client_info()

size_t
snd_seq_client_pool_sizeof(void)

get size of snd_seq_client_pool_t

Returns:

size in bytes

int
snd_seq_client_pool_malloc(snd_seq_client_pool_t** ptr)

allocate an empty snd_seq_client_pool_t using standard malloc

Parameters:

ptr

returned pointer

Returns:

0 on success otherwise negative error code

void
snd_seq_client_pool_free(snd_seq_client_pool_t* ptr)

frees a previously allocated snd_seq_client_pool_t

Parameters:

obj

pointer to object to free

void
snd_seq_client_pool_copy(
    snd_seq_client_pool_t* dst,
    const snd_seq_client_pool_t* src
)

copy one snd_seq_client_pool_t to another

Parameters:

dst

pointer to destination

src

pointer to source

int
snd_seq_client_pool_get_client(const snd_seq_client_pool_t* info)

Get the client id of a queue_info container.

Parameters:

info

client_pool container

Returns:

client id

size_t
snd_seq_client_pool_get_output_pool(const snd_seq_client_pool_t* info)

Get the output pool size of a queue_info container.

Parameters:

info

client_pool container

Returns:

output pool size

size_t
snd_seq_client_pool_get_input_pool(const snd_seq_client_pool_t* info)

Get the input pool size of a queue_info container.

Parameters:

info

client_pool container

Returns:

input pool size

size_t
snd_seq_client_pool_get_output_room(const snd_seq_client_pool_t* info)

Get the output room size of a queue_info container.

Parameters:

info

client_pool container

Returns:

output room size

size_t
snd_seq_client_pool_get_output_free(const snd_seq_client_pool_t* info)

Get the available size on output pool of a queue_info container.

Parameters:

info

client_pool container

Returns:

available output size

size_t
snd_seq_client_pool_get_input_free(const snd_seq_client_pool_t* info)

Get the available size on input pool of a queue_info container.

Parameters:

info

client_pool container

Returns:

available input size

void
snd_seq_client_pool_set_output_pool(
    snd_seq_client_pool_t* info,
    size_t size
)

Set the output pool size of a queue_info container.

Parameters:

info

client_pool container

size

output pool size

void
snd_seq_client_pool_set_input_pool(
    snd_seq_client_pool_t* info,
    size_t size
)

Set the input pool size of a queue_info container.

Parameters:

info

client_pool container

size

input pool size

void
snd_seq_client_pool_set_output_room(
    snd_seq_client_pool_t* info,
    size_t size
)

Set the output room size of a queue_info container.

Parameters:

info

client_pool container

size

output room size

int
snd_seq_get_client_pool(
    snd_seq_t* handle,
    snd_seq_client_pool_t* info
)

obtain the pool information of the current client

Parameters:

seq

sequencer handle

info

information to be stored

int
snd_seq_set_client_pool(
    snd_seq_t* handle,
    snd_seq_client_pool_t* info
)

set the pool information

Sets the pool information of the current client. The client field in info is replaced automatically with the current id.

Parameters:

seq

sequencer handle

info

information to update

Macros

#define snd_seq_client_info_alloca(ptr)

allocate a snd_seq_client_info_t container on stack

#define snd_seq_client_pool_alloca(ptr)

allocate a snd_seq_client_pool_t container on stack