diff --git a/src/java/org/lwjgl/fmod/FMOD.java b/src/java/org/lwjgl/fmod/FMOD.java new file mode 100644 index 00000000..e56ae795 --- /dev/null +++ b/src/java/org/lwjgl/fmod/FMOD.java @@ -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$ + *
+ * @author Brian Matzon + * @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 + * @author Brian Matzon + * @version $Revision$ + */ +public class FMODException extends LWJGLException { + + /** + * Creates a new FMODException + * + * @param msg Message describing nature of exception + */ + public FMODException(String msg) { + super(msg); + } +} diff --git a/src/java/org/lwjgl/fmod/FMusic.java b/src/java/org/lwjgl/fmod/FMusic.java new file mode 100644 index 00000000..8c3c9925 --- /dev/null +++ b/src/java/org/lwjgl/fmod/FMusic.java @@ -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$ + *
+ * @author Brian Matzon + * @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) + *

+ * + * 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. + * + *

+ * + * @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. + *

+ * Remarks + * 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. + *

+ * Remarks + * 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 + *

+ * Remarks + * 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. + *

+ * Remarks + * 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. + *

+ * Remarks + * 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. + *

+ * @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). + *

+ * Remarks + * 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. + *

+ * @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. + *

+ * Remarks + * Reverb may be enabled through software emulation in the future for MOD based formats. + *

+ * @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 + *

+ * Remarks + * 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. + *

+ * @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. + *

+ * Remarks + * Note : This function is not supported with the MIDI format. + *

+ * @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 + *

+ * Remarks + * 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. + *

+ * @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 + *

+ * Remarks + * 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) + *

+ * @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 + *

+ * Remarks + * 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. + *

+ * @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 + *

+ * Remarks + * 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 + *

+ * @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 + *

+ * Remarks + * 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. + *

