1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
|
/*
* JSoundImpl.java
* Copyright (C) 2004
*
* $Id: JSoundImpl.java,v 1.2 2005-12-04 17:26:55 cawe Exp $
*/
package jake2.sound.jsound;
import java.nio.ByteBuffer;
import jake2.sound.*;
/**
* JSoundImpl
*/
public class JSoundImpl implements Sound {
static {
S.register(new JSoundImpl());
};
public boolean Init() {
SND_DMA.Init();
if (SND_DMA.sound_started) return true;
return false;
}
/* (non-Javadoc)
* @see jake2.sound.SoundImpl#Shutdown()
*/
public void Shutdown() {
SND_DMA.Shutdown();
}
/* (non-Javadoc)
* @see jake2.sound.SoundImpl#StartSound(float[], int, int, jake2.sound.sfx_t, float, float, float)
*/
public void StartSound(float[] origin, int entnum, int entchannel, sfx_t sfx, float fvol, float attenuation, float timeofs) {
SND_DMA.StartSound(origin, entnum, entchannel, sfx, fvol, attenuation, timeofs);
}
/* (non-Javadoc)
* @see jake2.sound.SoundImpl#StopAllSounds()
*/
public void StopAllSounds() {
SND_DMA.StopAllSounds();
}
/* (non-Javadoc)
* @see jake2.sound.SoundImpl#Update(float[], float[], float[], float[])
*/
public void Update(float[] origin, float[] forward, float[] right, float[] up) {
SND_DMA.Update(origin, forward, right, up);
}
/* (non-Javadoc)
* @see jake2.sound.Sound#getName()
*/
public String getName() {
return "jsound";
}
/* (non-Javadoc)
* @see jake2.sound.Sound#BeginRegistration()
*/
public void BeginRegistration() {
SND_DMA.BeginRegistration();
}
/* (non-Javadoc)
* @see jake2.sound.Sound#RegisterSound(java.lang.String)
*/
public sfx_t RegisterSound(String sample) {
return SND_DMA.RegisterSound(sample);
}
/* (non-Javadoc)
* @see jake2.sound.Sound#EndRegistration()
*/
public void EndRegistration() {
SND_DMA.EndRegistration();
}
/* (non-Javadoc)
* @see jake2.sound.Sound#StartLocalSound(java.lang.String)
*/
public void StartLocalSound(String sound) {
SND_DMA.StartLocalSound(sound);
}
/* (non-Javadoc)
* @see jake2.sound.Sound#RawSamples(int, int, int, int, byte[])
*/
public void RawSamples(int samples, int rate, int width, int channels, ByteBuffer data) {
SND_DMA.RawSamples(samples, rate, width, channels, data);
}
public void disableStreaming() {
}
}
|