aboutsummaryrefslogtreecommitdiffstats
path: root/src/jake2/sound/jsound/JSoundImpl.java
blob: 3a3cc46b21afe640509b94184c96888248e292d8 (plain)
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
/*
 * JSoundImpl.java
 * Copyright (C) 2004
 *
 * $Id: JSoundImpl.java,v 1.1 2004-07-09 06:50:48 hzi Exp $
 */
package jake2.sound.jsound;

import jake2.sound.*;
import jake2.sound.Sound;
import jake2.sound.sfx_t;

/**
 * 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, byte[] data) {
		SND_DMA.RawSamples(samples, rate, width, channels, data);
	}

}