## empathy-sound

empathy-sound

## Synopsis

    enum                EmpathySound;
    gboolean            empathy_sound_play                  (GtkWidget *widget,
                                                             EmpathySound sound_id);
    void                empathy_sound_stop                  (EmpathySound sound_id);
    gboolean            empathy_sound_start_playing         (GtkWidget *widget,
                                                             EmpathySound sound_id,
                                                             guint timeout_before_replay);
    gboolean            empathy_sound_play_full             (GtkWidget *widget,
                                                             EmpathySound sound_id,
                                                             ca_finish_callback_t callback,
                                                             gpointer user_data);

## Description

## Details

### enum EmpathySound

    typedef enum {
    	EMPATHY_SOUND_MESSAGE_INCOMING = 0,
    	EMPATHY_SOUND_MESSAGE_OUTGOING,
    	EMPATHY_SOUND_CONVERSATION_NEW,
    	EMPATHY_SOUND_CONTACT_CONNECTED,
    	EMPATHY_SOUND_CONTACT_DISCONNECTED,
    	EMPATHY_SOUND_ACCOUNT_CONNECTED,
    	EMPATHY_SOUND_ACCOUNT_DISCONNECTED,
    	EMPATHY_SOUND_PHONE_INCOMING,
    	EMPATHY_SOUND_PHONE_OUTGOING,
    	EMPATHY_SOUND_PHONE_HANGUP,
    	LAST_EMPATHY_SOUND,
    } EmpathySound;

### empathy_sound_play ()

    gboolean            empathy_sound_play                  (GtkWidget *widget,
                                                             EmpathySound sound_id);

Plays a sound. See `empathy_sound_play_full` for details.'

`widget` : | The GtkWidget from which the sound is originating.
`sound_id` : | The EmpathySound to play.
Returns : | `TRUE` if the sound has successfully started playing, `FALSE` otherwise.

### empathy_sound_stop ()

    void                empathy_sound_stop                  (EmpathySound sound_id);

Stop playing a sound. If it has been stated in loop with `empathy_sound_start_playing()`, it will also stop replaying.

`sound_id` : | The EmpathySound to stop playing.

### empathy_sound_start_playing ()

    gboolean            empathy_sound_start_playing         (GtkWidget *widget,
                                                             EmpathySound sound_id,
                                                             guint timeout_before_replay);

Start playing a sound in loop. To stop the sound, call `empathy_call_stop()` by passing it the same `sound_id`. Note that if you start playing a sound multiple times, you'll have to call `empathy_sound_stop` the same number of times.

`widget` : | The GtkWidget from which the sound is originating.
`sound_id` : | The EmpathySound to play.
`timeout_before_replay` : | The amount of time, in milliseconds, between two consecutive play.
Returns : | `TRUE` if the sound has successfully started playing.

### empathy_sound_play_full ()

    gboolean            empathy_sound_play_full             (GtkWidget *widget,
                                                             EmpathySound sound_id,
                                                             ca_finish_callback_t callback,
                                                             gpointer user_data);

Plays a sound.

Returns `TRUE` if the sound has successfully started playing, otherwise returning `FALSE` and `callback` won't be called.

This function returns `FALSE` if the sound is already playing in loop using `empathy_sound_start_playing`.

This function returns `FALSE` if the sound is disabled in empathy preferences.

`widget` : | The GtkWidget from which the sound is originating.
`sound_id` : | The EmpathySound to play.
`callback` : | The ca_finish_callback_t function that will be called when the sound has stopped playing.
`user_data` : | user data to pass to the function.
Returns : | `TRUE` if the sound has successfully started playing, `FALSE` otherwise.