+ * @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); + } +} diff --git a/src/java/org/lwjgl/fmod/FMusicModule.java b/src/java/org/lwjgl/fmod/FMusicModule.java new file mode 100644 index 00000000..643279a2 --- /dev/null +++ b/src/java/org/lwjgl/fmod/FMusicModule.java @@ -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$ + *
+ * @author Brian Matzon + * @version $Revision$ + */ +public class FMusicModule { + /** Handle to module */ + long moduleHandle; + + /** + * Creates a new FMusicModule + * + * @param moduleHandle + */ + FMusicModule(long moduleHandle) { + this.moduleHandle = moduleHandle; + } +} diff --git a/src/java/org/lwjgl/fmod/FSound.java b/src/java/org/lwjgl/fmod/FSound.java new file mode 100644 index 00000000..a54a30bb --- /dev/null +++ b/src/java/org/lwjgl/fmod/FSound.java @@ -0,0 +1,3601 @@ +/* + * 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.FloatBuffer; +import java.nio.IntBuffer; + +import org.lwjgl.fmod.callbacks.FSoundCloseCallback; +import org.lwjgl.fmod.callbacks.FSoundDSPCallback; +import org.lwjgl.fmod.callbacks.FSoundMetaDataCallback; +import org.lwjgl.fmod.callbacks.FSoundOpenCallback; +import org.lwjgl.fmod.callbacks.FSoundReadCallback; +import org.lwjgl.fmod.callbacks.FSoundSeekCallback; +import org.lwjgl.fmod.callbacks.FSoundStreamCallback; +import org.lwjgl.fmod.callbacks.FSoundTellCallback; + +/** + * $Id$ + *
+ * @author Brian Matzon + * @version $Revision$ + */ +public class FSound { + + /** CE/PS2/GC Only - Non interpolating/low quality mixer. */ + public static final int FSOUND_MIXER_AUTODETECT = 0; + + /** Removed / obsolete. */ + public static final int FSOUND_MIXER_BLENDMODE = 1; + + /** Removed / obsolete. */ + public static final int FSOUND_MIXER_MMXP5 = 2; + + /** Removed / obsolete. */ + public static final int FSOUND_MIXER_MMXP6 = 3; + + /** All platforms - Autodetect the fastest quality mixer based on your cpu. */ + public static final int FSOUND_MIXER_QUALITY_AUTODETECT = 4; + + /** Win32/Linux only - Interpolating/volume ramping FPU mixer. */ + public static final int FSOUND_MIXER_QUALITY_FPU = 5; + + /** Win32/Linux only - Interpolating/volume ramping P5 MMX mixer. */ + public static final int FSOUND_MIXER_QUALITY_MMXP5 = 6; + + /** Win32/Linux only - Interpolating/volume ramping ppro+ MMX mixer. */ + public static final int FSOUND_MIXER_QUALITY_MMXP6 = 7; + + /** CE/PS2/GC only - MONO non interpolating/low quality mixer. For speed */ + public static final int FSOUND_MIXER_MONO = 8; + + /** CE/PS2/GC only - MONO Interpolating mixer. For speed */ + public static final int FSOUND_MIXER_QUALITY_MONO = 9; + + public static final int FSOUND_MIXER_MAX = 10; + + /** NoSound driver, all calls to this succeed but do nothing. */ + public static final int FSOUND_OUTPUT_NOSOUND = 0; + + /** Windows Multimedia driver. */ + public static final int FSOUND_OUTPUT_WINMM = 1; + + /** DirectSound driver. You need this to get EAX or EAX2 support, or FX api support. */ + public static final int FSOUND_OUTPUT_DSOUND = 2; + + /** A3D driver. not supported any more. */ + public static final int FSOUND_OUTPUT_A3D = 3; + + /** Linux/Unix OSS (Open Sound System) driver, i.e. the kernel sound drivers. */ + public static final int FSOUND_OUTPUT_OSS = 4; + + /** Linux/Unix ESD (Enlightment Sound Daemon) driver.*/ + public static final int FSOUND_OUTPUT_ESD = 5; + + /** Linux Alsa driver. */ + public static final int FSOUND_OUTPUT_ALSA = 6; + + /** Low latency ASIO driver */ + public static final int FSOUND_OUTPUT_ASIO = 7; + + /** Xbox driver */ + public static final int FSOUND_OUTPUT_XBOX = 8; + + /** PlayStation 2 driver */ + public static final int FSOUND_OUTPUT_PS2 = 9; + + /** Mac SoundMager driver */ + public static final int FSOUND_OUTPUT_MAC = 10; + + /** Gamecube driver */ + public static final int FSOUND_OUTPUT_GC = 11; + + /** This is the same As nosound, but the sound generation is driven by FSOUND_Update */ + public static final int FSOUND_OUTPUT_NOSOUND_NONREALTIME = 12; + + /** DSP CLEAR unit - done first */ + public static final int FSOUND_DSP_DEFAULTPRIORITY_CLEARUNIT = 0; + + /** DSP SFX unit - done second */ + public static final int FSOUND_DSP_DEFAULTPRIORITY_SFXUNIT = 100; + + /** DSP MUSIC unit - done third */ + public static final int FSOUND_DSP_DEFAULTPRIORITY_MUSICUNIT = 200; + + /** User priority, use this as reference */ + public static final int FSOUND_DSP_DEFAULTPRIORITY_USER = 300; + + /** This reads data for FSOUND_DSP_GetSpectrum, so it comes after user units */ + public static final int FSOUND_DSP_DEFAULTPRIORITY_FFTUNIT = 900; + + /** DSP CLIP AND COPY unit - last */ + public static final int FSOUND_DSP_DEFAULTPRIORITY_CLIPANDCOPYUNIT = 1000; + + /** This driver supports hardware accelerated 3d sound. */ + public static final int FSOUND_CAPS_HARDWARE = 0x1; + + /** This driver supports EAX2 reverb */ + public static final int FSOUND_CAPS_EAX2 = 0x2; + + /** This driver supports EAX3 reverb */ + public static final int FSOUND_CAPS_EAX3 = 0x10; + + /** For non looping samples. */ + public static final int FSOUND_LOOP_OFF = 0x00000001; + + /** For forward looping samples. */ + public static final int FSOUND_LOOP_NORMAL = 0x00000002; + + /** For bidirectional looping samples. (no effect if in hardware). */ + public static final int FSOUND_LOOP_BIDI = 0x00000004; + + /** For 8 bit samples. */ + public static final int FSOUND_8BITS = 0x00000008; + + /** For 16 bit samples. */ + public static final int FSOUND_16BITS = 0x00000010; + + /** For mono samples. */ + public static final int FSOUND_MONO = 0x00000020; + + /** For stereo samples. */ + public static final int FSOUND_STEREO = 0x00000040; + + /** For user created source data containing unsigned samples. */ + public static final int FSOUND_UNSIGNED = 0x00000080; + + /** For user created source data containing signed data. */ + public static final int FSOUND_SIGNED = 0x00000100; + + /** For user created source data stored as delta values. */ + public static final int FSOUND_DELTA = 0x00000200; + + /** For user created source data stored using IT214 compression. */ + public static final int FSOUND_IT214 = 0x00000400; + + /** For user created source data stored using IT215 compression. */ + public static final int FSOUND_IT215 = 0x00000800; + + /** Attempts to make samples use 3d hardware acceleration. (if the card supports it) */ + public static final int FSOUND_HW3D = 0x00001000; + + /** Tells software (not hardware) based sample not to be included in 3d processing. */ + public static final int FSOUND_2D = 0x00002000; + + /** For a streamimg sound where you feed the data to it. */ + public static final int FSOUND_STREAMABLE = 0x00004000; + + /** "name" will be interpreted as a pointer to data for streaming and samples. */ + public static final int FSOUND_LOADMEMORY = 0x00008000; + + /** Will ignore file format and treat as raw pcm. */ + public static final int FSOUND_LOADRAW = 0x00010000; + + /** For FSOUND_Stream_Open - for accurate FSOUND_Stream_GetLengthMs/FSOUND_Stream_SetTime. WARNING, see FSOUND_Stream_Open for inital opening time performance issues. */ + public static final int FSOUND_MPEGACCURATE = 0x00020000; + + /** For forcing stereo streams and samples to be mono - needed if using FSOUND_HW3D and stereo data - incurs a small speed hit for streams */ + public static final int FSOUND_FORCEMONO = 0x00040000; + + /** 2D hardware sounds. allows hardware specific effects */ + public static final int FSOUND_HW2D = 0x00080000; + + /** Allows DX8 FX to be played back on a sound. Requires DirectX 8 - Note these sounds cannot be played more than once, be 8 bit, be less than a certain size, or have a changing frequency */ + public static final int FSOUND_ENABLEFX = 0x00100000; + + /** For FMODCE only - decodes mpeg streams using a lower quality decode, but faster execution */ + public static final int FSOUND_MPEGHALFRATE = 0x00200000; + + /** Contents are stored compressed as IMA ADPCM */ + public static final int FSOUND_IMAADPCM = 0x00400000; + + /** For PS2 only - Contents are compressed as Sony VAG format */ + public static final int FSOUND_VAG = 0x00800000; + + /** For FSOUND_Stream_Open/FMUSIC_LoadSong - Causes stream or music to open in the background and not block the foreground app. See FSOUND_Stream_GetOpenState or FMUSIC_GetOpenState to determine when it IS ready. */ + public static final int FSOUND_NONBLOCKING = 0x01000000; + + /** For Gamecube only - Contents are compressed as Gamecube DSP-ADPCM format */ + public static final int FSOUND_GCADPCM = 0x02000000; + + /** For PS2 and Gamecube only - Contents are interleaved into a multi-channel (more than stereo) format */ + public static final int FSOUND_MULTICHANNEL = 0x04000000; + + /** For PS2 only - Sample/Stream is forced to use hardware voices 00-23 */ + public static final int FSOUND_USECORE0 = 0x08000000; + + /** For PS2 only - Sample/Stream is forced to use hardware voices 24-47 */ + public static final int FSOUND_USECORE1 = 0x10000000; + + /** For PS2 only - "name" will be interpreted as a pointer to data for streaming and samples. The address provided will be an IOP address */ + public static final int FSOUND_LOADMEMORYIOP = 0x20000000; + + /** Skips id3v2 etc tag checks when opening a stream, to reduce seek/read overhead when opening files (helps with CD performance) */ + public static final int FSOUND_IGNORETAGS = 0x40000000; + + /** Specifies an internet stream */ + public static final int FSOUND_STREAM_NET = 0x80000000; + + public static final int FSOUND_NORMAL = (FSOUND_16BITS | FSOUND_SIGNED | FSOUND_MONO); + + /* Starts from the current track and plays to end of CD. */ + public static final int FSOUND_CD_PLAYCONTINUOUS = 0; + + /* Plays the specified track then stops. */ + public static final int FSOUND_CD_PLAYONCE = 1; + + /* Plays the specified track looped, forever until stopped manually. */ + public static final int FSOUND_CD_PLAYLOOPED = 2; + + /* Plays tracks in random order */ + public static final int FSOUND_CD_PLAYRANDOM = 3; + + /* value to play on any free channel, or to allocate a sample in a free sample slot. */ + public static final int FSOUND_FREE = -1; + + /* value to allocate a sample that is NOT managed by FSOUND or placed in a sample slot. */ + public static final int FSOUND_UNMANAGED = -2; + + /* for a channel index , this flag will affect ALL channels available! Not supported by every function. */ + public static final int FSOUND_ALL = -3; + + /* value for FSOUND_SetPan so that stereo sounds are not played at half volume. See FSOUND_SetPan for more on this. */ + public static final int FSOUND_STEREOPAN = -1; + + /* special 'channel' ID for all channel based functions that want to alter the global FSOUND software mixing output channel */ + public static final int FSOUND_SYSTEMCHANNEL = -1000; + + /* special 'sample' ID for all sample based functions that want to alter the global FSOUND software mixing output sample */ + public static final int FSOUND_SYSTEMSAMPLE = -1000; + + /* 'EnvSize' affects reverberation decay time */ + public static final int FSOUND_REVERB_FLAGS_DECAYTIMESCALE = 0x00000001; + + /* 'EnvSize' affects reflection level */ + public static final int FSOUND_REVERB_FLAGS_REFLECTIONSSCALE = 0x00000002; + + /* 'EnvSize' affects initial reflection delay time */ + public static final int FSOUND_REVERB_FLAGS_REFLECTIONSDELAYSCALE = 0x00000004; + + /* 'EnvSize' affects reflections level */ + public static final int FSOUND_REVERB_FLAGS_REVERBSCALE = 0x00000008; + + /* 'EnvSize' affects late reverberation delay time */ + public static final int FSOUND_REVERB_FLAGS_REVERBDELAYSCALE = 0x00000010; + + /* AirAbsorptionHF affects DecayHFRatio */ + public static final int FSOUND_REVERB_FLAGS_DECAYHFLIMIT = 0x00000020; + + /* 'EnvSize' affects echo time */ + public static final int FSOUND_REVERB_FLAGS_ECHOTIMESCALE = 0x00000040; + + /* 'EnvSize' affects modulation time */ + public static final int FSOUND_REVERB_FLAGS_MODULATIONTIMESCALE = 0x00000080; + + /* PS2 Only - Reverb is applied to CORE0 (hw voices 0-23) */ + public static final int FSOUND_REVERB_FLAGS_CORE0 = 0x00000100; + + /* PS2 Only - Reverb is applied to CORE1 (hw voices 24-47) */ + public static final int FSOUND_REVERB_FLAGS_CORE1 = 0x00000200; + + public static final int FSOUND_REVERB_FLAGS_DEFAULT = (FSOUND_REVERB_FLAGS_DECAYTIMESCALE + | FSOUND_REVERB_FLAGS_REFLECTIONSSCALE + | FSOUND_REVERB_FLAGS_REFLECTIONSDELAYSCALE + | FSOUND_REVERB_FLAGS_REVERBSCALE + | FSOUND_REVERB_FLAGS_REVERBDELAYSCALE + | FSOUND_REVERB_FLAGS_DECAYHFLIMIT + | FSOUND_REVERB_FLAGS_CORE0 | FSOUND_REVERB_FLAGS_CORE1); + + // Pre Initialization / Initialization / Enumeration + // ====================================================== + /** + * Shuts down the WHOLE FMOD Sound System + *

+ * Remarks + * This also closes down the sample management system, freeing all MANAGED samples loaded (unless they were allocated with the FSOUND_UNMANAGED flag). + * Streams are not freed. You must close them yourself. + * CD Tracks are stopped. + *

+ */ + public static native void FSOUND_Close(); + + /** + * Specify user callbacks for FMOD's internal file manipulation functions. + * If ANY of these parameters are NULL, then FMOD will switch back to its own file routines. + * You can replace this with memory routines (ie name can be cast to a memory address for example, then open sets up + * a handle based on this information), or alternate file routines, ie a WAD file reader. + *

+ * Remarks + * Memory loader FMOD functions are not affected, such as FMUSIC_LoadSongMemory etc. + * WARNING : This function is dangerous in the wrong hands. You must return the right values, and each command must work properly, or FMOD will not function, or it may even crash if you give it invalid data. + * You must support SEEK_SET, SEEK_CUR and SEEK_END properly, or FMOD will not work properly. See standard I/O help files on how these work under fseek(). + * Read the documentation in REMARKS and do exactly what it says. See the "simple" example for how it is used properly. + * The MIDI loader does not support user file callbacks. For WAD type data structures with embedded MIDI files FMUSIC_LoadSongMemory will have to be used. + * -------------- + * PlayStation 2 NOTE! This function takes IOP function pointers, not EE pointers! It is for custom IOP file systems not EE based ones. + * This function can only be called after FSOUND_Init on PlayStation 2, not before + *

+ * @param callback + */ + public static void FSOUND_File_SetCallbacks( + FSoundOpenCallback open, FSoundCloseCallback close, FSoundReadCallback read, + FSoundSeekCallback seek, FSoundTellCallback tell) { + FMOD.registerCallback(FMOD.FSOUND_OPENCALLBACK, -1, null, open); + FMOD.registerCallback(FMOD.FSOUND_CLOSECALLBACK, -1, null, open); + FMOD.registerCallback(FMOD.FSOUND_READCALLBACK, -1, null, open); + FMOD.registerCallback(FMOD.FSOUND_SEEKCALLBACK, -1, null, open); + FMOD.registerCallback(FMOD.FSOUND_TELLCALLBACK, -1, null, open); + + nFSOUND_File_SetCallbacks(); + } + private static native void nFSOUND_File_SetCallbacks(); + + /** + * Initializes the FMOD Sound System. + *

+ * Remarks + * You do not have control over how many hardware channels are available to you. In a lot of + * cases it may be 0 (the sound card does not have the ability to supply hardware channels). + * This is why it is usually a good idea to supply FSOUND_Init with a good number of software + * channels to fall back onto, for example 32. + * Hardware channels are 3D hardware channels only. There is no benefit in supporting hardware + * for 2d playback of sound effects. With todays machines and FMOD's superior mixing routines, + * FMOD's software engine can sometimes be faster than the driver's hardware support! + * + * @param mixrate Output rate in hz between 4000 and 65535. Any thing outside this will cause + * the function to fail and return false. + * PS2 Note. Only rates of 24000 and 48000 are supported. + * SmartPhone Note. Use 22050 or the operating system may crash outside of the control of fmod. + * @param channels Maximum number of SOFTWARE channels available. + * The number of HARDWARE channels is autodetected. The total number of channels available (hardware and software) after initialization can be found with FSOUND_GetMaxChannels. + * Having a large number of maxchannels does not adversely affect cpu usage, but it means it has the POTENTIAL to mix a large number of channels, which can have an adverse effect on cpu usage. + * 1024 is the highest number that can be set. Anything higher will return an error. + * @param flags See FSOUND_INIT_FLAGS. Controls some global or initialization time aspects of playback + * @return On success, true is returned. On failure, false is returned + */ + public static native boolean FSOUND_Init(int mixrate, int channels, int flags); + + /** + * Sets the FMOD internal mixing buffer size. + * It is configurable because low buffersizes use less memory, but are more instable. + * More importantly, increasing buffer size will increase sound output stability, but + * on the other hand increases latency, and to some extent, CPU usage. + * FMOD chooses the most optimal size by default for best stability, depending on the + * output type - and if the drivers are emulated or not (NT). + * It is not recommended changing this value unless you really need to. You may get worse + * performance than the default settings chosen by FMOD. + *

+ * Remarks + * This function cannot be called after FMOD is already activated with FSOUND_Init. + * It must be called before FSOUND_Init, or after FSOUND_Close. + * --------- + * The buffersize seting defaults to 50ms if it is not called for DSOUND. + * It defaults to 200ms for Windows Multimedia wave-out or for emulated DirectSound drivers (such as NT drivers). + * When the output is FSOUND_OUTPUT_ASIO the buffersize is ignored. The buffersize should be configured using the ASIO driver which can be done with the supplied asioconfig.exe in the FMOD SDK. + * --------- + * Buffer sizes lower than 50 are clamped at 50. + * Buffer sizes are also rounded DOWN to the nearest multiple of 25. This is because FMOD mixes in blocks of 25ms. + * Due to this buffersize command latency on software channels will be between 25 and 50ms on average (37.5ms) when the buffersize is set to 50. + * --------- + * Macintosh, PlayStation 2 and GameCube do not support this as they already achieve minimal latency and are forced to 25ms. + * + * @param len_ms buffer size in milliseconds. + * @return On success, true is returned. On failure, (ie if FMOD is already active) false is returned + */ + public static native boolean FSOUND_SetBufferSize(int len_ms); + + /** + * Selects a soundcard driver. + * It is used when an output mode has enumerated more than one output device, and you need to select between them. + *

+ * Remarks + * This function cannot be called after FMOD is already activated with FSOUND_Init. + * It must be called before FSOUND_Init, or after FSOUND_Close. + *

+ * @param driver Driver number to select. 0 will select the DEFAULT sound driver. + * >0 will select an INVALID driver which will case the DEVICE to be set + * to a null (nosound) driver. + * <0 Selects other valid drivers that can be listed with FSOUND_GetDriverName. + * @return On success, TRUE is returned. On failure, (ie if FMOD is already active) FALSE is returned. + */ + public static native boolean FSOUND_SetDriver(int driver); + + /** + * This is an optional function to set the window handle of the application + * you are writing, so Directsound can tell if it is in focus or not. + *

+ * Remarks + * This function cannot be called after FMOD is already activated with FSOUND_Init. + * It must be called before FSOUND_Init, or after FSOUND_Close. + * --------- + * FMOD uses GetForegroundWindow if this function is not called. + * @return On success, TRUE is returned. On failure, FALSE is returned. + */ + public static native boolean FSOUND_SetHWND(); + + /** + * This sets the maximum allocatable channels on a hardware card. FMOD automatically + * detects and allocates the maximum number of 3d hardware channels, so calling this + * will limit that number if it becomes too much + *

+ * Remarks + * This function cannot be called after FMOD is already activated with FSOUND_Init. + * It must be called before FSOUND_Init, or after FSOUND_Close. + * --------- + * This function has nothing to do with FSOUND_SetMinHardwareChannels, in that this is not a function that forces FMOD into software mixing if a card has a certain number of channels. + * This function only sets a limit on hardware channels, so if you card has 96 hardware channels, and you set FSOUND_SetMaxHardwareChannels(10), then you will only have 10 hardware channels to use. + * @param max maximum number of hardware channels to allocate, even if the soundcard supports more + * @return On success, TRUE is returned. On failure, FALSE is returned + */ + public static native boolean FSOUND_SetMaxHardwareChannels(int max); + + //public static native boolean FSOUND_FSOUND_SetMemorySystem(FSoundCallback callback); + + /** + * This sets the minimum allowable hardware channels before FMOD drops back to 100 percent software. + * This is helpful for minimum spec cards, and not having to guess how many hardware channels + * they might have. This way you can guarantee and assume a certain number of channels for + * your application and place them all in FSOUND_HW3D without fear of the playsound failing + * because it runs out of channels on a low spec card. + *

+ * Remarks + * As an example, if you set your minimum to 16, you can now safely guarantee that 16 sounds can be played at once that are created with FSOUND_HW3D. + * This way if you do come across a card that only supports 4 channels, it will just drop back to playing ALL sounds in software mode. + * It may sound worse, but at least it doesnt fail on the playsound. (which could sound even worse!) + * --------- + * @param min minimum number of hardware channels allowable on a card before it uses the software engine 1004562604f the time + * @return On success, TRUE is returned. On failure, FALSE is returned + */ + public static native boolean FSOUND_SetMinHardwareChannels(int min); + + /** + * Sets a digital mixer type. + *

+ * Remarks + * This function cannot be called after FMOD is already activated with FSOUND_Init. + * It must be called before FSOUND_Init, or after FSOUND_Close. + * This function does not nescessarily need to be called, autodetection will select the + * fastest mixer for your machine. It is here if you need to test all mixer types for + * debugging purposes, or a mixer has a feature that the autodetected one doesnt. + * (ie low quality mixers or volume ramping) + * @param mixer mixer type, see FSOUND_MIXERTYPES for valid parameters and descriptions + * @return On success, TRUE is returned. On failure, (ie if FMOD is already active) FALSE is returned + */ + public static native boolean FSOUND_SetMixer(int mixer); + + /** + * Sets up the soundsystem output mode + *

+ * Remarks + * This function cannot be called after FMOD is already activated with FSOUND_Init. + * It must be called before FSOUND_Init, or after FSOUND_Close. + * ------- + * Under Windows NT - Waveout is FASTER than DirectSound, achieves LOWER latency, AND + * is LESS buggy. DirectSound under NT is achieved by emulating waveout, and therefore is + * inferior to waveout. Use WAVEOUT under NT. + * Under Windows 9x and W2K - DirectSound is faster than waveout and can achieve lower latency. + * Use DIRECTSOUND under Win9x and W2K. + * ------- + * If you dont call FSOUND_SetOutput, FMOD will now autodetect DSOUND or WINMM based on the operating system. + *

+ * @param output The output system to be used. See FSOUND_OUTPUTTYPES for valid parameters and descriptions. -1 Is autodetect based on operating system + * @return On success, TRUE is returned. On failure, (ie if FMOD is already active) FALSE is returned + */ + public static native boolean FSOUND_SetOutput(int output); + + // ------------------------------------------------------------ + + // Global runtime update fucntions + // ============================================================ + + /** + * Sets the master pan seperation for 2d sound effects + * @param pansep The pan scalar. 1.0 means full pan seperation, 0 means mono + */ + public static native void FSOUND_SetPanSeperation(float pansep); + + /** + * Sets the master volume for any sound effects played. Does not affect music or CD output. + * @param volume The volume to set. Valid ranges are from 0 (silent) to 255 (full volume) + */ + public static native void FSOUND_SetSFXMasterVolume(int volume); + + /** + * Sets the mode for the users speaker setup + *

+ * Remarks + * Note - Only reliably works with FSOUND_OUTPUT_DSOUND or FSOUND_OUTPUT_XBOX output modes. Other output modes will only interpret FSOUND_SPEAKERMODE_MONO and set everything else to be stereo. + * ---------------------------------- + * To get true 5.1 dolby digital or DTS output you will need a soundcard that can encode it, and a receiver that can decode it. + * If not the results can be unpredictable. + * ---------------------------------- + * Calling this will reset the pan separation setting. It sets it to 0 if FSOUND_SPEAKERMODE_MONO is chosen, and 1 otherwise. + * You will need to reset the pan separation if required afterwards. + * Note that some soundcard drivers may ignore this call. + * ---------------------------------- + * XBOX only - This function MUST be called before FSOUND_Init to change the default speaker mode. To change on the fly, you must close down FMOD with FSOUND_Close then re-initialize it with FSOUND_Init. + * If it is called after FSOUND_Init, only headphone speakermode is interpreted to switch headphone mode on and off. + * ---------------------------------- + * PlayStation 2 only - This function must be called before playing sounds. Calling this after playing a sound will not make that existing sound work in Prologic 2. + * + * @param speakermode enum describing the users speaker setup + */ + public static native void FSOUND_SetSpeakerMode(int speakermode); + + /** + * This updates the 3d sound engine and DMA engine (only on some platforms), and should be called once a game frame. + * This function will also update the software mixer if you have selected FSOUND_OUTPUT_NOSOUND_NONREALTIME as your output mode + */ + public static native void FSOUND_Update(); + + // ------------------------------------------------------------- + + // Global runtime informaton functions + // ============================================================= + /** + * Returns in percent of cpu time the amount of cpu usage that FSOUND/FMUSIC mixing is taking + *

+ * Remarks + * This value represents the cpu usage used by streams, the software mixer, and subsequent calls to dsound waveout etc. + * MIDI playback is not counted as it is performed by directx. + *

+ * + * @return percent of cpu time the amount of cpu usage that FSOUND/FMUSIC mixing is taking + */ + public static native float FSOUND_GetCPUUsage(); + + /** + * Returns the number of active channels in FSOUND, or ones that are playing + * @return number of active channels in FSOUND, or ones that are playing + */ + public static native int FSOUND_GetChannelsPlaying(); + + /** + * Returns the currently selected driver number. Drivers are enumerated when selecting a driver + * with FSOUND_SetDriver or other driver related functions such as FSOUND_GetNumDrivers or + * FSOUND_GetDriverName + * @return currently selected driver number. + */ + public static native int FSOUND_GetDriver(); + + /** + * Returns information on capabilities of the current output mode + * + * @param driverid Enumerated driver ID. This must be in a valid range delimited by FSOUND_GetNumDrivers + * @param caps IntBuffer to have the caps bits stored + * @return On success, TRUE is returned. On failure, FALSE is returned + */ + public static native boolean FSOUND_GetDriverCaps(int driverid, IntBuffer caps); + + /** + * Returns the name of the selected driver. Drivers are enumerated when selecting a driver with + * FSOUND_SetDriver or other driver related functions such as FSOUND_GetNumDrivers or + * FSOUND_GetDriver + *

+ * Remarks + * If no driver is selected, the default driver is used. + *

+ * + * @param driverid Enumerated driver ID. This must be in a valid range delimited by FSOUND_GetNumDrivers + * @return On success, a String containing the name of the specified device is returned. + * The number of drivers enumerated can be found with FSOUND_GetNumDrivers. On failure, NULL is returned. + */ + public static native String FSOUND_GetDriverName(int driverid); + + /** + * Returns an error code set by FMOD + * + * @return error code, see FMOD_ERRORS + */ + public static native int FSOUND_GetError(); + + /** + * Returns the current maximum index for a sample. This figure grows as you allocate more + * samples (in blocks) + * @return Maximum sample index + */ + public static native int FSOUND_GetMaxSamples(); + + /** + * Returns the total number of channels allocated + * @return Number of channels allocated + */ + public static native int FSOUND_GetMaxChannels(); + + /** + * Returns information on the memory usage of fmod. This is useful for determining a fixed memory size to + * make FMOD work within for fixed memory machines such as pocketpc and consoles + *

+ * Remarks + * Note that if using FSOUND_SetMemorySystem, the memory usage will be slightly higher than without it, as fmod has to have a small amount of memory overhead to manage the available memory. + *

+ * @param currentallocated_maxallocated IntBuffer to store Currently allocated memory at time of call and + * Maximum allocated memory since FSOUND_Init or FSOUND_SetMemorySystem + */ + public static native void FSOUND_GetMemoryStats(IntBuffer currentallocated_maxallocated); + + /** + * Returns the number of sound cards or devices enumerated for the current output type. (Direct + * Sound, WaveOut etc + * @return Total number of enumerated sound devices + */ + public static native int FSOUND_GetNumDrivers(); + + /** + * Returns the number of available hardware mixed 2d and 3d channels + * @param twoD_threeD_channels_total IntBuffer to store number of available hardware mixed 2d channels, + * number of available hardware mixed 3d channels and the total (Usually num2d + num3d, but on some + * platforms like PS2 and GameCube, this will be the same as num2d and num3d (and not the sum) because 2d and 3d voices share the same pool) + * @return On success, TRUE is returned. On failure, FALSE is returned + */ + public static native boolean FSOUND_GetNumHWChannels(IntBuffer twoD_threeD_channels_total); + + /** + * Returns the current id to the output type. + * See FSOUND_OUTPUTTYPES for valid parameters and descriptions + * @return id to output type + */ + public static native int FSOUND_GetOutput(); + + //public static native int FSOUND_GetOutPutHandle(); + + /** + * Returns the current mixing rate + * @return Currently set output rate in Hz + */ + public static native int FSOUND_GetOutputRate(); + + /** + * Returns the master volume for any sound effects played. + * It specifically has SFX in the function name, as it does not affect music or CD volume. + * This must also be altered with FMUSIC_SetMasterVolume + * @return On success, the SFX master volume is returned. Valid ranges are from 0 (silent) to 255 (full volume) + */ + public static native int FSOUND_GetSFXMasterVolume(); + + /** + * Returns the FMOD version number + *

+ * Remarks + * Use this to compare the header you are using against the compiled DLL version to make sure your + * DLL is up to date. + *

+ * @return FMOD version number + */ + public static native float FSOUND_GetVersion(); + + // ---------------------------------------------------------- + + // Sample functions + // ========================================================== + /** + * Allocates a new empty sample. Used if you want to create a sample from scratch and fill the databuffer with your own data (using FSOUND_Sample_Lock or FSOUND_Sample_Upload), instead of just loading a file with FSOUND_Sample_Load. + *

+ * Remarks + * FMOD has a sample management system that holds onto any samples loaded or allocated, and + * frees them all when you call FSOUND_Close. It takes the hassle out of having to keep hold + * of a lot of sample handles and remember to free them all at the end of your application. + * It is basically an expandle array of handles that holds each sample until FMOD closes down where it does + * a cleanup. FSOUND_UNMANAGED can be used NOT to use the sample management system. + * ------------ + * FSOUND_Sample_Alloc is only nescessary for lower level operations with sample data. Usually + * FSOUND_Load does the work for you. lower level operations mean such things as uploading data from memory or + * your own compressed data for example. + * You can create a new sample from scratch by doing the following operations + * 1. Allocate a new sample with FSOUND_Sample_Alloc + * 2. Write data to the sample buffer with FSOUND_Sample_Lock and FSOUND_Sample_Unlock, or + * FSOUND_Sample_Upload. + * Note FSOUND_Sample_Lock only returns a pointer to the sample data, whereas + * FSOUND_Sample_Upload does a copy from data you give it, with format conversion to the + * correct format. + * + * @param index Sample pool index. See remarks for more on the sample pool. + * 0 or above - The absolute index into fsounds sample pool. The pool will grow as + * the index gets larger. If a slot is already used it will be replaced. + * FSOUND_FREE - Let FSOUND select an arbitrary sample slot. + * FSOUND_UNMANAGED - Dont have fsound free this sample upon FSOUND_Close + * @param length The length in of the sample buffer in SAMPLES + * @param mode Bitfield describing various characteristics of the sample. Valid parameters are + * described in FSOUND_MODES + * @param deffreq Default frequency for this sample + * @param defvol Default volume for this sample + * @param defpan Default pan for this sample + * @param defpri Default priority for this sample + * @return On success, a reference to an allocated sample is returned. On failure, NULL is returned + */ + public static FSoundSample FSOUND_Sample_Alloc(int index, int length, int mode, int deffreq, int defvol, int defpan, + int defpri) { + long result = nFSOUND_Sample_Alloc(index, length, mode, deffreq, defvol, defpan, defpri); + if (result != 0) { return new FSoundSample(result); } + return null; + } + + private static native long nFSOUND_Sample_Alloc(int index, int length, int mode, int deffreq, int defvol, int defpan, + int defpri); + + /** + * Removes a sample from memory and makes its slot available again + * @param sample sample definition to be freed + */ + public static void FSOUND_Sample_Free(FSoundSample sample) { + nFSOUND_Sample_Free(sample.sampleHandle); + } + + private static native void nFSOUND_Sample_Free(long sample); + + /** + * Returns a reference to a managed sample based on the index passed + *

+ * Remarks + * Samples that are not created with FSOUND_UNMANAGED are stored in a table inside FMOD. + * This way when FMOD can free all samples when FSOUND_Close is called and the user doesnt have to worry about cleaning up memory. + * + * @param sampno index in the sample management pool of the requested sample + * @return Reference to a sample + */ + public static FSoundSample FSOUND_Sample_Get(int sampno) { + long result = nFSOUND_Sample_Get(sampno); + if (result != 0) { return new FSoundSample(result); } + return null; + } + + private static native long nFSOUND_Sample_Get(int sampno); + + /** + * Returns the default volume, frequency, pan and priority values for the specified sample + *

+ * Remarks + * Passing NULL in any of these parameters will result in the value being ignored + *

+ * + * @param sample sample to get the default information from + * @param deffreq IntBuffer to be filled with the sample default frequency. Can be NULL + * @param defvol IntBuffer to be filled with the sample default volume. Can be NULL + * @param defpan IntBuffer to be filled with the sample default pan. Can be NULL + * @param defpri IntBuffer to be filled with the sample default priority. Can be NULL + * @return On success, TRUE is returned. On failure, FALSE is returned + */ + public static boolean FSOUND_Sample_GetDefaults(FSoundSample sample, IntBuffer deffreq, IntBuffer defvol, + IntBuffer defpan, IntBuffer defpri) { + return nFSOUND_Sample_GetDefaults(sample.sampleHandle, deffreq, (deffreq == null) ? 0 : deffreq.position(), defvol, + (defvol == null) ? 0 : defvol.position(), defpan, (defpan == null) ? 0 : defpan.position(), defpri, + (defpri == null) ? 0 : defpri.position()); + } + + private static native boolean nFSOUND_Sample_GetDefaults(long sample, IntBuffer deffreq, int deffreqOffset, + IntBuffer defvol, int defvolOffset, IntBuffer defpan, int defpanOffset, IntBuffer defpri, int defpriOffset); + + /** + * Returns the default volume, frequency, pan, priority and random playback variations for the specified sample + *

+ * Remarks + * Passing NULL in any of these parameters will result in the value being ignored + *

+ * + * @param sample sample to get the default information from + * @param deffreq IntBuffer to be filled with the sample default frequency. Can be NULL + * @param defvol IntBuffer to be filled with the sample default volume. Can be NULL + * @param defpan IntBuffer to be filled with the sample default pan. Can be NULL + * @param defpri IntBuffer to be filled with the sample default priority. Can be NULL + * @param varfreq IntBuffer to be filled with the sample random frequency variance. Can be NULL + * @param varvol IntBuffer to be filled with the sample random volume variance. Can be NULL + * @param varpan IntBuffer to be filled with the sample random pan variance. Can be NULL. + * @return On success, TRUE is returned. On failure, FALSE is returned + */ + public static boolean FSOUND_Sample_GetDefaultsEx(FSoundSample sample, IntBuffer deffreq, IntBuffer defvol, + IntBuffer defpan, IntBuffer defpri, IntBuffer varfreq, IntBuffer varvol, IntBuffer varpan) { + return nFSOUND_Sample_GetDefaultsEx(sample.sampleHandle, deffreq, (deffreq == null) ? 0 : deffreq.position(), + defvol, (defvol == null) ? 0 : defvol.position(), defpan, (defpan == null) ? 0 : defpan.position(), defpri, + (defpri == null) ? 0 : defpri.position(), varfreq, (varfreq == null) ? 0 : varfreq.position(), varvol, + (varvol == null) ? 0 : varvol.position(), varpan, (varpan == null) ? 0 : varpan.position()); + } + private static native boolean nFSOUND_Sample_GetDefaultsEx(long sample, IntBuffer deffreq, int deffreqOffset, + IntBuffer defvol, int defvolOffset, IntBuffer defpan, int defpanOffset, IntBuffer defpri, int defpriOffset, + IntBuffer varfreq, int varfreqOffset, IntBuffer varvol, int varvolOffset, IntBuffer varpan, int varpanOffset); + + /** + * Returns the length of the sample in SAMPLES + * @param sample sample to get the length from + * @return On success, the length of sample in SAMPLES is returned. On failure, 0 is returned + */ + public static int FSOUND_Sample_GetLength(FSoundSample sample) { + return nFSOUND_Sample_GetLength(sample.sampleHandle); + } + private static native int nFSOUND_Sample_GetLength(long sample); + + /** + * Returns the start and end positions of the specified sample loop + * in SAMPLES (not bytes) + *

+ * Remarks + * Passing NULL in any of these parameters will result in the value being ignored. + * @param sample sample to get the loop point information from + * @param loopstart IntBuffer to be filled with the sample loop start point. Can be NULL + * @param loopend IntBuffer to be filled with the sample loop end point. Can be NULL + * @return On success, TRUE is returned. On failure, FALSE is returned + */ + public static int FSOUND_Sample_GetLoopPoints(FSoundSample sample, IntBuffer loopstart, IntBuffer loopend) { + return nFSOUND_Sample_GetLoopPoints(sample.sampleHandle, loopstart, (loopstart == null) ? 0 : loopstart.position(), loopend, (loopend == null) ? 0 : loopend.position()); + } + private static native int nFSOUND_Sample_GetLoopPoints(long sample, IntBuffer loopstart, int loopstartOffset, IntBuffer loopend, int loopendOffset); + + /** + * Get the minimum and maximum audible distance for a sample + *

+ * Remarks + * A 'distance unit' is specified by FSOUND_3D_SetDistanceFactor. By default this is set to meters which is a distance scale of 1.0. + * See FSOUND_3D_SetDistanceFactor for more on this. + * The default units for minimum and maximum distances are 1.0 and 1000000000.0f. + * Volume drops off at mindistance / distance. + * + * @param sample sample to get the distance information from + * @param min FloatBuffer to be filled with the sample loop start point. Can be NULL + * @param max FloatBuffer to be filled with the sample loop end point. Can be NULL + * @return On success, TRUE is returned. On failure, FALSE is returned + */ + public static int FSOUND_Sample_GetMinMaxDistance(FSoundSample sample, FloatBuffer min, FloatBuffer max) { + return nFSOUND_Sample_GetMinMaxDistance(sample.sampleHandle, min, (min == null) ? 0 : min.position(), max, (max == null) ? 0 : max.position()); + } + private static native int nFSOUND_Sample_GetMinMaxDistance(long sample, FloatBuffer min, int minOffset, FloatBuffer max, int maxOffset); + + /** + * Returns a bitfield containing information about the specified sample. + * The values can be bitwise AND'ed with the values contained in FSOUND_MODES to see if certain criteria are true or not. + * Information that can be retrieved from the same in this field are loop type, bitdepth and stereo/mono. + * + * @param sample sample to get the mode information from + * @return On success, the sample mode is returned. On failure, 0 is returned. + */ + public static int FSOUND_Sample_GetMode(FSoundSample sample) { + return nFSOUND_Sample_GetMode(sample.sampleHandle); + } + private static native int nFSOUND_Sample_GetMode(long sample); + + /** + * Returns a string containing the sample's name + * + * @param sample sample to get the loop point information from + * @return On success, the name of the sample is returned. On failure, NULL is returned. + */ + public static String FSOUND_Sample_GetName(FSoundSample sample) { + return nFSOUND_Sample_GetName(sample.sampleHandle); + } + private static native String nFSOUND_Sample_GetName(long sample); + + /** + * Loads and decodes a static soundfile into memory. + * This includes such files as .WAV, .MP2, .MP3, .OGG, .RAW and others. + *

+ * Remarks + * FMOD has a sample management system that holds onto any samples loaded or allocated, and frees them all when you call FSOUND_Close. + * It takes the hassle out of having to keep hold of a lot of sample handles and remember to free them all at the end of your application. + * It is basically an expandle array of handles that holds each sample until FMOD closes down where it does a cleanup. + * FSOUND_UNMANAGED can be used so FMOD does NOT use the sample management system. You have to make sure they are freed yourself. + * -------- + * Specify FSOUND_LOADMEMORY to load a file from a memory image. + * The pointer you pass to name must be the actual image of the data you want to load. + * The length parameter is to be filled out if FSOUND_LOADMEMORY is specified, otherwise if you do not specify memory loading, can be safely ignored and should be set to 0. + * -------- + * Compressed formats are expanded into memory. If the file is quite large, it could take a while to load. + * -------- + * If FSOUND_8BITS is specified and the file decodes to 16bit normally, FMOD will downgrade the sample to 8bit. + * -------- + * On PlayStation 2, the name_or_data pointer and length variables must be 16 byte aligned, for DMA reasons. + * -------- + * Note that FSOUND_NONBLOCKING is NOT supported with this function. + *

+ * @param index Sample pool index. See remarks for more on the sample pool. + * 0 or above - The absolute index into the sample pool. The pool will grow as the index gets larger. If a slot is already used it will be replaced. + * FSOUND_FREE - Let FSOUND select an arbitrary sample slot. + * FSOUND_UNMANAGED - Dont have this sample managed within fsounds sample management system + * @param data Name of sound file or ByteBuffer to memory image to load. + * @param inputmode Description of the data format, OR in the bits defined in FSOUND_MODES to describe the data being loaded + * @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. length must also be specified if this value is used + * @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 + * @return + */ + public static FSoundSample FSOUND_Sample_Load(int index, ByteBuffer name_or_data, int inputmode, int offset, int length) { + long result = 0; + + if((inputmode & FSound.FSOUND_LOADMEMORY) == FSound.FSOUND_LOADMEMORY) { + result = nFSOUND_Sample_Load(index, name_or_data, name_or_data.position(), inputmode, offset, length); + } else { + byte[] data = new byte[name_or_data.remaining()]; + result = nFSOUND_Sample_Load(index, new String(data), inputmode, offset, length); + } + if(result != 0) { + return new FSoundSample(result); + } + return null; + } + private static native long nFSOUND_Sample_Load(int index, ByteBuffer data, int dataOffset, int inputmode, int offset, int length); + private static native long nFSOUND_Sample_Load(int index, String name, int inputmode, int offset, int length); + + /** + * Returns a reference to the beginning of the sample data for a sample. + * Data written must be signed. + *

+ * Remarks + * You must always unlock the data again after you have finished with it, using FSOUND_Sample_Unlock. + * For PCM based samples, data must be signed 8 or 16bit. For compressed samples such as those created with FSOUND_IMAADPCM, FSOUND_VAG, FSOUND_GCADPCM, the data must be in its original compressed format. + * On PlayStation 2, with FSOUND_HW2D or FSOUND_HW3D based samples, this function does not return a readable or writable buffer, it returns the SPU2 address of the sample. To send data to it you must call FSOUND_SendData. + * On GameCube, with FSOUND_HW2D or FSOUND_HW3D based samples, this function will not return the data contained within the sample. It is for upload purposes only. + *

+ * + * @param sample sample definition + * @param offset Offset in BYTES to the position you want to lock in the sample buffer. + * @param length Number of BYTES you want to lock in the sample buffer. + * @param Sample lock object to contain lock info + * @return On success, true is is returned. On failure, false is returned. + */ + public static boolean FSOUND_Sample_Lock(FSoundSample sample, int offset, int length, FSoundSampleLock lock) { + return nFSOUND_Sample_Lock(sample.sampleHandle, offset, length, lock); + } + private static native boolean nFSOUND_Sample_Lock(long sample, int offset, int length, FSoundSampleLock lock); + + /** + * Sets a sample's default attributes, so when it is played it uses these values without having to specify them later. + * + * @param sample sample to have its attributes set + * @param deffreq Default sample frequency. The value here is specified in hz. -1 to ignore. + * @param defvol Default sample volume. This is a value from 0 to 255. -1 to ignore. + * @param defpan Default sample pan position. This is a value from 0 to 255 or FSOUND_STEREOPAN. + * @param defpri Default sample priority. This is a value from 0 to 255. -1 to ignore. + * + * @return On success, true is is returned. On failure, false is returned. + */ + public static boolean FSOUND_Sample_SetDefaults(FSoundSample sample, int deffreq, int defvol, int defpan, int defpri) { + return nFSOUND_Sample_SetDefaults(sample.sampleHandle, deffreq, defvol, defpan, defpri); + } + private static native boolean nFSOUND_Sample_SetDefaults(long sample, int deffreq, int defvol, int defpan, int defpri); + + /** + * Sets a sample's default attributes, so when it is played it uses these values without having to specify them later. + *

+ * Remarks + * Frequency, volume and pan variation values specify a +/- variation to the + * specified default frequency, volume and pan values i.e. with deffreq=44100, + * varfreq=2000 the actual frequency value used will be in the range 42100 -> 46100. + *

+ * + * @param sample sample to have its attributes set + * @param deffreq Default sample frequency. The value here is specified in hz. -1 to ignore. + * @param defvol Default sample volume. This is a value from 0 to 255. -1 to ignore. + * @param defpan Default sample pan position. This is a value from 0 to 255 or FSOUND_STEREOPAN. + * @param defpri Default sample priority. This is a value from 0 to 255. -1 to ignore. + * @param varfreq Frequency variation in hz to apply to deffreq each time this sample is played. -1 to ignore. + * @param varvol Volume variation to apply to defvol each time this sample is played. -1 to ignore. + * @param varpan Pan variation to apply to defpan each time this sample is played. -1 to ignore. + * + * @return On success, true is is returned. On failure, false is returned. + */ + public static boolean FSOUND_Sample_SetDefaultsEx(FSoundSample sample, int deffreq, int defvol, int defpan, int defpri, int varfreq, int varvol, int varpan) { + return nFSOUND_Sample_SetDefaultsEx(sample.sampleHandle, deffreq, defvol, defpan, defpri, varfreq, varvol, varpan); + } + private static native boolean nFSOUND_Sample_SetDefaultsEx(long sample, int deffreq, int defvol, int defpan, int defpri, int varfreq, int varvol, int varpan); + + /** + * Sets the maximum number of times a sample can play back at once + * + * @param sample sample to have its playback behaviour changed + * @param max maximum number of times a sample can play back at once + * @return On success, true is is returned. On failure, false is returned. + */ + public static boolean FSOUND_Sample_SetMaxPlaybacks(FSoundSample sample, int max) { + return nFSOUND_Sample_SetMaxPlaybacks(sample.sampleHandle, max); + } + private static native boolean nFSOUND_Sample_SetMaxPlaybacks(long sample, int max); + + /** + * Sets the minimum and maximum audible distance for a sample. + * MinDistance is the minimum distance that the sound emitter will cease to continue growing + * louder at (as it approaches the listener). Within the mindistance it stays at the constant loudest volume possible. Outside of this mindistance it begins to attenuate. + * MaxDistance is the distance a sound stops attenuating at. Beyond this point it will stay at the volume it would be at maxdistance units from the listener and will not attenuate any more. + * MinDistance is useful to give the impression that the sound is loud or soft in 3d space. An example of this is a small quiet object, such as a bumblebee, which you could set a mindistance of to 0.1 for example, which would cause it to attenuate quickly and dissapear when only a few meters away from the listener. + * Another example is a jumbo jet, which you could set to a mindistance of 100.0, which would keep the sound volume at max until the listener was 100 meters away, then it would be hundreds of meters more before it would fade out. + * ------- + * In summary, increase the mindistance of a sound to make it 'louder' in a 3d world, and + * decrease it to make it 'quieter' in a 3d world. + * maxdistance is effectively obsolete unless you need the sound to stop fading out at a certain point. Do not adjust this from the default if you dont need to. + * Some people have the confusion that maxdistance is the point the sound will fade out to, this is not the case + *

+ * Remarks + * A 'distance unit' is specified by FSOUND_3D_SetDistanceFactor. By default this is set to meters which is a distance scale of 1.0. + * See FSOUND_3D_SetDistanceFactor for more on this. + * The default units for minimum and maximum distances are 1.0 and 1000000000.0f. + * Volume drops off at mindistance / distance. + *

+ * + * @param sample sample to have its minimum and maximum distance set + * @param min The samples minimum volume distance in "units". See remarks for more on units. + * @param max The samples maximum volume distance in "units". See remarks for more on units. + * @return On success, true is is returned. On failure, false is returned. + */ + public static boolean FSOUND_Sample_SetMinMaxDistance(FSoundSample sample, float min, float max) { + return nFSOUND_Sample_SetMinMaxDistance(sample.sampleHandle, min, max); + } + private static native boolean nFSOUND_Sample_SetMinMaxDistance(long sample, float min, float max); + + /** + * Sets a sample's mode. This can only be FSOUND_LOOP_OFF,FSOUND_LOOP_NORMAL, FSOUND_LOOP_BIDI or FSOUND_2D. + * You cannot change the description of the contents of a sample or its location. FSOUND_2D will be ignored on the Win32 platform if FSOUND_HW3D was used to create the sample. + * + *

+ * Remarks + * Only the following modes are accepted, others will be filtered out. + * FSOUND_LOOP_BIDI, FSOUND_LOOP_NORMAL, FSOUND_LOOP_OFF, FSOUND_2D. + * Normally FSOUND_2D is accepted only if the sound is software mixed. If this is not set, the mode is set for the sample to be 3D processed. + * ------------------- + * On Playstation 2, XBox and GameCube, FSOUND_HW2D and FSOUND_HW3D are supported, so you can change between the 2 at runtime. + * ------------------- + * On Windows, samples created with FSOUND_HW3D or FSOUND_HW2D do not support FSOUND_LOOP_BIDI. This is a limitation of Direct X. *

+ * + * @param sample sample to have the mode set + * @param mode mode bits to set from FSOUND_MODES + * @return On success, true is is returned. On failure, false is returned. + */ + public static boolean FSOUND_Sample_SetMode(FSoundSample sample, int mode) { + return nFSOUND_Sample_SetMode(sample.sampleHandle, mode); + } + private static native boolean nFSOUND_Sample_SetMode(long sample, int mode); + + /** + * Sets a sample's loop points, specified in SAMPLES, not bytes + *

+ * Remarks + * Samples created with FSOUND_HW3D and FSOUND_HW2D under the FSOUND_OUTPUT_DSOUND output mode do not support this function. + * Loop points set on such a sample with be ignored, and the sample will loop in its entirety. This is a limitation of DirectSound. + * On XBOX, GameCube and Playstation 2 hardware voices using compressed data (ie XADPCM, VAG or GCADPCM), these values will not be sample accurate, but will be rounded to the nearest compression block size. + * On PlayStation 2, the loopend is ignored. The hardware cannot change the end address, so the loopend is always equivalent to length - 1 no matter what you set. * + * @param sample sample to have its loop points set + * @param loopstart The starting position of the sample loop + * @param loopend The end position of the sample loop + * @return On success, true is is returned. On failure, false is returned. + */ + public static boolean nFSOUND_Sample_SetLoopPoints(FSoundSample sample, int loopstart, int loopend) { + return nFSOUND_Sample_SetLoopPoints(sample.sampleHandle, loopstart, loopend); + } + private static native boolean nFSOUND_Sample_SetLoopPoints(long sample, int loopstart, int loopend); + + /** + * Releases previous sample data lock from FSOUND_Sample_Lock + * + * @param sample sample definition + * @param offset Offset in BYTES to the position you want to unlock in the sample buffer. + * @param lock lock object that contains lock info + * @return On success, true is is returned. On failure, false is returned. + */ + public static boolean FSOUND_Sample_Unlock(FSoundSample sample, int offset, FSoundSampleLock lock) { + return nFSOUND_Sample_Unlock(sample.sampleHandle, offset, lock); + } + private static native boolean nFSOUND_Sample_Unlock(long sample, int offset, FSoundSampleLock lock); + + + /** + * This function uploads new sound data from memory to a preallocated/existing sample and does conversion based on the specified source mode. + * If sample data already exists at this handle then it is replaced with the new data being uploaded + *

+ * Remarks + * Note that on PlayStation 2 the source data address is an IOP address not an EE address. + * To get data from EE RAM to the sample you must allocate some IOP memory, dma it to IOP memory then call upload. There are helper functions in fmodps2.h to achieve this. + *

+ * + * @param sample the destination sample + * @param srcdata ByteBuffer to the source data to be uploaded. On PlayStation 2 this is an IOP address not an EE address. + * @param mode Description of the source data format. Bitwise OR in these bits to describe the data being passed in. + * See FSOUND_MODES for valid parameters and descriptions. + * FSOUND_HW3D, FSOUND_HW2D and FSOUND_LOOP modes are ignored, the mode describes the source format, not the destination format. + * + * @return On success, true is is returned. On failure, false is returned. + */ + public static boolean FSOUND_Sample_Upload(FSoundSample sample, ByteBuffer srcdata, int mode) { + return nFSOUND_Sample_Upload(sample.sampleHandle, srcdata, srcdata.position(), mode); + } + private static native boolean nFSOUND_Sample_Upload(long sample, ByteBuffer srcdata, int srcdataOffset, int mode); + // ---------------------------------------------------------- + + // Channel functions + // ========================================================== + /** + * Plays a sample in a specified channel, using the sample's default frequency, volume + * and pan settings. + *

+ * Remarks + * If you play a FSOUND_HW3D declared sample with this function, then the position and velocity + * are set to those of the listener. Other attributes such as volume, frequency and pan are taken + * from the sample's default volume, frequency, pan etc. + * ---------- + * The channel handle : + * The return value is reference counted. This stops the user from updating a stolen channel. + * Basically it means the only sound you can change the attributes (ie volume/pan/frequency/3d position) for are the one you specifically called playsound for. If another sound steals that channel, and you keep trying to change its attributes (ie volume/pan/frequency/3d position), it will do nothing. + * This is great if you have sounds being updated from tasks and you just forget about it. + * You can keep updating the sound attributes and if another task steals that channel, your original task wont change the attributes of the new sound!!! + * The lower 12 bits contain the channel number. (yes this means a 4096 channel limit for FMOD :) + * The upper 19 bits contain the reference count. + * The top 1 bit is the sign bit. + * ie + * S RRRRRRRRRRRRRRRRRRR CCCCCCCCCCCC + * ---------- + * Remember if not using FSOUND_FREE, then the channel pool is split up into software and hardware channels. + * Software channels occupy the first n indicies specified by the value passed into FSOUND_Init. + * Hardware channels occupy the next n indicies after this, and can be a variable amount, depending on the hardware. + * Use FSOUND_GetNumHardwareChannels to query how many channels are available in hardware. + *

+ * + * @param channel 0+ + * The absolute channel number in the channel pool. + * Remember software channels come first, followed by hardware channels. + * You cannot play a software sample on a hardware channel and vice versa. + * FSOUND_FREE + * Chooses a free channel to play in. If all channels are used then it + * selects a channel with a sample playing that has an EQUAL or LOWER priority + * than the sample to be played. + * FSOUND_ALL + * Passing this will cause ALL channels to play. (note this will make things + * VERY noisy!) + * If FSOUND_ALL is used the last channel success flag will be returned. + * @param sample to be played + * + * @return On success, the channel handle that was selected is returned. On failure, -1 is returned. + */ + public static int FSOUND_PlaySound(int channel, FSoundSample sample) { + return nFSOUND_PlaySound(channel, sample.sampleHandle); + } + private static native int nFSOUND_PlaySound(int channel, long sample); + + /** + * Extended featured version of FSOUND_PlaySound. + * New functionality includes the ability to start the sound paused. + * This allows attributes of a channel to be set freely before the sound actually starts playing, until FSOUND_SetPaused(FALSE) is used. + * Also added is the ability to associate the channel to a specified DSP unit. This allows the user to 'group' channels into seperate DSP units, which allows effects to be inserted between these 'groups', and allow various things like having one group affected by reverb (wet mix) and another group of channels unaffected (dry). + * This is useful to seperate things like music from being affected by DSP effects, while other sound effects are. + *

+ * Remarks + * FSOUND_ALL is supported. Passing this will cause ALL channels to play. (note this could make things VERY noisy!) + * If FSOUND_ALL is used the last channel success flag will be returned. This return value is not useful in most circumstances. + * ---------- + * The channel handle : + * The return value is reference counted. This stops the user from updating a stolen channel. + * This means the only sound you can change the attributes (ie volume/pan/frequency/3d position) for are the + * one you specifically called playsound for. If another sound steals that channel, and you keep trying to + * change its attributes (ie volume/pan/frequency/3d position), it will do nothing. + * This is great if you have sounds being updated from tasks and you just forget about it. + * You can keep updating the sound attributes and if another task steals that channel, your original task + * wont change the attributes of the new sound!!! + * The lower 12 bits contain the channel number. (yes this means a 4096 channel limit for FMOD :) + * The upper 19 bits contain the reference count. + * The top 1 bit is the sign bit. + * ie + * S RRRRRRRRRRRRRRRRRRR CCCCCCCCCCCC + * ---------- + * Remember if not using FSOUND_FREE, then the channel pool is split up into software and hardware channels. + * Software channels occupy the first n indicies specified by the value passed into FSOUND_Init. + * Hardware channels occupy the next n indicies after this, and can be a variable amount, depending on the hardware. + * Use FSOUND_GetNumHardwareChannels to query how many channels are available in hardware. + * ---------- + * If you attach a sound to a DSP unit (for grouping purposes), the callback for the DSP unit will be overwritten with fmod's internal mixer callback, so the callback the user supplied is rendered obsolete and is not called. + * Also, do not attach sounds to system DSP units, the assignment will be ignored if you do. + *

+ * + * @param channel 0+ + * The absolute channel number in the channel pool. + * Remember software channels come first, followed by hardware channels. + * You cannot play a software sample on a hardware channel and vice versa. + * FSOUND_FREE + * Chooses a free channel to play in. If all channels are used then it + * selects a channel with a sample playing that has an EQUAL or LOWER priority + * than the sample to be played. + * FSOUND_ALL + * Passing this will cause ALL channels to play. (note this will make things + * VERY noisy!) + * If FSOUND_ALL is used the last channel success flag will be returned. + * @param sample to be played + * @param dspunit Optional. NULL by default. Pointer to a dsp unit to attach the channel to for channel grouping. Only attach a sound to a user created DSP unit, and not a system DSP unit. + * @param startpaused Start the sound paused or not. Pausing the sound allows attributes to be set before the sound starts + * @return On success, the channel handle that was selected is returned. On failure, -1 is returned. + */ + public static int nFSOUND_PlaySoundEx(int channel, FSoundSample sample, FSoundDSPUnit dspunit, boolean startpaused) { + return nFSOUND_PlaySoundEx(channel, sample.sampleHandle, dspunit.dspHandle, startpaused); + } + private static native int nFSOUND_PlaySoundEx(int channel, long sample, long dspunit, boolean startpaused); + + /** + * Stops a specified sound channel from playing, and frees it up for re-use + *

+ * Remarks + * FSOUND_ALL is supported. Passing this will cause ALL channels to stop. + * If FSOUND_ALL is used the last channel success flag will be returned. This return value is not useful in most circumstances. + *

+ * + * @param channel The channel number/handle to stop. FSOUND_ALL can also be used (see remarks) + * @return On success, TRUE is returned. On failure, FALSE is returned + */ + public static native boolean FSOUND_StopSound(int channel); + + /** + * Sets a channels frequency or playback rate, in Hz. + *

+ * Remarks + * FSOUND_ALL is supported here. Passing this will set ALL channels to specified frequency. + * If FSOUND_ALL is used the last channel success flag will be returned. This return value is not useful in most circumstances. + * Negative frequencies make the sound play backwards, so FSOUND_SetCurrentPosition would be needed to set the sound to the right position. + *

+ * + * @param channel The channel number/handle to stop. FSOUND_ALL can also be used (see remarks) + * @param freq The frequency to set. Valid ranges are from 100 to 705600, and -100 to -705600 + * @return On success, TRUE is returned. On failure, FALSE is returned + */ + public static native boolean FSOUND_SetFrequency(int channel, int freq); + + /** + * XBox Only - For surround sound systems, this function allows each surround speaker level to be set individually for this channel + *

+ * Remarks + * FSOUND_ALL is supported. Passing this will set the pan of ALL channels available. + * If FSOUND_ALL is used the last channel success flag will be returned. This return value is not useful in most circumstances. + * ---------- + * FSOUND_SYSTEMCHANNEL is supported. You can set the mix levels for the FMOD software engine, and ALL software mixed sounds will be affected. *

+ * + * @param channel The channel number/handle to change the output levels for. FSOUND_ALL and FSOUND_SYSTEMCHANNEL can also be used (see remarks) + * @param frontleft Value from 0 to 255 inclusive, specifying a linear level for the front left speaker. + * @param center Value from 0 to 255 inclusive, specifying a linear level for the center. + * @param frontright Value from 0 to 255 inclusive, specifying a linear level for the front right speaker. + * @param backleft Value from 0 to 255 inclusive, specifying a linear level for the back left speaker. + * @param backright Value from 0 to 255 inclusive, specifying a linear level for the back right speaker. + * @param lfe Value from 0 to 255 inclusive, specifying a linear level for the subwoofer speaker. + * @return On success, TRUE is returned. On failure, FALSE is returned + */ + public static native boolean FSOUND_SetLevels( + int channel, int frontleft, int center, int frontright, int backleft, int backright, int lfe); + + /** + * Sets the loop mode for a particular CHANNEL, not sample + *

+ * Remarks + * FSOUND_ALL is supported. Passing this will set loop modes for all channels available. + * Note, this does not work for hardware sounds played on hardware channels while they are playing. The function has to be called when the channel is paused. + * Software based sounds do not have this limitation, and can have their loop mode changed during playback, but for compatibility it is best to use the pause method, else you may get different behaviour if hardware voices do not exist. + *

+ * @param channel The channel number/handle to change the output levels for. FSOUND_ALL and FSOUND_SYSTEMCHANNEL can also be used (see remarks) + * @param loopmode The loopmode to set. This can be FSOUND_LOOP_NORMAL, FSOUND_LOOP_BIDI or FSOUND_LOOP_OFF. + * @return On success, TRUE is returned. On failure, FALSE is returned + */ + public static native boolean FSOUND_SetLoopMode(int channel, int loopmode); + + /** + * Mutes and un-mutes a channel + *

+ * Remarks + * FSOUND_ALL is supported. Passing this will mute/unmute ALL channels available. + * If FSOUND_ALL is used the last channel success flag will be returned. This return value is not useful in most circumstances. + *

+ * @param channel The channel number/handle to change the output levels for. FSOUND_ALL and FSOUND_SYSTEMCHANNEL can also be used (see remarks) + * @param mute Toggle value - TRUE mutes out the channel, FALSE reenables it. + * @return On success, TRUE is returned. On failure, FALSE is returned + */ + public static native boolean FSOUND_SetMute(int channel, boolean mute); + + /** + * Sets a channels pan position linearly + *

+ * Remarks + * FSOUND_ALL is supported. Passing this will set the pan of ALL channels available. + * If FSOUND_ALL is used the last channel success flag will be returned. This return value is not useful in most circumstances. + * ---------- + * Important : If you are playing a STEREO sample, and using normal middle panning, it will only come out at half the volume + * they are supposed to. To avoid this use FSOUND_STEREO pan. + * Panning works in the following manner: + * full left : 100to left, 0to right + * full right : 0to left, 100to right + * middle : 71to left, 71to right + * FMOD Uses 'constant power' panning. The center position is 71 4738960n each channel as it keeps an even RMS output level when + * moving the sound from left to right. Placing 50 4738960n each channel for a middle position is incorrect. + * The pan graph for constant power panning resembles a curve instead of straight lines. *

+ * @param channel The channel number/handle to change the output levels for. FSOUND_ALL and FSOUND_SYSTEMCHANNEL can also be used (see remarks) + * @param pan The panning position for this channel to set. + * parameters are: + * - from 0 (full left) to 255 (full right) + * - FSOUND_STEREOPAN. This is meant for stereo samples, but will work on mono + * samples as well. It makes both left and right FULL volume instead of 50/50 + * as middle panning does. See remarks section for more information on this + * @return On success, TRUE is returned. On failure, FALSE is returned + */ + public static native boolean FSOUND_SetPan(int channel, int pan); + + /** + * Pauses or unpauses a sound channel + *

+ * Remarks + * FSOUND_ALL is supported. Passing this will pause/unpause ALL channels available. + * If FSOUND_ALL is used the last channel success flag will be returned. This return value is not useful in most circumstances. + *

+ * @param channel The channel number/handle to change the output levels for. FSOUND_ALL and FSOUND_SYSTEMCHANNEL can also be used (see remarks) + * @param paused TRUE pauses this channel, FALSE unpauses it. + * @return On success, TRUE is returned. On failure, FALSE is returned + */ + public static native boolean FSOUND_SetPaused(int channel, boolean paused); + + /** + * Sets a channels priority. Higher priority means it is less likely to get discarded when + * FSOUND_FREE is used to select a channel, when all channels are being used, and one has to + * be rejected. If a channel has an equal priority then it will be replaced. + *

+ * Remarks + * FSOUND_ALL is supported. Passing this will pause/unpause ALL channels available. + * If FSOUND_ALL is used the last channel success flag will be returned. This return value is not useful in most circumstances. + *

+ * @param channel The channel number/handle to change the output levels for. FSOUND_ALL and FSOUND_SYSTEMCHANNEL can also be used (see remarks) + * @param priority The priority to set. Valid ranges are from 0 (lowest) to 255 (highest) + * @return On success, TRUE is returned. On failure, FALSE is returned + */ + public static native boolean FSOUND_SetPriority(int channel, int priority); + + /** + * This sets the reserved status of a channel. Reserving a channel is related to setting its + * priority, but reserving a channel means it can NEVER be stolen by a channel request. It + * could be thought of as an extra high priority, but is different in that reserved channels do + * not steal from each other, whereas channels with equal priorities do (unless there are + * channels with lower priorities that it can steal from). If all channels were reserved and + * another request for came in for a channel, it would simply fail and the sound would not be + * played. + *

+ * Remarks + * FSOUND_ALL is supported. Passing this will pause/unpause ALL channels available. + * If FSOUND_ALL is used the last channel success flag will be returned. This return value is not useful in most circumstances. + *

+ * @param channel The channel number/handle to change the priority for. + * FSOUND_ALL can also be used (see remarks). + * FSOUND_FREE is NOT accepted. + * @param reserved Reserved flag. Values accepted are TRUE, to reserve a channel, and FALSE to + * un-reserve a channel. + * @return On success, TRUE is returned. On failure, FALSE is returned + */ + public static native boolean FSOUND_SetReserved(int channel, boolean reserved); + + /** + * Sets a channels surround sound status. This surround sound is a fake dolby trick that + * effectively pans the channel to the center, but inverts the waveform in one speaker to + * make it sound fuller or spacier, or like it is coming out of space between the 2 speakers. + * Panning is ignored while surround is in effect. + *

+ * Remarks + * FSOUND_ALL is supported. Passing this will pause/unpause ALL channels available. + * If FSOUND_ALL is used the last channel success flag will be returned. This return value is not useful in most circumstances. + *

+ * @param channel The channel number/handle to change the surround for. FSOUND_ALL can also be used (see remarks). + * @param surround Toggle value - TRUE enables surround sound on the channel, FALSE disables it. + * @return On success, TRUE is returned. On failure, FALSE is returned + */ + public static native boolean FSOUND_SetSurround(int channel, boolean sorround); + + /** + * Sets a channels volume linearly. + * This function IS affected by FSOUND_SetSFXMasterVolume. + *

+ * Remarks + * FSOUND_ALL is supported. Passing this will pause/unpause ALL channels available. + * If FSOUND_ALL is used the last channel success flag will be returned. This return value is not useful in most circumstances. + *

+ * @param channel The channel number/handle to change the volume for. FSOUND_ALL can also be used (see remarks) + * @param vol The volume to set. Valid ranges are from 0 (silent) to 255 (full volume) + * @return On success, TRUE is returned. On failure, FALSE is returned + */ + public static native boolean FSOUND_SetVolume(int channel, int vol); + + /** + * Sets a channels volume linearly. + * This function is NOT affected by master volume. + * This function is used when you want to quiet everything down using FSOUND_SetSFXMasterVolume, but make + * a channel prominent. + *

+ * Remarks + * FSOUND_ALL is supported. Passing this will set the absolute volume of ALL channels available. + * If FSOUND_ALL is used the last channel success flag will be returned. This return value is not useful in most circumstances. + * ------------- + * A good example of this function being used for a game needing a voice over. + * If all the background sounds were too loud and drowned out the voice over, there is no way to + * feasibly go through all the sfx channels and lower the background noise volumes (some might be allocated by music). + * Simply lower the background noise with FSOUND_SetSFXMasterVolume, and use FSOUND_SetVolumeAbsolute to bring + * up the volume of the voice over to full, and you will get one channel standing out amongst the rest. *

+ * @param channel The channel number/handle to change the volume for. FSOUND_ALL can also be used (see remarks) + * @param vol The volume to set. Valid ranges are from 0 (silent) to 255 (full volume) + * @return On success, TRUE is returned. On failure, FALSE is returned + */ + public static native boolean FSOUND_SetVolumeAbsolute(int channel, int vol); + + /** + * Returns the linear volume of the specified channel between 0 and 255 + * @param channel Channel to get volume from + * @return On success, the following values are returned : 0 = silent to 255 = full volume. + * On failure, 0 is returned. To quailfy if this is a real error, call FSOUND_GetError. + */ + public static native int FSOUND_GetVolume(int channel); + + /** + * Returns the volume of the channel based on all combinations of set volume, mastervolume and 3d position. + * Works on software and hardware voices. + *

+ * Remarks + * This is not the same as FSOUND_GetCurrentLevels, as that function takes the actual waveform data into account. + * This function simply gives a final volume based on 3d position and volume settings. + *

+ * @param channel Channel to get amplitude from + * @return On success, the following values are returned : 0 = silent to 255 = full volume. + * On failure, 0 is returned. To quailfy if this is a real error, call FSOUND_GetError. + */ + public static native int FSOUND_GetAmplitude(int channel); + + /** + * This updates the position and velocity of a 3d sound playing on a channel + *

+ * Remarks + * FSOUND treats +X as right, +Y as up, and +Z as forwards. + * --------- + * A 'distance unit' is specified by FSOUND_3D_SetDistanceFactor. By default this is set to meters which is a distance scale of 1.0. + * See FSOUND_3D_SetDistanceFactor for more on this. + * --------- + * FSOUND vectors expect 3 floats representing x y and z in that order. I.e. a typical definition + *

+ * @param channel Channel you want to apply 3d positioning to. + * @param pos Pointer to a position vector (xyz float triplet) of the emitter in world space, measured in distance units. + * This can be NULL to ignore it. + * @param vel Pointer to a velocity vector (xyz float triplet), of the emitter measured in distance units PER SECOND. + * This can be NULL to ignore it. + * @return On success, TRUE is returned. On failure, FALSE is returned. + */ + public static boolean FSOUND_3D_SetAttributes(int channel, FloatBuffer pos, FloatBuffer vel) { + return nFSOUND_3D_SetAttributes(channel, pos, (pos != null) ? pos.position() : 0, vel, (vel != null) ? vel.position() : 0); + } + private static native boolean nFSOUND_3D_SetAttributes(int channel, FloatBuffer pos, int posOffset, FloatBuffer vel, int velOffset); + + /** + * Sets the minimum and maximum audible distance for a channel. + * MinDistance is the minimum distance that the sound emitter will cease to continue growing + * louder at (as it approaches the listener). Within the mindistance it stays at the constant loudest volume possible. Outside of this mindistance it begins to attenuate. + * MaxDistance is the distance a sound stops attenuating at. Beyond this point it will stay at the volume it would be at maxdistance units from the listener and will not attenuate any more. + * MinDistance is useful to give the impression that the sound is loud or soft in 3d space. An example of this is a small quiet object, such as a bumblebee, which you could set a mindistance of to 0.1 for example, which would cause it to attenuate quickly and dissapear when only a few meters away from the listener. + * Another example is a jumbo jet, which you could set to a mindistance of 100.0, which would keep the sound volume at max until the listener was 100 meters away, then it would be hundreds of meters more before it would fade out. + * ------- + * In summary, increase the mindistance of a sound to make it 'louder' in a 3d world, and + * decrease it to make it 'quieter' in a 3d world. + * maxdistance is effectively obsolete unless you need the sound to stop fading out at a certain point. Do not adjust this from the default if you dont need to. + * Some people have the confusion that maxdistance is the point the sound will fade out to, this is not the case. + *

+ * Remarks + * FSOUND_ALL is supported. Passing this will set the min/max distance on ALL channels available. + * A 'distance unit' is specified by FSOUND_3D_SetDistanceFactor. By default this is set to meters which is a distance scale of 1.0. + * See FSOUND_3D_SetDistanceFactor for more on this. + * The default units for minimum and maximum distances are 1.0 and 1000000000.0f. + * Volume drops off at mindistance / distance. + * To define the min and max distance per sound and not per channel use FSOUND_Sample_SetMinMaxDistance. + *

+ * @param channel The channel to have its minimum and maximum distance set. + * @param min The channels minimum volume distance in "units". See remarks for more on units. + * @param max The channels maximum volume distance in "units". See remarks for more on units. + * @return On success, TRUE is returned. On failure, FALSE is returned. + */ + public static native boolean FSOUND_3D_SetMinMaxDistance(int channel, int min, int max); + + /** + * Sets the current position of the sound in SAMPLES not bytes + *

+ * Remarks + * FSOUND_ALL is supported. Passing this set the current position for the sound on ALL channels available. + * On XBOX, GameCube and Playstation 2 hardware voices using compressed data (ie XADPCM, VAG or GCADPCM), + * this value will not be sample accurate, but will be rounded to the nearest compression block size. + *

+ * @param channel The channel number/handle to have its offset or position set. + * @param offset The offset in SAMPLES from the start of the sound for the position to be set to. + * @return On success, TRUE is returned. On failure, FALSE is returned. + */ + public static native boolean FSOUND_SetCurrentPosition(int channel, int pos); + + /** + * Returns the current playcursor position of the specified channel + * @param channel Channel number/handle to get the current position from. + * @return On success, the play cursor position in SAMPLES is returned for the specified channel. + * On failure, 0 is returned. + */ + public static native int FSOUND_GetCurrentPosition(int channel); + + /** + * Returns the current sample being played on the specified channel + *

+ * Remarks + * Note that current sample does not return to NULL when a sound has ended. + *

+ * @param channel Channel number/handle to get the currently playing sample from. + * @return On success, TRUE is returned. On failure, FALSE is returned. + */ + public static FSoundSample FSOUND_GetCurrentSample(int channel) { + long result = nFSOUND_GetCurrentSample(channel); + if(result != 0) { + return new FSoundSample(result); + } + return null; + } + private static native long nFSOUND_GetCurrentSample(int channel); + + /** + * Returns a left and right VU/Level reading at the current position of the specified channel. + * Levels are are only supported for software channels. + *

+ * Remarks + * By default this function is only point sampled and not latency adjusted (it will appear to trigger ahead of when you hear the sound). + * To fix this and get a 'perfect' set of levels in realtime, use FSOUND_INIT_ACCURATEVULEVELS with FSOUND_Init. + * ------------------- + * To get an overall VU reading for all sounds, add all VU values for each channel together, and then clip at 1.0. + * Another (harder) way is to write a dsp unit that reads from the mixbuffer being passed into it. + * Note: A true 'VU' should be smoothed, but in case people were after more accuracy than a smoothed value, it was decided to return the raw amplitude, and let the user smooth the result in their own way. + *

+ * @param channel Channel number/handle to retrieve left and right level from. + * @param l_r FloatBuffer to store left and right level, each between 0 and 1. + * @return On success, TRUE is returned. On failure, FALSE is returned. + */ + public static boolean FSOUND_GetCurrentLevels(int channel, FloatBuffer l_r) { + return nFSOUND_GetCurrentLevels(channel, l_r, l_r.position()); + } + private static native boolean nFSOUND_GetCurrentLevels(int channel, FloatBuffer l_r, int l_rOffset); + + /** + * Returns the frequency in HZ of the specified channel + * @param channel The number/handle to get the frequency from. + * @return On success, the frequency in HZ of the specified channel is returned. + * On failure, 0 is returned. To quailfy if this is a real error, call FSOUND_GetError. + */ + public static native int FSOUND_GetFrequency(int channel); + + /** + * Gets the loop mode for a particular channel + *

+ * Remarks + * This works for all channel types, whereas setting it will not work. + *

+ * @param The channel number/handle to get the loop mode from. + * @return On success, the loop mode is returned. On failure, 0 is returned. + */ + public static native int FSOUND_GetLoopMode(int channel); + + /** + * Returns the currently used mixer type + * @return FSOUND_GetMixer returns a defenition from FSOUND_MIXERTYPES. See FSOUND_MIXERTYPES for valid parameters and descriptions. + */ + public static native int FSOUND_GetMixer(); + + /** + * Returns if the channel specified is muted or not + * @param channel The channel number/handle to get the mute status from + * @return TRUE - The channel has mute turned ON. FALSE - The channel has mute turned OFF + */ + public static native boolean FSOUND_GetMute(int channel); + + /** + * This function returns the number of sub-channels stored in a multi-channel channel handle, which is only possible when playing back a multichannel .FSB file. + *

+ * Remarks + * A multichannel sound, only possible with the .FSB format, can contain multiple subchannels. When a multichannel sound is played, multiple channels are allocated at the same time. + * For example, a 8 sounds/streams can be interleaved into a multichannel FSB. This function would return 8, as 8 real hardware/software voices are used during playback. + * FSOUND_GetSubChannel can be used to get access to the secondary channels. + *

+ * @param channel The value returned by FSOUND_Stream_Play, FSOUND_Stream_PlayEx, FSOUND_PlaySound, FSOUND_PlaySoundEx. + * @return On success, the number of subchannels is returned. On failure, 0 is returned. + */ + public static native int FSOUND_GetNumSubChannels(int channel); + + /** + * Returns the linear pan position of the specified channel between 0 and 255 + * @param channel The channel number/handle to get the pan from. + * @return On success, the following values are returned : 0 = full left to 128 = middle to 255 = full right, FSOUND_STEREOPAN + * On failure, 0 is returned. To quailfy if this is a real error, call FSOUND_GetError. + */ + public static native int FSOUND_GetPan(int channel); + + /** + * Gets current pause status of the channel + *

+ * Remarks + * This function is useful for games that have a pause mode, and you dont want the sounds + * to continue playing, but you would like them to continue on from where they left off + * when you unpause. + *

+ * @param channel The channel number/handle to get the paused status from. + * @return TRUE - The channel is currently paused. + * FALSE - The channel is running. + */ + public static native boolean FSOUND_GetPaused(int channel); + + /** + * Gets a sound channels priority. Priority is used to determine if soundeffects should + * replace other sound effects when the channel limit has been reached. See + * FSOUND_SetPriority for more information. + * @param channel The channel number/handle to get the priority from. + * @return On success, the priority of the channel is returned. Ranges between 0 and 255. + * On failure, 0 is returned. To quailfy if this is a real error, call FSOUND_GetError. + */ + public static native int FSOUND_GetPriority(int channel); + + /** + * Gets a sound channels reserved status. priority is used to determine if soundeffects should muscle + * out other sound effects when the channel limit has been reached. + * @param channel The channel number/handle to get the reserved status from. + * @return TRUE Channel is reserved and cannot be selected. + * FALSE Channel is reserved and can be selected. + */ + public static native int FSOUND_GetReserved(int channel); + + /** + * This function returns a channel handle from a subchannel within a multichannel FSB file, so that it can be maniuplated seperately, instead of controlling the whole multichannel array with the parent channel that the user retrieves from FSOUND_PlaySound etc. + *

+ * Remarks + * A multichannel sound, only possible with the .FSB format, can contain multiple subchannels. When a multichannel sound is played, multiple channels are allocated at the same time. + * Normally you can just use the parent handle, and things like FSOUND_SetVolume will affect all subchannels at the same time. With this function, you can get access to the raw subchannels to allow manipulation of each voice seperately within the multichannel array. + * For example, a 8 sounds/streams can be interleaved into a multichannel FSB. If you specified a subchannel of 7, it would return a channel handle to the last channel in the multichannel array. + * A subchannel index of 0 is the parent channel, and the same as the voice passed in is a parameter. + * The number of subchannels within a multichannel voice can be determined with FSOUND_GetNumSubChannels. + *

+ * + * @param channel The value returned by FSOUND_Stream_Play, FSOUND_Stream_PlayEx, FSOUND_PlaySound, FSOUND_PlaySoundEx. + * @param subchannel Offset from the parent channel into the multichannel array. + * @return On success, a raw channel handle is returned. On failure, -1 is returned. + */ + public static native int FSOUND_GetSubChannel(int channel, int subchannel); + + /** + * Returns the surround sound status of the specified channel. + *

+ * Remarks + * Surround sound only works on software channels. + *

+ * @param channel The channel number/handle to get the surround sound status from + * @return On success, TRUE is returned meaning the channel has surround sound turned ON + * On failure, FALSE is returned meaning the channel has surround sound turned OFF + */ + public static native int FSOUND_GetSurround(int channel); + + /** + * Returns if the channel is currently playing or not. + * @param channel Channel number/handle to get the playing status from. + * @return TRUE channel is currently active and playing. FALSE channel is currently idle. + */ + public static native boolean FSOUND_IsPlaying(int channel); + + /** + *

+ * Remarks + * A 'distance unit' is specified by FSOUND_3D_SetDistanceFactor. By default this is set to meters which is a distance scale of 1.0. + * See FSOUND_3D_SetDistanceFactor for more on this. + *

+ * + * @param channel Channel you want to get 3d information from + * @param pos Pointer to a position vector (xyz float triplet) of the emitter in world space, measured in distance units. + * This can be NULL to ignore it. + * @param vel Pointer to a velocity vector (xyz float triplet), of the emitter measured in distance units PER SECOND. + * This can be NULL to ignore it. + * @return On success, TRUE is returned. On failure, FALSE is returned. + */ + public static boolean FSOUND_3D_GetAttributes(int channel, FloatBuffer pos, FloatBuffer vel) { + return nFSOUND_3D_GetAttributes(channel, pos, (pos != null) ? pos.position() : 0, vel, (vel != null) ? vel.position() : 0); + } + private static native boolean nFSOUND_3D_GetAttributes(int channel, FloatBuffer pos, int posOffset, FloatBuffer vel, int velOffset); + + /** + * Returns the current min and max distance for a channel + * + * @param channel Channel number/handle to retrieve min and max distance from. + * @param min_max_dist FloatBuffer to store min/max -distance. + * @return On success, TRUE is returned. On failure, FALSE is returned. + */ + public static boolean FSOUND_3D_GetMinMaxDistance(int channel, FloatBuffer minmax) { + return nFSOUND_3D_GetMinMaxDistance(channel, minmax, (minmax != null) ? minmax.position() : 0); + } + private static native boolean nFSOUND_3D_GetMinMaxDistance(int channel, FloatBuffer minmax, int minmaxOffset); + // ---------------------------------------------------------- + + // 3D sound functions + // ========================================================== + /** + * This retreives the position, velocity and orientation of a 3d sound listener + *

+ * Remarks + * FSOUND treats +X as right, +Y as up, and +Z as forwards. (left handed) + * To map to your own coordinate system, flip and exchange these values. For example if you wanted to use right handed coordinates, you would negate the Z value of your own direction vector. + * Orientation vectors are expected to be of UNIT length. This means the magnitude of the vector should be 1.0f. + * --------- + * A 'distance unit' is specified by FSOUND_3D_SetDistanceFactor. By default this is set to meters which is a distance scale of 1.0. + * See FSOUND_3D_SetDistanceFactor for more on this. + * --------- + * Please remember to use units PER SECOND, NOT PER FRAME as this is a common mistake. + * Do not just use (pos - lastpos) from the last frame's data for velocity, as this is not correct. + * You need to time compensate it so it is given in units per SECOND. + * You could alter your pos - lastpos calculation to something like this. + * vel = (pos-lastpos) / (time taken since last frame in seconds). + * I.e. at 60fps the formula would look like this + * vel = (pos-lastpos) / 0.0166667. + *

+ * + * @param pos Pointer to a position vector (xyz float triplet), of the listener in world space, + * measured in distance units. + * This can be NULL to ignore it. + * @param vel Pointer to a velocity vector (xyz float triplet), of the listener measured in + * distance units PER SECOND. + * This can be NULL to ignore it. + * @param fx pointer to x component of a FORWARD unit length orientation vector + * This can be NULL to ignore it. + * @param fy pointer to y component of a FORWARD unit length orientation vector + * This can be NULL to ignore it. + * @param fz pointer to z component of a FORWARD unit length orientation vector + * This can be NULL to ignore it. + * @param tx pointer to x component of a TOP or upwards facing unit length orientation vector + * This can be NULL to ignore it. + * @param ty pointer to y component of a TOP or upwards facing unit length orientation vector + * This can be NULL to ignore it. + * @param tz pointer to z component of a TOP or upwards facing unit length orientation vector + * This can be NULL to ignore it. + */ + public static void FSOUND_3D_Listener_GetAttributes( + FloatBuffer pos, FloatBuffer vel, FloatBuffer fx, FloatBuffer fy, FloatBuffer fz, + FloatBuffer tx, FloatBuffer ty, FloatBuffer tz) { + nFSOUND_3D_Listener_GetAttributes( + pos, (pos != null) ? pos.position() : 0, + vel, (vel != null) ? vel.position() : 0, + fx, (fx != null) ? fx.position() : 0, + fy, (fy != null) ? fy.position() : 0, + fz, (fz != null) ? fz.position() : 0, + tx, (tx != null) ? tx.position() : 0, + ty, (ty != null) ? ty.position() : 0, + tz, (tz != null) ? tz.position() : 0); + } + private static native void nFSOUND_3D_Listener_GetAttributes( + FloatBuffer pos, int posOffset, FloatBuffer vel, int velOffset, + FloatBuffer fx, int fxOffset, FloatBuffer fy, int fyOffset, FloatBuffer fz, int fzOffset, + FloatBuffer tx, int txOffset, FloatBuffer ty, int tyOffset, FloatBuffer tz, int tzOffset); + + /** + * This updates the position, velocity and orientation of a 3d sound listener + *

+ * Remarks + * FSOUND treats +X as right, +Y as up, and +Z as forwards. (left handed) + * To map to your own coordinate system, flip and exchange these values. For example if you wanted to use + * right handed coordinates, you would negate the Z value of your own direction vector. + * Orientation vectors are expected to be of UNIT length. This means the magnitude of the vector + * should be 1.0f. + * --------- + * A 'distance unit' is specified by FSOUND_3D_SetDistanceFactor. By default this is set to meters which is a distance scale of 1.0. + * See FSOUND_3D_SetDistanceFactor for more on this. + * --------- + * Please remember to use units PER SECOND, NOT PER FRAME as this is a common mistake. + * Do not just use (pos - lastpos) from the last frame's data for velocity, as this is not + * correct. You need to time compensate it so it is given in units per SECOND. + * You could alter your pos - lastpos calculation to something like this. + * vel = (pos-lastpos) / (time taken since last frame in seconds). Ie at 60fps the formula + * would look like this vel = (pos-lastpos) / 0.0166667. + *

+ * + * @param pos Pointer to a position vector (xyz float triplet), of the listener in world space, measured in distance units. + * This can be NULL to ignore it. + * @param vel Pointer to a velocity vector (xyz float triplet), of the listener measured in distance units PER SECOND. + * This can be NULL to ignore it. + * @param fx x component of a FORWARD unit length orientation vector + * @param fy y component of a FORWARD unit length orientation vector + * @param fz z component of a FORWARD unit length orientation vector + * @param tx x component of a TOP or upwards facing unit length orientation vector + * @param ty y component of a TOP or upwards facing unit length orientation vector + * @param tz z component of a TOP or upwards facing unit length orientation vector + */ + public static void FSOUND_3D_Listener_SetAttributes( + FloatBuffer pos, FloatBuffer vel, + float fx, float fy, float fz, float tx, float ty, float tz) { + + nFSOUND_3D_Listener_SetAttributes( + pos, (pos != null) ? pos.position() : 0, + vel, (vel != null) ? vel.position() : 0, + fx, fy, fz, tx, ty, tz); + } + private static native void nFSOUND_3D_Listener_SetAttributes( + FloatBuffer pos, int posOffset, FloatBuffer vel, int velOffset, + float fx, float fy, float fz, float tx, float ty, float tz); + + /** + * Sets the current listener number and number of listeners, if the user wants to simulate multiple listeners at once. + * This is usually for the case in a game where there is a splitscreen and multiple players playing the game at once + *

+ * Remarks + * Only affects FSOUND_3D_Listener_SetAttributes and FSOUND_3D_Listener_GetAttributes. + * Setting more than 1 listener will turn off doppler and cause all panning to be ignored and 3d sound will come from the center (mono). + * ------------- + * For WIN32 FSOUND_HW3D based sounds, channels must have their attributes set after this function is called, otherwise unexpected audible results may occur. + * For example you cannot update your channels with FSOUND_3D_SetAttributes, call FSOUND_3D_Listener_SetCurrent, and then call FSOUND_Update and expect all the voices to update correctly. + * The correct order is to call FSOUND_3D_Listener_SetCurrent first, then update all channels with FSOUND_3D_SetAttributes, then call FSOUND_Update. + * This is due to DirectSound not supporting multiple listeners, so FMOD has to do inverse transforms on the positions to simulate it with one listener, at the time FSOUND_3D_SetAttributes is called. + *

+ * + * @param current Current listener number. Listener commands following this function call will affect this listener number. (default: 0) + * @param numlisteners Number of listeners active. (default: 1) + */ + public static native void FSOUND_3D_Listener_SetCurrent(int current, int numlisteners); + + /** + * Sets FMOD's 3d engine relative distance factor, compared to 1.0 meters. It equates to + * 'how many units per meter' does your engine have + *

+ * Remarks + * By default this value is set at 1.0, or meters + *

+ * + * @param scale 1.0 = 1 meter units. If you are using feet then scale would equal 3.28. + */ + public static native void FSOUND_3D_SetDistanceFactor(float scale); + + /** + * Sets the doppler shift scale factor. + *

+ * Remarks + * This is a general scaling factor for how much the pitch varies due to doppler shifting. + * Increasing the value above 1.0 exaggerates the effect, whereas lowering it reduces the effect. + * 0 removes the effect all together. + * FMOD's speed of sound at a DopplerFactor of 1.0 is 340 m/s. + *

+ * + * @param scale Doppler shift scale. Default value for FSOUND is 1.0f + */ + public static native void FSOUND_3D_SetDopplerFactor(float scale); + + /** + * Sets the global attenuation rolloff factor. + * Normally volume for a sample will scale at 1 / distance. This gives a logarithmic attenuation of volume as the source gets further away (or closer). + * Setting this value makes the sound drop off faster or slower. The higher the value, the faster volume will fall off. + * The lower the value, the slower it will fall off. + * For example a rolloff factor of 1 will simulate the real world, where as a value of 2 will make sounds attenuate 2 times quicker + *

+ * Remarks + * --------- + * A 'distance unit' is specified by FSOUND_3D_SetDistanceFactor. + * By default this is set to meters which is a distance scale of 1.0. + * See FSOUND_3D_SetDistanceFactor for more on this. + * --------- + * The default rolloff factor is 1.0. + *

+ * + * @param rolloff The rolloff factor to set for this sample. Valid ranges are 0 to 10. + */ + public static native void FSOUND_3D_SetRolloffFactor(float rolloff); + // ---------------------------------------------------------- + + // Stream functions + // ========================================================== + /** + * Opens an audio file/url/cd ready for streaming. + * This opens the file in preparation for playback in real-time, without needing to decode the whole file into memory first + *

+ * Remarks + * WAV support supports windows codec compressed WAV files. + * -------------- + * FSOUND_MPEGACCURATE is to be used cautiously. To open a file with this mode turned on, it has to scan the whole MP3 first. This can take several seconds if the file is big, or the harddisk/cpu is slow. + * A way to speed up this process would be to load the compressed mp3 into memory first, and use the FSOUND_LOADMEMORY flag with this function. + * -------------- + * NOTE : Internet stream limitations + * - URLs must start with "http://". + * - The only supported formats for HTTP streams are MP3 (must have .mp3 extension) and OggVorbis (must have .ogg extension). + * -------------- + * FSB streaming is not supported if the format from FSBank is 'Retain original format'. On PC platforms, only PCM and ADPCM FSB files are allowed. + * -------------- + * Note, on PlayStation 2 you cannot use FSOUND_LOADMEMORY, you may use FSOUND_LOADMEMORYIOP though. + * -------------- + * When opening with the FSOUND_NONBLOCKING flag, this function always succeeds at the point of being called. + * It will always return a valid channel handle, even though the file might fail to open. To determine any error in non blocking mode use FSOUND_Stream_GetOpenState. + * -------------- + * NOTE: CDDA Streaming (Win32 only!) + * To open a CD for CDDA streaming, specify the drive letter of a CD drive e.g. FSOUND_Stream_Open("d:", 0, 0, 0); FSOUND_Stream_Open will create a stream with multiple substreams, one for each CD track. Use FSOUND_Stream_SetSubStream to select which CD track to play. + * A number of options can be passed to FSOUND_Stream_Open along with the drive letter. They are : + * ? e.g. FSOUND_Stream_Open("d:*?", 0, 0, 0); This option will cause a tag field called "CD_DEVICE_INFO" to be attached to the stream. This tag field contains information on the specified CD device. + * ! e.g. FSOUND_Stream_Open("d:*!", 0, 0, 0); This option will cause the stream to be opened in "quick open" mode. When a stream is opened in this mode, calls to FSOUND_Stream_SetSubStream will return immediately making it quick to select each substream in turn and get the length of each CD track. Note that a stream in quick open mode cannot be played! Use quick open mode to get track lengths and then re-open the stream without quick open mode to actually play it. + * j e.g. FSOUND_Stream_Open("d:*j", 0, 0, 0); This option turns jitter correction OFF. + * Options can be combined like so: FSOUND_Stream_Open("d:*?!j", 0, 0, 0); + * If a nonblocking CDDA stream fails to open, a tag field called "CD_ERROR" will be attached to the stream. This tag field contains a textual description of why the stream failed to open. + * NOTE: FMOD will always try to use native NTSCSI support to communicate with CD devices before trying to use ASPI. If FMOD is using ASPI then it can only access the first CD device it finds. + *

+ * + * @param name_or_data Name of the file to open, or pointer to data if FSOUND_LOADMEMORY is used. + * @param mode Simple description of how to play the file. For all formats except raw PCM, + * FSOUND_LOOP*, FSOUND_HW3D, FSOUND_HW2D, FSOUND_2D, FSOUND_LOADMEMORY, FSOUND_LOADRAW, FSOUND_MPEGACCURATE, FSOUND_NONBLOCKING flags are the only ones supported. + * @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. length must also be specified if this value is used. + * @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. + * @return On success, a reference to an opened stream is returned. On failure, NULL is returned. + */ + public static FSoundStream FSOUND_Stream_Open(String name, int mode, int offset, int length) { + long result = nFSOUND_Stream_Open(name, mode, offset, length); + if(result != 0) { + return new FSoundStream(result); + } + return null; + } + public static FSoundStream FSOUND_Stream_Open(ByteBuffer data, int mode, int offset, int length) { + long result = nFSOUND_Stream_Open(data, data.position(), mode, offset, length); + if(result != 0) { + return new FSoundStream(result); + } + return null; + } + private static native long nFSOUND_Stream_Open(ByteBuffer data, int dataOffset, int mode, int offset, int length); + private static native long nFSOUND_Stream_Open(String name, int mode, int offset, int length); + + /** + * Starts a pre-opened stream playing + *

+ * Remarks + * When a stream starts to play, it inherits a special high priority (256). + * It cannot be rejected by other sound effect channels in the normal fashion as the user can never set a priority above 255 normally. + * -------------- + * If the stream has been opened with FSOUND_NONBLOCKING, this function will not succeed until the stream is ready. + * -------------- + * FSB streaming is not supported if the format from FSBank is 'Retain original format'. On PC platforms, only PCM and ADPCM FSB files are allowed. + * -------------- + * FSOUND_STEREOPAN is recommended for stereo streams if you call FSOUND_SetPan. This puts the left and right channel to full volume. + * Otherwise a normal pan will give half volume for left and right. See FSOUND_SetPan for more information on this. + * -------------- + * You can use normal channel based commands (such as FSOUND_SetVolume etc) on the return handle, as it is a channel handle. + *

+ * + * @param channel 0+ The channel index in the channel pool. This must not exceed the maximum number of channels allocated with FSOUND_Init + * FSOUND_FREE + * Chooses a free channel to play in. If all channels are used then it + * selects a channel with a sample playing that has a lower priority than the + * sample to be played. + * @param stream FSoundStream to be played. + * @return On success, the channel handle the stream is playing in is returned. On failure, -1 is returned. + */ + public static int FSOUND_Stream_Play(int channel, FSoundStream stream) { + return nFSOUND_Stream_Play(channel, stream.streamHandle); + } + private static native int nFSOUND_Stream_Play(int channel, long streamhandle); + + /** + * Stops a stream from playing + *

+ * Remarks + * The stream is still prepared and sitting in memory ready to go. Use FSOUND_Stream_Close on the stream to completely remove it. + * If the stream has been opened with FSOUND_NONBLOCKING, this function will not succeed until the stream is ready + *

+ * + * @param stream FSoundStream to be stopped + * @return On success, TRUE is returned. On failure, FALSE is returned. + */ + public static boolean FSOUND_Stream_Stop(FSoundStream stream) { + return nFSOUND_Stream_Stop(stream.streamHandle); + } + private static native boolean nFSOUND_Stream_Stop(long streamhandle); + + /** + * Shuts down and releases an FSOUND stream + *

+ * Remarks + * If the stream has been opened with FSOUND_NONBLOCKING, this function will not succeed until the stream is ready. + * The only exception to this rule is for internet streams - this function will successfully close an internet stream that has been opened with FSOUND_NONBLOCKING before that stream is ready. + *

+ * + * @param stream FSoundStream to be closed + * @return On success, TRUE is returned. On failure, FALSE is returned. + */ + public static boolean FSOUND_Stream_Close(FSoundStream stream) { + return nFSOUND_Stream_Close(stream.streamHandle); + } + private static native boolean nFSOUND_Stream_Close(long streamhandle); + + /** + * Returns the number of substreams inside a multi-stream FSB bank file + * + * @param stream FSoundStream to get substream count from + * @return On success, the number of FSB substreams is returned. On failure, 0 is returned. + */ + public static int FSOUND_Stream_GetNumSubStreams(FSoundStream stream) { + return nFSOUND_Stream_GetNumSubStreams(stream.streamHandle); + } + private static native int nFSOUND_Stream_GetNumSubStreams(long streamhandle); + + /** + * Seeks a stream to the substream inside a multi-stream FSB bank file, specified by its index + *

+ * Remarks + * A stream will stop if this function is called, as it needs to seek and flush the buffer. + * Indicies for this function are generated as user friendly constants when compiling the FSB bank, and are available in the relevant generated header file. + * -------------- + * If the stream has been opened with FSOUND_NONBLOCKING, this function will ALWAYS succeed, but puts the stream back into a non-ready state. You then have to poll after calling this to make sure the stream is ready. + * You can either do this by calling FSOUND_Stream_Play repeatedly/once a frame until it is succeeds, or FSOUND_Stream_GetOpenState. + *

+ * @param stream to have its position set + * @param index The index of the stream within the FSB file + * @return On success, TRUE is returned. On failure, FALSE is returned + */ + public static int FSOUND_Stream_SetSubStream(FSoundStream stream, int index) { + return nFSOUND_Stream_SetSubStream(stream.streamHandle, index); + } + private static native int nFSOUND_Stream_SetSubStream(long streamhandle, int index); + + /** + * Adds a user synchronization callback point into a stream + *

+ * Remarks + * If the stream has been opened with FSOUND_NONBLOCKING, this function will not succeed until the stream is ready + *

+ * @param stream The stream to add a sync point to. + * @param pcmoffset Offset in SAMPLES (not bytes). + * @param name The name of the syncpoint, which will be passed into the sync callback when it is triggered. + * @return On success, a sync point handle is returned. On failure, NULL is returned. + */ + public static FSoundSyncPoint FSOUND_Stream_AddSyncPoint(FSoundStream stream, int pcmoffset, String name) { + long result = nFSOUND_Stream_AddSyncPoint(stream.streamHandle, pcmoffset, name); + if(result != 0) { + return new FSoundSyncPoint(result); + } + return null; + } + private static native long nFSOUND_Stream_AddSyncPoint(long streamhandle, int pcmoffset, String name); + + /** + * Creates a user definable stream file ready for playing. The stream is serviced through a callback + *

+ * Remarks + * This method only supports SIGNED RAW streams to be written to the buffer supplied by the callback. + * They can be 8 or 16 bit, mono or stereo. + * 'lenbytes' may be rounded down to the nearest sample alignment in bytes. Ie if you specified 1001 bytes for a 16bit stereo sample stream, len would return 1000 in the callback. (250 samples * 4 bytes per sample) + * PlayStation 2 IMPORTANT! : if FSOUND_SendData is NOT called from the stream callback the IOP will hang because it is waiting for this command to be executed before it can unlock its buffer. + *

+ * @param stream The stream to add a sync point to. + * @param pcmoffset Offset in SAMPLES (not bytes). + * @param name The name of the syncpoint, which will be passed into the sync callback when it is triggered. + * @return On success, a sync point handle is returned. On failure, NULL is returned. + */ + public static FSoundStream FSOUND_Stream_Create(FSoundStreamCallback callbackHandler, int lenbytes, int mode, int samplerate) { + FSoundStream stream = null; + long result = nFSOUND_Stream_Create(lenbytes, mode, samplerate); + if(result != 0) { + stream = new FSoundStream(result); + FMOD.registerCallback(FMOD.FSOUND_STREAMCALLBACK, stream.streamHandle, stream, callbackHandler); + } + return stream; + } + private static native long nFSOUND_Stream_Create(int lenbytes, int mode, int samplerate); + + /** + * Allows the user to add a custom DSP unit to a stream + *

+ * Remarks + * The priority for a stream DSP unit is not related to the priorities specified in fmod.h. + * The priorities are anything fom 0 onwards, and ALWAYS come after data is read/decoded for the stream *

+ * + * @param stream The stream to have a DSP attached to. + * @param callback A standard FSoundDSPCallback callback + * @param priority The priority, or position within the streams DSP chain to place the unit. + * @return On success, a handle to the FSoundDSPUnit is returned. All DSP functions are performable on this. On failure, null is returned + */ + public static FSoundDSPUnit FSOUND_Stream_CreateDSP(FSoundStream stream, FSoundDSPCallback callback, int priority) { + FSoundDSPUnit unit = null; + long result = nFSOUND_Stream_CreateDSP(stream.streamHandle, priority); + if(result != 0) { + unit = new FSoundDSPUnit(result); + FMOD.registerCallback(FMOD.FSOUND_DSPCALLBACK, unit.dspHandle, unit, callback); + } + return unit; + } + private static native long nFSOUND_Stream_CreateDSP(long streamHandle, int priority); + + /** + * Removes a user synchronization callback point from a stream. + * + * @param point The sync point to remove + * @return On success, TRUE is returned. On failure, FALSE is returned + */ + public static boolean FSOUND_Stream_DeleteSyncPoint(FSoundSyncPoint point) { + return nFSOUND_Stream_DeleteSyncPoint(point.syncpointHandle); + } + private static native boolean nFSOUND_Stream_DeleteSyncPoint(long syncpointHandle); + + /** + * Find a tag field associated with an open stream by name and type + * + * @param stream The stream to get the tag field from. + * @param field FSoundTagField to find (using type, name) + * @return On success, TRUE is returned. On failure, FALSE is returned + */ + public static boolean FSOUND_Stream_FindTagField(FSoundStream stream, FSoundTagField field) { + return nFSOUND_Stream_FindTagField(stream.streamHandle, field.type, field.name, field); + } + private static native boolean nFSOUND_Stream_FindTagField(long streamHandle, int type, String name, FSoundTagField field); + + /** + * Returns the size of the stream in BYTES + *

+ * Remarks + * Position functions for streams work in bytes not samples. + * ----- + * This function is not supported for URL based streams over the internet. + *

+ * @param stream The stream to have its length returned + * @return On success, the size of the stream in BYTES is returned. On failure, 0 is returned. + */ + public static boolean FSOUND_Stream_GetLength(FSoundStream stream) { + return nFSOUND_Stream_GetLength(stream.streamHandle); + } + private static native boolean nFSOUND_Stream_GetLength(long streamHandle); + + /** + * Returns the size of the stream in MILLISECONDS + *

+ * Remarks + * FSOUND_MPEGACCURATE will need to be used with mp3 files that use VBR encoding for more accuracy + *

+ * @param stream The stream to have its its total duration returned. + * @return On success, the size of the stream in MILLISECONDS is returned. On failure, 0 is returned. + */ + public static boolean FSOUND_Stream_GetLengthMs(FSoundStream stream) { + return nFSOUND_Stream_GetLengthMs(stream.streamHandle); + } + private static native boolean nFSOUND_Stream_GetLengthMs(long streamHandle); + + /** + * Retrieves the mode of the stream + *

+ * Remarks + * If the stream has been opened with FSOUND_NONBLOCKING, this function will not succeed until the stream is ready. + *

+ * @param stream The stream to get the mode from + * @return mode of stream + */ + public static int FSOUND_Stream_GetMode(FSoundStream stream) { + return nFSOUND_Stream_GetMode(stream.streamHandle); + } + private static native int nFSOUND_Stream_GetMode(long streamHandle); + + /** + * Returns the number of substreams inside a multi-stream FSB bank file + * + * @param stream stream to query + * @return On success, the number of FSB substreams is returned. On failure, 0 is returned + */ + public static int nFSOUND_Stream_GetNumSyncPoints(FSoundStream stream) { + return nFSOUND_Stream_GetNumSyncPoints(stream.streamHandle); + } + private static native int nFSOUND_Stream_GetNumSyncPoints(long streamHandle); + + /** + * Get the number of tag fields associated with the specified stream + * + * @param stream stream to query + * @param num IntBuffer that will receive the nubmer of tag fields associated with the specified stream. + * @return On success, TRUE is returned. On failure, FALSE is returned. + */ + public static boolean FSOUND_Stream_GetNumTagFields(FSoundStream stream, IntBuffer num) { + return nFSOUND_Stream_GetNumTagFields(stream.streamHandle, num, num.position()); + } + private static native boolean nFSOUND_Stream_GetNumTagFields(long streamHandle, IntBuffer buffer, int offset); + + /** + * If a stream is opened with FSOUND_NONBLOCKING, this function returns the state of the opening stream + *

+ * Remarks + * A blocking stream will return NULL from FSOUND_Stream_Open so a return value of -3 is redundant in this case. + * A blocking stream will always return 0 if it is not NULL. + *

+ * @param stream to get the open state from. + * @return 0 = stream is opened and ready. + * -1 = stream handle passed in is invalid. + * -2 = stream is still opening or performing a SetSubStream command. + * -3 = stream failed to open. (file not found, out of memory or other error). + * -4 = connecting to remote host (internet streams only) + * -5 = stream is buffering data (internet streams only) + */ + public static int FSOUND_Stream_GetOpenState(FSoundStream stream) { + return nFSOUND_Stream_GetOpenState(stream.streamHandle); + } + private static native int nFSOUND_Stream_GetOpenState(long streamHandle); + + /** + * Returns the current FILE position of the stream of the stream in BYTES + *

+ * Remarks + * Position functions for streams work in bytes not samples. + * Position information is also based on the current file position, not the actual playing + * position, so if the stream is only updated every 100ms, then the position will only be + * updated every 100ms. + * ----- + * This function is not supported for URL based streams over the internet or CDDA streams + *

+ * @param stream to have its position returned + * @return On success, the current stream's position in BYTES is returned. On failure, 0 is returned. + */ + public static int FSOUND_Stream_GetPosition(FSoundStream stream) { + return nFSOUND_Stream_GetPosition(stream.streamHandle); + } + private static native int nFSOUND_Stream_GetPosition(long streamHandle); + + /** + * Returns the FSOUND_SAMPLE definition that the stream uses internally. + * You can use this to get a variety of information like the songs name, default speed and more. + * @param stream to have its internal sample pointer returned. + * @return On success, a handle to the FSOUND_SAMPLE definition is returned. On failure, 0 is returned + */ + public static FSoundSample FSOUND_Stream_GetSample(FSoundStream stream) { + long result = nFSOUND_Stream_GetSample(stream.streamHandle); + if(result != 0) { + return new FSoundSample(result); + } + return null; + } + private static native long nFSOUND_Stream_GetSample(long streamHandle); + + /** + * Obtains a sync point by index. This is useful when you havent created your own, ie it came from a wav file + *

+ * Remarks + * Points are loaded in order of offset, so the index will represent the smallest point to the largest. *

+ * @param stream to have its position returned + * @param index The sync point offset into the stream + * @return On success, a handle to a sync point is returned. On failure, NULL is returned. + */ + public static FSoundSyncPoint FSOUND_Stream_GetSyncPoint(FSoundStream stream, int index) { + long result = nFSOUND_Stream_GetSyncPoint(stream.streamHandle, index); + if(result != 0) { + return new FSoundSyncPoint(result); + } + return null; + } + private static native long nFSOUND_Stream_GetSyncPoint(long streamHandle, int index); + + /** + * Retrieves the name and pcm offset in samples for a specified sync point + *

+ * Remarks + * Convert samples to time by dividing the PCM value by the default samplerate. This would give you the value in seconds. Multiply by 1000 to get milliseconds. + * @param point handle to the sync point to retrieve information from + * @param pcmoffset An IntBuffer that will receive the sync point offset in pcm SAMPLES. A value of NULL will be ignored + * @return On success, the name of the syncpoint is returned as a string. On failure, NULL is returned. + */ + public static String FSOUND_Stream_GetSyncPointInfo(FSoundSyncPoint point, IntBuffer pcmoffset) { + return nFSOUND_Stream_GetSyncPointInfo(point.syncpointHandle, pcmoffset, (pcmoffset != null) ? pcmoffset.position() : 0); + } + private static native String nFSOUND_Stream_GetSyncPointInfo(long pointHandle, IntBuffer pcmoffset, int bufferOffset); + + /** + * Get a tag field associated with an open stream + *

+ * Remarks + * Do not attempt to modify or free any pointers returned by this function. + * If this function returns successfully, "value" will contain a pointer to a piece of tag-field-specific data - do not assume it will always point to a null-terminated ASCII string. + * @param point handle to the sync point to retrieve information from + * @param pcmoffset An IntBuffer that will receive the sync point offset in pcm SAMPLES. A value of NULL will be ignored + * @return On success, TRUE is returned. On failure, FALSE is returned. + */ + public static boolean FSOUND_Stream_GetTagField(FSoundStream stream, int num, FSoundTagField field) { + return nFSOUND_Stream_GetTagField(stream.streamHandle, num, field); + } + private static native boolean nFSOUND_Stream_GetTagField(long streamHandle, int num, FSoundTagField field); + + /** + * Returns the current time offset in stream in milliseconds. + *

+ * Remarks + * FSOUND_MPEGACCURATE will need to be used with mp3 files that use VBR encoding for more accuracy + *

+ * @param stream to get the currently playing time offset + * @return On success, the current stream's position in milliseconds is returned. On failure, 0 is returned. + */ + public static int FSOUND_Stream_GetTime(FSoundStream stream) { + return nFSOUND_Stream_GetTime(stream.streamHandle); + } + private static native int nFSOUND_Stream_GetTime(long streamHandle); + + /** + * Gets buffer size and thresholds that will be used when opening new internet streams + *

+ * Remarks + * This function returns the values that will be used for subsequent internet stream opens. Internet streams that already exist may have different values. + *

+ * @param values IntBuffer to hold 3 int values: + * buffersize size in bytes of the streaming buffer. + * prebuffer_percent how much to prebuffer when a stream is first opened. Values are expressed as a percentage from 1 to 99. + * rebuffer_percent how much to rebuffer after a stream has suffered a buffer underrun. Values are expressed as a percentage from 1 to 99. + * @return On success, TRUE is returned. On failure, FALSE is returned. + + */ + public static boolean FSOUND_Stream_Net_GetBufferProperties(IntBuffer values) { + return nFSOUND_Stream_Net_GetBufferProperties(values, values.position()); + } + private static native boolean nFSOUND_Stream_Net_GetBufferProperties(IntBuffer values, int offset); + + /** + * This function returns a String representing the last HTTP status line that was received when connecting to an internet stream + *

+ * Remarks + * The result of this function should be used for informational purposes only. + * This function provides no facility to discover which internet stream the last HTTP status pertains to when there are multiple internet streams open. + *

+ * @return last HTTP status line that was received + */ + public static native String FSOUND_Stream_Net_GetLastServerStatus(); + + /** + * Get various status information for an internet stream + * + * @param stream to get status information on + * @param values IntBuffer to hold 4 int values: + * status variable that will receive a status value. See FSOUND_STREAM_NET_STATUS. + * bufferused variable that will receive the percentage of the read buffer that is currently in use. + * bitrate variable that will receive the current bitrate of the stream. + * flags variable that will receive a flags field describing protocol and format information. See FSOUND_STATUS_FLAGS. + * + * @return On success, TRUE is returned. On failure, FALSE is returned. + */ + public static boolean FSOUND_Stream_Net_GetStatus(FSoundStream stream, IntBuffer values) { + return nFSOUND_Stream_Net_GetStatus(stream.streamHandle, values, values.position()); + } + private static native boolean nFSOUND_Stream_Net_GetStatus(long streamHandle, IntBuffer values, int offset); + + /** + * Sets buffer size and thresholds to use when opening new internet streams + *

+ * Remarks + * Call this function before FSOUND_Stream_Open. This function has no effect on internet streams that are already open + *

+ * @param buffersize Size in bytes of the streaming buffer. Make it bigger to avoid buffer underruns. (Default = 64000) + * @param prebuffer_percent How much to prebuffer when a stream is first opened. Values are expressed as a percentage from 1 to 99. (Default = 95) + * @param rebuffer_percent How much to rebuffer after a stream has suffered a buffer underrun. Values are expressed as a percentage from 1 to 99. (Default = 95) + * @return On success, TRUE is returned. On failure, FALSE is returned. + */ + public static native String FSOUND_Stream_Net_SetBufferProperties(int buffersize, int prebuffer_percent, int rebuffer_percent); + + /** + * Set a metadata callback for an internet stream + *

+ * Remarks + * The supplied metadata callback function will be called each time the specified internet stream receives a chunk of metadata. + * Do not do any time-consuming processing in a metadata callback function or network subsystem performance may degrade. + * Do not attempt to modify or free any memory passed to a metadata callback function. + *

+ * @param stream to set the metadata callback for + * @param callback metadata callback to attach to this stream + * + * @return On success, TRUE is returned. On failure, FALSE is returned. + */ + public static boolean FSOUND_Stream_Net_SetMetadataCallback(FSoundStream stream, FSoundMetaDataCallback callback) { + FMOD.registerCallback(FMOD.FSOUND_METADATACALLBACK, stream.streamHandle, stream, callback); + return nFSOUND_Stream_Net_SetMetadataCallback(stream.streamHandle); + } + private static native boolean nFSOUND_Stream_Net_SetMetadataCallback(long streamHandle); + + /** + * Set a proxy server to use for all subsequent internet connections + * @param proxy The name of a proxy server in host:port format e.g. www.fmod.org:8888 (defaults to port 80 if no port is specified). + * Basic authentication is supported. To use it, this parameter must be in user:password@host:port format e.g. bob:sekrit123@www.fmod.org:8888 + * Set this parameter to NULL if no proxy is required + * @return On success, TRUE is returned. On failure, FALSE is returned. + */ + public static native boolean FSOUND_Stream_Net_SetProxy(String proxy); + + /** + * Extended featured version of FSOUND_Stream_Play. + * Added functionality includes the ability to start the stream paused. This allows attributes + * of a stream channel to be set freely before the stream actually starts playing, until FSOUND_SetPaused(FALSE) is used. + * Also added is the ability to associate the stream channel to a specified DSP unit. This allows + * the user to 'group' channels into seperate DSP units, which allows effects to be inserted + * between these 'groups', and allow various things like having one group affected by reverb (wet mix) and another group of + * channels unaffected (dry). This is useful to seperate things like music from being affected + * by DSP effects, while other sound effects are. + *

+ * Remarks + * When a stream starts to play, it inherits a special high priority (256). + * It cannot be rejected by other sound effect channels in the normal fashion as the user can never set a priority above 255 normally. + * -------- + * FSOUND_STEREOPAN is recommended for stereo streams if you call FSOUND_SetPan. This puts the left and right channel to full volume. + * Otherwise a normal pan will give half volume for left and right. See FSOUND_SetPan for more information on this. + * -------- + * You can use normal channel based commands (such as FSOUND_SetVolume etc) on the return handle, as it is a channel handle. + *

+ * + * @param channel 0+ The absolute channel number in the channel pool. + * Remember software channels come first, followed by hardware channels. + * You cannot play a software sample on a hardware channel and vice versa. + * FSOUND_FREE + * Chooses a free channel to play in. If all channels are used then it + * selects a channel with a sample playing that has an EQUAL or LOWER priority + * than the sample to be played. + * @param stream already opened stream to be played + * @param dspunit dsp unit to attach the channel to + * @param paused Start the stream paused or not. Pausing the stream channel allows attributes to be set before it is unpaused + * @return On success, a channel handle the stream is playing in is returned. On failure, -1 is returned. + */ + public static int FSOUND_Stream_PlayEx(int channel, FSoundStream stream, FSoundDSPUnit dspunit, boolean paused) { + return nFSOUND_Stream_PlayEx(channel, stream.streamHandle, dspunit.dspHandle, paused); + } + private static native int nFSOUND_Stream_PlayEx(int channel, long stream, long dspunit, boolean paused); + + /** + * Sets the internal file buffersize for audio streaming of data for the NEXT stream opened with FSOUND_Stream_Open. + * Larger values will consume more memory (see remarks), whereas smaller values may be subject to large delays in disk access, especially from CDROM. + *

+ * Remarks + * The default setting is 200ms. Under Windows CE it is default to 100ms. + * To calculate memory usage for a stream buffer, it is a simple matter of calculating sizebytes = streambuffersize * sample rate / 1000 * (bitdepth / 8) * numchannels * 2, where numchannels is 1 for mono, + * or 2 for stereo files. It is multiplied by 2 because FSOUND stream buffers are double buffers. + * Note this function does not affect user created streams, as the buffer size is specified in FSOUND_Stream_Create. + *

+ * + * @param ms Time in milliseconds between stream updates. FMOD tries to access the disk and + * decompress data every period specified. Values less than 50 result in an error + * @return On success, TRUE is returned. On failure, FALSE is returned. + */ + public static native boolean FSOUND_Stream_SetBufferSize(int ms); + + /** + * Sets a callback function for when a stream has ended + *

+ * Remarks + * Only calls back when a stream stops. (not when a looping stream reaches its end point) + * Note it uses a FSOUND_STREAMCALLBACK function callback. This is normally for user streams but for + * the sake of re-usability this prototype is used. 'buff' and 'length' are NULL and 0 in this case + * when the callback occurs. The return value can be TRUE or FALSE it is ignored. + * ----------- + * If the stream has been opened with FSOUND_NONBLOCKING, this function will not succeed until the stream is ready. + *

+ * @param stream to set the metadata callback for + * @param callback FSoundStreamCallback callback to attach to this stream + * @return On success, TRUE is returned. On failure, FALSE is returned. + */ + public static boolean FSOUND_Stream_SetEndCallback(FSoundStream stream, FSoundStreamCallback callback) { + FMOD.registerCallback(FMOD.FSOUND_ENDCALLBACK, stream.streamHandle, stream, callback); + return nFSOUND_Stream_SetEndCallback(stream.streamHandle); + } + private static native boolean nFSOUND_Stream_SetEndCallback(long streamHandle); + + /** + * Sets the stream to loop the number of times specified by the user. If not called it loops forever + *

+ * Remarks + * This specifies how many loops, not how many times to play the sound back. Therefore when you specify 0, you will hear the sound once, if you specify 1, you will hear the sound twice, and so on. + *

+ * + * @param stream already opened stream to be played + * @param count Number of times to loop. 0 would be similar to having FSOUND_LOOP_OFF set. >0 is infinity + * @return On success, a channel handle the stream is playing in is returned. On failure, -1 is returned. + */ + public static int FSOUND_Stream_SetLoopCount(FSoundStream stream, int count) { + return nFSOUND_Stream_SetLoopCount(stream.streamHandle, count); + } + private static native int nFSOUND_Stream_SetLoopCount(long stream, int count); + + /** + * Sets the loop points for a stream + *

+ * Remarks + * For streams, setting looppoints is reasonably accurate but should not be assumed to be perfectly sample accurate in all cases. + * It depends on the compression format in some cases as seek positions need to be rounded to the nearest compression block offset. + * FSOUND_MPEGACCURATE will need to be used with mp3 files that use VBR encoding for more accuracy. + * You cannot call this function wile the stream is playing, it has to be stopped + *

+ * + * @param stream already opened stream to be played + * @param loopstart The start of the loop, specified in PCM SAMPLES. + * @param loopend The end of the loop, specified in PCM SAMPLES. + * @return On success, TRUE is returned. On failure, FALSE is returned. + */ + public static int FSOUND_Stream_SetLoopPoints(FSoundStream stream, int loopstart, int loopend) { + return nFSOUND_Stream_SetLoopPoints(stream.streamHandle, loopstart, loopend); + } + private static native int nFSOUND_Stream_SetLoopPoints(long stream, int loopstart, int loopend); + + /** + * Set a streams mode + *

+ * Remarks + * If the stream has been opened with FSOUND_NONBLOCKING, this function will not succeed until the stream is ready. + * Only the following modes are accepted, others will be filtered out. + * FSOUND_LOOP_BIDI, FSOUND_LOOP_NORMAL, FSOUND_LOOP_OFF, FSOUND_2D. FSOUND_LOOP_BIDI is treated as FSOUND_LOOP_NORMAL. FSOUND_2D is accepted only if the sound is not hardware. + * On playstation 2, FSOUND_HW3D and FSOUND_HW2D modes are accepted + *

+ * + * @param stream to have the mode set + * @param mode The mode bits to set from FSOUND_MODES + * @return On success, TRUE is returned. On failure, FALSE is returned. + */ + public static int FSOUND_Stream_SetMode(FSoundStream stream, int mode) { + return nFSOUND_Stream_SetMode(stream.streamHandle, mode); + } + private static native int nFSOUND_Stream_SetMode(long stream, int mode); + + /** + * Set a streams mode + *

+ * Remarks + * Position functions for streams talk in bytes and NOT samples. + * The reason for not taking the header into account is people usually want to know the offset to seek to relative to the start of their data (ie as they see it in soundforge or whatever), not from offset 0 which is almost meaningless if you dont know the format. + * -------------- + * If the stream has been opened with FSOUND_NONBLOCKING, this function will not succeed until the stream is ready. *

+ *

+ * + * @param stream to have its position set + * @param position Offset in bytes from start of actual sound data (not including any header) + * @return On success, TRUE is returned. On failure, FALSE is returned. + */ + public static int FSOUND_Stream_SetPosition(FSoundStream stream, int position) { + return nFSOUND_Stream_SetPosition(stream.streamHandle, position); + } + private static native int nFSOUND_Stream_SetPosition(long stream, int position); + + /** + * This function allows the user to describe the playback order of a list of substreams. The substreams will be played back in order seamlessly. + *

+ * Remarks + * This feature only works with FSB files that have multiple streams stored within it. + * To remove any sentence, simply call this function with NULL and 0. + * FMOD copies the list from the supplied pointer. Once the pointer is used, the caller can discard the original array. + * This function will fail if the stream is playing. The stream must be stopped for it to work. + * ------------ + * If the stream is opened with FSOUND_NONBLOCKING, and the stream is not ready (it is still opening), then this function will return FALSE. + * When it is ready, it will return TRUE, but after this call the stream is put back into a non-ready state, because it is asynchronously seeking again. + * You then have to poll after calling this to make sure the stream is ready. + * You can either do this by calling FSOUND_Stream_Play repeatedly/once a frame until it is succeeds, or FSOUND_Stream_GetOpenState. *

+ * + * @param stream stream to have its position returned. + * @param sentencelist IntBuffer describing a list of substream indicies to play back. + * @return On success, TRUE is returned. On failure, FALSE is returned. + */ + public static int FSOUND_Stream_SetSubStreamSentence(FSoundStream stream, IntBuffer sentencelist) { + return nFSOUND_Stream_SetSubStreamSentence(stream.streamHandle, sentencelist, sentencelist.position()); + } + private static native int nFSOUND_Stream_SetSubStreamSentence(long stream, IntBuffer sentencelist, int offset); + + /** + * Sets a callback function for when a stream passes over a WAV tag/marker. These are markers that + * a sound editing program such as Sound Forge can drop into the actual wave data. FMOD will + * trigger callbacks with these markers when the stream plays, and pass in the string through the callback that the marker contains + *

+ * Remarks + * Note it uses a FSOUND_STREAMCALLBACK function callback. This is normally for user streams but for + * the sake of re-usability this prototype is used. 'buff' is a null terminated string provided by + * the marker. 'len' is the offset in samples that the marker was set at. + * The return value can be TRUE or FALSE, it is ignored. + * ----------- + * Note you can save a WAV out using an MP3 wav codec (and then just rename the WAV to MP3 if you like) to get + * sync marker support for compressed MP3 files. FMOD will pick up on this and read the markers out. + * -------------- + * If the stream has been opened with FSOUND_NONBLOCKING, this function will not succeed until the stream is ready. + *

+ * @param stream to set the SyncCallback callback for + * @param callback FSoundStreamCallback callback to attach to this stream + * @return On success, TRUE is returned. On failure, FALSE is returned. + */ + public static boolean FSOUND_Stream_SetSyncCallback(FSoundStream stream, FSoundStreamCallback callback) { + FMOD.registerCallback(FMOD.FSOUND_SYNCCALLBACK, stream.streamHandle, stream, callback); + return FSOUND_Stream_SetSyncCallback(stream.streamHandle); + } + private static native boolean FSOUND_Stream_SetSyncCallback(long streamHandle); + + /** + * Sets the current stream's FILE position in MILLISECONDS + *

+ * Remarks + * If the stream has been opened with FSOUND_NONBLOCKING, this function will not succeed until the stream is ready. + * FSOUND_MPEGACCURATE will need to be used with mp3 files that use VBR encoding for more accuracy. + *

+ * + * @param stream to have its position set + * @param ms Time in milliseconds to seek to. + * @return On success, TRUE is returned. On failure, FALSE is returned. + */ + public static int FSOUND_Stream_SetTime(FSoundStream stream, int ms) { + return nFSOUND_Stream_SetTime(stream.streamHandle, ms); + } + private static native int nFSOUND_Stream_SetTime(long stream, int ms); + // ---------------------------------------------------------- + + // CD functions + // ========================================================== + /** + * Opens/Closes the CD tray + *

+ * Remarks + * Calling this when the CD tray is open will cause it to close. + * Calling this when the CD tray is closed will cause it to open. + *

+ * + * @param drive the drive ID to use. 0 is the default CD drive. Using D or E in single quotes would be D: or E: for example. + * @return On success, true is is returned. On failure, false is returned. + */ + public static native boolean FSOUND_CD_Eject(char drive); + + /** + * Returns the number of tracks on the currently inserted CD + * + * @param drive the drive ID to use. 0 is the default CD drive. Using D or E in single quotes would be D: or E: for example. + * @return On success, the number of CD tracks on the currently inserted is returned. On failure, 0 is returned + */ + public static native int FSOUND_CD_GetNumTracks(char drive); + + /** + * Gets the pause status of the current CD audio track + * + * @param drive the drive ID to use. 0 is the default CD drive. Using D or E in single quotes would be D: or E: for example. + * @return If the track is currently paused, TRUE is returned. if the track is currently not paused, FALSE is returned. + */ + public static native boolean FSOUND_CD_GetPaused(char drive); + + /** + * Returns the currently playing CD track number + * + * @param drive the drive ID to use. 0 is the default CD drive. Using D or E in single quotes would be D: or E: for example. + * @return On success, the CD track number currently playing is returned. (starts from 1) On failure, 0 is returned + */ + public static native int FSOUND_CD_GetTrack(char drive); + + /** + * Gets the track length of a CD + * + * @param drive the drive ID to use. 0 is the default CD drive. Using D or E in single quotes would be D: or E: for example. + * @param track The CD track number to query the length of. (starts from 1) + * @return On success, the length of the current track in milliseconds is returned. On failure, 0 is returned. + */ + public static native int FSOUND_CD_GetTrackLength(char drive, int track); + + /** + * Returns the current track time playing on a CD + *

+ * Remarks + * This is easily one of the slowest functions in the FMOD API. Please use it sparingly. + * It seems like it shouldnt take long, but because of windows MCI API it does, and not just a little bit of time, it takes a LOT. + * It seems to poll the CD driver and cause a large delay upon completion of the command. + * Different algorithms were used to try and emulate this function such as simply using a timer, but this was very inaccurate, especially when pausing/unpausing a lot. + *

+ * + * @param drive the drive ID to use. 0 is the default CD drive. Using D or E in single quotes would be D: or E: for example. + * @return On success, the position of the current playing track in milliseconds is returned. On failure, 0 is returned + */ + public static native int FSOUND_CD_GetTrackTime(char drive); + + /** + * Plays a CD Audio track + *

+ * Remarks + * See FSOUND_CD_SetPlayMode for information on how to control playback of a CD track. + * FSOUND's CD Playback system, is a non intrusive, non polling system. + * This may not mean much to a lot of people, but a polling player (take the windows default CD player) will consistantly poll the CD device to update its status, which causes other applications to jerk, or pause consistantly. + * This would be inexcusable in a game, to have the game halt or jerk every second to few seconds or so. + * FSOUND uses timing and prediction to loop tracks and update the status of the CD, and never touches the CD device during playback, for TRUE 0% cpu usage. + *

+ * @param drive the drive ID to use. 0 is the default CD drive. Using D or E in single quotes would be D: or E: for example. + * @param track The CD track number to query the length of. (starts from 1) + * @return On success, TRUE is returned. On failure, FALSE is returned. + */ + public static native boolean FSOUND_CD_Play(char drive, int track); + + /** + * Sets the pause status of the currently playing CD audio track + * + * @param drive the drive ID to use. 0 is the default CD drive. Using D or E in single quotes would be D: or E: for example. + * @param paused TRUE to pause track, FALSE to unpause track + * @return On success, TRUE is returned. On failure, FALSE is returned. + */ + public static native boolean FSOUND_CD_SetPaused(char drive, boolean paused); + + /** + * Sets the playback mode of the CD + * + * @param drive the drive ID to use. 0 is the default CD drive. Using D or E in single quotes would be D: or E: for example. + * @param mode See FSOUND_CDPLAYMODES for a list of valid parameters to send to this function + */ + public static native void FSOUND_CD_SetPlayMode(char drive, int mode); + + /** + * Performs a seek within a track specified by milliseconds + *

+ * Remarks + * This function will start the track if it is not playing + *

+ * + * @param drive the drive ID to use. 0 is the default CD drive. Using D or E in single quotes would be D: or E: for example. + * @param ms Time to seek into the current track in milliseconds + * @return On success, TRUE is returned. On failure, FALSE is returned. + */ + public static native boolean FSOUND_CD_SetTrackTime(char drive, int ms); + + /** + * Sets the volume of the playing CD audio + * + * @param drive the drive ID to use. 0 is the default CD drive. Using D or E in single quotes would be D: or E: for example. + * @param volume An integer value from 0-255. 0 being the lowest volume, 255 being the highest (full). + * @return On success, TRUE is returned. On failure, FALSE is returned. + */ + public static native boolean FSOUND_CD_SetVolume(char drive, int volume); + + /** + * Stops the currently playing CD audio track + * + * @param drive the drive ID to use. 0 is the default CD drive. Using D or E in single quotes would be D: or E: for example. + * @return On success, TRUE is returned. On failure, FALSE is returned. + */ + public static native boolean FSOUND_CD_Stop(char drive); + // ---------------------------------------------------------- + + // DSP functions + // ========================================================== + /** + * Clears the mixbuffer, especially handy if you are doing a large file operation which + * halts the system. + * You might try and stop all the sounds, but if you do your file operation straight after + * this, it will not have a chance to flush the mixbuffer normally, so this function is called. + * It stops the effect of stuttering looping sound while your file operation happens. + *

+ * Remarks + * The best way to do it is like this. Turn off the sfx and music DSP units, clear the mix buffer, + * then when the operation that halts the machine is done, just re-enable the sfx and music DSP units. + * Disabling these units stops the timer trying to get 1 or 2 more mixes in during the file operation, + * which will cause more stuttering. + * ie. + * FSOUND_DSP_SetActive(FSOUND_DSP_GetSFXUnit(), FALSE); + * FSOUND_DSP_SetActive(FSOUND_DSP_GetMusicUnit(), FALSE); + * FSOUND_DSP_ClearMixBuffer(); + * // + * // maching halting operation here + * // + * FSOUND_DSP_SetActive(FSOUND_DSP_GetSFXUnit(), TRUE); + * FSOUND_DSP_SetActive(FSOUND_DSP_GetMusicUnit(), TRUE); + *

+ */ + public static native void FSOUND_DSP_ClearMixBuffer(); + + /** + * Creates a DSP unit, and places it in the DSP chain position specified by the priority + * parameter. Read the remarks section carefully for issues regarding DSP units. + * DSP units are freed with FSOUND_DSP_Free + *

+ * Remarks + * A dsp unit is NOT ACTIVE by default. You have to activate it with FSOUND_DSP_SetActive + * --------------------------------------------------------------------------------------- + * Priorities and default system units. + * --------------------------------------------------------------------------------------- + * A note on priorities. FSOUND processes DSP units in order of priority. A 0 priority + * unit gets processed first, a 1 priority unit gets processed next, and so on. + * FSOUND actually uses these DSP units to mix its sound effects and music! Yes, you have + * access to them (be careful!). It is possible to totally remove, replace or deactivate + * all of FSOUND's system units so that it does nothing at all! + * FSOUND has preinstalled default system units at the following priority locations: + * FSOUND_DSP_DEFAULTPRIORITY_CLEARUNIT (priority 0) - Clear Unit. This unit clears out + * the mixbuffer for the next units to mix into. You can disable this unit and replace + * it with something other than a clearer, such as a scaler, which fades down the mix + * buffer instead of clearing it, to produce a very rough echo effect. + * FSOUND_DSP_DEFAULTPRIORITY_SFXUNIT (priority 100) - SFX Unit. This unit mixes sound + * effect channels into the mix buffer, which was previously cleared with the Clear + * Unit. + * FSOUND_DSP_DEFAULTPRIORITY_MUSICUNIT (priority 200) - Music Unit. This unit mixes all + * music channels into the mix buffer, which was previously mixed into with the SFX + * Unit. + * FSOUND_DSP_DEFAULTPRIORITY_CLIPANDCOPYUNIT (priority 1000) - Clip and Copy Unit. This + * unit takes the finally mixed buffer, and clips it to the output stream size (if it + * needs to), and then sends it off to the sound device. It is done last. If this is + * disabled you will hear no sound. + * --------------------------------------------------------------------------------------- + * Buffer Lengths. + * --------------------------------------------------------------------------------------- + * The 'length' value of the DSP callback is roughly 20ms worth of data. + * Use FSOUND_DSP_GetBufferLength to get the exact callback length. + * --------------------------------------------------------------------------------------- + * Buffer Widths + * --------------------------------------------------------------------------------------- + * Remember that FSOUND uses different buffer types depending on what type of mixer it is. + * You will have to compensate for this by writing different routines depending on the + * mixer type (ie mmx or non mmx), just like FSOUND does. + * Currently there are the 3 types of mixers and their buffer sizes. + * You can get the type of mixer being used by calling the FSOUND_GetMixer function. + * You may want to check on this inside your callback, or set up a function pointer system, + * whatever you think is suitable (it costs nothing to do a FSOUND_GetMixer every time). + * - FSOUND_MIXER_BLENDMODE : This buffer is a stereo, signed 32bit buffer (8 bytes per + * sample). The data is in integer format. + * Data written to this buffer is not clipped and passed to the output stream until the + * very end of the chain (the clip and copy unit). For this type of mixer, you dont + * have to worry about clipping becuase FSOUND does this for you. + * - FSOUND_MIXER_QUALITY_FPU / FSOUND_MIXER_QUALITY_FPU_VOLUMERAMP: This buffer is also a + * stereo, signed 32bit buffer (8 bytes per sample). This data is in floating point + * format. + * The same clip and copy rules apply here as for the above mixer. + * - Any MMX based mixer : This buffer is a stereo, signed 16bit buffer (4 bytes per sample). + * When writing to this buffer, you must make sure the result does not overflow this + * signed 16bit range. + * If you add data into to this buffer, make sure it is clipped to a signed 16bit range + * before writing it back. FSOUND only copies this data to the output stream, it does + * not clip it. + * --------------------------------------------------------------------------------------- + * Speed + * --------------------------------------------------------------------------------------- + * DSP Units are processed then and there, inside the mixing routine. Remember to make + * your process as FAST as possible, or the output device's play cursor will catch up to + * FSOUND's write cursor while your routine takes its time to complete, and make it start + * to break up. + * So basically, if it isnt fast, then FSOUND will not be able to send the data to the + * output device in time for the next mixer update, and the result will be corrupted sound. + * FSOUND_DSP_MixBuffers is available now, so if you need to mix some raw data into the output + * buffer quickly, you can use FSOUND's own optimized mixer directly to do it! + * Finally, you can see how your routine affects cpu usage, by using FSOUND_GetCPUUsage. + * The cpu usage returned by this function includes any time spent in DSP units as well. + * (this function times everything). If you are really bored, you can see how much FSOUND's + * system units take cpu-wise, by turning them on and off and seeing how they affect + * performance. + *

+ * @param stream to have its position set + * @param index The index of the stream within the FSB file + * @return On success, a new valid DSP unit is returned. On failure, NULL is returned. + */ + public static FSoundDSPUnit FSOUND_DSP_Create(FSoundDSPCallback callbackHandler, int priority) { + FSoundDSPUnit dspUnit = null; + long unit = nFSOUND_DSP_Create(priority); + if(unit != 0) { + dspUnit= new FSoundDSPUnit(unit); + FMOD.registerCallback(FMOD.FSOUND_DSPCALLBACK, dspUnit.dspHandle, dspUnit, callbackHandler); + } + return dspUnit; + } + private static native long nFSOUND_DSP_Create(int priority); + + /** + * Frees and removes a DSP unit from the DSP chain + * + * @param unit DSP unit to be freed + */ + public static void FSOUND_DSP_Free(FSoundDSPUnit unit) { + nFSOUND_DSP_Free(unit.dspHandle); + FMOD.registerCallback(FMOD.FSOUND_DSPCALLBACK, unit.dspHandle, unit, null); + } + private static native void nFSOUND_DSP_Free(long dspUnitHandle); + + /** + * Allows the user to toggle a DSP unit on or off + *

+ * Remarks + * It is possible to toggle on and off FSOUNDs internal DSP units, though not recommended + *

+ * @param unit DSP unit to have its active flag changed + * @param active Flag to say whether DSP unit should be rendered active or inactive. valid values are TRUE or FALSE + */ + public static void FSOUND_DSP_SetActive(FSoundDSPUnit unit, boolean active) { + nFSOUND_DSP_SetActive(unit.dspHandle, active); + } + private static native void nFSOUND_DSP_SetActive(long dspUnitHandle, boolean active); + + /** + * Returns if a DSP unit is active or not + *

+ * Remarks + * It is possible to toggle on and off FSOUNDs internal DSP units, though not recommended + *

+ * @param unit DSP unit to have its active flag returned + * @return On success, TRUE is returned. On failure, FALSE is returned + */ + public static boolean FSOUND_DSP_GetActive(FSoundDSPUnit unit) { + return nFSOUND_DSP_GetActive(unit.dspHandle); + } + private static native boolean nFSOUND_DSP_GetActive(long dspUnitHandle); + + /** + * Returns the buffer lenth passed by the DSP system to DSP unit callbacks, so you can allocate memory etc + * using this data + *

+ * Remarks + * Remember this is samples not bytes. To convert to bytes you + * will have to multiply by 4 for mmx mixers, 8 for other mixers. + * (a stereo 16bit sample = 4 bytes, and a stereo 32bit sample (ie fpu) = 8 bytes) + *

+ * @return The size of the DSP unit buffer in SAMPLES (not bytes) + */ + public static native int FSOUND_DSP_GetBufferLength(); + + /** + * This is the total size in samples (not bytes) of the FSOUND mix buffer. This is affected + * by FSOUND_SetBufferSize. + *

+ * Remarks + * Remember this is samples not bytes. To convert to bytes you + * will have to multiply by 4 for mmx mixers, 8 for other mixers. + * (a stereo 16bit sample = 4 bytes, and a stereo 32bit sample (ie fpu) = 8 bytes) + *

+ * @return The size of the FSOUND mixing buffer in SAMPLES (not bytes). + */ + public static native int FSOUND_DSP_GetBufferLengthTotal(); + + /** + * Changes a DSP Unit's priority position in the DSP chain + *

+ * Remarks + * DSP units with the same priority as a previous unit already in the chain will be placed + * AFTER all like priority units + *

+ * @param unit DSP unit to have its priority changed + * @param priority Order in the priority chain. Valid numbers are 0 to 1000, 0 being highest priority (first), with 1000 being lowest priority (last). + */ + public static void FSOUND_DSP_GetActive(FSoundDSPUnit unit, int priority) { + nFSOUND_DSP_SetPriority(unit.dspHandle, priority); + } + private static native void nFSOUND_DSP_SetPriority(long dspUnitHandle, int priority); + + /** + * Returns the priority status in the DSP chain, of a specified unit. + *

+ * Remarks + * DSP units with the same priority as a previous unit already in the chain will be placed + * AFTER all like priority units + *

+ * @param unit DSP unit to get priority value from + * @return On success, the priority of the unit, from 0 to 1000. On failure, -1 is returned. + */ + public static int FSOUND_DSP_GetPriority(FSoundDSPUnit unit) { + return nFSOUND_DSP_GetPriority(unit.dspHandle); + } + private static native int nFSOUND_DSP_GetPriority(long dspUnitHandle); + + /** + * Returns a reference to FSOUND's system DSP clear unit + *

+ * Remarks + * The FSOUND clear DSP unit simply sets the mix buffer to 0, silencing it + *

+ * @return reference to the DSP unit + */ + public static FSoundDSPUnit FSOUND_DSP_GetClearUnit() { + if(FMOD.fmodClearUnit == null) { + FMOD.fmodClearUnit = new FSoundDSPUnit(nFSOUND_DSP_GetClearUnit()); + } + return FMOD.fmodClearUnit; + } + private static native long nFSOUND_DSP_GetClearUnit(); + + /** + * Returns a reference to FSOUND's system Clip and Copy DSP unit + *

+ * Remarks + * The FSOUND ClipAndCopy DSP unit clips the 32bit buffer down to fit the soundcard's 16bit stereo output, and sends it off to the hardware. + *

+ * @return reference to the DSP unit + */ + public static FSoundDSPUnit FSOUND_DSP_GetClipAndCopyUnit() { + if(FMOD.fmodClipAndCopyUnit == null) { + FMOD.fmodClipAndCopyUnit = new FSoundDSPUnit(nFSOUND_DSP_GetClipAndCopyUnit()); + } + return FMOD.fmodClipAndCopyUnit; + } + private static native long nFSOUND_DSP_GetClipAndCopyUnit(); + + /** + * Returns a reference to FSOUND's system DSP Music mixer unit + *

+ * Remarks + * The FSOUND Music DSP executes the FMUSIC engine and mixes the sounds spawned by the music player + *

+ * @return reference to the DSP unit + */ + public static FSoundDSPUnit FSOUND_DSP_GetMusicUnit() { + if(FMOD.fmodMusicUnit == null) { + FMOD.fmodMusicUnit = new FSoundDSPUnit(nFSOUND_DSP_GetMusicUnit()); + } + return FMOD.fmodMusicUnit; + } + private static native long nFSOUND_DSP_GetMusicUnit(); + + /** + * Returns a reference to FSOUND's system DSP SFX mixer unit + *

+ * Remarks + * The FSOUND SFX DSP unit mixes sound effects together spawned by the user + *

+ * @return reference to the DSP unit + */ + public static FSoundDSPUnit FSOUND_DSP_GetSFXUnit() { + if(FMOD.fmodSFXUnit == null) { + FMOD.fmodSFXUnit = new FSoundDSPUnit(nFSOUND_DSP_GetSFXUnit()); + } + return FMOD.fmodSFXUnit; + } + private static native long nFSOUND_DSP_GetSFXUnit(); + + /** + * Returns a reference to FSOUND's system DSP FFT processing unit + *

+ * Remarks + * The FSOUND FFT DSP executes the FFT engine to allow FSOUND_DSP_GetSpectrum to be used. + * The FFT unit is off by default, due to the cpu expense incurred in running. Turn it on to use FSOUND_DSP_GetSpectrum + *

+ * @return reference to the DSP unit + */ + public static FSoundDSPUnit FSOUND_DSP_GetFFTUnit() { + if(FMOD.fmodFFTUnit == null) { + FMOD.fmodFFTUnit = new FSoundDSPUnit(nFSOUND_DSP_GetFFTUnit()); + } + return FMOD.fmodFFTUnit; + } + private static native long nFSOUND_DSP_GetFFTUnit(); + + /** + * Function to return a FloatBuffer to the current spectrum buffer. The buffer contains 512 floating + * point values that represent each frequency band's amplitude for the current FMOD SoundSystem + * mixing buffer. The range of frequencies covered by the spectrum is 1 to the nyquist frequency + * or half of the output rate. So if the output rate is 44100, then frequencies provided are up + * to 22050. (entry 511) + *

+ * Remarks + * Note that hardware sounds, MIDI, files do not register on the spectrum graph as they are not run through FMODs DSP system. + * Note that to use this you have to turn on the FSOUND FFT DSP unit. This is achieved by calling FSOUND_DSP_GetFFTUnit, then using FSOUND_DSP_SetActive to turn it on. + *

+ * @return FloatBuffer containing 512 floats + */ + public static FloatBuffer FSOUND_DSP_GetSpectrum() { + if(FMOD.fmodFFTBuffer == null) { + FMOD.fmodFFTBuffer = nFSOUND_DSP_GetSpectrum(); + } + return FMOD.fmodFFTBuffer; + } + private static native FloatBuffer nFSOUND_DSP_GetSpectrum(); + + /** + * Allows the user to mix their own data from one buffer to another, using FSOUNDs optimized + * mixer routines. This was mainly provided for DSP routines, though it can be used for + * anything. + *

+ * Remarks + * 'destbuffer' should always the format of the mixing output buffer, as it will use the mixer + * currently running to do the mixing. + * For MMX it is 16bit stereo, so it is 4 bytes per output sample (word left, word right) + * For Standard Blend mode it is 32bit stereo, so it is 8 bytes per output sample (left dword, right dword) + * For FPU mixer it is 32bit float stereo, so it is 8 bytes per output sample (left float, right float) + * FSOUND_GetMixer can be used to determine which mixer is being used. + *

+ * @param destbuffer Pointer to a buffer to have the data mixed into. + * @param srcbuffer Pointer to the source buffer to be mixed in. + * @param len Amount to mix in SAMPLES. + * @param freq Speed to mix data to output buffer. Remember if you mix at a rate + * different than the output rate, the buffer lengths will have to be + * different to compensate. Ie if the output rate is 44100 and you supply + * a value of 88200 to FSOUND_DSP_MixBuffers, you will only need a destbuffer + * that is half the size of srcbuffer. If you supply a value of 22050 then + * you will need a destbuffer that is twice as big as srcbuffer. If they + * are both the same size then it will only mix half of the data. + * @param vol volume scalar value of mix. Valid values are 0 (silence) to 255 + * (full volume). See FSOUND_SetVolume for more information. + * @param pan pan value for data being mixed. Valid values are 0 (full left), 128 + * (middle), 255 (full right) and FSOUND_STEREOPAN. See FSOUND_SetPan for + * more information. + * @param mode Bit settings to describe the source buffer. Valid values are found in + * FSOUND_MODES, but only 8/16bit and stereo/mono flags are interpreted, other flags are ignored. + * @return On success, TRUE is returned. On failure, FALSE is returned. + */ + public static boolean FSOUND_DSP_MixBuffers( + ByteBuffer destbuffer, ByteBuffer srcbuffer, int len, int freq, int vol, int pan, int mode) { + return nFSOUND_DSP_MixBuffers( + destbuffer, destbuffer.position(), srcbuffer, srcbuffer.position(), len, freq, vol, pan, mode); + } + private static native boolean nFSOUND_DSP_MixBuffers( + ByteBuffer destbuffer, int destBufferOffset, ByteBuffer srcbuffer, int srcBufferOffset, + int len, int freq, int vol, int pan, int mode); + // ---------------------------------------------------------- + + // FX functions + // ========================================================== + /** + * Disables effect processing for ALL effects on the specified channel + *

+ * Remarks + * FSOUND_ALL is supported. Passing this will disable fx on ALL channels available. + * This command can only be issued while the channel is paused or stopped. + *

+ * + * @param channel Channel number/handle to disable all fx for + * @return On success, TRUE is returned. On failure, FALSE is returned + */ + public static native boolean FSOUND_FX_Disable(int channel); + + /** + * Enables effect processing for the specified channel. This command continues to add effects to a channel (up to 16) until FSOUND_FX_Disable is called. + *

+ * Remarks + * FSOUND_ALL is supported. Passing this will enable fx on ALL channels available. + * This command can only be issued while the channel is paused. + * If an effect is not enabled, then it will not be affected by its corresponding FSOUND_FX_Set functions. + * This function must be played after a paused PlaySoundEx (ie FSOUND_PlaySoundEx(FSOUND_FREE, sound, NULL, TRUE)), and before + * the FSOUND_SetPaused(FALSE) so that the hardware can get the resource before it starts playing. + * A total of 16 FX per channel is allowed, any more will result in an error. FX are reset to 0 after a sound is stopped or played. (but as above, before the unpausing of a play-paused sound). + * Warning : This function is expensive to call as it has to set up fx buffers etc. It is best to call it once, reserve the channel then reuse the channel index when calling playsound without calling it again. + * Note : Channels with FX enabled sounds cannot have their frequency changed. + *

+ * + * @param channel Channel number/handle to disable all fx for + * @param fx A single fx enum value to enable certain effects. + * @return On success, an FX id is returned. On failure, -1 is returned + */ + public static native int FSOUND_FX_Enable(int channel, int fxtype); + + /** + * Sets the parameters for the chorus effect on a particular channel + *

+ * Remarks + * Make sure you have enabled this effect with FSOUND_FX_CHORUS before using this function. + *

+ * + * @param fxid fx handle generated by FSOUND_FX_Enable, to set chorus parameters for. + * @param WetDryMix Ratio of wet (processed) signal to dry (unprocessed) signal. Must be in the range from 0 through 100 (all wet). + * @param Depth Percentage by which the delay time is modulated by the low-frequency oscillator, in hundredths of a percentage point. Must be in the range from 0 through 100. The default value is 25. + * @param Feedback Percentage of output signal to feed back into the effects input, in the range from -99 to 99. The default value is 0. + * @param Frequency Frequency of the LFO, in the range from 0 to 10. The default value is 0. + * @param Waveform Waveform of the LFO. Defined values are 0 triangle. 1 sine. By default, the waveform is a sine. + * @param Delay Number of milliseconds the input is delayed before it is played back, in the range from 0 to 20. The default value is 0 ms. + * @param Phase Phase differential between left and right LFOs, in the range from 0 through 4. Possible values are defined as follows: + * 0 -180 degrees + * 1 - 90 degrees + * 2 0 degrees + * 3 90 degrees + * 4 180 degrees + * @return On success, TRUE is returned. On failure, FALSE is returned. + + */ + public static native boolean FSOUND_FX_SetChorus( + int fxid, float WetDryMix, float Depth, float Feedback, float Frequency, int Waveform, float Delay, int Phase); + + /** + * Sets the parameters for the compressor effect on a particular channel + *

+ * Remarks + * Make sure you have enabled this effect with FSOUND_FX_COMPRESSOR before using this function + *

+ * + * @param fxid fx handle generated by FSOUND_FX_Enable, to set compressor parameters for. + * @param Gain Output gain of signal after compression, in the range from -60 to 60. The default value is 0 dB. + * @param Attack Time before compression reaches its full value, in the range from 0.01 to 500. The default value is 0.01 ms. + * @param Release Speed at which compression is stopped after input drops below fThreshold, in the range from 50 to 3000. The default value is 50 ms. + * @param Threshold Point at which compression begins, in decibels, in the range from -60 to 0. The default value is -10 dB. + * @param Ratio Compression ratio, in the range from 1 to 100. The default value is 10, which means 10:1 compression. + * @param Predelay Time after lThreshold is reached before attack phase is started, in milliseconds, in the range from 0 to 4. The default value is 0 ms. + * @return On success, TRUE is returned. On failure, FALSE is returned. + */ + public static native boolean FSOUND_FX_SetCompressor( + int fxid, float Gain, float Attack, float Release, float Threshold, float Ratio, float Predelay); + + /** + * Sets the parameters for the distortion effect on a particular channel + *

+ * Remarks + * Make sure you have enabled this effect with FSOUND_FX_DISTORTION before using this function + *

+ * + * @param fxid fx handle generated by FSOUND_FX_Enable, to set distortion parameters for. + * @param Gain Amount of signal change after distortion, in the range from -60 through 0. The default value is 0 dB. + * @param Edge Percentage of distortion intensity, in the range in the range from 0 through 100. The default value is 50 percent. + * @param PostEQCenterFrequency Center frequency of harmonic content addition, in the range from 100 through 8000. The default value is 4000 Hz. + * @param PostEQBandwidth Width of frequency band that determines range of harmonic content addition, in the range from 100 through 8000. The default value is 4000 Hz. + * @param PreLowpassCutoff Filter cutoff for high-frequency harmonics attenuation, in the range from 100 through 8000. The default value is 4000 Hz. + * @return On success, TRUE is returned. On failure, FALSE is returned. + */ + public static native boolean FSOUND_FX_SetDistortion( + int fxid, float Gain, float Edge, float PostEQCenterFrequency, float PostEQBandwidth, float PreLowpassCutoff); + + /** + * Sets the parameters for the echo effect on a particular channel + *

+ * Remarks + * Make sure you have enabled this effect with FSOUND_FX_Enable and FSOUND_FX_ECHO before using this function. + *

+ * + * @param fxid fx handle generated by FSOUND_FX_Enable, to set echo parameters for. + * @param WetDryMix Ratio of wet (processed) signal to dry (unprocessed) signal. Must be in the range from 0 through 100 (all wet). + * @param Feedback Percentage of output fed back into input, in the range from 0 through 100. The default value is 0. + * @param LeftDelay Delay for left channel, in milliseconds, in the range from 1 through 2000. The default value is 333 ms. + * @param RightDelay Delay for right channel, in milliseconds, in the range from 1 through 2000. The default value is 333 ms. + * @param PanDelay Value that specifies whether to swap left and right delays with each successive echo. The default value is FALSE, meaning no swap. Possible values are defined as TRUE or FALSE. + * @return On success, TRUE is returned. On failure, FALSE is returned. + */ + public static native boolean FSOUND_FX_SetEcho( + int fxid, float WetDryMix, float Feedback, float LeftDelay, float RightDelay, int PanDelay); + + /** + * Sets the parameters for the echo effect on a particular channel + *

+ * Remarks + * Make sure you have enabled this effect with FSOUND_FX_Enable and FSOUND_FX_FLANGER before using this function. + *

+ * + * @param fxid fx handle generated by FSOUND_FX_Enable, to set flanger parameters for. + * @param WetDryMix Ratio of wet (processed) signal to dry (unprocessed) signal. Must be in the range from 0 through 100 (all wet). + * @param Depth Percentage by which the delay time is modulated by the low-frequency oscillator (LFO), in hundredths of a percentage point. Must be in the range from 0 through 100. The default value is 25. + * @param Feedback Percentage of output signal to feed back into the effects input, in the range from -99 to 99. The default value is 0. + * @param Frequency Frequency of the LFO, in the range from 0 to 10. The default value is 0. + * @param Waveform Waveform of the LFO. By default, the waveform is a sine. Possible values are defined as follows: + * 0 - Triangle. + * 1 - Sine. + * @param Delay Number of milliseconds the input is delayed before it is played back, in the range from 0 to 4. The default value is 0 ms. + * @param Phase Phase differential between left and right LFOs, in the range from 0 through 4. Possible values are defined as follows: + * 0 -180 degrees + * 1 - 90 degrees + * 2 0 degrees + * 3 90 degrees + * 4 180 degrees + * @return On success, TRUE is returned. On failure, FALSE is returned. + */ + public static native boolean FSOUND_FX_SetFlanger( + int fxid, float WetDryMix, float Depth, float Feedback, float Frequency, int Waveform, float Delay, int Phase); + + /** + * Sets the parameters for the echo effect on a particular channel + *

+ * Remarks + * Make sure you have enabled this effect with FSOUND_FX_Enable and FSOUND_FX_GARGLE before using this function. + *

+ * + * @param fxid fx handle generated by FSOUND_FX_Enable, to set gargle parameters for. + * @param RateHz Rate of modulation, in Hertz. Must be in the range from 1 through 1000. + * @param WaveShape Shape of the modulation wave. The following values are defined. + * 0 - Triangular wave. + * 1 - Square wave. + * @return On success, TRUE is returned. On failure, FALSE is returned. + */ + public static native boolean FSOUND_FX_SetGargle(int fxid, int RateHz, int WaveShape); + + /** + * Sets the parameters for the I3DL2 Reverb effect on a particular channel + *

+ * Remarks + * Make sure you have enabled this effect with FSOUND_FX_Enable and FSOUND_FX_I3DL2REVERB before using this function. + *

+ * + * @param fxid fx handle generated by FSOUND_FX_Enable, to set I3DL2 Reverb parameters for. + * @param Room Attenuation of the room effect, in millibels (mB), in the range from -10000 to 0. The default value is -1000 mB. + * @param RoomHF Attenuation of the room high-frequency effect, in mB, in the range from -10000 to 0. The default value is 0 mB. + * @param RoomRolloffFactor Rolloff factor for the reflected signals, in the range from 0 to 10. The default value is 0.0. The rolloff factor for the direct path is controlled by the listener. + * @param DecayTime Decay time, in seconds, in the range from .1 to 20. The default value is 1.49 seconds. + * @param DecayHFRatio Ratio of the decay time at high frequencies to the decay time at low frequencies, in the range from 0.1 to 2. The default value is 0.83. + * @param Reflections Attenuation of early reflections relative to lRoom, in mB, in the range from -10000 to 1000. The default value is -2602 mB. + * @param ReflectionsDelay Delay time of the first reflection relative to the direct path, in seconds, in the range from 0 to 0.3. The default value is 0.007 seconds. + * @param Reverb Attenuation of late reverberation relative to lRoom, in mB, in the range from -10000 to 2000. The default value is 200 mB. + * @param ReverbDelay Time limit between the early reflections and the late reverberation relative to the time of the first reflection, in seconds, in the range from 0 to 0.1. The default value is 0.011 seconds. + * @param Diffusion Echo density in the late reverberation decay, in percent, in the range from 0 to 100. The default value is 100.0 percent. + * @param Density Modal density in the late reverberation decay, in percent, in the range from 0 to 100. The default value is 100.0 percent. + * @param HFReference Reference high frequency, in hertz, in the range from 20 to 20000. The default value is 5000.0 Hz. + * @return On success, TRUE is returned. On failure, FALSE is returned. + */ + public static native boolean FSOUND_FX_SetI3DL2Reverb( + int fxid, int Room, int RoomHF, float RoomRolloffFactor, float DecayTime, + float DecayHFRatio, int Reflections, float ReflectionsDelay, int Reverb, + float ReverbDelay, float Diffusion, float Density, float HFReference); + + /** + * Sets the parameters for the I3DL2 Reverb effect on a particular channel + *

+ * Remarks + * Make sure you have enabled this effect with FSOUND_FX_Enable and FSOUND_FX_PARAMEQ before using this function. + *

+ * + * @param fxid fx handle generated by FSOUND_FX_Enable, to set ParamEQ parameters for. + * @param Center Center frequency, in hertz, in the range from 80 to 16000. This value cannot exceed one-third of the frequency of the buffer. Default is 8000. + * @param Bandwidth Bandwidth, in semitones, in the range from 1 to 36. Default is 12. + * @param Gain Gain, in the range from -15 to 15. Default is 0. + * @return On success, TRUE is returned. On failure, FALSE is returned. + */ + public static native boolean FSOUND_FX_SetParamEQ(int fxid, float Center, float Bandwidth, float Gain); + + /** + * Sets the parameters for the Waves Reverb effect on a particular channel + *

+ * Remarks + * Make sure you have enabled this effect with FSOUND_FX_Enable and FSOUND_WAVES_REVERB before using this function. + *

+ * + * @param fxid fx handle generated by FSOUND_FX_Enable, to set ParamEQ parameters for. + * @param InGain Input gain of signal, in decibels (dB), in the range from -96 through 0. The default value is 0 dB. + * @param ReverbMix Reverb mix, in dB, in the range from -96 through 0. The default value is 0 dB. + * @param ReverbTime Reverb time, in milliseconds, in the range from .001 through 3000. The default value is 1000. + * @param HighFreqRTRatio In the range from .001 through .999. The default value is 0.001. + * @return On success, TRUE is returned. On failure, FALSE is returned. + */ + public static native boolean FSOUND_FX_SetWavesReverb(int fxid, float InGain, float ReverbMix, float ReverbTime, float HighFreqRTRatio); + // ---------------------------------------------------------- + + // Recording functions + // ========================================================== + /** + * Returns the currently selected recording driver number. Drivers are enumerated when selecting a driver + * with FSOUND_Record_SetDriver or other driver related functions such as FSOUND_Record_GetNumDrivers or + * FSOUND_Record_GetDriverName + * + * @return Currently selected driver id + */ + public static native int FSOUND_Record_GetDriver(); + + /** + * Returns the name of the selected recording driver. Drivers are enumerated when selecting a driver with + * FSOUND_Record_SetDriver or other driver related functions such as FSOUND_Record_GetNumDrivers or FSOUND_Record_GetDriver + * + * @param id Enumerated driver ID. This must be in a valid range delimited by FSOUND_Record_GetNumDrivers, + * @return On success, a string containing the name of the specified device is returned. + * The number of drivers enumerated can be found with FSOUND_Record_GetNumDrivers. On failure, NULL is returned + */ + public static native String FSOUND_Record_GetDriverName(int id); + + /** + * Returns the number of sound cards or devices enumerated for the current input type. (Direct + * Sound, WaveOut etc.) + * + * @return Total number of enumerated sound devices + */ + public static native int FSOUND_Record_GetNumDrivers(); + + /** + * Gets the position in the sample buffer that has been recorded to + *

+ * Remarks + * Note. This is not the 'recording cursor', but rather the latest point that the input has been copied to your sample + *

+ * + * @return On success, the offset in SAMPLES, for the record buffer that the input device has just written up to is returned. + * On failure (recording device hasnt been started), -1 is returned. + */ + public static native int FSOUND_Record_GetPosition(); + + /** + * Returns the name of the selected recording driver. Drivers are enumerated when selecting a driver with + * FSOUND_Record_SetDriver or other driver related functions such as FSOUND_Record_GetNumDrivers or FSOUND_Record_GetDriver + * + * @param driverno Recording driver number to select. >=0 will select the DEFAULT recording sound driver. <0 Selects other valid drivers that can be listed with FSOUND_Record_GetDriverName. + * @return On success, TRUE is returned. On failure, FALSE is returned + */ + public static native boolean FSOUND_Record_SetDriver(int driverno); + + /** + * Starts recording into a predefined sample using the sample's default playback rate as the recording rate + *

+ * Remarks + * If you want to play back the sample at the same time is is recording, you will have to play the sound and try and keep it just behind the recording cursor. + * Under FSOUND_OUTPUT_OSS mode, it is single duplex, so playback will stop when recording is in progress! Try FSOUND_OUTPUT_ALSA for full duplex as they have better drivers in this respect. + * ------------- + * The recording/playback rates are slightly innacurate and are not identical (ie 44100.0 for playback, 44100.1 for recording), so one could possibly be faster or slower than the other. In this case the recording and the playback cursor could overlap, and the output will sound corrupted. + * To counter this you might adjust the playback frequency of the channel you are playing the record sample on while it plays, using FSOUND_GetCurrentPosition and FSOUND_Record_GetPosition as calibration points. + * In the recording sample there is an example of trying to play back sound as it records, and the mechanism to try and keep the 2 cursors a safe distance from each other is employed. + *

+ * @param reverb reference to a FSoundReverbProperties. + * @return TRUE or FALSE flag whether the recorder should keep recording once it has hit the end, + * and start from the start again, therefore creating a continuous recording session into that + * sample buffer. Looping the recording buffer is good for realtime processing of recorded + * information, as you can record and playback the sample at the same time + */ + public static boolean FSOUND_Record_StartSample(FSoundSample sample, boolean loop) { + return nFSOUND_Record_StartSample(sample.sampleHandle, loop); + } + private static native boolean nFSOUND_Record_StartSample(long sampleHandle, boolean loop); + + /** + * Halts recording to the specified sample + * + * @return On success, TRUE is returned. On failure, FALSE is returned + */ + public static native boolean FSOUND_Record_Stop(); + // ---------------------------------------------------------- + + // Reverb functions + // ========================================================== + /** + * Sets hardware reverb parameters for advanced tuning. + * The best way to modify these is to set everything to use pre-defined presets given in the header, and then start modifying values + *

+ * Remarks + * You must be using FSOUND_OUTPUT_DSOUND as the output mode for this to work. + * In dsound, the reverb will only work if you have an EAX compatible soundcard such as the SBLive, and your sample/stream was created with the FSOUND_HW3D flag. + * For GameCube, use FSOUND_AUXFX_xxx api + *

+ * @param reverb reference to a FSoundReverbProperties. + * @return On success, TRUE is returned. On failure, FALSE is returned + */ + public static boolean FSOUND_Reverb_SetProperties(FSoundReverbProperties reverb) { + return nFSOUND_Reverb_SetProperties(reverb.reverbHandle); + } + private static native boolean nFSOUND_Reverb_SetProperties(long reverbHandle); + + /** + * Returns the current hardware reverb environment. + * The best way to modify these is to set everything to use pre-defined presets given in the header, and then start modifying values + *

+ * Remarks + * These values are only relevant if you are in DSOUND mode with an EAX3 compatible soundcard, or XBOX and PS2 + *

+ * @param reverb reference to a FSoundReverbProperties. + * @return On success, TRUE is returned. On failure, FALSE is returned + */ + public static boolean FSOUND_Reverb_GetProperties(FSoundReverbProperties reverb) { + return nFSOUND_Reverb_GetProperties(reverb.reverbHandle); + } + private static native boolean nFSOUND_Reverb_GetProperties(long reverbHandle); + + /** + * Sets the channel specific reverb properties for hardware, including wet/dry mix (room size), and things like obstruction and occlusion properties + *

+ * Remarks + * FSOUND_ALL is supported here. Passing this will set ALL channels to specified reverb properties. + * If FSOUND_ALL is used the last channel success flag will be returned. This return value not useful in most circumstances. + * ----------------- + * Under Win32, you must be using FSOUND_OUTPUT_DSOUND as the output mode for this to work. + * In DSound, the reverb will only work if you have an EAX compatible soundcard such as the SBLive, and your sample/stream was created with the FSOUND_HW3D flag. + * ----------------- + * On PlayStation2, the 'Room' parameter is the only parameter supported. The hardware only allows 'on' or 'off', so the reverb will be off when 'Room' is -10000 and on for every other value. + * ----------------- + * On XBox, it is possible to apply reverb to 2d voices using this function. By default reverb is turned off for 2d voices. + * If this 2d voice was being positioned in a 5.1 array with the xbox only function FSOUND_SetLevels, then calling this function will disable that capability in favour of enabling reverb for the 2d voice. + * It is a limitation of the xbox hardware that only one of the other of these features can be executed at one time. + *

+ * @param channel The channel to have its reverb properties changed. FSOUND_ALL can also be used (see remarks) + * @param reverb reference to a FSoundReverbChannelProperties. + * @return On success, TRUE is returned. On failure, FALSE is returned + */ + public static boolean FSOUND_Reverb_SetChannelProperties(int channel, FSoundReverbChannelProperties reverb) { + return nFSOUND_Reverb_SetChannelProperties(channel, reverb.reverbHandle); + } + private static native boolean nFSOUND_Reverb_SetChannelProperties(int channel, long reverbHandle); + + /** + * This function gets the current reverb properties for this channel + * @param channel The channel to have its reverb mix returned + * @param reverb reference to a FSoundReverbChannelProperties. + * @return On success, TRUE is returned. On failure, FALSE is returned + */ + public static boolean FSOUND_Reverb_GetChannelProperties(int channel, FSoundReverbChannelProperties reverb) { + return nFSOUND_Reverb_GetChannelProperties(channel, reverb.reverbHandle); + } + private static native boolean nFSOUND_Reverb_GetChannelProperties(int channel, long reverbHandle); + // ---------------------------------------------------------- + + // Callbacks + // ========================================================== + /** + * 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 dsp_callback(long dspHandle, ByteBuffer originalbuffer, ByteBuffer newbuffer, int length) { + // locate out callback and call it back + FSoundDSPCallback callback = (FSoundDSPCallback) ((FMOD.WrappedCallback) FMOD.getCallback(FMOD.FSOUND_DSPCALLBACK, dspHandle)).callback; + callback.FSOUND_DSPCALLBACK(originalbuffer, newbuffer, length); + } + + /** + * 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 stream_callback(long streamHandle, ByteBuffer buff, int length) { + // locate out callback and call it back + FMOD.WrappedCallback wCallback = (FMOD.WrappedCallback) FMOD.getCallback(FMOD.FSOUND_STREAMCALLBACK, streamHandle); + FSoundStreamCallback callback = (FSoundStreamCallback) wCallback.callback; + callback.FSOUND_STREAMCALLBACK((FSoundStream) wCallback.handled, buff, length); + } + + /** + * 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 end_callback(long streamHandle) { + // locate out callback and call it back + FMOD.WrappedCallback wCallback = (FMOD.WrappedCallback) FMOD.getCallback(FMOD.FSOUND_ENDCALLBACK, streamHandle); + FSoundStreamCallback callback = (FSoundStreamCallback) wCallback.callback; + callback.FSOUND_STREAMCALLBACK((FSoundStream) wCallback.handled, null, 0); + } + + /** + * 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 sync_callback(long streamHandle, ByteBuffer buff, int lenght) { + // locate out callback and call it back + FMOD.WrappedCallback wCallback = (FMOD.WrappedCallback) FMOD.getCallback(FMOD.FSOUND_SYNCCALLBACK, streamHandle); + FSoundStreamCallback callback = (FSoundStreamCallback) wCallback.callback; + callback.FSOUND_STREAMCALLBACK((FSoundStream) wCallback.handled, buff, lenght); + } + + /** + * 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 int open_callback(String name) { + // locate out callback and call it back + FMOD.WrappedCallback wCallback = (FMOD.WrappedCallback) FMOD.getCallback(FMOD.FSOUND_OPENCALLBACK, -1); + FSoundOpenCallback callback = (FSoundOpenCallback) wCallback.callback; + return callback.FSOUND_OPENCALLBACK(name); + } + + /** + * 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 close_callback(int handle) { + // locate out callback and call it back + FMOD.WrappedCallback wCallback = (FMOD.WrappedCallback) FMOD.getCallback(FMOD.FSOUND_CLOSECALLBACK, -1); + FSoundCloseCallback callback = (FSoundCloseCallback) wCallback.callback; + callback.FSOUND_CLOSECALLBACK(handle); + } + + /** + * 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 int read_callback(ByteBuffer buffer, int size, int handle) { + // locate out callback and call it back + FMOD.WrappedCallback wCallback = (FMOD.WrappedCallback) FMOD.getCallback(FMOD.FSOUND_CLOSECALLBACK, -1); + FSoundReadCallback callback = (FSoundReadCallback) wCallback.callback; + return callback.FSOUND_READCALLBACK(buffer, size, handle); + } + + /** + * 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 int seek_callback(int handle, int pos, int mode) { + // locate out callback and call it back + FMOD.WrappedCallback wCallback = (FMOD.WrappedCallback) FMOD.getCallback(FMOD.FSOUND_CLOSECALLBACK, -1); + FSoundSeekCallback callback = (FSoundSeekCallback) wCallback.callback; + return callback.FSOUND_SEEKCALLBACK(handle, pos, mode); + } + + /** + * 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 int tell_callback(int handle) { + // locate out callback and call it back + FMOD.WrappedCallback wCallback = (FMOD.WrappedCallback) FMOD.getCallback(FMOD.FSOUND_CLOSECALLBACK, -1); + FSoundTellCallback callback = (FSoundTellCallback) wCallback.callback; + return callback.FSOUND_TELLCALLBACK(handle); + } + // ---------------------------------------------------------- +} \ No newline at end of file diff --git a/src/java/org/lwjgl/fmod/FSoundDSPUnit.java b/src/java/org/lwjgl/fmod/FSoundDSPUnit.java new file mode 100644 index 00000000..e55161a3 --- /dev/null +++ b/src/java/org/lwjgl/fmod/FSoundDSPUnit.java @@ -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$ + *
+ * @author Brian Matzon + * @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; + } +} diff --git a/src/java/org/lwjgl/fmod/FSoundReverbChannelProperties.java b/src/java/org/lwjgl/fmod/FSoundReverbChannelProperties.java new file mode 100644 index 00000000..8a6393c0 --- /dev/null +++ b/src/java/org/lwjgl/fmod/FSoundReverbChannelProperties.java @@ -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$ + *
+ * @author Brian Matzon + * @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; + } +} diff --git a/src/java/org/lwjgl/fmod/FSoundReverbProperties.java b/src/java/org/lwjgl/fmod/FSoundReverbProperties.java new file mode 100644 index 00000000..c8c1f120 --- /dev/null +++ b/src/java/org/lwjgl/fmod/FSoundReverbProperties.java @@ -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$ + *
+ * @author Brian Matzon + * @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; + } +} diff --git a/src/java/org/lwjgl/fmod/FSoundSample.java b/src/java/org/lwjgl/fmod/FSoundSample.java new file mode 100644 index 00000000..63d2815d --- /dev/null +++ b/src/java/org/lwjgl/fmod/FSoundSample.java @@ -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$ + *
+ * @author Brian Matzon + * @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; + } +} diff --git a/src/java/org/lwjgl/fmod/FSoundSampleLock.java b/src/java/org/lwjgl/fmod/FSoundSampleLock.java new file mode 100644 index 00000000..94a89c54 --- /dev/null +++ b/src/java/org/lwjgl/fmod/FSoundSampleLock.java @@ -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$ + *
+ * @author Brian Matzon + * @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; + } +} \ No newline at end of file diff --git a/src/java/org/lwjgl/fmod/FSoundStream.java b/src/java/org/lwjgl/fmod/FSoundStream.java new file mode 100644 index 00000000..a12bd8ea --- /dev/null +++ b/src/java/org/lwjgl/fmod/FSoundStream.java @@ -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$ + *
+ * @author Brian Matzon + * @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; + } +} diff --git a/src/java/org/lwjgl/fmod/FSoundSyncPoint.java b/src/java/org/lwjgl/fmod/FSoundSyncPoint.java new file mode 100644 index 00000000..863df21e --- /dev/null +++ b/src/java/org/lwjgl/fmod/FSoundSyncPoint.java @@ -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$ + *
+ * @author Brian Matzon + * @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; + } +} diff --git a/src/java/org/lwjgl/fmod/FSoundTagField.java b/src/java/org/lwjgl/fmod/FSoundTagField.java new file mode 100644 index 00000000..6a74646b --- /dev/null +++ b/src/java/org/lwjgl/fmod/FSoundTagField.java @@ -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$ + *
+ * @author Brian Matzon + * @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; + } +} \ No newline at end of file diff --git a/src/java/org/lwjgl/fmod/callbacks/FMusicCallback.java b/src/java/org/lwjgl/fmod/callbacks/FMusicCallback.java new file mode 100644 index 00000000..7ba7394d --- /dev/null +++ b/src/java/org/lwjgl/fmod/callbacks/FMusicCallback.java @@ -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$ + *
+ * @author Brian Matzon + * @version $Revision$ + */ +public interface FMusicCallback { + public void FMUSIC_CALLBACK(FMusicModule module, int param); +} diff --git a/src/java/org/lwjgl/fmod/callbacks/FSoundCloseCallback.java b/src/java/org/lwjgl/fmod/callbacks/FSoundCloseCallback.java new file mode 100644 index 00000000..3d838904 --- /dev/null +++ b/src/java/org/lwjgl/fmod/callbacks/FSoundCloseCallback.java @@ -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$ + *
+ * @author Brian Matzon + * @version $Revision$ + */ +public interface FSoundCloseCallback { + public void FSOUND_CLOSECALLBACK(int handle); +} diff --git a/src/java/org/lwjgl/fmod/callbacks/FSoundDSPCallback.java b/src/java/org/lwjgl/fmod/callbacks/FSoundDSPCallback.java new file mode 100644 index 00000000..8d6983d8 --- /dev/null +++ b/src/java/org/lwjgl/fmod/callbacks/FSoundDSPCallback.java @@ -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$ + *
+ * @author Brian Matzon + * @version $Revision$ + */ +public interface FSoundDSPCallback { + public void FSOUND_DSPCALLBACK(ByteBuffer originalbuffer, ByteBuffer newbuffer, int length); +} diff --git a/src/java/org/lwjgl/fmod/callbacks/FSoundMetaDataCallback.java b/src/java/org/lwjgl/fmod/callbacks/FSoundMetaDataCallback.java new file mode 100644 index 00000000..582762b1 --- /dev/null +++ b/src/java/org/lwjgl/fmod/callbacks/FSoundMetaDataCallback.java @@ -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$ + *
+ * @author Brian Matzon + * @version $Revision$ + */ +public interface FSoundMetaDataCallback { + public void FSOUND_STREAMCALLBACK(FSoundStream stream, ByteBuffer buff, int len); +} diff --git a/src/java/org/lwjgl/fmod/callbacks/FSoundOpenCallback.java b/src/java/org/lwjgl/fmod/callbacks/FSoundOpenCallback.java new file mode 100644 index 00000000..10bb6243 --- /dev/null +++ b/src/java/org/lwjgl/fmod/callbacks/FSoundOpenCallback.java @@ -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$ + *
+ * @author Brian Matzon + * @version $Revision$ + */ +public interface FSoundOpenCallback { + public int FSOUND_OPENCALLBACK(String name); +} diff --git a/src/java/org/lwjgl/fmod/callbacks/FSoundReadCallback.java b/src/java/org/lwjgl/fmod/callbacks/FSoundReadCallback.java new file mode 100644 index 00000000..44dbdaed --- /dev/null +++ b/src/java/org/lwjgl/fmod/callbacks/FSoundReadCallback.java @@ -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$ + *
+ * @author Brian Matzon + * @version $Revision$ + */ +public interface FSoundReadCallback { + public int FSOUND_READCALLBACK(ByteBuffer buffer, int size, int handle); +} diff --git a/src/java/org/lwjgl/fmod/callbacks/FSoundSeekCallback.java b/src/java/org/lwjgl/fmod/callbacks/FSoundSeekCallback.java new file mode 100644 index 00000000..935fb8d0 --- /dev/null +++ b/src/java/org/lwjgl/fmod/callbacks/FSoundSeekCallback.java @@ -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$ + *
+ * @author Brian Matzon + * @version $Revision$ + */ +public interface FSoundSeekCallback { + public int FSOUND_SEEKCALLBACK(int handle, int pos, int mode); +} diff --git a/src/java/org/lwjgl/fmod/callbacks/FSoundStreamCallback.java b/src/java/org/lwjgl/fmod/callbacks/FSoundStreamCallback.java new file mode 100644 index 00000000..83c93a10 --- /dev/null +++ b/src/java/org/lwjgl/fmod/callbacks/FSoundStreamCallback.java @@ -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$ + *
+ * @author Brian Matzon + * @version $Revision$ + */ +public interface FSoundStreamCallback { + public void FSOUND_STREAMCALLBACK(FSoundStream stream, ByteBuffer buff, int len); +} diff --git a/src/java/org/lwjgl/fmod/callbacks/FSoundTellCallback.java b/src/java/org/lwjgl/fmod/callbacks/FSoundTellCallback.java new file mode 100644 index 00000000..ad5381e7 --- /dev/null +++ b/src/java/org/lwjgl/fmod/callbacks/FSoundTellCallback.java @@ -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$ + *
+ * @author Brian Matzon + * @version $Revision$ + */ +public interface FSoundTellCallback { + public int FSOUND_TELLCALLBACK(int handle); +} diff --git a/src/java/org/lwjgl/test/fmod/CDDAPlayer.java b/src/java/org/lwjgl/test/fmod/CDDAPlayer.java new file mode 100644 index 00000000..2bf4ae56 --- /dev/null +++ b/src/java/org/lwjgl/test/fmod/CDDAPlayer.java @@ -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$ + *
+ * @author Brian Matzon + * @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 \":\""); + System.out.println("2: FSOUND_Stream_Open \":?\""); + System.out.println("3: FSOUND_Stream_Open \":!\""); + System.out.println("4: FSOUND_Stream_SetSubStream "); + 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(); + } +} \ No newline at end of file diff --git a/src/java/org/lwjgl/test/fmod/CDPlayer.java b/src/java/org/lwjgl/test/fmod/CDPlayer.java new file mode 100644 index 00000000..77eb1b27 --- /dev/null +++ b/src/java/org/lwjgl/test/fmod/CDPlayer.java @@ -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$ + *
+ * @author Brian Matzon + * @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 "); + System.out.println("2: FSOUND_CD_Play "); + System.out.println("3: FSOUND_CD_Stop "); + System.out.println("4: FSOUND_CD_GetNumTracks "); + System.out.println("5: FSOUND_CD_GetPaused "); + System.out.println("6: FSOUND_CD_GetTrack "); + System.out.println("7: FSOUND_CD_GetTrackLength "); + System.out.println("8: FSOUND_CD_GetTrackTime "); + System.out.println("9: FSOUND_CD_SetPaused "); + System.out.println("10: FSOUND_CD_SetPlayMode "); + System.out.println("11: FSOUND_CD_SetTrackTime "); + System.out.println("12: FSOUND_CD_SetVolume "); + 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(); + } +} \ No newline at end of file diff --git a/src/java/org/lwjgl/test/fmod/MusicPlayer.java b/src/java/org/lwjgl/test/fmod/MusicPlayer.java new file mode 100644 index 00000000..ed389529 --- /dev/null +++ b/src/java/org/lwjgl/test/fmod/MusicPlayer.java @@ -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$ + *
+ * @author Brian Matzon + * @version $Revision$ + */ +public class MusicPlayer { + + public static void main(String[] args) { + if(args.length < 1) { + System.out.println("Usage:\n MusicPlayer "); + 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; + } +} diff --git a/src/java/org/lwjgl/test/fmod/StreamPlayer.java b/src/java/org/lwjgl/test/fmod/StreamPlayer.java new file mode 100644 index 00000000..33ae7887 --- /dev/null +++ b/src/java/org/lwjgl/test/fmod/StreamPlayer.java @@ -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$
+ * + * @author Brian Matzon + * @version $Revision$ + */ +public class StreamPlayer { + + public static void main(String[] args) { + if (args.length < 1) { + System.out.println("Usage:\n StreamPlayer "); + 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; + } +} \ No newline at end of file diff --git a/src/native/common/fmod/extfmod.cpp b/src/native/common/fmod/extfmod.cpp new file mode 100644 index 00000000..78babe91 --- /dev/null +++ b/src/native/common/fmod/extfmod.cpp @@ -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 +#include +#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); + } +} \ No newline at end of file diff --git a/src/native/common/fmod/extfmod.h b/src/native/common/fmod/extfmod.h new file mode 100644 index 00000000..6855c972 --- /dev/null +++ b/src/native/common/fmod/extfmod.h @@ -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 +#include "../common_tools.h" + +#include "fmoddyn.h" +#include "fmod_errors.h" + +extern FMOD_INSTANCE * fmod; + +void fmod_create(char*); +void fmod_destroy(); + +#endif \ No newline at end of file diff --git a/src/native/common/fmod/org_lwjgl_fmod_FMOD.cpp b/src/native/common/fmod/org_lwjgl_fmod_FMOD.cpp new file mode 100644 index 00000000..a24d7a1a --- /dev/null +++ b/src/native/common/fmod/org_lwjgl_fmod_FMOD.cpp @@ -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;iGetObjectArrayElement(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)); +} \ No newline at end of file diff --git a/src/native/common/fmod/org_lwjgl_fmod_FMOD.h b/src/native/common/fmod/org_lwjgl_fmod_FMOD.h new file mode 100644 index 00000000..642a94b8 --- /dev/null +++ b/src/native/common/fmod/org_lwjgl_fmod_FMOD.h @@ -0,0 +1,126 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* 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 diff --git a/src/native/common/fmod/org_lwjgl_fmod_FMusic.cpp b/src/native/common/fmod/org_lwjgl_fmod_FMusic.cpp new file mode 100644 index 00000000..13a6ea8f --- /dev/null +++ b/src/native/common/fmod/org_lwjgl_fmod_FMusic.cpp @@ -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; + } diff --git a/src/native/common/fmod/org_lwjgl_fmod_FMusic.h b/src/native/common/fmod/org_lwjgl_fmod_FMusic.h new file mode 100644 index 00000000..a383cfe3 --- /dev/null +++ b/src/native/common/fmod/org_lwjgl_fmod_FMusic.h @@ -0,0 +1,379 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* 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 diff --git a/src/native/common/fmod/org_lwjgl_fmod_FSound.cpp b/src/native/common/fmod/org_lwjgl_fmod_FSound.cpp new file mode 100644 index 00000000..cbd717d0 --- /dev/null +++ b/src/native/common/fmod/org_lwjgl_fmod_FSound.cpp @@ -0,0 +1,1757 @@ +/* +* 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_FSound.h" +#include "extfmod.h" + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_Close +* Signature: ()V +*/ +JNIEXPORT void JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1Close(JNIEnv * env, jclass clazz) { + fmod->FSOUND_Close(); +} + + +/* +* Class: org_lwjgl_fmod_FSound +* Method: nFSOUND_File_SetCallbacks +* Signature: ()V +*/ +JNIEXPORT void JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1File_1SetCallbacks(JNIEnv * env, jclass clazz) { + throwFMODException(env, "missing implementation"); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_Init +* Signature: (III)Z +*/ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1Init +(JNIEnv *env, jclass clazz, jint mixrate, jint channels, jint flags) { + return fmod->FSOUND_Init(mixrate, channels, flags); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_SetBufferSize +* Signature: (I)Z +*/ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1SetBufferSize(JNIEnv * env, jclass clazz, jint len_ms) { + return fmod->FSOUND_SetBufferSize(len_ms); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_SetDriver +* Signature: (I)Z +*/ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1SetDriver(JNIEnv * env, jclass clazz, jint driver) { + return fmod->FSOUND_SetDriver(driver); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_SetHWND +* Signature: ()Z +*/ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1SetHWND(JNIEnv * env, jclass clazz) { + throwFMODException(env, "missing implementation"); + return false; +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_SetMaxHardwareChannels +* Signature: (I)Z +*/ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1SetMaxHardwareChannels(JNIEnv * env, jclass clazz, jint max) { + return fmod->FSOUND_SetMaxHardwareChannels(max); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_SetMinHardwareChannels +* Signature: (I)Z +*/ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1SetMinHardwareChannels(JNIEnv * env, jclass clazz, jint min) { + return fmod->FSOUND_SetMinHardwareChannels(min); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_SetMixer +* Signature: (I)Z +*/ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1SetMixer(JNIEnv * env, jclass clazz, jint mixer) { + return fmod->FSOUND_SetMixer(mixer); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_SetOutput +* Signature: (I)Z +*/ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1SetOutput(JNIEnv * env, jclass clazz, jint outputtype) { + return fmod->FSOUND_SetOutput(outputtype); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_SetPanSeperation +* Signature: (F)V +*/ +JNIEXPORT void JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1SetPanSeperation(JNIEnv * env, jclass clazz, jfloat pansep) { + return fmod->FSOUND_SetPanSeperation(pansep); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_SetSFXMasterVolume +* Signature: (I)V +*/ +JNIEXPORT void JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1SetSFXMasterVolume(JNIEnv * env, jclass clazz, jint volume) { + fmod->FSOUND_SetSFXMasterVolume(volume); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_SetSpeakerMode +* Signature: (I)V +*/ +JNIEXPORT void JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1SetSpeakerMode(JNIEnv * env, jclass clazz, jint speakermode) { + fmod->FSOUND_SetSpeakerMode(speakermode); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_Update +* Signature: ()V +*/ +JNIEXPORT void JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1Update(JNIEnv * env, jclass clazz) { + fmod->FSOUND_Update(); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_GetCPUUsage +* Signature: ()F +*/ +JNIEXPORT jfloat JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1GetCPUUsage(JNIEnv * env, jclass clazz) { + return fmod->FSOUND_GetCPUUsage(); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_GetChannelsPlaying +* Signature: ()I +*/ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1GetChannelsPlaying(JNIEnv * env, jclass clazz) { + return fmod->FSOUND_GetChannelsPlaying(); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_GetDriver +* Signature: ()I +*/ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1GetDriver(JNIEnv * env, jclass clazz) { + return fmod->FSOUND_GetDriver(); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_GetDriverCaps +* Signature: (ILjava/nio/IntBuffer;)Z +*/ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1GetDriverCaps(JNIEnv * env, jclass clazz, jint, jobject) { + throwFMODException(env, "missing implementation"); + return false; +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_GetDriverName +* Signature: (I)Ljava/lang/String; +*/ +JNIEXPORT jstring JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1GetDriverName(JNIEnv * env, jclass clazz, jint id) { + return env->NewStringUTF((const char *) fmod->FSOUND_GetDriverName(id)); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_GetError +* Signature: ()I +*/ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1GetError(JNIEnv * env, jclass clazz) { + return fmod->FSOUND_GetError(); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_GetMaxSamples +* Signature: ()I +*/ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1GetMaxSamples(JNIEnv * env, jclass clazz) { + return fmod->FSOUND_GetMaxSamples(); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_GetMaxChannels +* Signature: ()I +*/ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1GetMaxChannels(JNIEnv * env, jclass clazz) { + return fmod->FSOUND_GetMaxChannels(); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_GetMemoryStats +* Signature: (Ljava/nio/IntBuffer;)V +*/ +JNIEXPORT void JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1GetMemoryStats(JNIEnv * env, jclass clazz, jobject) { + throwFMODException(env, "missing implementation"); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_GetNumDrivers +* Signature: ()I +*/ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1GetNumDrivers(JNIEnv * env, jclass clazz) { + return fmod->FSOUND_GetNumDrivers(); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_GetNumHWChannels +* Signature: (Ljava/nio/IntBuffer;)Z +*/ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1GetNumHWChannels(JNIEnv * env, jclass clazz, jobject) { + throwFMODException(env, "missing implementation"); + return false; +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_GetOutput +* Signature: ()I +*/ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1GetOutput(JNIEnv * env, jclass clazz) { + return fmod->FSOUND_GetOutput(); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_GetOutputRate +* Signature: ()I +*/ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1GetOutputRate(JNIEnv * env, jclass clazz) { + return fmod->FSOUND_GetOutputRate(); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_GetSFXMasterVolume +* Signature: ()I +*/ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1GetSFXMasterVolume(JNIEnv * env, jclass clazz) { + return fmod->FSOUND_GetSFXMasterVolume(); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_GetVersion +* Signature: ()F +*/ +JNIEXPORT jfloat JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1GetVersion(JNIEnv * env, jclass clazz) { + return fmod->FSOUND_GetVersion(); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: nFSOUND_Sample_Alloc +* Signature: (IIIIIII)J +*/ +JNIEXPORT jlong JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Sample_1Alloc(JNIEnv * env, jclass clazz, jint, jint, jint, jint, jint, jint, jint) { + throwFMODException(env, "missing implementation"); + return 0; +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: nFSOUND_Sample_Free +* Signature: (J)V +*/ +JNIEXPORT void JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Sample_1Free(JNIEnv * env, jclass clazz, jlong) { + //XXX + throwFMODException(env, "missing implementation"); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: nFSOUND_Sample_Get +* Signature: (I)J +*/ +JNIEXPORT jlong JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Sample_1Get(JNIEnv * env, jclass clazz, jint sampno) { + return (jlong) fmod->FSOUND_Sample_Get(sampno); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: nFSOUND_Sample_GetDefaults +* Signature: (JLjava/nio/IntBuffer;ILjava/nio/IntBuffer;ILjava/nio/IntBuffer;ILjava/nio/IntBuffer;I)Z +*/ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Sample_1GetDefaults(JNIEnv * env, jclass clazz, jlong, jobject, jint, jobject, jint, jobject, jint, jobject, jint) { + //XXX + throwFMODException(env, "missing implementation"); + return false; +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: nFSOUND_Sample_GetDefaultsEx +* Signature: (JLjava/nio/IntBuffer;ILjava/nio/IntBuffer;ILjava/nio/IntBuffer;ILjava/nio/IntBuffer;ILjava/nio/IntBuffer;ILjava/nio/IntBuffer;ILjava/nio/IntBuffer;I)Z +*/ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Sample_1GetDefaultsEx(JNIEnv * env, jclass clazz, jlong, jobject, jint, jobject, jint, jobject, jint, jobject, jint, jobject, jint, jobject, jint, jobject, jint) { + //XXX + throwFMODException(env, "missing implementation"); + return false; +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: nFSOUND_Sample_GetLength +* Signature: (J)I +*/ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Sample_1GetLength(JNIEnv * env, jclass clazz, jlong sptr) { + return fmod->FSOUND_Sample_GetLength((FSOUND_SAMPLE *) sptr); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: nFSOUND_Sample_GetLoopPoints +* Signature: (JLjava/nio/IntBuffer;ILjava/nio/IntBuffer;I)I +*/ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Sample_1GetLoopPoints(JNIEnv * env, jclass clazz, jlong, jobject, jint, jobject, jint) { + //XXX + throwFMODException(env, "missing implementation"); + return 0; +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: nFSOUND_Sample_GetMinMaxDistance +* Signature: (JLjava/nio/FloatBuffer;ILjava/nio/FloatBuffer;I)I +*/ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Sample_1GetMinMaxDistance(JNIEnv * env, jclass clazz, jlong, jobject, jint, jobject, jint) { + //XXX + throwFMODException(env, "missing implementation"); + return 0; +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: nFSOUND_Sample_GetMode +* Signature: (J)I +*/ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Sample_1GetMode(JNIEnv * env, jclass clazz, jlong sptr) { + return fmod->FSOUND_Sample_GetMode((FSOUND_SAMPLE *) sptr); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: nFSOUND_Sample_GetName +* Signature: (J)Ljava/lang/String; +*/ +JNIEXPORT jstring JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Sample_1GetName(JNIEnv * env, jclass clazz, jlong sptr) { + return env->NewStringUTF(fmod->FSOUND_Sample_GetName((FSOUND_SAMPLE *) sptr)); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: nFSOUND_Sample_Load +* Signature: (ILjava/nio/ByteBuffer;IIII)J +*/ +JNIEXPORT jlong JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Sample_1Load__ILjava_nio_ByteBuffer_2IIII(JNIEnv * env, jclass clazz, jint, jobject, jint, jint, jint, jint) { + //XXX + throwFMODException(env, "missing implementation"); + return 0; +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: nFSOUND_Sample_Load +* Signature: (ILjava/lang/String;III)J +*/ +JNIEXPORT jlong JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Sample_1Load__ILjava_lang_String_2III(JNIEnv * env, jclass clazz, jint, jstring, jint, jint, jint) { + //XX + return 0; +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: nFSOUND_Sample_Lock +* Signature: (JIILorg/lwjgl/fmod/FSoundSampleLock;)Z +*/ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Sample_1Lock(JNIEnv * env, jclass clazz, jlong, jint, jint, jobject) { + //XXX + throwFMODException(env, "missing implementation"); + return false; +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: nFSOUND_Sample_SetDefaults +* Signature: (JIIII)Z +*/ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Sample_1SetDefaults(JNIEnv * env, jclass clazz, jlong, jint, jint, jint, jint) { + //XXX + throwFMODException(env, "missing implementation"); + return false; +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: nFSOUND_Sample_SetDefaultsEx +* Signature: (JIIIIIII)Z +*/ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Sample_1SetDefaultsEx(JNIEnv * env, jclass clazz, jlong, jint, jint, jint, jint, jint, jint, jint) { + //XXX + throwFMODException(env, "missing implementation"); + return false; +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: nFSOUND_Sample_SetMaxPlaybacks +* Signature: (JI)Z +*/ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Sample_1SetMaxPlaybacks(JNIEnv * env, jclass clazz, jlong sptr, jint max) { + return fmod->FSOUND_Sample_SetMaxPlaybacks((FSOUND_SAMPLE*) sptr, max); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: nFSOUND_Sample_SetMinMaxDistance +* Signature: (JFF)Z +*/ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Sample_1SetMinMaxDistance(JNIEnv * env, jclass clazz, jlong sptr, jfloat min, jfloat max) { + return fmod->FSOUND_Sample_SetMinMaxDistance((FSOUND_SAMPLE*) sptr, min, max); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: nFSOUND_Sample_SetMode +* Signature: (JI)Z +*/ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Sample_1SetMode(JNIEnv * env, jclass clazz, jlong sptr, jint mode) { + return fmod->FSOUND_Sample_SetMode((FSOUND_SAMPLE*) sptr, mode); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: nFSOUND_Sample_SetLoopPoints +* Signature: (JII)Z +*/ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Sample_1SetLoopPoints(JNIEnv * env, jclass clazz, jlong sptr, jint loopstart, jint loopend) { + return fmod->FSOUND_Sample_SetLoopPoints((FSOUND_SAMPLE*) sptr, loopstart, loopend); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: nFSOUND_Sample_Unlock +* Signature: (JILorg/lwjgl/fmod/FSoundSampleLock;)Z +*/ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Sample_1Unlock(JNIEnv * env, jclass clazz, jlong, jint, jobject) { + //XXX + throwFMODException(env, "missing implementation"); + return false; +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: nFSOUND_Sample_Upload +* Signature: (JLjava/nio/ByteBuffer;II)Z +*/ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Sample_1Upload(JNIEnv * env, jclass clazz, jlong, jobject, jint, jint) { + //XXX + throwFMODException(env, "missing implementation"); + return false; +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: nFSOUND_PlaySound +* Signature: (IJ)I +*/ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1PlaySound(JNIEnv * env, jclass clazz, jint channel, jlong sptr) { + return fmod->FSOUND_PlaySound(channel, (FSOUND_SAMPLE*) sptr); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: nFSOUND_PlaySoundEx +* Signature: (IJJZ)I +*/ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1PlaySoundEx(JNIEnv * env, jclass clazz, jint channel, jlong sptr, jlong dsp, jboolean startpaused) { + return fmod->FSOUND_PlaySoundEx(channel, (FSOUND_SAMPLE*) sptr, (FSOUND_DSPUNIT*) dsp, startpaused); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_StopSound +* Signature: (I)Z +*/ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1StopSound(JNIEnv * env, jclass clazz, jint channel) { + return fmod->FSOUND_StopSound(channel); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_SetFrequency +* Signature: (II)Z +*/ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1SetFrequency(JNIEnv * env, jclass clazz, jint channel, jint freq) { + return fmod->FSOUND_SetFrequency(channel, freq); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_SetLevels +* Signature: (IIIIIII)Z +*/ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1SetLevels(JNIEnv * env, jclass clazz, jint, jint, jint, jint, jint, jint, jint) { + //XBOX only + //XXX + return false; +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_SetLoopMode +* Signature: (II)Z +*/ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1SetLoopMode(JNIEnv * env, jclass clazz, jint channel, jint loopmode) { + return fmod->FSOUND_SetLoopMode(channel, loopmode); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_SetMute +* Signature: (IZ)Z +*/ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1SetMute(JNIEnv * env, jclass clazz, jint channel, jboolean mute) { + return fmod->FSOUND_SetMute(channel, mute); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_SetPan +* Signature: (II)Z +*/ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1SetPan(JNIEnv * env, jclass clazz, jint channel, jint pan) { + return fmod->FSOUND_SetPan(channel, pan); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_SetPaused +* Signature: (IZ)Z +*/ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1SetPaused(JNIEnv * env, jclass clazz, jint channel, jboolean paused) { + return fmod->FSOUND_SetPaused(channel, paused); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_SetPriority +* Signature: (II)Z +*/ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1SetPriority(JNIEnv * env, jclass clazz, jint channel, jint priority) { + return fmod->FSOUND_SetPriority(channel, priority); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_SetReserved +* Signature: (IZ)Z +*/ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1SetReserved(JNIEnv * env, jclass clazz, jint channel, jboolean reserved) { + return fmod->FSOUND_SetReserved(channel, reserved); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_SetSurround +* Signature: (IZ)Z +*/ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1SetSurround(JNIEnv * env, jclass clazz, jint channel, jboolean surround) { + return fmod->FSOUND_SetSurround(channel, surround); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_SetVolume +* Signature: (II)Z +*/ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1SetVolume(JNIEnv * env, jclass clazz, jint channel, jint vol) { + return fmod->FSOUND_SetVolume(channel, vol); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_SetVolumeAbsolute +* Signature: (II)Z +*/ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1SetVolumeAbsolute(JNIEnv * env, jclass clazz, jint channel, jint vol) { + return fmod->FSOUND_SetVolumeAbsolute(channel, vol); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_GetVolume +* Signature: ()I +*/ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1GetVolume(JNIEnv * env, jclass clazz, jint channel) { + return fmod->FSOUND_GetVolume(channel); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_GetAmplitude +* Signature: ()I +*/ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1GetAmplitude(JNIEnv * env, jclass clazz, jint channel) { + return fmod->FSOUND_GetAmplitude(channel); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: nFSOUND_3D_SetAttributes +* Signature: (ILjava/nio/FloatBuffer;ILjava/nio/FloatBuffer;I)Z +*/ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_13D_1SetAttributes(JNIEnv * env, jclass clazz, jint, jobject, jint, jobject, jint) { + //XXX + throwFMODException(env, "missing implementation"); + return false; +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_3D_SetMinMaxDistance +* Signature: (III)Z +*/ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_13D_1SetMinMaxDistance(JNIEnv * env, jclass clazz, jint channel, jint min, jint max) { + return fmod->FSOUND_3D_SetMinMaxDistance(channel, min, max); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_SetCurrentPosition +* Signature: (II)Z +*/ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1SetCurrentPosition(JNIEnv * env, jclass clazz, jint channel, jint offset) { + return fmod->FSOUND_SetCurrentPosition(channel, offset); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_GetCurrentPosition +* Signature: (I)I +*/ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1GetCurrentPosition(JNIEnv * env, jclass clazz, jint channel) { + return fmod->FSOUND_GetCurrentPosition(channel); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: nFSOUND_GetCurrentSample +* Signature: (I)J +*/ +JNIEXPORT jlong JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1GetCurrentSample(JNIEnv * env, jclass clazz, jint channel) { + return (jlong) fmod->FSOUND_GetCurrentSample(channel); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: nFSOUND_GetCurrentLevels +* Signature: (ILjava/nio/FloatBuffer;I)Z +*/ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1GetCurrentLevels(JNIEnv * env, jclass clazz, jint, jobject, jint) { + //XXX + throwFMODException(env, "missing implementation"); + return false; +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_GetFrequency +* Signature: (I)I +*/ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1GetFrequency(JNIEnv * env, jclass clazz, jint channel) { + return fmod->FSOUND_GetFrequency(channel); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_GetLoopMode +* Signature: (I)I +*/ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1GetLoopMode(JNIEnv * env, jclass clazz, jint channel) { + return fmod->FSOUND_GetLoopMode(channel); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_GetMixer +* Signature: ()I +*/ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1GetMixer(JNIEnv * env, jclass clazz) { + return fmod->FSOUND_GetMixer(); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_GetMute +* Signature: (I)Z +*/ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1GetMute(JNIEnv * env, jclass clazz, jint channel) { + return fmod->FSOUND_GetMute(channel); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_GetNumSubChannels +* Signature: (I)I +*/ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1GetNumSubChannels(JNIEnv * env, jclass clazz, jint channel) { + return fmod->FSOUND_GetNumSubChannels(channel); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_GetPan +* Signature: (I)I +*/ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1GetPan(JNIEnv * env, jclass clazz, jint channel) { + return fmod->FSOUND_GetPan(channel); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_GetPaused +* Signature: (I)Z +*/ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1GetPaused(JNIEnv * env, jclass clazz, jint channel) { + return fmod->FSOUND_GetPaused(channel); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_GetPriority +* Signature: (I)I +*/ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1GetPriority(JNIEnv * env, jclass clazz, jint channel) { + return fmod->FSOUND_GetPriority(channel); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_GetReserved +* Signature: (I)I +*/ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1GetReserved(JNIEnv * env, jclass clazz, jint channel) { + return fmod->FSOUND_GetReserved(channel); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_GetSubChannel +* Signature: (II)I +*/ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1GetSubChannel(JNIEnv * env, jclass clazz, jint channel, jint subchannel) { + return fmod->FSOUND_GetSubChannel(channel, subchannel); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_GetSurround +* Signature: (I)I +*/ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1GetSurround(JNIEnv * env, jclass clazz, jint channel) { + return fmod->FSOUND_GetSurround(channel); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_IsPlaying +* Signature: (I)Z +*/ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1IsPlaying(JNIEnv * env, jclass clazz, jint channel) { + return fmod->FSOUND_IsPlaying(channel); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: nFSOUND_3D_GetAttributes +* Signature: (ILjava/nio/FloatBuffer;ILjava/nio/FloatBuffer;I)Z +*/ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_13D_1GetAttributes(JNIEnv * env, jclass clazz, jint, jobject, jint, jobject, jint) { + //XXX + throwFMODException(env, "missing implementation"); + return false; +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: nFSOUND_3D_GetMinMaxDistance +* Signature: (ILjava/nio/FloatBuffer;I)Z +*/ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_13D_1GetMinMaxDistance(JNIEnv * env, jclass clazz, jint, jobject, jint) { + //XXX + throwFMODException(env, "missing implementation"); + return false; +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: nFSOUND_3D_Listener_GetAttributes +* Signature: (Ljava/nio/FloatBuffer;ILjava/nio/FloatBuffer;ILjava/nio/FloatBuffer;ILjava/nio/FloatBuffer;ILjava/nio/FloatBuffer;ILjava/nio/FloatBuffer;ILjava/nio/FloatBuffer;ILjava/nio/FloatBuffer;I)V +*/ +JNIEXPORT void JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_13D_1Listener_1GetAttributes(JNIEnv * env, jclass clazz, jobject, jint, jobject, jint, jobject, jint, jobject, jint, jobject, jint, jobject, jint, jobject, jint, jobject, jint) { + //XXX + throwFMODException(env, "missing implementation"); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: nFSOUND_3D_Listener_SetAttributes +* Signature: (Ljava/nio/FloatBuffer;ILjava/nio/FloatBuffer;IFFFFFF)V +*/ +JNIEXPORT void JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_13D_1Listener_1SetAttributes(JNIEnv * env, jclass clazz, jobject, jint, jobject, jint, jfloat, jfloat, jfloat, jfloat, jfloat, jfloat) { + //XXX + throwFMODException(env, "missing implementation"); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_3D_Listener_SetCurrent +* Signature: (II)V +*/ +JNIEXPORT void JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_13D_1Listener_1SetCurrent(JNIEnv * env, jclass clazz, jint current, jint numlisteners) { + fmod->FSOUND_3D_Listener_SetCurrent(current, numlisteners); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_3D_SetDistanceFactor +* Signature: (F)V +*/ +JNIEXPORT void JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_13D_1SetDistanceFactor(JNIEnv * env, jclass clazz, jfloat scale) { + fmod->FSOUND_3D_SetDistanceFactor(scale); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_3D_SetDopplerFactor +* Signature: (F)V +*/ +JNIEXPORT void JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_13D_1SetDopplerFactor(JNIEnv * env, jclass clazz, jfloat scale) { + return fmod->FSOUND_3D_SetDopplerFactor(scale); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_3D_SetRolloffFactor +* Signature: (F)V +*/ +JNIEXPORT void JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_13D_1SetRolloffFactor(JNIEnv * env, jclass clazz, jfloat scale) { + return fmod->FSOUND_3D_SetRolloffFactor(scale); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: nFSOUND_Stream_Open +* Signature: (Ljava/nio/ByteBuffer;IIII)J +*/ +JNIEXPORT jlong JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Stream_1Open__Ljava_nio_ByteBuffer_2IIII(JNIEnv * env, jclass clazz, jobject data, jint dataOffset, jint mode, jint offset, jint length) { + const char *streamData = dataOffset + (char *) env->GetDirectBufferAddress(data); + return (jlong) fmod->FSOUND_Stream_Open(streamData, mode, offset, length); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: nFSOUND_Stream_Open +* Signature: (Ljava/lang/String;III)J +*/ +JNIEXPORT jlong JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Stream_1Open__Ljava_lang_String_2III(JNIEnv * env, jclass clazz, jstring name, jint mode, jint offset, jint length) { + const char* filename = (const char*) (env->GetStringUTFChars(name, 0)); + return (jlong) fmod->FSOUND_Stream_Open(filename, mode, offset, length); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: nFSOUND_Stream_Play +* Signature: (IJ)I +*/ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Stream_1Play(JNIEnv * env, jclass clazz, jint channel, jlong handle) { + return fmod->FSOUND_Stream_Play(channel, (FSOUND_STREAM*) handle); +} + +/* + * Class: org_lwjgl_fmod_FSound + * Method: nFSOUND_Stream_PlayEx + * Signature: (IJJZ)I + */ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Stream_1PlayEx(JNIEnv * env, jclass clazz, jint channel, jlong stream, jlong dsp, jboolean startpaused) { + return fmod->FSOUND_Stream_PlayEx(channel, (FSOUND_STREAM*) stream, (FSOUND_DSPUNIT*) dsp, startpaused); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: nFSOUND_Stream_Stop +* Signature: (J)Z +*/ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Stream_1Stop(JNIEnv * env, jclass clazz, jlong handle) { + return fmod->FSOUND_Stream_Stop((FSOUND_STREAM*) handle); +} + + +/* +* Class: org_lwjgl_fmod_FSound +* Method: nFSOUND_Stream_Close +* Signature: (J)Z +*/ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Stream_1Close(JNIEnv * env, jclass clazz, jlong handle) { + return fmod->FSOUND_Stream_Close((FSOUND_STREAM*) handle); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: nFSOUND_Stream_GetNumSubStreams +* Signature: (J)I +*/ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Stream_1GetNumSubStreams(JNIEnv * env, jclass clazz, jlong handle) { + return fmod->FSOUND_Stream_GetNumSubStreams((FSOUND_STREAM*) handle); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: nFSOUND_Stream_SetSubStream +* Signature: (JI)I +*/ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Stream_1SetSubStream(JNIEnv * env, jclass clazz, jlong handle, jint index) { + return fmod->FSOUND_Stream_SetSubStream((FSOUND_STREAM*) handle, index); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: nFSOUND_Stream_AddSyncPoint +* Signature: (JILjava/lang/String;)J +*/ +JNIEXPORT jlong JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Stream_1AddSyncPoint(JNIEnv * env, jclass clazz, jlong, jint, jstring) { + //XXX + throwFMODException(env, "missing implementation"); + return 0; +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: nFSOUND_Stream_Create +* Signature: (III)J +*/ +JNIEXPORT jlong JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Stream_1Create(JNIEnv * env, jclass clazz, jint, jint, jint) { + //XXX + throwFMODException(env, "missing implementation"); + return 0; +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: nFSOUND_Stream_CreateDSP +* Signature: (JI)J +*/ +JNIEXPORT jlong JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Stream_1CreateDSP(JNIEnv * env, jclass clazz, jlong, jint) { + //XXX + throwFMODException(env, "missing implementation"); + return 0; +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: nFSOUND_Stream_DeleteSyncPoint +* Signature: (J)Z +*/ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Stream_1DeleteSyncPoint(JNIEnv * env, jclass clazz, jlong point) { + return fmod->FSOUND_Stream_DeleteSyncPoint((FSOUND_SYNCPOINT*) point); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: nFSOUND_Stream_FindTagField +* Signature: (JILjava/lang/String;Lorg/lwjgl/fmod/FSoundTagField;)Z +*/ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Stream_1FindTagField(JNIEnv * env, jclass clazz, jlong, jint, jstring, jobject) { + //XXX + throwFMODException(env, "missing implementation"); + return false; +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: nFSOUND_Stream_GetLength +* Signature: (J)Z +*/ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Stream_1GetLength(JNIEnv * env, jclass clazz, jlong stream) { + return fmod->FSOUND_Stream_GetLength((FSOUND_STREAM*) stream); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: nFSOUND_Stream_GetLengthMs +* Signature: (J)Z +*/ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Stream_1GetLengthMs(JNIEnv * env, jclass clazz, jlong stream) { + return fmod->FSOUND_Stream_GetLengthMs((FSOUND_STREAM*) stream); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: nFSOUND_Stream_GetMode +* Signature: (J)I +*/ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Stream_1GetMode(JNIEnv * env, jclass clazz, jlong stream) { + return fmod->FSOUND_Stream_GetMode((FSOUND_STREAM*) stream); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: nFSOUND_Stream_GetNumSyncPoints +* Signature: (J)I +*/ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Stream_1GetNumSyncPoints(JNIEnv * env, jclass clazz, jlong stream) { + return fmod->FSOUND_Stream_GetNumSyncPoints((FSOUND_STREAM*) stream); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: nFSOUND_Stream_GetNumTagFields +* Signature: (JLjava/nio/IntBuffer;I)Z +*/ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Stream_1GetNumTagFields(JNIEnv * env, jclass clazz, jlong, jobject, jint) { + // XXX + return false; +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: nFSOUND_Stream_GetOpenState +* Signature: (J)I +*/ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Stream_1GetOpenState(JNIEnv * env, jclass clazz, jlong stream) { + return fmod->FSOUND_Stream_GetOpenState((FSOUND_STREAM*) stream); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: nFSOUND_Stream_GetPosition +* Signature: (J)I +*/ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Stream_1GetPosition(JNIEnv * env, jclass clazz, jlong stream) { + return fmod->FSOUND_Stream_GetPosition((FSOUND_STREAM*) stream); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: nFSOUND_Stream_GetSample +* Signature: (J)J +*/ +JNIEXPORT jlong JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Stream_1GetSample(JNIEnv * env, jclass clazz, jlong stream) { + return (jlong) fmod->FSOUND_Stream_GetSample((FSOUND_STREAM*) stream); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: nFSOUND_Stream_GetSyncPoint +* Signature: (JI)J +*/ +JNIEXPORT jlong JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Stream_1GetSyncPoint(JNIEnv * env, jclass clazz, jlong stream, jint index) { + return (jlong) fmod->FSOUND_Stream_GetSyncPoint((FSOUND_STREAM*) stream, index); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: nFSOUND_Stream_GetSyncPointInfo +* Signature: (JLjava/nio/IntBuffer;I)Ljava/lang/String; +*/ +JNIEXPORT jstring JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Stream_1GetSyncPointInfo(JNIEnv * env, jclass clazz, jlong, jobject, jint) { + //XXX + throwFMODException(env, "missing implementation"); + return NULL; +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: nFSOUND_Stream_GetTagField +* Signature: (JILorg/lwjgl/fmod/FSoundTagField;)Z +*/ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Stream_1GetTagField(JNIEnv * env, jclass clazz, jlong, jint, jobject) { + //XXX + throwFMODException(env, "missing implementation"); + return false; +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: nFSOUND_Stream_GetTime +* Signature: (J)I +*/ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Stream_1GetTime(JNIEnv * env, jclass clazz, jlong stream) { + return fmod->FSOUND_Stream_GetTime((FSOUND_STREAM*) stream); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: nFSOUND_Stream_Net_GetBufferProperties +* Signature: (Ljava/nio/IntBuffer;I)Z +*/ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Stream_1Net_1GetBufferProperties(JNIEnv * env, jclass clazz, jobject, jint) { + //XXX + throwFMODException(env, "missing implementation"); + return false; +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_Stream_Net_GetBufferProperties +* Signature: ()Ljava/lang/String; +*/ +JNIEXPORT jstring JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1Stream_1Net_1GetLastServerStatus(JNIEnv * env, jclass clazz) { + return env->NewStringUTF(fmod->FSOUND_Stream_Net_GetLastServerStatus()); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: nFSOUND_Stream_Net_GetStatus +* Signature: (JLjava/nio/IntBuffer;I)Z +*/ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Stream_1Net_1GetStatus(JNIEnv * env, jclass clazz, jlong, jobject, jint) { + //XXX + throwFMODException(env, "missing implementation"); + return false; +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_Stream_Net_SetBufferProperties +* Signature: (III)Ljava/lang/String; +*/ +JNIEXPORT jstring JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1Stream_1Net_1SetBufferProperties(JNIEnv * env, jclass clazz, jint, jint, jint) { + //XXX + throwFMODException(env, "missing implementation"); + return NULL; +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: nFSOUND_Stream_Net_SetMetadataCallback +* Signature: (J)Z +*/ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Stream_1Net_1SetMetadataCallback(JNIEnv * env, jclass clazz, jlong) { + //XXX + throwFMODException(env, "missing implementation"); + return false; +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_Stream_Net_SetProxy +* Signature: (Ljava/lang/String;)Z +*/ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1Stream_1Net_1SetProxy(JNIEnv * env, jclass clazz, jstring proxy) { + const char * proxyString = env->GetStringUTFChars(proxy, 0); + boolean result = fmod->FSOUND_Stream_Net_SetProxy(proxyString); + env->ReleaseStringUTFChars(proxy, proxyString); + return result; +} + + + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_Stream_SetBufferSize +* Signature: (I)Z +*/ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1Stream_1SetBufferSize(JNIEnv * env, jclass clazz, jint ms) { + return fmod->FSOUND_Stream_SetBufferSize(ms); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: nFSOUND_Stream_SetEndCallback +* Signature: (J)Z +*/ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Stream_1SetEndCallback(JNIEnv * env, jclass clazz, jlong) { + //XXX + throwFMODException(env, "missing implementation"); + return false; +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: nFSOUND_Stream_SetLoopCount +* Signature: (JI)I +*/ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Stream_1SetLoopCount(JNIEnv * env, jclass clazz, jlong stream, jint count) { + return fmod->FSOUND_Stream_SetLoopCount((FSOUND_STREAM*) stream, count); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: nFSOUND_Stream_SetLoopPoints +* Signature: (JII)I +*/ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Stream_1SetLoopPoints(JNIEnv * env, jclass clazz, jlong stream, jint loopstartpcm, jint loopendpcm) { + return fmod->FSOUND_Stream_SetLoopPoints((FSOUND_STREAM*) stream, loopstartpcm, loopendpcm); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: nFSOUND_Stream_SetMode +* Signature: (JI)I +*/ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Stream_1SetMode(JNIEnv * env, jclass clazz, jlong stream, jint mode) { + return fmod->FSOUND_Stream_SetMode((FSOUND_STREAM*) stream, mode); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: nFSOUND_Stream_SetPosition +* Signature: (JI)I +*/ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Stream_1SetPosition(JNIEnv * env, jclass clazz, jlong stream, jint position) { + return fmod->FSOUND_Stream_SetPosition((FSOUND_STREAM*) stream, position); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: nFSOUND_Stream_SetSubStreamSentence +* Signature: (JLjava/nio/IntBuffer;I)I +*/ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Stream_1SetSubStreamSentence(JNIEnv * env, jclass clazz, jlong, jobject, jint) { + //XXX + throwFMODException(env, "missing implementation"); + return false; +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_Stream_SetSyncCallback +* Signature: (J)Z +*/ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1Stream_1SetSyncCallback(JNIEnv * env, jclass clazz, jlong) { + //XXX + throwFMODException(env, "missing implementation"); + return false; +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: nFSOUND_Stream_SetTime +* Signature: (JI)I +*/ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Stream_1SetTime(JNIEnv * env, jclass clazz, jlong stream, jint ms) { + return fmod->FSOUND_Stream_SetTime((FSOUND_STREAM*) stream, ms); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_CD_Eject +* Signature: (C)Z +*/ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1CD_1Eject(JNIEnv * env, jclass clazz, jchar drive) { + return fmod->FSOUND_CD_Eject(drive); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_CD_GetNumTracks +* Signature: (C)I +*/ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1CD_1GetNumTracks(JNIEnv * env, jclass clazz, jchar drive) { + return fmod->FSOUND_CD_GetNumTracks(drive); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_CD_GetPaused +* Signature: (C)Z +*/ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1CD_1GetPaused(JNIEnv * env, jclass clazz, jchar drive) { + return fmod->FSOUND_CD_GetPaused(drive); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_CD_GetTrack +* Signature: (C)I +*/ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1CD_1GetTrack(JNIEnv * env, jclass clazz, jchar drive) { + return fmod->FSOUND_CD_GetTrack(drive); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_CD_GetTrackLength +* Signature: (CI)I +*/ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1CD_1GetTrackLength(JNIEnv * env, jclass clazz, jchar drive, jint track) { + return fmod->FSOUND_CD_GetTrackLength(drive, track); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_CD_GetTrackTime +* Signature: (C)I +*/ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1CD_1GetTrackTime(JNIEnv * env, jclass clazz, jchar drive) { + return fmod->FSOUND_CD_GetTrackTime(drive); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_CD_Play +* Signature: (CI)Z +*/ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1CD_1Play(JNIEnv * env, jclass clazz, jchar drive, jint track) { + return fmod->FSOUND_CD_Play(drive, track); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_CD_SetPaused +* Signature: (CZ)Z +*/ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1CD_1SetPaused(JNIEnv * env, jclass clazz, jchar drive, jboolean paused) { + return fmod->FSOUND_CD_SetPaused(drive, paused); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_CD_SetPlayMode +* Signature: (CI)V +*/ +JNIEXPORT void JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1CD_1SetPlayMode(JNIEnv * env, jclass clazz, jchar drive, jint mode) { + return fmod->FSOUND_CD_SetPlayMode(drive, mode); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_CD_SetTrackTime +* Signature: (CI)Z +*/ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1CD_1SetTrackTime(JNIEnv * env, jclass clazz, jchar drive, jint ms) { + return fmod->FSOUND_CD_SetTrackTime(drive, ms); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_CD_SetVolume +* Signature: (CI)Z +*/ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1CD_1SetVolume(JNIEnv * env, jclass clazz, jchar drive, jint volume) { + return fmod->FSOUND_CD_SetVolume(drive, volume); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_CD_Stop +* Signature: (C)Z +*/ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1CD_1Stop(JNIEnv * env, jclass clazz, jchar drive) { + return fmod->FSOUND_CD_Stop(drive); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_DSP_ClearMixBuffer +* Signature: ()V +*/ +JNIEXPORT void JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1DSP_1ClearMixBuffer(JNIEnv * env, jclass clazz) { + fmod->FSOUND_DSP_ClearMixBuffer(); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: nFSOUND_DSP_Create +* Signature: (I)J +*/ +JNIEXPORT jlong JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1DSP_1Create(JNIEnv * env, jclass clazz, jint priority) { + //XXX + //return (jlong) fmod->FSOUND_DSP_Create(fmod_dsp_callback, priority, NULL); + throwFMODException(env, "missing implementation"); + return 0; +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: nFSOUND_DSP_Free +* Signature: (J)V +*/ +JNIEXPORT void JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1DSP_1Free(JNIEnv * env, jclass clazz, jlong dsp) { + fmod->FSOUND_DSP_Free((FSOUND_DSPUNIT*) dsp); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: nFSOUND_DSP_SetActive +* Signature: (JZ)V +*/ +JNIEXPORT void JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1DSP_1SetActive(JNIEnv * env, jclass clazz, jlong dsp, jboolean active) { + fmod->FSOUND_DSP_SetActive((FSOUND_DSPUNIT*) dsp, active); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: nFSOUND_DSP_GetActive +* Signature: (J)Z +*/ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1DSP_1GetActive(JNIEnv * env, jclass clazz, jlong dsp) { + return fmod->FSOUND_DSP_GetActive((FSOUND_DSPUNIT*) dsp); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_DSP_GetBufferLength +* Signature: ()I +*/ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1DSP_1GetBufferLength(JNIEnv * env, jclass clazz) { + return fmod->FSOUND_DSP_GetBufferLength(); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_DSP_GetBufferLengthTotal +* Signature: ()I +*/ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1DSP_1GetBufferLengthTotal(JNIEnv * env, jclass clazz) { + return fmod->FSOUND_DSP_GetBufferLengthTotal(); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: nFSOUND_DSP_SetPriority +* Signature: (JI)V +*/ +JNIEXPORT void JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1DSP_1SetPriority(JNIEnv * env, jclass clazz, jlong dsp, jint priority) { + fmod->FSOUND_DSP_SetPriority((FSOUND_DSPUNIT*) dsp, priority); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: nFSOUND_DSP_GetPriority +* Signature: (J)I +*/ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1DSP_1GetPriority(JNIEnv * env, jclass clazz, jlong dsp) { + return fmod->FSOUND_DSP_GetPriority((FSOUND_DSPUNIT*) dsp); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: nFSOUND_DSP_GetClearUnit +* Signature: ()J +*/ +JNIEXPORT jlong JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1DSP_1GetClearUnit(JNIEnv * env, jclass clazz) { + return (jlong) fmod->FSOUND_DSP_GetClearUnit(); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: nFSOUND_DSP_GetClipAndCopyUnit +* Signature: ()J +*/ +JNIEXPORT jlong JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1DSP_1GetClipAndCopyUnit(JNIEnv * env, jclass clazz) { + return (jlong) fmod->FSOUND_DSP_GetClipAndCopyUnit(); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: nFSOUND_DSP_GetMusicUnit +* Signature: ()J +*/ +JNIEXPORT jlong JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1DSP_1GetMusicUnit(JNIEnv * env, jclass clazz) { + return (jlong) fmod->FSOUND_DSP_GetMusicUnit(); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: nFSOUND_DSP_GetSFXUnit +* Signature: ()J +*/ +JNIEXPORT jlong JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1DSP_1GetSFXUnit(JNIEnv * env, jclass clazz) { + return (jlong) fmod->FSOUND_DSP_GetSFXUnit(); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: nFSOUND_DSP_GetFFTUnit +* Signature: ()J +*/ +JNIEXPORT jlong JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1DSP_1GetFFTUnit(JNIEnv * env, jclass clazz) { + return (jlong) fmod->FSOUND_DSP_GetFFTUnit(); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: nFSOUND_DSP_GetSpectrum +* Signature: ()Ljava/nio/FloatBuffer; +*/ +JNIEXPORT jobject JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1DSP_1GetSpectrum(JNIEnv * env, jclass clazz) { + return env->NewDirectByteBuffer(fmod->FSOUND_DSP_GetSpectrum(), (512 * sizeof(float))); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: nFSOUND_DSP_MixBuffers +* Signature: (Ljava/nio/ByteBuffer;ILjava/nio/ByteBuffer;IIIIII)Z +*/ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1DSP_1MixBuffers(JNIEnv * env, jclass clazz, jobject, jint, jobject, jint, jint, jint, jint, jint, jint) { + //XXX + throwFMODException(env, "missing implementation"); + return false; +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_FX_Disable +* Signature: (I)Z +*/ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1FX_1Disable(JNIEnv * env, jclass clazz, jint channel) { + return fmod->FSOUND_FX_Disable(channel); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_FX_Enable +* Signature: (II)I +*/ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1FX_1Enable(JNIEnv * env, jclass clazz, jint channel, jint fx) { + return fmod->FSOUND_FX_Enable(channel, fx); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_FX_SetChorus +* Signature: (IFFFFIFI)Z +*/ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1FX_1SetChorus(JNIEnv * env, jclass clazz, jint fxid, jfloat WetDryMix, jfloat Depth, jfloat Feedback, jfloat Frequency, jint Waveform, jfloat Delay, jint Phase) { + return fmod->FSOUND_FX_SetChorus(fxid, WetDryMix, Depth, Feedback, Frequency, Waveform, Delay, Phase); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_FX_SetCompressor +* Signature: (IFFFFFF)Z +*/ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1FX_1SetCompressor(JNIEnv * env, jclass clazz, jint fxid, jfloat Gain, jfloat Attack, jfloat Release, jfloat Threshold, jfloat Ratio, jfloat Predelay) { + return fmod->FSOUND_FX_SetCompressor(fxid, Gain, Attack, Release, Threshold, Ratio, Predelay); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_FX_SetDistortion +* Signature: (IFFFFF)Z +*/ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1FX_1SetDistortion(JNIEnv * env, jclass clazz, jint fxid, jfloat Gain, jfloat Edge, jfloat PostEQCenterFrequency, jfloat PostEQBandwidth, jfloat PreLowpassCutoff) { + return fmod->FSOUND_FX_SetDistortion(fxid, Gain, Edge, PostEQCenterFrequency, PostEQBandwidth, PreLowpassCutoff); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_FX_SetEcho +* Signature: (IFFFFI)Z +*/ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1FX_1SetEcho(JNIEnv * env, jclass clazz, jint fxid, jfloat WetDryMix, jfloat Feedback, jfloat LeftDelay, jfloat RightDelay, jint PanDelay) { + return fmod->FSOUND_FX_SetEcho(fxid, WetDryMix, Feedback, LeftDelay, RightDelay, PanDelay); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_FX_SetFlanger +* Signature: (IFFFFIFI)Z +*/ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1FX_1SetFlanger(JNIEnv * env, jclass clazz, jint fxid, jfloat WetDryMix, jfloat Depth, jfloat Feedback, jfloat Frequency, jint Waveform, jfloat Delay, jint Phase) { + return fmod->FSOUND_FX_SetFlanger(fxid, WetDryMix, Depth, Feedback, Frequency, Waveform, Delay, Phase); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_FX_SetGargle +* Signature: (III)Z +*/ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1FX_1SetGargle(JNIEnv * env, jclass clazz, jint fxid, jint RateHz, jint WaveShape) { + return fmod->FSOUND_FX_SetGargle(fxid, RateHz, WaveShape); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_FX_SetI3DL2Reverb +* Signature: (IIIFFFIFIFFFF)Z +*/ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1FX_1SetI3DL2Reverb(JNIEnv * env, jclass clazz, + jint fxid, jint Room, jint RoomHF, jfloat RoomRolloffFactor, jfloat DecayTime, + jfloat DecayHFRation, jint Reflections, jfloat ReflectionsDelay, jint Reverb, + jfloat ReverbDelay, jfloat Diffusion, jfloat Density, jfloat HFReference) { + return fmod->FSOUND_FX_SetI3DL2Reverb( + fxid, Room, RoomHF, RoomRolloffFactor, DecayTime, + DecayHFRation, Reflections, ReflectionsDelay, Reverb, + ReverbDelay, Diffusion, Density, HFReference); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_FX_SetParamEQ +* Signature: (IFFF)Z +*/ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1FX_1SetParamEQ(JNIEnv * env, jclass clazz, jint fxid, jfloat Center, jfloat Bandwidth, jfloat Gain) { + return fmod->FSOUND_FX_SetParamEQ(fxid, Center, Bandwidth, Gain); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_FX_SetWavesReverb +* Signature: (IFFFF)Z +*/ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1FX_1SetWavesReverb(JNIEnv * env, jclass clazz, jint fxid, jfloat InGain, jfloat ReverbMix, jfloat ReverbTime, jfloat HighFreqRTRatio) { + return fmod->FSOUND_FX_SetWavesReverb(fxid, InGain, ReverbMix, ReverbTime, HighFreqRTRatio); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_Record_GetDriver +* Signature: ()I +*/ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1Record_1GetDriver(JNIEnv * env, jclass clazz) { + return fmod->FSOUND_Record_GetDriver(); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_Record_GetDriverName +* Signature: (I)Ljava/lang/String; +*/ +JNIEXPORT jstring JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1Record_1GetDriverName(JNIEnv * env, jclass clazz, jint driver) { + return env->NewStringUTF((const char *)fmod->FSOUND_Record_GetDriverName(driver)); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_Record_GetNumDrivers +* Signature: ()I +*/ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1Record_1GetNumDrivers(JNIEnv * env, jclass clazz) { + return fmod->FSOUND_Record_GetNumDrivers(); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_Record_GetPosition +* Signature: ()I +*/ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1Record_1GetPosition(JNIEnv * env, jclass clazz) { + return fmod->FSOUND_Record_GetPosition(); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_Record_SetDriver +* Signature: (I)Z +*/ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1Record_1SetDriver(JNIEnv * env, jclass clazz, jint outputtype) { + return fmod->FSOUND_Record_SetDriver(outputtype); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: nFSOUND_Record_StartSample +* Signature: (JZ)Z +*/ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Record_1StartSample(JNIEnv * env, jclass clazz, jlong sample, jboolean loop) { + return fmod->FSOUND_Record_StartSample((FSOUND_SAMPLE *) sample, loop); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: FSOUND_Record_Stop +* Signature: ()Z +*/ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1Record_1Stop(JNIEnv * env, jclass clazz) { + return fmod->FSOUND_Record_Stop(); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: nFSOUND_Reverb_SetProperties +* Signature: (J)Z +*/ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Reverb_1SetProperties(JNIEnv * env, jclass clazz, jlong prop) { + return fmod->FSOUND_Reverb_SetProperties((FSOUND_REVERB_PROPERTIES*) prop); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: nFSOUND_Reverb_GetProperties +* Signature: (J)Z +*/ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Reverb_1GetProperties(JNIEnv * env, jclass clazz, jlong prop) { + return fmod->FSOUND_Reverb_GetProperties((FSOUND_REVERB_PROPERTIES*) prop); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: nFSOUND_Reverb_SetChannelProperties +* Signature: (IJ)Z +*/ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Reverb_1SetChannelProperties(JNIEnv * env, jclass clazz, jint channel, jlong prop) { + return fmod->FSOUND_Reverb_SetChannelProperties(channel, (FSOUND_REVERB_CHANNELPROPERTIES*) prop); +} + +/* +* Class: org_lwjgl_fmod_FSound +* Method: nFSOUND_Reverb_GetChannelProperties +* Signature: (IJ)Z +*/ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Reverb_1GetChannelProperties(JNIEnv * env, jclass clazz, jint channel, jlong prop) { + return fmod->FSOUND_Reverb_GetChannelProperties(channel, (FSOUND_REVERB_CHANNELPROPERTIES*) prop); +} \ No newline at end of file diff --git a/src/native/common/fmod/org_lwjgl_fmod_FSound.h b/src/native/common/fmod/org_lwjgl_fmod_FSound.h new file mode 100644 index 00000000..fde226cb --- /dev/null +++ b/src/native/common/fmod/org_lwjgl_fmod_FSound.h @@ -0,0 +1,1643 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class org_lwjgl_fmod_FSound */ + +#ifndef _Included_org_lwjgl_fmod_FSound +#define _Included_org_lwjgl_fmod_FSound +#ifdef __cplusplus +extern "C" { +#endif +#undef org_lwjgl_fmod_FSound_FSOUND_MIXER_AUTODETECT +#define org_lwjgl_fmod_FSound_FSOUND_MIXER_AUTODETECT 0L +#undef org_lwjgl_fmod_FSound_FSOUND_MIXER_BLENDMODE +#define org_lwjgl_fmod_FSound_FSOUND_MIXER_BLENDMODE 1L +#undef org_lwjgl_fmod_FSound_FSOUND_MIXER_MMXP5 +#define org_lwjgl_fmod_FSound_FSOUND_MIXER_MMXP5 2L +#undef org_lwjgl_fmod_FSound_FSOUND_MIXER_MMXP6 +#define org_lwjgl_fmod_FSound_FSOUND_MIXER_MMXP6 3L +#undef org_lwjgl_fmod_FSound_FSOUND_MIXER_QUALITY_AUTODETECT +#define org_lwjgl_fmod_FSound_FSOUND_MIXER_QUALITY_AUTODETECT 4L +#undef org_lwjgl_fmod_FSound_FSOUND_MIXER_QUALITY_FPU +#define org_lwjgl_fmod_FSound_FSOUND_MIXER_QUALITY_FPU 5L +#undef org_lwjgl_fmod_FSound_FSOUND_MIXER_QUALITY_MMXP5 +#define org_lwjgl_fmod_FSound_FSOUND_MIXER_QUALITY_MMXP5 6L +#undef org_lwjgl_fmod_FSound_FSOUND_MIXER_QUALITY_MMXP6 +#define org_lwjgl_fmod_FSound_FSOUND_MIXER_QUALITY_MMXP6 7L +#undef org_lwjgl_fmod_FSound_FSOUND_MIXER_MONO +#define org_lwjgl_fmod_FSound_FSOUND_MIXER_MONO 8L +#undef org_lwjgl_fmod_FSound_FSOUND_MIXER_QUALITY_MONO +#define org_lwjgl_fmod_FSound_FSOUND_MIXER_QUALITY_MONO 9L +#undef org_lwjgl_fmod_FSound_FSOUND_MIXER_MAX +#define org_lwjgl_fmod_FSound_FSOUND_MIXER_MAX 10L +#undef org_lwjgl_fmod_FSound_FSOUND_OUTPUT_NOSOUND +#define org_lwjgl_fmod_FSound_FSOUND_OUTPUT_NOSOUND 0L +#undef org_lwjgl_fmod_FSound_FSOUND_OUTPUT_WINMM +#define org_lwjgl_fmod_FSound_FSOUND_OUTPUT_WINMM 1L +#undef org_lwjgl_fmod_FSound_FSOUND_OUTPUT_DSOUND +#define org_lwjgl_fmod_FSound_FSOUND_OUTPUT_DSOUND 2L +#undef org_lwjgl_fmod_FSound_FSOUND_OUTPUT_A3D +#define org_lwjgl_fmod_FSound_FSOUND_OUTPUT_A3D 3L +#undef org_lwjgl_fmod_FSound_FSOUND_OUTPUT_OSS +#define org_lwjgl_fmod_FSound_FSOUND_OUTPUT_OSS 4L +#undef org_lwjgl_fmod_FSound_FSOUND_OUTPUT_ESD +#define org_lwjgl_fmod_FSound_FSOUND_OUTPUT_ESD 5L +#undef org_lwjgl_fmod_FSound_FSOUND_OUTPUT_ALSA +#define org_lwjgl_fmod_FSound_FSOUND_OUTPUT_ALSA 6L +#undef org_lwjgl_fmod_FSound_FSOUND_OUTPUT_ASIO +#define org_lwjgl_fmod_FSound_FSOUND_OUTPUT_ASIO 7L +#undef org_lwjgl_fmod_FSound_FSOUND_OUTPUT_XBOX +#define org_lwjgl_fmod_FSound_FSOUND_OUTPUT_XBOX 8L +#undef org_lwjgl_fmod_FSound_FSOUND_OUTPUT_PS2 +#define org_lwjgl_fmod_FSound_FSOUND_OUTPUT_PS2 9L +#undef org_lwjgl_fmod_FSound_FSOUND_OUTPUT_MAC +#define org_lwjgl_fmod_FSound_FSOUND_OUTPUT_MAC 10L +#undef org_lwjgl_fmod_FSound_FSOUND_OUTPUT_GC +#define org_lwjgl_fmod_FSound_FSOUND_OUTPUT_GC 11L +#undef org_lwjgl_fmod_FSound_FSOUND_OUTPUT_NOSOUND_NONREALTIME +#define org_lwjgl_fmod_FSound_FSOUND_OUTPUT_NOSOUND_NONREALTIME 12L +#undef org_lwjgl_fmod_FSound_FSOUND_DSP_DEFAULTPRIORITY_CLEARUNIT +#define org_lwjgl_fmod_FSound_FSOUND_DSP_DEFAULTPRIORITY_CLEARUNIT 0L +#undef org_lwjgl_fmod_FSound_FSOUND_DSP_DEFAULTPRIORITY_SFXUNIT +#define org_lwjgl_fmod_FSound_FSOUND_DSP_DEFAULTPRIORITY_SFXUNIT 100L +#undef org_lwjgl_fmod_FSound_FSOUND_DSP_DEFAULTPRIORITY_MUSICUNIT +#define org_lwjgl_fmod_FSound_FSOUND_DSP_DEFAULTPRIORITY_MUSICUNIT 200L +#undef org_lwjgl_fmod_FSound_FSOUND_DSP_DEFAULTPRIORITY_USER +#define org_lwjgl_fmod_FSound_FSOUND_DSP_DEFAULTPRIORITY_USER 300L +#undef org_lwjgl_fmod_FSound_FSOUND_DSP_DEFAULTPRIORITY_FFTUNIT +#define org_lwjgl_fmod_FSound_FSOUND_DSP_DEFAULTPRIORITY_FFTUNIT 900L +#undef org_lwjgl_fmod_FSound_FSOUND_DSP_DEFAULTPRIORITY_CLIPANDCOPYUNIT +#define org_lwjgl_fmod_FSound_FSOUND_DSP_DEFAULTPRIORITY_CLIPANDCOPYUNIT 1000L +#undef org_lwjgl_fmod_FSound_FSOUND_CAPS_HARDWARE +#define org_lwjgl_fmod_FSound_FSOUND_CAPS_HARDWARE 1L +#undef org_lwjgl_fmod_FSound_FSOUND_CAPS_EAX2 +#define org_lwjgl_fmod_FSound_FSOUND_CAPS_EAX2 2L +#undef org_lwjgl_fmod_FSound_FSOUND_CAPS_EAX3 +#define org_lwjgl_fmod_FSound_FSOUND_CAPS_EAX3 16L +#undef org_lwjgl_fmod_FSound_FSOUND_LOOP_OFF +#define org_lwjgl_fmod_FSound_FSOUND_LOOP_OFF 1L +#undef org_lwjgl_fmod_FSound_FSOUND_LOOP_NORMAL +#define org_lwjgl_fmod_FSound_FSOUND_LOOP_NORMAL 2L +#undef org_lwjgl_fmod_FSound_FSOUND_LOOP_BIDI +#define org_lwjgl_fmod_FSound_FSOUND_LOOP_BIDI 4L +#undef org_lwjgl_fmod_FSound_FSOUND_8BITS +#define org_lwjgl_fmod_FSound_FSOUND_8BITS 8L +#undef org_lwjgl_fmod_FSound_FSOUND_16BITS +#define org_lwjgl_fmod_FSound_FSOUND_16BITS 16L +#undef org_lwjgl_fmod_FSound_FSOUND_MONO +#define org_lwjgl_fmod_FSound_FSOUND_MONO 32L +#undef org_lwjgl_fmod_FSound_FSOUND_STEREO +#define org_lwjgl_fmod_FSound_FSOUND_STEREO 64L +#undef org_lwjgl_fmod_FSound_FSOUND_UNSIGNED +#define org_lwjgl_fmod_FSound_FSOUND_UNSIGNED 128L +#undef org_lwjgl_fmod_FSound_FSOUND_SIGNED +#define org_lwjgl_fmod_FSound_FSOUND_SIGNED 256L +#undef org_lwjgl_fmod_FSound_FSOUND_DELTA +#define org_lwjgl_fmod_FSound_FSOUND_DELTA 512L +#undef org_lwjgl_fmod_FSound_FSOUND_IT214 +#define org_lwjgl_fmod_FSound_FSOUND_IT214 1024L +#undef org_lwjgl_fmod_FSound_FSOUND_IT215 +#define org_lwjgl_fmod_FSound_FSOUND_IT215 2048L +#undef org_lwjgl_fmod_FSound_FSOUND_HW3D +#define org_lwjgl_fmod_FSound_FSOUND_HW3D 4096L +#undef org_lwjgl_fmod_FSound_FSOUND_2D +#define org_lwjgl_fmod_FSound_FSOUND_2D 8192L +#undef org_lwjgl_fmod_FSound_FSOUND_STREAMABLE +#define org_lwjgl_fmod_FSound_FSOUND_STREAMABLE 16384L +#undef org_lwjgl_fmod_FSound_FSOUND_LOADMEMORY +#define org_lwjgl_fmod_FSound_FSOUND_LOADMEMORY 32768L +#undef org_lwjgl_fmod_FSound_FSOUND_LOADRAW +#define org_lwjgl_fmod_FSound_FSOUND_LOADRAW 65536L +#undef org_lwjgl_fmod_FSound_FSOUND_MPEGACCURATE +#define org_lwjgl_fmod_FSound_FSOUND_MPEGACCURATE 131072L +#undef org_lwjgl_fmod_FSound_FSOUND_FORCEMONO +#define org_lwjgl_fmod_FSound_FSOUND_FORCEMONO 262144L +#undef org_lwjgl_fmod_FSound_FSOUND_HW2D +#define org_lwjgl_fmod_FSound_FSOUND_HW2D 524288L +#undef org_lwjgl_fmod_FSound_FSOUND_ENABLEFX +#define org_lwjgl_fmod_FSound_FSOUND_ENABLEFX 1048576L +#undef org_lwjgl_fmod_FSound_FSOUND_MPEGHALFRATE +#define org_lwjgl_fmod_FSound_FSOUND_MPEGHALFRATE 2097152L +#undef org_lwjgl_fmod_FSound_FSOUND_IMAADPCM +#define org_lwjgl_fmod_FSound_FSOUND_IMAADPCM 4194304L +#undef org_lwjgl_fmod_FSound_FSOUND_VAG +#define org_lwjgl_fmod_FSound_FSOUND_VAG 8388608L +#undef org_lwjgl_fmod_FSound_FSOUND_NONBLOCKING +#define org_lwjgl_fmod_FSound_FSOUND_NONBLOCKING 16777216L +#undef org_lwjgl_fmod_FSound_FSOUND_GCADPCM +#define org_lwjgl_fmod_FSound_FSOUND_GCADPCM 33554432L +#undef org_lwjgl_fmod_FSound_FSOUND_MULTICHANNEL +#define org_lwjgl_fmod_FSound_FSOUND_MULTICHANNEL 67108864L +#undef org_lwjgl_fmod_FSound_FSOUND_USECORE0 +#define org_lwjgl_fmod_FSound_FSOUND_USECORE0 134217728L +#undef org_lwjgl_fmod_FSound_FSOUND_USECORE1 +#define org_lwjgl_fmod_FSound_FSOUND_USECORE1 268435456L +#undef org_lwjgl_fmod_FSound_FSOUND_LOADMEMORYIOP +#define org_lwjgl_fmod_FSound_FSOUND_LOADMEMORYIOP 536870912L +#undef org_lwjgl_fmod_FSound_FSOUND_IGNORETAGS +#define org_lwjgl_fmod_FSound_FSOUND_IGNORETAGS 1073741824L +#undef org_lwjgl_fmod_FSound_FSOUND_STREAM_NET +#define org_lwjgl_fmod_FSound_FSOUND_STREAM_NET -2147483648L +#undef org_lwjgl_fmod_FSound_FSOUND_NORMAL +#define org_lwjgl_fmod_FSound_FSOUND_NORMAL 304L +#undef org_lwjgl_fmod_FSound_FSOUND_CD_PLAYCONTINUOUS +#define org_lwjgl_fmod_FSound_FSOUND_CD_PLAYCONTINUOUS 0L +#undef org_lwjgl_fmod_FSound_FSOUND_CD_PLAYONCE +#define org_lwjgl_fmod_FSound_FSOUND_CD_PLAYONCE 1L +#undef org_lwjgl_fmod_FSound_FSOUND_CD_PLAYLOOPED +#define org_lwjgl_fmod_FSound_FSOUND_CD_PLAYLOOPED 2L +#undef org_lwjgl_fmod_FSound_FSOUND_CD_PLAYRANDOM +#define org_lwjgl_fmod_FSound_FSOUND_CD_PLAYRANDOM 3L +#undef org_lwjgl_fmod_FSound_FSOUND_FREE +#define org_lwjgl_fmod_FSound_FSOUND_FREE -1L +#undef org_lwjgl_fmod_FSound_FSOUND_UNMANAGED +#define org_lwjgl_fmod_FSound_FSOUND_UNMANAGED -2L +#undef org_lwjgl_fmod_FSound_FSOUND_ALL +#define org_lwjgl_fmod_FSound_FSOUND_ALL -3L +#undef org_lwjgl_fmod_FSound_FSOUND_STEREOPAN +#define org_lwjgl_fmod_FSound_FSOUND_STEREOPAN -1L +#undef org_lwjgl_fmod_FSound_FSOUND_SYSTEMCHANNEL +#define org_lwjgl_fmod_FSound_FSOUND_SYSTEMCHANNEL -1000L +#undef org_lwjgl_fmod_FSound_FSOUND_SYSTEMSAMPLE +#define org_lwjgl_fmod_FSound_FSOUND_SYSTEMSAMPLE -1000L +#undef org_lwjgl_fmod_FSound_FSOUND_REVERB_FLAGS_DECAYTIMESCALE +#define org_lwjgl_fmod_FSound_FSOUND_REVERB_FLAGS_DECAYTIMESCALE 1L +#undef org_lwjgl_fmod_FSound_FSOUND_REVERB_FLAGS_REFLECTIONSSCALE +#define org_lwjgl_fmod_FSound_FSOUND_REVERB_FLAGS_REFLECTIONSSCALE 2L +#undef org_lwjgl_fmod_FSound_FSOUND_REVERB_FLAGS_REFLECTIONSDELAYSCALE +#define org_lwjgl_fmod_FSound_FSOUND_REVERB_FLAGS_REFLECTIONSDELAYSCALE 4L +#undef org_lwjgl_fmod_FSound_FSOUND_REVERB_FLAGS_REVERBSCALE +#define org_lwjgl_fmod_FSound_FSOUND_REVERB_FLAGS_REVERBSCALE 8L +#undef org_lwjgl_fmod_FSound_FSOUND_REVERB_FLAGS_REVERBDELAYSCALE +#define org_lwjgl_fmod_FSound_FSOUND_REVERB_FLAGS_REVERBDELAYSCALE 16L +#undef org_lwjgl_fmod_FSound_FSOUND_REVERB_FLAGS_DECAYHFLIMIT +#define org_lwjgl_fmod_FSound_FSOUND_REVERB_FLAGS_DECAYHFLIMIT 32L +#undef org_lwjgl_fmod_FSound_FSOUND_REVERB_FLAGS_ECHOTIMESCALE +#define org_lwjgl_fmod_FSound_FSOUND_REVERB_FLAGS_ECHOTIMESCALE 64L +#undef org_lwjgl_fmod_FSound_FSOUND_REVERB_FLAGS_MODULATIONTIMESCALE +#define org_lwjgl_fmod_FSound_FSOUND_REVERB_FLAGS_MODULATIONTIMESCALE 128L +#undef org_lwjgl_fmod_FSound_FSOUND_REVERB_FLAGS_CORE0 +#define org_lwjgl_fmod_FSound_FSOUND_REVERB_FLAGS_CORE0 256L +#undef org_lwjgl_fmod_FSound_FSOUND_REVERB_FLAGS_CORE1 +#define org_lwjgl_fmod_FSound_FSOUND_REVERB_FLAGS_CORE1 512L +#undef org_lwjgl_fmod_FSound_FSOUND_REVERB_FLAGS_DEFAULT +#define org_lwjgl_fmod_FSound_FSOUND_REVERB_FLAGS_DEFAULT 831L +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_Close + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1Close + (JNIEnv *, jclass); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: nFSOUND_File_SetCallbacks + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1File_1SetCallbacks + (JNIEnv *, jclass); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_Init + * Signature: (III)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1Init + (JNIEnv *, jclass, jint, jint, jint); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_SetBufferSize + * Signature: (I)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1SetBufferSize + (JNIEnv *, jclass, jint); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_SetDriver + * Signature: (I)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1SetDriver + (JNIEnv *, jclass, jint); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_SetHWND + * Signature: ()Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1SetHWND + (JNIEnv *, jclass); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_SetMaxHardwareChannels + * Signature: (I)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1SetMaxHardwareChannels + (JNIEnv *, jclass, jint); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_SetMinHardwareChannels + * Signature: (I)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1SetMinHardwareChannels + (JNIEnv *, jclass, jint); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_SetMixer + * Signature: (I)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1SetMixer + (JNIEnv *, jclass, jint); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_SetOutput + * Signature: (I)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1SetOutput + (JNIEnv *, jclass, jint); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_SetPanSeperation + * Signature: (F)V + */ +JNIEXPORT void JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1SetPanSeperation + (JNIEnv *, jclass, jfloat); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_SetSFXMasterVolume + * Signature: (I)V + */ +JNIEXPORT void JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1SetSFXMasterVolume + (JNIEnv *, jclass, jint); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_SetSpeakerMode + * Signature: (I)V + */ +JNIEXPORT void JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1SetSpeakerMode + (JNIEnv *, jclass, jint); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_Update + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1Update + (JNIEnv *, jclass); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_GetCPUUsage + * Signature: ()F + */ +JNIEXPORT jfloat JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1GetCPUUsage + (JNIEnv *, jclass); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_GetChannelsPlaying + * Signature: ()I + */ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1GetChannelsPlaying + (JNIEnv *, jclass); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_GetDriver + * Signature: ()I + */ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1GetDriver + (JNIEnv *, jclass); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_GetDriverCaps + * Signature: (ILjava/nio/IntBuffer;)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1GetDriverCaps + (JNIEnv *, jclass, jint, jobject); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_GetDriverName + * Signature: (I)Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1GetDriverName + (JNIEnv *, jclass, jint); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_GetError + * Signature: ()I + */ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1GetError + (JNIEnv *, jclass); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_GetMaxSamples + * Signature: ()I + */ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1GetMaxSamples + (JNIEnv *, jclass); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_GetMaxChannels + * Signature: ()I + */ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1GetMaxChannels + (JNIEnv *, jclass); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_GetMemoryStats + * Signature: (Ljava/nio/IntBuffer;)V + */ +JNIEXPORT void JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1GetMemoryStats + (JNIEnv *, jclass, jobject); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_GetNumDrivers + * Signature: ()I + */ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1GetNumDrivers + (JNIEnv *, jclass); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_GetNumHWChannels + * Signature: (Ljava/nio/IntBuffer;)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1GetNumHWChannels + (JNIEnv *, jclass, jobject); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_GetOutput + * Signature: ()I + */ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1GetOutput + (JNIEnv *, jclass); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_GetOutputRate + * Signature: ()I + */ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1GetOutputRate + (JNIEnv *, jclass); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_GetSFXMasterVolume + * Signature: ()I + */ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1GetSFXMasterVolume + (JNIEnv *, jclass); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_GetVersion + * Signature: ()F + */ +JNIEXPORT jfloat JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1GetVersion + (JNIEnv *, jclass); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: nFSOUND_Sample_Alloc + * Signature: (IIIIIII)J + */ +JNIEXPORT jlong JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Sample_1Alloc + (JNIEnv *, jclass, jint, jint, jint, jint, jint, jint, jint); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: nFSOUND_Sample_Free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Sample_1Free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: nFSOUND_Sample_Get + * Signature: (I)J + */ +JNIEXPORT jlong JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Sample_1Get + (JNIEnv *, jclass, jint); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: nFSOUND_Sample_GetDefaults + * Signature: (JLjava/nio/IntBuffer;ILjava/nio/IntBuffer;ILjava/nio/IntBuffer;ILjava/nio/IntBuffer;I)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Sample_1GetDefaults + (JNIEnv *, jclass, jlong, jobject, jint, jobject, jint, jobject, jint, jobject, jint); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: nFSOUND_Sample_GetDefaultsEx + * Signature: (JLjava/nio/IntBuffer;ILjava/nio/IntBuffer;ILjava/nio/IntBuffer;ILjava/nio/IntBuffer;ILjava/nio/IntBuffer;ILjava/nio/IntBuffer;ILjava/nio/IntBuffer;I)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Sample_1GetDefaultsEx + (JNIEnv *, jclass, jlong, jobject, jint, jobject, jint, jobject, jint, jobject, jint, jobject, jint, jobject, jint, jobject, jint); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: nFSOUND_Sample_GetLength + * Signature: (J)I + */ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Sample_1GetLength + (JNIEnv *, jclass, jlong); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: nFSOUND_Sample_GetLoopPoints + * Signature: (JLjava/nio/IntBuffer;ILjava/nio/IntBuffer;I)I + */ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Sample_1GetLoopPoints + (JNIEnv *, jclass, jlong, jobject, jint, jobject, jint); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: nFSOUND_Sample_GetMinMaxDistance + * Signature: (JLjava/nio/FloatBuffer;ILjava/nio/FloatBuffer;I)I + */ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Sample_1GetMinMaxDistance + (JNIEnv *, jclass, jlong, jobject, jint, jobject, jint); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: nFSOUND_Sample_GetMode + * Signature: (J)I + */ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Sample_1GetMode + (JNIEnv *, jclass, jlong); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: nFSOUND_Sample_GetName + * Signature: (J)Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Sample_1GetName + (JNIEnv *, jclass, jlong); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: nFSOUND_Sample_Load + * Signature: (ILjava/nio/ByteBuffer;IIII)J + */ +JNIEXPORT jlong JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Sample_1Load__ILjava_nio_ByteBuffer_2IIII + (JNIEnv *, jclass, jint, jobject, jint, jint, jint, jint); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: nFSOUND_Sample_Load + * Signature: (ILjava/lang/String;III)J + */ +JNIEXPORT jlong JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Sample_1Load__ILjava_lang_String_2III + (JNIEnv *, jclass, jint, jstring, jint, jint, jint); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: nFSOUND_Sample_Lock + * Signature: (JIILorg/lwjgl/fmod/FSoundSampleLock;)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Sample_1Lock + (JNIEnv *, jclass, jlong, jint, jint, jobject); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: nFSOUND_Sample_SetDefaults + * Signature: (JIIII)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Sample_1SetDefaults + (JNIEnv *, jclass, jlong, jint, jint, jint, jint); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: nFSOUND_Sample_SetDefaultsEx + * Signature: (JIIIIIII)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Sample_1SetDefaultsEx + (JNIEnv *, jclass, jlong, jint, jint, jint, jint, jint, jint, jint); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: nFSOUND_Sample_SetMaxPlaybacks + * Signature: (JI)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Sample_1SetMaxPlaybacks + (JNIEnv *, jclass, jlong, jint); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: nFSOUND_Sample_SetMinMaxDistance + * Signature: (JFF)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Sample_1SetMinMaxDistance + (JNIEnv *, jclass, jlong, jfloat, jfloat); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: nFSOUND_Sample_SetMode + * Signature: (JI)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Sample_1SetMode + (JNIEnv *, jclass, jlong, jint); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: nFSOUND_Sample_SetLoopPoints + * Signature: (JII)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Sample_1SetLoopPoints + (JNIEnv *, jclass, jlong, jint, jint); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: nFSOUND_Sample_Unlock + * Signature: (JILorg/lwjgl/fmod/FSoundSampleLock;)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Sample_1Unlock + (JNIEnv *, jclass, jlong, jint, jobject); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: nFSOUND_Sample_Upload + * Signature: (JLjava/nio/ByteBuffer;II)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Sample_1Upload + (JNIEnv *, jclass, jlong, jobject, jint, jint); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: nFSOUND_PlaySound + * Signature: (IJ)I + */ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1PlaySound + (JNIEnv *, jclass, jint, jlong); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: nFSOUND_PlaySoundEx + * Signature: (IJJZ)I + */ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1PlaySoundEx + (JNIEnv *, jclass, jint, jlong, jlong, jboolean); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_StopSound + * Signature: (I)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1StopSound + (JNIEnv *, jclass, jint); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_SetFrequency + * Signature: (II)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1SetFrequency + (JNIEnv *, jclass, jint, jint); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_SetLevels + * Signature: (IIIIIII)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1SetLevels + (JNIEnv *, jclass, jint, jint, jint, jint, jint, jint, jint); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_SetLoopMode + * Signature: (II)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1SetLoopMode + (JNIEnv *, jclass, jint, jint); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_SetMute + * Signature: (IZ)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1SetMute + (JNIEnv *, jclass, jint, jboolean); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_SetPan + * Signature: (II)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1SetPan + (JNIEnv *, jclass, jint, jint); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_SetPaused + * Signature: (IZ)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1SetPaused + (JNIEnv *, jclass, jint, jboolean); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_SetPriority + * Signature: (II)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1SetPriority + (JNIEnv *, jclass, jint, jint); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_SetReserved + * Signature: (IZ)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1SetReserved + (JNIEnv *, jclass, jint, jboolean); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_SetSurround + * Signature: (IZ)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1SetSurround + (JNIEnv *, jclass, jint, jboolean); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_SetVolume + * Signature: (II)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1SetVolume + (JNIEnv *, jclass, jint, jint); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_SetVolumeAbsolute + * Signature: (II)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1SetVolumeAbsolute + (JNIEnv *, jclass, jint, jint); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_GetVolume + * Signature: ()I + */ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1GetVolume + (JNIEnv *, jclass); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_GetAmplitude + * Signature: ()I + */ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1GetAmplitude + (JNIEnv *, jclass); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: nFSOUND_3D_SetAttributes + * Signature: (ILjava/nio/FloatBuffer;ILjava/nio/FloatBuffer;I)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_13D_1SetAttributes + (JNIEnv *, jclass, jint, jobject, jint, jobject, jint); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_3D_SetMinMaxDistance + * Signature: (III)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_13D_1SetMinMaxDistance + (JNIEnv *, jclass, jint, jint, jint); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_SetCurrentPosition + * Signature: (II)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1SetCurrentPosition + (JNIEnv *, jclass, jint, jint); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_GetCurrentPosition + * Signature: (I)I + */ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1GetCurrentPosition + (JNIEnv *, jclass, jint); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: nFSOUND_GetCurrentSample + * Signature: (I)J + */ +JNIEXPORT jlong JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1GetCurrentSample + (JNIEnv *, jclass, jint); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: nFSOUND_GetCurrentLevels + * Signature: (ILjava/nio/FloatBuffer;I)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1GetCurrentLevels + (JNIEnv *, jclass, jint, jobject, jint); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_GetFrequency + * Signature: (I)I + */ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1GetFrequency + (JNIEnv *, jclass, jint); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_GetLoopMode + * Signature: (I)I + */ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1GetLoopMode + (JNIEnv *, jclass, jint); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_GetMixer + * Signature: ()I + */ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1GetMixer + (JNIEnv *, jclass); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_GetMute + * Signature: (I)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1GetMute + (JNIEnv *, jclass, jint); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_GetNumSubChannels + * Signature: (I)I + */ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1GetNumSubChannels + (JNIEnv *, jclass, jint); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_GetPan + * Signature: (I)I + */ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1GetPan + (JNIEnv *, jclass, jint); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_GetPaused + * Signature: (I)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1GetPaused + (JNIEnv *, jclass, jint); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_GetPriority + * Signature: (I)I + */ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1GetPriority + (JNIEnv *, jclass, jint); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_GetReserved + * Signature: (I)I + */ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1GetReserved + (JNIEnv *, jclass, jint); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_GetSubChannel + * Signature: (II)I + */ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1GetSubChannel + (JNIEnv *, jclass, jint, jint); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_GetSurround + * Signature: (I)I + */ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1GetSurround + (JNIEnv *, jclass, jint); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_IsPlaying + * Signature: (I)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1IsPlaying + (JNIEnv *, jclass, jint); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: nFSOUND_3D_GetAttributes + * Signature: (ILjava/nio/FloatBuffer;ILjava/nio/FloatBuffer;I)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_13D_1GetAttributes + (JNIEnv *, jclass, jint, jobject, jint, jobject, jint); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: nFSOUND_3D_GetMinMaxDistance + * Signature: (ILjava/nio/FloatBuffer;I)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_13D_1GetMinMaxDistance + (JNIEnv *, jclass, jint, jobject, jint); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: nFSOUND_3D_Listener_GetAttributes + * Signature: (Ljava/nio/FloatBuffer;ILjava/nio/FloatBuffer;ILjava/nio/FloatBuffer;ILjava/nio/FloatBuffer;ILjava/nio/FloatBuffer;ILjava/nio/FloatBuffer;ILjava/nio/FloatBuffer;ILjava/nio/FloatBuffer;I)V + */ +JNIEXPORT void JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_13D_1Listener_1GetAttributes + (JNIEnv *, jclass, jobject, jint, jobject, jint, jobject, jint, jobject, jint, jobject, jint, jobject, jint, jobject, jint, jobject, jint); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: nFSOUND_3D_Listener_SetAttributes + * Signature: (Ljava/nio/FloatBuffer;ILjava/nio/FloatBuffer;IFFFFFF)V + */ +JNIEXPORT void JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_13D_1Listener_1SetAttributes + (JNIEnv *, jclass, jobject, jint, jobject, jint, jfloat, jfloat, jfloat, jfloat, jfloat, jfloat); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_3D_Listener_SetCurrent + * Signature: (II)V + */ +JNIEXPORT void JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_13D_1Listener_1SetCurrent + (JNIEnv *, jclass, jint, jint); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_3D_SetDistanceFactor + * Signature: (F)V + */ +JNIEXPORT void JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_13D_1SetDistanceFactor + (JNIEnv *, jclass, jfloat); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_3D_SetDopplerFactor + * Signature: (F)V + */ +JNIEXPORT void JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_13D_1SetDopplerFactor + (JNIEnv *, jclass, jfloat); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_3D_SetRolloffFactor + * Signature: (F)V + */ +JNIEXPORT void JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_13D_1SetRolloffFactor + (JNIEnv *, jclass, jfloat); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: nFSOUND_Stream_Open + * Signature: (Ljava/nio/ByteBuffer;IIII)J + */ +JNIEXPORT jlong JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Stream_1Open__Ljava_nio_ByteBuffer_2IIII + (JNIEnv *, jclass, jobject, jint, jint, jint, jint); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: nFSOUND_Stream_Open + * Signature: (Ljava/lang/String;III)J + */ +JNIEXPORT jlong JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Stream_1Open__Ljava_lang_String_2III + (JNIEnv *, jclass, jstring, jint, jint, jint); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: nFSOUND_Stream_Play + * Signature: (IJ)I + */ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Stream_1Play + (JNIEnv *, jclass, jint, jlong); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: nFSOUND_Stream_Stop + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Stream_1Stop + (JNIEnv *, jclass, jlong); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: nFSOUND_Stream_Close + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Stream_1Close + (JNIEnv *, jclass, jlong); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: nFSOUND_Stream_GetNumSubStreams + * Signature: (J)I + */ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Stream_1GetNumSubStreams + (JNIEnv *, jclass, jlong); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: nFSOUND_Stream_SetSubStream + * Signature: (JI)I + */ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Stream_1SetSubStream + (JNIEnv *, jclass, jlong, jint); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: nFSOUND_Stream_AddSyncPoint + * Signature: (JILjava/lang/String;)J + */ +JNIEXPORT jlong JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Stream_1AddSyncPoint + (JNIEnv *, jclass, jlong, jint, jstring); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: nFSOUND_Stream_Create + * Signature: (III)J + */ +JNIEXPORT jlong JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Stream_1Create + (JNIEnv *, jclass, jint, jint, jint); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: nFSOUND_Stream_CreateDSP + * Signature: (JI)J + */ +JNIEXPORT jlong JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Stream_1CreateDSP + (JNIEnv *, jclass, jlong, jint); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: nFSOUND_Stream_DeleteSyncPoint + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Stream_1DeleteSyncPoint + (JNIEnv *, jclass, jlong); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: nFSOUND_Stream_FindTagField + * Signature: (JILjava/lang/String;Lorg/lwjgl/fmod/FSoundTagField;)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Stream_1FindTagField + (JNIEnv *, jclass, jlong, jint, jstring, jobject); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: nFSOUND_Stream_GetLength + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Stream_1GetLength + (JNIEnv *, jclass, jlong); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: nFSOUND_Stream_GetLengthMs + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Stream_1GetLengthMs + (JNIEnv *, jclass, jlong); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: nFSOUND_Stream_GetMode + * Signature: (J)I + */ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Stream_1GetMode + (JNIEnv *, jclass, jlong); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: nFSOUND_Stream_GetNumSyncPoints + * Signature: (J)I + */ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Stream_1GetNumSyncPoints + (JNIEnv *, jclass, jlong); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: nFSOUND_Stream_GetNumTagFields + * Signature: (JLjava/nio/IntBuffer;I)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Stream_1GetNumTagFields + (JNIEnv *, jclass, jlong, jobject, jint); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: nFSOUND_Stream_GetOpenState + * Signature: (J)I + */ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Stream_1GetOpenState + (JNIEnv *, jclass, jlong); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: nFSOUND_Stream_GetPosition + * Signature: (J)I + */ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Stream_1GetPosition + (JNIEnv *, jclass, jlong); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: nFSOUND_Stream_GetSample + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Stream_1GetSample + (JNIEnv *, jclass, jlong); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: nFSOUND_Stream_GetSyncPoint + * Signature: (JI)J + */ +JNIEXPORT jlong JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Stream_1GetSyncPoint + (JNIEnv *, jclass, jlong, jint); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: nFSOUND_Stream_GetSyncPointInfo + * Signature: (JLjava/nio/IntBuffer;I)Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Stream_1GetSyncPointInfo + (JNIEnv *, jclass, jlong, jobject, jint); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: nFSOUND_Stream_GetTagField + * Signature: (JILorg/lwjgl/fmod/FSoundTagField;)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Stream_1GetTagField + (JNIEnv *, jclass, jlong, jint, jobject); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: nFSOUND_Stream_GetTime + * Signature: (J)I + */ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Stream_1GetTime + (JNIEnv *, jclass, jlong); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: nFSOUND_Stream_Net_GetBufferProperties + * Signature: (Ljava/nio/IntBuffer;I)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Stream_1Net_1GetBufferProperties + (JNIEnv *, jclass, jobject, jint); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_Stream_Net_GetBufferProperties + * Signature: ()Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1Stream_1Net_1GetLastServerStatus + (JNIEnv *, jclass); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: nFSOUND_Stream_Net_GetStatus + * Signature: (JLjava/nio/IntBuffer;I)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Stream_1Net_1GetStatus + (JNIEnv *, jclass, jlong, jobject, jint); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_Stream_Net_SetBufferProperties + * Signature: (III)Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1Stream_1Net_1SetBufferProperties + (JNIEnv *, jclass, jint, jint, jint); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: nFSOUND_Stream_Net_SetMetadataCallback + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Stream_1Net_1SetMetadataCallback + (JNIEnv *, jclass, jlong); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_Stream_Net_SetProxy + * Signature: (Ljava/lang/String;)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1Stream_1Net_1SetProxy + (JNIEnv *, jclass, jstring); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: nFSOUND_Stream_PlayEx + * Signature: (IJJZ)I + */ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Stream_1PlayEx + (JNIEnv *, jclass, jint, jlong, jlong, jboolean); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_Stream_SetBufferSize + * Signature: (I)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1Stream_1SetBufferSize + (JNIEnv *, jclass, jint); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: nFSOUND_Stream_SetEndCallback + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Stream_1SetEndCallback + (JNIEnv *, jclass, jlong); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: nFSOUND_Stream_SetLoopCount + * Signature: (JI)I + */ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Stream_1SetLoopCount + (JNIEnv *, jclass, jlong, jint); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: nFSOUND_Stream_SetLoopPoints + * Signature: (JII)I + */ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Stream_1SetLoopPoints + (JNIEnv *, jclass, jlong, jint, jint); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: nFSOUND_Stream_SetMode + * Signature: (JI)I + */ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Stream_1SetMode + (JNIEnv *, jclass, jlong, jint); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: nFSOUND_Stream_SetPosition + * Signature: (JI)I + */ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Stream_1SetPosition + (JNIEnv *, jclass, jlong, jint); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: nFSOUND_Stream_SetSubStreamSentence + * Signature: (JLjava/nio/IntBuffer;I)I + */ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Stream_1SetSubStreamSentence + (JNIEnv *, jclass, jlong, jobject, jint); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_Stream_SetSyncCallback + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1Stream_1SetSyncCallback + (JNIEnv *, jclass, jlong); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: nFSOUND_Stream_SetTime + * Signature: (JI)I + */ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Stream_1SetTime + (JNIEnv *, jclass, jlong, jint); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_CD_Eject + * Signature: (C)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1CD_1Eject + (JNIEnv *, jclass, jchar); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_CD_GetNumTracks + * Signature: (C)I + */ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1CD_1GetNumTracks + (JNIEnv *, jclass, jchar); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_CD_GetPaused + * Signature: (C)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1CD_1GetPaused + (JNIEnv *, jclass, jchar); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_CD_GetTrack + * Signature: (C)I + */ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1CD_1GetTrack + (JNIEnv *, jclass, jchar); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_CD_GetTrackLength + * Signature: (CI)I + */ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1CD_1GetTrackLength + (JNIEnv *, jclass, jchar, jint); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_CD_GetTrackTime + * Signature: (C)I + */ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1CD_1GetTrackTime + (JNIEnv *, jclass, jchar); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_CD_Play + * Signature: (CI)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1CD_1Play + (JNIEnv *, jclass, jchar, jint); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_CD_SetPaused + * Signature: (CZ)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1CD_1SetPaused + (JNIEnv *, jclass, jchar, jboolean); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_CD_SetPlayMode + * Signature: (CI)V + */ +JNIEXPORT void JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1CD_1SetPlayMode + (JNIEnv *, jclass, jchar, jint); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_CD_SetTrackTime + * Signature: (CI)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1CD_1SetTrackTime + (JNIEnv *, jclass, jchar, jint); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_CD_SetVolume + * Signature: (CI)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1CD_1SetVolume + (JNIEnv *, jclass, jchar, jint); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_CD_Stop + * Signature: (C)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1CD_1Stop + (JNIEnv *, jclass, jchar); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_DSP_ClearMixBuffer + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1DSP_1ClearMixBuffer + (JNIEnv *, jclass); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: nFSOUND_DSP_Create + * Signature: (I)J + */ +JNIEXPORT jlong JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1DSP_1Create + (JNIEnv *, jclass, jint); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: nFSOUND_DSP_Free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1DSP_1Free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: nFSOUND_DSP_SetActive + * Signature: (JZ)V + */ +JNIEXPORT void JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1DSP_1SetActive + (JNIEnv *, jclass, jlong, jboolean); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: nFSOUND_DSP_GetActive + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1DSP_1GetActive + (JNIEnv *, jclass, jlong); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_DSP_GetBufferLength + * Signature: ()I + */ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1DSP_1GetBufferLength + (JNIEnv *, jclass); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_DSP_GetBufferLengthTotal + * Signature: ()I + */ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1DSP_1GetBufferLengthTotal + (JNIEnv *, jclass); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: nFSOUND_DSP_SetPriority + * Signature: (JI)V + */ +JNIEXPORT void JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1DSP_1SetPriority + (JNIEnv *, jclass, jlong, jint); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: nFSOUND_DSP_GetPriority + * Signature: (J)I + */ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1DSP_1GetPriority + (JNIEnv *, jclass, jlong); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: nFSOUND_DSP_GetClearUnit + * Signature: ()J + */ +JNIEXPORT jlong JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1DSP_1GetClearUnit + (JNIEnv *, jclass); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: nFSOUND_DSP_GetClipAndCopyUnit + * Signature: ()J + */ +JNIEXPORT jlong JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1DSP_1GetClipAndCopyUnit + (JNIEnv *, jclass); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: nFSOUND_DSP_GetMusicUnit + * Signature: ()J + */ +JNIEXPORT jlong JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1DSP_1GetMusicUnit + (JNIEnv *, jclass); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: nFSOUND_DSP_GetSFXUnit + * Signature: ()J + */ +JNIEXPORT jlong JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1DSP_1GetSFXUnit + (JNIEnv *, jclass); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: nFSOUND_DSP_GetFFTUnit + * Signature: ()J + */ +JNIEXPORT jlong JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1DSP_1GetFFTUnit + (JNIEnv *, jclass); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: nFSOUND_DSP_GetSpectrum + * Signature: ()Ljava/nio/FloatBuffer; + */ +JNIEXPORT jobject JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1DSP_1GetSpectrum + (JNIEnv *, jclass); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: nFSOUND_DSP_MixBuffers + * Signature: (Ljava/nio/ByteBuffer;ILjava/nio/ByteBuffer;IIIIII)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1DSP_1MixBuffers + (JNIEnv *, jclass, jobject, jint, jobject, jint, jint, jint, jint, jint, jint); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_FX_Disable + * Signature: (I)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1FX_1Disable + (JNIEnv *, jclass, jint); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_FX_Enable + * Signature: (II)I + */ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1FX_1Enable + (JNIEnv *, jclass, jint, jint); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_FX_SetChorus + * Signature: (IFFFFIFI)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1FX_1SetChorus + (JNIEnv *, jclass, jint, jfloat, jfloat, jfloat, jfloat, jint, jfloat, jint); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_FX_SetCompressor + * Signature: (IFFFFFF)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1FX_1SetCompressor + (JNIEnv *, jclass, jint, jfloat, jfloat, jfloat, jfloat, jfloat, jfloat); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_FX_SetDistortion + * Signature: (IFFFFF)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1FX_1SetDistortion + (JNIEnv *, jclass, jint, jfloat, jfloat, jfloat, jfloat, jfloat); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_FX_SetEcho + * Signature: (IFFFFI)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1FX_1SetEcho + (JNIEnv *, jclass, jint, jfloat, jfloat, jfloat, jfloat, jint); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_FX_SetFlanger + * Signature: (IFFFFIFI)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1FX_1SetFlanger + (JNIEnv *, jclass, jint, jfloat, jfloat, jfloat, jfloat, jint, jfloat, jint); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_FX_SetGargle + * Signature: (III)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1FX_1SetGargle + (JNIEnv *, jclass, jint, jint, jint); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_FX_SetI3DL2Reverb + * Signature: (IIIFFFIFIFFFF)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1FX_1SetI3DL2Reverb + (JNIEnv *, jclass, jint, jint, jint, jfloat, jfloat, jfloat, jint, jfloat, jint, jfloat, jfloat, jfloat, jfloat); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_FX_SetParamEQ + * Signature: (IFFF)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1FX_1SetParamEQ + (JNIEnv *, jclass, jint, jfloat, jfloat, jfloat); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_FX_SetWavesReverb + * Signature: (IFFFF)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1FX_1SetWavesReverb + (JNIEnv *, jclass, jint, jfloat, jfloat, jfloat, jfloat); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_Record_GetDriver + * Signature: ()I + */ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1Record_1GetDriver + (JNIEnv *, jclass); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_Record_GetDriverName + * Signature: (I)Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1Record_1GetDriverName + (JNIEnv *, jclass, jint); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_Record_GetNumDrivers + * Signature: ()I + */ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1Record_1GetNumDrivers + (JNIEnv *, jclass); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_Record_GetPosition + * Signature: ()I + */ +JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1Record_1GetPosition + (JNIEnv *, jclass); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_Record_SetDriver + * Signature: (I)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1Record_1SetDriver + (JNIEnv *, jclass, jint); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: nFSOUND_Record_StartSample + * Signature: (JZ)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Record_1StartSample + (JNIEnv *, jclass, jlong, jboolean); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: FSOUND_Record_Stop + * Signature: ()Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_FSOUND_1Record_1Stop + (JNIEnv *, jclass); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: nFSOUND_Reverb_SetProperties + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Reverb_1SetProperties + (JNIEnv *, jclass, jlong); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: nFSOUND_Reverb_GetProperties + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Reverb_1GetProperties + (JNIEnv *, jclass, jlong); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: nFSOUND_Reverb_SetChannelProperties + * Signature: (IJ)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Reverb_1SetChannelProperties + (JNIEnv *, jclass, jint, jlong); + +/* + * Class: org_lwjgl_fmod_FSound + * Method: nFSOUND_Reverb_GetChannelProperties + * Signature: (IJ)Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Reverb_1GetChannelProperties + (JNIEnv *, jclass, jint, jlong); + +#ifdef __cplusplus +} +#endif +#endif