fmod support

This commit is contained in:
Brian Matzon 2004-05-23 14:03:07 +00:00
parent 9ed3aa45e2
commit f4a2c8354f
34 changed files with 10862 additions and 0 deletions

View File

@ -0,0 +1,344 @@
/*
* Copyright (c) 2004 LWJGL Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of 'LWJGL' nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* 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.fmod;
import java.io.File;
import java.nio.FloatBuffer;
import java.util.HashMap;
import java.util.StringTokenizer;
/**
* $Id$
* <br>
* @author Brian Matzon <brian@matzon.dk>
* @version $Revision$
*/
public class FMOD {
/** Array of hashmaps for callbacks */
private static HashMap[] callbacks = new HashMap[14];
/** FMOD System level clear dsp unit */
static FSoundDSPUnit fmodClearUnit;
/** FMOD System level clip and copy dsp unit */
static FSoundDSPUnit fmodClipAndCopyUnit;
/** FMOD System level music dsp unit */
static FSoundDSPUnit fmodMusicUnit;
/** FMOD System level sound effects dsp unit */
static FSoundDSPUnit fmodSFXUnit;
/** FMOD System level FFT dsp unit */
static FSoundDSPUnit fmodFFTUnit;
/** FMOD System level FFT buffer */
static FloatBuffer fmodFFTBuffer;
/** Type defining the music callback entries in callback hashmap array */
public static final int FMUSIC_CALLBACK = 0;
/** Type defining the dsp callback entries in callback hashmap array */
public static final int FSOUND_DSPCALLBACK = 1;
/** Type defining the stream callback entries in callback hashmap array */
public static final int FSOUND_STREAMCALLBACK = 2;
/** Type defining the alloc callback entries in callback hashmap array */
public static final int FSOUND_ALLOCCALLBACK = 3;
/** Type defining the realloc callback entries in callback hashmap array */
public static final int FSOUND_REALLOCCALLBACK = 4;
/** Type defining the free callback entries in callback hashmap array */
public static final int FSOUND_FREECALLBACK = 5;
/** Type defining the open callback entries in callback hashmap array */
public static final int FSOUND_OPENCALLBACK = 6;
/** Type defining the close callback entries in callback hashmap array */
public static final int FSOUND_CLOSECALLBACK = 7;
/** Type defining the metadata callback entries in callback hashmap array */
public static final int FSOUND_METADATACALLBACK = 8;
/** Type defining the read callback entries in callback hashmap array */
public static final int FSOUND_READCALLBACK = 9;
/** Type defining the seek callback entries in callback hashmap array */
public static final int FSOUND_SEEKCALLBACK = 10;
/** Type defining the tell callback entries in callback hashmap array */
public static final int FSOUND_TELLCALLBACK = 11;
/** Type defining the "end" callback entries in callback hashmap array */
public static final int FSOUND_ENDCALLBACK = 12;
/** Type defining the "sync" callback entries in callback hashmap array */
public static final int FSOUND_SYNCCALLBACK = 13;
/** Have we been created? */
protected static boolean created;
/** No errors */
public static final int FMOD_ERR_NONE = 0;
/** Cannot call this command after FSOUND_Init. Call FSOUND_Close first. */
public static final int FMOD_ERR_BUSY = 1;
/** This command failed because FSOUND_Init was not called */
public static final int FMOD_ERR_UNINITIALIZED = 2;
/** Error initializing output device. */
public static final int FMOD_ERR_INIT = 3;
/** Error initializing output device, but more specifically, the output device is already in use and cannot be reused. */
public static final int FMOD_ERR_ALLOCATED = 4;
/** Playing the sound failed. */
public static final int FMOD_ERR_PLAY = 5;
/** Soundcard does not support the features needed for this soundsystem (16bit stereo output) */
public static final int FMOD_ERR_OUTPUT_FORMAT = 6;
/** Error setting cooperative level for hardware. */
public static final int FMOD_ERR_COOPERATIVELEVEL = 7;
/** Error creating hardware sound buffer. */
public static final int FMOD_ERR_CREATEBUFFER = 8;
/** File not found */
public static final int FMOD_ERR_FILE_NOTFOUND = 9;
/** Unknown file format */
public static final int FMOD_ERR_FILE_FORMAT = 10;
/** Error loading file */
public static final int FMOD_ERR_FILE_BAD = 11;
/** Not enough memory */
public static final int FMOD_ERR_MEMORY = 12;
/** The version number of this file format is not supported */
public static final int FMOD_ERR_VERSION = 13;
/** An invalid parameter was passed to this function */
public static final int FMOD_ERR_INVALID_PARAM = 14;
/** Tried to use an EAX command on a non EAX enabled channel or output. */
public static final int FMOD_ERR_NO_EAX = 15;
/** Failed to allocate a new channel */
public static final int FMOD_ERR_CHANNEL_ALLOC = 17;
/** Recording is not supported on this machine */
public static final int FMOD_ERR_RECORD = 18;
/** Required Mediaplayer codec is not installed */
public static final int FMOD_ERR_MEDIAPLAYER = 19;
/** An error occured trying to open the specified CD device */
public static final int FMOD_ERR_CDDEVICE = 20;
/** Whether we have been initialized */
private static boolean initialized;
/** The native JNI library name */
private static String JNI_LIBRARY_NAME = "lwjgl-fmod";
/** The native library name on win32 */
private static String FMOD_WIN32_LIBRARY_NAME = "fmod.dll";
/** The native library name on win32 */
private static String FMOD_LINUX_LIBRARY_NAME = "libfmod.so.0";
/** The native library name on win32 */
private static String FMOD_OSX_LIBRARY_NAME = "fmod_cfm.shlb";
/** Version of FMOD */
public static final String VERSION = "0.9a";
static {
initialize();
}
/**
* Initializes the FMOD binding
*/
public static void initialize() {
if (initialized) {
return;
}
initialized = true;
System.loadLibrary(JNI_LIBRARY_NAME);
// check for mismatch
String nativeVersion = getNativeLibraryVersion();
if (!nativeVersion.equals(VERSION)) {
throw new LinkageError(
"Version mismatch: jar version is '" + VERSION +
"', native libary version is '" + nativeVersion + "'");
}
// Initialize callback hashmaps
for(int i=0; i<callbacks.length; i++) {
callbacks[i] = new HashMap();
}
}
/**
* Return the version of the native library
*/
private static native String getNativeLibraryVersion();
/**
* @return true if AL has been created
*/
public static boolean isCreated() {
return created;
}
/**
* Creates an FMOD instance.
*/
public static void create() throws FMODException {
if (created) {
return;
}
// create, passing potential locations for native fmod library
nCreate(constructFMODSearchPaths());
created = true;
}
/**
* Retrieves an array of strings, with potential locations for
* the native fmod library
* @return array of strings, with potential locations for the native fmod library
*/
private static String[] constructFMODSearchPaths() {
// miscellaneous values
String libpath = System.getProperty("java.library.path");
String seperator = System.getProperty("path.separator");
String osName = System.getProperty("os.name");
// determine os library name
String dllName = FMOD_WIN32_LIBRARY_NAME;
if (osName.startsWith("Mac OS")) {
dllName = FMOD_OSX_LIBRARY_NAME;
} else if (osName.startsWith("Linux")) {
dllName = FMOD_LINUX_LIBRARY_NAME;
}
// split, and rebuild library path to path + dll
StringTokenizer st = new StringTokenizer(libpath, seperator);
String[] paths = new String[st.countTokens() + 1];
//build paths
for (int i = 0; i < paths.length - 1; i++) {
paths[i] = st.nextToken() + File.separator + dllName;
}
//add cwd path
paths[paths.length - 1] = dllName;
return paths;
}
/**
* Native method to create FMOD instance
*
* @return true if the FMOD creation process succeeded
*/
protected static native void nCreate(String[] paths);
/**
* Exit cleanly by calling destroy.
*/
public static void destroy() {
if(!created) {
return;
}
created = false;
nDestroy();
}
/**
* Native method the destroy the FMOD
*/
protected static native void nDestroy();
/**
* Registers a callback by its handle
*
* @param handle Handle to native object being monitored
* @param callbackHandler Object to register as the call back handler
*/
static void registerCallback(int type, long handle, Object handled, Object callbackHandler) {
if(callbackHandler == null) {
callbacks[type].remove(new Long(handle));
} else {
callbacks[type].put(new Long(handle), new FMOD.WrappedCallback(handled, callbackHandler));
}
}
/**
* Retrieves a call back handler by its native handle
* @param handle Handle to native object being monitored
* @return Call back handler, or null if no such handler
*/
static WrappedCallback getCallback(int type, long handle) {
return (WrappedCallback) callbacks[type].get(new Long(handle));
}
/**
* Retrieves the errorcode desription for specified code
*
* @param errorcode errorcode to lookup
* @return Description of errorcode
*/
public static native String FMOD_ErrorString(int errorcode);
/**
* Wrapper class for a callback handler, and the object associated
*/
static class WrappedCallback {
Object handled;
Object callback;
WrappedCallback(Object handled, Object callback) {
this.handled = handled;
this.callback = callback;
}
}
}

View File

@ -0,0 +1,53 @@
/*
* Copyright (c) 2004 LWJGL Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of 'LWJGL' nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* 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.fmod;
import org.lwjgl.LWJGLException;
/**
* FMOD Exception specific for FMOD exceptions (duh!)
* $Id$
* <br>
* @author Brian Matzon <brian@matzon.dk>
* @version $Revision$
*/
public class FMODException extends LWJGLException {
/**
* Creates a new FMODException
*
* @param msg Message describing nature of exception
*/
public FMODException(String msg) {
super(msg);
}
}

View File

