comparison pidgin/gtksound.c @ 29679:e57315a062cb

propagate from branch 'im.pidgin.pidgin' (head 580055bb22fea0076d3a90d9df9346abd1789bab) to branch 'im.pidgin.cpw.attention_ui' (head 89303c99f052c92262b6a169005f053106ce8f61)
author Marcus Lundblad <ml@update.uu.se>
date Mon, 13 Apr 2009 13:37:33 +0000
parents b162300ab1e7 b98519a42e53
children 338d6a211055
comparison
equal deleted inserted replaced
26648:8c3b1a059ecc 29679:e57315a062cb
70 {N_("Person leaves chat"), "left_chat", "logout.wav"}, 70 {N_("Person leaves chat"), "left_chat", "logout.wav"},
71 {N_("You talk in chat"), "send_chat_msg", "send.wav"}, 71 {N_("You talk in chat"), "send_chat_msg", "send.wav"},
72 {N_("Others talk in chat"), "chat_msg_recv", "receive.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 ;-) */ 73 /* this isn't a terminator, it's the buddy pounce default sound event ;-) */
74 {NULL, "pounce_default", "alert.wav"}, 74 {NULL, "pounce_default", "alert.wav"},
75 {N_("Someone says your username in chat"), "nick_said", "alert.wav"} 75 {N_("Someone says your username in chat"), "nick_said", "alert.wav"},
76 {N_("Attention received"), "got_attention", "alert.wav"},
77 {N_("Attention sent"), "sent_attention", "alert.wav"}
76 }; 78 };
77 79
78 static gboolean 80 static gboolean
79 unmute_login_sounds_cb(gpointer data) 81 unmute_login_sounds_cb(gpointer data)
80 { 82 {
213 215
214 if (flags & PURPLE_MESSAGE_NICK || purple_utf8_has_word(message, chat->nick)) 216 if (flags & PURPLE_MESSAGE_NICK || purple_utf8_has_word(message, chat->nick))
215 play_conv_event(conv, PURPLE_SOUND_CHAT_NICK); 217 play_conv_event(conv, PURPLE_SOUND_CHAT_NICK);
216 else 218 else
217 play_conv_event(conv, event); 219 play_conv_event(conv, event);
220 }
221
222 static void
223 sent_attention_cb(PurpleAccount *account, const char *who,
224 PurpleConversation *conv, guint type, PurpleSoundEventID event)
225 {
226 play_conv_event(conv, event);
227 }
228
229 static void
230 got_attention_cb(PurpleAccount *account, const char *who,
231 PurpleConversation *conv, guint type, PurpleSoundEventID event)
232 {
233 play_conv_event(conv, event);
218 } 234 }
219 235
220 /* 236 /*
221 * We mute sounds for the 10 seconds after you log in so that 237 * We mute sounds for the 10 seconds after you log in so that
222 * you don't get flooded with sounds when the blist shows all 238 * you don't get flooded with sounds when the blist shows all
295 purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/sound/enabled/nick_said", FALSE); 311 purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/sound/enabled/nick_said", FALSE);
296 purple_prefs_add_path(PIDGIN_PREFS_ROOT "/sound/file/nick_said", ""); 312 purple_prefs_add_path(PIDGIN_PREFS_ROOT "/sound/file/nick_said", "");
297 purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/sound/enabled/pounce_default", TRUE); 313 purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/sound/enabled/pounce_default", TRUE);
298 purple_prefs_add_path(PIDGIN_PREFS_ROOT "/sound/file/pounce_default", ""); 314 purple_prefs_add_path(PIDGIN_PREFS_ROOT "/sound/file/pounce_default", "");
299 purple_prefs_add_string(PIDGIN_PREFS_ROOT "/sound/theme", ""); 315 purple_prefs_add_string(PIDGIN_PREFS_ROOT "/sound/theme", "");
316 purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/sound/enabled/sent_attention", TRUE);
317 purple_prefs_add_path(PIDGIN_PREFS_ROOT "/sound/file/sent_attention", "");
318 purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/sound/enabled/got_attention", TRUE);
319 purple_prefs_add_path(PIDGIN_PREFS_ROOT "/sound/file/got_attention", "");
300 purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/sound/conv_focus", TRUE); 320 purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/sound/conv_focus", TRUE);
301 purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/sound/mute", FALSE); 321 purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/sound/mute", FALSE);
302 purple_prefs_add_path(PIDGIN_PREFS_ROOT "/sound/command", ""); 322 purple_prefs_add_path(PIDGIN_PREFS_ROOT "/sound/command", "");
303 purple_prefs_add_string(PIDGIN_PREFS_ROOT "/sound/method", "automatic"); 323 purple_prefs_add_string(PIDGIN_PREFS_ROOT "/sound/method", "automatic");
304 purple_prefs_add_int(PIDGIN_PREFS_ROOT "/sound/volume", 50); 324 purple_prefs_add_int(PIDGIN_PREFS_ROOT "/sound/volume", 50);
341 gtk_sound_handle, PURPLE_CALLBACK(chat_msg_sent_cb), 361 gtk_sound_handle, PURPLE_CALLBACK(chat_msg_sent_cb),
342 GINT_TO_POINTER(PURPLE_SOUND_CHAT_YOU_SAY)); 362 GINT_TO_POINTER(PURPLE_SOUND_CHAT_YOU_SAY));
343 purple_signal_connect(conv_handle, "received-chat-msg", 363 purple_signal_connect(conv_handle, "received-chat-msg",
344 gtk_sound_handle, PURPLE_CALLBACK(chat_msg_received_cb), 364 gtk_sound_handle, PURPLE_CALLBACK(chat_msg_received_cb),
345 GINT_TO_POINTER(PURPLE_SOUND_CHAT_SAY)); 365 GINT_TO_POINTER(PURPLE_SOUND_CHAT_SAY));
366 purple_signal_connect(conv_handle, "sent-attention", gtk_sound_handle,
367 PURPLE_CALLBACK(sent_attention_cb),
368 GINT_TO_POINTER(PURPLE_SOUND_SEND_ATTENTION));
369 purple_signal_connect(conv_handle, "got-attention", gtk_sound_handle,
370 PURPLE_CALLBACK(got_attention_cb),
371 GINT_TO_POINTER(PURPLE_SOUND_GOT_ATTENTION));
346 } 372 }
347 373
348 static void 374 static void
349 pidgin_sound_uninit(void) 375 pidgin_sound_uninit(void)
350 { 376 {