Applied patch from Largo to update sound related stuff and documentation
[wmaker-crm.git] / src / wsound.c
blobd02f3c4c83afeea3520491a8f5a8e8a4a2b4ceb7
1 #include "wconfig.h"
3 #include <stdio.h>
4 #include <stdlib.h>
5 #include <X11/X.h>
6 #include <X11/Xlib.h>
7 #include <X11/Xutil.h>
8 #include <X11/Xproto.h>
10 #include "WindowMaker.h"
11 #include "funcs.h"
12 #include "wsound.h"
14 #ifdef WSOUND
18 extern WPreferences wPreferences;
20 void
21 wSoundPlay(long event_sound)
23 static Atom atom = 0;
24 XEvent sound_event;
26 if (!atom) {
27 atom = XInternAtom(dpy, "_WINDOWMAKER_EVENT", False);
30 if(!wPreferences.no_sound) {
31 Window win = wScreenWithNumber(0)->info_window;
33 sound_event.xclient.type = ClientMessage;
34 sound_event.xclient.message_type = atom;
35 sound_event.xclient.format = 32;
36 sound_event.xclient.display = dpy;
37 sound_event.xclient.window = win;
38 sound_event.xclient.data.l[0] = event_sound;
39 XSendEvent(dpy, win, False, StructureNotifyMask, &sound_event);
40 XFlush(dpy);
44 #endif /* WSOUND */