@ -0,0 +1,733 @@
/*
* Copyright (c) 2004 LWJGL Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of 'LWJGL' nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* 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.fmod;
import java.nio.ByteBuffer;
import java.nio.IntBuffer;
import org.lwjgl.fmod.callbacks.FMusicCallback;
/**
* $Id$
* <br>
* @author Brian Matzon <brian@matzon.dk>
* @version $Revision$
*/
public class FMusic {
/** No song being played */
public static final int FMUSIC_TYPE_NONE = 0;
/** Protracker / Fasttracker */
public static final int FMUSIC_TYPE_MOD = 1;
/** ScreamTracker 3 */
public static final int FMUSIC_TYPE_S3M = 2;
/** FastTracker 2 */
public static final int FMUSIC_TYPE_XM = 3;
/** Impulse Tracker */
public static final int FMUSIC_TYPE_IT = 4;
/** MIDI file */
public static final int FMUSIC_TYPE_MIDI = 5;
/** FMOD Sample Bank file */
public static final int FMUSIC_TYPE_FSB = 6;
/**
* To load a module or bank with a given filename. FMUSIC Supports loading of
* - .MOD (protracker/fasttracker modules)
* - .S3M (screamtracker 3 modules)
* - .XM (fasttracker 2 modules)
* - .IT (impulse tracker modules)
* - .MID (MIDI files)
* - .RMI (MIDI files)
* - .SGT (DirectMusic segment files)
* - .FSB (FMOD Sample Bank files)
*
* @param name Filename of module to load
* @return On success, a FMusicModule instance is returned. On failure, Null is returned
*/
public static FMusicModule FMUSIC_LoadSong(String name) {
long result = nFMUSIC_LoadSong(name);
if(result != FMUSIC_TYPE_NONE) {
return new FMusicModule(result);
}
return null;
}
private static native long nFMUSIC_LoadSong(String name);
/**
* To load a module or bank with a given filename. FMUSIC Supports loading of
* - .MOD (protracker/fasttracker modules)
* - .S3M (screamtracker 3 modules)
* - .XM (fasttracker 2 modules)
* - .IT (impulse tracker modules)
* - .MID (MIDI files)
* - .RMI (MIDI files)
* - .SGT (DirectMusic segment files)
* - .FSB (FMOD Sample Bank files)
* <p>
* <i>
* Loading a song from a memory handle is dangerous in one respect, if the data is corrupted or truncated, then FMUSIC could crash internally trying to load it.
* On PlayStation 2 the data and length pointer must be 16 byte aligned for DMA purposes.
* The samplelist and samplelistnum parameters are useful for limiting the amount of data fmod loads. This feature is for the FSB format only. It is especially useful if you have a bank of sounds and want to randomize the loading a bit by telling which sounds to load with random values, and consequently which not to load.
* On PlayStation 2, samplelistnum has a limit of 1536 entries.
* </i>
* </p>
*
* @param name_or_data Name of song or data containing song to load (if loading from memory and not file). On PlayStation 2 data must be 16 byte aligned if loading from memory
* @param offset Optional. 0 by default. If > 0, this value is used to specify an offset in a file, so fmod will seek before opening
* @param length Optional. 0 by default. If > 0, this value is used to specify the length of a memory block when using FSOUND_LOADMEMORY, or it is the length of a file or file segment if the offset parameter is used. On PlayStation 2 this must be 16 byte aligned for memory loading
* @param mode Mode for opening song. With module files, only FSOUND_LOADMEMORY, FSOUND_NONBLOCKING, FSOUND_LOOP_NORMAL, or FSOUND_LOOP_OFF are supported. For FSB files, FSOUND_2D, FSOUND_HW3D, FSOUND_FORCEMONO also work
* @param sampleList Optional. Buffer of sample indicies to load. Leave as Null if you want all samples to be loaded (default behaviour). See Remarks for more on this
* @return On success, a FMusicModule instance is returned. On failure, Null is returned
*/
public static FMusicModule FMUSIC_LoadSongEx(ByteBuffer name_or_data, int offset, int length, int mode, IntBuffer sampleList) {
long result = 0;
if((mode & FSound.FSOUND_LOADMEMORY) == FSound.FSOUND_LOADMEMORY) {
result = nFMUSIC_LoadSongEx(name_or_data, name_or_data.position(), offset, length, mode, (sampleList != null) ? sampleList : null, (sampleList != null) ? sampleList.position() : 0, (sampleList != null) ? sampleList.remaining() : 0);
} else {
byte[] data = new byte[name_or_data.remaining()];
result = nFMUSIC_LoadSongEx(new String(data), offset, length, mode, (sampleList != null) ? sampleList : null, (sampleList != null) ? sampleList.position() : 0, (sampleList != null) ? sampleList.remaining() : 0);
}
if(result != FMUSIC_TYPE_NONE) {
return new FMusicModule(result);
}
return null;
}
private static native long nFMUSIC_LoadSongEx(ByteBuffer data, int dataOffset, int offset, int length, int mode, IntBuffer sampleList, int bufferOffset, int remaining);
private static native long nFMUSIC_LoadSongEx(String name, int offset, int length, int mode, IntBuffer sampleList, int bufferOffset, int remaining);
/**
* If a mod is opened with FSOUND_NONBLOCKING, this function returns the state of the opening mod.
* @param module Module to get the open state from
* @return 0 = mod is opened and ready. -1 = mod handle passed in is invalid. -2 = mod is still opening -3 = mod failed to open. (file not found, out of memory or other error).
*/
public static int FMUSIC_GetOpenState(FMusicModule module) {
return nFMUSIC_GetOpenState(module.moduleHandle);
}
private static native int nFMUSIC_GetOpenState(long module);
/**
* Frees memory allocated for a song and removes it from the FMUSIC system
* @param module Module to be freed
* @return On success, true is returned. On failure, false is returned
*/
public static boolean FMUSIC_FreeSong(FMusicModule module) {
// when freeing a song, we automatically deregister any callbacks
FMOD.registerCallback(FMOD.FMUSIC_CALLBACK, module.moduleHandle, null, null);
return nFMUSIC_FreeSong(module.moduleHandle);
}
private static native boolean nFMUSIC_FreeSong(long module);
/**
* Starts a song playing
* @param module Module to be played
* @return true if module succeeded playing. false if module failed playing
*/
public static boolean FMUSIC_PlaySong(FMusicModule module) {
return nFMUSIC_PlaySong(module.moduleHandle);
}
private static native boolean nFMUSIC_PlaySong(long module);
/**
* Stops a song from playing.
* @param module Module to be stopped
* @return On success, true is returned. On failure, false is returned
*/
public static boolean FMUSIC_StopSong(FMusicModule module) {
return nFMUSIC_StopSong(module.moduleHandle);
}
private static native boolean nFMUSIC_StopSong(long module);
/**
* Stops all songs from playing. This is useful if you have multiple songs playing at once and
* want a quick way to stop them
*/
private static native void FMUSIC_StopAllSongs();
/**
* Sets a user callback for any Zxx commands encountered in an S3M, XM or IT file.
* <p>
* <b>Remarks</b>
* The value passed into the param parameter of the callback is the xx value specified in the Zxx
* command by the musician
* ------------
* It is important to note that this callback will be called from directly WITHIN the
* mixer / music update thread, therefore it is imperative that whatever you do from this
* callback be extremely efficient. If the routine takes too long then breakups in the sound
* will occur, or it will basically stop mixing until you return from the function.
* This sort of function is usually best for just setting a flag, or do some simple variable
* manipulation, and then exiting, letting your main thread do what it needs to based on these
* flags or variables.
* ------------
* This callback is LATENCY adjusted, so that the callback happens when you HEAR the sound, not when it is mixed, for accurate synchronization.
* Use FSOUND_INIT_DONTLATENCYADJUST if you want it to be called back at mix time, which is useful if you want to control the music interactively.
* ------------
* Note : This function is not supported with the MIDI format.
* @param module Module to set the callback for
* @param callback The callback function you supply to get called upon execution of a Zxx command
* @return On success, true is returned. On failure, false is returned
*/
public static boolean FMUSIC_SetZxxCallback(FMusicModule module, FMusicCallback callback) {
FMOD.registerCallback(FMOD.FMUSIC_CALLBACK, module.moduleHandle, module, callback);
return nFMUSIC_SetZxxCallback(module.moduleHandle, callback);
}
private static native boolean nFMUSIC_SetZxxCallback(long module, FMusicCallback callback);
/**
* Sets a user callback to occur on every row divisible by the rowstep parameter, played from a MOD, S3M, XM or IT file.
* <p>
* <b>Remarks</b>
* It is important to note that this callback will be called from directly WITHIN the
* mixer / music update thread, therefore it is imperative that whatever you do from this
* callback be extremely efficient. If the routine takes too long then breakups in the sound
* will occur, or it will basically stop mixing until you return from the function.
* This sort of function is usually best for just setting a flag, or do some simple variable
* manipulation, and then exiting, letting your main thread do what it needs to based on these
* flags or variables.
* ------------
* This callback is LATENCY adjusted, so that the callback happens when you HEAR the sound, not when it is mixed, for accurate synchronization.
* Use FSOUND_INIT_DONTLATENCYADJUST if you want it to be called back at mix time, which is useful if you want to control the music interactively.
* ------------
* Note : This function is not supported with the MIDI format.
* @param module Module to set the callback for
* @param callback The callback function you supply to get called
* @param rowstep Call the callback every multiple of this number of rows
* @return On success, true is returned. On failure, false is returned
*/
public static boolean FMUSIC_SetRowCallback(FMusicModule module, FMusicCallback callback, int rowstep) {
FMOD.registerCallback(FMOD.FMUSIC_CALLBACK, module.moduleHandle, module, callback);
return nFMUSIC_SetRowCallback(module.moduleHandle, callback, rowstep);
}
private static native boolean nFMUSIC_SetRowCallback(long module, FMusicCallback callback, int rowstep);
/**
* Sets a user callback to occur on every order divisible by the orderstep parameter, played from a MOD, S3M, XM or IT file
* <p>
* <b>Remarks</b>
* It is important to note that this callback will be called from directly WITHIN the
* mixer / music update thread, therefore it is imperative that whatever you do from this
* callback be extremely efficient. If the routine takes too long then breakups in the sound
* will occur, or it will basically stop mixing until you return from the function.
* This sort of function is usually best for just setting a flag, or do some simple variable
* manipulation, and then exiting, letting your main thread do what it needs to based on these
* flags or variables.
* ------------
* This callback is LATENCY adjusted, so that the callback happens when you HEAR the sound, not when it is mixed, for accurate synchronization.
* Use FSOUND_INIT_DONTLATENCYADJUST if you want it to be called back at mix time, which is useful if you want to control the music interactively.
* ------------
* Note : This function is not supported with the MIDI format.
* @param module Module to set the callback for
* @param callback The callback function you supply to get called
* @param orderstep Call the callback every multiple of this number of orders
* @return On success, true is returned. On failure, false is returned
*/
public static boolean FMUSIC_SetOrderCallback(FMusicModule module, FMusicCallback callback, int orderstep) {
FMOD.registerCallback(FMOD.FMUSIC_CALLBACK, module.moduleHandle, module, callback);
return nFMUSIC_SetOrderCallback(module.moduleHandle, callback, orderstep);
}
private static native boolean nFMUSIC_SetOrderCallback(long module, FMusicCallback callback, int orderstep);
/**
* Sets a user callback to occur every time a instrument is played, triggered from a MOD, S3M, XM or IT file.
* <p>
* <b>Remarks</b>
* It is important to note that this callback will be called from directly WITHIN the
* mixer / music update thread, therefore it is imperative that whatever you do from this
* callback be extremely efficient. If the routine takes too long then breakups in the sound
* will occur, or it will basically stop mixing until you return from the function.
* This sort of function is usually best for just setting a flag, or do some simple variable
* manipulation, and then exiting, letting your main thread do what it needs to based on these
* flags or variables.
* ------------
* This callback is LATENCY adjusted, so that the callback happens when you HEAR the sound, not when it is mixed, for accurate synchronization.
* Use FSOUND_INIT_DONTLATENCYADJUST if you want it to be called back at mix time, which is useful if you want to control the music interactively.
* ------------
* Note : This function is not supported with the MIDI format.
* @param module Module set the callback for
* @param callback The callback function you supply to get called
* @param instrument Call the callback when this instrument number is triggered
* @return On success, true is returned. On failure, false is returned
*/
public static boolean FMUSIC_SetInstCallback(FMusicModule module, FMusicCallback callback, int instrument) {
FMOD.registerCallback(FMOD.FMUSIC_CALLBACK, module.moduleHandle, module, callback);
return nFMUSIC_SetInstCallback(module.moduleHandle, callback, instrument);
}
private static native boolean nFMUSIC_SetInstCallback(long module, FMusicCallback callback, int instrument);
/**
* Replaces a mod's sample with a sample definition specified.
* <p>
* <b>Remarks</b>
* Because of the instrument nature of some formats like XM, this function lists all the samples in order of instruments and their subsamples.
* ie if instrument 1 has 2 samples and instrument 2 contains 3 samples, then sampno in this case would be 0 and 1 for instrument 1's samples, and 2,3 & 4 for instrument 2's samples.
* ------------
* FMOD does not free the existing mod sample that you may be overwriting. If you do overwrite an existing handle, it may be lost, and you may incur a memory leak. It is a good idea to free the existing sample first before overwriting it.
* ------------
* Important: For PlayStation 2, this function has to do a blocking query to the IOP, and can take significantly more time than a standard non blocking fmod function. This means it is best to cache the pointers for samples while loading, and not call this function in realtime.
* ------------
* This function is not supported with the MIDI format.
* </p>
* @param module Module to set the sample for.
* @param sampno index to sample inside module
* @param sptr sample definition to replace mod sample
* @return On success, true is returned. On failure, false is returned
*/
public static boolean FMUSIC_SetSample(FMusicModule module, int sampno, FSoundSample sptr) {
return nFMUSIC_SetSample(module.moduleHandle, sampno, sptr.sampleHandle);
}
private static native boolean nFMUSIC_SetSample(long module, int sampno, long sptr);
/**
* Sets a user defined value to store with the music file to be retrieved later.
* @param module Module to set user data for
* @param userdata Value to store with music object
* @return On success, true is returned. On failure, false is returned
*/
public static boolean FMUSIC_SetUserData(FMusicModule module, ByteBuffer userdata) {
return nFMUSIC_SetUserData(module.moduleHandle, userdata, userdata.position());
}
private static native boolean nFMUSIC_SetUserData(long module, ByteBuffer userdata, int offset);
/**
* This function helps with channel usage. If you are desperate for channels, and you are prepared to
* let the music routines drop a few channels, then calling this function can help.
* It basically doesnt try to play any new sounds if a certain channel limit is being played (including sound effects),
* and the new sound is below a certain specified volume.
* ie.
* You set it to maxchannels = 16, and minvolume = 0x10.
* In this case, the mod will play normally as long as the total number of channels being played inclusing sound effefcts is below 16
* (see FSOUND_GetChannelsPlaying).
* If the number of channels playing exceeds 16 (through a change in the music, or extra sound effects
* are spawned, then sounds with a musician specified volume of less than 0x10 will be ignored.
* The volume is based on volume column/default volume/volume set commands in the mod. master volume,
* envelope volumes etc are not taken into account (this gives more control over how it will work from the
* tracker).
* <p>
* <b>Remarks</b>
* maxchannels will default to the number of channels allocated by FSOUND, so this will never happen
* by default.
* minvolume will default to 0, so it will always succeed by default.
* To see how many channels are currently being MIXED, use FSOUND_GetChannelsPlaying.
* As a musician mentioned to me once, most of his default volumes are set fairly high, and any low end
* volumes are usually echoes etc, and can afford to be dropped.
* ------------
* Note : This function is not supported with the MIDI format.
* </p>
* @param module Module to set channel/volume optimization settings
* @param maxchannels Channel count to be mixed before fmusic starts to drop channels from the song
* @param minvolume If maxchannels is exceeded, then music channels with volumes below this value will not be played. Range is 0-64. This is the value the tracker displays. All trackers use 0-64
* @return On success, true is returned. On failure, false is returned
*/
public static boolean FMUSIC_OptimizeChannels(FMusicModule module, int maxchannels, int minvolume) {
return nFMUSIC_OptimizeChannels(module.moduleHandle, maxchannels, minvolume);
}
private static native boolean nFMUSIC_OptimizeChannels(long module, int maxchannels, int minvolume);
/**
* Turns on reverb for MIDI/RMI files.
* <p>
* <b>Remarks</b>
* Reverb may be enabled through software emulation in the future for MOD based formats.
* </p>
* @param reverb Set to true to turn MIDI reverb on, false to turn MIDI reverb off
* @return On success, true is returned. On failure, false is returned
*/
public static native boolean FMUSIC_SetReverb(boolean reverb);
/**
* Sets looping mode for midi and mod files
* <p>
* <b>Remarks</b>
* Defaults to TRUE. To disable looping you must call this function using FALSE as the parameter.
* For midi files this only takes effect before FMUSIC_PlaySong is called. For mod files this
* can be called at any time including during playback.
* </p>
* @param module Module to set looping for
* @param looping Set to true to make it loop forever, or false to only have it play once
* @return On success, true is returned. On failure, false is returned
*/
public static boolean FMUSIC_SetLooping(FMusicModule module, boolean looping) {
return nFMUSIC_SetLooping(module.moduleHandle, looping);
}
private static native boolean nFMUSIC_SetLooping(long module, boolean looping);
/**
* Sets a songs order position / current playing position.
* <p>
* <b>Remarks</b>
* Note : This function is not supported with the MIDI format.
* </p>
* @param module Module to have its order changed
* @param order Order number to jump to
* @return On success, true is returned. On failure, false is returned
*/
public static boolean FMUSIC_SetOrder(FMusicModule module, int order) {
return nFMUSIC_SetOrder(module.moduleHandle, order);
}
private static native boolean nFMUSIC_SetOrder(long module, int order);
/**
* Pauses a song
* @param module Module to be paused/unpaused
* @param pause true - song should be PAUSED, false - song should be UNPAUSED
* @return On success, true is returned. On failure, false is returned
*/
public static boolean FMUSIC_SetPaused(FMusicModule module, boolean pause) {
return nFMUSIC_SetPaused(module.moduleHandle, pause);
}
private static native boolean nFMUSIC_SetPaused(long module, boolean pause);
/**
* Sets a songs master volume.
* @param module Module to have its master volume set
* @param volume value from 0-256. 0 = silence, 256 = full volume
* @return On success, true is returned. On failure, false is returned
*/
public static boolean FMUSIC_SetMasterVolume(FMusicModule module, int volume) {
return nFMUSIC_SetMasterVolume(module.moduleHandle, volume);
}
private static native boolean nFMUSIC_SetMasterVolume(long module, int volume);
/**
* Sets a songs master speed scale, so that the song can be sped up or slowed down.
* @param module Module to have its speed scale set
* @param speed Speed scale for song. 1.0 is default. Minimum is 0 (stopped), maximum is 10.0
* @return On success, true is returned. On failure, false is returned
*/
public static boolean FMUSIC_SetMasterSpeed(FMusicModule module, float speed) {
return nFMUSIC_SetMasterSpeed(module.moduleHandle, speed);
}
private static native boolean nFMUSIC_SetMasterSpeed(long module, float speed);
/**
* Sets the master pan seperation for a module
* @param module Module to set pan seperation for
* @param pansep The pan scale. 1.0 means full pan seperation, 0 means mono
* @return On success, true is returned. On failure, false is returned
*/
public static boolean FMUSIC_SetPanSeperation(FMusicModule module, float pansep) {
return nFMUSIC_SetPanSeperation(module.moduleHandle, pansep);
}
private static native boolean nFMUSIC_SetPanSeperation(long module, float pansep);
/**
* Returns the name of the song set by the composer. With MIDI format, the filename is returned
* @param module Module to retrieve name from
* @return On success, the name of the song is returned. On failure, Null is returned
*/
public static String FMUSIC_GetName(FMusicModule module) {
return nFMUSIC_GetName(module.moduleHandle);
}
private static native String nFMUSIC_GetName(long module);
/**
* Returns the format type a song
* @param module Module to retrieve type from
* @return FMusicType constant, FMUSIC_TYPE_NONE on failure
*/
public static int FMUSIC_GetType(FMusicModule module) {
return nFMUSIC_GetType(module.moduleHandle);
}
private static native int nFMUSIC_GetType(long module);
/**
* Returns the number of orders in this song
* @param module Module to retrieve number of orders from
* @return On success, the number of orders in this song is returned. On failure, 0 is returned
*/
public static int FMUSIC_GetNumOrders(FMusicModule module) {
return nFMUSIC_GetNumOrders(module.moduleHandle);
}
private static native int nFMUSIC_GetNumOrders(long module);
/**
* Returns the number of patterns contained in this song.
* @param module Module to retrieve number of patterns from
* @return On success, the number of patterns contained in this song is returned. On failure, 0 is returned
*/
public static int FMUSIC_GetNumPatterns(FMusicModule module) {
return nFMUSIC_GetNumPatterns(module.moduleHandle);
}
private static native int nFMUSIC_GetNumPatterns(long module);
/**
* Returns the number of instruments contained in this song.
* @param module Module to retrieve number of instruments from
* @return On success, the number of instruments contained in this song is returned. On failure, 0 is returned.
*/
public static int FMUSIC_GetNumInstruments(FMusicModule module) {
return nFMUSIC_GetNumInstruments(module.moduleHandle);
}
private static native int nFMUSIC_GetNumInstruments(long module);
/**
* Returns the number of samples contained in this song.
* @param module Module to retrieve number of samples
* @return Number of samples contained in this song. On failure, 0 is returned.
*/
public static int FMUSIC_GetNumSamples(FMusicModule module) {
return nFMUSIC_GetNumSamples(module.moduleHandle);
}
private static native int nFMUSIC_GetNumSamples(long module);
/**
* Returns the number of channels within this songs pattern data
* @param module Module to retrieve number of channels from
* @return Number of channels within this songs pattern data. On failure, 0 is returned.
*/
public static int FMUSIC_GetNumChannels(FMusicModule module) {
return nFMUSIC_GetNumChannels(module.moduleHandle);
}
private static native int nFMUSIC_GetNumChannels(long module);
/**
* Returns a reference to a sample inside a module.
* Once you have access to the module's sample, you can do a lot of things
* to it, including locking and modifying the data within; using the
* FSOUND_Sample_ functionality
* <p>
* <b>Remarks</b>
* Because of the instrument nature of some formats like XM, this
* function lists all the samples in order of instruments and their subsamples.
* ie if instrument 1 has 2 samples and instrument 2 contains 3 samples, then
* sampno in this case would be 0 and 1 for instrument 1's samples, and 2,3 & 4
* for instrument 2's samples.
* </p>
* @param module Module to retrieve a sample handle from
* @param sampno index to sample inside module
* @return On success, a valid sample is returned. On failure, Null is returned.
*/
public static FSoundSample FMUSIC_GetSample(FMusicModule module, int sampno) {
long result = nFMUSIC_GetSample(module.moduleHandle, sampno);
if(result != 0) {
return new FSoundSample(result);
}
return null;
}
private static native long nFMUSIC_GetSample(long module, int sampno);
/**
* Returns the the length in rows of the pattern for the specified order number
* @param module Module to get pattern lenght from
* @param orderno pattern at specified order
* @return On success, the songs pattern length at the specified order is returned. On failure, 0 is returned
*/
public static int FMUSIC_GetPatternLength(FMusicModule module, int orderno) {
return nFMUSIC_GetPatternLength(module.moduleHandle, orderno);
}
private static native int nFMUSIC_GetPatternLength(long module, int orderno);
/**
* Returns whether the song has completed playing, or when the last order has finished playing.
* This stays set even if the song loops.
* @param module Module that you want check if finished or not
* @return true if module has finished playing. false if module has not finished playing.
*/
public static boolean FMUSIC_IsFinished(FMusicModule module) {
return nFMUSIC_IsFinished(module.moduleHandle);
}
private static native boolean nFMUSIC_IsFinished(long module);
/**
* Returns whether the song is currently playing or not.
* @param module Module to retrieve name from
* @return true Song is playing. false Song is stopped.
*/
public static boolean FMUSIC_IsPlaying(FMusicModule module) {
return nFMUSIC_IsPlaying(module.moduleHandle);
}
private static native boolean nFMUSIC_IsPlaying(long module);
/**
* Returns the song's current master volume
* @param module Module to retrieve song master volume from
* @return On success, the song's current master volume, from 0 (silence) to 256 (full volume) is returned. On failure, -1 is returned.
*/
public static int FMUSIC_GetMasterVolume(FMusicModule module) {
return nFMUSIC_GetMasterVolume(module.moduleHandle);
}
private static native int nFMUSIC_GetMasterVolume(long module);
/**
* Returns the song's current global volume
* <p>
* <b>Remarks</b>
* GLOBAL volume is not the same as MASTER volume. GLOBAL volume is an internal
* overall volume which can be altered by the song itself (ie there might be commands
* to fade in a particular part of the song by scaling all the volumes in the song
* up slowly from nothing).
* GLOBAL volume is different to MASTER volume in that the song can modify without
* your permission, whereas MASTER volume is an overall scalar that you can control.
* For general use, MASTER volume is more useful, but you may want to reset a song's
* GLOBAL volume at certain times in the song. (for example the song might have faded
* out by using GLOBAL volume and you want to reset it)
* </p>
* @param module Module to retrieve song global volume from
* @return Songs current global volume, from 0 (silence) to the maximum value determined by the music format. Global volume
* maximums are different in respect to each format, they range from 64 to 256. On failure, -1 is returned.
*/
public static int FMUSIC_GetGlobalVolume(FMusicModule module) {
return nFMUSIC_GetGlobalVolume(module.moduleHandle);
}
private static native int nFMUSIC_GetGlobalVolume(long module);
/**
* Returns the song's current order number
* @param module Module to retrieve current order number from
* @return On success, the song's current order number is returned.On failure, -1 is returned
*/
public static int FMUSIC_GetOrder(FMusicModule module) {
return nFMUSIC_GetOrder(module.moduleHandle);
}
private static native int nFMUSIC_GetOrder(long module);
/**
* Returns the song's current pattern number
* @param module Module to retrieve current pattern number from
* @return On success, The song's current pattern number is returned. On failure, -1 is returned
*/
public static int FMUSIC_GetPattern(FMusicModule module) {
return nFMUSIC_GetPattern(module.moduleHandle);
}
private static native int nFMUSIC_GetPattern(long module);
/**
* Returns the song's current speed.
* @param module Module to retrieve current song speed from
* @return On success, The song's current speed is returned. On failure, -1 is returned
*/
public static int FMUSIC_GetSpeed(FMusicModule module) {
return nFMUSIC_GetSpeed(module.moduleHandle);
}
private static native int nFMUSIC_GetSpeed(long module);
/**
* Returns the song's current BPM.
* @param module Module to retrieve current song BPM from
* @return On success, song's current BPM is returned. On failure, -1 is returned
*/
public static int FMUSIC_GetBPM(FMusicModule module) {
return nFMUSIC_GetBPM(module.moduleHandle);
}
private static native int nFMUSIC_GetBPM(long module);
/**
* Returns the song's current row number
* <p>
* <b>Remarks</b>
* This value is latency adjusted by default, and returns the number you are hearing, not the 'mix-time' value.
* Use FSOUND_INIT_DONTLATENCYADJUST if you want the value at mix time, which is useful if you want to control the music interactively, or from a DSP callback.
* </p>
* @param module Module to retrieve current row from
* @return On success, the song's current row number is returned. On failure, -1 is returned
*/
public static int FMUSIC_GetRow(FMusicModule module) {
return nFMUSIC_GetRow(module.moduleHandle);
}
private static native int nFMUSIC_GetRow(long module);
/**
* Returns whether song is currently paused or not
* @param module Module to get paused flag from
* @return On success, true is returned to say the song is currently paused. On failure, false is returned to say the song is NOT currently paused
*/
public static boolean FMUSIC_GetPaused(FMusicModule module) {
return nFMUSIC_GetPaused(module.moduleHandle);
}
private static native boolean nFMUSIC_GetPaused(long module);
/**
* Returns the time in milliseconds since the song was started. This is useful for
* synchronizing purposes becuase it will be exactly the same every time, and it is
* reliably retriggered upon starting the song. Trying to synchronize using other
* windows timers can lead to varying results, and inexact performance. This fixes that
* problem by actually using the number of samples sent to the soundcard as a reference
* <p>
* <b>Remarks</b>
* This value is latency adjusted by default, and returns the number you are hearing, not the 'mix-time' value.
* Use FSOUND_INIT_DONTLATENCYADJUST if you want the value at mix time, which is useful if you want to control the music interactively, or from a DSP callback
* </p>
* @param module Module to the song to get time from
* @return On success, the time played in milliseconds is returned. On failure, -1 is returned
*/
public static int FMUSIC_GetTime(FMusicModule module) {
return nFMUSIC_GetTime(module.moduleHandle);
}
private static native int nFMUSIC_GetTime(long module);
/**
* Returns the real FSOUND channel playing based on the mod's FMUSIC channel
* <p>
* <b>Remarks</b>
* Note FMUSIC mod playback only allocates a real channel on a mod channel the first time an instrument is played.
* NNA's will not register. This function only returns the primary real channel for the mod channel.
* </p>
* @param module Module to the song
* @param modchannel channel index, to query the real channel from
* @return On success, the channel index for the respective mod channel is returned. On failure, -1 is returned
*/
public static int FMUSIC_GetRealChannel(FMusicModule module, int modchannel) {
return nFMUSIC_GetRealChannel(module.moduleHandle, modchannel);
}
private static native int nFMUSIC_GetRealChannel(long module, int modchannel);
/**
* Retrieves the data set by FMUSIC_SetUserData
* @param module Module to get the open state from
* @return On success, userdata set by FMUSIC_SetUserData is returned. On failure, Null is returned.
*/
public static ByteBuffer FMUSIC_GetUserData(FMusicModule module) {
return nFMUSIC_GetUserData(module.moduleHandle);
}
private static native ByteBuffer nFMUSIC_GetUserData(long module);
/**
* This is the callback rutine called by the native implementation whenever a
* register callback is notified.
*
* @param handle Handle to native object being monitored
* @param param parameter passed to callback
*/
private static void music_callback(long modulehandle, int param) {
// locate out callback and call it back
FMOD.WrappedCallback wCallback = (FMOD.WrappedCallback) FMOD.getCallback(FMOD.FSOUND_DSPCALLBACK, modulehandle);
FMusicCallback callback = (FMusicCallback) wCallback.callback;
callback.FMUSIC_CALLBACK((FMusicModule) wCallback.handled, param);
}
}

