9
by Claude Lecommandeur
CTWM version 3.1 |
1 |
Here are some rplay sound patches for ctwm 3.0. Just in case you don't know |
2 |
what rplay is, here's some information from the README file: |
|
3 |
||
4 |
[README INFO] |
|
5 |
WHAT IS RPLAY? |
|
6 |
--------------
|
|
7 |
rplay is a sound package that supports both local and remote sound control. |
|
8 |
rplay is based on client/server communication using two protocols. The first |
|
9 |
protocol that can be used is RPLAY, which is UDP based and allows sounds to |
|
10 |
be played, paused, continued, and stopped. The second protocol is RPTP |
|
11 |
(the Remote Play Transfer Protocol) which is TCP based and allows sounds to be |
|
12 |
played, paused, continued, stopped, and transferred. |
|
13 |
||
14 |
The rplay system can be described as follows. An rplay client sends an RPLAY |
|
15 |
UDP packet to an rplay server. The RPLAY packet sent contains the name of a |
|
16 |
sound file and various other sound attributes. The rplay server receives the |
|
17 |
RPLAY packet and looks up the sound in a sound file database. If the sound |
|
18 |
is found in the database it will be immediately played on the host the rplay |
|
19 |
server is running on. If the sound is not found in the database the rplay |
|
20 |
server can be configured to search other rplay servers for the desired sound |
|
21 |
file. rplay servers communicate using the RPTP protocol. rplay clients can |
|
22 |
also use RPTP to upload sounds to an rplay server. When an rplay server |
|
23 |
receives sounds from a server or a client the sounds are stored in a sound |
|
24 |
cache directory. The size in bytes of the cache directory can be limited |
|
25 |
by the rplay server. When the cache is full, the rplay server will remove |
|
26 |
sounds using a "least recently used" algorithm. Sound files that are larger |
|
27 |
than the maximum cache size will not be accepted by the rplay server. |
|
28 |
||
29 |
rplay can be used to easily add sound to any application. For example, |
|
30 |
if you want to play a sound when a button is pressed, all you need to do |
|
31 |
is this: |
|
32 |
||
33 |
rplay_local("sound_name.au"); |
|
34 |
||
35 |
If you want to specify a hostname: |
|
36 |
||
37 |
rplay_host("bozo.sdsu.edu", "sound_name.au"); |
|
38 |
||
39 |
The above routines along with many others are included in the rplay library. |
|
40 |
See the KNOWN RPLAY APPLICATIONS section of this file for a list of applications |
|
41 |
that use the rplay library. |
|
42 |
||
43 |
Currently the rplay server only supports u-law 8000hz sound files. |
|
44 |
||
45 |
PORTING: |
|
46 |
--------
|
|
47 |
rplay is known to work on the following systems: |
|
48 |
||
49 |
* Sun SPARCstations running SunOS 4.1.x |
|
50 |
||
51 |
* Sun SPARCstations running Solaris 2.x |
|
52 |
||
53 |
* HP-UX |
|
54 |
||
55 |
* Linux |
|
56 |
||
57 |
* BSDI/386 |
|
58 |
||
59 |
* 386bsd using Steve Haehnichen's soundblaster driver version 1.5 |
|
60 |
||
61 |
* SGI Indigo |
|
62 |
||
63 |
All rplay requires is an audio device where sounds can be played using the |
|
64 |
write system call. For example, if you can "cat sound_file > /dev/audio", |
|
65 |
then rplay should work. If your system has an audio device that does not work |
|
66 |
with the above "cat" command, there is still hope but you might need to do some |
|
67 |
programming. You will probably only need to modify rplayd/audio.c. |
|
68 |
If you port rplay to another system please send me patches. |
|
69 |
[END OF README INFO] |
|
70 |
||
71 |
rplay support has been added to the olvwm, twm, tvtwm, and ctwm window managers |
|
72 |
and many games like XTank, XPilot, and XBoing just to name a few. |
|
73 |
||
74 |
If you are interested, you can obtain rplay at sounds.sdsu.edu in the /pub/rplay |
|
75 |
directory or I can mail you a copy. |
|
76 |
||
77 |
I would also like to give proper credit for the window manager patches. |
|
78 |
Olvwm patches where originally implemented by Andrew "Ender" Scherpbier (Andrew@SDSU.Edu) |
|
79 |
and were later modified to support tvtwm and twm by J.E. Sacco (jsacco @ssl.com). |
|
80 |
I slightly modified the tvtwm patches to support ctwm. |
|
81 |
||
82 |
Oops, I forgot to tell you what has been changed in ctwm. Two new functions have |
|
83 |
been added: |
|
84 |
||
85 |
f.rereadsounds - rereads the .ctwm-sounds file |
|
86 |
f.togglesound - turns on/off the sound |
|
87 |
||
88 |
and I added: |
|
89 |
||
90 |
SoundHost "hostname" - where hostname is the host to play sounds on. |
|
91 |
||
92 |
The .ctwm-sounds file has the following format <X Event> <sound>: |
|
93 |
||
94 |
KeyPress: Cork.au |
|
95 |
MapNotify: turbbeep.au |
|
96 |
ResizeRequest: failure.au |
|
97 |
Startup: 2lust.au |
|
98 |
Shutdown: 1sadeness.au |
|
99 |
||
100 |
--
|
|
101 |
Mark Boyns |
|
102 |
boyns@sdsu.edu |
|
103 |
||
104 |