1 /***************************************************************************
2 * Copyright (C) 2010 by the Alterverse team *
3 * email: rynkruger@gmail.com *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 3 of the License, or *
8 * (at your option) any later version. *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write see: *
17 * <http://www.gnu.org/licenses/>. *
18 ***************************************************************************/
20 package org
.alterverse
.sound
;
22 import java
.util
.ArrayList
;
25 public class SoundManager
{
26 static ArrayList
<Sound
> delsounds
;
27 static boolean running
;
30 public static void init() {
32 delsounds
=new ArrayList
<Sound
>();
34 Thread runner
=new Thread() {
37 for (int i
= 0; i
< delsounds
.size();i
++)
38 if (! delsounds
.get(i
).isPlaying()) {
39 delsounds
.get(i
).destroy();
40 delsounds
.remove(delsounds
.get(i
));
44 Thread
.sleep(300);} catch(Exception x
) {
54 public static void setListenerPosition(double x
, double y
, double z
) {
55 bcl
.setListenerPosition((float) x
, (float) y
, (float) z
);
59 public void setListenerOrientation(double fx, double fy, double fz, double ux, double uy, double uz) {
60 FloatBuffer ori = BufferUtils.createFloatBuffer(6).put(new float[] {(float) fx,(float) fy,(float) fz,(float) ux,(float) uy,(float) uz});
62 AL10.alListener(AL10.AL_ORIENTATION,ori);
66 public static void removeSound(Sound sound
) {
70 public static void terminate() {