2 * @file sound.h Sound API
6 * Copyright (C) 2003, Nathan Walp <faceprint@faceprint.com>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 #ifndef _GAIM_SOUND_H_
25 #define _GAIM_SOUND_H_
27 /**************************************************************************/
28 /** Data Structures */
29 /**************************************************************************/
33 * A type of conversation.
36 typedef enum _GaimSoundEventID
38 GAIM_SOUND_BUDDY_ARRIVE
= 0, /**< Buddy signs on. */
39 GAIM_SOUND_BUDDY_LEAVE
, /**< Buddy signs off. */
40 GAIM_SOUND_RECEIVE
, /**< Receive an IM. */
41 GAIM_SOUND_FIRST_RECEIVE
, /**< Receive an IM that starts a conv. */
42 GAIM_SOUND_SEND
, /**< Send an IM. */
43 GAIM_SOUND_CHAT_JOIN
, /**< Someone joins a chat. */
44 GAIM_SOUND_CHAT_LEAVE
, /**< Someone leaves a chat. */
45 GAIM_SOUND_CHAT_YOU_SAY
, /**< You say something in a chat. */
46 GAIM_SOUND_CHAT_SAY
, /**< Someone else says somthing in a chat. */
47 GAIM_SOUND_POUNCE_DEFAULT
, /**< Default sound for a buddy pounce. */
48 GAIM_SOUND_CHAT_NICK
, /**< Someone says your name in a chat. */
49 GAIM_NUM_SOUNDS
/**< Total number of sounds. */
52 /**************************************************************************/
53 /** @name Sound API */
54 /**************************************************************************/
58 * Lets the sound subsystem know when the sound output method has changed.
60 void gaim_sound_change_output_method();
63 * Properly shuts down the sound system.
65 void gaim_sound_quit();
68 * Plays the specified sound file.
70 * @param filename The file to play.
72 void gaim_sound_play_file(char *filename
);
75 * Plays the sound associated with the specified event.
77 * @param event The event.
79 void gaim_sound_play_event(GaimSoundEventID event
);
82 * Mutes or un-mutes sounds.
84 * @param mute The mute state.
86 void gaim_sound_set_mute(gboolean mute
);
89 * Gets mute state for sounds.
91 * @return The mute state.
93 gboolean
gaim_sound_get_mute();
96 * Mutes or un-mutes login sounds.
98 * @param mute The mute state.
100 void gaim_sound_set_login_mute(gboolean mute
);
103 * Set sound file for an event.
105 * @param event The event.
106 * @param filename The sound file.
108 void gaim_sound_set_event_file(GaimSoundEventID event
, const char *filename
);
110 /** Get sound file for an event.
112 * @param event The event.
113 * @return The filename if set, otherwise @c NULL.
115 char *gaim_sound_get_event_file(GaimSoundEventID event
);
118 * Get the prefs option for an event.
120 * @param event The event.
121 * @return The option.
123 guint
gaim_sound_get_event_option(GaimSoundEventID event
);
126 * Get the label for an event.
128 * @param event The event.
131 char *gaim_sound_get_event_label(GaimSoundEventID event
);
134 * Set sound command for command mode.
136 * @param cmd The command.
138 void gaim_sound_set_command(const char *cmd
);
141 * Get sound command for command mode.
143 * @return The command if set, otherwise @c NULL.
145 char *gaim_sound_get_command();
149 #endif /* _GAIM_SOUND_H_ */