View File

@ -0,0 +1,53 @@
/*
* Copyright (c) 2004 LWJGL Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of 'LWJGL' nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* 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.fmod;
/**
* This class is a representation of a Module in FMod.
* $Id$
* <br>
* @author Brian Matzon <brian@matzon.dk>
* @version $Revision$
*/
public class FMusicModule {
/** Handle to module */
long moduleHandle;
/**
* Creates a new FMusicModule
*
* @param moduleHandle
*/
FMusicModule(long moduleHandle) {
this.moduleHandle = moduleHandle;
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,53 @@
/*
* Copyright (c) 2004 LWJGL Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of 'LWJGL' nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* 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.fmod;
/**
* This class is a representation of a DSPUnit in FMod.
* $Id$
* <br>
* @author Brian Matzon <brian@matzon.dk>
* @version $Revision$
*/
public class FSoundDSPUnit {
/** Handle to dsp unit */
long dspHandle;
/**
* Creates a new FSoundDSPUnit
*
* @param dspHandle handle to dsp unit
*/
FSoundDSPUnit(long dspHandle) {
this.dspHandle = dspHandle;
}
}

View File

@ -0,0 +1,53 @@
/*
* Copyright (c) 2004 LWJGL Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of 'LWJGL' nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* 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.fmod;
/**
* This class is a representation of a Reverb channel property object in FMod.
* $Id$
* <br>
* @author Brian Matzon <brian@matzon.dk>
* @version $Revision$
*/
public class FSoundReverbChannelProperties {
/** Handle to stream */
long reverbHandle;
/**
* Creates a new FSoundStream
*
* @param streamHandle handle to stream
*/
FSoundReverbChannelProperties(long reverbHandle) {
this.reverbHandle = reverbHandle;
}
}

View File

@ -0,0 +1,53 @@
/*
* Copyright (c) 2004 LWJGL Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of 'LWJGL' nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* 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.fmod;
/**
* This class is a representation of a Reverb property object in FMod.
* $Id$
* <br>
* @author Brian Matzon <brian@matzon.dk>
* @version $Revision$
*/
public class FSoundReverbProperties {
/** Handle to stream */
long reverbHandle;
/**
* Creates a new FSoundStream
*
* @param streamHandle handle to stream
*/
FSoundReverbProperties(long reverbHandle) {
this.reverbHandle = reverbHandle;
}
}

View File

@ -0,0 +1,53 @@
/*
* Copyright (c) 2004 LWJGL Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of 'LWJGL' nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* 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.fmod;
/**
* This class is a representation of a Sound Sample in FMod.
* $Id$
* <br>
* @author Brian Matzon <brian@matzon.dk>
* @version $Revision$
*/
public class FSoundSample {
/** Handle to sample */
long sampleHandle;
/**
* Creates a new FSoundSample
*
* @param sampleHandle handle to sample
*/
FSoundSample(long sampleHandle) {
this.sampleHandle = sampleHandle;
}
}

View File

@ -0,0 +1,106 @@
/*
* Copyright (c) 2004 LWJGL Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of 'LWJGL' nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* 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.fmod;
import java.nio.ByteBuffer;
/**
* $Id$
* <br>
* @author Brian Matzon <brian@matzon.dk>
* @version $Revision$
*/
public class FSoundSampleLock {
/** ByteBuffer that will point to the first part of the locked data */
private ByteBuffer ptr1;
/**
* ByteBuffer that will point to the second part of the locked data.
* This will be null if the data locked hasnt wrapped at the end of the buffer
*/
private ByteBuffer ptr2;
/** Length of data in BYTES that was locked for ptr1 */
private int len1;
/**
* Length of data in BYTES that was locked for ptr2.
* This will be 0 if the data locked hasnt wrapped at the end of the buffer
*/
private int len2;
/**
* Creates a new FSoundSampleLock
*/
public FSoundSampleLock() {
}
/**
* Creates a new SampleLock
*
* @param ptr1 ByteBuffer that will point to the first part of the locked data
* @param ptr2 ByteBuffer that will point to the second part of the locked data
* @param len1 Length of data in BYTES that was locked for ptr1
* @param len2 Length of data in BYTES that was locked for ptr2
*/
void set(ByteBuffer ptr1, ByteBuffer ptr2, int len1, int len2) {
this.ptr1 = ptr1;
this.ptr2 = ptr2;
this.len1 = len1;
this.len2 = len2;
}
/**
* @return Returns the len1.
*/
public int getLen1() {
return len1;
}
/**
* @return Returns the len2.
*/
public int getLen2() {
return len2;
}
/**
* @return Returns the ptr1.
*/
public ByteBuffer getPtr1() {
return ptr1;
}
/**
* @return Returns the ptr2.
*/
public ByteBuffer getPtr2() {
return ptr2;
}
}

View File

@ -0,0 +1,53 @@
/*
* Copyright (c) 2004 LWJGL Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of 'LWJGL' nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* 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.fmod;
/**
* This class is a representation of a Sound stream in FMod.
* $Id$
* <br>
* @author Brian Matzon <brian@matzon.dk>
* @version $Revision$
*/
public class FSoundStream {
/** Handle to stream */
long streamHandle;
/**
* Creates a new FSoundStream
*
* @param streamHandle handle to stream
*/
FSoundStream(long streamHandle) {
this.streamHandle = streamHandle;
}
}

View File

@ -0,0 +1,53 @@
/*
* Copyright (c) 2004 LWJGL Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of 'LWJGL' nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* 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.fmod;
/**
* This class is a representation of a SyncPoint in FMod.
* $Id$
* <br>
* @author Brian Matzon <brian@matzon.dk>
* @version $Revision$
*/
public class FSoundSyncPoint {
/** Handle to syncpoint */
long syncpointHandle;
/**
* Creates a new FSoundSyncPoint
*
* @param syncpointHandle handle to syncpoint
*/
FSoundSyncPoint(long syncpointHandle) {
this.syncpointHandle = syncpointHandle;
}
}

View File

@ -0,0 +1,100 @@
/*
* Copyright (c) 2004 LWJGL Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of 'LWJGL' nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* 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.fmod;
import java.nio.ByteBuffer;
/**
* This class defines attributes in a tag field
* $Id$
* <br>
* @author Brian Matzon <brian@matzon.dk>
* @version $Revision$
*/
public class FSoundTagField {
/** Name of tagfield */
String name;
/**
* ByteBuffer that will point to the tagfield data
*/
ByteBuffer value;
/** Length of tagfield data */
int length;
/** Type of tagfield */
int type;
/**
* Creates a new FSoundTagField
*/
public FSoundTagField(int type, String name) {
this.type = type;
this.name = name;
}
/**
* Sets the value and length
* @param value value of tagfield
* @param lenght length of data
*/
void set(ByteBuffer value, int lenght) {
this.value = value;
this.length = lenght;
}
/**
* @return Returns the length.
*/
public int getLength() {
return length;
}
/**
* @return Returns the name.
*/
public String getName() {
return name;
}
/**
* @return Returns the type.
*/
public int getType() {
return type;
}
/**
* @return Returns the value.
*/
public ByteBuffer getValue() {
return value;
}
}

View File

@ -0,0 +1,45 @@
/*
* Copyright (c) 2004 LWJGL Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of 'LWJGL' nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* 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.fmod.callbacks;
import org.lwjgl.fmod.FMusicModule;
/**
* This interface describes a callback interface to Fmod music
* $Id$
* <br>
* @author Brian Matzon <brian@matzon.dk>
* @version $Revision$
*/
public interface FMusicCallback {
public void FMUSIC_CALLBACK(FMusicModule module, int param);
}

View File

@ -0,0 +1,44 @@
/*
* Copyright (c) 2004 LWJGL Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of 'LWJGL' nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* 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.fmod.callbacks;
/**
* This interface describes a callback interface to Fmod music
* $Id$
* <br>
* @author Brian Matzon <brian@matzon.dk>
* @version $Revision$
*/
public interface FSoundCloseCallback {
public void FSOUND_CLOSECALLBACK(int handle);
}

View File

@ -0,0 +1,45 @@
/*
* Copyright (c) 2004 LWJGL Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of 'LWJGL' nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* 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.fmod.callbacks;
import java.nio.ByteBuffer;
/**
* This interface describes a callback interface to Fmod music
* $Id$
* <br>
* @author Brian Matzon <brian@matzon.dk>
* @version $Revision$
*/
public interface FSoundDSPCallback {
public void FSOUND_DSPCALLBACK(ByteBuffer originalbuffer, ByteBuffer newbuffer, int length);
}

View File

@ -0,0 +1,47 @@
/*
* Copyright (c) 2004 LWJGL Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of 'LWJGL' nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* 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.fmod.callbacks;
import java.nio.ByteBuffer;
import org.lwjgl.fmod.FSoundStream;
/**
* This interface describes a callback interface to Fmod music
* $Id$
* <br>
* @author Brian Matzon <brian@matzon.dk>
* @version $Revision$
*/
public interface FSoundMetaDataCallback {
public void FSOUND_STREAMCALLBACK(FSoundStream stream, ByteBuffer buff, int len);
}

View File

@ -0,0 +1,44 @@
/*
* Copyright (c) 2004 LWJGL Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of 'LWJGL' nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* 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.fmod.callbacks;
/**
* This interface describes a callback interface to Fmod music
* $Id$
* <br>
* @author Brian Matzon <brian@matzon.dk>
* @version $Revision$
*/
public interface FSoundOpenCallback {
public int FSOUND_OPENCALLBACK(String name);
}

View File

@ -0,0 +1,45 @@
/*
* Copyright (c) 2004 LWJGL Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of 'LWJGL' nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* 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.fmod.callbacks;
import java.nio.ByteBuffer;
/**
* This interface describes a callback interface to Fmod music
* $Id$
* <br>
* @author Brian Matzon <brian@matzon.dk>
* @version $Revision$
*/
public interface FSoundReadCallback {
public int FSOUND_READCALLBACK(ByteBuffer buffer, int size, int handle);
}

View File

@ -0,0 +1,44 @@
/*
* Copyright (c) 2004 LWJGL Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of 'LWJGL' nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* 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.fmod.callbacks;
/**
* This interface describes a callback interface to Fmod music
* $Id$
* <br>
* @author Brian Matzon <brian@matzon.dk>
* @version $Revision$
*/
public interface FSoundSeekCallback {
public int FSOUND_SEEKCALLBACK(int handle, int pos, int mode);
}

View File

@ -0,0 +1,47 @@
/*
* Copyright (c) 2004 LWJGL Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of 'LWJGL' nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* 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.fmod.callbacks;
import java.nio.ByteBuffer;
import org.lwjgl.fmod.FSoundStream;
/**
* This interface describes a callback interface to Fmod music
* $Id$
* <br>
* @author Brian Matzon <brian@matzon.dk>
* @version $Revision$
*/
public interface FSoundStreamCallback {
public void FSOUND_STREAMCALLBACK(FSoundStream stream, ByteBuffer buff, int len);
}

View File

@ -0,0 +1,44 @@
/*
* Copyright (c) 2004 LWJGL Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of 'LWJGL' nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* 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.fmod.callbacks;
/**
* This interface describes a callback interface to Fmod music
* $Id$
* <br>
* @author Brian Matzon <brian@matzon.dk>
* @version $Revision$
*/
public interface FSoundTellCallback {
public int FSOUND_TELLCALLBACK(int handle);
}

View File

@ -0,0 +1,119 @@
/*
* Copyright (c) 2004 LWJGL Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of 'LWJGL' nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* 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.test.fmod;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
import org.lwjgl.fmod.FMOD;
import org.lwjgl.fmod.FMODException;
import org.lwjgl.fmod.FSound;
import org.lwjgl.fmod.FSoundStream;
/**
* $Id$
* <br>
* @author Brian Matzon <brian@matzon.dk>
* @version $Revision$
*/
public class CDDAPlayer {
public static void main(String[] args) {
try {
FMOD.create();
} catch (FMODException fmode) {
fmode.printStackTrace();
return;
}
System.out.println("Initializing FMOD");
if (!FSound.FSOUND_Init(44100, 32, 0)) {
System.out.println("Failed to initialize FMOD");
return;
}
boolean running = true;
String token = null;
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
FSoundStream stream = null;
do {
System.out.println(FMOD.FMOD_ErrorString(FSound.FSOUND_GetError()));
System.out.println("FMOD CD Player test. Press a key corresponding to action");
System.out.println("1: FSOUND_Stream_Open \"<drive>:\"");
System.out.println("2: FSOUND_Stream_Open \"<drive>:?\"");
System.out.println("3: FSOUND_Stream_Open \"<drive>:!\"");
System.out.println("4: FSOUND_Stream_SetSubStream <position>");
System.out.println("5: FSOUND_Stream_GetNumSubStreams");
System.out.println("6: Enumerate tag fields");
System.out.println("0: Exit");
try {
StringTokenizer st = new StringTokenizer(br.readLine().trim());
token = st.nextToken();
switch (Integer.parseInt(token)) {
case 0:
running = false;
break;
case 1:
stream = FSound.FSOUND_Stream_Open(st.nextToken() + ":", FSound.FSOUND_NORMAL, 0, 0);
break;
case 2:
stream = FSound.FSOUND_Stream_Open(st.nextToken() + ":*?", 0, 0, 0);
break;
case 3:
stream = FSound.FSOUND_Stream_Open(st.nextToken() + ":*!", 0, 0, 0);
break;
case 4:
FSound.FSOUND_Stream_SetSubStream(stream, Integer.parseInt(st.nextToken()));
break;
case 5:
System.out.println(FSound.FSOUND_Stream_GetNumSubStreams(stream));
break;
case 6:
//
break;
default:
System.out.println("No entry");
}
System.out.println("Stream: " + stream);
} catch (Exception e) {
}
} while (running);
if(stream != null) {
FSound.FSOUND_Stream_Close(stream);
}
FSound.FSOUND_Close();
FMOD.destroy();
}
}

View File

@ -0,0 +1,136 @@
/*
* Copyright (c) 2004 LWJGL Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of 'LWJGL' nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* 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.test.fmod;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
import org.lwjgl.fmod.FMOD;
import org.lwjgl.fmod.FMODException;
import org.lwjgl.fmod.FSound;
/**
* $Id$
* <br>
* @author Brian Matzon <brian@matzon.dk>
* @version $Revision$
*/
public class CDPlayer {
public static void main(String[] args) {
try {
FMOD.create();
} catch (FMODException fmode) {
fmode.printStackTrace();
return;
}
System.out.println("Initializing FMOD");
if (!FSound.FSOUND_Init(44100, 32, 0)) {
System.out.println("Failed to initialize FMOD");
return;
}
boolean running = true;
String token = null;
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
do {
System.out.println("FMOD CD Player test. Press a key corresponding to action");
System.out.println("1: FSOUND_CD_Eject <drive>");
System.out.println("2: FSOUND_CD_Play <drive> <track>");
System.out.println("3: FSOUND_CD_Stop <drive>");
System.out.println("4: FSOUND_CD_GetNumTracks <drive>");
System.out.println("5: FSOUND_CD_GetPaused <drive>");
System.out.println("6: FSOUND_CD_GetTrack <drive>");
System.out.println("7: FSOUND_CD_GetTrackLength <drive> <track>");
System.out.println("8: FSOUND_CD_GetTrackTime <drive>");
System.out.println("9: FSOUND_CD_SetPaused <drive>");
System.out.println("10: FSOUND_CD_SetPlayMode <drive> <mode>");
System.out.println("11: FSOUND_CD_SetTrackTime <drive> <milliseconds>");
System.out.println("12: FSOUND_CD_SetVolume <drive> <volume>");
System.out.println("0: Exit");
try {
StringTokenizer st = new StringTokenizer(br.readLine().trim());
token = st.nextToken();
switch (Integer.parseInt(token)) {
case 0:
running = false;
break;
case 1:
FSound.FSOUND_CD_Eject(st.nextToken().charAt(0));
break;
case 2:
FSound.FSOUND_CD_Play(st.nextToken().charAt(0), Integer.parseInt(st.nextToken()));
break;
case 3:
FSound.FSOUND_CD_Stop(st.nextToken().charAt(0));
break;
case 4:
System.out.println(FSound.FSOUND_CD_GetNumTracks(st.nextToken().charAt(0)));
break;
case 5:
System.out.println(FSound.FSOUND_CD_GetPaused(st.nextToken().charAt(0)));
break;
case 6:
System.out.println(FSound.FSOUND_CD_GetTrack(st.nextToken().charAt(0)));
break;
case 7:
System.out.println(FSound.FSOUND_CD_GetTrackLength(st.nextToken().charAt(0), Integer.parseInt(st.nextToken())));
break;
case 8:
System.out.println(FSound.FSOUND_CD_GetTrackTime(st.nextToken().charAt(0)));
break;
case 9:
FSound.FSOUND_CD_SetPaused(st.nextToken().charAt(0), Boolean.valueOf(st.nextToken()).booleanValue());
break;
case 10:
FSound.FSOUND_CD_SetPlayMode(st.nextToken().charAt(0), Integer.parseInt(st.nextToken()));
break;
case 11:
FSound.FSOUND_CD_SetTrackTime(st.nextToken().charAt(0), Integer.parseInt(st.nextToken()));
break;
case 12:
FSound.FSOUND_CD_SetVolume(st.nextToken().charAt(0), Integer.parseInt(st.nextToken()));
break;
default:
System.out.println("No entry");
}
} catch (Exception e) {
}
} while (running);
FSound.FSOUND_Close();
FMOD.destroy();
}
}

View File

@ -0,0 +1,142 @@
/*
* Copyright (c) 2004 LWJGL Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of 'LWJGL' nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* 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.test.fmod;
import java.io.BufferedInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import org.lwjgl.fmod.*;
/**
* $Id$
* <br>
* @author Brian Matzon <brian@matzon.dk>
* @version $Revision$
*/
public class MusicPlayer {
public static void main(String[] args) {
if(args.length < 1) {
System.out.println("Usage:\n MusicPlayer <file>");
return;
}
File file = new File(args[0]);
if (!file.exists()) {
System.out.println("No such file: " + args[0]);
return;
}
try {
FMOD.create();
} catch (FMODException fmode) {
fmode.printStackTrace();
return;
}
System.out.println("Initializing FMOD");
if(!FSound.FSOUND_Init(44100, 32, 0)) {
System.out.println("Failed to initialize FMOD");
return;
}
System.out.println("Loading " + args[0]);
FMusicModule module = FMusic.FMUSIC_LoadSong(args[0]);
//ByteBuffer buffer = ByteBuffer.allocateDirect(11).order(ByteOrder.nativeOrder());
//buffer.put("razorbck.it".getBytes());
//buffer.flip();
//FMusicModule module = FMusic.FMUSIC_LoadSongEx(getData(args[0]), 0, 0, 0, null);
//FMusicModule module = FMusic.FMUSIC_LoadSongEx(buffer, 0, 0, 0, null);
if(module != null) {
System.out.println("Loaded. Playing module of type: " + FMusic.FMUSIC_GetType(module));
FMusic.FMUSIC_PlaySong(module);
System.out.println("Press enter to stop playing");
try {
System.in.read();
} catch (IOException ioe) {
}
FMusic.FMUSIC_StopSong(module);
System.out.println("Done playing. Cleaning up");
FMusic.FMUSIC_FreeSong(module);
} else {
System.out.println("Unable to play: " + args[0]);
}
FSound.FSOUND_Close();
FMOD.destroy();
}
/**
* Reads the file into a ByteBuffer
*
* @param filename Name of file to load
* @return ByteBuffer containing file data
*/
static protected ByteBuffer getData(String filename) {
ByteBuffer buffer = null;
System.out.println("Attempting to load: " + filename);
try {
BufferedInputStream bis = new BufferedInputStream(MusicPlayer.class.getClassLoader().getResourceAsStream(filename));
ByteArrayOutputStream baos = new ByteArrayOutputStream();
int bufferLength = 4096;
byte[] readBuffer = new byte[bufferLength];
int read = -1;
while((read = bis.read(readBuffer, 0, bufferLength)) != -1) {
baos.write(readBuffer, 0, read);
}
//done reading, close
bis.close();
// if ogg vorbis data, we need to pass it unmodified to alBufferData
buffer = ByteBuffer.allocateDirect(baos.size());
buffer.order(ByteOrder.nativeOrder());
buffer.put(baos.toByteArray());
buffer.flip();
System.out.println("loaded " + buffer.remaining() + " bytes");
} catch (Exception ioe) {
ioe.printStackTrace();
}
return buffer;
}
}

View File

@ -0,0 +1,156 @@
/*
* Copyright (c) 2004 LWJGL Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of 'LWJGL' nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* 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.test.fmod;
import java.io.BufferedInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import org.lwjgl.fmod.FMOD;
import org.lwjgl.fmod.FMODException;
import org.lwjgl.fmod.FSound;
import org.lwjgl.fmod.FSoundStream;
/**
* $Id$ <br>
*
* @author Brian Matzon <brian@matzon.dk>
* @version $Revision$
*/
public class StreamPlayer {
public static void main(String[] args) {
if (args.length < 1) {
System.out.println("Usage:\n StreamPlayer <file>");
return;
}
File file = new File(args[0]);
if (!file.exists()) {
System.out.println("No such file: " + args[0]);
return;
}
try {
FMOD.create();
} catch (FMODException fmode) {
fmode.printStackTrace();
return;
}
System.out.println("Initializing FMOD");
if (!FSound.FSOUND_Init(44100, 32, 0)) {
System.out.println("Failed to initialize FMOD");
System.out.println("Error: " + FMOD.FMOD_ErrorString(FSound.FSOUND_GetError()));
return;
}
System.out.println("Loading " + args[0]);
FSoundStream stream = FSound.FSOUND_Stream_Open(args[0], FSound.FSOUND_NORMAL, 0, 0);
if (stream != null) {
FSound.FSOUND_Stream_Play(0, stream);
System.out.println("Press enter to stop playing");
try {
System.in.read();
} catch (IOException ioe) {
}
System.out.println("Done playing. Cleaning up");
FSound.FSOUND_Stream_Stop(stream);
FSound.FSOUND_Stream_Close(stream);
} else {
System.out.println("Unable to play: " + args[0]);
System.out.println("Error: " + FMOD.FMOD_ErrorString(FSound.FSOUND_GetError()));
}
FSound.FSOUND_Close();
FMOD.destroy();
}
/**
* Reads the file into a ByteBuffer
*
* @param filename
* Name of file to load
* @return ByteBuffer containing file data
*/
static protected ByteBuffer getData(String filename) {
ByteBuffer buffer = null;
System.out.println("Attempting to load: " + filename);
try {
BufferedInputStream bis = new BufferedInputStream(StreamPlayer.class.getClassLoader().getResourceAsStream(filename));
ByteArrayOutputStream baos = new ByteArrayOutputStream();
int bufferLength = 4096;
byte[] readBuffer = new byte[bufferLength];
int read = -1;
while ((read = bis.read(readBuffer, 0, bufferLength)) != -1) {
baos.write(readBuffer, 0, read);
}
//done reading, close
bis.close();
// if ogg vorbis data, we need to pass it unmodified to alBufferData
buffer = ByteBuffer.allocateDirect(baos.size());
buffer.order(ByteOrder.nativeOrder());
buffer.put(baos.toByteArray());
buffer.flip();
System.out.println("loaded " + buffer.remaining() + " bytes");
} catch (Exception ioe) {
ioe.printStackTrace();
}
return buffer;
}
/**
* Creates a ByteBuffer buffer to hold specified bytes - strictly a utility
* method
*
* @param size
* how many bytes to contain
* @return created ByteBuffer
*/
protected static ByteBuffer createByteBuffer(int size) {
ByteBuffer temp = ByteBuffer.allocateDirect(4 * size);
temp.order(ByteOrder.nativeOrder());
return temp;
}
}

View File

@ -0,0 +1,67 @@
/*
* Copyright (c) 2002 Light Weight Java Game Library Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of 'Light Weight Java Game Library' nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <stdio.h>
#include "extfmod.h"
/** Instance of fmod */
FMOD_INSTANCE * fmod = NULL;
/** Handle to dll */
HINSTANCE dll_handle;
/**
* DLL entry point for Windows. Called when Java loads the .dll
*/
BOOL WINAPI DllMain( HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) {
dll_handle = hinstDLL;
return true;
}
/**
* Creates and loads the FMOD instance
*
* @param path path to try to load dll
*/
void fmod_create(char* path) {
fmod = FMOD_CreateInstance(path);
}
/**
* Destroys the fmod instance
*/
void fmod_destroy() {
if (fmod != NULL) {
FMOD_FreeInstance(fmod);
}
}

View File

@ -0,0 +1,47 @@
/*
* Copyright (c) 2002 Light Weight Java Game Library Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of 'Light Weight Java Game Library' nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _EXT_FMOD_H
#define _EXT_FMOD_H
#include <jni.h>
#include "../common_tools.h"
#include "fmoddyn.h"
#include "fmod_errors.h"
extern FMOD_INSTANCE * fmod;
void fmod_create(char*);
void fmod_destroy();
#endif

View File

@ -0,0 +1,84 @@
/*
* Copyright (c) 2002-2004 Lightweight Java Game Library Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of 'Lightweight Java Game Library' nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "org_lwjgl_fmod_FMOD.h"
#include "extfmod.h"
static const char* VERSION = "0.9a";
/*
* Class: org_lwjgl_fmod_FMOD
* Method: getNativeLibraryVersion
* Signature: ()Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_org_lwjgl_fmod_FMOD_getNativeLibraryVersion(JNIEnv * env, jclass clazz) {
return env->NewStringUTF(VERSION);
}
/*
* Class: org_lwjgl_fmod_FMOD
* Method: nCreate
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_org_lwjgl_fmod_FMOD_nCreate(JNIEnv *env, jclass clazz, jobjectArray paths) {
jsize pathcount = env->GetArrayLength(paths);
for(int i=0;i<pathcount;i++) {
jstring path = (jstring) env->GetObjectArrayElement(paths, i);
char *path_str = (char *) env->GetStringUTFChars(path, NULL);
printfDebug("Trying to load fmod from %s\n", path_str);
fmod_create(path_str);
env->ReleaseStringUTFChars(path, path_str);
if(fmod != NULL) {
return;
}
}
throwFMODException(env, "Unable to load fmod library");
}
/*
* Class: org_lwjgl_fmod_FMOD
* Method: nDestroy
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_org_lwjgl_fmod_FMOD_nDestroy(JNIEnv *env, jclass clazz) {
fmod_destroy();
}
/*
* Class: org_lwjgl_fmod_FMOD
* Method: FMOD_ErrorString
* Signature: (I)Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_org_lwjgl_fmod_FMOD_FMOD_1ErrorString(JNIEnv *env, jclass clazz, jint errorcode) {
return env->NewStringUTF(FMOD_ErrorString(errorcode));
}

View File

@ -0,0 +1,126 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class org_lwjgl_fmod_FMOD */
#ifndef _Included_org_lwjgl_fmod_FMOD
#define _Included_org_lwjgl_fmod_FMOD
#ifdef __cplusplus
extern "C" {
#endif
/* Inaccessible static: callbacks */
/* Inaccessible static: fmodClearUnit */
/* Inaccessible static: fmodClipAndCopyUnit */
/* Inaccessible static: fmodMusicUnit */
/* Inaccessible static: fmodSFXUnit */
/* Inaccessible static: fmodFFTUnit */
/* Inaccessible static: fmodFFTBuffer */
#undef org_lwjgl_fmod_FMOD_FMUSIC_CALLBACK
#define org_lwjgl_fmod_FMOD_FMUSIC_CALLBACK 0L
#undef org_lwjgl_fmod_FMOD_FSOUND_DSPCALLBACK
#define org_lwjgl_fmod_FMOD_FSOUND_DSPCALLBACK 1L
#undef org_lwjgl_fmod_FMOD_FSOUND_STREAMCALLBACK
#define org_lwjgl_fmod_FMOD_FSOUND_STREAMCALLBACK 2L
#undef org_lwjgl_fmod_FMOD_FSOUND_ALLOCCALLBACK
#define org_lwjgl_fmod_FMOD_FSOUND_ALLOCCALLBACK 3L
#undef org_lwjgl_fmod_FMOD_FSOUND_REALLOCCALLBACK
#define org_lwjgl_fmod_FMOD_FSOUND_REALLOCCALLBACK 4L
#undef org_lwjgl_fmod_FMOD_FSOUND_FREECALLBACK
#define org_lwjgl_fmod_FMOD_FSOUND_FREECALLBACK 5L
#undef org_lwjgl_fmod_FMOD_FSOUND_OPENCALLBACK
#define org_lwjgl_fmod_FMOD_FSOUND_OPENCALLBACK 6L
#undef org_lwjgl_fmod_FMOD_FSOUND_CLOSECALLBACK
#define org_lwjgl_fmod_FMOD_FSOUND_CLOSECALLBACK 7L
#undef org_lwjgl_fmod_FMOD_FSOUND_METADATACALLBACK
#define org_lwjgl_fmod_FMOD_FSOUND_METADATACALLBACK 8L
#undef org_lwjgl_fmod_FMOD_FSOUND_READCALLBACK
#define org_lwjgl_fmod_FMOD_FSOUND_READCALLBACK 9L
#undef org_lwjgl_fmod_FMOD_FSOUND_SEEKCALLBACK
#define org_lwjgl_fmod_FMOD_FSOUND_SEEKCALLBACK 10L
#undef org_lwjgl_fmod_FMOD_FSOUND_TELLCALLBACK
#define org_lwjgl_fmod_FMOD_FSOUND_TELLCALLBACK 11L
#undef org_lwjgl_fmod_FMOD_FSOUND_ENDCALLBACK
#define org_lwjgl_fmod_FMOD_FSOUND_ENDCALLBACK 12L
#undef org_lwjgl_fmod_FMOD_FSOUND_SYNCCALLBACK
#define org_lwjgl_fmod_FMOD_FSOUND_SYNCCALLBACK 13L
/* Inaccessible static: created */
#undef org_lwjgl_fmod_FMOD_FMOD_ERR_NONE
#define org_lwjgl_fmod_FMOD_FMOD_ERR_NONE 0L
#undef org_lwjgl_fmod_FMOD_FMOD_ERR_BUSY
#define org_lwjgl_fmod_FMOD_FMOD_ERR_BUSY 1L
#undef org_lwjgl_fmod_FMOD_FMOD_ERR_UNINITIALIZED
#define org_lwjgl_fmod_FMOD_FMOD_ERR_UNINITIALIZED 2L
#undef org_lwjgl_fmod_FMOD_FMOD_ERR_INIT
#define org_lwjgl_fmod_FMOD_FMOD_ERR_INIT 3L
#undef org_lwjgl_fmod_FMOD_FMOD_ERR_ALLOCATED
#define org_lwjgl_fmod_FMOD_FMOD_ERR_ALLOCATED 4L
#undef org_lwjgl_fmod_FMOD_FMOD_ERR_PLAY
#define org_lwjgl_fmod_FMOD_FMOD_ERR_PLAY 5L
#undef org_lwjgl_fmod_FMOD_FMOD_ERR_OUTPUT_FORMAT
#define org_lwjgl_fmod_FMOD_FMOD_ERR_OUTPUT_FORMAT 6L
#undef org_lwjgl_fmod_FMOD_FMOD_ERR_COOPERATIVELEVEL
#define org_lwjgl_fmod_FMOD_FMOD_ERR_COOPERATIVELEVEL 7L
#undef org_lwjgl_fmod_FMOD_FMOD_ERR_CREATEBUFFER
#define org_lwjgl_fmod_FMOD_FMOD_ERR_CREATEBUFFER 8L
#undef org_lwjgl_fmod_FMOD_FMOD_ERR_FILE_NOTFOUND
#define org_lwjgl_fmod_FMOD_FMOD_ERR_FILE_NOTFOUND 9L
#undef org_lwjgl_fmod_FMOD_FMOD_ERR_FILE_FORMAT
#define org_lwjgl_fmod_FMOD_FMOD_ERR_FILE_FORMAT 10L
#undef org_lwjgl_fmod_FMOD_FMOD_ERR_FILE_BAD
#define org_lwjgl_fmod_FMOD_FMOD_ERR_FILE_BAD 11L
#undef org_lwjgl_fmod_FMOD_FMOD_ERR_MEMORY
#define org_lwjgl_fmod_FMOD_FMOD_ERR_MEMORY 12L
#undef org_lwjgl_fmod_FMOD_FMOD_ERR_VERSION
#define org_lwjgl_fmod_FMOD_FMOD_ERR_VERSION 13L
#undef org_lwjgl_fmod_FMOD_FMOD_ERR_INVALID_PARAM
#define org_lwjgl_fmod_FMOD_FMOD_ERR_INVALID_PARAM 14L
#undef org_lwjgl_fmod_FMOD_FMOD_ERR_NO_EAX
#define org_lwjgl_fmod_FMOD_FMOD_ERR_NO_EAX 15L
#undef org_lwjgl_fmod_FMOD_FMOD_ERR_CHANNEL_ALLOC
#define org_lwjgl_fmod_FMOD_FMOD_ERR_CHANNEL_ALLOC 17L
#undef org_lwjgl_fmod_FMOD_FMOD_ERR_RECORD
#define org_lwjgl_fmod_FMOD_FMOD_ERR_RECORD 18L
#undef org_lwjgl_fmod_FMOD_FMOD_ERR_MEDIAPLAYER
#define org_lwjgl_fmod_FMOD_FMOD_ERR_MEDIAPLAYER 19L
#undef org_lwjgl_fmod_FMOD_FMOD_ERR_CDDEVICE
#define org_lwjgl_fmod_FMOD_FMOD_ERR_CDDEVICE 20L
/* Inaccessible static: initialized */
/* Inaccessible static: JNI_LIBRARY_NAME */
/* Inaccessible static: FMOD_WIN32_LIBRARY_NAME */
/* Inaccessible static: FMOD_LINUX_LIBRARY_NAME */
/* Inaccessible static: FMOD_OSX_LIBRARY_NAME */
/*
* Class: org_lwjgl_fmod_FMOD
* Method: getNativeLibraryVersion
* Signature: ()Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_org_lwjgl_fmod_FMOD_getNativeLibraryVersion
(JNIEnv *, jclass);
/*
* Class: org_lwjgl_fmod_FMOD
* Method: nCreate
* Signature: ([Ljava/lang/String;)V
*/
JNIEXPORT void JNICALL Java_org_lwjgl_fmod_FMOD_nCreate
(JNIEnv *, jclass, jobjectArray);
/*
* Class: org_lwjgl_fmod_FMOD
* Method: nDestroy
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_org_lwjgl_fmod_FMOD_nDestroy
(JNIEnv *, jclass);
/*
* Class: org_lwjgl_fmod_FMOD
* Method: FMOD_ErrorString
* Signature: (I)Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_org_lwjgl_fmod_FMOD_FMOD_1ErrorString
(JNIEnv *, jclass, jint);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,493 @@
/*
* Copyright (c) 2002-2004 Lightweight Java Game Library Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of 'Lightweight Java Game Library' nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "org_lwjgl_fmod_FMusic.h"
#include "extfmod.h"
/*
* Class: org_lwjgl_fmod_FMusic
* Method: nFMUSIC_LoadSong
* Signature: (Ljava/lang/String;)J
*/
JNIEXPORT jlong JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1LoadSong(JNIEnv *env, jclass clazz, jstring name) {
const char* filename = (const char*) (env->GetStringUTFChars(name, 0));
return (jlong) fmod->FMUSIC_LoadSong(filename);
}
/*
* Class: org_lwjgl_fmod_FMusic
* Method: nFMUSIC_LoadSongEx
* Signature: (Ljava/nio/ByteBuffer;IIILjava/nio/IntBuffer;I)J
*/
JNIEXPORT jlong JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1LoadSongEx__Ljava_nio_ByteBuffer_2IIIILjava_nio_IntBuffer_2II
(JNIEnv *env, jclass clazz, jobject data, jint dataOffset, jint offset, jint length, jint mode, jobject sampleList, jint sampleListOffset, jint samplelistnum){
int *sampleData = NULL;
const char *songData = dataOffset + (char *) env->GetDirectBufferAddress(data);
if(sampleList != NULL) {
sampleData = sampleListOffset + (int *) env->GetDirectBufferAddress(sampleList);
}
return (jlong) fmod->FMUSIC_LoadSongEx(songData, offset, length, mode, sampleData, samplelistnum);
}
/*
* Class: org_lwjgl_fmod_FMusic
* Method: nFMUSIC_LoadSongEx
* Signature: (Ljava/nio/ByteBuffer;IIILjava/nio/IntBuffer;I)J
*/
JNIEXPORT jlong JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1LoadSongEx__Ljava_lang_String_2IIILjava_nio_IntBuffer_2II
(JNIEnv *env, jclass clazz, jstring name, jint offset, jint length, jint mode, jobject sampleList, jint sampleListOffset, jint samplelistnum){
int *sampleData = NULL;
const char* filename = (const char*) (env->GetStringUTFChars(name, 0));
if(sampleList != NULL) {
sampleData = sampleListOffset + (int *) env->GetDirectBufferAddress(sampleList);
}
return (jlong) fmod->FMUSIC_LoadSongEx(filename, offset, length, mode, sampleData, samplelistnum);
}
/*
* Class: org_lwjgl_fmod_FMusic
* Method: nFMUSIC_GetOpenState
* Signature: (J)I
*/
JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1GetOpenState
(JNIEnv *env, jclass clazz, jlong module){
return fmod->FMUSIC_GetOpenState((FMUSIC_MODULE *) module);
}
/*
* Class: org_lwjgl_fmod_FMusic
* Method: nFMUSIC_FreeSong
* Signature: (J)Z
*/
JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1FreeSong
(JNIEnv *env, jclass clazz, jlong module){
return fmod->FMUSIC_FreeSong((FMUSIC_MODULE *) module);
}
/*
* Class: org_lwjgl_fmod_FMusic
* Method: nFMUSIC_PlaySong
* Signature: (J)Z
*/
JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1PlaySong
(JNIEnv *env, jclass clazz, jlong module){
return fmod->FMUSIC_PlaySong((FMUSIC_MODULE *) module);
}
/*
* Class: org_lwjgl_fmod_FMusic
* Method: nFMUSIC_StopSong
* Signature: (J)Z
*/
JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1StopSong
(JNIEnv *env, jclass clazz, jlong module){
return fmod->FMUSIC_StopSong((FMUSIC_MODULE *) module);
}
/*
* Class: org_lwjgl_fmod_FMusic
* Method: FMUSIC_StopAllSongs
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_org_lwjgl_fmod_FMusic_FMUSIC_1StopAllSongs
(JNIEnv *env, jclass clazz){
return fmod->FMUSIC_StopAllSongs();
}
/*
* Class: org_lwjgl_fmod_FMusic
* Method: nFMUSIC_SetZxxCallback
* Signature: (JLorg/lwjgl/fmod/FMusicCallback;)Z
*/
JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1SetZxxCallback
(JNIEnv *env, jclass clazz, jlong, jobject){
throwFMODException(env, "missing implementation");
return false;
}
/*
* Class: org_lwjgl_fmod_FMusic
* Method: nFMUSIC_SetRowCallback
* Signature: (JLorg/lwjgl/fmod/FMusicCallback;I)Z
*/
JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1SetRowCallback
(JNIEnv *env, jclass clazz, jlong, jobject, jint){
throwFMODException(env, "missing implementation");
return false;
}
/*
* Class: org_lwjgl_fmod_FMusic
* Method: nFMUSIC_SetOrderCallback
* Signature: (JLorg/lwjgl/fmod/FMusicCallback;I)Z
*/
JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1SetOrderCallback
(JNIEnv *env, jclass clazz, jlong, jobject, jint){
throwFMODException(env, "missing implementation");
return false;
}
/*
* Class: org_lwjgl_fmod_FMusic
* Method: nFMUSIC_SetInstCallback
* Signature: (JLorg/lwjgl/fmod/FMusicCallback;I)Z
*/
JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1SetInstCallback
(JNIEnv *env, jclass clazz, jlong, jobject, jint){
throwFMODException(env, "missing implementation");
return false;
}
/*
* Class: org_lwjgl_fmod_FMusic
* Method: nFMUSIC_SetSample
* Signature: (JIJ)Z
*/
JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1SetSample
(JNIEnv *env, jclass clazz, jlong module, jint sampno, jlong sample){
return fmod->FMUSIC_SetSample((FMUSIC_MODULE *) module, sampno, (FSOUND_SAMPLE *) sample);
}
/*
* Class: org_lwjgl_fmod_FMusic
* Method: nFMUSIC_SetUserData
* Signature: (JLjava/nio/ByteBuffer;I)Z
*/
JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1SetUserData
(JNIEnv *env, jclass clazz, jlong module, jobject data, jint offset){
throwFMODException(env, "missing implementation");
return false;
}
/*
* Class: org_lwjgl_fmod_FMusic
* Method: nFMUSIC_OptimizeChannels
* Signature: (JII)Z
*/
JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1OptimizeChannels
(JNIEnv *env, jclass clazz, jlong module, jint max, jint min){
return fmod->FMUSIC_OptimizeChannels((FMUSIC_MODULE *) module, max, min);
}
/*
* Class: org_lwjgl_fmod_FMusic
* Method: FMUSIC_SetReverb
* Signature: (Z)Z
*/
JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FMusic_FMUSIC_1SetReverb
(JNIEnv *env, jclass clazz, jboolean reverb){
return fmod->FMUSIC_SetReverb(reverb);
}
/*
* Class: org_lwjgl_fmod_FMusic
* Method: nFMUSIC_SetLooping
* Signature: (JZ)Z
*/
JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1SetLooping
(JNIEnv *env, jclass clazz, jlong module, jboolean looping){
return fmod->FMUSIC_SetLooping((FMUSIC_MODULE *) module, looping);
}
/*
* Class: org_lwjgl_fmod_FMusic
* Method: nFMUSIC_SetOrder
* Signature: (JI)Z
*/
JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1SetOrder
(JNIEnv *env, jclass clazz, jlong module, jint order){
return fmod->FMUSIC_SetOrder((FMUSIC_MODULE *) module, order);
}
/*
* Class: org_lwjgl_fmod_FMusic
* Method: nFMUSIC_SetPaused
* Signature: (JZ)Z
*/
JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1SetPaused
(JNIEnv *env, jclass clazz, jlong module, jboolean paused){
return fmod->FMUSIC_SetPaused((FMUSIC_MODULE *) module, paused);
}
/*
* Class: org_lwjgl_fmod_FMusic
* Method: nFMUSIC_SetMasterVolume
* Signature: (JI)Z
*/
JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1SetMasterVolume
(JNIEnv *env, jclass clazz, jlong module, jint volume){
return fmod->FMUSIC_SetMasterVolume((FMUSIC_MODULE *) module, volume);
}
/*
* Class: org_lwjgl_fmod_FMusic
* Method: nFMUSIC_SetMasterSpeed
* Signature: (JF)Z
*/
JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1SetMasterSpeed
(JNIEnv *env, jclass clazz, jlong module, jfloat speed){
return fmod->FMUSIC_SetMasterSpeed((FMUSIC_MODULE *) module, speed);
}
/*
* Class: org_lwjgl_fmod_FMusic
* Method: nFMUSIC_SetPanSeperation
* Signature: (JF)Z
*/
JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1SetPanSeperation
(JNIEnv *env, jclass clazz, jlong module, jfloat pan){
return fmod->FMUSIC_SetPanSeperation((FMUSIC_MODULE *) module, pan);
}
/*
* Class: org_lwjgl_fmod_FMusic
* Method: nFMUSIC_GetName
* Signature: (J)Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1GetName
(JNIEnv *env, jclass clazz, jlong module) {
const char * name = fmod->FMUSIC_GetName((FMUSIC_MODULE *) module);
return env->NewStringUTF(name);
}
/*
* Class: org_lwjgl_fmod_FMusic
* Method: nFMUSIC_GetType
* Signature: (J)I
*/
JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1GetType
(JNIEnv *env, jclass clazz, jlong module){
return fmod->FMUSIC_GetType((FMUSIC_MODULE *) module);
}
/*
* Class: org_lwjgl_fmod_FMusic
* Method: nFMUSIC_GetNumOrders
* Signature: (J)I
*/
JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1GetNumOrders
(JNIEnv *env, jclass clazz, jlong module){
return fmod->FMUSIC_GetNumOrders((FMUSIC_MODULE *) module);
}
/*
* Class: org_lwjgl_fmod_FMusic
* Method: nFMUSIC_GetNumPatterns
* Signature: (J)I
*/
JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1GetNumPatterns
(JNIEnv *env, jclass clazz, jlong module){
return fmod->FMUSIC_GetNumPatterns((FMUSIC_MODULE *) module);
}
/*
* Class: org_lwjgl_fmod_FMusic
* Method: nFMUSIC_GetNumInstruments
* Signature: (J)I
*/
JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1GetNumInstruments
(JNIEnv *env, jclass clazz, jlong module){
return fmod->FMUSIC_GetNumInstruments((FMUSIC_MODULE *) module);
}
/*
* Class: org_lwjgl_fmod_FMusic
* Method: nFMUSIC_GetNumSamples
* Signature: (J)I
*/
JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1GetNumSamples
(JNIEnv *env, jclass clazz, jlong module){
return fmod->FMUSIC_GetNumSamples((FMUSIC_MODULE *) module);
}
/*
* Class: org_lwjgl_fmod_FMusic
* Method: nFMUSIC_GetNumChannels
* Signature: (J)I
*/
JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1GetNumChannels
(JNIEnv *env, jclass clazz, jlong module){
return fmod->FMUSIC_GetNumChannels((FMUSIC_MODULE *) module);
}
/*
* Class: org_lwjgl_fmod_FMusic
* Method: nFMUSIC_GetSample
* Signature: (JI)J
*/
JNIEXPORT jlong JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1GetSample
(JNIEnv *env, jclass clazz, jlong module, jint sampleno){
return (jlong) fmod->FMUSIC_GetSample((FMUSIC_MODULE *) module, sampleno);
}
/*
* Class: org_lwjgl_fmod_FMusic
* Method: nFMUSIC_GetPatternLength
* Signature: (JI)I
*/
JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1GetPatternLength
(JNIEnv *env, jclass clazz, jlong module, jint orderno){
return fmod->FMUSIC_GetPatternLength((FMUSIC_MODULE *) module, orderno);
}
/*
* Class: org_lwjgl_fmod_FMusic
* Method: nFMUSIC_IsFinished
* Signature: (J)Z
*/
JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1IsFinished
(JNIEnv *env, jclass clazz, jlong module){
return fmod->FMUSIC_IsFinished((FMUSIC_MODULE *) module);
}
/*
* Class: org_lwjgl_fmod_FMusic
* Method: nFMUSIC_IsPlaying
* Signature: (J)Z
*/
JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1IsPlaying
(JNIEnv *env, jclass clazz, jlong module){
return fmod->FMUSIC_IsPlaying((FMUSIC_MODULE *) module);
}
/*
* Class: org_lwjgl_fmod_FMusic
* Method: nFMUSIC_GetMasterVolume
* Signature: (J)I
*/
JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1GetMasterVolume
(JNIEnv *env, jclass clazz, jlong module){
return fmod->FMUSIC_GetMasterVolume((FMUSIC_MODULE *) module);
}
/*
* Class: org_lwjgl_fmod_FMusic
* Method: nFMUSIC_GetGlobalVolume
* Signature: (J)I
*/
JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1GetGlobalVolume
(JNIEnv *env, jclass clazz, jlong module){
return fmod->FMUSIC_GetGlobalVolume((FMUSIC_MODULE *) module);
}
/*
* Class: org_lwjgl_fmod_FMusic
* Method: nFMUSIC_GetOrder
* Signature: (J)I
*/
JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1GetOrder
(JNIEnv *env, jclass clazz, jlong module){
return fmod->FMUSIC_GetOrder((FMUSIC_MODULE *) module);
}
/*
* Class: org_lwjgl_fmod_FMusic
* Method: nFMUSIC_GetPattern
* Signature: (J)I
*/
JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1GetPattern
(JNIEnv *env, jclass clazz, jlong module){
return fmod->FMUSIC_GetPattern((FMUSIC_MODULE *) module);
}
/*
* Class: org_lwjgl_fmod_FMusic
* Method: nFMUSIC_GetSpeed
* Signature: (J)I
*/
JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1GetSpeed
(JNIEnv *env, jclass clazz, jlong module){
return fmod->FMUSIC_GetSpeed((FMUSIC_MODULE *) module);
}
/*
* Class: org_lwjgl_fmod_FMusic
* Method: nFMUSIC_GetBPM
* Signature: (J)I
*/
JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1GetBPM
(JNIEnv *env, jclass clazz, jlong module){
return fmod->FMUSIC_GetBPM((FMUSIC_MODULE *) module);
}
/*
* Class: org_lwjgl_fmod_FMusic
* Method: nFMUSIC_GetRow
* Signature: (J)I
*/
JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1GetRow
(JNIEnv *env, jclass clazz, jlong module){
return fmod->FMUSIC_GetRow((FMUSIC_MODULE *) module);
}
/*
* Class: org_lwjgl_fmod_FMusic
* Method: nFMUSIC_GetPaused
* Signature: (J)Z
*/
JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1GetPaused
(JNIEnv *env, jclass clazz, jlong module){
return fmod->FMUSIC_GetPaused((FMUSIC_MODULE *) module);
}
/*
* Class: org_lwjgl_fmod_FMusic
* Method: nFMUSIC_GetTime
* Signature: (J)I
*/
JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1GetTime
(JNIEnv *env, jclass clazz, jlong module){
return fmod->FMUSIC_GetTime((FMUSIC_MODULE *) module);
}
/*
* Class: org_lwjgl_fmod_FMusic
* Method: nFMUSIC_GetRealChannel
* Signature: (JI)I
*/
JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1GetRealChannel
(JNIEnv *env, jclass clazz, jlong module, jint modchannel){
return fmod->FMUSIC_GetRealChannel((FMUSIC_MODULE *) module, modchannel);
}
/*
* Class: org_lwjgl_fmod_FMusic
* Method: nFMUSIC_GetUserData
* Signature: (J)Ljava/nio/ByteBuffer;
*/
JNIEXPORT jobject JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1GetUserData
(JNIEnv *env, jclass clazz, jlong module) {
throwFMODException(env, "missing implementation");
return NULL;
}

View File

@ -0,0 +1,379 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class org_lwjgl_fmod_FMusic */
#ifndef _Included_org_lwjgl_fmod_FMusic
#define _Included_org_lwjgl_fmod_FMusic
#ifdef __cplusplus
extern "C" {
#endif
#undef org_lwjgl_fmod_FMusic_FMUSIC_TYPE_NONE
#define org_lwjgl_fmod_FMusic_FMUSIC_TYPE_NONE 0L
#undef org_lwjgl_fmod_FMusic_FMUSIC_TYPE_MOD
#define org_lwjgl_fmod_FMusic_FMUSIC_TYPE_MOD 1L
#undef org_lwjgl_fmod_FMusic_FMUSIC_TYPE_S3M
#define org_lwjgl_fmod_FMusic_FMUSIC_TYPE_S3M 2L
#undef org_lwjgl_fmod_FMusic_FMUSIC_TYPE_XM
#define org_lwjgl_fmod_FMusic_FMUSIC_TYPE_XM 3L
#undef org_lwjgl_fmod_FMusic_FMUSIC_TYPE_IT
#define org_lwjgl_fmod_FMusic_FMUSIC_TYPE_IT 4L
#undef org_lwjgl_fmod_FMusic_FMUSIC_TYPE_MIDI
#define org_lwjgl_fmod_FMusic_FMUSIC_TYPE_MIDI 5L
#undef org_lwjgl_fmod_FMusic_FMUSIC_TYPE_FSB
#define org_lwjgl_fmod_FMusic_FMUSIC_TYPE_FSB 6L
/*
* Class: org_lwjgl_fmod_FMusic
* Method: nFMUSIC_LoadSong
* Signature: (Ljava/lang/String;)J
*/
JNIEXPORT jlong JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1LoadSong
(JNIEnv *, jclass, jstring);
/*
* Class: org_lwjgl_fmod_FMusic
* Method: nFMUSIC_LoadSongEx
* Signature: (Ljava/nio/ByteBuffer;IIIILjava/nio/IntBuffer;II)J
*/
JNIEXPORT jlong JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1LoadSongEx__Ljava_nio_ByteBuffer_2IIIILjava_nio_IntBuffer_2II
(JNIEnv *, jclass, jobject, jint, jint, jint, jint, jobject, jint, jint);
/*
* Class: org_lwjgl_fmod_FMusic
* Method: nFMUSIC_LoadSongEx
* Signature: (Ljava/lang/String;IIILjava/nio/IntBuffer;II)J
*/
JNIEXPORT jlong JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1LoadSongEx__Ljava_lang_String_2IIILjava_nio_IntBuffer_2II
(JNIEnv *, jclass, jstring, jint, jint, jint, jobject, jint, jint);
/*
* Class: org_lwjgl_fmod_FMusic
* Method: nFMUSIC_GetOpenState
* Signature: (J)I
*/
JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1GetOpenState
(JNIEnv *, jclass, jlong);
/*
* Class: org_lwjgl_fmod_FMusic
* Method: nFMUSIC_FreeSong
* Signature: (J)Z
*/
JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1FreeSong
(JNIEnv *, jclass, jlong);
/*
* Class: org_lwjgl_fmod_FMusic
* Method: nFMUSIC_PlaySong
* Signature: (J)Z
*/
JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1PlaySong
(JNIEnv *, jclass, jlong);
/*
* Class: org_lwjgl_fmod_FMusic
* Method: nFMUSIC_StopSong
* Signature: (J)Z
*/
JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1StopSong
(JNIEnv *, jclass, jlong);
/*
* Class: org_lwjgl_fmod_FMusic
* Method: FMUSIC_StopAllSongs
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_org_lwjgl_fmod_FMusic_FMUSIC_1StopAllSongs
(JNIEnv *, jclass);
/*
* Class: org_lwjgl_fmod_FMusic
* Method: nFMUSIC_SetZxxCallback
* Signature: (JLorg/lwjgl/fmod/callbacks/FMusicCallback;)Z
*/
JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1SetZxxCallback
(JNIEnv *, jclass, jlong, jobject);
/*
* Class: org_lwjgl_fmod_FMusic
* Method: nFMUSIC_SetRowCallback
* Signature: (JLorg/lwjgl/fmod/callbacks/FMusicCallback;I)Z
*/
JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1SetRowCallback
(JNIEnv *, jclass, jlong, jobject, jint);
/*
* Class: org_lwjgl_fmod_FMusic
* Method: nFMUSIC_SetOrderCallback
* Signature: (JLorg/lwjgl/fmod/callbacks/FMusicCallback;I)Z
*/
JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1SetOrderCallback
(JNIEnv *, jclass, jlong, jobject, jint);
/*
* Class: org_lwjgl_fmod_FMusic
* Method: nFMUSIC_SetInstCallback
* Signature: (JLorg/lwjgl/fmod/callbacks/FMusicCallback;I)Z
*/
JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1SetInstCallback
(JNIEnv *, jclass, jlong, jobject, jint);
/*
* Class: org_lwjgl_fmod_FMusic
* Method: nFMUSIC_SetSample
* Signature: (JIJ)Z
*/
JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1SetSample
(JNIEnv *, jclass, jlong, jint, jlong);
/*
* Class: org_lwjgl_fmod_FMusic
* Method: nFMUSIC_SetUserData
* Signature: (JLjava/nio/ByteBuffer;I)Z
*/
JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1SetUserData
(JNIEnv *, jclass, jlong, jobject, jint);
/*
* Class: org_lwjgl_fmod_FMusic
* Method: nFMUSIC_OptimizeChannels
* Signature: (JII)Z
*/
JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1OptimizeChannels
(JNIEnv *, jclass, jlong, jint, jint);
/*
* Class: org_lwjgl_fmod_FMusic
* Method: FMUSIC_SetReverb
* Signature: (Z)Z
*/
JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FMusic_FMUSIC_1SetReverb
(JNIEnv *, jclass, jboolean);
/*
* Class: org_lwjgl_fmod_FMusic
* Method: nFMUSIC_SetLooping
* Signature: (JZ)Z
*/
JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1SetLooping
(JNIEnv *, jclass, jlong, jboolean);
/*
* Class: org_lwjgl_fmod_FMusic
* Method: nFMUSIC_SetOrder
* Signature: (JI)Z
*/
JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1SetOrder
(JNIEnv *, jclass, jlong, jint);
/*
* Class: org_lwjgl_fmod_FMusic
* Method: nFMUSIC_SetPaused
* Signature: (JZ)Z
*/
JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1SetPaused
(JNIEnv *, jclass, jlong, jboolean);
/*
* Class: org_lwjgl_fmod_FMusic
* Method: nFMUSIC_SetMasterVolume
* Signature: (JI)Z
*/
JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1SetMasterVolume
(JNIEnv *, jclass, jlong, jint);
/*
* Class: org_lwjgl_fmod_FMusic
* Method: nFMUSIC_SetMasterSpeed
* Signature: (JF)Z
*/
JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1SetMasterSpeed
(JNIEnv *, jclass, jlong, jfloat);
/*
* Class: org_lwjgl_fmod_FMusic
* Method: nFMUSIC_SetPanSeperation
* Signature: (JF)Z
*/
JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1SetPanSeperation
(JNIEnv *, jclass, jlong, jfloat);
/*
* Class: org_lwjgl_fmod_FMusic
* Method: nFMUSIC_GetName
* Signature: (J)Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1GetName
(JNIEnv *, jclass, jlong);
/*
* Class: org_lwjgl_fmod_FMusic
* Method: nFMUSIC_GetType
* Signature: (J)I
*/
JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1GetType
(JNIEnv *, jclass, jlong);
/*
* Class: org_lwjgl_fmod_FMusic
* Method: nFMUSIC_GetNumOrders
* Signature: (J)I
*/
JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1GetNumOrders
(JNIEnv *, jclass, jlong);
/*
* Class: org_lwjgl_fmod_FMusic
* Method: nFMUSIC_GetNumPatterns
* Signature: (J)I
*/
JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1GetNumPatterns
(JNIEnv *, jclass, jlong);
/*
* Class: org_lwjgl_fmod_FMusic
* Method: nFMUSIC_GetNumInstruments
* Signature: (J)I
*/
JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1GetNumInstruments
(JNIEnv *, jclass, jlong);
/*
* Class: org_lwjgl_fmod_FMusic
* Method: nFMUSIC_GetNumSamples
* Signature: (J)I
*/
JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1GetNumSamples
(JNIEnv *, jclass, jlong);
/*
* Class: org_lwjgl_fmod_FMusic
* Method: nFMUSIC_GetNumChannels
* Signature: (J)I
*/
JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1GetNumChannels
(JNIEnv *, jclass, jlong);
/*
* Class: org_lwjgl_fmod_FMusic
* Method: nFMUSIC_GetSample
* Signature: (JI)J
*/
JNIEXPORT jlong JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1GetSample
(JNIEnv *, jclass, jlong, jint);
/*
* Class: org_lwjgl_fmod_FMusic
* Method: nFMUSIC_GetPatternLength
* Signature: (JI)I
*/
JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1GetPatternLength
(JNIEnv *, jclass, jlong, jint);
/*
* Class: org_lwjgl_fmod_FMusic
* Method: nFMUSIC_IsFinished
* Signature: (J)Z
*/
JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1IsFinished
(JNIEnv *, jclass, jlong);
/*
* Class: org_lwjgl_fmod_FMusic
* Method: nFMUSIC_IsPlaying
* Signature: (J)Z
*/
JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1IsPlaying
(JNIEnv *, jclass, jlong);
/*
* Class: org_lwjgl_fmod_FMusic
* Method: nFMUSIC_GetMasterVolume
* Signature: (J)I
*/
JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1GetMasterVolume
(JNIEnv *, jclass, jlong);
/*
* Class: org_lwjgl_fmod_FMusic
* Method: nFMUSIC_GetGlobalVolume
* Signature: (J)I
*/
JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1GetGlobalVolume
(JNIEnv *, jclass, jlong);
/*
* Class: org_lwjgl_fmod_FMusic
* Method: nFMUSIC_GetOrder
* Signature: (J)I
*/
JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1GetOrder
(JNIEnv *, jclass, jlong);
/*
* Class: org_lwjgl_fmod_FMusic
* Method: nFMUSIC_GetPattern
* Signature: (J)I
*/
JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1GetPattern
(JNIEnv *, jclass, jlong);
/*
* Class: org_lwjgl_fmod_FMusic
* Method: nFMUSIC_GetSpeed
* Signature: (J)I
*/
JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1GetSpeed
(JNIEnv *, jclass, jlong);
/*
* Class: org_lwjgl_fmod_FMusic
* Method: nFMUSIC_GetBPM
* Signature: (J)I
*/
JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1GetBPM
(JNIEnv *, jclass, jlong);
/*
* Class: org_lwjgl_fmod_FMusic
* Method: nFMUSIC_GetRow
* Signature: (J)I
*/
JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1GetRow
(JNIEnv *, jclass, jlong);
/*
* Class: org_lwjgl_fmod_FMusic
* Method: nFMUSIC_GetPaused
* Signature: (J)Z
*/
JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1GetPaused
(JNIEnv *, jclass, jlong);
/*
* Class: org_lwjgl_fmod_FMusic
* Method: nFMUSIC_GetTime
* Signature: (J)I
*/
JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1GetTime
(JNIEnv *, jclass, jlong);
/*
* Class: org_lwjgl_fmod_FMusic
* Method: nFMUSIC_GetRealChannel
* Signature: (JI)I
*/
JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1GetRealChannel
(JNIEnv *, jclass, jlong, jint);
/*
* Class: org_lwjgl_fmod_FMusic
* Method: nFMUSIC_GetUserData
* Signature: (J)Ljava/nio/ByteBuffer;
*/
JNIEXPORT jobject JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1GetUserData
(JNIEnv *, jclass, jlong);
#ifdef __cplusplus
}
#endif
#endif

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff