104
104
{PURPLE_SOUND_CHAT_YOU_SAY, N_("You talk in chat"), "send_chat_msg", "send.wav", NULL},
105
105
{PURPLE_SOUND_CHAT_SAY, N_("Others talk in chat"), "chat_msg_recv", "receive.wav", NULL},
106
106
{PURPLE_SOUND_POUNCE_DEFAULT, NULL, "pounce_default", "alert.wav", NULL},
107
{PURPLE_SOUND_CHAT_NICK, N_("Someone says your username in chat"), "nick_said", "alert.wav", NULL}
107
{PURPLE_SOUND_CHAT_NICK, N_("Someone says your username in chat"), "nick_said", "alert.wav", NULL},
108
{PURPLE_SOUND_GOT_ATTENTION, N_("Attention received"), "got_attention", "alert.wav", NULL}
273
274
play_conv_event(conv, event);
278
got_attention_cb(PurpleAccount *account, const char *who,
279
PurpleConversation *conv, guint type, PurpleSoundEventID event)
281
play_conv_event(conv, event);
277
286
* We mute sounds for the 10 seconds after you log in so that
278
287
* you don't get flooded with sounds when the blist shows all
301
310
initialize_profile(const char *name, PurplePrefType type, gconstpointer val, gpointer null)
312
FinchSoundEvent *event;
303
313
if (purple_prefs_exists(make_pref("")))
306
316
purple_prefs_add_none(make_pref(""));
307
317
purple_prefs_add_none(make_pref("/enabled"));
308
318
purple_prefs_add_none(make_pref("/file"));
309
purple_prefs_add_bool(make_pref("/enabled/login"), FALSE);
310
purple_prefs_add_path(make_pref("/file/login"), "");
311
purple_prefs_add_bool(make_pref("/enabled/logout"), FALSE);
312
purple_prefs_add_path(make_pref("/file/logout"), "");
313
purple_prefs_add_bool(make_pref("/enabled/im_recv"), FALSE);
314
purple_prefs_add_path(make_pref("/file/im_recv"), "");
315
purple_prefs_add_bool(make_pref("/enabled/first_im_recv"), FALSE);
316
purple_prefs_add_path(make_pref("/file/first_im_recv"), "");
317
purple_prefs_add_bool(make_pref("/enabled/send_im"), FALSE);
318
purple_prefs_add_path(make_pref("/file/send_im"), "");
319
purple_prefs_add_bool(make_pref("/enabled/join_chat"), FALSE);
320
purple_prefs_add_path(make_pref("/file/join_chat"), "");
321
purple_prefs_add_bool(make_pref("/enabled/left_chat"), FALSE);
322
purple_prefs_add_path(make_pref("/file/left_chat"), "");
323
purple_prefs_add_bool(make_pref("/enabled/send_chat_msg"), FALSE);
324
purple_prefs_add_path(make_pref("/file/send_chat_msg"), "");
325
purple_prefs_add_bool(make_pref("/enabled/chat_msg_recv"), FALSE);
326
purple_prefs_add_path(make_pref("/file/chat_msg_recv"), "");
327
purple_prefs_add_bool(make_pref("/enabled/nick_said"), FALSE);
328
purple_prefs_add_path(make_pref("/file/nick_said"), "");
329
purple_prefs_add_bool(make_pref("/enabled/pounce_default"), FALSE);
330
purple_prefs_add_path(make_pref("/file/pounce_default"), "");
320
for (event = sounds; event - sounds < PURPLE_NUM_SOUNDS; event++) {
322
g_snprintf(pref, sizeof(pref), "/enabled/%s", event->pref);
323
purple_prefs_add_bool(make_pref(pref), FALSE);
324
g_snprintf(pref, sizeof(pref), "/file/%s", event->pref);
325
purple_prefs_add_path(make_pref(pref), "");
331
328
purple_prefs_add_bool(make_pref("/conv_focus"), FALSE);
332
329
purple_prefs_add_bool(make_pref("/mute"), FALSE);
333
330
purple_prefs_add_path(make_pref("/command"), "");
336
update_profiles(void)
338
GList *list = finch_sound_get_profiles();
339
for (; list; list = g_list_delete_link(list, list)) {
342
/* got_attention was added in libpurple 2.7.0 */
343
g_snprintf(pname, sizeof(pname), FINCH_PREFS_ROOT "/sound/profiles/%s%s",
344
(char *)list->data, "/enabled/got_attention");
345
purple_prefs_add_bool(pname, FALSE);
346
g_snprintf(pname, sizeof(pname), FINCH_PREFS_ROOT "/sound/profiles/%s%s",
347
(char *)list->data, "/file/got_attention");
348
purple_prefs_add_path(pname, "");
339
355
finch_sound_init(void)
341
357
void *gnt_sound_handle = finch_sound_get_handle();
399
415
purple_signal_connect(conv_handle, "received-chat-msg",
400
416
gnt_sound_handle, PURPLE_CALLBACK(chat_msg_received_cb),
401
417
GINT_TO_POINTER(PURPLE_SOUND_CHAT_SAY));
418
purple_signal_connect(conv_handle, "got-attention",
419
gnt_sound_handle, PURPLE_CALLBACK(got_attention_cb),
420
GINT_TO_POINTER(PURPLE_SOUND_GOT_ATTENTION));