Tue, 18 Sep 2007 16:32:46 +0000
merge of 'bc4b48f6fbaaf411c3e9245a9d0e3f22d763aacf'
and 'f7a11b4aef9753768661d36921787fad7693ad43'
| 4561 | 1 | /** |
| 2 | * @file sound.h Sound API | |
| 9938 | 3 | * @ingroup core |
|
20330
650a7af9c238
remove gpl boilerplate from doxygen docs
Sean Egan <seanegan@pidgin.im>
parents:
19859
diff
changeset
|
4 | */ |
|
650a7af9c238
remove gpl boilerplate from doxygen docs
Sean Egan <seanegan@pidgin.im>
parents:
19859
diff
changeset
|
5 | |
|
650a7af9c238
remove gpl boilerplate from doxygen docs
Sean Egan <seanegan@pidgin.im>
parents:
19859
diff
changeset
|
6 | /* purple |
| 4561 | 7 | * |
| 15884 | 8 | * Purple is the legal property of its developers, whose names are too numerous |
| 8046 | 9 | * to list here. Please refer to the COPYRIGHT file distributed with this |
| 10 | * source distribution. | |
| 4561 | 11 | * |
| 12 | * This program is free software; you can redistribute it and/or modify | |
| 13 | * it under the terms of the GNU General Public License as published by | |
| 14 | * the Free Software Foundation; either version 2 of the License, or | |
| 15 | * (at your option) any later version. | |
| 16 | * | |
| 17 | * This program is distributed in the hope that it will be useful, | |
| 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 20 | * GNU General Public License for more details. | |
| 21 | * | |
| 22 | * You should have received a copy of the GNU General Public License | |
| 23 | * along with this program; if not, write to the Free Software | |
|
19859
71d37b57eff2
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
18412
diff
changeset
|
24 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
|
18412
6873322c380f
Add links to the signal documents in the API documents.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16743
diff
changeset
|
25 | * |
|
6873322c380f
Add links to the signal documents in the API documents.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16743
diff
changeset
|
26 | * @see @ref sound-signals |
| 4561 | 27 | */ |
| 15884 | 28 | #ifndef _PURPLE_SOUND_H_ |
| 29 | #define _PURPLE_SOUND_H_ | |
| 4561 | 30 | |
|
11642
76b60f0bf467
[gaim-migrate @ 13919]
Casey Harkins <charkins@pidgin.im>
parents:
10322
diff
changeset
|
31 | #include "account.h" |
|
76b60f0bf467
[gaim-migrate @ 13919]
Casey Harkins <charkins@pidgin.im>
parents:
10322
diff
changeset
|
32 | |
| 4561 | 33 | /**************************************************************************/ |
| 34 | /** Data Structures */ | |
| 35 | /**************************************************************************/ | |
| 36 | ||
| 37 | ||
| 38 | /** | |
| 5684 | 39 | * A type of sound. |
| 4561 | 40 | */ |
| 41 | ||
| 15884 | 42 | typedef enum _PurpleSoundEventID |
| 4561 | 43 | { |
| 15884 | 44 | PURPLE_SOUND_BUDDY_ARRIVE = 0, /**< Buddy signs on. */ |
| 45 | PURPLE_SOUND_BUDDY_LEAVE, /**< Buddy signs off. */ | |
| 46 | PURPLE_SOUND_RECEIVE, /**< Receive an IM. */ | |
| 47 | PURPLE_SOUND_FIRST_RECEIVE, /**< Receive an IM that starts a conv. */ | |
| 48 | PURPLE_SOUND_SEND, /**< Send an IM. */ | |
| 49 | PURPLE_SOUND_CHAT_JOIN, /**< Someone joins a chat. */ | |
| 50 | PURPLE_SOUND_CHAT_LEAVE, /**< Someone leaves a chat. */ | |
| 51 | PURPLE_SOUND_CHAT_YOU_SAY, /**< You say something in a chat. */ | |
| 52 | PURPLE_SOUND_CHAT_SAY, /**< Someone else says somthing in a chat. */ | |
| 53 | PURPLE_SOUND_POUNCE_DEFAULT, /**< Default sound for a buddy pounce. */ | |
| 54 | PURPLE_SOUND_CHAT_NICK, /**< Someone says your name in a chat. */ | |
| 55 | PURPLE_NUM_SOUNDS /**< Total number of sounds. */ | |
|
5944
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5684
diff
changeset
|
56 | |
| 15884 | 57 | } PurpleSoundEventID; |
| 4561 | 58 | |
| 15884 | 59 | typedef struct _PurpleSoundUiOps |
| 5684 | 60 | { |
| 61 | void (*init)(void); | |
|
10322
06e23196da4b
[gaim-migrate @ 11529]
Mark Doliner <markdoliner@pidgin.im>
parents:
9938
diff
changeset
|
62 | void (*uninit)(void); |
| 5684 | 63 | void (*play_file)(const char *filename); |
| 15884 | 64 | void (*play_event)(PurpleSoundEventID event); |
| 5684 | 65 | |
|
16743
1ce5ffe12e2a
Initial addition of padding for ui_ops and other class-like structs
Gary Kramlich <grim@reaperworld.com>
parents:
15884
diff
changeset
|
66 | void (*_purple_reserved1)(void); |
|
1ce5ffe12e2a
Initial addition of padding for ui_ops and other class-like structs
Gary Kramlich <grim@reaperworld.com>
parents:
15884
diff
changeset
|
67 | void (*_purple_reserved2)(void); |
|
1ce5ffe12e2a
Initial addition of padding for ui_ops and other class-like structs
Gary Kramlich <grim@reaperworld.com>
parents:
15884
diff
changeset
|
68 | void (*_purple_reserved3)(void); |
|
1ce5ffe12e2a
Initial addition of padding for ui_ops and other class-like structs
Gary Kramlich <grim@reaperworld.com>
parents:
15884
diff
changeset
|
69 | void (*_purple_reserved4)(void); |
| 15884 | 70 | } PurpleSoundUiOps; |
| 5684 | 71 | |
|
5944
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5684
diff
changeset
|
72 | #ifdef __cplusplus |
|
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5684
diff
changeset
|
73 | extern "C" { |
|
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5684
diff
changeset
|
74 | #endif |
|
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5684
diff
changeset
|
75 | |
| 4561 | 76 | /**************************************************************************/ |
| 77 | /** @name Sound API */ | |
| 78 | /**************************************************************************/ | |
| 79 | /*@{*/ | |
| 80 | ||
| 81 | /** | |
|
10322
06e23196da4b
[gaim-migrate @ 11529]
Mark Doliner <markdoliner@pidgin.im>
parents:
9938
diff
changeset
|
82 | * Plays the specified sound file. |
|
06e23196da4b
[gaim-migrate @ 11529]
Mark Doliner <markdoliner@pidgin.im>
parents:
9938
diff
changeset
|
83 | * |
|
06e23196da4b
[gaim-migrate @ 11529]
Mark Doliner <markdoliner@pidgin.im>
parents:
9938
diff
changeset
|
84 | * @param filename The file to play. |
|
11642
76b60f0bf467
[gaim-migrate @ 13919]
Casey Harkins <charkins@pidgin.im>
parents:
10322
diff
changeset
|
85 | * @param account The account that this sound is associated with, or |
|
76b60f0bf467
[gaim-migrate @ 13919]
Casey Harkins <charkins@pidgin.im>
parents:
10322
diff
changeset
|
86 | * NULL if the sound is not associated with any specific |
|
76b60f0bf467
[gaim-migrate @ 13919]
Casey Harkins <charkins@pidgin.im>
parents:
10322
diff
changeset
|
87 | * account. This is needed for the "sounds while away?" |
|
76b60f0bf467
[gaim-migrate @ 13919]
Casey Harkins <charkins@pidgin.im>
parents:
10322
diff
changeset
|
88 | * preference to work correctly. |
|
10322
06e23196da4b
[gaim-migrate @ 11529]
Mark Doliner <markdoliner@pidgin.im>
parents:
9938
diff
changeset
|
89 | */ |
| 15884 | 90 | void purple_sound_play_file(const char *filename, const PurpleAccount *account); |
|
10322
06e23196da4b
[gaim-migrate @ 11529]
Mark Doliner <markdoliner@pidgin.im>
parents:
9938
diff
changeset
|
91 | |
|
06e23196da4b
[gaim-migrate @ 11529]
Mark Doliner <markdoliner@pidgin.im>
parents:
9938
diff
changeset
|
92 | /** |
|
06e23196da4b
[gaim-migrate @ 11529]
Mark Doliner <markdoliner@pidgin.im>
parents:
9938
diff
changeset
|
93 | * Plays the sound associated with the specified event. |
|
06e23196da4b
[gaim-migrate @ 11529]
Mark Doliner <markdoliner@pidgin.im>
parents:
9938
diff
changeset
|
94 | * |
|
06e23196da4b
[gaim-migrate @ 11529]
Mark Doliner <markdoliner@pidgin.im>
parents:
9938
diff
changeset
|
95 | * @param event The event. |
|
11642
76b60f0bf467
[gaim-migrate @ 13919]
Casey Harkins <charkins@pidgin.im>
parents:
10322
diff
changeset
|
96 | * @param account The account that this sound is associated with, or |
|
76b60f0bf467
[gaim-migrate @ 13919]
Casey Harkins <charkins@pidgin.im>
parents:
10322
diff
changeset
|
97 | * NULL if the sound is not associated with any specific |
|
76b60f0bf467
[gaim-migrate @ 13919]
Casey Harkins <charkins@pidgin.im>
parents:
10322
diff
changeset
|
98 | * account. This is needed for the "sounds while away?" |
|
76b60f0bf467
[gaim-migrate @ 13919]
Casey Harkins <charkins@pidgin.im>
parents:
10322
diff
changeset
|
99 | * preference to work correctly. |
|
10322
06e23196da4b
[gaim-migrate @ 11529]
Mark Doliner <markdoliner@pidgin.im>
parents:
9938
diff
changeset
|
100 | */ |
| 15884 | 101 | void purple_sound_play_event(PurpleSoundEventID event, const PurpleAccount *account); |
|
10322
06e23196da4b
[gaim-migrate @ 11529]
Mark Doliner <markdoliner@pidgin.im>
parents:
9938
diff
changeset
|
102 | |
|
06e23196da4b
[gaim-migrate @ 11529]
Mark Doliner <markdoliner@pidgin.im>
parents:
9938
diff
changeset
|
103 | /** |
| 5684 | 104 | * Sets the UI sound operations |
| 105 | * | |
| 106 | * @param ops The UI sound operations structure. | |
| 4561 | 107 | */ |
| 15884 | 108 | void purple_sound_set_ui_ops(PurpleSoundUiOps *ops); |
| 4561 | 109 | |
| 110 | /** | |
| 5684 | 111 | * Gets the UI sound operations |
| 112 | * | |
| 113 | * @return The UI sound operations structure. | |
| 4561 | 114 | */ |
| 15884 | 115 | PurpleSoundUiOps *purple_sound_get_ui_ops(void); |
| 5684 | 116 | |
| 117 | /** | |
| 118 | * Initializes the sound subsystem | |
| 119 | */ | |
| 15884 | 120 | void purple_sound_init(void); |
| 5684 | 121 | |
| 122 | /** | |
| 123 | * Shuts down the sound subsystem | |
| 124 | */ | |
| 15884 | 125 | void purple_sound_uninit(void); |
| 4561 | 126 | |
| 12291 | 127 | /** |
| 128 | * Returns the sound subsystem handle. | |
| 129 | * | |
| 130 | * @return The sound subsystem handle. | |
| 131 | */ | |
| 15884 | 132 | void *purple_sounds_get_handle(void); |
| 12291 | 133 | |
| 4561 | 134 | /*@}*/ |
| 135 | ||
|
5944
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5684
diff
changeset
|
136 | #ifdef __cplusplus |
|
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5684
diff
changeset
|
137 | } |
|
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5684
diff
changeset
|
138 | #endif |
|
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5684
diff
changeset
|
139 | |
| 15884 | 140 | #endif /* _PURPLE_SOUND_H_ */ |