comparison src/sound.h @ 4561:9df99116840a

[gaim-migrate @ 4842] This is the new sound subsystem Lots of stuff got renamed, and everything sound-wise is documented. Gaim now uses libaudiofile and libao to play sounds. Lots of ugly hacks were removed, and now we support playing audio through anything that libao will support. If you need to (you shouldn't) you can force libao to use a specific output driver, by putting a line into ~/.libao like: default_driver=esd You shouldn't need to do this, libao is pretty good at figuring out what driver to use. committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Sun, 09 Feb 2003 01:55:35 +0000
parents
children 2c8372d4fb2a
comparison
equal deleted inserted replaced
4560:eb32b3acef97 4561:9df99116840a
1 /**
2 * @file sound.h Sound API
3 *
4 * gaim
5 *
6 * Copyright (C) 2003, Nathan Walp <faceprint@faceprint.com>
7 *
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.
12 *
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.
17 *
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
21 *
22 */
23
24 #ifndef _SOUND_H_
25 #define _SOUND_H_
26
27 /**************************************************************************/
28 /** Data Structures */
29 /**************************************************************************/
30
31
32 /**
33 * A type of conversation.
34 */
35
36 typedef enum _GaimSoundEventID
37 {
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. */
50 } GaimSoundEventID;
51
52 /**************************************************************************/
53 /** @name Sound API */
54 /**************************************************************************/
55 /*@{*/
56
57 /**
58 * Sets up the sound system.
59 */
60 void gaim_sound_init();
61
62 /**
63 * Properly shuts down the sound system.
64 */
65 void gaim_sound_quit();
66
67 /**
68 * Plays the specified sound file.
69 *
70 * @param filename The file to play.
71 */
72 void gaim_sound_play_file(char *filename);
73
74 /**
75 * Plays the sound associated with the specified event.
76 *
77 * @param event The event.
78 */
79 void gaim_sound_play_event(GaimSoundEventID event);
80
81 /**
82 * Mutes or un-mutes sounds.
83 *
84 * @param mute The mute state.
85 */
86 void gaim_sound_set_mute(gboolean mute);
87
88 /**
89 * Gets mute state for sounds.
90 *
91 * @return The mute state.
92 */
93 gboolean gaim_sound_get_mute();
94
95 /**
96 * Mutes or un-mutes login sounds.
97 *
98 * @param mute The mute state.
99 */
100 void gaim_sound_set_login_mute(gboolean mute);
101
102 /**
103 * Set sound file for an event.
104 *
105 * @param event The event.
106 * @param filename The sound file.
107 */
108 void gaim_sound_set_event_file(GaimSoundEventID event, const char *filename);
109
110 /** Get sound file for an event.
111 *
112 * @param event The event.
113 * @return The filename if set, otherwise @c NULL.
114 */
115 char *gaim_sound_get_event_file(GaimSoundEventID event);
116
117 /**
118 * Get the prefs option for an event.
119 *
120 * @param event The event.
121 * @return The option.
122 */
123 guint gaim_sound_get_event_option(GaimSoundEventID event);
124
125 /**
126 * Get the label for an event.
127 *
128 * @param event The event.
129 * @return The label.
130 */
131 char *gaim_sound_get_event_label(GaimSoundEventID event);
132
133 /**
134 * Set sound command for command mode.
135 *
136 * @param cmd The command.
137 */
138 void gaim_sound_set_command(const char *cmd);
139
140 /**
141 * Get sound command for command mode.
142 *
143 * @return The command if set, otherwise @c NULL.
144 */
145 char *gaim_sound_get_command();
146
147 /*@}*/
148
149 #endif /* _CONVERSATION_H_ */