sound.h
Go to the documentation of this file.
1
7 /* purple
8 *
9 * Purple is the legal property of its developers, whose names are too numerous
10 * to list here. Please refer to the COPYRIGHT file distributed with this
11 * source distribution.
12 *
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2 of the License, or
16 * (at your option) any later version.
17 *
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
22 *
23 * You should have received a copy of the GNU General Public License
24 * along with this program; if not, write to the Free Software
25 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
26 */
27 #ifndef _PURPLE_SOUND_H_
28 #define _PURPLE_SOUND_H_
29
30 #include "account.h"
31
32 /**************************************************************************/
34 /**************************************************************************/
35
36
41 typedef enum _PurpleSoundEventID
42 {
43 PURPLE_SOUND_BUDDY_ARRIVE = 0,
44 PURPLE_SOUND_BUDDY_LEAVE,
45 PURPLE_SOUND_RECEIVE,
46 PURPLE_SOUND_FIRST_RECEIVE,
47 PURPLE_SOUND_SEND,
48 PURPLE_SOUND_CHAT_JOIN,
49 PURPLE_SOUND_CHAT_LEAVE,
50 PURPLE_SOUND_CHAT_YOU_SAY,
51 PURPLE_SOUND_CHAT_SAY,
52 PURPLE_SOUND_POUNCE_DEFAULT,
53 PURPLE_SOUND_CHAT_NICK,
54 PURPLE_SOUND_GOT_ATTENTION,
55 PURPLE_NUM_SOUNDS
57 } PurpleSoundEventID;
58
62 typedef struct _PurpleSoundUiOps
63 {
64 void (*init)(void);
65 void (*uninit)(void);
66 void (*play_file)(const char *filename);
67 void (*play_event)(PurpleSoundEventID event);
68
69 void (*_purple_reserved1)(void);
70 void (*_purple_reserved2)(void);
71 void (*_purple_reserved3)(void);
72 void (*_purple_reserved4)(void);
73 } PurpleSoundUiOps;
74
75 #ifdef __cplusplus
76 extern "C" {
77 #endif
78
79 /**************************************************************************/
81 /**************************************************************************/
93 void purple_sound_play_file(const char *filename, const PurpleAccount *account);
94
104 void purple_sound_play_event(PurpleSoundEventID event, const PurpleAccount *account);
105
111 void purple_sound_set_ui_ops(PurpleSoundUiOps *ops);
112
118 PurpleSoundUiOps *purple_sound_get_ui_ops(void);
119
123 void purple_sound_init(void);
124
128 void purple_sound_uninit(void);
129
135 void *purple_sounds_get_handle(void);
136
139 #ifdef __cplusplus
140 }
141 #endif
142
143 #endif /* _PURPLE_SOUND_H_ */
PURPLE_SOUND_POUNCE_DEFAULT
Default sound for a buddy pounce.
Definition: sound.h:52
PurpleSoundUiOps
struct _PurpleSoundUiOps PurpleSoundUiOps
Operations used by the core to request that particular sound files, or the sound associated with a pa...
PURPLE_SOUND_RECEIVE
Receive an IM.
Definition: sound.h:45
purple_sounds_get_handle
void * purple_sounds_get_handle(void)
Returns the sound subsystem handle.
PURPLE_SOUND_BUDDY_ARRIVE
Buddy signs on.
Definition: sound.h:43
PURPLE_SOUND_CHAT_LEAVE
Someone leaves a chat.
Definition: sound.h:49
_PurpleAccount
Structure representing an account.
Definition: account.h:169
PURPLE_NUM_SOUNDS
Total number of sounds.
Definition: sound.h:55
PURPLE_SOUND_CHAT_YOU_SAY
You say something in a chat.
Definition: sound.h:50
_PurpleSoundEventID
_PurpleSoundEventID
Data Structures.
Definition: sound.h:41
purple_sound_play_event
void purple_sound_play_event(PurpleSoundEventID event, const PurpleAccount *account)
Plays the sound associated with the specified event.
_PurpleSoundUiOps
Operations used by the core to request that particular sound files, or the sound associated with a pa...
Definition: sound.h:62
purple_sound_init
void purple_sound_init(void)
Initializes the sound subsystem.
PURPLE_SOUND_GOT_ATTENTION
Got an attention.
Definition: sound.h:54
PURPLE_SOUND_CHAT_JOIN
Someone joins a chat.
Definition: sound.h:48
PURPLE_SOUND_FIRST_RECEIVE
Receive an IM that starts a conv.
Definition: sound.h:46
purple_sound_get_ui_ops
PurpleSoundUiOps * purple_sound_get_ui_ops(void)
Gets the UI sound operations.
PURPLE_SOUND_CHAT_NICK
Someone says your name in a chat.
Definition: sound.h:53
account.h
Account API.
purple_sound_set_ui_ops
void purple_sound_set_ui_ops(PurpleSoundUiOps *ops)
Sets the UI sound operations.
purple_sound_play_file
void purple_sound_play_file(const char *filename, const PurpleAccount *account)
Plays the specified sound file.
PURPLE_SOUND_SEND
Send an IM.
Definition: sound.h:47
PurpleSoundEventID
enum _PurpleSoundEventID PurpleSoundEventID
Data Structures.
PURPLE_SOUND_CHAT_SAY
Someone else says somthing in a chat.
Definition: sound.h:51
purple_sound_uninit
void purple_sound_uninit(void)
Shuts down the sound subsystem.
PURPLE_SOUND_BUDDY_LEAVE
Buddy signs off.
Definition: sound.h:44