Mercurial > pidgin
annotate src/sound.c @ 5781:c8837160add6
[gaim-migrate @ 6206]
I still think this looks better. Now that Sean put the icons next to the
screenname (didn't he just tell me that was a bad idea?), we can get the
Accounts dialog back into the design it used to be in.
committer: Tailor Script <tailor@pidgin.im>
author | Christian Hammond <chipx86@chipx86.com> |
---|---|
date | Sat, 07 Jun 2003 01:00:26 +0000 |
parents | b61520e71679 |
children | 059d95c67cda |
rev | line source |
---|---|
1 | 1 /* |
2 * gaim | |
3 * | |
4561 | 4 * Copyright (C) 2003, Nathan Walp <faceprint@faceprint.com> |
1 | 5 * |
6 * This program is free software; you can redistribute it and/or modify | |
7 * it under the terms of the GNU General Public License as published by | |
8 * the Free Software Foundation; either version 2 of the License, or | |
9 * (at your option) any later version. | |
10 * | |
11 * This program is distributed in the hope that it will be useful, | |
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 * GNU General Public License for more details. | |
15 * | |
16 * You should have received a copy of the GNU General Public License | |
17 * along with this program; if not, write to the Free Software | |
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
19 * | |
20 */ | |
21 | |
349
b402a23f35df
[gaim-migrate @ 359]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
22 #ifdef HAVE_CONFIG_H |
2090
b66aca8e8dce
[gaim-migrate @ 2100]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2048
diff
changeset
|
23 #include <config.h> |
349
b402a23f35df
[gaim-migrate @ 359]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
24 #endif |
3630 | 25 |
4561 | 26 #include "sound.h" |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5436
diff
changeset
|
27 #include "prefs.h" |
5684 | 28 #include "gaim.h" /* XXX: this goes away when away messages become sane */ |
1 | 29 |
4019
e53d9f9969d0
[gaim-migrate @ 4219]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4014
diff
changeset
|
30 #ifdef _WIN32 |
e53d9f9969d0
[gaim-migrate @ 4219]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4014
diff
changeset
|
31 #include "win32dep.h" |
e53d9f9969d0
[gaim-migrate @ 4219]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4014
diff
changeset
|
32 #endif |
e53d9f9969d0
[gaim-migrate @ 4219]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4014
diff
changeset
|
33 |
5684 | 34 static GaimSoundUiOps *sound_ui_ops = NULL; |
3319 | 35 |
5684 | 36 void gaim_set_sound_ui_ops(GaimSoundUiOps *ops) |
4430 | 37 { |
5684 | 38 if(sound_ui_ops && sound_ui_ops->shutdown) |
39 sound_ui_ops->shutdown(); | |
40 sound_ui_ops = ops; | |
41 if(sound_ui_ops && sound_ui_ops->init) | |
42 sound_ui_ops->init(); | |
4430 | 43 } |
44 | |
5684 | 45 GaimSoundUiOps *gaim_get_sound_ui_ops(void) |
4430 | 46 { |
5684 | 47 return sound_ui_ops; |
4581 | 48 } |
49 | |
5684 | 50 void gaim_sound_init() |
51 { | |
52 gaim_prefs_add_none("/core/sound"); | |
53 gaim_prefs_add_bool("/core/sound/while_away", FALSE); | |
54 } | |
4581 | 55 |
5684 | 56 void gaim_sound_shutdown() |
4430 | 57 { |
5684 | 58 if(sound_ui_ops && sound_ui_ops->shutdown) |
59 sound_ui_ops->shutdown(); | |
60 } | |
4430 | 61 |
5684 | 62 void gaim_sound_play_file(const char *filename) |
63 { | |
64 if(awaymessage && !gaim_prefs_get_bool("/core/sound/while_away")) | |
4561 | 65 return; |
4430 | 66 |
5684 | 67 if(sound_ui_ops && sound_ui_ops->play_file) |
68 sound_ui_ops->play_file(filename); | |
1006
0a4d0ed65e17
[gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
899
diff
changeset
|
69 } |
0a4d0ed65e17
[gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
899
diff
changeset
|
70 |
4561 | 71 void gaim_sound_play_event(GaimSoundEventID event) |
1 | 72 { |
5684 | 73 if(awaymessage && !gaim_prefs_get_bool("/core/sound/while_away")) |
4561 | 74 return; |
75 | |
5684 | 76 if(sound_ui_ops && sound_ui_ops->play_event) |
77 sound_ui_ops->play_event(event); | |
4561 | 78 } |