[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.2.1 Server interaction

Function: cca_client_t * cca_init (cca_args_t * args, const char * client_class, int client_flags, cca_protocol_t protocol)
Open a connection to the server. Returns NULL on failure.

The args argument must be obtained using cca_extract_args.

The client_class argument must be a string that will never change over invocations of the program. If using GNU automake, the best way to do this is to use the PACKAGE_NAME macro that is automatically defined.

The client_flags argument should be 0 or bitwise-OR'd values from this list:

CCA_Config_Data_Set
The client wishes to save its data use the LADCCA config system. See Configs and 6.3 Event protocol.
CCA_Config_File
The client saves its data to a file. See section 6.3 Event protocol.
CCA_Server_Interface
The client is a server interface. See section 6.3.2 Server interfaces.
CCA_No_Autoresume
This flag is set by the --ladcca-no-autoresume command line option and should not normally be set by clients themselves.
CCA_Terminal
The client is dependant on being run in a terminal.

The protocol argument should be the version of the high-level protocol that the client implements See Protocol versioning for information on how to contruct a cca_protocol_t variable.

Function: cca_args_t * cca_extract_args (int * argc, char *** argv)
Extract LADCCA-specific arguments from argc/argv for use in cca_init. This should be done before the client checks the arguments, obviously.

Function: const char * cca_get_server_name (cca_client_t * client)
Get the hostname of the server.

Function: unsigned int cca_get_pending_event_count (cca_client_t * client)
Get the number of pending events.

Function: cca_event_t * cca_get_event (cca_client_t * client)
Retrieve an event. The event must be freed using cca_event_destroy. Returns NULL if there are no events pending.

Function: unsigned int cca_get_pending_config_count (cca_client_t * client)
Get the number of pending configs.

Function: cca_config_t * cca_get_config (cca_client_t * client)
Retrieve a config. The config must be freed using cca_config_destroy. Returns NULL if there are no configs pending.

Function: void cca_send_event (cca_client_t * client, cca_event_t * event)
Send an event to the server. The event must be created using cca_event_new or cca_event_new_with_type. The library takes over ownership of the memory and it should not be freed by the client.

Function: void cca_send_config (cca_client_t * client, cca_config_t * config)
Send some configuration data to the server. The config must be created using cca_config_new, cca_config_new_with_key or cca_config_dup. The library takes over ownership of the memory and it should not be freed by the client.

Macro: cca_enabled (client)
Check whether the cca_client_t pointer client is not NULL, and if it isn't, that the server is still connected.

Function: int cca_server_connected (cca_client_t * client)
Check whether the server is connected. Returns 1 if the server is still connected or 0 if it isn't

Function: void cca_jack_client_name (cca_client_t * client, const char * name)
Tell the server the client's JACK client name. This is a convenience function that just sends a CCA_Jack_Client_Name event to the server. See Normal CCA_Jack_Client_Name.

Function: void cca_alsa_client_id (cca_client_t * client, unsigned char id);
Tell the server the client's ALSA client ID. This just is a convenience function that just sends a CCA_Alsa_Client_ID event to the server. See Normal CCA_Alsa_Client_ID.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated on June, 25 2005 using texi2html