src/sound.c

Tue, 05 Aug 2003 10:55:04 +0000

author
Christian Hammond <chipx86@chipx86.com>
date
Tue, 05 Aug 2003 10:55:04 +0000
changeset 6371
e92b66ee5518
parent 5872
754c63f29b77
child 7035
76bca80cd91d
permissions
-rw-r--r--

[gaim-migrate @ 6876]
I think I touched almost every file. Here's what happened.

I started off fixing up the Makefile.am and configure.ac files to help with
the core/UI split some. Then I got annoyed with the
build_{allow,deny}_list() functions that everything used, and decided to
core/UI split privacy. While doing that, I decided to redesign the dialog.
So now, a lot has changed, but not really so much. Just that most files
got affected.

Oh yeah, and the UI stuff was taken out of internal.h and moved to
gtkinternal.h. If you use this, please be aware of this change.

1
efe077a7e70d [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1 /*
efe077a7e70d [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2 * gaim
efe077a7e70d [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3 *
4561
2a82628d7345 [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 4491
diff changeset
4 * Copyright (C) 2003, Nathan Walp <faceprint@faceprint.com>
1
efe077a7e70d [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
5 *
efe077a7e70d [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
6 * This program is free software; you can redistribute it and/or modify
efe077a7e70d [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
7 * it under the terms of the GNU General Public License as published by
efe077a7e70d [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
8 * the Free Software Foundation; either version 2 of the License, or
efe077a7e70d [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
9 * (at your option) any later version.
efe077a7e70d [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
10 *
efe077a7e70d [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
11 * This program is distributed in the hope that it will be useful,
efe077a7e70d [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
efe077a7e70d [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
efe077a7e70d [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
14 * GNU General Public License for more details.
efe077a7e70d [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
15 *
efe077a7e70d [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
16 * You should have received a copy of the GNU General Public License
efe077a7e70d [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
17 * along with this program; if not, write to the Free Software
efe077a7e70d [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
efe077a7e70d [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
19 *
efe077a7e70d [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
20 */
5872
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5684
diff changeset
21 #include "internal.h"
3630
caa952062dc2 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3367
diff changeset
22
4561
2a82628d7345 [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 4491
diff changeset
23 #include "sound.h"
5545
a8b1a1262402 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5436
diff changeset
24 #include "prefs.h"
1
efe077a7e70d [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
25
6371
e92b66ee5518 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents: 5872
diff changeset
26 /* XXX CORE/UI: this goes away when away messages become sane */
e92b66ee5518 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents: 5872
diff changeset
27 #include "gtkinternal.h"
5872
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5684
diff changeset
28 #include "ui.h"
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5684
diff changeset
29
4019
450d7e314aea [gaim-migrate @ 4219]
Herman Bloggs <herman@bluedigits.com>
parents: 4014
diff changeset
30
5684
10b916deb20c [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5612
diff changeset
31 static GaimSoundUiOps *sound_ui_ops = NULL;
3319
620cde89665a [gaim-migrate @ 3337]
Sean Egan <seanegan@pidgin.im>
parents: 3284
diff changeset
32
5684
10b916deb20c [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5612
diff changeset
33 void gaim_set_sound_ui_ops(GaimSoundUiOps *ops)
4430
95df701e8cdf [gaim-migrate @ 4705]
Robert McQueen <robot101@debian.org>
parents: 4429
diff changeset
34 {
5684
10b916deb20c [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5612
diff changeset
35 if(sound_ui_ops && sound_ui_ops->shutdown)
10b916deb20c [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5612
diff changeset
36 sound_ui_ops->shutdown();
10b916deb20c [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5612
diff changeset
37 sound_ui_ops = ops;
10b916deb20c [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5612
diff changeset
38 if(sound_ui_ops && sound_ui_ops->init)
10b916deb20c [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5612
diff changeset
39 sound_ui_ops->init();
4430
95df701e8cdf [gaim-migrate @ 4705]
Robert McQueen <robot101@debian.org>
parents: 4429
diff changeset
40 }
95df701e8cdf [gaim-migrate @ 4705]
Robert McQueen <robot101@debian.org>
parents: 4429
diff changeset
41
5684
10b916deb20c [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5612
diff changeset
42 GaimSoundUiOps *gaim_get_sound_ui_ops(void)
4430
95df701e8cdf [gaim-migrate @ 4705]
Robert McQueen <robot101@debian.org>
parents: 4429
diff changeset
43 {
5684
10b916deb20c [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5612
diff changeset
44 return sound_ui_ops;
4581
f6dc4d97a8af [gaim-migrate @ 4864]
Nathan Walp <nwalp@pidgin.im>
parents: 4579
diff changeset
45 }
f6dc4d97a8af [gaim-migrate @ 4864]
Nathan Walp <nwalp@pidgin.im>
parents: 4579
diff changeset
46
5684
10b916deb20c [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5612
diff changeset
47 void gaim_sound_init()
10b916deb20c [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5612
diff changeset
48 {
10b916deb20c [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5612
diff changeset
49 gaim_prefs_add_none("/core/sound");
10b916deb20c [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5612
diff changeset
50 gaim_prefs_add_bool("/core/sound/while_away", FALSE);
10b916deb20c [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5612
diff changeset
51 }
4581
f6dc4d97a8af [gaim-migrate @ 4864]
Nathan Walp <nwalp@pidgin.im>
parents: 4579
diff changeset
52
5684
10b916deb20c [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5612
diff changeset
53 void gaim_sound_shutdown()
4430
95df701e8cdf [gaim-migrate @ 4705]
Robert McQueen <robot101@debian.org>
parents: 4429
diff changeset
54 {
5684
10b916deb20c [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5612
diff changeset
55 if(sound_ui_ops && sound_ui_ops->shutdown)
10b916deb20c [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5612
diff changeset
56 sound_ui_ops->shutdown();
10b916deb20c [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5612
diff changeset
57 }
4430
95df701e8cdf [gaim-migrate @ 4705]
Robert McQueen <robot101@debian.org>
parents: 4429
diff changeset
58
5684
10b916deb20c [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5612
diff changeset
59 void gaim_sound_play_file(const char *filename)
10b916deb20c [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5612
diff changeset
60 {
10b916deb20c [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5612
diff changeset
61 if(awaymessage && !gaim_prefs_get_bool("/core/sound/while_away"))
4561
2a82628d7345 [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 4491
diff changeset
62 return;
4430
95df701e8cdf [gaim-migrate @ 4705]
Robert McQueen <robot101@debian.org>
parents: 4429
diff changeset
63
5684
10b916deb20c [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5612
diff changeset
64 if(sound_ui_ops && sound_ui_ops->play_file)
10b916deb20c [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5612
diff changeset
65 sound_ui_ops->play_file(filename);
1006
fb2f2a403962 [gaim-migrate @ 1016]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents: 899
diff changeset
66 }
fb2f2a403962 [gaim-migrate @ 1016]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents: 899
diff changeset
67
4561
2a82628d7345 [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 4491
diff changeset
68 void gaim_sound_play_event(GaimSoundEventID event)
1
efe077a7e70d [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
69 {
5684
10b916deb20c [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5612
diff changeset
70 if(awaymessage && !gaim_prefs_get_bool("/core/sound/while_away"))
4561
2a82628d7345 [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 4491
diff changeset
71 return;
2a82628d7345 [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 4491
diff changeset
72
5684
10b916deb20c [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5612
diff changeset
73 if(sound_ui_ops && sound_ui_ops->play_event)
10b916deb20c [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5612
diff changeset
74 sound_ui_ops->play_event(event);
4561
2a82628d7345 [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 4491
diff changeset
75 }

mercurial