Fri, 13 Mar 2009 03:04:07 +0000
Move 'Minutes before becoming idle' above 'Change status when idle'
Minutes before becoming idle has an effect even when we're not doing autoaway,
so it should not be disabled then.
| 5684 | 1 | /* |
|
14547
389330a9e9b5
[gaim-migrate @ 17204]
Mark Doliner <markdoliner@pidgin.im>
parents:
14316
diff
changeset
|
2 | * @file gtksound.c GTK+ Sound |
|
16254
eeb2bba4dc94
Rename the Doxygen group from gtkui to pidgin.
Richard Laager <rlaager@pidgin.im>
parents:
16161
diff
changeset
|
3 | * @ingroup pidgin |
|
20147
66f05a854eee
applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
4 | */ |
|
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 | /* pidgin |
| 5684 | 7 | * |
|
15931
716b5fac1895
Re-sed the copyright notices so they don't all talk about Purple.
Richard Laager <rlaager@pidgin.im>
parents:
15923
diff
changeset
|
8 | * Pidgin is the legal property of its developers, whose names are too numerous |
| 8046 | 9 | * to list here. Please refer to the COPYRIGHT file distributed with this |
| 10 | * source distribution. | |
| 5684 | 11 | * |
| 12 | * This program is free software; you can redistribute it and/or modify | |
| 13 | * it under the terms of the GNU General Public License as published by | |
| 14 | * the Free Software Foundation; either version 2 of the License, or | |
| 15 | * (at your option) any later version. | |
| 16 | * | |
| 17 | * This program is distributed in the hope that it will be useful, | |
| 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 20 | * GNU General Public License for more details. | |
| 21 | * | |
| 22 | * You should have received a copy of the GNU General Public License | |
| 23 | * 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:
19849
diff
changeset
|
24 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
| 5684 | 25 | * |
| 26 | */ | |
| 9791 | 27 | #include "internal.h" |
| 15577 | 28 | #include "pidgin.h" |
| 5684 | 29 | |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5794
diff
changeset
|
30 | #ifdef _WIN32 |
| 5684 | 31 | #include <windows.h> |
| 32 | #include <mmsystem.h> | |
| 33 | #endif | |
| 34 | ||
| 13720 | 35 | #ifdef USE_GSTREAMER |
| 36 | # include <gst/gst.h> | |
| 37 | #endif /* USE_GSTREAMER */ | |
| 5684 | 38 | |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5794
diff
changeset
|
39 | #include "debug.h" |
|
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5794
diff
changeset
|
40 | #include "notify.h" |
| 5684 | 41 | #include "prefs.h" |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5794
diff
changeset
|
42 | #include "sound.h" |
|
23649
5da5fe967d10
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23314
diff
changeset
|
43 | #include "sound-theme.h" |
|
5da5fe967d10
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23314
diff
changeset
|
44 | #include "theme-manager.h" |
|
7465
17e1e9e996ad
[gaim-migrate @ 8078]
Mark Doliner <markdoliner@pidgin.im>
parents:
7464
diff
changeset
|
45 | #include "util.h" |
| 5684 | 46 | |
|
11552
674a2a79943a
[gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents:
11463
diff
changeset
|
47 | #include "gtkconv.h" |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5794
diff
changeset
|
48 | #include "gtksound.h" |
| 5684 | 49 | |
|
15880
d275b025481c
More Gaim to Pidgin changes
Sean Egan <seanegan@pidgin.im>
parents:
15649
diff
changeset
|
50 | struct pidgin_sound_event { |
| 5684 | 51 | char *label; |
| 52 | char *pref; | |
| 53 | char *def; | |
| 54 | }; | |
| 55 | ||
|
10320
f5b0f5cf8562
[gaim-migrate @ 11527]
Mark Doliner <markdoliner@pidgin.im>
parents:
10297
diff
changeset
|
56 | static guint mute_login_sounds_timeout = 0; |
| 5684 | 57 | static gboolean mute_login_sounds = FALSE; |
| 58 | ||
|
14315
908ff155af2e
[gaim-migrate @ 16935]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14253
diff
changeset
|
59 | #ifdef USE_GSTREAMER |
|
908ff155af2e
[gaim-migrate @ 16935]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14253
diff
changeset
|
60 | static gboolean gst_init_failed; |
|
908ff155af2e
[gaim-migrate @ 16935]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14253
diff
changeset
|
61 | #endif /* USE_GSTREAMER */ |
|
908ff155af2e
[gaim-migrate @ 16935]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14253
diff
changeset
|
62 | |
|
21091
07fe1a99c47b
Patch from Andrew Gaul to constify a bunch of static variables to reduce
Ka-Hing Cheung <khc@pidgin.im>
parents:
20234
diff
changeset
|
63 | static const struct pidgin_sound_event sounds[PURPLE_NUM_SOUNDS] = { |
| 10158 | 64 | {N_("Buddy logs in"), "login", "login.wav"}, |
| 65 | {N_("Buddy logs out"), "logout", "logout.wav"}, | |
| 5684 | 66 | {N_("Message received"), "im_recv", "receive.wav"}, |
| 67 | {N_("Message received begins conversation"), "first_im_recv", "receive.wav"}, | |
| 68 | {N_("Message sent"), "send_im", "send.wav"}, | |
| 10158 | 69 | {N_("Person enters chat"), "join_chat", "login.wav"}, |
| 70 | {N_("Person leaves chat"), "left_chat", "logout.wav"}, | |
| 5684 | 71 | {N_("You talk in chat"), "send_chat_msg", "send.wav"}, |
| 72 | {N_("Others talk in chat"), "chat_msg_recv", "receive.wav"}, | |
| 73 | /* this isn't a terminator, it's the buddy pounce default sound event ;-) */ | |
| 10158 | 74 | {NULL, "pounce_default", "alert.wav"}, |
|
22942
2bf494f8e2a4
Change the string "screen name" to "username" everywhere. I think most
Mark Doliner <markdoliner@pidgin.im>
parents:
22631
diff
changeset
|
75 | {N_("Someone says your username in chat"), "nick_said", "alert.wav"} |
| 5684 | 76 | }; |
| 77 | ||
|
10320
f5b0f5cf8562
[gaim-migrate @ 11527]
Mark Doliner <markdoliner@pidgin.im>
parents:
10297
diff
changeset
|
78 | static gboolean |
|
11463
d672317c99c1
[gaim-migrate @ 13703]
Mark Doliner <markdoliner@pidgin.im>
parents:
11256
diff
changeset
|
79 | unmute_login_sounds_cb(gpointer data) |
|
10320
f5b0f5cf8562
[gaim-migrate @ 11527]
Mark Doliner <markdoliner@pidgin.im>
parents:
10297
diff
changeset
|
80 | { |
|
f5b0f5cf8562
[gaim-migrate @ 11527]
Mark Doliner <markdoliner@pidgin.im>
parents:
10297
diff
changeset
|
81 | mute_login_sounds = FALSE; |
|
f5b0f5cf8562
[gaim-migrate @ 11527]
Mark Doliner <markdoliner@pidgin.im>
parents:
10297
diff
changeset
|
82 | mute_login_sounds_timeout = 0; |
|
f5b0f5cf8562
[gaim-migrate @ 11527]
Mark Doliner <markdoliner@pidgin.im>
parents:
10297
diff
changeset
|
83 | return FALSE; |
|
f5b0f5cf8562
[gaim-migrate @ 11527]
Mark Doliner <markdoliner@pidgin.im>
parents:
10297
diff
changeset
|
84 | } |
|
f5b0f5cf8562
[gaim-migrate @ 11527]
Mark Doliner <markdoliner@pidgin.im>
parents:
10297
diff
changeset
|
85 | |
|
11552
674a2a79943a
[gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents:
11463
diff
changeset
|
86 | static gboolean |
| 15884 | 87 | chat_nick_matches_name(PurpleConversation *conv, const char *aname) |
|
11552
674a2a79943a
[gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents:
11463
diff
changeset
|
88 | { |
| 15884 | 89 | PurpleConvChat *chat = NULL; |
|
11552
674a2a79943a
[gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents:
11463
diff
changeset
|
90 | char *nick = NULL; |
|
674a2a79943a
[gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents:
11463
diff
changeset
|
91 | char *name = NULL; |
|
674a2a79943a
[gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents:
11463
diff
changeset
|
92 | gboolean ret = FALSE; |
| 15884 | 93 | chat = purple_conversation_get_chat_data(conv); |
|
11552
674a2a79943a
[gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents:
11463
diff
changeset
|
94 | |
|
674a2a79943a
[gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents:
11463
diff
changeset
|
95 | if (chat==NULL) |
|
674a2a79943a
[gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents:
11463
diff
changeset
|
96 | return ret; |
|
674a2a79943a
[gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents:
11463
diff
changeset
|
97 | |
| 15884 | 98 | nick = g_strdup(purple_normalize(conv->account, chat->nick)); |
| 99 | name = g_strdup(purple_normalize(conv->account, aname)); | |
|
11552
674a2a79943a
[gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents:
11463
diff
changeset
|
100 | |
|
674a2a79943a
[gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents:
11463
diff
changeset
|
101 | if (g_utf8_collate(nick, name) == 0) |
|
674a2a79943a
[gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents:
11463
diff
changeset
|
102 | ret = TRUE; |
|
674a2a79943a
[gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents:
11463
diff
changeset
|
103 | |
|
674a2a79943a
[gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents:
11463
diff
changeset
|
104 | g_free(nick); |
|
674a2a79943a
[gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents:
11463
diff
changeset
|
105 | g_free(name); |
|
674a2a79943a
[gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents:
11463
diff
changeset
|
106 | |
|
674a2a79943a
[gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents:
11463
diff
changeset
|
107 | return ret; |
|
674a2a79943a
[gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents:
11463
diff
changeset
|
108 | } |
|
674a2a79943a
[gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents:
11463
diff
changeset
|
109 | |
|
674a2a79943a
[gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents:
11463
diff
changeset
|
110 | /* |
|
674a2a79943a
[gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents:
11463
diff
changeset
|
111 | * play a sound event for a conversation, honoring make_sound flag |
|
674a2a79943a
[gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents:
11463
diff
changeset
|
112 | * of conversation and checking for focus if conv_focus pref is set |
|
674a2a79943a
[gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents:
11463
diff
changeset
|
113 | */ |
|
674a2a79943a
[gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents:
11463
diff
changeset
|
114 | static void |
| 15884 | 115 | play_conv_event(PurpleConversation *conv, PurpleSoundEventID event) |
|
11552
674a2a79943a
[gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents:
11463
diff
changeset
|
116 | { |
|
11642
76b60f0bf467
[gaim-migrate @ 13919]
Casey Harkins <charkins@pidgin.im>
parents:
11581
diff
changeset
|
117 | /* If we should not play the sound for some reason, then exit early */ |
|
19591
a943e8e69c5f
Make sure a conversation is a pidgin-conversation to avoid a crash.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19564
diff
changeset
|
118 | if (conv != NULL && PIDGIN_IS_PIDGIN_CONVERSATION(conv)) |
|
11642
76b60f0bf467
[gaim-migrate @ 13919]
Casey Harkins <charkins@pidgin.im>
parents:
11581
diff
changeset
|
119 | { |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
120 | PidginConversation *gtkconv; |
|
11642
76b60f0bf467
[gaim-migrate @ 13919]
Casey Harkins <charkins@pidgin.im>
parents:
11581
diff
changeset
|
121 | gboolean has_focus; |
|
11552
674a2a79943a
[gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents:
11463
diff
changeset
|
122 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
123 | gtkconv = PIDGIN_CONVERSATION(conv); |
| 15884 | 124 | has_focus = purple_conversation_has_focus(conv); |
|
11552
674a2a79943a
[gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents:
11463
diff
changeset
|
125 | |
|
11642
76b60f0bf467
[gaim-migrate @ 13919]
Casey Harkins <charkins@pidgin.im>
parents:
11581
diff
changeset
|
126 | if (!gtkconv->make_sound || |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
127 | (has_focus && !purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/sound/conv_focus"))) |
|
11642
76b60f0bf467
[gaim-migrate @ 13919]
Casey Harkins <charkins@pidgin.im>
parents:
11581
diff
changeset
|
128 | { |
|
76b60f0bf467
[gaim-migrate @ 13919]
Casey Harkins <charkins@pidgin.im>
parents:
11581
diff
changeset
|
129 | return; |
|
76b60f0bf467
[gaim-migrate @ 13919]
Casey Harkins <charkins@pidgin.im>
parents:
11581
diff
changeset
|
130 | } |
|
76b60f0bf467
[gaim-migrate @ 13919]
Casey Harkins <charkins@pidgin.im>
parents:
11581
diff
changeset
|
131 | } |
|
11552
674a2a79943a
[gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents:
11463
diff
changeset
|
132 | |
| 15884 | 133 | purple_sound_play_event(event, conv ? purple_conversation_get_account(conv) : NULL); |
|
11552
674a2a79943a
[gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents:
11463
diff
changeset
|
134 | } |
|
674a2a79943a
[gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents:
11463
diff
changeset
|
135 | |
|
674a2a79943a
[gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents:
11463
diff
changeset
|
136 | static void |
| 15884 | 137 | buddy_state_cb(PurpleBuddy *buddy, PurpleSoundEventID event) |
|
11552
674a2a79943a
[gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents:
11463
diff
changeset
|
138 | { |
| 15884 | 139 | purple_sound_play_event(event, purple_buddy_get_account(buddy)); |
|
11552
674a2a79943a
[gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents:
11463
diff
changeset
|
140 | } |
|
674a2a79943a
[gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents:
11463
diff
changeset
|
141 | |
|
674a2a79943a
[gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents:
11463
diff
changeset
|
142 | static void |
| 15884 | 143 | im_msg_received_cb(PurpleAccount *account, char *sender, |
| 144 | char *message, PurpleConversation *conv, | |
| 145 | PurpleMessageFlags flags, PurpleSoundEventID event) | |
|
11552
674a2a79943a
[gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents:
11463
diff
changeset
|
146 | { |
| 15884 | 147 | if (flags & PURPLE_MESSAGE_DELAYED) |
|
12850
744542bdd53e
[gaim-migrate @ 15200]
Casey Harkins <charkins@pidgin.im>
parents:
12828
diff
changeset
|
148 | return; |
|
744542bdd53e
[gaim-migrate @ 15200]
Casey Harkins <charkins@pidgin.im>
parents:
12828
diff
changeset
|
149 | |
|
11552
674a2a79943a
[gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents:
11463
diff
changeset
|
150 | if (conv==NULL) |
| 15884 | 151 | purple_sound_play_event(PURPLE_SOUND_FIRST_RECEIVE, account); |
|
11552
674a2a79943a
[gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents:
11463
diff
changeset
|
152 | else |
|
674a2a79943a
[gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents:
11463
diff
changeset
|
153 | play_conv_event(conv, event); |
|
674a2a79943a
[gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents:
11463
diff
changeset
|
154 | } |
|
674a2a79943a
[gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents:
11463
diff
changeset
|
155 | |
|
674a2a79943a
[gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents:
11463
diff
changeset
|
156 | static void |
| 15884 | 157 | im_msg_sent_cb(PurpleAccount *account, const char *receiver, |
| 158 | const char *message, PurpleSoundEventID event) | |
|
11552
674a2a79943a
[gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents:
11463
diff
changeset
|
159 | { |
| 15884 | 160 | PurpleConversation *conv = purple_find_conversation_with_account( |
| 161 | PURPLE_CONV_TYPE_ANY, receiver, account); | |
|
11552
674a2a79943a
[gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents:
11463
diff
changeset
|
162 | play_conv_event(conv, event); |
|
674a2a79943a
[gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents:
11463
diff
changeset
|
163 | } |
|
674a2a79943a
[gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents:
11463
diff
changeset
|
164 | |
|
674a2a79943a
[gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents:
11463
diff
changeset
|
165 | static void |
| 15884 | 166 | chat_buddy_join_cb(PurpleConversation *conv, const char *name, |
| 167 | PurpleConvChatBuddyFlags flags, gboolean new_arrival, | |
| 168 | PurpleSoundEventID event) | |
|
11552
674a2a79943a
[gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents:
11463
diff
changeset
|
169 | { |
|
12850
744542bdd53e
[gaim-migrate @ 15200]
Casey Harkins <charkins@pidgin.im>
parents:
12828
diff
changeset
|
170 | if (new_arrival && !chat_nick_matches_name(conv, name)) |
|
11552
674a2a79943a
[gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents:
11463
diff
changeset
|
171 | play_conv_event(conv, event); |
|
674a2a79943a
[gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents:
11463
diff
changeset
|
172 | } |
|
674a2a79943a
[gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents:
11463
diff
changeset
|
173 | |
|
674a2a79943a
[gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents:
11463
diff
changeset
|
174 | static void |
| 15884 | 175 | chat_buddy_left_cb(PurpleConversation *conv, const char *name, |
| 176 | const char *reason, PurpleSoundEventID event) | |
|
11552
674a2a79943a
[gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents:
11463
diff
changeset
|
177 | { |
| 11581 | 178 | if (!chat_nick_matches_name(conv, name)) |
|
11552
674a2a79943a
[gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents:
11463
diff
changeset
|
179 | play_conv_event(conv, event); |
|
674a2a79943a
[gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents:
11463
diff
changeset
|
180 | } |
|
674a2a79943a
[gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents:
11463
diff
changeset
|
181 | |
|
674a2a79943a
[gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents:
11463
diff
changeset
|
182 | static void |
| 15884 | 183 | chat_msg_sent_cb(PurpleAccount *account, const char *message, |
| 184 | int id, PurpleSoundEventID event) | |
|
11552
674a2a79943a
[gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents:
11463
diff
changeset
|
185 | { |
| 15884 | 186 | PurpleConnection *conn = purple_account_get_connection(account); |
| 187 | PurpleConversation *conv = NULL; | |
|
11552
674a2a79943a
[gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents:
11463
diff
changeset
|
188 | |
| 11581 | 189 | if (conn!=NULL) |
| 15884 | 190 | conv = purple_find_chat(conn,id); |
|
11552
674a2a79943a
[gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents:
11463
diff
changeset
|
191 | |
|
674a2a79943a
[gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents:
11463
diff
changeset
|
192 | play_conv_event(conv, event); |
|
674a2a79943a
[gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents:
11463
diff
changeset
|
193 | } |
|
674a2a79943a
[gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents:
11463
diff
changeset
|
194 | |
|
674a2a79943a
[gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents:
11463
diff
changeset
|
195 | static void |
| 15884 | 196 | chat_msg_received_cb(PurpleAccount *account, char *sender, |
| 197 | char *message, PurpleConversation *conv, | |
| 198 | PurpleMessageFlags flags, PurpleSoundEventID event) | |
|
11552
674a2a79943a
[gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents:
11463
diff
changeset
|
199 | { |
| 15884 | 200 | PurpleConvChat *chat; |
|
11552
674a2a79943a
[gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents:
11463
diff
changeset
|
201 | |
| 15884 | 202 | if (flags & PURPLE_MESSAGE_DELAYED) |
|
12850
744542bdd53e
[gaim-migrate @ 15200]
Casey Harkins <charkins@pidgin.im>
parents:
12828
diff
changeset
|
203 | return; |
|
744542bdd53e
[gaim-migrate @ 15200]
Casey Harkins <charkins@pidgin.im>
parents:
12828
diff
changeset
|
204 | |
| 15884 | 205 | chat = purple_conversation_get_chat_data(conv); |
|
13413
8cdf761df65c
[gaim-migrate @ 15787]
Richard Laager <rlaager@pidgin.im>
parents:
13046
diff
changeset
|
206 | g_return_if_fail(chat != NULL); |
|
11552
674a2a79943a
[gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents:
11463
diff
changeset
|
207 | |
| 15884 | 208 | if (purple_conv_chat_is_user_ignored(chat, sender)) |
|
11552
674a2a79943a
[gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents:
11463
diff
changeset
|
209 | return; |
|
674a2a79943a
[gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents:
11463
diff
changeset
|
210 | |
|
674a2a79943a
[gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents:
11463
diff
changeset
|
211 | if (chat_nick_matches_name(conv, sender)) |
|
674a2a79943a
[gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents:
11463
diff
changeset
|
212 | return; |
|
674a2a79943a
[gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents:
11463
diff
changeset
|
213 | |
| 15884 | 214 | if (flags & PURPLE_MESSAGE_NICK || purple_utf8_has_word(message, chat->nick)) |
| 215 | play_conv_event(conv, PURPLE_SOUND_CHAT_NICK); | |
|
11552
674a2a79943a
[gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents:
11463
diff
changeset
|
216 | else |
|
674a2a79943a
[gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents:
11463
diff
changeset
|
217 | play_conv_event(conv, event); |
|
674a2a79943a
[gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents:
11463
diff
changeset
|
218 | } |
|
674a2a79943a
[gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents:
11463
diff
changeset
|
219 | |
|
10320
f5b0f5cf8562
[gaim-migrate @ 11527]
Mark Doliner <markdoliner@pidgin.im>
parents:
10297
diff
changeset
|
220 | /* |
|
f5b0f5cf8562
[gaim-migrate @ 11527]
Mark Doliner <markdoliner@pidgin.im>
parents:
10297
diff
changeset
|
221 | * We mute sounds for the 10 seconds after you log in so that |
|
f5b0f5cf8562
[gaim-migrate @ 11527]
Mark Doliner <markdoliner@pidgin.im>
parents:
10297
diff
changeset
|
222 | * you don't get flooded with sounds when the blist shows all |
|
f5b0f5cf8562
[gaim-migrate @ 11527]
Mark Doliner <markdoliner@pidgin.im>
parents:
10297
diff
changeset
|
223 | * your buddies logging in. |
|
f5b0f5cf8562
[gaim-migrate @ 11527]
Mark Doliner <markdoliner@pidgin.im>
parents:
10297
diff
changeset
|
224 | */ |
|
f5b0f5cf8562
[gaim-migrate @ 11527]
Mark Doliner <markdoliner@pidgin.im>
parents:
10297
diff
changeset
|
225 | static void |
| 15884 | 226 | account_signon_cb(PurpleConnection *gc, gpointer data) |
|
10320
f5b0f5cf8562
[gaim-migrate @ 11527]
Mark Doliner <markdoliner@pidgin.im>
parents:
10297
diff
changeset
|
227 | { |
|
f5b0f5cf8562
[gaim-migrate @ 11527]
Mark Doliner <markdoliner@pidgin.im>
parents:
10297
diff
changeset
|
228 | if (mute_login_sounds_timeout != 0) |
|
f5b0f5cf8562
[gaim-migrate @ 11527]
Mark Doliner <markdoliner@pidgin.im>
parents:
10297
diff
changeset
|
229 | g_source_remove(mute_login_sounds_timeout); |
|
f5b0f5cf8562
[gaim-migrate @ 11527]
Mark Doliner <markdoliner@pidgin.im>
parents:
10297
diff
changeset
|
230 | mute_login_sounds = TRUE; |
| 15884 | 231 | mute_login_sounds_timeout = purple_timeout_add(10000, unmute_login_sounds_cb, NULL); |
|
10320
f5b0f5cf8562
[gaim-migrate @ 11527]
Mark Doliner <markdoliner@pidgin.im>
parents:
10297
diff
changeset
|
232 | } |
|
f5b0f5cf8562
[gaim-migrate @ 11527]
Mark Doliner <markdoliner@pidgin.im>
parents:
10297
diff
changeset
|
233 | |
|
10322
06e23196da4b
[gaim-migrate @ 11529]
Mark Doliner <markdoliner@pidgin.im>
parents:
10320
diff
changeset
|
234 | const char * |
| 15884 | 235 | pidgin_sound_get_event_option(PurpleSoundEventID event) |
|
10322
06e23196da4b
[gaim-migrate @ 11529]
Mark Doliner <markdoliner@pidgin.im>
parents:
10320
diff
changeset
|
236 | { |
| 15884 | 237 | if(event >= PURPLE_NUM_SOUNDS) |
|
10322
06e23196da4b
[gaim-migrate @ 11529]
Mark Doliner <markdoliner@pidgin.im>
parents:
10320
diff
changeset
|
238 | return 0; |
|
06e23196da4b
[gaim-migrate @ 11529]
Mark Doliner <markdoliner@pidgin.im>
parents:
10320
diff
changeset
|
239 | |
|
06e23196da4b
[gaim-migrate @ 11529]
Mark Doliner <markdoliner@pidgin.im>
parents:
10320
diff
changeset
|
240 | return sounds[event].pref; |
|
06e23196da4b
[gaim-migrate @ 11529]
Mark Doliner <markdoliner@pidgin.im>
parents:
10320
diff
changeset
|
241 | } |
|
06e23196da4b
[gaim-migrate @ 11529]
Mark Doliner <markdoliner@pidgin.im>
parents:
10320
diff
changeset
|
242 | |
|
15165
0ff631dfbbca
[gaim-migrate @ 17889]
Daniel Atallah <datallah@pidgin.im>
parents:
14972
diff
changeset
|
243 | const char * |
| 15884 | 244 | pidgin_sound_get_event_label(PurpleSoundEventID event) |
|
10322
06e23196da4b
[gaim-migrate @ 11529]
Mark Doliner <markdoliner@pidgin.im>
parents:
10320
diff
changeset
|
245 | { |
| 15884 | 246 | if(event >= PURPLE_NUM_SOUNDS) |
|
10322
06e23196da4b
[gaim-migrate @ 11529]
Mark Doliner <markdoliner@pidgin.im>
parents:
10320
diff
changeset
|
247 | return NULL; |
|
06e23196da4b
[gaim-migrate @ 11529]
Mark Doliner <markdoliner@pidgin.im>
parents:
10320
diff
changeset
|
248 | |
|
06e23196da4b
[gaim-migrate @ 11529]
Mark Doliner <markdoliner@pidgin.im>
parents:
10320
diff
changeset
|
249 | return sounds[event].label; |
|
06e23196da4b
[gaim-migrate @ 11529]
Mark Doliner <markdoliner@pidgin.im>
parents:
10320
diff
changeset
|
250 | } |
|
06e23196da4b
[gaim-migrate @ 11529]
Mark Doliner <markdoliner@pidgin.im>
parents:
10320
diff
changeset
|
251 | |
|
06e23196da4b
[gaim-migrate @ 11529]
Mark Doliner <markdoliner@pidgin.im>
parents:
10320
diff
changeset
|
252 | void * |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
253 | pidgin_sound_get_handle() |
|
10322
06e23196da4b
[gaim-migrate @ 11529]
Mark Doliner <markdoliner@pidgin.im>
parents:
10320
diff
changeset
|
254 | { |
|
06e23196da4b
[gaim-migrate @ 11529]
Mark Doliner <markdoliner@pidgin.im>
parents:
10320
diff
changeset
|
255 | static int handle; |
|
06e23196da4b
[gaim-migrate @ 11529]
Mark Doliner <markdoliner@pidgin.im>
parents:
10320
diff
changeset
|
256 | |
|
06e23196da4b
[gaim-migrate @ 11529]
Mark Doliner <markdoliner@pidgin.im>
parents:
10320
diff
changeset
|
257 | return &handle; |
|
06e23196da4b
[gaim-migrate @ 11529]
Mark Doliner <markdoliner@pidgin.im>
parents:
10320
diff
changeset
|
258 | } |
|
06e23196da4b
[gaim-migrate @ 11529]
Mark Doliner <markdoliner@pidgin.im>
parents:
10320
diff
changeset
|
259 | |
|
06e23196da4b
[gaim-migrate @ 11529]
Mark Doliner <markdoliner@pidgin.im>
parents:
10320
diff
changeset
|
260 | static void |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
261 | pidgin_sound_init(void) |
| 5684 | 262 | { |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
263 | void *gtk_sound_handle = pidgin_sound_get_handle(); |
| 15884 | 264 | void *blist_handle = purple_blist_get_handle(); |
| 265 | void *conv_handle = purple_conversations_get_handle(); | |
|
14315
908ff155af2e
[gaim-migrate @ 16935]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14253
diff
changeset
|
266 | #ifdef USE_GSTREAMER |
|
908ff155af2e
[gaim-migrate @ 16935]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14253
diff
changeset
|
267 | GError *error = NULL; |
|
908ff155af2e
[gaim-migrate @ 16935]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14253
diff
changeset
|
268 | #endif |
|
10320
f5b0f5cf8562
[gaim-migrate @ 11527]
Mark Doliner <markdoliner@pidgin.im>
parents:
10297
diff
changeset
|
269 | |
| 15884 | 270 | purple_signal_connect(purple_connections_get_handle(), "signed-on", |
| 271 | gtk_sound_handle, PURPLE_CALLBACK(account_signon_cb), | |
|
10320
f5b0f5cf8562
[gaim-migrate @ 11527]
Mark Doliner <markdoliner@pidgin.im>
parents:
10297
diff
changeset
|
272 | NULL); |
|
f5b0f5cf8562
[gaim-migrate @ 11527]
Mark Doliner <markdoliner@pidgin.im>
parents:
10297
diff
changeset
|
273 | |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
274 | purple_prefs_add_none(PIDGIN_PREFS_ROOT "/sound"); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
275 | purple_prefs_add_none(PIDGIN_PREFS_ROOT "/sound/enabled"); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
276 | purple_prefs_add_none(PIDGIN_PREFS_ROOT "/sound/file"); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
277 | purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/sound/enabled/login", TRUE); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
278 | purple_prefs_add_path(PIDGIN_PREFS_ROOT "/sound/file/login", ""); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
279 | purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/sound/enabled/logout", TRUE); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
280 | purple_prefs_add_path(PIDGIN_PREFS_ROOT "/sound/file/logout", ""); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
281 | purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/sound/enabled/im_recv", TRUE); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
282 | purple_prefs_add_path(PIDGIN_PREFS_ROOT "/sound/file/im_recv", ""); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
283 | purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/sound/enabled/first_im_recv", FALSE); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
284 | purple_prefs_add_path(PIDGIN_PREFS_ROOT "/sound/file/first_im_recv", ""); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
285 | purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/sound/enabled/send_im", TRUE); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
286 | purple_prefs_add_path(PIDGIN_PREFS_ROOT "/sound/file/send_im", ""); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
287 | purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/sound/enabled/join_chat", FALSE); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
288 | purple_prefs_add_path(PIDGIN_PREFS_ROOT "/sound/file/join_chat", ""); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
289 | purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/sound/enabled/left_chat", FALSE); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
290 | purple_prefs_add_path(PIDGIN_PREFS_ROOT "/sound/file/left_chat", ""); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
291 | purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/sound/enabled/send_chat_msg", FALSE); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
292 | purple_prefs_add_path(PIDGIN_PREFS_ROOT "/sound/file/send_chat_msg", ""); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
293 | purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/sound/enabled/chat_msg_recv", FALSE); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
294 | purple_prefs_add_path(PIDGIN_PREFS_ROOT "/sound/file/chat_msg_recv", ""); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
295 | purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/sound/enabled/nick_said", FALSE); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
296 | purple_prefs_add_path(PIDGIN_PREFS_ROOT "/sound/file/nick_said", ""); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
297 | purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/sound/enabled/pounce_default", TRUE); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
298 | purple_prefs_add_path(PIDGIN_PREFS_ROOT "/sound/file/pounce_default", ""); |
|
23649
5da5fe967d10
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23314
diff
changeset
|
299 | purple_prefs_add_string(PIDGIN_PREFS_ROOT "/sound/theme", ""); |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
300 | purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/sound/conv_focus", TRUE); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
301 | purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/sound/mute", FALSE); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
302 | purple_prefs_add_path(PIDGIN_PREFS_ROOT "/sound/command", ""); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
303 | purple_prefs_add_string(PIDGIN_PREFS_ROOT "/sound/method", "automatic"); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
304 | purple_prefs_add_int(PIDGIN_PREFS_ROOT "/sound/volume", 50); |
| 5684 | 305 | |
| 13720 | 306 | #ifdef USE_GSTREAMER |
| 15884 | 307 | purple_debug_info("sound", "Initializing sound output drivers.\n"); |
|
22631
ba53b0eadb20
Revert the dependency on gstreamer-0.10 >= 0.10.10, falling back to the SIGALRM
Will Thompson <resiak@pidgin.im>
parents:
22565
diff
changeset
|
308 | #ifdef GST_CAN_DISABLE_FORKING |
|
22565
d1943619d6f9
Tell gstreamer not to fork; remove the SIGCHLD -> SIGALRM hack, which made
Will Thompson <resiak@pidgin.im>
parents:
21125
diff
changeset
|
309 | gst_registry_fork_set_enabled (FALSE); |
|
22631
ba53b0eadb20
Revert the dependency on gstreamer-0.10 >= 0.10.10, falling back to the SIGALRM
Will Thompson <resiak@pidgin.im>
parents:
22565
diff
changeset
|
310 | #endif |
|
14315
908ff155af2e
[gaim-migrate @ 16935]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14253
diff
changeset
|
311 | if ((gst_init_failed = !gst_init_check(NULL, NULL, &error))) { |
| 15884 | 312 | purple_notify_error(NULL, _("GStreamer Failure"), |
|
14315
908ff155af2e
[gaim-migrate @ 16935]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14253
diff
changeset
|
313 | _("GStreamer failed to initialize."), |
|
908ff155af2e
[gaim-migrate @ 16935]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14253
diff
changeset
|
314 | error ? error->message : ""); |
|
908ff155af2e
[gaim-migrate @ 16935]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14253
diff
changeset
|
315 | if (error) { |
|
908ff155af2e
[gaim-migrate @ 16935]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14253
diff
changeset
|
316 | g_error_free(error); |
|
908ff155af2e
[gaim-migrate @ 16935]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14253
diff
changeset
|
317 | error = NULL; |
|
908ff155af2e
[gaim-migrate @ 16935]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14253
diff
changeset
|
318 | } |
|
908ff155af2e
[gaim-migrate @ 16935]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14253
diff
changeset
|
319 | } |
| 13720 | 320 | #endif /* USE_GSTREAMER */ |
|
11552
674a2a79943a
[gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents:
11463
diff
changeset
|
321 | |
| 15884 | 322 | purple_signal_connect(blist_handle, "buddy-signed-on", |
| 323 | gtk_sound_handle, PURPLE_CALLBACK(buddy_state_cb), | |
| 324 | GINT_TO_POINTER(PURPLE_SOUND_BUDDY_ARRIVE)); | |
| 325 | purple_signal_connect(blist_handle, "buddy-signed-off", | |
| 326 | gtk_sound_handle, PURPLE_CALLBACK(buddy_state_cb), | |
| 327 | GINT_TO_POINTER(PURPLE_SOUND_BUDDY_LEAVE)); | |
| 328 | purple_signal_connect(conv_handle, "received-im-msg", | |
| 329 | gtk_sound_handle, PURPLE_CALLBACK(im_msg_received_cb), | |
| 330 | GINT_TO_POINTER(PURPLE_SOUND_RECEIVE)); | |
| 331 | purple_signal_connect(conv_handle, "sent-im-msg", | |
| 332 | gtk_sound_handle, PURPLE_CALLBACK(im_msg_sent_cb), | |
| 333 | GINT_TO_POINTER(PURPLE_SOUND_SEND)); | |
| 334 | purple_signal_connect(conv_handle, "chat-buddy-joined", | |
| 335 | gtk_sound_handle, PURPLE_CALLBACK(chat_buddy_join_cb), | |
| 336 | GINT_TO_POINTER(PURPLE_SOUND_CHAT_JOIN)); | |
| 337 | purple_signal_connect(conv_handle, "chat-buddy-left", | |
| 338 | gtk_sound_handle, PURPLE_CALLBACK(chat_buddy_left_cb), | |
| 339 | GINT_TO_POINTER(PURPLE_SOUND_CHAT_LEAVE)); | |
| 340 | purple_signal_connect(conv_handle, "sent-chat-msg", | |
| 341 | gtk_sound_handle, PURPLE_CALLBACK(chat_msg_sent_cb), | |
| 342 | GINT_TO_POINTER(PURPLE_SOUND_CHAT_YOU_SAY)); | |
| 343 | purple_signal_connect(conv_handle, "received-chat-msg", | |
| 344 | gtk_sound_handle, PURPLE_CALLBACK(chat_msg_received_cb), | |
| 345 | GINT_TO_POINTER(PURPLE_SOUND_CHAT_SAY)); | |
| 5684 | 346 | } |
| 347 | ||
|
10322
06e23196da4b
[gaim-migrate @ 11529]
Mark Doliner <markdoliner@pidgin.im>
parents:
10320
diff
changeset
|
348 | static void |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
349 | pidgin_sound_uninit(void) |
| 5684 | 350 | { |
| 13720 | 351 | #ifdef USE_GSTREAMER |
|
14315
908ff155af2e
[gaim-migrate @ 16935]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14253
diff
changeset
|
352 | if (!gst_init_failed) |
|
908ff155af2e
[gaim-migrate @ 16935]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14253
diff
changeset
|
353 | gst_deinit(); |
| 5684 | 354 | #endif |
|
11552
674a2a79943a
[gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents:
11463
diff
changeset
|
355 | |
| 15884 | 356 | purple_signals_disconnect_by_handle(pidgin_sound_get_handle()); |
| 5684 | 357 | } |
| 358 | ||
| 13720 | 359 | #ifdef USE_GSTREAMER |
|
10322
06e23196da4b
[gaim-migrate @ 11529]
Mark Doliner <markdoliner@pidgin.im>
parents:
10320
diff
changeset
|
360 | static gboolean |
| 13720 | 361 | bus_call (GstBus *bus, |
| 362 | GstMessage *msg, | |
|
14097
0c340861ab79
[gaim-migrate @ 16638]
Mark Doliner <markdoliner@pidgin.im>
parents:
13799
diff
changeset
|
363 | gpointer data) |
|
12815
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12411
diff
changeset
|
364 | { |
| 13720 | 365 | GstElement *play = data; |
|
14941
0c27c799be04
[gaim-migrate @ 17648]
Mark Doliner <markdoliner@pidgin.im>
parents:
14762
diff
changeset
|
366 | GError *err = NULL; |
|
10074
4fab99572bf1
[gaim-migrate @ 11054]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9791
diff
changeset
|
367 | |
| 13720 | 368 | switch (GST_MESSAGE_TYPE (msg)) { |
| 369 | case GST_MESSAGE_ERROR: | |
| 370 | gst_message_parse_error(msg, &err, NULL); | |
|
17731
6486f382fb08
Improve the formatting of some gstreamer error messages. Someone
Mark Doliner <markdoliner@pidgin.im>
parents:
17146
diff
changeset
|
371 | purple_debug_error("gstreamer", "%s\n", err->message); |
| 13720 | 372 | g_error_free(err); |
|
19564
6f04c6ab2897
Cleanup playbin on error. Thanks, Elliott Sales de Andrade. Fixes #2663
Sean Egan <seanegan@pidgin.im>
parents:
18292
diff
changeset
|
373 | /* fall-through and clean up */ |
|
6f04c6ab2897
Cleanup playbin on error. Thanks, Elliott Sales de Andrade. Fixes #2663
Sean Egan <seanegan@pidgin.im>
parents:
18292
diff
changeset
|
374 | case GST_MESSAGE_EOS: |
|
6f04c6ab2897
Cleanup playbin on error. Thanks, Elliott Sales de Andrade. Fixes #2663
Sean Egan <seanegan@pidgin.im>
parents:
18292
diff
changeset
|
375 | gst_element_set_state(play, GST_STATE_NULL); |
|
6f04c6ab2897
Cleanup playbin on error. Thanks, Elliott Sales de Andrade. Fixes #2663
Sean Egan <seanegan@pidgin.im>
parents:
18292
diff
changeset
|
376 | gst_object_unref(GST_OBJECT(play)); |
| 13720 | 377 | break; |
| 378 | case GST_MESSAGE_WARNING: | |
| 379 | gst_message_parse_warning(msg, &err, NULL); | |
|
17732
b6325601b1ff
I left off a comma. My bad!
Mark Doliner <markdoliner@pidgin.im>
parents:
17731
diff
changeset
|
380 | purple_debug_warning("gstreamer", "%s\n", err->message); |
| 13720 | 381 | g_error_free(err); |
| 382 | break; | |
| 383 | default: | |
| 384 | break; | |
| 385 | } | |
| 386 | return TRUE; | |
| 387 | } | |
|
12930
2a65c7c86e86
[gaim-migrate @ 15283]
Richard Laager <rlaager@pidgin.im>
parents:
12850
diff
changeset
|
388 | #endif |
|
12815
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12411
diff
changeset
|
389 | |
|
23027
5df4eac489e2
Kill off sound playing child processes if they are still around after 15
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22942
diff
changeset
|
390 | #ifndef _WIN32 |
|
5df4eac489e2
Kill off sound playing child processes if they are still around after 15
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22942
diff
changeset
|
391 | static gboolean |
|
5df4eac489e2
Kill off sound playing child processes if they are still around after 15
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22942
diff
changeset
|
392 | expire_old_child(gpointer data) |
|
5df4eac489e2
Kill off sound playing child processes if they are still around after 15
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22942
diff
changeset
|
393 | { |
|
5df4eac489e2
Kill off sound playing child processes if they are still around after 15
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22942
diff
changeset
|
394 | pid_t pid = GPOINTER_TO_INT(data); |
|
5df4eac489e2
Kill off sound playing child processes if they are still around after 15
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22942
diff
changeset
|
395 | |
|
5df4eac489e2
Kill off sound playing child processes if they are still around after 15
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22942
diff
changeset
|
396 | if (waitpid(pid, NULL, WNOHANG | WUNTRACED) < 0) { |
|
5df4eac489e2
Kill off sound playing child processes if they are still around after 15
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22942
diff
changeset
|
397 | if (errno == ECHILD) |
|
5df4eac489e2
Kill off sound playing child processes if they are still around after 15
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22942
diff
changeset
|
398 | return FALSE; |
|
5df4eac489e2
Kill off sound playing child processes if they are still around after 15
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22942
diff
changeset
|
399 | else |
|
5df4eac489e2
Kill off sound playing child processes if they are still around after 15
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22942
diff
changeset
|
400 | purple_debug_warning("gtksound", "Child is ill, pid: %d (%s)\n", pid, strerror(errno)); |
|
5df4eac489e2
Kill off sound playing child processes if they are still around after 15
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22942
diff
changeset
|
401 | } |
|
5df4eac489e2
Kill off sound playing child processes if they are still around after 15
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22942
diff
changeset
|
402 | |
|
5df4eac489e2
Kill off sound playing child processes if they are still around after 15
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22942
diff
changeset
|
403 | if (kill(pid, SIGKILL) < 0) |
|
5df4eac489e2
Kill off sound playing child processes if they are still around after 15
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22942
diff
changeset
|
404 | purple_debug_error("gtksound", "Killing process %d failed (%s)\n", pid, strerror(errno)); |
|
5df4eac489e2
Kill off sound playing child processes if they are still around after 15
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22942
diff
changeset
|
405 | |
|
5df4eac489e2
Kill off sound playing child processes if they are still around after 15
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22942
diff
changeset
|
406 | return FALSE; |
|
5df4eac489e2
Kill off sound playing child processes if they are still around after 15
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22942
diff
changeset
|
407 | } |
|
5df4eac489e2
Kill off sound playing child processes if they are still around after 15
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22942
diff
changeset
|
408 | #endif |
|
5df4eac489e2
Kill off sound playing child processes if they are still around after 15
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22942
diff
changeset
|
409 | |
|
10322
06e23196da4b
[gaim-migrate @ 11529]
Mark Doliner <markdoliner@pidgin.im>
parents:
10320
diff
changeset
|
410 | static void |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
411 | pidgin_sound_play_file(const char *filename) |
| 5684 | 412 | { |
| 413 | const char *method; | |
| 13720 | 414 | #ifdef USE_GSTREAMER |
| 415 | float volume; | |
| 416 | char *uri; | |
| 417 | GstElement *sink = NULL; | |
| 418 | GstElement *play = NULL; | |
|
15285
505ff058278c
[gaim-migrate @ 18013]
Mark Doliner <markdoliner@pidgin.im>
parents:
15165
diff
changeset
|
419 | GstBus *bus = NULL; |
| 5684 | 420 | #endif |
| 421 | ||
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
422 | if (purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/sound/mute")) |
| 5684 | 423 | return; |
| 424 | ||
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
425 | method = purple_prefs_get_string(PIDGIN_PREFS_ROOT "/sound/method"); |
| 5684 | 426 | |
|
10074
4fab99572bf1
[gaim-migrate @ 11054]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9791
diff
changeset
|
427 | if (!strcmp(method, "none")) { |
|
4fab99572bf1
[gaim-migrate @ 11054]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9791
diff
changeset
|
428 | return; |
|
4fab99572bf1
[gaim-migrate @ 11054]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9791
diff
changeset
|
429 | } else if (!strcmp(method, "beep")) { |
| 5684 | 430 | gdk_beep(); |
| 431 | return; | |
| 432 | } | |
| 433 | ||
| 13797 | 434 | if (!g_file_test(filename, G_FILE_TEST_EXISTS)) { |
| 15884 | 435 | purple_debug_error("gtksound", "sound file (%s) does not exist.\n", filename); |
| 5684 | 436 | return; |
| 13797 | 437 | } |
| 5684 | 438 | |
| 439 | #ifndef _WIN32 | |
| 440 | if (!strcmp(method, "custom")) { | |
| 441 | const char *sound_cmd; | |
| 442 | char *command; | |
|
16951
d7d924e847d6
Escape filename when using the command sound method. Fixes ticket #607.
Casey Harkins <charkins@pidgin.im>
parents:
16752
diff
changeset
|
443 | char *esc_filename; |
|
23027
5df4eac489e2
Kill off sound playing child processes if they are still around after 15
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22942
diff
changeset
|
444 | char **argv = NULL; |
| 5684 | 445 | GError *error = NULL; |
|
23027
5df4eac489e2
Kill off sound playing child processes if they are still around after 15
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22942
diff
changeset
|
446 | GPid pid; |
| 5684 | 447 | |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
448 | sound_cmd = purple_prefs_get_path(PIDGIN_PREFS_ROOT "/sound/command"); |
| 5684 | 449 | |
| 450 | if (!sound_cmd || *sound_cmd == '\0') { | |
| 15884 | 451 | purple_debug_error("gtksound", |
| 13797 | 452 | "'Command' sound method has been chosen, " |
|
24572
d2f6abb70f4e
Missing newline in debug message.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23314
diff
changeset
|
453 | "but no command has been set.\n"); |
| 5684 | 454 | return; |
| 455 | } | |
| 456 | ||
|
16959
5ae554ed8299
Let glib handle quoting filenames for shell, it'll escape other quotes as needed.
Casey Harkins <charkins@pidgin.im>
parents:
16951
diff
changeset
|
457 | esc_filename = g_shell_quote(filename); |
|
16951
d7d924e847d6
Escape filename when using the command sound method. Fixes ticket #607.
Casey Harkins <charkins@pidgin.im>
parents:
16752
diff
changeset
|
458 | |
| 7464 | 459 | if(strstr(sound_cmd, "%s")) |
|
16951
d7d924e847d6
Escape filename when using the command sound method. Fixes ticket #607.
Casey Harkins <charkins@pidgin.im>
parents:
16752
diff
changeset
|
460 | command = purple_strreplace(sound_cmd, "%s", esc_filename); |
| 7464 | 461 | else |
|
16951
d7d924e847d6
Escape filename when using the command sound method. Fixes ticket #607.
Casey Harkins <charkins@pidgin.im>
parents:
16752
diff
changeset
|
462 | command = g_strdup_printf("%s %s", sound_cmd, esc_filename); |
| 5684 | 463 | |
|
23027
5df4eac489e2
Kill off sound playing child processes if they are still around after 15
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22942
diff
changeset
|
464 | if (!g_shell_parse_argv(command, NULL, &argv, &error)) { |
|
5df4eac489e2
Kill off sound playing child processes if they are still around after 15
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22942
diff
changeset
|
465 | purple_debug_error("gtksound", "error parsing command %s (%s)\n", |
|
5df4eac489e2
Kill off sound playing child processes if they are still around after 15
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22942
diff
changeset
|
466 | command, error->message); |
| 5684 | 467 | g_error_free(error); |
|
23027
5df4eac489e2
Kill off sound playing child processes if they are still around after 15
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22942
diff
changeset
|
468 | g_free(esc_filename); |
|
5df4eac489e2
Kill off sound playing child processes if they are still around after 15
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22942
diff
changeset
|
469 | g_free(command); |
|
5df4eac489e2
Kill off sound playing child processes if they are still around after 15
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22942
diff
changeset
|
470 | return; |
| 5684 | 471 | } |
| 472 | ||
|
23027
5df4eac489e2
Kill off sound playing child processes if they are still around after 15
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22942
diff
changeset
|
473 | if (!g_spawn_async(NULL, argv, NULL, G_SPAWN_SEARCH_PATH | G_SPAWN_DO_NOT_REAP_CHILD, |
|
5df4eac489e2
Kill off sound playing child processes if they are still around after 15
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22942
diff
changeset
|
474 | NULL, NULL, &pid, &error)) { |
|
5df4eac489e2
Kill off sound playing child processes if they are still around after 15
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22942
diff
changeset
|
475 | purple_debug_error("gtksound", "sound command could not be launched: %s\n", |
|
5df4eac489e2
Kill off sound playing child processes if they are still around after 15
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22942
diff
changeset
|
476 | error->message); |
|
5df4eac489e2
Kill off sound playing child processes if they are still around after 15
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22942
diff
changeset
|
477 | g_error_free(error); |
|
5df4eac489e2
Kill off sound playing child processes if they are still around after 15
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22942
diff
changeset
|
478 | } else { |
|
5df4eac489e2
Kill off sound playing child processes if they are still around after 15
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22942
diff
changeset
|
479 | purple_timeout_add_seconds(15, expire_old_child, GINT_TO_POINTER(pid)); |
|
5df4eac489e2
Kill off sound playing child processes if they are still around after 15
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22942
diff
changeset
|
480 | } |
|
5df4eac489e2
Kill off sound playing child processes if they are still around after 15
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22942
diff
changeset
|
481 | |
|
5df4eac489e2
Kill off sound playing child processes if they are still around after 15
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22942
diff
changeset
|
482 | g_strfreev(argv); |
|
16951
d7d924e847d6
Escape filename when using the command sound method. Fixes ticket #607.
Casey Harkins <charkins@pidgin.im>
parents:
16752
diff
changeset
|
483 | g_free(esc_filename); |
| 5684 | 484 | g_free(command); |
| 485 | return; | |
| 486 | } | |
|
19849
e8a23f4721f0
Don't assume that the Gstreamer stuff isn't used on win32. There really isn't anything to see here.
Daniel Atallah <datallah@pidgin.im>
parents:
19591
diff
changeset
|
487 | #endif /* _WIN32 */ |
|
e8a23f4721f0
Don't assume that the Gstreamer stuff isn't used on win32. There really isn't anything to see here.
Daniel Atallah <datallah@pidgin.im>
parents:
19591
diff
changeset
|
488 | |
| 13720 | 489 | #ifdef USE_GSTREAMER |
|
14315
908ff155af2e
[gaim-migrate @ 16935]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14253
diff
changeset
|
490 | if (gst_init_failed) /* Perhaps do gdk_beep instead? */ |
|
908ff155af2e
[gaim-migrate @ 16935]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14253
diff
changeset
|
491 | return; |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
492 | volume = (float)(CLAMP(purple_prefs_get_int(PIDGIN_PREFS_ROOT "/sound/volume"),0,100)) / 50; |
| 13720 | 493 | if (!strcmp(method, "automatic")) { |
|
23314
f9ed181439a4
Try gconfaudiosink first always, not just under GNOME. This is what Debian
Richard Laager <rlaager@pidgin.im>
parents:
23239
diff
changeset
|
494 | sink = gst_element_factory_make("gconfaudiosink", "sink"); |
|
19849
e8a23f4721f0
Don't assume that the Gstreamer stuff isn't used on win32. There really isn't anything to see here.
Daniel Atallah <datallah@pidgin.im>
parents:
19591
diff
changeset
|
495 | } |
|
e8a23f4721f0
Don't assume that the Gstreamer stuff isn't used on win32. There really isn't anything to see here.
Daniel Atallah <datallah@pidgin.im>
parents:
19591
diff
changeset
|
496 | #ifndef _WIN32 |
|
e8a23f4721f0
Don't assume that the Gstreamer stuff isn't used on win32. There really isn't anything to see here.
Daniel Atallah <datallah@pidgin.im>
parents:
19591
diff
changeset
|
497 | else if (!strcmp(method, "esd")) { |
| 13720 | 498 | sink = gst_element_factory_make("esdsink", "sink"); |
|
17146
7d256e417ef6
ALSA Gstreamer sink. Mostly to see if this still crashes Luke.
Sean Egan <seanegan@pidgin.im>
parents:
16995
diff
changeset
|
499 | } else if (!strcmp(method, "alsa")) { |
|
7d256e417ef6
ALSA Gstreamer sink. Mostly to see if this still crashes Luke.
Sean Egan <seanegan@pidgin.im>
parents:
16995
diff
changeset
|
500 | sink = gst_element_factory_make("alsasink", "sink"); |
|
19849
e8a23f4721f0
Don't assume that the Gstreamer stuff isn't used on win32. There really isn't anything to see here.
Daniel Atallah <datallah@pidgin.im>
parents:
19591
diff
changeset
|
501 | } |
|
e8a23f4721f0
Don't assume that the Gstreamer stuff isn't used on win32. There really isn't anything to see here.
Daniel Atallah <datallah@pidgin.im>
parents:
19591
diff
changeset
|
502 | #endif |
|
e8a23f4721f0
Don't assume that the Gstreamer stuff isn't used on win32. There really isn't anything to see here.
Daniel Atallah <datallah@pidgin.im>
parents:
19591
diff
changeset
|
503 | else { |
| 15884 | 504 | purple_debug_error("sound", "Unknown sound method '%s'\n", method); |
|
15285
505ff058278c
[gaim-migrate @ 18013]
Mark Doliner <markdoliner@pidgin.im>
parents:
15165
diff
changeset
|
505 | return; |
| 13720 | 506 | } |
| 5684 | 507 | |
|
23239
1aec418902fd
A (modified) patch from Felipe to simplify our GStreamer sink selection
Felipe Contreras <felipe.contreras@gmail.com>
parents:
23069
diff
changeset
|
508 | if (strcmp(method, "automatic") != 0 && !sink) { |
|
1aec418902fd
A (modified) patch from Felipe to simplify our GStreamer sink selection
Felipe Contreras <felipe.contreras@gmail.com>
parents:
23069
diff
changeset
|
509 | purple_debug_error("sound", "Unable to create GStreamer audiosink.\n"); |
|
1aec418902fd
A (modified) patch from Felipe to simplify our GStreamer sink selection
Felipe Contreras <felipe.contreras@gmail.com>
parents:
23069
diff
changeset
|
510 | return; |
|
1aec418902fd
A (modified) patch from Felipe to simplify our GStreamer sink selection
Felipe Contreras <felipe.contreras@gmail.com>
parents:
23069
diff
changeset
|
511 | } |
|
1aec418902fd
A (modified) patch from Felipe to simplify our GStreamer sink selection
Felipe Contreras <felipe.contreras@gmail.com>
parents:
23069
diff
changeset
|
512 | |
|
15285
505ff058278c
[gaim-migrate @ 18013]
Mark Doliner <markdoliner@pidgin.im>
parents:
15165
diff
changeset
|
513 | play = gst_element_factory_make("playbin", "play"); |
|
21125
e7cd2426e511
Remove unused definition.
Daniel Atallah <datallah@pidgin.im>
parents:
21091
diff
changeset
|
514 | |
|
16161
a6f32c913f9b
Fix a possible gstreamer crash
Sean Egan <seanegan@pidgin.im>
parents:
16123
diff
changeset
|
515 | if (play == NULL) { |
|
a6f32c913f9b
Fix a possible gstreamer crash
Sean Egan <seanegan@pidgin.im>
parents:
16123
diff
changeset
|
516 | return; |
|
a6f32c913f9b
Fix a possible gstreamer crash
Sean Egan <seanegan@pidgin.im>
parents:
16123
diff
changeset
|
517 | } |
|
21125
e7cd2426e511
Remove unused definition.
Daniel Atallah <datallah@pidgin.im>
parents:
21091
diff
changeset
|
518 | |
| 13720 | 519 | uri = g_strdup_printf("file://%s", filename); |
|
14097
0c340861ab79
[gaim-migrate @ 16638]
Mark Doliner <markdoliner@pidgin.im>
parents:
13799
diff
changeset
|
520 | |
| 13720 | 521 | g_object_set(G_OBJECT(play), "uri", uri, |
|
14097
0c340861ab79
[gaim-migrate @ 16638]
Mark Doliner <markdoliner@pidgin.im>
parents:
13799
diff
changeset
|
522 | "volume", volume, |
| 13720 | 523 | "audio-sink", sink, NULL); |
| 5684 | 524 | |
|
15285
505ff058278c
[gaim-migrate @ 18013]
Mark Doliner <markdoliner@pidgin.im>
parents:
15165
diff
changeset
|
525 | bus = gst_pipeline_get_bus(GST_PIPELINE(play)); |
|
505ff058278c
[gaim-migrate @ 18013]
Mark Doliner <markdoliner@pidgin.im>
parents:
15165
diff
changeset
|
526 | gst_bus_add_watch(bus, bus_call, play); |
|
505ff058278c
[gaim-migrate @ 18013]
Mark Doliner <markdoliner@pidgin.im>
parents:
15165
diff
changeset
|
527 | |
| 13720 | 528 | gst_element_set_state(play, GST_STATE_PLAYING); |
|
14097
0c340861ab79
[gaim-migrate @ 16638]
Mark Doliner <markdoliner@pidgin.im>
parents:
13799
diff
changeset
|
529 | |
|
15285
505ff058278c
[gaim-migrate @ 18013]
Mark Doliner <markdoliner@pidgin.im>
parents:
15165
diff
changeset
|
530 | gst_object_unref(bus); |
| 13720 | 531 | g_free(uri); |
|
14097
0c340861ab79
[gaim-migrate @ 16638]
Mark Doliner <markdoliner@pidgin.im>
parents:
13799
diff
changeset
|
532 | |
|
23069
293830ac1149
Clarify #ifdef/#else/#endif matching; References #5770.
Ethan Blanton <elb@pidgin.im>
parents:
23027
diff
changeset
|
533 | #else /* #ifdef USE_GSTREAMER */ |
|
19849
e8a23f4721f0
Don't assume that the Gstreamer stuff isn't used on win32. There really isn't anything to see here.
Daniel Atallah <datallah@pidgin.im>
parents:
19591
diff
changeset
|
534 | |
|
e8a23f4721f0
Don't assume that the Gstreamer stuff isn't used on win32. There really isn't anything to see here.
Daniel Atallah <datallah@pidgin.im>
parents:
19591
diff
changeset
|
535 | #ifndef _WIN32 |
| 5684 | 536 | gdk_beep(); |
| 537 | #else /* _WIN32 */ | |
| 15884 | 538 | purple_debug_info("sound", "Playing %s\n", filename); |
| 5684 | 539 | |
|
10922
a27fde43df3b
[gaim-migrate @ 12691]
Daniel Atallah <datallah@pidgin.im>
parents:
10322
diff
changeset
|
540 | if (G_WIN32_HAVE_WIDECHAR_API ()) { |
|
a27fde43df3b
[gaim-migrate @ 12691]
Daniel Atallah <datallah@pidgin.im>
parents:
10322
diff
changeset
|
541 | wchar_t *wc_filename = g_utf8_to_utf16(filename, |
|
a27fde43df3b
[gaim-migrate @ 12691]
Daniel Atallah <datallah@pidgin.im>
parents:
10322
diff
changeset
|
542 | -1, NULL, NULL, NULL); |
|
a27fde43df3b
[gaim-migrate @ 12691]
Daniel Atallah <datallah@pidgin.im>
parents:
10322
diff
changeset
|
543 | if (!PlaySoundW(wc_filename, NULL, SND_ASYNC | SND_FILENAME)) |
| 15884 | 544 | purple_debug(PURPLE_DEBUG_ERROR, "sound", "Error playing sound.\n"); |
|
10922
a27fde43df3b
[gaim-migrate @ 12691]
Daniel Atallah <datallah@pidgin.im>
parents:
10322
diff
changeset
|
545 | g_free(wc_filename); |
|
a27fde43df3b
[gaim-migrate @ 12691]
Daniel Atallah <datallah@pidgin.im>
parents:
10322
diff
changeset
|
546 | } else { |
|
a27fde43df3b
[gaim-migrate @ 12691]
Daniel Atallah <datallah@pidgin.im>
parents:
10322
diff
changeset
|
547 | char *l_filename = g_locale_from_utf8(filename, |
|
a27fde43df3b
[gaim-migrate @ 12691]
Daniel Atallah <datallah@pidgin.im>
parents:
10322
diff
changeset
|
548 | -1, NULL, NULL, NULL); |
|
a27fde43df3b
[gaim-migrate @ 12691]
Daniel Atallah <datallah@pidgin.im>
parents:
10322
diff
changeset
|
549 | if (!PlaySoundA(l_filename, NULL, SND_ASYNC | SND_FILENAME)) |
| 15884 | 550 | purple_debug(PURPLE_DEBUG_ERROR, "sound", "Error playing sound.\n"); |
|
10922
a27fde43df3b
[gaim-migrate @ 12691]
Daniel Atallah <datallah@pidgin.im>
parents:
10322
diff
changeset
|
551 | g_free(l_filename); |
|
a27fde43df3b
[gaim-migrate @ 12691]
Daniel Atallah <datallah@pidgin.im>
parents:
10322
diff
changeset
|
552 | } |
| 5684 | 553 | #endif /* _WIN32 */ |
|
19849
e8a23f4721f0
Don't assume that the Gstreamer stuff isn't used on win32. There really isn't anything to see here.
Daniel Atallah <datallah@pidgin.im>
parents:
19591
diff
changeset
|
554 | |
|
e8a23f4721f0
Don't assume that the Gstreamer stuff isn't used on win32. There really isn't anything to see here.
Daniel Atallah <datallah@pidgin.im>
parents:
19591
diff
changeset
|
555 | #endif /* USE_GSTREAMER */ |
| 5684 | 556 | } |
| 557 | ||
|
10322
06e23196da4b
[gaim-migrate @ 11529]
Mark Doliner <markdoliner@pidgin.im>
parents:
10320
diff
changeset
|
558 | static void |
| 15884 | 559 | pidgin_sound_play_event(PurpleSoundEventID event) |
| 5684 | 560 | { |
| 561 | char *enable_pref; | |
| 562 | char *file_pref; | |
|
23972
90e0da03c053
theme loader cleanup, and remove a few warnings
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23661
diff
changeset
|
563 | const char *theme_name; |
|
23649
5da5fe967d10
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23314
diff
changeset
|
564 | PurpleSoundTheme *theme; |
| 5684 | 565 | |
| 15884 | 566 | if ((event == PURPLE_SOUND_BUDDY_ARRIVE) && mute_login_sounds) |
| 5684 | 567 | return; |
| 568 | ||
| 15884 | 569 | if (event >= PURPLE_NUM_SOUNDS) { |
| 570 | purple_debug_error("sound", "got request for unknown sound: %d\n", event); | |
| 5684 | 571 | return; |
| 572 | } | |
| 573 | ||
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
574 | enable_pref = g_strdup_printf(PIDGIN_PREFS_ROOT "/sound/enabled/%s", |
| 5684 | 575 | sounds[event].pref); |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
576 | file_pref = g_strdup_printf(PIDGIN_PREFS_ROOT "/sound/file/%s", sounds[event].pref); |
| 5684 | 577 | |
| 578 | /* check NULL for sounds that don't have an option, ie buddy pounce */ | |
| 15884 | 579 | if (purple_prefs_get_bool(enable_pref)) { |
| 580 | char *filename = g_strdup(purple_prefs_get_path(file_pref)); | |
|
23661
6cfcb043b068
fixed segfault when changing blist themes, changed prefs to not rely on static iter, fixed a few leaks
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23651
diff
changeset
|
581 | theme_name = purple_prefs_get_string(PIDGIN_PREFS_ROOT "/sound/theme"); |
|
25888
d0fdd378a635
Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents:
25884
diff
changeset
|
582 | |
|
25884
c00e14c20165
* Alphabetize files in a few Makefile.am files
Mark Doliner <markdoliner@pidgin.im>
parents:
24952
diff
changeset
|
583 | if (theme_name && *theme_name && (!filename || !*filename)) { |
|
c00e14c20165
* Alphabetize files in a few Makefile.am files
Mark Doliner <markdoliner@pidgin.im>
parents:
24952
diff
changeset
|
584 | /* Use theme */ |
|
14097
0c340861ab79
[gaim-migrate @ 16638]
Mark Doliner <markdoliner@pidgin.im>
parents:
13799
diff
changeset
|
585 | g_free(filename); |
|
23649
5da5fe967d10
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23314
diff
changeset
|
586 | |
|
5da5fe967d10
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23314
diff
changeset
|
587 | theme = PURPLE_SOUND_THEME(purple_theme_manager_find_theme(theme_name, "sound")); |
|
5da5fe967d10
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23314
diff
changeset
|
588 | filename = purple_sound_theme_get_file_full(theme, sounds[event].pref); |
|
5da5fe967d10
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23314
diff
changeset
|
589 | |
|
5da5fe967d10
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23314
diff
changeset
|
590 | if(!g_file_test(filename, G_FILE_TEST_IS_REGULAR)){ /* Use Default sound in this case */ |
|
25888
d0fdd378a635
Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents:
25884
diff
changeset
|
591 | purple_debug_error("sound", "The file: (%s) %s\n from theme: %s, was not found or wasn't readable\n", |
|
23649
5da5fe967d10
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23314
diff
changeset
|
592 | sounds[event].pref, filename, theme_name); |
|
5da5fe967d10
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23314
diff
changeset
|
593 | g_free(filename); |
|
5da5fe967d10
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23314
diff
changeset
|
594 | } |
|
5da5fe967d10
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23314
diff
changeset
|
595 | } |
|
25888
d0fdd378a635
Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents:
25884
diff
changeset
|
596 | |
|
23649
5da5fe967d10
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23314
diff
changeset
|
597 | if (!filename || !strlen(filename)) { /* Use Default sounds */ |
|
5da5fe967d10
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23314
diff
changeset
|
598 | g_free(filename); |
|
5da5fe967d10
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23314
diff
changeset
|
599 | |
| 18292 | 600 | /* XXX Consider creating a constant for "sounds/purple" to be shared with Finch */ |
| 601 | filename = g_build_filename(DATADIR, "sounds", "purple", sounds[event].def, NULL); | |
| 5684 | 602 | } |
| 603 | ||
| 15884 | 604 | purple_sound_play_file(filename, NULL); |
|
23649
5da5fe967d10
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23314
diff
changeset
|
605 | |
| 5684 | 606 | g_free(filename); |
| 607 | } | |
| 608 | ||
| 609 | g_free(enable_pref); | |
| 610 | g_free(file_pref); | |
| 611 | } | |
| 612 | ||
|
25888
d0fdd378a635
Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents:
25884
diff
changeset
|
613 | gboolean |
|
23649
5da5fe967d10
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23314
diff
changeset
|
614 | pidgin_sound_is_customized(void) |
|
5da5fe967d10
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23314
diff
changeset
|
615 | { |
|
25888
d0fdd378a635
Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents:
25884
diff
changeset
|
616 | gint i; |
|
23649
5da5fe967d10
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23314
diff
changeset
|
617 | gchar *path, *file; |
|
5da5fe967d10
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23314
diff
changeset
|
618 | |
|
25884
c00e14c20165
* Alphabetize files in a few Makefile.am files
Mark Doliner <markdoliner@pidgin.im>
parents:
24952
diff
changeset
|
619 | for (i = 0; i < PURPLE_NUM_SOUNDS; i++) { |
|
23649
5da5fe967d10
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23314
diff
changeset
|
620 | path = g_strdup_printf(PIDGIN_PREFS_ROOT "/sound/file/%s", sounds[i].pref); |
|
5da5fe967d10
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23314
diff
changeset
|
621 | file = g_strdup(purple_prefs_get_path(path)); |
|
5da5fe967d10
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23314
diff
changeset
|
622 | g_free(path); |
|
5da5fe967d10
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23314
diff
changeset
|
623 | |
|
25884
c00e14c20165
* Alphabetize files in a few Makefile.am files
Mark Doliner <markdoliner@pidgin.im>
parents:
24952
diff
changeset
|
624 | if (file && file[0] != '\0'){ |
|
23649
5da5fe967d10
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23314
diff
changeset
|
625 | g_free(file); |
|
5da5fe967d10
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23314
diff
changeset
|
626 | return TRUE; |
|
5da5fe967d10
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23314
diff
changeset
|
627 | } |
|
5da5fe967d10
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23314
diff
changeset
|
628 | |
|
5da5fe967d10
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23314
diff
changeset
|
629 | g_free(file); |
|
5da5fe967d10
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23314
diff
changeset
|
630 | } |
|
5da5fe967d10
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23314
diff
changeset
|
631 | |
|
5da5fe967d10
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23314
diff
changeset
|
632 | return FALSE; |
|
5da5fe967d10
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23314
diff
changeset
|
633 | |
|
5da5fe967d10
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23314
diff
changeset
|
634 | } |
|
5da5fe967d10
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23314
diff
changeset
|
635 | |
| 15884 | 636 | static PurpleSoundUiOps sound_ui_ops = |
| 5684 | 637 | { |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
638 | pidgin_sound_init, |
|
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
639 | pidgin_sound_uninit, |
|
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
640 | pidgin_sound_play_file, |
|
16752
e6bcb1628c57
Patch from John 'rekkanoryo' Bailey to add the padding struct members in pidgin
Gary Kramlich <grim@reaperworld.com>
parents:
16254
diff
changeset
|
641 | pidgin_sound_play_event, |
|
e6bcb1628c57
Patch from John 'rekkanoryo' Bailey to add the padding struct members in pidgin
Gary Kramlich <grim@reaperworld.com>
parents:
16254
diff
changeset
|
642 | NULL, |
|
e6bcb1628c57
Patch from John 'rekkanoryo' Bailey to add the padding struct members in pidgin
Gary Kramlich <grim@reaperworld.com>
parents:
16254
diff
changeset
|
643 | NULL, |
|
e6bcb1628c57
Patch from John 'rekkanoryo' Bailey to add the padding struct members in pidgin
Gary Kramlich <grim@reaperworld.com>
parents:
16254
diff
changeset
|
644 | NULL, |
|
e6bcb1628c57
Patch from John 'rekkanoryo' Bailey to add the padding struct members in pidgin
Gary Kramlich <grim@reaperworld.com>
parents:
16254
diff
changeset
|
645 | NULL |
| 5684 | 646 | }; |
| 647 | ||
| 15884 | 648 | PurpleSoundUiOps * |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
649 | pidgin_sound_get_ui_ops(void) |
| 5684 | 650 | { |
| 651 | return &sound_ui_ops; | |
| 652 | } |