Fri, 14 Feb 2003 20:57:32 +0000
[gaim-migrate @ 4864]
put NAS sound support back in, and re-wrote a lot of the libao stuff
this should mostly put an end to people having to make a ~/.libao file
| 4561 | 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 | ||
| 4581 | 24 | #ifndef _GAIM_SOUND_H_ |
| 25 | #define _GAIM_SOUND_H_ | |
| 4561 | 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 | /** | |
| 4581 | 58 | * Lets the sound subsystem know when the sound output method has changed. |
| 4561 | 59 | */ |
| 4581 | 60 | void gaim_sound_change_output_method(); |
| 4561 | 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 | ||
| 4581 | 149 | #endif /* _GAIM_SOUND_H_ */ |