From 8c0c280a1235d8eb25758edf87fbc4e21805ab01 Mon Sep 17 00:00:00 2001 From: Brian Matzon Date: Sat, 14 Dec 2002 12:38:39 +0000 Subject: [PATCH] no message --- src/java/org/lwjgl/openal/ALUT.java | 136 ++++++++++++++-------------- 1 file changed, 68 insertions(+), 68 deletions(-) diff --git a/src/java/org/lwjgl/openal/ALUT.java b/src/java/org/lwjgl/openal/ALUT.java index e8bc77ea..86c6461c 100644 --- a/src/java/org/lwjgl/openal/ALUT.java +++ b/src/java/org/lwjgl/openal/ALUT.java @@ -29,7 +29,7 @@ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - package org.lwjgl.openal; +package org.lwjgl.openal; /** * $Id$ @@ -41,106 +41,106 @@ * @version $Revision$ */ public class ALUT { - + /** Has the ALUT object been created? */ - protected static boolean created; - + protected static boolean created; + static { initialize(); } - - /** Creates a new instance of ALUT */ - public ALUT() { - } - - /** - * Override to provide any initialization code after creation. - */ + + /** Creates a new instance of ALUT */ + public ALUT() { + } + + /** + * Override to provide any initialization code after creation. + */ protected void init() { } - + /** * Static initialization */ private static void initialize() { System.loadLibrary(org.lwjgl.Sys.getLibraryName()); } - - /** - * Creates the ALUT instance - * - * @throws Exception if a failiure occured in the ALUT creation process - */ + + /** + * Creates the ALUT instance + * + * @throws Exception if a failiure occured in the ALUT creation process + */ public void create() throws Exception { if (created) { return; - } - + } + if (!nCreate()) { throw new Exception("ALUT instance could not be created."); - } + } created = true; - init(); + init(); } - + /** * Native method to create ALUT instance * * @return true if the ALUT creation process succeeded */ protected native boolean nCreate(); - + /** * Calls whatever destruction rutines that are needed */ public void destroy() { if (!created) { return; - } - created = false; - nDestroy(); + } + created = false; + nDestroy(); } - + /** * Native method the destroy the ALUT */ - protected native void nDestroy(); - - /** - * Initializes the OpenAL engine - * - * @param args String array of arguments to engine - */ - public native void init(String[] args); - - /** - * Loads a wave file into memory - * - * @param file name of file to load (in current working directory) - * @return ALUTLoadWAVData object containing information regarding wave data loaded - */ - public native ALUTLoadWAVData loadWAVFile(String file); - - /** - * Loads a byte buffer into memory - * - * @param buffer buffer address containing file - * @return ALUTLoadWAVData object containing information regarding wave data loaded - */ - public native ALUTLoadWAVData loadWAVMemory(int buffer); - - /** - * Unloads the specified file from memory - * - * @param format OpenAL format specifier - * @param data address of data (pointer) - * @param size size of the data in bytes - * @param freq frequency of the data - */ - public native void unloadWAV(int format, int data, int size, int freq); - - /** - * Deinitializes the OpenAL engine - */ - public native void exit(); + protected native void nDestroy(); + + /** + * Initializes the OpenAL engine + * + * @param args String array of arguments to engine + */ + public native void init(String[] args); + + /** + * Loads a wave file into memory + * + * @param file name of file to load (in current working directory) + * @return ALUTLoadWAVData object containing information regarding wave data loaded + */ + public native ALUTLoadWAVData loadWAVFile(String file); + + /** + * Loads a byte buffer into memory + * + * @param buffer buffer address containing file + * @return ALUTLoadWAVData object containing information regarding wave data loaded + */ + public native ALUTLoadWAVData loadWAVMemory(int buffer); + + /** + * Unloads the specified file from memory + * + * @param format OpenAL format specifier + * @param data address of data (pointer) + * @param size size of the data in bytes + * @param freq frequency of the data + */ + public native void unloadWAV(int format, int data, int size, int freq); + + /** + * Deinitializes the OpenAL engine + */ + public native void exit(); } \ No newline at end of file