# HG changeset patch # User Eric Warmenhoven # Date 954129132 0 # Node ID b1d7336cba8561d96e151dbf990eecb4f11e701f # Parent 12894b62d2064c42803ef20e9d1f7d7411fcaa5a [gaim-migrate @ 74] Changed how the sounds work for the applet - it's configurable now! :) committer: Tailor Script diff -r 12894b62d206 -r b1d7336cba85 Makefile.am --- a/Makefile.am Mon Mar 27 03:16:21 2000 +0000 +++ b/Makefile.am Mon Mar 27 03:52:12 2000 +0000 @@ -1,5 +1,6 @@ -EXTRA_DIST = gaim_applet.gnorba gaim_applet.desktop buddytrans +EXTRA_DIST = gaim_applet.gnorba gaim_applet.desktop gaim_applet.soundlist \ + buddytrans if GNOMEAPPLET @@ -11,6 +12,10 @@ gaimdesktopdir = $(datadir)/applets/Network gaimdesktop_DATA = $(gaim_DESKTOP) +gaim_SOUND = gaim_applet.soundlist +gaimsounddir = $(sysconfdir)/sound/events +gaimsound_DATA = $(gaim_SOUND) + endif SUBDIRS = m4 libfaim sounds pixmaps doc src diff -r 12894b62d206 -r b1d7336cba85 gaim_applet.soundlist --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gaim_applet.soundlist Mon Mar 27 03:52:12 2000 +0000 @@ -0,0 +1,18 @@ +[__section_info__] +description=Gaim soundlist + +[login] +file=gaim/BuddyArrive.au +description=User signed on + +[leave] +file=gaim/BuddyLeave.au +description=User signed off + +[send] +file=gaim/Send.au +description=Send a message + +[recv] +file=gaim/Receive.au +description=Receive a message diff -r 12894b62d206 -r b1d7336cba85 sounds/Makefile.am --- a/sounds/Makefile.am Mon Mar 27 03:16:21 2000 +0000 +++ b/sounds/Makefile.am Mon Mar 27 03:52:12 2000 +0000 @@ -18,4 +18,7 @@ Receive.h: au2h Receive.au ./au2h Receive.au Receive.h - +if GNOMEAPPLET +gaimsoundsdir = $(datadir)/sounds/gaim +gaimsounds_DATA = $(EXTRA_DIST) +endif diff -r 12894b62d206 -r b1d7336cba85 src/sound.c --- a/src/sound.c Mon Mar 27 03:16:21 2000 +0000 +++ b/src/sound.c Mon Mar 27 03:52:12 2000 +0000 @@ -19,6 +19,7 @@ * */ +#ifndef USE_APPLET #include #include #include @@ -288,6 +289,41 @@ play(Receive, sizeof(Receive)); break; } +} - +#else /* USE_APPLET */ + +#include "gaim.h" +#include +void play_sound(int sound) +{ + + switch(sound) { + case BUDDY_ARRIVE: + if (sound_options & OPT_SOUND_LOGIN) + gnome_triggers_do("", "program", "gaim_applet", "login", NULL); + break; + case BUDDY_LEAVE: + if (sound_options & OPT_SOUND_LOGOUT) + gnome_triggers_do("", "program", "gaim_applet", "leave", NULL); + break; + case SEND: + if (sound_options & OPT_SOUND_SEND) + gnome_triggers_do("", "program", "gaim_applet", "send", NULL); + break; + case FIRST_RECEIVE: + if (sound_options & OPT_SOUND_FIRST_RCV) + gnome_triggers_do("", "program", "gaim_applet", "recv", NULL); + break; + case RECEIVE: + if (sound_options & OPT_SOUND_RECV) + gnome_triggers_do("", "program", "gaim_applet", "recv", NULL); + break; + case AWAY: + if (sound_options & OPT_SOUND_WHEN_AWAY) + gnome_triggers_do("", "program", "gaim_applet", "recv", NULL); + break; + } } + +#endif /* USE_APPLET */