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