Fri, 20 Jun 2003 05:40:49 +0000
[gaim-migrate @ 6369]
Bah, thought I committed this, but I guess SourceForge disconnected on me.
Anyhow, this greys out the Insert Image button on the toolbar on
conversation windows when the protocol doesn't support them or when in a
chat.
| 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 | ||
| 4581 | 23 | #ifndef _GAIM_SOUND_H_ |
| 24 | #define _GAIM_SOUND_H_ | |
| 4561 | 25 | |
| 26 | /**************************************************************************/ | |
| 27 | /** Data Structures */ | |
| 28 | /**************************************************************************/ | |
| 29 | ||
| 30 | ||
| 31 | /** | |
| 5684 | 32 | * A type of sound. |
| 4561 | 33 | */ |
| 34 | ||
| 35 | typedef enum _GaimSoundEventID | |
| 36 | { | |
| 37 | GAIM_SOUND_BUDDY_ARRIVE = 0, /**< Buddy signs on. */ | |
| 38 | GAIM_SOUND_BUDDY_LEAVE, /**< Buddy signs off. */ | |
| 39 | GAIM_SOUND_RECEIVE, /**< Receive an IM. */ | |
| 40 | GAIM_SOUND_FIRST_RECEIVE, /**< Receive an IM that starts a conv. */ | |
| 41 | GAIM_SOUND_SEND, /**< Send an IM. */ | |
| 42 | GAIM_SOUND_CHAT_JOIN, /**< Someone joins a chat. */ | |
| 43 | GAIM_SOUND_CHAT_LEAVE, /**< Someone leaves a chat. */ | |
| 44 | GAIM_SOUND_CHAT_YOU_SAY, /**< You say something in a chat. */ | |
| 45 | GAIM_SOUND_CHAT_SAY, /**< Someone else says somthing in a chat. */ | |
| 46 | GAIM_SOUND_POUNCE_DEFAULT, /**< Default sound for a buddy pounce. */ | |
| 47 | GAIM_SOUND_CHAT_NICK, /**< Someone says your name in a chat. */ | |
| 48 | GAIM_NUM_SOUNDS /**< Total number of sounds. */ | |
| 49 | } GaimSoundEventID; | |
| 50 | ||
| 5684 | 51 | typedef struct _GaimSoundUiOps |
| 52 | { | |
| 53 | void (*init)(void); | |
| 54 | void (*shutdown)(void); | |
| 55 | void (*play_file)(const char *filename); | |
| 56 | void (*play_event)(GaimSoundEventID event); | |
| 57 | ||
| 58 | } GaimSoundUiOps; | |
| 59 | ||
| 4561 | 60 | /**************************************************************************/ |
| 61 | /** @name Sound API */ | |
| 62 | /**************************************************************************/ | |
| 63 | /*@{*/ | |
| 64 | ||
| 65 | /** | |
| 5684 | 66 | * Sets the UI sound operations |
| 67 | * | |
| 68 | * @param ops The UI sound operations structure. | |
| 4561 | 69 | */ |
| 5684 | 70 | void gaim_set_sound_ui_ops(GaimSoundUiOps *ops); |
| 4561 | 71 | |
| 72 | /** | |
| 5684 | 73 | * Gets the UI sound operations |
| 74 | * | |
| 75 | * @return The UI sound operations structure. | |
| 4561 | 76 | */ |
| 5684 | 77 | GaimSoundUiOps *gaim_get_sound_ui_ops(void); |
| 78 | ||
| 79 | /** | |
| 80 | * Initializes the sound subsystem | |
| 81 | */ | |
| 82 | void gaim_sound_init(void); | |
| 83 | ||
| 84 | /** | |
| 85 | * Shuts down the sound subsystem | |
| 86 | */ | |
| 87 | void gaim_sound_shutdown(void); | |
| 4561 | 88 | |
| 89 | /** | |
| 90 | * Plays the specified sound file. | |
| 91 | * | |
| 92 | * @param filename The file to play. | |
| 93 | */ | |
| 5684 | 94 | void gaim_sound_play_file(const char *filename); |
| 4561 | 95 | |
| 96 | /** | |
| 97 | * Plays the sound associated with the specified event. | |
| 98 | * | |
| 99 | * @param event The event. | |
| 100 | */ | |
| 101 | void gaim_sound_play_event(GaimSoundEventID event); | |
| 102 | ||
| 103 | /*@}*/ | |
| 104 | ||
| 4581 | 105 | #endif /* _GAIM_SOUND_H_ */ |