annotate src/gtksound.c @ 10629:d93621a98f12

[gaim-migrate @ 12106] This was removed when changes were made to specify that the http:// handler should open the file. Judging by the number of bug reports, it is still necessary. committer: Tailor Script <tailor@pidgin.im>
author Daniel Atallah <daniel.atallah@gmail.com>
date Wed, 23 Feb 2005 03:52:55 +0000
parents 2a132b73a6e6
children 68083504217c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5684
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
1 /*
10297
ec140184437b [gaim-migrate @ 11480]
Luke Schierer <lschiere@pidgin.im>
parents: 10158
diff changeset
2 * @file gtksound.h GTK+ Sound
ec140184437b [gaim-migrate @ 11480]
Luke Schierer <lschiere@pidgin.im>
parents: 10158
diff changeset
3 * @ingroup gtkui
ec140184437b [gaim-migrate @ 11480]
Luke Schierer <lschiere@pidgin.im>
parents: 10158
diff changeset
4 *
5684
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
5 * gaim
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
6 *
8046
fa6395637e2c [gaim-migrate @ 8730]
Sean Egan <seanegan@gmail.com>
parents: 7465
diff changeset
7 * Gaim is the legal property of its developers, whose names are too numerous
fa6395637e2c [gaim-migrate @ 8730]
Sean Egan <seanegan@gmail.com>
parents: 7465
diff changeset
8 * to list here. Please refer to the COPYRIGHT file distributed with this
fa6395637e2c [gaim-migrate @ 8730]
Sean Egan <seanegan@gmail.com>
parents: 7465
diff changeset
9 * source distribution.
5684
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
10 *
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
11 * This program is free software; you can redistribute it and/or modify
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
12 * it under the terms of the GNU General Public License as published by
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
13 * the Free Software Foundation; either version 2 of the License, or
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
14 * (at your option) any later version.
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
15 *
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
16 * This program is distributed in the hope that it will be useful,
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
19 * GNU General Public License for more details.
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
20 *
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
21 * You should have received a copy of the GNU General Public License
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
22 * along with this program; if not, write to the Free Software
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
24 *
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
25 */
9791
4a15962c344a [gaim-migrate @ 10659]
Mark Doliner <mark@kingant.net>
parents: 8947
diff changeset
26 #include "internal.h"
4a15962c344a [gaim-migrate @ 10659]
Mark Doliner <mark@kingant.net>
parents: 8947
diff changeset
27 #include "gtkgaim.h"
5684
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
28
5872
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5794
diff changeset
29 #ifdef _WIN32
5684
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
30 #include <windows.h>
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
31 #include <mmsystem.h>
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
32 #endif
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
33
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
34 #ifdef USE_AO
5872
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5794
diff changeset
35 # include <ao/ao.h>
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5794
diff changeset
36 # include <audiofile.h>
5684
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
37 #endif /* USE_AO */
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
38
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
39 #ifdef USE_NAS_AUDIO
5872
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5794
diff changeset
40 # include <audio/audiolib.h>
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5794
diff changeset
41 # include <audio/soundlib.h>
5684
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
42 #endif /* USE_NAS_AUDIO */
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
43
5872
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5794
diff changeset
44 #include "debug.h"
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5794
diff changeset
45 #include "notify.h"
5684
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
46 #include "prefs.h"
5872
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5794
diff changeset
47 #include "sound.h"
7465
dedbfdc7ce65 [gaim-migrate @ 8078]
Mark Doliner <mark@kingant.net>
parents: 7464
diff changeset
48 #include "util.h"
5684
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
49
5872
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5794
diff changeset
50 #include "gtksound.h"
5684
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
51
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
52 struct gaim_sound_event {
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
53 char *label;
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
54 char *pref;
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
55 char *def;
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
56 };
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
57
10074
2e225cd35615 [gaim-migrate @ 11054]
Stu Tomlinson <stu@nosnilmot.com>
parents: 9791
diff changeset
58 #define PLAY_SOUND_TIMEOUT 15000
5684
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
59
10320
61852117568f [gaim-migrate @ 11527]
Mark Doliner <mark@kingant.net>
parents: 10297
diff changeset
60 static guint mute_login_sounds_timeout = 0;
5684
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
61 static gboolean mute_login_sounds = FALSE;
6199
eb0fedc1ac09 [gaim-migrate @ 6685]
Nathan Walp <nwalp@pidgin.im>
parents: 5872
diff changeset
62 static gboolean sound_initialized = FALSE;
5684
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
63
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
64 static struct gaim_sound_event sounds[GAIM_NUM_SOUNDS] = {
10158
5dd9c1df6459 [gaim-migrate @ 11239]
Mark Doliner <mark@kingant.net>
parents: 10087
diff changeset
65 {N_("Buddy logs in"), "login", "login.wav"},
5dd9c1df6459 [gaim-migrate @ 11239]
Mark Doliner <mark@kingant.net>
parents: 10087
diff changeset
66 {N_("Buddy logs out"), "logout", "logout.wav"},
5684
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
67 {N_("Message received"), "im_recv", "receive.wav"},
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
68 {N_("Message received begins conversation"), "first_im_recv", "receive.wav"},
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
69 {N_("Message sent"), "send_im", "send.wav"},
10158
5dd9c1df6459 [gaim-migrate @ 11239]
Mark Doliner <mark@kingant.net>
parents: 10087
diff changeset
70 {N_("Person enters chat"), "join_chat", "login.wav"},
5dd9c1df6459 [gaim-migrate @ 11239]
Mark Doliner <mark@kingant.net>
parents: 10087
diff changeset
71 {N_("Person leaves chat"), "left_chat", "logout.wav"},
5684
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
72 {N_("You talk in chat"), "send_chat_msg", "send.wav"},
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
73 {N_("Others talk in chat"), "chat_msg_recv", "receive.wav"},
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
74 /* this isn't a terminator, it's the buddy pounce default sound event ;-) */
10158
5dd9c1df6459 [gaim-migrate @ 11239]
Mark Doliner <mark@kingant.net>
parents: 10087
diff changeset
75 {NULL, "pounce_default", "alert.wav"},
5dd9c1df6459 [gaim-migrate @ 11239]
Mark Doliner <mark@kingant.net>
parents: 10087
diff changeset
76 {N_("Someone says your name in chat"), "nick_said", "alert.wav"}
5684
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
77 };
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
78
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
79 #ifdef USE_AO
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
80 static int ao_driver = -1;
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
81 #endif /* USE_AO */
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
82
10320
61852117568f [gaim-migrate @ 11527]
Mark Doliner <mark@kingant.net>
parents: 10297
diff changeset
83 static gboolean
61852117568f [gaim-migrate @ 11527]
Mark Doliner <mark@kingant.net>
parents: 10297
diff changeset
84 mute_login_sounds_cb(gpointer data)
61852117568f [gaim-migrate @ 11527]
Mark Doliner <mark@kingant.net>
parents: 10297
diff changeset
85 {
61852117568f [gaim-migrate @ 11527]
Mark Doliner <mark@kingant.net>
parents: 10297
diff changeset
86 mute_login_sounds = FALSE;
61852117568f [gaim-migrate @ 11527]
Mark Doliner <mark@kingant.net>
parents: 10297
diff changeset
87 mute_login_sounds_timeout = 0;
61852117568f [gaim-migrate @ 11527]
Mark Doliner <mark@kingant.net>
parents: 10297
diff changeset
88 return FALSE;
61852117568f [gaim-migrate @ 11527]
Mark Doliner <mark@kingant.net>
parents: 10297
diff changeset
89 }
61852117568f [gaim-migrate @ 11527]
Mark Doliner <mark@kingant.net>
parents: 10297
diff changeset
90
61852117568f [gaim-migrate @ 11527]
Mark Doliner <mark@kingant.net>
parents: 10297
diff changeset
91 /*
61852117568f [gaim-migrate @ 11527]
Mark Doliner <mark@kingant.net>
parents: 10297
diff changeset
92 * We mute sounds for the 10 seconds after you log in so that
61852117568f [gaim-migrate @ 11527]
Mark Doliner <mark@kingant.net>
parents: 10297
diff changeset
93 * you don't get flooded with sounds when the blist shows all
61852117568f [gaim-migrate @ 11527]
Mark Doliner <mark@kingant.net>
parents: 10297
diff changeset
94 * your buddies logging in.
61852117568f [gaim-migrate @ 11527]
Mark Doliner <mark@kingant.net>
parents: 10297
diff changeset
95 */
61852117568f [gaim-migrate @ 11527]
Mark Doliner <mark@kingant.net>
parents: 10297
diff changeset
96 static void
61852117568f [gaim-migrate @ 11527]
Mark Doliner <mark@kingant.net>
parents: 10297
diff changeset
97 account_signon_cb(GaimConnection *gc, gpointer data)
61852117568f [gaim-migrate @ 11527]
Mark Doliner <mark@kingant.net>
parents: 10297
diff changeset
98 {
61852117568f [gaim-migrate @ 11527]
Mark Doliner <mark@kingant.net>
parents: 10297
diff changeset
99 if (mute_login_sounds_timeout != 0)
61852117568f [gaim-migrate @ 11527]
Mark Doliner <mark@kingant.net>
parents: 10297
diff changeset
100 g_source_remove(mute_login_sounds_timeout);
61852117568f [gaim-migrate @ 11527]
Mark Doliner <mark@kingant.net>
parents: 10297
diff changeset
101 mute_login_sounds = TRUE;
61852117568f [gaim-migrate @ 11527]
Mark Doliner <mark@kingant.net>
parents: 10297
diff changeset
102 mute_login_sounds_timeout = gaim_timeout_add(10000, mute_login_sounds_cb, NULL);
61852117568f [gaim-migrate @ 11527]
Mark Doliner <mark@kingant.net>
parents: 10297
diff changeset
103 }
61852117568f [gaim-migrate @ 11527]
Mark Doliner <mark@kingant.net>
parents: 10297
diff changeset
104
10322
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 10320
diff changeset
105 static void
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 10320
diff changeset
106 _pref_sound_method_changed(const char *name, GaimPrefType type,
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 10320
diff changeset
107 gpointer val, gpointer data) {
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 10320
diff changeset
108 if(type != GAIM_PREF_STRING || strcmp(name, "/gaim/gtk/sound/method"))
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 10320
diff changeset
109 return;
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 10320
diff changeset
110
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 10320
diff changeset
111 sound_initialized = TRUE;
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 10320
diff changeset
112
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 10320
diff changeset
113 #ifdef USE_AO
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 10320
diff changeset
114 ao_driver = -1;
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 10320
diff changeset
115
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 10320
diff changeset
116 if(!strcmp(val, "esd"))
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 10320
diff changeset
117 ao_driver = ao_driver_id("esd");
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 10320
diff changeset
118 else if(!strcmp(val, "arts"))
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 10320
diff changeset
119 ao_driver = ao_driver_id("arts");
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 10320
diff changeset
120 else if(!strcmp(val, "automatic"))
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 10320
diff changeset
121 ao_driver = ao_default_driver_id();
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 10320
diff changeset
122
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 10320
diff changeset
123 if(ao_driver != -1) {
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 10320
diff changeset
124 ao_info *info = ao_driver_info(ao_driver);
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 10320
diff changeset
125 gaim_debug_info("sound",
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 10320
diff changeset
126 "Sound output driver loaded: %s\n", info->name);
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 10320
diff changeset
127 }
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 10320
diff changeset
128 #endif /* USE_AO */
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 10320
diff changeset
129 #ifdef USE_NAS
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 10320
diff changeset
130 if (!strcmp(val, "nas"))
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 10320
diff changeset
131 gaim_debug_info("sound",
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 10320
diff changeset
132 "Sound output driver loaded: NAS output\n");
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 10320
diff changeset
133 #endif /* USE_NAS */
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 10320
diff changeset
134 }
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 10320
diff changeset
135
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 10320
diff changeset
136 const char *
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 10320
diff changeset
137 gaim_gtk_sound_get_event_option(GaimSoundEventID event)
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 10320
diff changeset
138 {
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 10320
diff changeset
139 if(event >= GAIM_NUM_SOUNDS)
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 10320
diff changeset
140 return 0;
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 10320
diff changeset
141
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 10320
diff changeset
142 return sounds[event].pref;
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 10320
diff changeset
143 }
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 10320
diff changeset
144
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 10320
diff changeset
145 char *
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 10320
diff changeset
146 gaim_gtk_sound_get_event_label(GaimSoundEventID event)
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 10320
diff changeset
147 {
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 10320
diff changeset
148 if(event >= GAIM_NUM_SOUNDS)
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 10320
diff changeset
149 return NULL;
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 10320
diff changeset
150
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 10320
diff changeset
151 return sounds[event].label;
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 10320
diff changeset
152 }
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 10320
diff changeset
153
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 10320
diff changeset
154 void *
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 10320
diff changeset
155 gaim_gtk_sound_get_handle()
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 10320
diff changeset
156 {
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 10320
diff changeset
157 static int handle;
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 10320
diff changeset
158
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 10320
diff changeset
159 return &handle;
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 10320
diff changeset
160 }
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 10320
diff changeset
161
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 10320
diff changeset
162 static void
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 10320
diff changeset
163 gaim_gtk_sound_init(void)
5684
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
164 {
10320
61852117568f [gaim-migrate @ 11527]
Mark Doliner <mark@kingant.net>
parents: 10297
diff changeset
165 void *gtk_sound_handle = gaim_gtk_sound_get_handle();
61852117568f [gaim-migrate @ 11527]
Mark Doliner <mark@kingant.net>
parents: 10297
diff changeset
166
61852117568f [gaim-migrate @ 11527]
Mark Doliner <mark@kingant.net>
parents: 10297
diff changeset
167 gaim_signal_connect(gaim_connections_get_handle(), "signed-on",
61852117568f [gaim-migrate @ 11527]
Mark Doliner <mark@kingant.net>
parents: 10297
diff changeset
168 gtk_sound_handle, GAIM_CALLBACK(account_signon_cb),
61852117568f [gaim-migrate @ 11527]
Mark Doliner <mark@kingant.net>
parents: 10297
diff changeset
169 NULL);
61852117568f [gaim-migrate @ 11527]
Mark Doliner <mark@kingant.net>
parents: 10297
diff changeset
170
5684
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
171 gaim_prefs_add_none("/gaim/gtk/sound");
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
172 gaim_prefs_add_none("/gaim/gtk/sound/enabled");
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
173 gaim_prefs_add_none("/gaim/gtk/sound/file");
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
174 gaim_prefs_add_bool("/gaim/gtk/sound/enabled/login", TRUE);
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
175 gaim_prefs_add_string("/gaim/gtk/sound/file/login", "");
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
176 gaim_prefs_add_bool("/gaim/gtk/sound/enabled/logout", TRUE);
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
177 gaim_prefs_add_string("/gaim/gtk/sound/file/logout", "");
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
178 gaim_prefs_add_bool("/gaim/gtk/sound/enabled/im_recv", TRUE);
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
179 gaim_prefs_add_string("/gaim/gtk/sound/file/im_recv", "");
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
180 gaim_prefs_add_bool("/gaim/gtk/sound/enabled/first_im_recv", FALSE);
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
181 gaim_prefs_add_string("/gaim/gtk/sound/file/first_im_recv", "");
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
182 gaim_prefs_add_bool("/gaim/gtk/sound/enabled/send_im", TRUE);
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
183 gaim_prefs_add_string("/gaim/gtk/sound/file/send_im", "");
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
184 gaim_prefs_add_bool("/gaim/gtk/sound/enabled/join_chat", FALSE);
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
185 gaim_prefs_add_string("/gaim/gtk/sound/file/join_chat", "");
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
186 gaim_prefs_add_bool("/gaim/gtk/sound/enabled/left_chat", FALSE);
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
187 gaim_prefs_add_string("/gaim/gtk/sound/file/left_chat", "");
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
188 gaim_prefs_add_bool("/gaim/gtk/sound/enabled/send_chat_msg", FALSE);
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
189 gaim_prefs_add_string("/gaim/gtk/sound/file/send_chat_msg", "");
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
190 gaim_prefs_add_bool("/gaim/gtk/sound/enabled/chat_msg_recv", FALSE);
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
191 gaim_prefs_add_string("/gaim/gtk/sound/file/chat_msg_recv", "");
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
192 gaim_prefs_add_bool("/gaim/gtk/sound/enabled/nick_said", FALSE);
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
193 gaim_prefs_add_string("/gaim/gtk/sound/file/nick_said", "");
7460
3973a09525b3 [gaim-migrate @ 8073]
Christian Hammond <chipx86@chipx86.com>
parents: 7035
diff changeset
194 gaim_prefs_add_bool("/gaim/gtk/sound/enabled/pounce_default", TRUE);
3973a09525b3 [gaim-migrate @ 8073]
Christian Hammond <chipx86@chipx86.com>
parents: 7035
diff changeset
195 gaim_prefs_add_string("/gaim/gtk/sound/file/pounce_default", "");
8633
f8292be3b45c [gaim-migrate @ 9385]
Mark Doliner <mark@kingant.net>
parents: 8632
diff changeset
196 gaim_prefs_add_bool("/gaim/gtk/sound/conv_focus", TRUE);
10074
2e225cd35615 [gaim-migrate @ 11054]
Stu Tomlinson <stu@nosnilmot.com>
parents: 9791
diff changeset
197 gaim_prefs_add_bool("/gaim/gtk/sound/mute", FALSE);
5684
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
198 gaim_prefs_add_string("/gaim/gtk/sound/command", "");
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
199 gaim_prefs_add_string("/gaim/gtk/sound/method", "automatic");
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
200
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
201 #ifdef USE_AO
10322
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 10320
diff changeset
202 gaim_debug_info("sound", "Initializing sound output drivers.\n");
5684
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
203 ao_initialize();
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
204 #endif /* USE_AO */
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
205
10087
9fdbfe832fac [gaim-migrate @ 11098]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10074
diff changeset
206 gaim_prefs_connect_callback(gaim_gtk_sound_get_handle(), "/gaim/gtk/sound/method",
5794
5e93fc46d1af [gaim-migrate @ 6219]
Christian Hammond <chipx86@chipx86.com>
parents: 5684
diff changeset
207 _pref_sound_method_changed, NULL);
5684
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
208 }
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
209
10322
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 10320
diff changeset
210 static void
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 10320
diff changeset
211 gaim_gtk_sound_uninit(void)
5684
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
212 {
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
213 #ifdef USE_AO
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
214 ao_shutdown();
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
215 #endif
6199
eb0fedc1ac09 [gaim-migrate @ 6685]
Nathan Walp <nwalp@pidgin.im>
parents: 5872
diff changeset
216 sound_initialized = FALSE;
5684
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
217 }
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
218
10322
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 10320
diff changeset
219 #ifdef USE_NAS_AUDIO
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 10320
diff changeset
220 static gboolean
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 10320
diff changeset
221 play_file_nas(const char *filename)
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 10320
diff changeset
222 {
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 10320
diff changeset
223 AuServer *nas_serv;
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 10320
diff changeset
224 gboolean ret = FALSE;
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 10320
diff changeset
225
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 10320
diff changeset
226 if((nas_serv = AuOpenServer(NULL, 0, NULL, 0, NULL, NULL))) {
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 10320
diff changeset
227 ret = AuSoundPlaySynchronousFromFile(nas_serv, filename, 100);
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 10320
diff changeset
228 AuCloseServer(nas_serv);
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 10320
diff changeset
229 }
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 10320
diff changeset
230
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 10320
diff changeset
231 return ret;
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 10320
diff changeset
232 }
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 10320
diff changeset
233
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 10320
diff changeset
234 #endif /* USE_NAS_AUDIO */
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 10320
diff changeset
235
10074
2e225cd35615 [gaim-migrate @ 11054]
Stu Tomlinson <stu@nosnilmot.com>
parents: 9791
diff changeset
236 #if defined(USE_NAS_AUDIO) || defined(USE_AO)
10322
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 10320
diff changeset
237 static gboolean
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 10320
diff changeset
238 expire_old_child(gpointer data)
10074
2e225cd35615 [gaim-migrate @ 11054]
Stu Tomlinson <stu@nosnilmot.com>
parents: 9791
diff changeset
239 {
2e225cd35615 [gaim-migrate @ 11054]
Stu Tomlinson <stu@nosnilmot.com>
parents: 9791
diff changeset
240 int ret;
2e225cd35615 [gaim-migrate @ 11054]
Stu Tomlinson <stu@nosnilmot.com>
parents: 9791
diff changeset
241 pid_t pid = GPOINTER_TO_INT(data);
2e225cd35615 [gaim-migrate @ 11054]
Stu Tomlinson <stu@nosnilmot.com>
parents: 9791
diff changeset
242
2e225cd35615 [gaim-migrate @ 11054]
Stu Tomlinson <stu@nosnilmot.com>
parents: 9791
diff changeset
243 ret = waitpid(pid, NULL, WNOHANG | WUNTRACED);
2e225cd35615 [gaim-migrate @ 11054]
Stu Tomlinson <stu@nosnilmot.com>
parents: 9791
diff changeset
244
2e225cd35615 [gaim-migrate @ 11054]
Stu Tomlinson <stu@nosnilmot.com>
parents: 9791
diff changeset
245 if(ret == 0) {
2e225cd35615 [gaim-migrate @ 11054]
Stu Tomlinson <stu@nosnilmot.com>
parents: 9791
diff changeset
246 if(kill(pid, SIGKILL) < 0)
10322
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 10320
diff changeset
247 gaim_debug_error("gtksound", "Killing process %d failed (%s)\n",
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 10320
diff changeset
248 pid, strerror(errno));
10074
2e225cd35615 [gaim-migrate @ 11054]
Stu Tomlinson <stu@nosnilmot.com>
parents: 9791
diff changeset
249 }
2e225cd35615 [gaim-migrate @ 11054]
Stu Tomlinson <stu@nosnilmot.com>
parents: 9791
diff changeset
250
2e225cd35615 [gaim-migrate @ 11054]
Stu Tomlinson <stu@nosnilmot.com>
parents: 9791
diff changeset
251 return FALSE; /* do not run again */
2e225cd35615 [gaim-migrate @ 11054]
Stu Tomlinson <stu@nosnilmot.com>
parents: 9791
diff changeset
252 }
2e225cd35615 [gaim-migrate @ 11054]
Stu Tomlinson <stu@nosnilmot.com>
parents: 9791
diff changeset
253 #endif
2e225cd35615 [gaim-migrate @ 11054]
Stu Tomlinson <stu@nosnilmot.com>
parents: 9791
diff changeset
254
10322
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 10320
diff changeset
255 static void
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 10320
diff changeset
256 gaim_gtk_sound_play_file(const char *filename)
5684
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
257 {
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
258 const char *method;
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
259 #if defined(USE_NAS_AUDIO) || defined(USE_AO)
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
260 pid_t pid;
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
261 #ifdef USE_AO
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
262 AFfilehandle file;
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
263 #endif
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
264 #endif
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
265
6199
eb0fedc1ac09 [gaim-migrate @ 6685]
Nathan Walp <nwalp@pidgin.im>
parents: 5872
diff changeset
266 if (!sound_initialized)
eb0fedc1ac09 [gaim-migrate @ 6685]
Nathan Walp <nwalp@pidgin.im>
parents: 5872
diff changeset
267 gaim_prefs_trigger_callback("/gaim/gtk/sound/method");
eb0fedc1ac09 [gaim-migrate @ 6685]
Nathan Walp <nwalp@pidgin.im>
parents: 5872
diff changeset
268
10074
2e225cd35615 [gaim-migrate @ 11054]
Stu Tomlinson <stu@nosnilmot.com>
parents: 9791
diff changeset
269 if (gaim_prefs_get_bool("/gaim/gtk/sound/mute"))
5684
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
270 return;
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
271
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
272 method = gaim_prefs_get_string("/gaim/gtk/sound/method");
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
273
10074
2e225cd35615 [gaim-migrate @ 11054]
Stu Tomlinson <stu@nosnilmot.com>
parents: 9791
diff changeset
274 if (!strcmp(method, "none")) {
2e225cd35615 [gaim-migrate @ 11054]
Stu Tomlinson <stu@nosnilmot.com>
parents: 9791
diff changeset
275 return;
2e225cd35615 [gaim-migrate @ 11054]
Stu Tomlinson <stu@nosnilmot.com>
parents: 9791
diff changeset
276 } else if (!strcmp(method, "beep")) {
5684
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
277 gdk_beep();
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
278 return;
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
279 }
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
280
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
281 if (!g_file_test(filename, G_FILE_TEST_EXISTS)) {
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
282 char *tmp = g_strdup_printf(_("Unable to play sound because the chosen file (%s) does not exist."), filename);
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
283 gaim_notify_error(NULL, NULL, tmp, NULL);
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
284 g_free(tmp);
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
285 return;
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
286 }
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
287
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
288 #ifndef _WIN32
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
289 if (!strcmp(method, "custom")) {
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
290 const char *sound_cmd;
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
291 char *command;
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
292 GError *error = NULL;
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
293
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
294 sound_cmd = gaim_prefs_get_string("/gaim/gtk/sound/command");
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
295
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
296 if (!sound_cmd || *sound_cmd == '\0') {
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
297 gaim_notify_error(NULL, NULL,
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
298 _("Unable to play sound because the "
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
299 "'Command' sound method has been chosen, "
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
300 "but no command has been set."), NULL);
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
301 return;
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
302 }
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
303
7464
a259e244e44f [gaim-migrate @ 8077]
Nathan Walp <nwalp@pidgin.im>
parents: 7460
diff changeset
304 if(strstr(sound_cmd, "%s"))
a259e244e44f [gaim-migrate @ 8077]
Nathan Walp <nwalp@pidgin.im>
parents: 7460
diff changeset
305 command = gaim_strreplace(sound_cmd, "%s", filename);
a259e244e44f [gaim-migrate @ 8077]
Nathan Walp <nwalp@pidgin.im>
parents: 7460
diff changeset
306 else
a259e244e44f [gaim-migrate @ 8077]
Nathan Walp <nwalp@pidgin.im>
parents: 7460
diff changeset
307 command = g_strdup_printf("%s %s", sound_cmd, filename);
5684
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
308
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
309 if(!g_spawn_command_line_async(command, &error)) {
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
310 char *tmp = g_strdup_printf(_("Unable to play sound because the configured sound command could not be launched: %s"), error->message);
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
311 gaim_notify_error(NULL, NULL, tmp, NULL);
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
312 g_free(tmp);
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
313 g_error_free(error);
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
314 }
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
315
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
316 g_free(command);
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
317 return;
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
318 }
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
319 #if defined(USE_NAS_AUDIO) || defined(USE_AO)
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
320 pid = fork();
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
321 if (pid < 0)
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
322 return;
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
323 else if (pid == 0) {
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
324 #ifdef USE_NAS_AUDIO
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
325 if (!strcmp(method, "nas")) {
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
326 if (play_file_nas(filename))
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
327 _exit(0);
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
328 }
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
329 #endif /* USE_NAS_AUDIO */
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
330
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
331 #ifdef USE_AO
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
332 file = afOpenFile(filename, "rb", NULL);
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
333 if(file) {
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
334 ao_device *device;
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
335 ao_sample_format format;
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
336 int in_fmt;
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
337 int bytes_per_frame;
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
338
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
339 format.rate = afGetRate(file, AF_DEFAULT_TRACK);
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
340 format.channels = afGetChannels(file, AF_DEFAULT_TRACK);
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
341 afGetSampleFormat(file, AF_DEFAULT_TRACK, &in_fmt,
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
342 &format.bits);
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
343
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
344 /* XXX: libao doesn't seem to like 8-bit sounds, so we'll
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
345 * let libaudiofile make them a bit better for us */
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
346 if(format.bits == 8)
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
347 format.bits = 16;
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
348
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
349 afSetVirtualSampleFormat(file, AF_DEFAULT_TRACK,
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
350 AF_SAMPFMT_TWOSCOMP, format.bits);
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
351
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
352 #if __BYTE_ORDER == __BIG_ENDIAN
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
353 format.byte_format = AO_FMT_BIG;
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
354 afSetVirtualByteOrder(file, AF_DEFAULT_TRACK,
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
355 AF_BYTEORDER_BIGENDIAN);
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
356 #elif __BYTE_ORDER == __LITTLE_ENDIAN
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
357 format.byte_format = AO_FMT_LITTLE;
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
358 afSetVirtualByteOrder(file, AF_DEFAULT_TRACK,
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
359 AF_BYTEORDER_LITTLEENDIAN);
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
360 #endif
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
361
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
362 bytes_per_frame = format.bits * format.channels / 8;
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
363
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
364 device = ao_open_live(ao_driver, &format, NULL);
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
365
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
366 if(device) {
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
367 int frames_read;
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
368 char buf[4096];
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
369 int buf_frames = sizeof(buf) / bytes_per_frame;
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
370
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
371 while((frames_read = afReadFrames(file, AF_DEFAULT_TRACK,
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
372 buf, buf_frames))) {
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
373 if(!ao_play(device, buf, frames_read * bytes_per_frame))
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
374 break;
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
375 }
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
376 ao_close(device);
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
377 }
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
378 afCloseFile(file);
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
379 }
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
380 ao_shutdown();
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
381 #endif /* USE_AO */
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
382 _exit(0);
10074
2e225cd35615 [gaim-migrate @ 11054]
Stu Tomlinson <stu@nosnilmot.com>
parents: 9791
diff changeset
383 } else {
2e225cd35615 [gaim-migrate @ 11054]
Stu Tomlinson <stu@nosnilmot.com>
parents: 9791
diff changeset
384 gaim_timeout_add(PLAY_SOUND_TIMEOUT, expire_old_child, GINT_TO_POINTER(pid));
5684
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
385 }
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
386 #else /* USE_NAS_AUDIO || USE_AO */
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
387 gdk_beep();
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
388 return;
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
389 #endif /* USE_NAS_AUDIO || USE_AO */
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
390 #else /* _WIN32 */
10322
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 10320
diff changeset
391 gaim_debug_info("sound", "Playing %s\n", filename);
5684
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
392
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
393 if (!PlaySound(filename, 0, SND_ASYNC | SND_FILENAME))
10322
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 10320
diff changeset
394 gaim_debug_error("sound", "Error playing sound.\n");
5684
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
395 #endif /* _WIN32 */
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
396 }
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
397
10322
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 10320
diff changeset
398 static void
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 10320
diff changeset
399 gaim_gtk_sound_play_event(GaimSoundEventID event)
5684
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
400 {
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
401 char *enable_pref;
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
402 char *file_pref;
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
403
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
404 if ((event == GAIM_SOUND_BUDDY_ARRIVE) && mute_login_sounds)
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
405 return;
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
406
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
407 if (event >= GAIM_NUM_SOUNDS) {
10322
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 10320
diff changeset
408 gaim_debug_error("sound", "got request for unknown sound: %d\n", event);
5684
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
409 return;
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
410 }
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
411
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
412 enable_pref = g_strdup_printf("/gaim/gtk/sound/enabled/%s",
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
413 sounds[event].pref);
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
414 file_pref = g_strdup_printf("/gaim/gtk/sound/file/%s", sounds[event].pref);
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
415
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
416 /* check NULL for sounds that don't have an option, ie buddy pounce */
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
417 if (gaim_prefs_get_bool(enable_pref)) {
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
418 char *filename = g_strdup(gaim_prefs_get_string(file_pref));
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
419 if(!filename || !strlen(filename)) {
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
420 if(filename) g_free(filename);
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
421 filename = g_build_filename(DATADIR, "sounds", "gaim", sounds[event].def, NULL);
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
422 }
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
423
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
424 gaim_sound_play_file(filename);
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
425 g_free(filename);
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
426 }
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
427
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
428 g_free(enable_pref);
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
429 g_free(file_pref);
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
430 }
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
431
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
432 static GaimSoundUiOps sound_ui_ops =
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
433 {
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
434 gaim_gtk_sound_init,
10322
2a132b73a6e6 [gaim-migrate @ 11529]
Mark Doliner <mark@kingant.net>
parents: 10320
diff changeset
435 gaim_gtk_sound_uninit,
5684
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
436 gaim_gtk_sound_play_file,
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
437 gaim_gtk_sound_play_event
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
438 };
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
439
7035
feb3d21a7794 [gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents: 6778
diff changeset
440 GaimSoundUiOps *
feb3d21a7794 [gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents: 6778
diff changeset
441 gaim_gtk_sound_get_ui_ops(void)
5684
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
442 {
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
443 return &sound_ui_ops;
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
444 }