Mercurial > pidgin
comparison src/sound.c @ 4082:4b04ecb3eb97
[gaim-migrate @ 4297]
(22:54:38) Robot101: * Make sure prefs are saved before plugins are removed, and not afterwards.
(22:54:59) Robot101: * Move do_quit() into aim.c and make sure everything appropriate uses it.
(22:55:12) Robot101: * Remove duplicated cancel_login for closing the main window, use do_quit instead.
(22:55:49) Robot101: * Remove uncalled code pertaining to closing the about window from when it was called via gaim -v.
(22:56:06) LSchiere: what's this in sounds?
(22:56:29) Robot101: * Add correct ifdefs to prefs so only compiled-in sound methods are shown.
(22:56:34) LSchiere: if you broke my sounds...
(22:57:07) Robot101: * Remove unused sound order data, and clarify comments and debug output.
(22:57:56) Robot101: * Remove duplicated check which is performed at the start of play_file anyway.
(22:58:03) Robot101: that's the lot
committer: Tailor Script <tailor@pidgin.im>
author | Luke Schierer <lschiere@pidgin.im> |
---|---|
date | Mon, 16 Dec 2002 03:58:54 +0000 |
parents | e53d9f9969d0 |
children | bf770f11132b |
comparison
equal
deleted
inserted
replaced
4081:b35cf600fe30 | 4082:4b04ecb3eb97 |
---|---|
58 #include "win32dep.h" | 58 #include "win32dep.h" |
59 #endif | 59 #endif |
60 | 60 |
61 gboolean mute_sounds = 0; | 61 gboolean mute_sounds = 0; |
62 | 62 |
63 /* description, option bit, default sound file * | 63 /* description, option bit, default sound file * |
64 * if you want it to get displayed in the prefs dialog, it needs * | 64 * set the option bit to 0 to have it not display in prefs * |
65 * to be added to the sound_order array in prefs.c, if not, and * | 65 * the order here has to match the defines in gaim.h. * |
66 * it has no option bit, set it to 0. the order here has to match * | 66 * -Robot101 */ |
67 * the defines in gaim.h. -Robot101 */ | |
68 struct sound_struct sounds[NUM_SOUNDS] = { | 67 struct sound_struct sounds[NUM_SOUNDS] = { |
69 {N_("Buddy logs in"), OPT_SOUND_LOGIN, "arrive.wav"}, | 68 {N_("Buddy logs in"), OPT_SOUND_LOGIN, "arrive.wav"}, |
70 {N_("Buddy logs out"), OPT_SOUND_LOGOUT, "leave.wav"}, | 69 {N_("Buddy logs out"), OPT_SOUND_LOGOUT, "leave.wav"}, |
71 {N_("Message received"), OPT_SOUND_RECV, "receive.wav"}, | 70 {N_("Message received"), OPT_SOUND_RECV, "receive.wav"}, |
72 {N_("Message received begins conversation"), OPT_SOUND_FIRST_RCV, "receive.wav"}, | 71 {N_("Message received begins conversation"), OPT_SOUND_FIRST_RCV, "receive.wav"}, |
76 {N_("You talk in chat"), OPT_SOUND_CHAT_YOU_SAY, "send.wav"}, | 75 {N_("You talk in chat"), OPT_SOUND_CHAT_YOU_SAY, "send.wav"}, |
77 {N_("Others talk in chat"), OPT_SOUND_CHAT_SAY, "receive.wav"}, | 76 {N_("Others talk in chat"), OPT_SOUND_CHAT_SAY, "receive.wav"}, |
78 /* this isn't a terminator, it's the buddy pounce default sound event ;-) */ | 77 /* this isn't a terminator, it's the buddy pounce default sound event ;-) */ |
79 {NULL, 0, "redalert.wav"}, | 78 {NULL, 0, "redalert.wav"}, |
80 {N_("Someone says your name in chat"), OPT_SOUND_CHAT_NICK, "redalert.wav"} | 79 {N_("Someone says your name in chat"), OPT_SOUND_CHAT_NICK, "redalert.wav"} |
81 }; | |
82 int sound_order[] = { | |
83 SND_BUDDY_ARRIVE, SND_BUDDY_LEAVE, | |
84 SND_FIRST_RECEIVE, SND_RECEIVE, SND_SEND, | |
85 SND_CHAT_JOIN, SND_CHAT_LEAVE, | |
86 SND_CHAT_YOU_SAY, SND_CHAT_SAY, SND_CHAT_NICK, 0 | |
87 }; | 80 }; |
88 | 81 |
89 #ifndef _WIN32 | 82 #ifndef _WIN32 |
90 static int check_dev(char *dev) | 83 static int check_dev(char *dev) |
91 { | 84 { |
462 void play_sound(int sound) | 455 void play_sound(int sound) |
463 { | 456 { |
464 if (mute_sounds) | 457 if (mute_sounds) |
465 return; | 458 return; |
466 | 459 |
467 if (awaymessage && !(sound_options & OPT_SOUND_WHEN_AWAY)) | |
468 return; | |
469 | |
470 if ((sound == SND_BUDDY_ARRIVE) && !logins_not_muted) | 460 if ((sound == SND_BUDDY_ARRIVE) && !logins_not_muted) |
471 return; | 461 return; |
472 | 462 |
473 if (sound >= NUM_SOUNDS) { | 463 if (sound >= NUM_SOUNDS) { |
474 debug_printf("sorry old fruit... can't say I know that sound: ", sound, "\n"); | 464 debug_printf("got request for unknown sound: %d\n", sound); |
475 return; | 465 return; |
476 } | 466 } |
477 | 467 |
478 /* check NULL for sounds that don't have an option, ie buddy pounce */ | 468 /* check NULL for sounds that don't have an option, ie buddy pounce */ |
479 if ((sound_options & sounds[sound].opt) || (sounds[sound].opt == 0)) { | 469 if ((sound_options & sounds[sound].opt) || (sounds[sound].opt == 0)) { |