* /**
* Copyright 2011 JogAmp Community. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. 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.
*
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``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 JogAmp Community 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.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
#ifndef NEWT_COMMON_H
#define NEWT_COMMON_H 1
#include <jni.h>
#include <stdlib.h>
void NewtCommon_init(JNIEnv *env);
const char * NewtCommon_GetStaticStringMethod(JNIEnv *jniEnv, jclass clazz, jmethodID jGetStrID, char *dest, int destSize, const char *altText);
jchar* NewtCommon_GetNullTerminatedStringChars(JNIEnv* env, jstring str);
void NewtCommon_FatalError(JNIEnv *env, const char* msg, ...);
void NewtCommon_throwNewRuntimeException(JNIEnv *env, const char* msg, ...);
/**
*
* 1) Init static jvmHandle, jvmVersion and clazz references
* from an early initialization call w/ valid 'JNIEnv * env'
NewtCommon_init(env);
*
* 2) Use current thread JNIEnv or attach current thread to JVM, generating new JNIEnv
*
int asDaemon = 0;
int shallBeDetached = 0;
JNIEnv* env = NewtCommon_GetJNIEnv(asDaemon, &shallBeDetached);
if(NULL==env) {
DBG_PRINT("drawRect: null JNIEnv\n");
return;
}
*
* 3) Use JNIEnv ..
*
.. your JNIEnv code here ..
*
* 4) Detach thread from JVM if requ* | Revert the default stereo layout back to -90 and +90 degrees | Chris Robinson | 2012-03-12 | 1 | -1/+1 |
* | Document the hrtf_tables config option | Chris Robinson | 2012-03-11 | 1 | -0/+6 |
* | Enforce range limits on periods and period_size. | Chris Robinson | 2012-03-04 | 1 | -2/+3 |
* | Update the layout config option names | Chris Robinson | 2012-03-01 | 1 | -5/+5 |
* | Recognize "none" to disable the default reverb | Chris Robinson | 2012-02-19 | 1 | -4/+4 |
* | Remove mention of the environment variables from alsoftrc.sample | Chris Robinson | 2012-02-19 | 1 | -9/+1 |
* | Separate the format config option into channels and sample-type | Chris Robinson | 2012-02-15 | 1 | -21/+17 |
* | Add config options for card- and device-specific prefixes in ALSA device names | Chris Robinson | 2012-02-11 | 1 | -0/+14 |
* | Change the default stereo speaker positions to match the stereo channel posit... | Chris Robinson | 2012-02-04 | 1 | -1/+1 |
* | Fix typo in the "CarpetedHallway" reverb preset | Chris Robinson | 2012-02-01 | 1 | -1/+1 |
* | Fix a typo | Chris Robinson | 2012-01-24 | 1 | -1/+1 |
* | Add a default-reverb config option, and rename __ALSOFT_FORCE_REVERB to match | Chris Robinson | 2012-01-20 | 1 | -0/+11 |
* | Change the default output format to 32-bit float | Chris Robinson | 2012-01-17 | 1 | -1/+1 |
* | Update some config option descriptions | Chris Robinson | 2011-12-20 | 1 | -9/+9 |
* | Use a string to specify the resampler config option | Chris Robinson | 2011-12-20 | 1 | -4/+4 |
* | Update a config file comment | Chris Robinson | 2011-09-18 | 1 | -3/+3 |
* | Add an option to trap device errors in a debugger | Chris Robinson | 2011-09-10 | 1 | -0/+8 |
* | Add an option to trap context errors in a debugger | Chris Robinson | 2011-09-10 | 1 | -0/+8 |
* | Use the string ID instead of numeral index to reference the ALSA card | Chris Robinson | 2011-08-19 | 1 | -2/+2 |
* | Add options to specify alternate ALSA device prefixes | Chris Robinson | 2011-08-19 | 1 | -0/+12 |
* | Add an option to emulate EAX reverb using standard reverb | Chris Robinson | 2011-07-20 | 1 | -0/+6 |
* | Add a config option to boost reverb output | Chris Robinson | 2011-07-20 | 1 | -0/+12 |
* | Update the default drivers config option comment | Chris Robinson | 2011-06-22 | 1 | -1/+1 |
* | Update alsoftrc.sample | Chris Robinson | 2011-05-18 | 1 | -11/+7 |
* | Add mmdevapi to alsoftrc.sample | Chris Robinson | 2011-05-17 | 1 | -1/+1 |
* | Re-enable duplication for stereo sounds | Chris Robinson | 2011-05-15 | 1 | -8/+7 |
|