Fri, 31 Jan 2014 18:22:41 +0530
Initial replacements for this branch
| 4561 | 1 | /** |
| 2 | * @file sound.h Sound API | |
| 9938 | 3 | * @ingroup core |
|
20889
3d0ef192f98c
All the links to libpurple signal pages were in the comment containing the
Will Thompson <resiak@pidgin.im>
parents:
20147
diff
changeset
|
4 | * @see @ref sound-signals |
|
20147
66f05a854eee
applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
5 | */ |
|
66f05a854eee
applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
6 | |
|
66f05a854eee
applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
7 | /* purple |
| 4561 | 8 | * |
| 15884 | 9 | * Purple is the legal property of its developers, whose names are too numerous |
| 8046 | 10 | * to list here. Please refer to the COPYRIGHT file distributed with this |
| 11 | * source distribution. | |
| 4561 | 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 | |
|
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
|
25 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
| 4561 | 26 | */ |
| 15884 | 27 | #ifndef _PURPLE_SOUND_H_ |
| 28 | #define _PURPLE_SOUND_H_ | |
| 4561 | 29 | |
|
11642
76b60f0bf467
[gaim-migrate @ 13919]
Casey Harkins <charkins@pidgin.im>
parents:
10322
diff
changeset
|
30 | #include "account.h" |
|
76b60f0bf467
[gaim-migrate @ 13919]
Casey Harkins <charkins@pidgin.im>
parents:
10322
diff
changeset
|
31 | |
| 4561 | 32 | /**************************************************************************/ |
| 33 | /** Data Structures */ | |
| 34 | /**************************************************************************/ | |
| 35 | ||
| 36 | ||
| 37 | /** | |
| 5684 | 38 | * A type of sound. |
| 4561 | 39 | */ |
| 40 | ||
|
32206
a2c62b07ae5a
Please correct me if I'm wrong, but I don't think we gain anything
Mark Doliner <markdoliner@pidgin.im>
parents:
29489
diff
changeset
|
41 | typedef enum |
| 4561 | 42 | { |
| 15884 | 43 | PURPLE_SOUND_BUDDY_ARRIVE = 0, /**< Buddy signs on. */ |
| 44 | PURPLE_SOUND_BUDDY_LEAVE, /**< Buddy signs off. */ | |
| 45 | PURPLE_SOUND_RECEIVE, /**< Receive an IM. */ | |
| 46 | PURPLE_SOUND_FIRST_RECEIVE, /**< Receive an IM that starts a conv. */ | |
| 47 | PURPLE_SOUND_SEND, /**< Send an IM. */ | |
| 48 | PURPLE_SOUND_CHAT_JOIN, /**< Someone joins a chat. */ | |
| 49 | PURPLE_SOUND_CHAT_LEAVE, /**< Someone leaves a chat. */ | |
| 50 | PURPLE_SOUND_CHAT_YOU_SAY, /**< You say something in a chat. */ | |
| 51 | PURPLE_SOUND_CHAT_SAY, /**< Someone else says somthing in a chat. */ | |
| 52 | PURPLE_SOUND_POUNCE_DEFAULT, /**< Default sound for a buddy pounce. */ | |
| 53 | PURPLE_SOUND_CHAT_NICK, /**< Someone says your name in a chat. */ | |
|
24457
adbbdb0532b0
Adds attention UI to Pidgin (can send attentions using a menu item)
Marcus Lundblad <malu@pidgin.im>
parents:
23512
diff
changeset
|
54 | PURPLE_SOUND_GOT_ATTENTION, /**< Got an attention */ |
| 15884 | 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 | |
|
23512
b4cd56b9d709
add some trivial documentation to PurpleSoundUiOps
Will Thompson <resiak@pidgin.im>
parents:
20889
diff
changeset
|
59 | /** Operations used by the core to request that particular sound files, or the |
|
b4cd56b9d709
add some trivial documentation to PurpleSoundUiOps
Will Thompson <resiak@pidgin.im>
parents:
20889
diff
changeset
|
60 | * sound associated with a particular event, should be played. |
|
b4cd56b9d709
add some trivial documentation to PurpleSoundUiOps
Will Thompson <resiak@pidgin.im>
parents:
20889
diff
changeset
|
61 | */ |
| 15884 | 62 | typedef struct _PurpleSoundUiOps |
| 5684 | 63 | { |
| 64 | void (*init)(void); | |
|
10322
06e23196da4b
[gaim-migrate @ 11529]
Mark Doliner <markdoliner@pidgin.im>
parents:
9938
diff
changeset
|
65 | void (*uninit)(void); |
| 5684 | 66 | void (*play_file)(const char *filename); |
| 15884 | 67 | void (*play_event)(PurpleSoundEventID event); |
| 5684 | 68 | |
|
35024
eb3afb7643ce
Added /*< private >*/ for padding members, clean them up and add missing ones
Ankit Vani <a@nevitus.org>
parents:
32787
diff
changeset
|
69 | /*< private >*/ |
|
16743
1ce5ffe12e2a
Initial addition of padding for ui_ops and other class-like structs
Gary Kramlich <grim@reaperworld.com>
parents:
15884
diff
changeset
|
70 | 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
|
71 | 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
|
72 | 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
|
73 | void (*_purple_reserved4)(void); |
| 15884 | 74 | } PurpleSoundUiOps; |
| 5684 | 75 | |
|
32787
7072f190d6ad
Use G_BEGIN/END_DECLS in public libpurple files. This was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32206
diff
changeset
|
76 | G_BEGIN_DECLS |
|
5944
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5684
diff
changeset
|
77 | |
| 4561 | 78 | /**************************************************************************/ |
| 79 | /** @name Sound API */ | |
| 80 | /**************************************************************************/ | |
| 81 | /*@{*/ | |
| 82 | ||
| 83 | /** | |
|
10322
06e23196da4b
[gaim-migrate @ 11529]
Mark Doliner <markdoliner@pidgin.im>
parents:
9938
diff
changeset
|
84 | * Plays the specified sound file. |
|
06e23196da4b
[gaim-migrate @ 11529]
Mark Doliner <markdoliner@pidgin.im>
parents:
9938
diff
changeset
|
85 | * |
|
37034
9d6765962b22
Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents:
37023
diff
changeset
|
86 | * @filename: The file to play. |
|
9d6765962b22
Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents:
37023
diff
changeset
|
87 | * @account: The account that this sound is associated with, or |
|
11642
76b60f0bf467
[gaim-migrate @ 13919]
Casey Harkins <charkins@pidgin.im>
parents:
10322
diff
changeset
|
88 | * NULL if the sound is not associated with any specific |
|
76b60f0bf467
[gaim-migrate @ 13919]
Casey Harkins <charkins@pidgin.im>
parents:
10322
diff
changeset
|
89 | * account. This is needed for the "sounds while away?" |
|
76b60f0bf467
[gaim-migrate @ 13919]
Casey Harkins <charkins@pidgin.im>
parents:
10322
diff
changeset
|
90 | * preference to work correctly. |
|
10322
06e23196da4b
[gaim-migrate @ 11529]
Mark Doliner <markdoliner@pidgin.im>
parents:
9938
diff
changeset
|
91 | */ |
| 15884 | 92 | 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
|
93 | |
|
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 | * Plays the sound associated with the specified event. |
|
06e23196da4b
[gaim-migrate @ 11529]
Mark Doliner <markdoliner@pidgin.im>
parents:
9938
diff
changeset
|
96 | * |
|
37034
9d6765962b22
Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents:
37023
diff
changeset
|
97 | * @event: The event. |
|
9d6765962b22
Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents:
37023
diff
changeset
|
98 | * @account: The account that this sound is associated with, or |
|
11642
76b60f0bf467
[gaim-migrate @ 13919]
Casey Harkins <charkins@pidgin.im>
parents:
10322
diff
changeset
|
99 | * NULL if the sound is not associated with any specific |
|
76b60f0bf467
[gaim-migrate @ 13919]
Casey Harkins <charkins@pidgin.im>
parents:
10322
diff
changeset
|
100 | * account. This is needed for the "sounds while away?" |
|
76b60f0bf467
[gaim-migrate @ 13919]
Casey Harkins <charkins@pidgin.im>
parents:
10322
diff
changeset
|
101 | * preference to work correctly. |
|
10322
06e23196da4b
[gaim-migrate @ 11529]
Mark Doliner <markdoliner@pidgin.im>
parents:
9938
diff
changeset
|
102 | */ |
| 15884 | 103 | void purple_sound_play_event(PurpleSoundEventID event, const PurpleAccount *account); |
|
10322
06e23196da4b
[gaim-migrate @ 11529]
Mark Doliner <markdoliner@pidgin.im>
parents:
9938
diff
changeset
|
104 | |
|
06e23196da4b
[gaim-migrate @ 11529]
Mark Doliner <markdoliner@pidgin.im>
parents:
9938
diff
changeset
|
105 | /** |
| 5684 | 106 | * Sets the UI sound operations |
| 107 | * | |
|
37034
9d6765962b22
Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents:
37023
diff
changeset
|
108 | * @ops: The UI sound operations structure. |
| 4561 | 109 | */ |
| 15884 | 110 | void purple_sound_set_ui_ops(PurpleSoundUiOps *ops); |
| 4561 | 111 | |
| 112 | /** | |
| 5684 | 113 | * Gets the UI sound operations |
| 114 | * | |
|
37034
9d6765962b22
Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents:
37023
diff
changeset
|
115 | * Returns: The UI sound operations structure. |
| 4561 | 116 | */ |
| 15884 | 117 | PurpleSoundUiOps *purple_sound_get_ui_ops(void); |
| 5684 | 118 | |
| 119 | /** | |
| 120 | * Initializes the sound subsystem | |
| 121 | */ | |
| 15884 | 122 | void purple_sound_init(void); |
| 5684 | 123 | |
| 124 | /** | |
| 125 | * Shuts down the sound subsystem | |
| 126 | */ | |
| 15884 | 127 | void purple_sound_uninit(void); |
| 4561 | 128 | |
| 12291 | 129 | /** |
| 130 | * Returns the sound subsystem handle. | |
| 131 | * | |
|
37034
9d6765962b22
Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents:
37023
diff
changeset
|
132 | * Returns: The sound subsystem handle. |
| 12291 | 133 | */ |
| 15884 | 134 | void *purple_sounds_get_handle(void); |
| 12291 | 135 | |
| 4561 | 136 | /*@}*/ |
| 137 | ||
|
32787
7072f190d6ad
Use G_BEGIN/END_DECLS in public libpurple files. This was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32206
diff
changeset
|
138 | G_END_DECLS |
|
5944
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5684
diff
changeset
|
139 | |
| 15884 | 140 | #endif /* _PURPLE_SOUND_H_ */ |