Mercurial > hg > xemacs-beta
annotate src/ntplay.c @ 780:578cb2932d72
[xemacs-hg @ 2002-03-18 10:07:30 by ben]
config.inc.samp, xemacs.mak: Deal with never-ending perl quoting problems.
README: Include a long, long description of the suggested directory layout
for developing XEmacs. This should probably go as part of a
larger document, a "Getting Started with Developing XEmacs". ####
Does such a document exist?
etc\unicode\mule-ucs\*: New directory, containing translation
files for the remaining charsets that are not in
unicode\unicode-consortium but are in mule-ucs.
etc\unicode\other\*: New directory, containing translation
files made up on an ad-hoc basis.
etc\unicode\README: Update.
* Some ChangeLog entries from stuff that got applied long ago
never got checked in, due to the nasty SCCS "oops, i forgot again
..." bug.
mule\lao.el: Convert stuff to XEmacs-style.
mule\thai-xtis.el: Move thai-xtis-chars.el stuff to here, since we can now handle
encountering characters of a charset before the charset is defined.
mule\thai-xtis-chars.el: Removed, moved into thai-xtis.el.
mule\mule-msw-init.el: Move some stuff into mule-msw-init-late.el,
which references charsets and thus needs to be delayed until after
all charsets have been created.
mule\mule-msw-init-late.el: New file, some stuff from
mule-msw-init.el.
dumped-lisp.el: Load the remaining languages -- lao, indian, devanagari, tibetan.
Load new file mule-msw-init-late.
unicode.el: Load the new tables for Ethiopic, Vietnamese, and other languages
extracted from mule-ucs.
mule\lao.el: Convert stuff to XEmacs-style.
mule\thai-xtis.el: Move thai-xtis-chars.el stuff to here, since we can now handle
encountering characters of a charset before the charset is defined.
mule\thai-xtis-chars.el: Removed, moved into thai-xtis.el.
mule\mule-msw-init.el: Move some stuff into mule-msw-init-late.el,
which references charsets and thus needs to be delayed until after
all charsets have been created.
mule\mule-msw-init-late.el: New file, some stuff from
mule-msw-init.el.
mule\lao.el: Convert stuff to XEmacs-style.
mule\thai-xtis.el: Move thai-xtis-chars.el stuff to here, since we can now handle
encountering characters of a charset before the charset is defined.
mule\thai-xtis-chars.el: Removed, moved into thai-xtis.el.
mule\mule-msw-init.el: Move some stuff into mule-msw-init-late.el,
which references charsets and thus needs to be delayed until after
all charsets have been created.
mule\mule-msw-init-late.el: New file, some stuff from
mule-msw-init.el.
dumped-lisp.el: Load the remaining languages -- lao, indian, devanagari, tibetan.
Load new file mule-msw-init-late.
unicode.el: Load the new tables for Ethiopic, Vietnamese, and other languages
extracted from mule-ucs.
mule\lao.el: Convert stuff to XEmacs-style.
mule\thai-xtis.el: Move thai-xtis-chars.el stuff to here, since we can now handle
encountering characters of a charset before the charset is defined.
mule\thai-xtis-chars.el: Removed, moved into thai-xtis.el.
mule\mule-msw-init.el: Move some stuff into mule-msw-init-late.el,
which references charsets and thus needs to be delayed until after
all charsets have been created.
mule\mule-msw-init-late.el: New file, some stuff from
mule-msw-init.el.
fns.c, lread.c: Add variable require-prints-loading-message to cause loading
messages to get printed when a file is loading during a `require',
which normally doesn't happen. This can be set using env var
XEMACSDEBUG to debug problems with non-interactive compilation.
Modify load-internal so it prints "Requiring: ..." instead of
"Loading: ..." when appropriate.
author | ben |
---|---|
date | Mon, 18 Mar 2002 10:07:39 +0000 |
parents | 943eaba38521 |
children | a8d8f419b459 |
rev | line source |
---|---|
428 | 1 /* Sound in windows nt XEmacs. |
2 Copyright (C) 1998 Andy Piper. | |
771 | 3 Copyright (C) 2001 Ben Wing. |
428 | 4 |
5 This file is part of XEmacs. | |
6 | |
7 XEmacs is free software; you can redistribute it and/or modify it | |
8 under the terms of the GNU General Public License as published by the | |
9 Free Software Foundation; either version 2, or (at your option) any | |
10 later version. | |
11 | |
12 XEmacs is distributed in the hope that it will be useful, but WITHOUT | |
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
15 for more details. | |
16 | |
17 You should have received a copy of the GNU General Public License | |
18 along with XEmacs; see the file COPYING. If not, write to the Free | |
19 Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA | |
20 02111-1307, USA.*/ | |
21 | |
563 | 22 /* Synched up with: Not in FSF. */ |
23 | |
24 /* This file Mule-ized by Ben Wing, 5-15-01. */ | |
25 | |
428 | 26 #include <config.h> |
27 #include "lisp.h" | |
28 | |
563 | 29 #include "sound.h" |
771 | 30 #include "syswindows.h" |
563 | 31 |
32 #include "sysfile.h" | |
442 | 33 |
563 | 34 static int play_sound_data_1 (UChar_Binary *data, int length, |
35 int volume, int convert); | |
428 | 36 |
563 | 37 void |
38 play_sound_file (Extbyte *sound_file, int volume) | |
428 | 39 { |
40 DWORD flags = SND_ASYNC | SND_NODEFAULT | SND_FILENAME; | |
563 | 41 Lisp_Object fname = |
771 | 42 Ffile_name_nondirectory (build_tstr_string (sound_file)); |
563 | 43 Extbyte *fnameext; |
428 | 44 |
45 CHECK_STRING (fname); | |
771 | 46 LISP_STRING_TO_TSTR (fname, fnameext); |
563 | 47 |
771 | 48 if (qxeSearchPath (NULL, fnameext, NULL, 0, NULL, NULL) == 0) |
428 | 49 { |
50 /* file isn't in the path so read it as data */ | |
51 int size; | |
593 | 52 UChar_Binary *data; |
771 | 53 int ofd = qxe_open (XSTRING_DATA (fname), O_RDONLY | OPEN_BINARY, 0); |
428 | 54 |
55 if (ofd <0) | |
56 return; | |
57 | |
58 size = lseek (ofd, 0, SEEK_END); | |
593 | 59 data = (UChar_Binary *) xmalloc (size); |
428 | 60 lseek (ofd, 0, SEEK_SET); |
61 | |
62 if (!data) | |
63 { | |
771 | 64 retry_close (ofd); |
428 | 65 return; |
66 } | |
67 | |
771 | 68 if (retry_read (ofd, data, size) != size) |
428 | 69 { |
771 | 70 retry_close (ofd); |
428 | 71 xfree (data); |
72 return; | |
73 } | |
771 | 74 retry_close (ofd); |
428 | 75 |
76 play_sound_data_1 (data, size, 100, FALSE); | |
77 } | |
78 else | |
771 | 79 qxePlaySound (fnameext, NULL, flags); |
428 | 80 } |
81 | |
82 /* mswindows can't cope with playing a sound from alloca space so we | |
83 have to convert if necessary */ | |
563 | 84 static int |
85 play_sound_data_1 (UChar_Binary *data, int length, int volume, | |
86 int convert_to_malloc) | |
428 | 87 { |
88 DWORD flags = SND_ASYNC | SND_MEMORY | SND_NODEFAULT; | |
593 | 89 static UChar_Binary *sound_data = 0; |
428 | 90 if (sound_data) |
91 { | |
771 | 92 qxePlaySound (NULL, NULL, flags); |
428 | 93 xfree (sound_data); |
593 | 94 sound_data = 0; |
428 | 95 } |
96 | |
97 if (convert_to_malloc) | |
98 { | |
593 | 99 sound_data = (UChar_Binary *) xmalloc (length); |
428 | 100 memcpy (sound_data, data, length); |
101 } | |
102 else | |
103 sound_data = data; | |
104 | |
771 | 105 qxePlaySound ((Extbyte *) sound_data, NULL, flags); |
428 | 106 |
442 | 107 /* #### Error handling? */ |
108 return 1; | |
428 | 109 } |
110 | |
563 | 111 int |
112 play_sound_data (UChar_Binary *data, int length, int volume) | |
428 | 113 { |
442 | 114 return play_sound_data_1 (data, length, volume, TRUE); |
428 | 115 } |