Compare commits

...

85 commits

Author SHA1 Message Date
Grant Bagwell
5f2c42fa09
Merge pull request #26 from DrBeef/gbtesting
Update gzdoom-g3.3mgw_mobile
2022-11-09 23:14:05 +01:00
Emanuele Disco
84b8113645 Update gzdoom-g3.3mgw_mobile 2022-11-07 01:20:10 +09:00
Emanuele Disco
2df7087169 - copy cheat-menu and laser-sight mods only if they are not present in the mods folder 2022-05-25 22:34:08 +09:00
Emanuele Disco
0dc8495ae8 - removed fluidsynth unused folder
- updated fluidsynth lite to version 1.1.11
2022-04-18 21:49:11 +09:00
Emanuele Disco
97f066669f - replaced fluidsynth.sf2 with the default sf2 file in lzdoom asset 2022-04-03 23:54:11 +09:00
Emanuele Disco
bf44809a31 - enabled offhand grip button event whether or not the two handed weapon option is turned on 2022-03-08 04:19:51 +09:00
Emanuele Disco
f5d006eb2e Merge branch 'beef_master' into questzdoom 2022-03-04 02:22:29 +09:00
Simon
aab0df4a80 Update gzdoom-g3.3mgw_mobile 2022-03-02 21:28:11 +00:00
Simon
dd422472d7 fix various build breaks
and added VR API extra latency mode
2022-03-02 21:27:29 +00:00
Emanuele Disco
73e0e73317 - fixed lzma compilation
added flag -march=armv8+crc
2021-12-30 20:54:28 +09:00
Emanuele Disco
e1371f4bde Merge remote-tracking branch 'origin/master' into questzdoom 2021-11-12 13:47:26 +09:00
Emanuele Disco
8b45ea7f89 Changes to laser-sight mod
- replaced option 'Hide on slot 1' with 'Hide with melee weapon'
2021-11-12 13:47:12 +09:00
Emanuele Disco
43dbb02581 - fixed laser-sight mod to work with offhand weapon 2021-11-12 13:47:12 +09:00
Emanuele Disco
8773d849f9 - disabled snapturn when secondary button pressed, enabling 4 more buttons to be binded 2021-11-12 13:47:12 +09:00
Emanuele Disco
0c96f9908a - cleaned up button events
- added button events for main and offhand joystick with and without secondary button pressed
- simplified implementation for wheel buttons events
2021-11-12 13:47:11 +09:00
Emanuele Disco
70cb4046af - added two more button events to the main controller
secondary button + joysitick up
secondary button + joystick down
they can be used to switch offhand weapon with new qzd update
- moved default button events for joysticks way down to avoid conflict during key bindings with other buttons events
2021-11-12 13:47:11 +09:00
Emanuele Disco
72feffbbef - added pitch adjust to offhand weapon 2021-11-11 01:32:54 +09:00
Simon
b0b7a36d46 Update to latest changes from @emawind84 2021-11-02 22:51:52 +00:00
Simon
4fbcca0df6 Point to my fork of @emawind84 's repo 2021-09-29 22:39:14 +01:00
Simon
4abfa88af8
Merge pull request #20 from emawind84/questzdoom
Merge to rebase1
2021-09-29 22:31:32 +01:00
Emanuele Disco
40db6ea16b - changed submodule to latest questzdoom update
- repacked lzdoom.pk3
2021-09-28 13:37:55 +09:00
Emanuele Disco
9a14174303 - fixed wrong offhandoffset X, Y position when in cinema mode 2021-09-28 13:30:39 +09:00
Emanuele Disco
8526c3890d - changed submodule to latest questzdoom update
- repacked lzdoom.pk3
2021-09-08 12:14:02 +09:00
Emanuele Disco
3bd239a37c - changed submodule to latest questzdoom update
- repacked lzdoom.pk3
2021-09-07 00:43:48 +09:00
Emanuele Disco
304cff0a03 - fixed joystick events not triggered when menu state on
It was impossible to scroll strafe dialog content or choose reply
- changed the joystick axis bind keys to match the pcvr version
2021-09-07 00:42:51 +09:00
Emanuele Disco
88a3cdf414 - changed submodule to latest questzdoom update
- repacked lzdoom.pk3
2021-09-01 10:47:07 +09:00
Emanuele Disco
b26d0c29c2 - add splash screen to the app 2021-08-20 23:34:18 +09:00
Emanuele Disco
25f15196d8 - changed submodule to latest questzdoom update
- repacked lzdoom.pk3
2021-08-20 23:28:51 +09:00
Emanuele Disco
66d4b9d566 - changed submodule to latest questzdoom update
- repacked lzdoom.pk3
2021-08-20 10:34:06 +09:00
Emanuele Disco
3f93b8d1e1 - added 120Hz refresh rate support for command line 2021-08-20 10:24:01 +09:00
Emanuele Disco
3b4e8ce848 - moved the set refresh rate execution on initialization instead of setting it on every frame (dynamic throttling should happen)
- check if passed refresh rate is supported by the device before set it
- added public QzDoom_SetRefreshRate to change refresh rate in game
2021-08-20 10:19:08 +09:00
Emanuele Disco
1dd0e88cff - changed submodule to latest questzdoom update
- repacked lzdoom.pk3
2021-08-17 22:39:43 +09:00
Emanuele Disco
a035e9ab4e - added 4 key binding for thumb rest for Quest 2 controller
- inverted key bind mousewheel down/up
- added missing key definitions on doomkeys.h
2021-08-17 22:37:53 +09:00
Emanuele Disco
3f19e085a4 - changed submodule reference to latest questzdoom update
- update version to 1.3.0
- packed lzdoom.pk3
2021-08-05 01:30:19 +09:00
Emanuele Disco
1b4d9448cb Merge branch 'questzdoom' of https://github.com/emawind84/QuestZDoom into questzdoom 2021-08-05 00:20:39 +09:00
Emanuele Disco
dded640874 - changed submodule reference to latest commit
- updated pk3 files
2021-07-27 09:58:37 +09:00
Emanuele Disco
ed6d85b93d added support for 90hz for Quest 2 2021-07-27 09:55:37 +09:00
Emanuele Disco
f7a9d63ab6 added 90hz support for Oculus Quest 2 2021-07-26 23:10:41 +09:00
Emanuele Disco
a7ee685929 changed submodule reference to latest commit 2021-07-09 16:54:06 +09:00
Emanuele Disco
b1b283a85c - added submodule questzdoom
https://github.com/emawind84/gzdoom/tree/questzdoom
2021-07-09 13:36:19 +09:00
Emanuele Disco
0a774f828c - removed gzdoom code
preparation for attaching submodule
2021-07-09 12:54:10 +09:00
Emanuele Disco
2c531e54f9 restored fix for savegame screenshot
fix for heretic filter + cleanup
2021-06-19 09:35:50 +09:00
Simon
329dee523c Fix for enemy hit haptics when no gameplay mod is being used 2021-06-17 19:34:27 +01:00
Simon
7e9a35b3a2 Fix Brutal Doom enemy fire not triggering vest 2021-06-16 22:36:27 +01:00
Simon
a3d2eca0d8 Added External Haptics Intensity config
Affects level of all external haptics
2021-06-14 22:14:29 +01:00
Simon
8bd954828a Small change to allow adjustment of individual haptic intensity 2021-06-11 19:25:11 +01:00
Simon
f8ab514d5c Merged @Baggyg's changes for Cybershoes support 2021-05-16 19:35:30 +01:00
Simon
035881dbdd Remove external haptics menu option
if it is present, then it will be used, no need for a toggle
2021-05-10 22:03:26 +01:00
Simon
a5228fab96 Update Version to 1.2.0 2021-05-08 17:31:07 +01:00
Simon
41bccaa732 More fixes for use of service 2021-05-08 17:24:02 +01:00
Simon
d2d7d32239 Update GLES3JNIActivity.java 2021-05-08 17:24:02 +01:00
Simon
553286c44f Added SupportLibs 2021-05-08 17:24:02 +01:00
Simon
c4a3dd2ecb Move to using bHaptics service 2021-05-08 17:24:02 +01:00
Simon
8ae6d5604f Small tweaks to angles 2021-05-08 17:24:02 +01:00
Simon
9592dc97bf attack angle now working right (I think..) 2021-05-08 17:24:01 +01:00
Simon
496c872ab3 trying to sort attack angle
still not quite right for some reason
2021-05-08 17:24:01 +01:00
Simon
78269e76db Bit more tinkering
removed unused haptic patterns from Doom3
2021-05-08 17:24:01 +01:00
Simon
7cde9314f7 Early impl of bHaptics
Just copied some stuff from Doom3Quest to see how well it works
2021-05-08 17:24:00 +01:00
Simon
4680b56dff Added SupportLibs 2021-04-20 21:09:02 +01:00
Simon
f4df49b04e Update p_mobj.cpp 2021-03-07 15:27:58 +00:00
Simon
d1e59eef70 Update p_mobj.cpp 2021-03-06 21:47:15 +00:00
Simon
00baa9cd7a Haptic feedback working with Meatgrinder mod 2021-03-06 20:28:51 +00:00
Simon
1085c1cf73 Multiple Changes
- Secondary left handed control option that keeps right-handed buttons for A/B/X/Y
- Some CVAR changes thanks to VR_Bummser for better lighting on Quest 2
- Upgraded Gradle to 4.0.2 /  6.1.1
- Updated to SDK 1.42
2021-02-20 23:37:24 +00:00
Simon
5c6a51ef0d FOrce refresh rate setting on each frame 2020-12-14 21:08:45 +00:00
Simon
df5f3327f8 Building against SDK 1.40 (v23) 2020-12-08 22:21:34 +00:00
Simon
fede580be9 Update to LZDoom 3.86 2020-11-02 21:16:25 +00:00
Simon
9d6e140f7c Changes to support buffer investigation 2020-11-02 19:11:30 +00:00
Simon
35163ee836 Updated for FOV issues 2020-10-18 22:28:43 +01:00
Simon
299ceb4e2f Fix warpy look on Quest 2 2020-10-13 22:58:43 +01:00
Simon
d015ba9f9d Update QzDoom_SurfaceView.c 2020-09-01 21:56:34 +01:00
Simon
7b667e72b2 Weapon Scale cvar now applies to Models too
..and added finer control of the mouse in the Total Chaos inventory
2020-06-08 19:15:23 +01:00
Simon
e4d64f9b9f Made Doom Playable in Cinema Mode 2020-06-07 22:32:20 +01:00
Simon
f35544b9b1 Functioning mouse cursor in Total Chaos
Using cinematic mode binding
Also enabled HDR by default
2020-06-06 14:41:41 +01:00
Simon
d115870210 Fix for seconday buttons toggle issue 2020-06-02 22:40:23 +01:00
Simon
528a5dcf06 Prevent weapon model clipping through walls/objects 2020-06-01 22:29:54 +01:00
Simon
802543ab30 Update p_map.cpp
Updated the comment to make it clearer what it is doing (I hope!)
2020-05-31 22:58:48 +01:00
Simon
af67930294 Fix strange aiming issue 2020-05-31 22:55:39 +01:00
Simon
f47f9593f8 Fix weapon projectile origin height when standing in water 2020-05-30 10:45:28 +01:00
Simon
a2dae210ca Command line param for FFR in case it makes any difference 2020-05-29 22:37:16 +01:00
Simon
3d9775bb0b Never allow crosshair to be drawn
it doesn't make sense in VR
2020-05-29 09:46:46 +01:00
Simon
68f41c63e7 Prevent weapon projectile spread fix causing laser sight jitter 2020-05-29 00:11:08 +01:00
Simon
4f3b54e84a Major Update - LZDoom 3.85
- Updated to LZDoom 3.85
- Fix for issue where multi-projectile weapons don't have projectile spread
- Configurable cinema mode toggle button
2020-05-28 23:57:00 +01:00
Simon
42b4cf7859 Definition of vr_momentum CVAR
Forgot to commit this in the last commit
2020-05-28 09:38:45 +01:00
Simon
2eb41c6246 Aloow Slidey Movement Toggle
Remove's acceleration which could be a cause of motion sickness
2020-05-27 18:09:59 +01:00
Simon
649d27c982 Many fixes..
- Stair transitions are now smooth as butter!
- Ability to turn off two handed weapons and map grip button instead
- Ability to turn off "alt-key" dominant grip button  and map that to a single button instead
- Weapon no longer jitters or moves independently of player, it should be fixed to controller location (this should fix hexen weapon in water issue)
- Added comment to menu to tell people for to use < 10 angle for smooth turn
- Fix issue where orientation is wrong after using teleporter
2020-05-24 10:52:47 +01:00
6341 changed files with 1205928 additions and 1003894 deletions

15
.gitignore vendored
View file

@ -30,22 +30,11 @@ $RECYCLE.BIN/
*.class
drbeef-release-key.keystore
projects/Android/build/*
projects/Android/jni/SupportLibs/*
Projects/Android/.externalNativeBuild/ndkBuild/debug/arm64-v8a/android_gradle_build.json
Projects/Android/.cxx/*
*.json
Projects/Android/.externalNativeBuild/ndkBuild/debug/arm64-v8a/ndkBuild_build_command.txt
Projects/Android/.externalNativeBuild/ndkBuild/debug/arm64-v8a/ndkBuild_build_output.txt
Projects/Android/.externalNativeBuild/ndkBuild/release/arm64-v8a/ndkBuild_build_command.txt
Projects/Android/.externalNativeBuild/ndkBuild/release/armeabi-v7a/ndkBuild_build_output.txt
Projects/Android/.externalNativeBuild/*
*.bin
Projects/Android/.gradle/4.4/fileHashes/fileHashes.lock
*.ser
Projects/Android/.idea/*
Projects/Android/.externalNativeBuild/ndkBuild/debug/armeabi-v7a/ndkBuild_build_command.txt
Projects/Android/.externalNativeBuild/ndkBuild/release/armeabi-v7a/ndkBuild_build_command.txt
Projects/Android/.externalNativeBuild/ndkBuild/debug/armeabi-v7a/ndkBuild_build_output.txt
Projects/Android/.externalNativeBuild/ndkBuild/release/arm64-v8a/ndkBuild_build_output.txt
Projects/Android/.gradle/4.6/fileHashes/fileHashes.lock
Projects/Android/Android.iml
Projects/Android/.gradle/*
Projects/Android/Android.iml

4
.gitmodules vendored Normal file
View file

@ -0,0 +1,4 @@
[submodule "gzdoom"]
path = Projects/Android/jni/gzdoom-g3.3mgw_mobile
url = https://github.com/DrBeef/gzdoom.git
branch = questzdoom

View file

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.drbeef.questzdoom"
android:versionCode="16"
android:versionName="1.0.0" android:installLocation="auto" >
android:versionCode="31"
android:versionName="1.4.0" android:installLocation="auto" >
<!-- Tell the system this app requires OpenGL ES 3.1. -->
<uses-feature android:glEsVersion="0x00030001" android:required="true"/>
@ -10,14 +10,16 @@
<uses-feature android:name="android.hardware.vr.headtracking" android:version="1"
android:required="true" />
<!-- Network access needed for OVRMonitor -->
<uses-permission android:name="android.permission.INTERNET" />
<!-- Volume Control -->
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<application android:allowBackup="false" android:icon="@drawable/ic_qquest" android:label="@string/qzdoom">
<meta-data android:name="com.samsung.android.vr.application.mode" android:value="vr_only"/>
<meta-data android:name="com.oculus.supportedDevices" android:value="quest|quest2"/>
<meta-data android:name="com.oculus.ossplash" android:value="true"/>
<!-- The activity is the built-in NativeActivity framework class. -->
<!-- launchMode is set to singleTask because there should never be multiple copies of the app running. -->
<!-- Theme.Black.NoTitleBar.Fullscreen gives solid black instead of a (bad stereoscopic) gradient on app transition. -->
@ -29,8 +31,9 @@
android:label="@string/qzdoom"
android:launchMode="singleTask"
android:screenOrientation="landscape"
android:resizeableActivity="false"
android:excludeFromRecents="false"
android:configChanges="screenSize|screenLayout|orientation|keyboardHidden|keyboard|navigation|uiMode">
android:configChanges="density|keyboard|keyboardHidden|navigation|orientation|screenLayout|screenSize|uiMode">
<!-- Tell NativeActivity the name of the .so -->
<meta-data android:name="android.app.lib_name" android:value="QuestZDoom" />
<!-- This filter lets the apk show up as a launchable icon. -->

View file

@ -25,6 +25,11 @@ android {
}
minSdkVersion 24
targetSdkVersion 26
// packagingOptions {
// specify the path to your object binaries, or generally:
// doNotStrip '**.so'
// }
}
sourceSets {
@ -33,7 +38,7 @@ android {
java.srcDirs = ['../../java']
jniLibs.srcDir 'libs'
res.srcDirs = ['../../res']
assets.srcDirs = ['../../assets']
assets.srcDirs = ['../../assets', 'jni/gzdoom-g3.3mgw_mobile/fm_banks', 'jni/gzdoom-g3.3mgw_mobile/soundfont']
}
}
compileOptions {
@ -42,11 +47,17 @@ android {
}
compileSdkVersion = 24
buildToolsVersion = '29.0.1'
/* buildTypes {
release {
debuggable true
}
}*/
}
dependencies {
implementation "com.android.support:support-compat:24.2.0"
implementation "com.android.support:support-core-utils:24.2.0"
implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
}
repositories {

View file

@ -1,6 +1,6 @@
#Sat Jul 27 06:47:04 BST 2019
#Sat Feb 20 22:20:15 GMT 2021
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip

View file

@ -6,7 +6,7 @@ NDK_MODULE_PATH := $(ROOT_DIR)
APP_PLATFORM := android-19
APP_CFLAGS += -Wl,--no-undefined
APP_CFLAGS += -Wl,--no-undefined, -march=armv8+crc
APPLICATIONMK_PATH = $(call my-dir)

View file

@ -44,7 +44,6 @@ Copyright : Copyright 2015 Oculus VR, LLC. All Rights reserved.
//Define all variables here that were externs in the VrCommon.h
bool qzdoom_initialised;
long long global_time;
float playerHeight;
float playerYaw;
bool resetDoomYaw;
bool resetPreviousPitch;
@ -62,6 +61,8 @@ float vr_weapon_pitchadjust;
bool vr_moveuseoffhand;
float vr_snapturn_angle;
bool vr_switchsticks;
bool vr_secondarybuttonmappings;
bool vr_twohandedweapons;
float vr_use_teleport;
vec3_t offhandangles;
vec3_t offhandoffset;
@ -69,7 +70,31 @@ bool player_moving;
bool shutdown;
bool ready_teleport;
bool trigger_teleport;
bool cinemamode;
extern ovrInputStateTrackedRemote leftTrackedRemoteState_old;
extern ovrInputStateTrackedRemote leftTrackedRemoteState_new;
extern ovrTracking leftRemoteTracking_new;
extern ovrInputStateTrackedRemote rightTrackedRemoteState_old;
extern ovrInputStateTrackedRemote rightTrackedRemoteState_new;
extern ovrTracking rightRemoteTracking_new;
extern ovrInputStateGamepad footTrackedRemoteState_old;
extern ovrInputStateGamepad footTrackedRemoteState_new;
extern ovrDeviceID controllerIDs[2];
extern float remote_movementSideways;
extern float remote_movementForward;
extern float remote_movementUp;
extern float positional_movementSideways;
extern float positional_movementForward;
extern float snapTurn;
extern float cinemamodeYaw;
extern float cinemamodePitch;
#if !defined( EGL_OPENGL_ES3_BIT_KHR )
#define EGL_OPENGL_ES3_BIT_KHR 0x0040
@ -101,8 +126,9 @@ PFNEGLGETSYNCATTRIBKHRPROC eglGetSyncAttribKHR;
int CPU_LEVEL = 4;
int GPU_LEVEL = 4;
int NUM_MULTI_SAMPLES = 1;
int FFR = 0;
float SS_MULTIPLIER = 1.0f;
int DISPLAY_REFRESH = 72;
int DISPLAY_REFRESH = -1;
jclass clazz;
@ -119,6 +145,7 @@ struct arg_dbl *ss;
struct arg_int *cpu;
struct arg_int *gpu;
struct arg_int *msaa;
struct arg_int *ffr;
struct arg_int *refresh;
struct arg_end *end;
@ -131,6 +158,7 @@ int argc=0;
enum control_scheme {
RIGHT_HANDED_DEFAULT = 0,
LEFT_HANDED_DEFAULT = 10,
LEFT_HANDED_ALT = 11,
GAMEPAD = 20 //Not implemented, someone else can do this!
};
@ -171,7 +199,7 @@ void QzDoom_setUseScreenLayer(bool use)
bool QzDoom_useScreenLayer()
{
return useVirtualScreen;
return useVirtualScreen || cinemamode;
}
static void UnEscapeQuotes( char *arg )
@ -617,11 +645,6 @@ void ovrFramebuffer_Destroy( ovrFramebuffer * frameBuffer )
void ovrFramebuffer_SetCurrent( ovrFramebuffer * frameBuffer )
{
while (glGetError() != GL_NO_ERROR)
{
}
GL( glBindFramebuffer( GL_FRAMEBUFFER, frameBuffer->FrameBuffers[frameBuffer->ProcessingTextureSwapChainIndex] ) );
}
@ -691,17 +714,18 @@ void ovrRenderer_Clear( ovrRenderer * renderer )
{
ovrFramebuffer_Clear( &renderer->FrameBuffer[eye] );
}
renderer->ProjectionMatrix = ovrMatrix4f_CreateIdentity();
renderer->NumBuffers = VRAPI_FRAME_LAYER_EYE_MAX;
}
float QzDoom_GetFOV();
void ovrRenderer_Create( int width, int height, ovrRenderer * renderer, const ovrJava * java )
{
renderer->NumBuffers = VRAPI_FRAME_LAYER_EYE_MAX;
//Now using a symmetrical render target, based on the horizontal FOV
vrFOV = vrapi_GetSystemPropertyInt( java, VRAPI_SYS_PROP_SUGGESTED_EYE_FOV_DEGREES_X);
//QzDoom_GetFOV();
// Create the render Textures.
for ( int eye = 0; eye < VRAPI_FRAME_LAYER_EYE_MAX; eye++ )
@ -712,11 +736,6 @@ void ovrRenderer_Create( int width, int height, ovrRenderer * renderer, const ov
height,
NUM_MULTI_SAMPLES );
}
// Setup the projection matrix.
renderer->ProjectionMatrix = ovrMatrix4f_CreateProjectionFov(
vrFOV, vrFOV, 0.0f, 0.0f, 1.0f, 0.0f );
}
void ovrRenderer_Destroy( ovrRenderer * renderer )
@ -725,7 +744,6 @@ void ovrRenderer_Destroy( ovrRenderer * renderer )
{
ovrFramebuffer_Destroy( &renderer->FrameBuffer[eye] );
}
renderer->ProjectionMatrix = ovrMatrix4f_CreateIdentity();
}
@ -851,18 +869,8 @@ void setWorldPosition( float x, float y, float z )
void setHMDPosition( float x, float y, float z, float yaw )
{
static bool s_useScreen = false;
VectorSet(hmdPosition, x, y, z);
if (s_useScreen != QzDoom_useScreenLayer())
{
s_useScreen = QzDoom_useScreenLayer();
//Record player height on transition
playerHeight = y;
}
if (!QzDoom_useScreenLayer())
{
playerYaw = yaw;
@ -892,6 +900,39 @@ void QzDoom_Vibrate(float duration, int channel, float intensity )
vibration_channel_intensity[channel] = intensity;
}
void jni_haptic_event(const char* event, int position, int intensity, float angle, float yHeight);
void jni_haptic_stopevent(const char* event);
void jni_haptic_enable();
void jni_haptic_disable();
void QzDoom_HapticEvent(const char* event, int position, int intensity, float angle, float yHeight )
{
static char buffer[256];
memset(buffer, 0, 256);
for(int i = 0; event[i]; i++)
{
buffer[i] = tolower(event[i]);
}
jni_haptic_event(buffer, position, intensity, angle, yHeight);
}
void QzDoom_HapticStopEvent(const char* event)
{
jni_haptic_stopevent(event);
}
void QzDoom_HapticEnable()
{
jni_haptic_enable();
}
void QzDoom_HapticDisable()
{
jni_haptic_disable();
}
void VR_DoomMain(int argc, char** argv);
void VR_GetMove( float *joy_forward, float *joy_side, float *hmd_forward, float *hmd_side, float *up, float *yaw, float *pitch, float *roll )
@ -901,9 +942,9 @@ void VR_GetMove( float *joy_forward, float *joy_side, float *hmd_forward, float
*up = remote_movementUp;
*joy_side = remote_movementSideways;
*hmd_side = positional_movementSideways;
*yaw = hmdorientation[YAW] + snapTurn;
*pitch = hmdorientation[PITCH];
*roll = hmdorientation[ROLL];
*yaw = cinemamode ? cinemamodeYaw : hmdorientation[YAW] + snapTurn;
*pitch = cinemamode ? cinemamodePitch : hmdorientation[PITCH];
*roll = cinemamode ? 0.0f : hmdorientation[ROLL];
}
@ -953,8 +994,8 @@ static void ovrApp_Clear( ovrApp * app )
app->FrameIndex = 1;
app->DisplayTime = 0;
app->SwapInterval = 1;
app->CpuLevel = 2;
app->GpuLevel = 2;
app->CpuLevel = 3;
app->GpuLevel = 3;
app->MainThreadTid = 0;
app->RenderThreadTid = 0;
@ -1032,6 +1073,8 @@ static void ovrApp_HandleVrModeChanges( ovrApp * app )
vrapi_SetPerfThread( app->Ovr, VRAPI_PERF_THREAD_TYPE_RENDERER, app->RenderThreadTid );
ALOGV( " vrapi_SetPerfThread( RENDERER, %d )", app->RenderThreadTid );
vrapi_SetExtraLatencyMode(app->Ovr, VRAPI_EXTRA_LATENCY_MODE_ON);
}
}
}
@ -1291,7 +1334,9 @@ void VR_Init()
remote_movementUp = 0.0f;
positional_movementSideways = 0.0f;
positional_movementForward = 0.0f;
snapTurn = 0.0f; // start partly turned
snapTurn = 0.0f;
cinemamodeYaw = 0.0f;
cinemamodePitch = 0.0f;
//init randomiser
srand(time(NULL));
@ -1302,6 +1347,8 @@ void VR_Init()
shutdown = false;
ready_teleport = false;
trigger_teleport = false;
cinemamode = false;
}
static ovrAppThread * gAppThread = NULL;
@ -1309,6 +1356,40 @@ static ovrApp gAppState;
static ovrJava java;
static bool destroyed = false;
int QzDoom_GetRefresh()
{
return vrapi_GetSystemPropertyInt(&gAppState.Java, VRAPI_SYS_PROP_DISPLAY_REFRESH_RATE);
}
int QzDoom_SetRefreshRate(int refreshRate)
{
return vrapi_SetDisplayRefreshRate(gAppState.Ovr, (float)refreshRate);
}
bool QzDoom_IsRefreshSupported(int refreshRate)
{
int size = vrapi_GetSystemPropertyInt(&gAppState.Java, VRAPI_SYS_PROP_NUM_SUPPORTED_DISPLAY_REFRESH_RATES);
float supported_rates[size];
int elements = vrapi_GetSystemPropertyFloatArray(&gAppState.Java,
VRAPI_SYS_PROP_SUPPORTED_DISPLAY_REFRESH_RATES,
supported_rates, size);
for (int i = 0; i < size; i++)
{
if (refreshRate == (int)supported_rates[i])
{
return true;
}
}
ALOGV("Refresh rate not supported: %dHz", refreshRate);
return false;
}
float QzDoom_GetFOV()
{
vrFOV = vrapi_GetSystemPropertyInt(&gAppState.Java, VRAPI_SYS_PROP_SUGGESTED_EYE_FOV_DEGREES_Y);
return vrFOV;
}
void QzDoom_prepareEyeBuffer(int eye )
{
ovrRenderer *renderer = QzDoom_useScreenLayer() ? &gAppState.Scene.CylinderRenderer : &gAppState.Renderer;
@ -1441,6 +1522,9 @@ void * AppThreadFunction(void * parm ) {
// This app will handle android gamepad events itself.
vrapi_SetPropertyInt(&gAppState.Java, VRAPI_EAT_NATIVE_GAMEPAD_EVENTS, 0);
//Set FFR property
vrapi_SetPropertyInt( &gAppState.Java, VRAPI_FOVEATION_LEVEL, FFR );
//Using a symmetrical render target
m_height = m_width = (int)(vrapi_GetSystemPropertyInt(&java, VRAPI_SYS_PROP_SUGGESTED_EYE_TEXTURE_WIDTH) * SS_MULTIPLIER);
@ -1464,8 +1548,9 @@ void * AppThreadFunction(void * parm ) {
return NULL;
}
//Set the screen refresh
vrapi_SetDisplayRefreshRate(gAppState.Ovr, DISPLAY_REFRESH);
if (QzDoom_IsRefreshSupported(DISPLAY_REFRESH)) {
QzDoom_SetRefreshRate(DISPLAY_REFRESH);
}
// Create the scene if not yet created.
ovrScene_Create( m_width, m_height, &gAppState.Scene, &java );
@ -1483,26 +1568,6 @@ void * AppThreadFunction(void * parm ) {
//Should now be all set up and ready - start the Doom main loop
VR_DoomMain(argc, argv);
}
//Doesn't work
/*
else {
if (!hasLauncher) {
vrapi_ShowFatalError(&gAppState.Java, "Missing Launcher",
"Please install and run QuestZDoom Launcher to start correctly",
"QuestZDoom", 666);
} else {
vrapi_ShowFatalError(&gAppState.Java, "No IWADs Found",
"Please install a valid IWAD using QuestZDoom Launcher",
"QuestZDoom", 666);
}
while (!destroyed) {
QzDoom_processMessageQueue();
QzDoom_getTrackedRemotesOrientation(0);
incrementFrameIndex();
showLoadingIcon();
}
}*/
//We are done, shutdown cleanly
shutdownVR();
@ -1518,6 +1583,12 @@ void QzDoom_FrameSetup()
{
//Use floor based tracking space
vrapi_SetTrackingSpace(gAppState.Ovr, VRAPI_TRACKING_SPACE_LOCAL_FLOOR);
//Ensure extra latency mode is enabled always
vrapi_SetExtraLatencyMode(gAppState.Ovr, VRAPI_EXTRA_LATENCY_MODE_ON);
//Ensure we are running at configure "power"
vrapi_SetClockLevels( gAppState.Ovr, gAppState.CpuLevel, gAppState.GpuLevel );
}
void QzDoom_processHaptics() {//Handle haptics
@ -1620,12 +1691,17 @@ void QzDoom_getTrackedRemotesOrientation(int vr_control_scheme) {//Get info for
switch ((int)vr_control_scheme)
{
case RIGHT_HANDED_DEFAULT:
HandleInput_Default(&rightTrackedRemoteState_new, &rightTrackedRemoteState_old, &rightRemoteTracking_new,
HandleInput_Default(vr_control_scheme,
&footTrackedRemoteState_new, &footTrackedRemoteState_old,
&rightTrackedRemoteState_new, &rightTrackedRemoteState_old, &rightRemoteTracking_new,
&leftTrackedRemoteState_new, &leftTrackedRemoteState_old, &leftRemoteTracking_new,
ovrButton_A, ovrButton_B, ovrButton_X, ovrButton_Y);
break;
case LEFT_HANDED_DEFAULT:
HandleInput_Default(&leftTrackedRemoteState_new, &leftTrackedRemoteState_old, &leftRemoteTracking_new,
case LEFT_HANDED_ALT:
HandleInput_Default(vr_control_scheme,
&footTrackedRemoteState_new, &footTrackedRemoteState_old,
&leftTrackedRemoteState_new, &leftTrackedRemoteState_old, &leftRemoteTracking_new,
&rightTrackedRemoteState_new, &rightTrackedRemoteState_old, &rightRemoteTracking_new,
ovrButton_X, ovrButton_Y, ovrButton_A, ovrButton_B);
break;
@ -1743,8 +1819,12 @@ Activity lifecycle
*/
jmethodID android_shutdown;
jmethodID android_haptic_event;
jmethodID android_haptic_stopevent;
jmethodID android_haptic_enable;
jmethodID android_haptic_disable;
static JavaVM *jVM;
static jobject shutdownCallbackObj=0;
static jobject jniCallbackObj=0;
void jni_shutdown()
{
@ -1755,7 +1835,64 @@ void jni_shutdown()
{
(*jVM)->AttachCurrentThread(jVM,&env, NULL);
}
return (*env)->CallVoidMethod(env, shutdownCallbackObj, android_shutdown);
return (*env)->CallVoidMethod(env, jniCallbackObj, android_shutdown);
}
void jni_haptic_event(const char* event, int position, int intensity, float angle, float yHeight)
{
ALOGV("Calling: jni_haptic_event");
JNIEnv *env;
jobject tmp;
if (((*jVM)->GetEnv(jVM, (void**) &env, JNI_VERSION_1_4))<0)
{
(*jVM)->AttachCurrentThread(jVM,&env, NULL);
}
jstring StringArg1 = (*env)->NewStringUTF(env, event);
return (*env)->CallVoidMethod(env, jniCallbackObj, android_haptic_event, StringArg1, position, intensity, angle, yHeight);
}
void jni_haptic_stopevent(const char* event)
{
ALOGV("Calling: jni_haptic_stopevent");
JNIEnv *env;
jobject tmp;
if (((*jVM)->GetEnv(jVM, (void**) &env, JNI_VERSION_1_4))<0)
{
(*jVM)->AttachCurrentThread(jVM,&env, NULL);
}
jstring StringArg1 = (*env)->NewStringUTF(env, event);
return (*env)->CallVoidMethod(env, jniCallbackObj, android_haptic_stopevent, StringArg1);
}
void jni_haptic_enable()
{
ALOGV("Calling: jni_haptic_enable");
JNIEnv *env;
jobject tmp;
if (((*jVM)->GetEnv(jVM, (void**) &env, JNI_VERSION_1_4))<0)
{
(*jVM)->AttachCurrentThread(jVM,&env, NULL);
}
return (*env)->CallVoidMethod(env, jniCallbackObj, android_haptic_enable);
}
void jni_haptic_disable()
{
ALOGV("Calling: jni_haptic_disable");
JNIEnv *env;
jobject tmp;
if (((*jVM)->GetEnv(jVM, (void**) &env, JNI_VERSION_1_4))<0)
{
(*jVM)->AttachCurrentThread(jVM,&env, NULL);
}
return (*env)->CallVoidMethod(env, jniCallbackObj, android_haptic_disable);
}
int JNI_OnLoad(JavaVM* vm, void* reserved)
@ -1782,7 +1919,8 @@ JNIEXPORT jlong JNICALL Java_com_drbeef_questzdoom_GLES3JNILib_onCreate( JNIEnv
cpu = arg_int0("c", "cpu", "<int>", "CPU perf index 1-4 (default: 2)"),
gpu = arg_int0("g", "gpu", "<int>", "GPU perf index 1-4 (default: 3)"),
msaa = arg_int0("m", "msaa", "<int>", "MSAA 1-4 (default: 1)"),
refresh = arg_int0("r", "refresh", "<int>", "Display Refresh 60 or 72 (default: 72)"),
ffr = arg_int0("f", "ffr", "<int>", "FFR 0-4 (default: 0)"),
refresh = arg_int0("r", "refresh", "<int>", "Display Refresh 60, 72 or 90 (default: 72)"),
end = arg_end(20)
};
@ -1829,7 +1967,12 @@ JNIEXPORT jlong JNICALL Java_com_drbeef_questzdoom_GLES3JNILib_onCreate( JNIEnv
NUM_MULTI_SAMPLES = msaa->ival[0];
}
if (refresh->count > 0 && (refresh->ival[0] == 60 || refresh->ival[0] == 72))
if (ffr->count > 0 && ffr->ival[0] >= 0 && ffr->ival[0] <= 4)
{
FFR = ffr->ival[0];
}
if (refresh->count > 0 && (refresh->ival[0] == 60 || refresh->ival[0] == 72 || refresh->ival[0] == 90 || refresh->ival[0] == 120))
{
DISPLAY_REFRESH = refresh->ival[0];
}
@ -1851,10 +1994,14 @@ JNIEXPORT void JNICALL Java_com_drbeef_questzdoom_GLES3JNILib_onStart( JNIEnv *
{
ALOGV( " GLES3JNILib::onStart()" );
shutdownCallbackObj = (jobject)(*env)->NewGlobalRef(env, obj1);
jclass callbackClass = (*env)->GetObjectClass(env, shutdownCallbackObj);
jniCallbackObj = (jobject)(*env)->NewGlobalRef(env, obj1);
jclass callbackClass = (*env)->GetObjectClass(env, jniCallbackObj);
android_shutdown = (*env)->GetMethodID(env,callbackClass,"shutdown","()V");
android_haptic_event = (*env)->GetMethodID(env, callbackClass, "haptic_event", "(Ljava/lang/String;IIFF)V");
android_haptic_stopevent = (*env)->GetMethodID(env, callbackClass, "haptic_stopevent", "(Ljava/lang/String;)V");
android_haptic_enable = (*env)->GetMethodID(env, callbackClass, "haptic_enable", "()V");
android_haptic_disable = (*env)->GetMethodID(env, callbackClass, "haptic_disable", "()V");
ovrAppThread * appThread = (ovrAppThread *)((size_t)handle);
ovrMessage message;
@ -1975,15 +2122,13 @@ JNIEXPORT void JNICALL Java_com_drbeef_questzdoom_GLES3JNILib_onSurfaceChanged(
}
}
JNIEXPORT void JNICALL Java_com_drbeef_questzdoom_GLES3JNILib_onSurfaceDestroyed( JNIEnv * env, jobject obj, jlong handle )
{
ALOGV( " GLES3JNILib::onSurfaceDestroyed()" );
ovrAppThread * appThread = (ovrAppThread *)((size_t)handle);
ovrMessage message;
ovrMessage_Init( &message, MESSAGE_ON_SURFACE_DESTROYED, MQ_WAIT_PROCESSED );
ovrMessageQueue_PostMessage( &appThread->MessageQueue, &message );
ALOGV( " ANativeWindow_release( NativeWindow )" );
ANativeWindow_release( appThread->NativeWindow );
appThread->NativeWindow = NULL;
}
JNIEXPORT void JNICALL Java_com_drbeef_questzdoom_GLES3JNILib_onSurfaceDestroyed( JNIEnv * env, jobject obj, jlong handle ) {
ALOGV(" GLES3JNILib::onSurfaceDestroyed()");
ovrAppThread *appThread = (ovrAppThread *) ((size_t) handle);
ovrMessage message;
ovrMessage_Init(&message, MESSAGE_ON_SURFACE_DESTROYED, MQ_WAIT_PROCESSED);
ovrMessageQueue_PostMessage(&appThread->MessageQueue, &message);
ALOGV(" ANativeWindow_release( NativeWindow )");
ANativeWindow_release(appThread->NativeWindow);
appThread->NativeWindow = NULL;
}

View file

@ -29,9 +29,10 @@ extern "C"
extern bool qzdoom_initialised;
extern long long global_time;
extern bool cinemamode;
extern float cinemamodeYaw;
extern float cinemamodePitch;
extern float playerHeight;
extern float playerYaw;
extern bool resetDoomYaw;
extern float doomYaw;
@ -53,6 +54,8 @@ extern bool weaponStabilised;
extern float vr_weapon_pitchadjust;
extern bool vr_moveuseoffhand;
extern bool vr_switchsticks;
extern bool vr_secondarybuttonmappings;
extern bool vr_twohandedweapons;
extern float vr_snapturn_angle;
extern float vr_use_teleport;
@ -89,6 +92,11 @@ void QzDoom_setUseScreenLayer(bool use);
void QzDoom_processHaptics();
void QzDoom_getHMDOrientation(ovrTracking2 *tracking);
void QzDoom_getTrackedRemotesOrientation(int vr_control_scheme);
int QzDoom_SetRefreshRate(int refreshRate);
void QzDoom_HapticEvent(const char* event, int position, int intensity, float angle, float yHeight );
void QzDoom_HapticEnable();
void QzDoom_HapticDisable();
void incrementFrameIndex();

View file

@ -84,7 +84,6 @@ ovrRenderer
typedef struct
{
ovrFramebuffer FrameBuffer[VRAPI_FRAME_LAYER_EYE_MAX];
ovrMatrix4f ProjectionMatrix;
int NumBuffers;
} ovrRenderer;

View file

@ -4,26 +4,12 @@
#include "VrCommon.h"
ovrInputStateTrackedRemote leftTrackedRemoteState_old;
ovrInputStateTrackedRemote leftTrackedRemoteState_new;
ovrTracking leftRemoteTracking_new;
ovrInputStateTrackedRemote rightTrackedRemoteState_old;
ovrInputStateTrackedRemote rightTrackedRemoteState_new;
ovrTracking rightRemoteTracking_new;
ovrDeviceID controllerIDs[2];
float remote_movementSideways;
float remote_movementForward;
float remote_movementUp;
float positional_movementSideways;
float positional_movementForward;
float snapTurn;
void acquireTrackedRemotesData(const ovrMobile *Ovr, double displayTime);
void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew, ovrInputStateTrackedRemote *pDominantTrackedRemoteOld, ovrTracking* pDominantTracking,
void HandleInput_Default( int control_scheme, ovrInputStateGamepad *pFootTrackingNew, ovrInputStateGamepad *pFootTrackingOld, ovrInputStateTrackedRemote *pDominantTrackedRemoteNew,
ovrInputStateTrackedRemote *pDominantTrackedRemoteOld, ovrTracking* pDominantTracking,
ovrInputStateTrackedRemote *pOffTrackedRemoteNew, ovrInputStateTrackedRemote *pOffTrackedRemoteOld, ovrTracking* pOffTracking,
int domButton1, int domButton2, int offButton1, int offButton2 );

View file

@ -15,6 +15,30 @@ Authors : Simon Brown
#include "VrInput.h"
ovrInputStateTrackedRemote leftTrackedRemoteState_old;
ovrInputStateTrackedRemote leftTrackedRemoteState_new;
ovrTracking leftRemoteTracking_new;
ovrInputStateTrackedRemote rightTrackedRemoteState_old;
ovrInputStateTrackedRemote rightTrackedRemoteState_new;
ovrTracking rightRemoteTracking_new;
ovrInputStateGamepad footTrackedRemoteState_old;
ovrInputStateGamepad footTrackedRemoteState_new;
ovrDeviceID controllerIDs[2];
float remote_movementSideways;
float remote_movementForward;
float remote_movementUp;
float positional_movementSideways;
float positional_movementForward;
float snapTurn;
float cinemamodeYaw;
float cinemamodePitch;
void Joy_GenerateButtonEvents(int oldbuttons, int newbuttons, int numbuttons, int base);
void handleTrackedControllerButton(ovrInputStateTrackedRemote * trackedRemoteState, ovrInputStateTrackedRemote * prevTrackedRemoteState, uint32_t button, int key)
@ -84,34 +108,51 @@ bool between(float min, float val, float max)
void acquireTrackedRemotesData(const ovrMobile *Ovr, double displayTime) {//The amount of yaw changed by controller
for ( int i = 0; ; i++ ) {
ovrInputCapabilityHeader cap;
ovrResult result = vrapi_EnumerateInputDevices(Ovr, i, &cap);
ovrInputCapabilityHeader capsHeader;
ovrResult result = vrapi_EnumerateInputDevices(Ovr, i, &capsHeader);
if (result < 0) {
break;
}
if (cap.Type == ovrControllerType_TrackedRemote) {
if (capsHeader.Type == ovrControllerType_Gamepad) {
ovrInputGamepadCapabilities remoteCaps;
remoteCaps.Header = capsHeader;
if (vrapi_GetInputDeviceCapabilities(Ovr, &remoteCaps.Header) >= 0) {
// remote is connected
ovrInputStateGamepad remoteState;
remoteState.Header.ControllerType = ovrControllerType_Gamepad;
if ( vrapi_GetCurrentInputState( Ovr, capsHeader.DeviceID, &remoteState.Header ) >= 0 )
{
// act on device state returned in remoteState
footTrackedRemoteState_new = remoteState;
}
}
}
else if (capsHeader.Type == ovrControllerType_TrackedRemote) {
ovrTracking remoteTracking;
ovrInputStateTrackedRemote trackedRemoteState;
trackedRemoteState.Header.ControllerType = ovrControllerType_TrackedRemote;
result = vrapi_GetCurrentInputState(Ovr, cap.DeviceID, &trackedRemoteState.Header);
ovrInputTrackedRemoteCapabilities remoteCaps;
remoteCaps.Header = capsHeader;
if ( vrapi_GetInputDeviceCapabilities( Ovr, &remoteCaps.Header ) >= 0 )
{
// remote is connected
ovrInputStateTrackedRemote remoteState;
remoteState.Header.ControllerType = ovrControllerType_TrackedRemote;
if (result == ovrSuccess) {
ovrInputTrackedRemoteCapabilities remoteCapabilities;
remoteCapabilities.Header = cap;
result = vrapi_GetInputDeviceCapabilities(Ovr, &remoteCapabilities.Header);
result = vrapi_GetInputTrackingState(Ovr, cap.DeviceID, displayTime,
&remoteTracking);
if (remoteCapabilities.ControllerCapabilities & ovrControllerCaps_RightHand) {
rightTrackedRemoteState_new = trackedRemoteState;
rightRemoteTracking_new = remoteTracking;
controllerIDs[1] = cap.DeviceID;
} else{
leftTrackedRemoteState_new = trackedRemoteState;
leftRemoteTracking_new = remoteTracking;
controllerIDs[0] = cap.DeviceID;
if(vrapi_GetCurrentInputState(Ovr, capsHeader.DeviceID, &remoteState.Header) >= 0) {
if (vrapi_GetInputTrackingState(Ovr, capsHeader.DeviceID, displayTime,
&remoteTracking) >= 0) {
// act on device state returned in remoteState
if (remoteCaps.ControllerCapabilities & ovrControllerCaps_RightHand) {
rightTrackedRemoteState_new = remoteState;
rightRemoteTracking_new = remoteTracking;
controllerIDs[1] = capsHeader.DeviceID;
} else {
leftTrackedRemoteState_new = remoteState;
leftRemoteTracking_new = remoteTracking;
controllerIDs[0] = capsHeader.DeviceID;
}
}
}
}
}

View file

@ -18,39 +18,50 @@ Authors : Simon Brown
#include "doomkeys.h"
extern ovrInputStateTrackedRemote leftTrackedRemoteState_old;
extern ovrInputStateTrackedRemote leftTrackedRemoteState_new;
extern ovrTracking leftRemoteTracking_new;
extern ovrInputStateTrackedRemote rightTrackedRemoteState_old;
extern ovrInputStateTrackedRemote rightTrackedRemoteState_new;
extern ovrTracking rightRemoteTracking_new;
extern ovrInputStateGamepad footTrackedRemoteState_old;
extern ovrInputStateGamepad footTrackedRemoteState_new;
extern ovrDeviceID controllerIDs[2];
extern float remote_movementSideways;
extern float remote_movementForward;
extern float remote_movementUp;
extern float positional_movementSideways;
extern float positional_movementForward;
extern float snapTurn;
extern float cinemamodeYaw;
extern float cinemamodePitch;
int getGameState();
int getMenuState();
void Joy_GenerateButtonEvents(int oldbuttons, int newbuttons, int numbuttons, int base);
float getViewpointYaw();
void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew, ovrInputStateTrackedRemote *pDominantTrackedRemoteOld, ovrTracking* pDominantTracking,
void HandleInput_Default( int control_scheme, ovrInputStateGamepad *pFootTrackingNew, ovrInputStateGamepad *pFootTrackingOld,
ovrInputStateTrackedRemote *pDominantTrackedRemoteNew, ovrInputStateTrackedRemote *pDominantTrackedRemoteOld, ovrTracking* pDominantTracking,
ovrInputStateTrackedRemote *pOffTrackedRemoteNew, ovrInputStateTrackedRemote *pOffTrackedRemoteOld, ovrTracking* pOffTracking,
int domButton1, int domButton2, int offButton1, int offButton2 )
{
//Menu button - invoke menu
handleTrackedControllerButton(&leftTrackedRemoteState_new, &leftTrackedRemoteState_old, ovrButton_Enter, KEY_ESCAPE);
if (getGameState() != 0 || getMenuState() == 1) // If getMenuState returns 2, then we are waiting for a key mapping input, so send normal keymappings, don't send these
{
Joy_GenerateButtonEvents((pOffTrackedRemoteOld->Joystick.x > 0.7f ? 1 : 0), (pOffTrackedRemoteNew->Joystick.x > 0.7f ? 1 : 0), 1, KEY_PAD_DPAD_RIGHT);
Joy_GenerateButtonEvents((pDominantTrackedRemoteOld->Joystick.x > 0.7f ? 1 : 0), (pDominantTrackedRemoteNew->Joystick.x > 0.7f ? 1 : 0), 1, KEY_PAD_DPAD_RIGHT);
Joy_GenerateButtonEvents((pOffTrackedRemoteOld->Joystick.x < -0.7f ? 1 : 0), (pOffTrackedRemoteNew->Joystick.x < -0.7f ? 1 : 0), 1, KEY_PAD_DPAD_LEFT);
Joy_GenerateButtonEvents((pDominantTrackedRemoteOld->Joystick.x < -0.7f ? 1 : 0), (pDominantTrackedRemoteNew->Joystick.x < -0.7f ? 1 : 0), 1, KEY_PAD_DPAD_LEFT);
Joy_GenerateButtonEvents((pOffTrackedRemoteOld->Joystick.y < -0.7f ? 1 : 0), (pOffTrackedRemoteNew->Joystick.y < -0.7f ? 1 : 0), 1, KEY_PAD_DPAD_DOWN);
Joy_GenerateButtonEvents((pDominantTrackedRemoteOld->Joystick.y < -0.7f ? 1 : 0), (pDominantTrackedRemoteNew->Joystick.y < -0.7f ? 1 : 0), 1, KEY_PAD_DPAD_DOWN);
Joy_GenerateButtonEvents((pOffTrackedRemoteOld->Joystick.y > 0.7f ? 1 : 0), (pOffTrackedRemoteNew->Joystick.y > 0.7f ? 1 : 0), 1, KEY_PAD_DPAD_UP);
Joy_GenerateButtonEvents((pDominantTrackedRemoteOld->Joystick.y > 0.7f ? 1 : 0), (pDominantTrackedRemoteNew->Joystick.y > 0.7f ? 1 : 0), 1, KEY_PAD_DPAD_UP);
}
handleTrackedControllerButton(&rightTrackedRemoteState_new, &rightTrackedRemoteState_old, ovrButton_Enter, KEY_ESCAPE); // For users who have switched the buttons
//Dominant Grip works like a shift key
bool dominantGripPushedOld =
(pDominantTrackedRemoteOld->Buttons & ovrButton_GripTrigger) != 0;
bool dominantGripPushedNew =
(pDominantTrackedRemoteNew->Buttons & ovrButton_GripTrigger) != 0;
bool dominantGripPushedOld = vr_secondarybuttonmappings ?
(pDominantTrackedRemoteOld->Buttons & ovrButton_GripTrigger) != 0 : false;
bool dominantGripPushedNew = vr_secondarybuttonmappings ?
(pDominantTrackedRemoteNew->Buttons & ovrButton_GripTrigger) != 0 : false;
ovrInputStateTrackedRemote *pPrimaryTrackedRemoteNew, *pPrimaryTrackedRemoteOld, *pSecondaryTrackedRemoteNew, *pSecondaryTrackedRemoteOld;
if (vr_switchsticks)
@ -68,6 +79,53 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew,
pSecondaryTrackedRemoteOld = pOffTrackedRemoteOld;
}
//All this to allow stick and button switching!
uint32_t primaryButtonsNew;
uint32_t primaryButtonsOld;
uint32_t secondaryButtonsNew;
uint32_t secondaryButtonsOld;
int primaryButton1;
int primaryButton2;
int secondaryButton1;
int secondaryButton2;
if (control_scheme == 11) // Left handed Alt
{
primaryButtonsNew = pOffTrackedRemoteNew->Buttons;
primaryButtonsOld = pOffTrackedRemoteOld->Buttons;
secondaryButtonsNew = pDominantTrackedRemoteNew->Buttons;
secondaryButtonsOld = pDominantTrackedRemoteOld->Buttons;
primaryButton1 = offButton1;
primaryButton2 = offButton2;
secondaryButton1 = domButton1;
secondaryButton2 = domButton2;
}
else // Left and right handed
{
primaryButtonsNew = pDominantTrackedRemoteNew->Buttons;
primaryButtonsOld = pDominantTrackedRemoteOld->Buttons;
secondaryButtonsNew = pOffTrackedRemoteNew->Buttons;
secondaryButtonsOld = pOffTrackedRemoteOld->Buttons;
primaryButton1 = domButton1;
primaryButton2 = domButton2;
secondaryButton1 = offButton1;
secondaryButton2 = offButton2;
}
//In cinema mode, right-stick controls mouse
const float mouseSpeed = 3.0f;
if (cinemamode)
{
if (fabs(pPrimaryTrackedRemoteNew->Joystick.x) > 0.1f) {
cinemamodeYaw -= mouseSpeed * pPrimaryTrackedRemoteNew->Joystick.x;
}
if (fabs(pPrimaryTrackedRemoteNew->Joystick.y) > 0.1f) {
cinemamodePitch -= mouseSpeed * pPrimaryTrackedRemoteNew->Joystick.y;
}
}
// Only do the following if we are definitely not in the menu
if (getMenuState() == 0)
{
@ -79,7 +137,8 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew,
pDominantTracking->HeadPose.Pose.Position.z, 2));
//Turn on weapon stabilisation?
if ((pOffTrackedRemoteNew->Buttons & ovrButton_GripTrigger) !=
if (vr_twohandedweapons &&
(pOffTrackedRemoteNew->Buttons & ovrButton_GripTrigger) !=
(pOffTrackedRemoteOld->Buttons & ovrButton_GripTrigger)) {
if (pOffTrackedRemoteNew->Buttons & ovrButton_GripTrigger) {
@ -98,19 +157,16 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew,
weaponoffset[1] = pDominantTracking->HeadPose.Pose.Position.y - hmdPosition[1];
weaponoffset[2] = pDominantTracking->HeadPose.Pose.Position.z - hmdPosition[2];
{
vec2_t v;
rotateAboutOrigin(weaponoffset[0], weaponoffset[2],
-(doomYaw - hmdorientation[YAW]), v);
weaponoffset[0] = v[1];
weaponoffset[2] = v[0];
}
vec2_t v;
float yawRotation = getViewpointYaw() - hmdorientation[YAW];
rotateAboutOrigin(weaponoffset[0], weaponoffset[2], -yawRotation, v);
weaponoffset[0] = v[1];
weaponoffset[2] = v[0];
//Set gun angles
const ovrQuatf quatRemote = pDominantTracking->HeadPose.Pose.Orientation;
vec3_t rotation = {0};
rotation[PITCH] = vr_weapon_pitchadjust;
//rotation[YAW] = (doomYaw - hmdorientation[YAW]);
QuatToYawPitchRoll(quatRemote, rotation, weaponangles);
@ -139,16 +195,16 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew,
offhandoffset[2] = pOffTracking->HeadPose.Pose.Position.z - hmdPosition[2];
vec2_t v;
rotateAboutOrigin(offhandoffset[0], offhandoffset[2], -(doomYaw - hmdorientation[YAW]),
v);
float yawRotation = getViewpointYaw() - hmdorientation[YAW];
rotateAboutOrigin(offhandoffset[0], offhandoffset[2], -yawRotation, v);
offhandoffset[0] = v[1];
offhandoffset[2] = v[0];
vec3_t rotation = {0};
rotation[PITCH] = 20;
rotation[PITCH] = vr_weapon_pitchadjust;
QuatToYawPitchRoll(pOffTracking->HeadPose.Pose.Orientation, rotation, offhandangles);
if (vr_moveuseoffhand != 0) {
if (vr_moveuseoffhand) {
controllerYawHeading = offhandangles[YAW] - hmdorientation[YAW];
} else {
controllerYawHeading = 0.0f;
@ -194,8 +250,8 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew,
//and we don't get movement jitter when the joystick doesn't quite center properly
float dist = length(pSecondaryTrackedRemoteNew->Joystick.x, pSecondaryTrackedRemoteNew->Joystick.y);
float nlf = nonLinearFilter(dist);
float x = nlf * pSecondaryTrackedRemoteNew->Joystick.x;
float y = nlf * pSecondaryTrackedRemoteNew->Joystick.y;
float x = nlf * pSecondaryTrackedRemoteNew->Joystick.x + pFootTrackingNew->LeftJoystick.x;
float y = nlf * pSecondaryTrackedRemoteNew->Joystick.y - pFootTrackingNew->LeftJoystick.y;
//Apply a simple deadzone
player_moving = (fabs(x) + fabs(y)) > 0.05f;
@ -212,195 +268,308 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew,
remote_movementSideways,
remote_movementForward);
// Turning logic
static int increaseSnap = true;
if (pPrimaryTrackedRemoteNew->Joystick.x > 0.6f) {
if (increaseSnap) {
resetDoomYaw = true;
snapTurn -= vr_snapturn_angle;
if (vr_snapturn_angle > 10.0f) {
increaseSnap = false;
}
if (snapTurn < -180.0f) {
snapTurn += 360.f;
if (!cinemamode && !dominantGripPushedNew)
{
// Turning logic
static int increaseSnap = true;
if (pPrimaryTrackedRemoteNew->Joystick.x > 0.6f) {
if (increaseSnap) {
resetDoomYaw = true;
snapTurn -= vr_snapturn_angle;
if (vr_snapturn_angle > 10.0f) {
increaseSnap = false;
}
if (snapTurn < -180.0f) {
snapTurn += 360.f;
}
}
} else if (pPrimaryTrackedRemoteNew->Joystick.x < 0.4f) {
increaseSnap = true;
}
} else if (pPrimaryTrackedRemoteNew->Joystick.x < 0.4f) {
increaseSnap = true;
}
static int decreaseSnap = true;
if (pPrimaryTrackedRemoteNew->Joystick.x < -0.6f) {
if (decreaseSnap) {
resetDoomYaw = true;
snapTurn += vr_snapturn_angle;
static int decreaseSnap = true;
if (pPrimaryTrackedRemoteNew->Joystick.x < -0.6f) {
if (decreaseSnap) {
resetDoomYaw = true;
snapTurn += vr_snapturn_angle;
//If snap turn configured for less than 10 degrees
if (vr_snapturn_angle > 10.0f) {
decreaseSnap = false;
}
if (snapTurn > 180.0f) {
snapTurn -= 360.f;
//If snap turn configured for less than 10 degrees
if (vr_snapturn_angle > 10.0f) {
decreaseSnap = false;
}
if (snapTurn > 180.0f) {
snapTurn -= 360.f;
}
}
} else if (pPrimaryTrackedRemoteNew->Joystick.x > -0.4f) {
decreaseSnap = true;
}
} else if (pPrimaryTrackedRemoteNew->Joystick.x > -0.4f) {
decreaseSnap = true;
}
}
}
//Now handle all the buttons - irrespective of menu state - we might be trying to remap stuff
//if in cinema mode, then the dominant joystick is used differently
if (!cinemamode)
{
{
//Default this is Weapon Chooser - This _could_ be remapped
static int itemSwitched = 0;
if (between(-0.2f, pPrimaryTrackedRemoteNew->Joystick.x, 0.2f) &&
(between(0.8f, pPrimaryTrackedRemoteNew->Joystick.y, 1.0f) ||
between(-1.0f, pPrimaryTrackedRemoteNew->Joystick.y, -0.8f))) {
if (itemSwitched == 0) {
if (between(0.8f, pPrimaryTrackedRemoteNew->Joystick.y, 1.0f)) {
Joy_GenerateButtonEvents(0, 1, 1, KEY_MWHEELDOWN);
itemSwitched = 1;
} else {
Joy_GenerateButtonEvents(0, 1, 1, KEY_MWHEELUP);
itemSwitched = 2;
}
}
} else {
if (itemSwitched == 1) {
Joy_GenerateButtonEvents(1, 0, 1, KEY_MWHEELDOWN);
} else if (itemSwitched == 2) {
Joy_GenerateButtonEvents(1, 0, 1, KEY_MWHEELUP);
}
itemSwitched = 0;
}
}
//Default this is Weapon Chooser - This _could_ be remapped
Joy_GenerateButtonEvents(
(pPrimaryTrackedRemoteOld->Joystick.y < -0.7f && !dominantGripPushedOld ? 1 : 0),
(pPrimaryTrackedRemoteNew->Joystick.y < -0.7f && !dominantGripPushedNew ? 1 : 0),
1, KEY_MWHEELDOWN);
//Default this is Weapon Chooser - This _could_ be remapped
Joy_GenerateButtonEvents(
(pPrimaryTrackedRemoteOld->Joystick.y > 0.7f && !dominantGripPushedOld ? 1 : 0),
(pPrimaryTrackedRemoteNew->Joystick.y > 0.7f && !dominantGripPushedNew ? 1 : 0),
1, KEY_MWHEELUP);
//If snap turn set to 0, then we can use left/right on the stick as mappable functions
if (vr_snapturn_angle == 0.0)
{
static int invSwitched = 0;
if (between(-0.2f, pPrimaryTrackedRemoteNew->Joystick.y, 0.2f) &&
(between(0.8f, pPrimaryTrackedRemoteNew->Joystick.x, 1.0f) ||
between(-1.0f, pPrimaryTrackedRemoteNew->Joystick.x, -0.8f))) {
if (invSwitched == 0) {
if (between(0.8f, pPrimaryTrackedRemoteNew->Joystick.x, 1.0f)) {
Joy_GenerateButtonEvents(0, 1, 1, KEY_MWHEELLEFT);
invSwitched = 1;
} else {
Joy_GenerateButtonEvents(0, 1, 1, KEY_MWHEELRIGHT);
invSwitched = 2;
}
}
} else {
if (invSwitched == 1) {
Joy_GenerateButtonEvents(1, 0, 1, KEY_MWHEELLEFT);
} else if (invSwitched == 2) {
Joy_GenerateButtonEvents(1, 0, 1, KEY_MWHEELRIGHT);
}
invSwitched = 0;
}
Joy_GenerateButtonEvents(
(pPrimaryTrackedRemoteOld->Joystick.x > 0.7f && !dominantGripPushedOld && !vr_snapturn_angle ? 1 : 0),
(pPrimaryTrackedRemoteNew->Joystick.x > 0.7f && !dominantGripPushedNew && !vr_snapturn_angle ? 1 : 0),
1, KEY_MWHEELLEFT);
}
{
//Dominant Hand - Primary keys (no grip pushed) - All keys are re-mappable, default bindngs are shown below
//Fire
Joy_GenerateButtonEvents(((pDominantTrackedRemoteOld->Buttons & ovrButton_Trigger) != 0) && !dominantGripPushedOld ? 1 : 0,
((pDominantTrackedRemoteNew->Buttons & ovrButton_Trigger) != 0) && !dominantGripPushedNew ? 1 : 0,
1, KEY_PAD_RTRIGGER);
//"Use" (open door, toggle switch etc)
Joy_GenerateButtonEvents(((pDominantTrackedRemoteOld->Buttons & domButton1) != 0) && !dominantGripPushedOld ? 1 : 0,
((pDominantTrackedRemoteNew->Buttons & domButton1) != 0) && !dominantGripPushedNew ? 1 : 0,
1, KEY_PAD_A);
//No Binding
Joy_GenerateButtonEvents(((pDominantTrackedRemoteOld->Buttons & domButton2) != 0) && !dominantGripPushedOld ? 1 : 0,
((pDominantTrackedRemoteNew->Buttons & domButton2) != 0) && !dominantGripPushedNew ? 1 : 0,
1, KEY_PAD_B);
// Inv Use
Joy_GenerateButtonEvents(((pDominantTrackedRemoteOld->Buttons & ovrButton_Joystick) != 0) && !dominantGripPushedOld ? 1 : 0,
((pDominantTrackedRemoteNew->Buttons & ovrButton_Joystick) != 0) && !dominantGripPushedNew ? 1 : 0,
1, KEY_ENTER);
//Dominant Hand - Secondary keys (grip pushed)
//Alt-Fire
Joy_GenerateButtonEvents(((pDominantTrackedRemoteOld->Buttons & ovrButton_Trigger) != 0) && dominantGripPushedOld ? 1 : 0,
((pDominantTrackedRemoteNew->Buttons & ovrButton_Trigger) != 0) && dominantGripPushedNew ? 1 : 0,
1, KEY_PAD_LTRIGGER);
//Crouch
Joy_GenerateButtonEvents(((pDominantTrackedRemoteOld->Buttons & domButton1) != 0) && dominantGripPushedOld ? 1 : 0,
((pDominantTrackedRemoteNew->Buttons & domButton1) != 0) && dominantGripPushedNew ? 1 : 0,
1, KEY_PAD_LTHUMB);
//No Binding
Joy_GenerateButtonEvents(((pDominantTrackedRemoteOld->Buttons & domButton2) != 0) && dominantGripPushedOld ? 1 : 0,
((pDominantTrackedRemoteNew->Buttons & domButton2) != 0) && dominantGripPushedNew ? 1 : 0,
1, KEY_RSHIFT);
//No Binding
Joy_GenerateButtonEvents(((pDominantTrackedRemoteOld->Buttons & ovrButton_Joystick) != 0) && dominantGripPushedOld ? 1 : 0,
((pDominantTrackedRemoteNew->Buttons & ovrButton_Joystick) != 0) && dominantGripPushedNew ? 1 : 0,
1, KEY_TAB);
//Off Hand - Primary keys (no grip pushed)
//No Default Binding
Joy_GenerateButtonEvents(((pOffTrackedRemoteOld->Buttons & ovrButton_Trigger) != 0) && !dominantGripPushedOld ? 1 : 0,
((pOffTrackedRemoteNew->Buttons & ovrButton_Trigger) != 0) && !dominantGripPushedNew ? 1 : 0,
1, KEY_LSHIFT);
//No Default Binding
Joy_GenerateButtonEvents(((pOffTrackedRemoteOld->Buttons & offButton1) != 0) && !dominantGripPushedOld ? 1 : 0,
((pOffTrackedRemoteNew->Buttons & offButton1) != 0) && !dominantGripPushedNew ? 1 : 0,
1, KEY_PAD_X);
//Toggle Map
Joy_GenerateButtonEvents(((pOffTrackedRemoteOld->Buttons & offButton2) != 0) && !dominantGripPushedOld ? 1 : 0,
((pOffTrackedRemoteNew->Buttons & offButton2) != 0) && !dominantGripPushedNew ? 1 : 0,
1, KEY_PAD_Y);
//"Use" (open door, toggle switch etc) - Can be rebound for other uses
Joy_GenerateButtonEvents(((pOffTrackedRemoteOld->Buttons & ovrButton_Joystick) != 0) && !dominantGripPushedOld ? 1 : 0,
((pOffTrackedRemoteNew->Buttons & ovrButton_Joystick) != 0) && !dominantGripPushedNew ? 1 : 0,
1, KEY_SPACE);
//Off Hand - Secondary keys (grip pushed)
//No Default Binding
Joy_GenerateButtonEvents(((pOffTrackedRemoteOld->Buttons & ovrButton_Trigger) != 0) && dominantGripPushedOld ? 1 : 0,
((pOffTrackedRemoteNew->Buttons & ovrButton_Trigger) != 0) && dominantGripPushedNew ? 1 : 0,
1, KEY_LALT);
//Move Down
Joy_GenerateButtonEvents(((pOffTrackedRemoteOld->Buttons & offButton1) != 0) && dominantGripPushedOld ? 1 : 0,
((pOffTrackedRemoteNew->Buttons & offButton1) != 0) && dominantGripPushedNew ? 1 : 0,
1, KEY_PGDN);
//Move Up
Joy_GenerateButtonEvents(((pOffTrackedRemoteOld->Buttons & offButton2) != 0) && dominantGripPushedOld ? 1 : 0,
((pOffTrackedRemoteNew->Buttons & offButton2) != 0) && dominantGripPushedNew ? 1 : 0,
1, KEY_PGUP);
//Land
Joy_GenerateButtonEvents(((pOffTrackedRemoteOld->Buttons & ovrButton_Joystick) != 0) && dominantGripPushedOld ? 1 : 0,
((pOffTrackedRemoteNew->Buttons & ovrButton_Joystick) != 0) && dominantGripPushedNew ? 1 : 0,
1, KEY_HOME);
}
Joy_GenerateButtonEvents(
(pPrimaryTrackedRemoteOld->Joystick.x < -0.7f && !dominantGripPushedOld && !vr_snapturn_angle ? 1 : 0),
(pPrimaryTrackedRemoteNew->Joystick.x < -0.7f && !dominantGripPushedNew && !vr_snapturn_angle ? 1 : 0),
1, KEY_MWHEELRIGHT);
}
//Dominant Hand - Primary keys (no grip pushed) - All keys are re-mappable, default bindngs are shown below
{
//Fire
Joy_GenerateButtonEvents(
((pDominantTrackedRemoteOld->Buttons & ovrButton_Trigger) != 0) && !dominantGripPushedOld ? 1 : 0,
((pDominantTrackedRemoteNew->Buttons & ovrButton_Trigger) != 0) && !dominantGripPushedNew ? 1 : 0,
1, KEY_PAD_RTRIGGER);
//"Use" (open door, toggle switch etc)
Joy_GenerateButtonEvents(
((primaryButtonsOld & primaryButton1) != 0) && !dominantGripPushedOld ? 1 : 0,
((primaryButtonsNew & primaryButton1) != 0) && !dominantGripPushedNew ? 1 : 0,
1, KEY_PAD_A);
//No Binding
Joy_GenerateButtonEvents(
((primaryButtonsOld & primaryButton2) != 0) && !dominantGripPushedOld ? 1 : 0,
((primaryButtonsNew & primaryButton2) != 0) && !dominantGripPushedNew ? 1 : 0,
1, KEY_PAD_B);
// Inv Use
Joy_GenerateButtonEvents(
((pDominantTrackedRemoteOld->Buttons & ovrButton_Joystick) != 0) && !dominantGripPushedOld ? 1 : 0,
((pDominantTrackedRemoteNew->Buttons & ovrButton_Joystick) != 0) && !dominantGripPushedNew ? 1 : 0,
1, KEY_ENTER);
//No Default Binding
Joy_GenerateButtonEvents(
((pDominantTrackedRemoteOld->Touches & ovrTouch_ThumbRest) != 0) && !dominantGripPushedOld ? 1 : 0,
((pDominantTrackedRemoteNew->Touches & ovrTouch_ThumbRest) != 0) && !dominantGripPushedNew ? 1 : 0,
1, KEY_JOY5);
}
//Dominant Hand - Secondary keys (grip pushed)
{
//Alt-Fire
Joy_GenerateButtonEvents(
((pDominantTrackedRemoteOld->Buttons & ovrButton_Trigger) != 0) && dominantGripPushedOld ? 1 : 0,
((pDominantTrackedRemoteNew->Buttons & ovrButton_Trigger) != 0) && dominantGripPushedNew ? 1 : 0,
1, KEY_PAD_LTRIGGER);
//Crouch
Joy_GenerateButtonEvents(
((primaryButtonsOld & primaryButton1) != 0) && dominantGripPushedOld ? 1 : 0,
((primaryButtonsNew & primaryButton1) != 0) && dominantGripPushedNew ? 1 : 0,
1, KEY_PAD_LTHUMB);
//No Binding
Joy_GenerateButtonEvents(
((primaryButtonsOld & primaryButton2) != 0) && dominantGripPushedOld ? 1 : 0,
((primaryButtonsNew & primaryButton2) != 0) && dominantGripPushedNew ? 1 : 0,
1, KEY_RSHIFT);
//No Binding
Joy_GenerateButtonEvents(
((pDominantTrackedRemoteOld->Buttons & ovrButton_Joystick) != 0) && dominantGripPushedOld ? 1 : 0,
((pDominantTrackedRemoteNew->Buttons & ovrButton_Joystick) != 0) && dominantGripPushedNew ? 1 : 0,
1, KEY_TAB);
//No Default Binding
Joy_GenerateButtonEvents(
((pDominantTrackedRemoteOld->Touches & ovrTouch_ThumbRest) != 0) && dominantGripPushedOld ? 1 : 0,
((pDominantTrackedRemoteNew->Touches & ovrTouch_ThumbRest) != 0) && dominantGripPushedNew ? 1 : 0,
1, KEY_JOY6);
//Use grip as an extra button
//Alt-Fire
Joy_GenerateButtonEvents(
((pDominantTrackedRemoteOld->Buttons & ovrButton_GripTrigger) != 0) && !dominantGripPushedOld ? 1 : 0,
((pDominantTrackedRemoteNew->Buttons & ovrButton_GripTrigger) != 0) && !dominantGripPushedNew ? 1 : 0,
1, KEY_PAD_LTRIGGER);
}
//Off Hand - Primary keys (no grip pushed)
{
//No Default Binding
Joy_GenerateButtonEvents(
((pOffTrackedRemoteOld->Buttons & ovrButton_Trigger) != 0) && !dominantGripPushedOld ? 1 : 0,
((pOffTrackedRemoteNew->Buttons & ovrButton_Trigger) != 0) && !dominantGripPushedNew ? 1 : 0,
1, KEY_LSHIFT);
//No Default Binding
Joy_GenerateButtonEvents(
((secondaryButtonsOld & secondaryButton1) != 0) && !dominantGripPushedOld ? 1 : 0,
((secondaryButtonsNew & secondaryButton1) != 0) && !dominantGripPushedNew ? 1 : 0,
1, KEY_PAD_X);
//Toggle Map
Joy_GenerateButtonEvents(
((secondaryButtonsOld & secondaryButton2) != 0) && !dominantGripPushedOld ? 1 : 0,
((secondaryButtonsNew & secondaryButton2) != 0) && !dominantGripPushedNew ? 1 : 0,
1, KEY_PAD_Y);
//"Use" (open door, toggle switch etc) - Can be rebound for other uses
Joy_GenerateButtonEvents(
((pOffTrackedRemoteOld->Buttons & ovrButton_Joystick) != 0) && !dominantGripPushedOld ? 1 : 0,
((pOffTrackedRemoteNew->Buttons & ovrButton_Joystick) != 0) && !dominantGripPushedNew ? 1 : 0,
1, KEY_SPACE);
//No Default Binding
Joy_GenerateButtonEvents(
((pOffTrackedRemoteOld->Touches & ovrTouch_ThumbRest) != 0) && !dominantGripPushedOld ? 1 : 0,
((pOffTrackedRemoteNew->Touches & ovrTouch_ThumbRest) != 0) && !dominantGripPushedNew ? 1 : 0,
1, KEY_JOY7);
Joy_GenerateButtonEvents(
((pOffTrackedRemoteOld->Buttons & ovrButton_GripTrigger) != 0) && !dominantGripPushedOld ? 1 : 0,
((pOffTrackedRemoteNew->Buttons & ovrButton_GripTrigger) != 0) && !dominantGripPushedNew ? 1 : 0,
1, KEY_PAD_RTHUMB);
}
//Off Hand - Secondary keys (grip pushed)
{
//No Default Binding
Joy_GenerateButtonEvents(
((pOffTrackedRemoteOld->Buttons & ovrButton_Trigger) != 0) && dominantGripPushedOld ? 1 : 0,
((pOffTrackedRemoteNew->Buttons & ovrButton_Trigger) != 0) && dominantGripPushedNew ? 1 : 0,
1, KEY_LALT);
//Move Down
Joy_GenerateButtonEvents(
((secondaryButtonsOld & secondaryButton1) != 0) && dominantGripPushedOld ? 1 : 0,
((secondaryButtonsNew & secondaryButton1) != 0) && dominantGripPushedNew ? 1 : 0,
1, KEY_PGDN);
//Move Up
Joy_GenerateButtonEvents(
((secondaryButtonsOld & secondaryButton2) != 0) && dominantGripPushedOld ? 1 : 0,
((secondaryButtonsNew & secondaryButton2) != 0) && dominantGripPushedNew ? 1 : 0,
1, KEY_PGUP);
//Land
Joy_GenerateButtonEvents(
((pOffTrackedRemoteOld->Buttons & ovrButton_Joystick) != 0) && dominantGripPushedOld ? 1 : 0,
((pOffTrackedRemoteNew->Buttons & ovrButton_Joystick) != 0) && dominantGripPushedNew ? 1 : 0,
1, KEY_HOME);
//No Default Binding
Joy_GenerateButtonEvents(
((pOffTrackedRemoteOld->Touches & ovrTouch_ThumbRest) != 0) && dominantGripPushedOld ? 1 : 0,
((pOffTrackedRemoteNew->Touches & ovrTouch_ThumbRest) != 0) && dominantGripPushedNew ? 1 : 0,
1, KEY_JOY8);
Joy_GenerateButtonEvents(
((pOffTrackedRemoteOld->Buttons & ovrButton_GripTrigger) != 0) && dominantGripPushedOld && !vr_twohandedweapons ? 1 : 0,
((pOffTrackedRemoteNew->Buttons & ovrButton_GripTrigger) != 0) && dominantGripPushedNew && !vr_twohandedweapons ? 1 : 0,
1, KEY_PAD_DPAD_UP);
}
Joy_GenerateButtonEvents(
(pSecondaryTrackedRemoteOld->Joystick.x > 0.7f && !dominantGripPushedOld ? 1 : 0),
(pSecondaryTrackedRemoteNew->Joystick.x > 0.7f && !dominantGripPushedNew ? 1 : 0),
1, KEY_JOYAXIS1PLUS);
Joy_GenerateButtonEvents(
(pSecondaryTrackedRemoteOld->Joystick.x < -0.7f && !dominantGripPushedOld ? 1 : 0),
(pSecondaryTrackedRemoteNew->Joystick.x < -0.7f && !dominantGripPushedNew ? 1 : 0),
1, KEY_JOYAXIS1MINUS);
Joy_GenerateButtonEvents(
(pPrimaryTrackedRemoteOld->Joystick.x > 0.7f && !dominantGripPushedOld ? 1 : 0),
(pPrimaryTrackedRemoteNew->Joystick.x > 0.7f && !dominantGripPushedNew ? 1 : 0),
1, KEY_JOYAXIS3PLUS);
Joy_GenerateButtonEvents(
(pPrimaryTrackedRemoteOld->Joystick.x < -0.7f && !dominantGripPushedOld ? 1 : 0),
(pPrimaryTrackedRemoteNew->Joystick.x < -0.7f && !dominantGripPushedNew ? 1 : 0),
1, KEY_JOYAXIS3MINUS);
Joy_GenerateButtonEvents(
(pSecondaryTrackedRemoteOld->Joystick.y < -0.7f && !dominantGripPushedOld ? 1 : 0),
(pSecondaryTrackedRemoteNew->Joystick.y < -0.7f && !dominantGripPushedNew ? 1 : 0),
1, KEY_JOYAXIS2MINUS);
Joy_GenerateButtonEvents(
(pSecondaryTrackedRemoteOld->Joystick.y > 0.7f && !dominantGripPushedOld ? 1 : 0),
(pSecondaryTrackedRemoteNew->Joystick.y > 0.7f && !dominantGripPushedNew ? 1 : 0),
1, KEY_JOYAXIS2PLUS);
Joy_GenerateButtonEvents(
(pPrimaryTrackedRemoteOld->Joystick.y < -0.7f && !dominantGripPushedOld ? 1 : 0),
(pPrimaryTrackedRemoteNew->Joystick.y < -0.7f && !dominantGripPushedNew ? 1 : 0),
1, KEY_JOYAXIS4MINUS);
Joy_GenerateButtonEvents(
(pPrimaryTrackedRemoteOld->Joystick.y > 0.7f && !dominantGripPushedOld ? 1 : 0),
(pPrimaryTrackedRemoteNew->Joystick.y > 0.7f && !dominantGripPushedNew ? 1 : 0),
1, KEY_JOYAXIS4PLUS);
Joy_GenerateButtonEvents(
(pSecondaryTrackedRemoteOld->Joystick.x > 0.7f && dominantGripPushedOld ? 1 : 0),
(pSecondaryTrackedRemoteNew->Joystick.x > 0.7f && dominantGripPushedNew ? 1 : 0),
1, KEY_JOYAXIS5PLUS);
Joy_GenerateButtonEvents(
(pSecondaryTrackedRemoteOld->Joystick.x < -0.7f && dominantGripPushedOld ? 1 : 0),
(pSecondaryTrackedRemoteNew->Joystick.x < -0.7f && dominantGripPushedNew ? 1 : 0),
1, KEY_JOYAXIS5MINUS);
Joy_GenerateButtonEvents(
(pPrimaryTrackedRemoteOld->Joystick.x > 0.7f && dominantGripPushedOld ? 1 : 0),
(pPrimaryTrackedRemoteNew->Joystick.x > 0.7f && dominantGripPushedNew ? 1 : 0),
1, KEY_JOYAXIS7PLUS);
Joy_GenerateButtonEvents(
(pPrimaryTrackedRemoteOld->Joystick.x < -0.7f && dominantGripPushedOld ? 1 : 0),
(pPrimaryTrackedRemoteNew->Joystick.x < -0.7f && dominantGripPushedNew ? 1 : 0),
1, KEY_JOYAXIS7MINUS);
Joy_GenerateButtonEvents(
(pSecondaryTrackedRemoteOld->Joystick.y < -0.7f && dominantGripPushedOld ? 1 : 0),
(pSecondaryTrackedRemoteNew->Joystick.y < -0.7f && dominantGripPushedNew ? 1 : 0),
1, KEY_JOYAXIS6MINUS);
Joy_GenerateButtonEvents(
(pSecondaryTrackedRemoteOld->Joystick.y > 0.7f && dominantGripPushedOld ? 1 : 0),
(pSecondaryTrackedRemoteNew->Joystick.y > 0.7f && dominantGripPushedNew ? 1 : 0),
1, KEY_JOYAXIS6PLUS);
Joy_GenerateButtonEvents(
(pPrimaryTrackedRemoteOld->Joystick.y < -0.7f && dominantGripPushedOld ? 1 : 0),
(pPrimaryTrackedRemoteNew->Joystick.y < -0.7f && dominantGripPushedNew ? 1 : 0),
1, KEY_JOYAXIS8MINUS);
Joy_GenerateButtonEvents(
(pPrimaryTrackedRemoteOld->Joystick.y > 0.7f && dominantGripPushedOld ? 1 : 0),
(pPrimaryTrackedRemoteNew->Joystick.y > 0.7f && dominantGripPushedNew ? 1 : 0),
1, KEY_JOYAXIS8PLUS);
//Save state
rightTrackedRemoteState_old = rightTrackedRemoteState_new;
leftTrackedRemoteState_old = leftTrackedRemoteState_new;

View file

@ -195,7 +195,88 @@
#define KEY_JOY4AXIS8PLUS 0x222
#define KEY_JOY4AXIS8MINUS 0x223
#define NUM_KEYS 0x224
#define KEY_PAD2_LTHUMB_RIGHT 0x224
#define KEY_PAD2_LTHUMB_LEFT 0x225
#define KEY_PAD2_LTHUMB_DOWN 0x226
#define KEY_PAD2_LTHUMB_UP 0x227
#define KEY_PAD2_RTHUMB_RIGHT 0x228
#define KEY_PAD2_RTHUMB_LEFT 0x229
#define KEY_PAD2_RTHUMB_DOWN 0x22A
#define KEY_PAD2_RTHUMB_UP 0x22B
#define KEY_PAD2_DPAD_UP 0x22C
#define KEY_PAD2_DPAD_DOWN 0x22D
#define KEY_PAD2_DPAD_LEFT 0x22E
#define KEY_PAD2_DPAD_RIGHT 0x22F
#define KEY_PAD2_START 0x230
#define KEY_PAD2_BACK 0x231
#define KEY_PAD2_LTHUMB 0x232
#define KEY_PAD2_RTHUMB 0x233
#define KEY_PAD2_LSHOULDER 0x234
#define KEY_PAD2_RSHOULDER 0x235
#define KEY_PAD2_LTRIGGER 0x236
#define KEY_PAD2_RTRIGGER 0x237
#define KEY_PAD2_A 0x238
#define KEY_PAD2_B 0x239
#define KEY_PAD2_X 0x23A
#define KEY_PAD2_Y 0x23B
#define KEY_PAD3_LTHUMB_RIGHT 0x23C
#define KEY_PAD3_LTHUMB_LEFT 0x23D
#define KEY_PAD3_LTHUMB_DOWN 0x23E
#define KEY_PAD3_LTHUMB_UP 0x23F
#define KEY_PAD3_RTHUMB_RIGHT 0x240
#define KEY_PAD3_RTHUMB_LEFT 0x241
#define KEY_PAD3_RTHUMB_DOWN 0x242
#define KEY_PAD3_RTHUMB_UP 0x243
#define KEY_PAD3_DPAD_UP 0x244
#define KEY_PAD3_DPAD_DOWN 0x245
#define KEY_PAD3_DPAD_LEFT 0x246
#define KEY_PAD3_DPAD_RIGHT 0x247
#define KEY_PAD3_START 0x248
#define KEY_PAD3_BACK 0x249
#define KEY_PAD3_LTHUMB 0x24A
#define KEY_PAD3_RTHUMB 0x24B
#define KEY_PAD3_LSHOULDER 0x24C
#define KEY_PAD3_RSHOULDER 0x24D
#define KEY_PAD3_LTRIGGER 0x24E
#define KEY_PAD3_RTRIGGER 0x24F
#define KEY_PAD3_A 0x250
#define KEY_PAD3_B 0x251
#define KEY_PAD3_X 0x252
#define KEY_PAD3_Y 0x253
#define KEY_PAD4_LTHUMB_RIGHT 0x254
#define KEY_PAD4_LTHUMB_LEFT 0x255
#define KEY_PAD4_LTHUMB_DOWN 0x256
#define KEY_PAD4_LTHUMB_UP 0x257
#define KEY_PAD4_RTHUMB_RIGHT 0x258
#define KEY_PAD4_RTHUMB_LEFT 0x259
#define KEY_PAD4_RTHUMB_DOWN 0x25A
#define KEY_PAD4_RTHUMB_UP 0x25B
#define KEY_PAD4_DPAD_UP 0x25C
#define KEY_PAD4_DPAD_DOWN 0x25D
#define KEY_PAD4_DPAD_LEFT 0x25E
#define KEY_PAD4_DPAD_RIGHT 0x25F
#define KEY_PAD4_START 0x260
#define KEY_PAD4_BACK 0x261
#define KEY_PAD4_LTHUMB 0x262
#define KEY_PAD4_RTHUMB 0x263
#define KEY_PAD4_LSHOULDER 0x264
#define KEY_PAD4_RSHOULDER 0x265
#define KEY_PAD4_LTRIGGER 0x266
#define KEY_PAD4_RTRIGGER 0x267
#define KEY_PAD4_A 0x268
#define KEY_PAD4_B 0x269
#define KEY_PAD4_X 0x26A
#define KEY_PAD4_Y 0x26B
#define NUM_KEYS 0x26C
#endif //QZDOOM_DOOMKEYS_H

View file

@ -0,0 +1 @@
include $(call all-subdir-makefiles)

View file

@ -0,0 +1,14 @@
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := fmod
LOCAL_SRC_FILES := api/lowlevel/lib/$(TARGET_ARCH_ABI)/libfmod.so
include $(PREBUILT_SHARED_LIBRARY)
#Logging version
#include $(CLEAR_VARS)
#LOCAL_MODULE := fmodL
#LOCAL_SRC_FILES := api/lowlevel/lib/$(TARGET_ARCH_ABI)/libfmodL.so
#include $(PREBUILT_SHARED_LIBRARY)

View file

@ -0,0 +1,331 @@
#ifndef _FSBANK_H
#define _FSBANK_H
#if defined(_WIN32)
#define FB_API __declspec(dllexport) _stdcall
#define FSBANK_CALLBACK _stdcall
#elif defined(__linux__) || defined(__MACH__)
#define FB_API __attribute__ ((visibility("default")))
#define FSBANK_CALLBACK
#else
#define FB_API
#define FSBANK_CALLBACK
#endif
/*
FSBank types
*/
typedef unsigned int FSBANK_INITFLAGS;
typedef unsigned int FSBANK_BUILDFLAGS;
/*
[DEFINE]
[
[NAME]
FSBANK_INITFLAGS
[DESCRIPTION]
Bit fields to use with FSBank_Init to control the general operation of the library.
[REMARKS]
[SEE_ALSO]
FSBank_Init
]
*/
#define FSBANK_INIT_NORMAL 0x00000000 /* Initialize normally. */
#define FSBANK_INIT_IGNOREERRORS 0x00000001 /* Ignore individual subsound build errors, continue building for as long as possible. */
#define FSBANK_INIT_WARNINGSASERRORS 0x00000002 /* Treat any warnings issued as errors. */
#define FSBANK_INIT_CREATEINCLUDEHEADER 0x00000004 /* Create C header files with #defines defining indices for each member of the FSB. */
#define FSBANK_INIT_DONTLOADCACHEFILES 0x00000008 /* Ignore existing cache files. */
#define FSBANK_INIT_GENERATEPROGRESSITEMS 0x00000010 /* Generate status items that can be queried by another thread to monitor the build progress and give detailed error messages. */
/* [DEFINE_END] */
/*
[DEFINE]
[
[NAME]
FSBANK_BUILDFLAGS
[DESCRIPTION]
Bit fields to use with FSBank_Build and in FSBANK_SUBSOUND to control how subsounds are encoded.
[REMARKS]
[SEE_ALSO]
FSBank_Init
FSBANK_SUBSOUND
]
*/
#define FSBANK_BUILD_DEFAULT 0x00000000 /* Build with default settings. */
#define FSBANK_BUILD_DISABLESYNCPOINTS 0x00000001 /* Disable the storing of syncpoints in the output */
#define FSBANK_BUILD_DONTLOOP 0x00000002 /* Disable perfect loop encoding and sound stretching. Removes chirps from the start of oneshot MP2, MP3 and IMAADPCM sounds. */
#define FSBANK_BUILD_FILTERHIGHFREQ 0x00000004 /* XMA only. Enable high frequency filtering. */
#define FSBANK_BUILD_DISABLESEEKING 0x00000008 /* XMA only. Disable seek tables to save memory. */
#define FSBANK_BUILD_OPTIMIZESAMPLERATE 0x00000010 /* Attempt to optimize the sample rate down. Ignored if format is MP2, MP3 or CELT or if FSB4 basic headers flag is used. */
#define FSBANK_BUILD_DONTINTERLEAVE 0x00000020 /* VAG and GCADPCM only. Don't interleave the data as LRLRLRLR... instead use LLLLRRRR type encoding. Speeds up loading for samples (not streams, streams must remained interleaved), allows FMOD_OPENMEMORY_POINT. */
#define FSBANK_BUILD_FSB4_USEBASICHEADERS 0x00000040 /* FSB4 format only. Generate FSBs with small sample header data. They only contain basic information such as sample length, and everything else has its attributes inherited from the first sample (for example the default frequency). */
#define FSBANK_BUILD_FSB5_DONTWRITENAMES 0x00000080 /* FSB5 format only. Do not write out a names chunk to the FSB to reduce file size. */
#define FSBANK_BUILD_NOGUID 0x00000100 /* FSB5 format only. Write out a null GUID for the FSB header. The runtime will not use header caching for these FSB files. */
#define FSBANK_BUILD_WRITEPEAKVOLUME 0x00000200 /* FSB5 format only. Write peak volume for all subsounds. */
#define FSBANK_BUILD_OVERRIDE_MASK (FSBANK_BUILD_DISABLESYNCPOINTS | FSBANK_BUILD_DONTLOOP | FSBANK_BUILD_FILTERHIGHFREQ | FSBANK_BUILD_DISABLESEEKING | FSBANK_BUILD_OPTIMIZESAMPLERATE | FSBANK_BUILD_DONTINTERLEAVE | FSBANK_BUILD_WRITEPEAKVOLUME) /* Build flag mask that specifies which settings can be overridden per subsound. */
#define FSBANK_BUILD_CACHE_VALIDATION_MASK (FSBANK_BUILD_DONTLOOP | FSBANK_BUILD_FILTERHIGHFREQ | FSBANK_BUILD_OPTIMIZESAMPLERATE | FSBANK_BUILD_DONTINTERLEAVE) /* Build flag mask that specifies which settings (when changed) invalidate a cache file. */
/* [DEFINE_END] */
/*
[ENUM]
[
[DESCRIPTION]
Error codes returned from every function.
[REMARKS]
[SEE_ALSO]
]
*/
typedef enum FSBANK_RESULT
{
FSBANK_OK, /* No errors. */
FSBANK_ERR_CACHE_CHUNKNOTFOUND, /* An expected chunk is missing from the cache, perhaps try deleting cache files. */
FSBANK_ERR_CANCELLED, /* The build process was cancelled during compilation by the user. */
FSBANK_ERR_CANNOT_CONTINUE, /* The build process cannot continue due to previously ignored errors. */
FSBANK_ERR_ENCODER, /* Encoder for chosen format has encountered an unexpected error. */
FSBANK_ERR_ENCODER_INIT, /* Encoder initialization failed. */
FSBANK_ERR_ENCODER_NOTSUPPORTED, /* Encoder for chosen format is not supported on this platform. */
FSBANK_ERR_FILE_OS, /* An operating system based file error was encountered. */
FSBANK_ERR_FILE_NOTFOUND, /* A specified file could not be found. */
FSBANK_ERR_FMOD, /* Internal error from FMOD sub-system. */
FSBANK_ERR_INITIALIZED, /* Already initialized. */
FSBANK_ERR_INVALID_FORMAT, /* The format of the source file is invalid, see output for details. */
FSBANK_ERR_INVALID_FORMAT_PCMBITS, /* The format of the source file is invalid, the source bit formats (i.e. PCM8, PCM16, etc) must match for all sub-sounds */
FSBANK_ERR_INVALID_PARAM, /* An invalid parameter has been passed to this function. */
FSBANK_ERR_MEMORY, /* Ran out of memory. */
FSBANK_ERR_UNINITIALIZED, /* Not initialized yet. */
FSBANK_ERR_WRITER_FORMAT, /* Chosen encode format is not supported by this FSB version. */
FSBANK_WARN_CANNOTLOOP, /* Source file is too short for seamless looping. Looping disabled. */
FSBANK_WARN_IGNORED_OPTIMIZESAMPLERATE, /* FSBANK_BUILD_OPTIMIZESAMPLERATE flag ignored: MP2, MP3 and CELT formats, and the USEBASICHEADERS flag make this option irrelevant. */
FSBANK_WARN_IGNORED_FILTERHIGHFREQ, /* FSBANK_BUILD_FILTERHIGHFREQ flag ignored: feature only supported by XMA format. */
FSBANK_WARN_IGNORED_DISABLESEEKING, /* FSBANK_BUILD_DISABLESEEKING flag ignored: feature only supported by XMA format. */
FSBANK_WARN_IGNORED_DONTINTERLEAVE, /* FSBANK_BUILD_DONTINTERLEAVE flag ignored: feature only supported by VAG and GCADPCM formats. */
FSBANK_ERR_ENCODER_FILE_NOTFOUND, /* External encoder dynamic library not found */
FSBANK_ERR_ENCODER_FILE_BAD, /* External encoder dynamic library could not be loaded, possibly incorrect binary format, incorrect architecture, file corruption */
} FSBANK_RESULT;
/*
[ENUM]
[
[DESCRIPTION]
Compression formats available for encoding
[REMARKS]
[SEE_ALSO]
FSBank_Build
]
*/
typedef enum FSBANK_FORMAT
{
FSBANK_FORMAT_PCM, /* PCM (1:1) All platforms. */
FSBANK_FORMAT_PCM_BIGENDIAN, /* PCM Big Endian (1:1) Xbox360 and PS3 only. */
FSBANK_FORMAT_IMAADPCM, /* IMA ADPCM (3.5:1) All platforms. */
FSBANK_FORMAT_MP2, /* MPEG Layer 2 (CBR) All platforms except PS3. Depends on toolame. */
FSBANK_FORMAT_MP3, /* MPEG Layer 3 (CBR) All platforms. Depends on libmp3lame. */
FSBANK_FORMAT_XMA, /* XMA (VBR) Xbox360 / XboxOne only (hardware). Depends on xmaencoder. */
FSBANK_FORMAT_CELT, /* Constrained Energy Lapped Transform (CBR) All platforms. Depends on celt_encoder. */
FSBANK_FORMAT_AT9_PSVITA, /* ATRAC9 (CBR) PSVita only (hardware). Depends on libatrac9. */
FSBANK_FORMAT_AT9_PS4, /* ATRAC9 (CBR) PS4 only (hardware). Depends on libatrac9. */
FSBANK_FORMAT_XWMA, /* XWMA (VBR) Xbox360 only. Depends on xwmaencoder. */
FSBANK_FORMAT_VORBIS, /* Vorbis (VBR) All platforms. Depends on libvorbis. */
FSBANK_FORMAT_MAX /* Upper bound for this enumeration, for use with validation. */
} FSBANK_FORMAT;
/*
[ENUM]
[
[DESCRIPTION]
Version of FSB to write out.
[REMARKS]
[SEE_ALSO]
FSBank_Init
]
*/
typedef enum FSBANK_FSBVERSION
{
FSBANK_FSBVERSION_FSB5, /* Produce FSB version 5 files. */
FSBANK_FSBVERSION_MAX /* Upper bound for this enumeration, for use with validation. */
} FSBANK_FSBVERSION;
/*
[ENUM]
[
[DESCRIPTION]
Speaker maps to define the layout of multichannel subsounds.
[REMARKS]
[SEE_ALSO]
FSBANK_SUBSOUND
]
*/
typedef enum FSBANK_SPEAKERMAP
{
FSBANK_SPEAKERMAP_DEFAULT, /* Sample uses default FMOD speaker mapping. */
FSBANK_SPEAKERMAP_ALLMONO, /* Sample is a collection of mono channels. */
FSBANK_SPEAKERMAP_ALLSTEREO, /* Sample is a collection of stereo channel pairs. */
FSBANK_SPEAKERMAP_PROTOOLS, /* Sample is 6ch and uses L C R LS RS LFE standard. */
FSBANK_SPEAKERMAP_MAX /* Upper bound for this enumeration, for use with validation. */
} FSBANK_SPEAKERMAP;
/*
[ENUM]
[
[DESCRIPTION]
Current state during the build process.
[REMARKS]
[SEE_ALSO]
FSBANK_PROGRESSITEM
]
*/
typedef enum FSBANK_STATE
{
FSBANK_STATE_DECODING, /* Decode a file to usable raw sample data. */
FSBANK_STATE_ANALYSING, /* Scan sound data for details (such as optimized sample rate). */
FSBANK_STATE_PREPROCESSING, /* Prepares sound data for encoder. */
FSBANK_STATE_ENCODING, /* Pass the sample data to the chosen encoder. */
FSBANK_STATE_WRITING, /* Write encoded data into an FSB. */
FSBANK_STATE_FINISHED, /* Process complete. */
FSBANK_STATE_FAILED, /* An error has occurred, check data (as FSBANK_STATEDATA_FAILED) for details. */
FSBANK_STATE_WARNING, /* A warning has been issued, check data (as FSBANK_STATEDATA_WARNING) for details. */
} FSBANK_STATE;
/*
[STRUCTURE]
[
[DESCRIPTION]
Representation of how to encode a single subsound in the final FSB.
[REMARKS]
[SEE_ALSO]
FSBank_Build
FSBANK_BUILD_OPTIMIZESAMPLERATE
FSBANK_SPEAKERMAP
FSBANK_BUILDFLAGS
]
*/
typedef struct FSBANK_SUBSOUND
{
const char* const *fileNames; /* List of file names used to produce an interleaved sound. */
unsigned int numFileNames; /* Number of files in above file name list, up to 16. */
FSBANK_SPEAKERMAP speakerMap; /* Setting to define the mapping and order of channels. */
FSBANK_BUILDFLAGS overrideFlags; /* Flags that will reverse the equivalent flags passed to FSBank_Build. */
unsigned int overrideQuality; /* Override the quality setting passed to FSBank_Build. */
float desiredSampleRate; /* Resample to this sample rate (ignores optimize sample rate setting), up to 192000Hz. */
float percentOptimizedRate; /* If using FSBANK_BUILD_OPTIMIZESAMPLERATE, this is the percentage of that rate to be used, up to 100.0%. */
} FSBANK_SUBSOUND;
/*
[STRUCTURE]
[
[DESCRIPTION]
Status information describing the progress of a build.
[REMARKS]
[SEE_ALSO]
FSBank_Build
FSBank_FetchNextProgressItem
FSBank_ReleaseProgressItem
FSBANK_STATE
]
*/
typedef struct FSBANK_PROGRESSITEM
{
int subSoundIndex; /* Index into the subsound list passed to FSBank_Build that this update relates to (-1 indicates no specific subsound). */
int threadIndex; /* Which thread index is serving this update (-1 indicates FSBank_Build / main thread). */
FSBANK_STATE state; /* Progress through the encoding process. */
const void *stateData; /* Cast to state specific data structure for extra information. */
} FSBANK_PROGRESSITEM;
/*
[STRUCTURE]
[
[DESCRIPTION]
Extra state data for FSBANK_STATE_FAILED
[REMARKS]
Cast stateData in FSBANK_PROGRESSITEM to this struct if the state is FSBANK_STATE_FAILED
[SEE_ALSO]
FSBANK_STATE_FAILED
FSBANK_PROGRESSITEM
]
*/
typedef struct FSBANK_STATEDATA_FAILED
{
FSBANK_RESULT errorCode; /* Error result code. */
char errorString[256]; /* Description for error code. */
} FSBANK_STATEDATA_FAILED;
/*
[STRUCTURE]
[
[DESCRIPTION]
Extra state data for FSBANK_STATEDATA_WARNING
[REMARKS]
Cast stateData in FSBANK_PROGRESSITEM to this struct if the state is FSBANK_STATE_WARNING
[SEE_ALSO]
FSBANK_STATE_WARNING
FSBANK_PROGRESSITEM
]
*/
typedef struct FSBANK_STATEDATA_WARNING
{
FSBANK_RESULT warnCode; /* Warning result code. */
char warningString[256]; /* Description for warning code. */
} FSBANK_STATEDATA_WARNING;
#ifdef __cplusplus
extern "C" {
#endif
typedef void* (FSBANK_CALLBACK *FSBANK_MEMORY_ALLOC_CALLBACK)(unsigned int size, unsigned int, const char *sourceStr);
typedef void* (FSBANK_CALLBACK *FSBANK_MEMORY_REALLOC_CALLBACK)(void *ptr, unsigned int size, unsigned int, const char *sourceStr);
typedef void (FSBANK_CALLBACK *FSBANK_MEMORY_FREE_CALLBACK)(void *ptr, unsigned int, const char *sourceStr);
FSBANK_RESULT FB_API FSBank_MemoryInit(FSBANK_MEMORY_ALLOC_CALLBACK userAlloc, FSBANK_MEMORY_REALLOC_CALLBACK userRealloc, FSBANK_MEMORY_FREE_CALLBACK userFree);
FSBANK_RESULT FB_API FSBank_Init(FSBANK_FSBVERSION version, FSBANK_INITFLAGS flags, unsigned int numSimultaneousJobs, const char *cacheDirectory);
FSBANK_RESULT FB_API FSBank_Release();
FSBANK_RESULT FB_API FSBank_Build(const FSBANK_SUBSOUND *subSounds, unsigned int numSubSounds, FSBANK_FORMAT encodeFormat, FSBANK_BUILDFLAGS buildFlags, unsigned int quality, const char *encryptKey, const char *outputFileName);
FSBANK_RESULT FB_API FSBank_BuildCancel();
FSBANK_RESULT FB_API FSBank_FetchNextProgressItem(const FSBANK_PROGRESSITEM **progressItem);
FSBANK_RESULT FB_API FSBank_ReleaseProgressItem(const FSBANK_PROGRESSITEM *progressItem);
FSBANK_RESULT FB_API FSBank_MemoryGetStats(unsigned int *currentAllocated, unsigned int *maximumAllocated);
#ifdef __cplusplus
}
#endif
#endif // _FSBANK_H

View file

@ -0,0 +1,38 @@
#ifndef _FSBANK_ERRORS_H
#define _FSBANK_ERRORS_H
#include "fsbank.h"
static const char *FSBank_ErrorString(FSBANK_RESULT result)
{
switch (result)
{
case FSBANK_OK: return "No errors.";
case FSBANK_ERR_CACHE_CHUNKNOTFOUND: return "An expected chunk is missing from the cache, perhaps try deleting cache files.";
case FSBANK_ERR_CANCELLED: return "The build process was cancelled during compilation by the user.";
case FSBANK_ERR_CANNOT_CONTINUE: return "The build process cannot continue due to previously ignored errors.";
case FSBANK_ERR_ENCODER: return "Encoder for chosen format has encountered an unexpected error.";
case FSBANK_ERR_ENCODER_INIT: return "Encoder initialization failed.";
case FSBANK_ERR_ENCODER_NOTSUPPORTED: return "Encoder for chosen format is not supported on this platform.";
case FSBANK_ERR_FILE_OS: return "An operating system based file error was encountered.";
case FSBANK_ERR_FILE_NOTFOUND: return "A specified file could not be found.";
case FSBANK_ERR_FMOD: return "Internal error from FMOD sub-system.";
case FSBANK_ERR_INITIALIZED: return "Already initialized.";
case FSBANK_ERR_INVALID_FORMAT: return "The format of the source file is invalid, see output for details.";
case FSBANK_ERR_INVALID_FORMAT_PCMBITS: return "The format of the source file is invalid, the source bit formats (i.e. PCM8, PCM16, etc) must match for all sub-sounds";
case FSBANK_ERR_INVALID_PARAM: return "An invalid parameter has been passed to this function.";
case FSBANK_ERR_MEMORY: return "Run out of memory.";
case FSBANK_ERR_UNINITIALIZED: return "Not initialized yet.";
case FSBANK_ERR_WRITER_FORMAT: return "Chosen encode format is not supported by this FSB version.";
case FSBANK_WARN_CANNOTLOOP: return "Source file is too short for seamless looping. Looping disabled.";
case FSBANK_WARN_IGNORED_OPTIMIZESAMPLERATE: return "FSBANK_BUILD_OPTIMIZESAMPLERATE flag ignored: MP2, MP3 and CELT formats, and the USEBASICHEADERS flag make this option irrelevant.";
case FSBANK_WARN_IGNORED_FILTERHIGHFREQ: return "FSBANK_BUILD_FILTERHIGHFREQ flag ignored: feature only supported by XMA format.";
case FSBANK_WARN_IGNORED_DISABLESEEKING: return "FSBANK_BUILD_DISABLESEEKING flag ignored: feature only supported by XMA format.";
case FSBANK_WARN_IGNORED_DONTINTERLEAVE: return "FSBANK_BUILD_DONTINTERLEAVE flag ignored: feature only supported by VAG and GCADPCM formats.";
case FSBANK_ERR_ENCODER_FILE_NOTFOUND: return "External encoder dynamic library not found";
case FSBANK_ERR_ENCODER_FILE_BAD: return "External encoder dynamic library could not be loaded, possibly incorrect binary format, incorrect architecture, or file corruption";
default: return "Unknown error.";
}
}
#endif // _FSBANK_ERRORS_H

View file

@ -0,0 +1,221 @@
/*==============================================================================
3D Example
Copyright (c), Firelight Technologies Pty, Ltd 2004-2015.
This example shows how to basic 3D positioning of sounds.
==============================================================================*/
#include "fmod.hpp"
#include "common.h"
const int INTERFACE_UPDATETIME = 50; // 50ms update for interface
const float DISTANCEFACTOR = 1.0f; // Units per meter. I.e feet would = 3.28. centimeters would = 100.
int FMOD_Main()
{
FMOD::System *system;
FMOD::Sound *sound1, *sound2, *sound3;
FMOD::Channel *channel1 = 0, *channel2 = 0, *channel3 = 0;
FMOD_RESULT result;
bool listenerflag = true;
FMOD_VECTOR listenerpos = { 0.0f, 0.0f, -1.0f * DISTANCEFACTOR };
unsigned int version;
void *extradriverdata = 0;
Common_Init(&extradriverdata);
/*
Create a System object and initialize.
*/
result = FMOD::System_Create(&system);
ERRCHECK(result);
result = system->getVersion(&version);
ERRCHECK(result);
if (version < FMOD_VERSION)
{
Common_Fatal("FMOD lib version %08x doesn't match header version %08x", version, FMOD_VERSION);
}
result = system->init(100, FMOD_INIT_NORMAL, extradriverdata);
ERRCHECK(result);
/*
Set the distance units. (meters/feet etc).
*/
result = system->set3DSettings(1.0, DISTANCEFACTOR, 1.0f);
ERRCHECK(result);
/*
Load some sounds
*/
result = system->createSound(Common_MediaPath("drumloop.wav"), FMOD_3D, 0, &sound1);
ERRCHECK(result);
result = sound1->set3DMinMaxDistance(0.5f * DISTANCEFACTOR, 5000.0f * DISTANCEFACTOR);
ERRCHECK(result);
result = sound1->setMode(FMOD_LOOP_NORMAL);
ERRCHECK(result);
result = system->createSound(Common_MediaPath("jaguar.wav"), FMOD_3D, 0, &sound2);
ERRCHECK(result);
result = sound2->set3DMinMaxDistance(0.5f * DISTANCEFACTOR, 5000.0f * DISTANCEFACTOR);
ERRCHECK(result);
result = sound2->setMode(FMOD_LOOP_NORMAL);
ERRCHECK(result);
result = system->createSound(Common_MediaPath("swish.wav"), FMOD_2D, 0, &sound3);
ERRCHECK(result);
/*
Play sounds at certain positions
*/
{
FMOD_VECTOR pos = { -10.0f * DISTANCEFACTOR, 0.0f, 0.0f };
FMOD_VECTOR vel = { 0.0f, 0.0f, 0.0f };
result = system->playSound(sound1, 0, true, &channel1);
ERRCHECK(result);
result = channel1->set3DAttributes(&pos, &vel);
ERRCHECK(result);
result = channel1->setPaused(false);
ERRCHECK(result);
}
{
FMOD_VECTOR pos = { 15.0f * DISTANCEFACTOR, 0.0f, 0.0f };
FMOD_VECTOR vel = { 0.0f, 0.0f, 0.0f };
result = system->playSound(sound2, 0, true, &channel2);
ERRCHECK(result);
result = channel2->set3DAttributes(&pos, &vel);
ERRCHECK(result);
result = channel2->setPaused(false);
ERRCHECK(result);
}
/*
Main loop
*/
do
{
Common_Update();
if (Common_BtnPress(BTN_ACTION1))
{
bool paused;
channel1->getPaused(&paused);
channel1->setPaused(!paused);
}
if (Common_BtnPress(BTN_ACTION2))
{
bool paused;
channel2->getPaused(&paused);
channel2->setPaused(!paused);
}
if (Common_BtnPress(BTN_ACTION3))
{
result = system->playSound(sound3, 0, false, &channel3);
ERRCHECK(result);
}
if (Common_BtnPress(BTN_MORE))
{
listenerflag = !listenerflag;
}
if (!listenerflag)
{
if (Common_BtnDown(BTN_LEFT))
{
listenerpos.x -= 1.0f * DISTANCEFACTOR;
if (listenerpos.x < -24 * DISTANCEFACTOR)
{
listenerpos.x = -24 * DISTANCEFACTOR;
}
}
if (Common_BtnDown(BTN_RIGHT))
{
listenerpos.x += 1.0f * DISTANCEFACTOR;
if (listenerpos.x > 23 * DISTANCEFACTOR)
{
listenerpos.x = 23 * DISTANCEFACTOR;
}
}
}
// ==========================================================================================
// UPDATE THE LISTENER
// ==========================================================================================
{
static float t = 0;
static FMOD_VECTOR lastpos = { 0.0f, 0.0f, 0.0f };
FMOD_VECTOR forward = { 0.0f, 0.0f, 1.0f };
FMOD_VECTOR up = { 0.0f, 1.0f, 0.0f };
FMOD_VECTOR vel;
if (listenerflag)
{
listenerpos.x = (float)sin(t * 0.05f) * 24.0f * DISTANCEFACTOR; // left right pingpong
}
// ********* NOTE ******* READ NEXT COMMENT!!!!!
// vel = how far we moved last FRAME (m/f), then time compensate it to SECONDS (m/s).
vel.x = (listenerpos.x - lastpos.x) * (1000 / INTERFACE_UPDATETIME);
vel.y = (listenerpos.y - lastpos.y) * (1000 / INTERFACE_UPDATETIME);
vel.z = (listenerpos.z - lastpos.z) * (1000 / INTERFACE_UPDATETIME);
// store pos for next time
lastpos = listenerpos;
result = system->set3DListenerAttributes(0, &listenerpos, &vel, &forward, &up);
ERRCHECK(result);
t += (30 * (1.0f / (float)INTERFACE_UPDATETIME)); // t is just a time value .. it increments in 30m/s steps in this example
}
result = system->update();
ERRCHECK(result);
// Create small visual display.
char s[80] = "|.............<1>......................<2>.......|";
s[(int)(listenerpos.x / DISTANCEFACTOR) + 25] = 'L';
Common_Draw("==================================================");
Common_Draw("3D Example.");
Common_Draw("Copyright (c) Firelight Technologies 2004-2015.");
Common_Draw("==================================================");
Common_Draw("");
Common_Draw("Press %s to toggle sound 1 (16bit Mono 3D)", Common_BtnStr(BTN_ACTION1));
Common_Draw("Press %s to toggle sound 2 (8bit Mono 3D)", Common_BtnStr(BTN_ACTION2));
Common_Draw("Press %s to play a sound (16bit Stereo 2D)", Common_BtnStr(BTN_ACTION3));
Common_Draw("Press %s or %s to move listener in still mode", Common_BtnStr(BTN_LEFT), Common_BtnStr(BTN_RIGHT));
Common_Draw("Press %s to toggle listener auto movement", Common_BtnStr(BTN_MORE));
Common_Draw("Press %s to quit", Common_BtnStr(BTN_QUIT));
Common_Draw("");
Common_Draw(s);
Common_Sleep(INTERFACE_UPDATETIME - 1);
} while (!Common_BtnPress(BTN_QUIT));
/*
Shut down
*/
result = sound1->release();
ERRCHECK(result);
result = sound2->release();
ERRCHECK(result);
result = sound3->release();
ERRCHECK(result);
result = system->close();
ERRCHECK(result);
result = system->release();
ERRCHECK(result);
Common_Close();
return 0;
}

View file

@ -0,0 +1,195 @@
/*==============================================================================
Channel Groups Example
Copyright (c), Firelight Technologies Pty, Ltd 2004-2015.
This example shows how to put channels into channel groups, so that you can
affect a group of channels at a time instead of just one.
==============================================================================*/
#include "fmod.hpp"
#include "common.h"
int FMOD_Main()
{
FMOD::System *system;
FMOD::Sound *sound[6];
FMOD::Channel *channel[6];
FMOD::ChannelGroup *groupA, *groupB, *masterGroup;
FMOD_RESULT result;
int count;
unsigned int version;
void *extradriverdata = 0;
Common_Init(&extradriverdata);
/*
Create a System object and initialize.
*/
result = FMOD::System_Create(&system);
ERRCHECK(result);
result = system->getVersion(&version);
ERRCHECK(result);
if (version < FMOD_VERSION)
{
Common_Fatal("FMOD lib version %08x doesn't match header version %08x", version, FMOD_VERSION);
}
result = system->init(32, FMOD_INIT_NORMAL, extradriverdata);
ERRCHECK(result);
result = system->createSound(Common_MediaPath("drumloop.wav"), FMOD_LOOP_NORMAL, 0, &sound[0]);
ERRCHECK(result);
result = system->createSound(Common_MediaPath("jaguar.wav"), FMOD_LOOP_NORMAL, 0, &sound[1]);
ERRCHECK(result);
result = system->createSound(Common_MediaPath("swish.wav"), FMOD_LOOP_NORMAL, 0, &sound[2]);
ERRCHECK(result);
result = system->createSound(Common_MediaPath("c.ogg"), FMOD_LOOP_NORMAL, 0, &sound[3]);
ERRCHECK(result);
result = system->createSound(Common_MediaPath("d.ogg"), FMOD_LOOP_NORMAL, 0, &sound[4]);
ERRCHECK(result);
result = system->createSound(Common_MediaPath("e.ogg"), FMOD_LOOP_NORMAL, 0, &sound[5]);
ERRCHECK(result);
result = system->createChannelGroup("Group A", &groupA);
ERRCHECK(result);
result = system->createChannelGroup("Group B", &groupB);
ERRCHECK(result);
result = system->getMasterChannelGroup(&masterGroup);
ERRCHECK(result);
/*
Instead of being independent, set the group A and B to be children of the master group.
*/
result = masterGroup->addGroup(groupA);
ERRCHECK(result);
result = masterGroup->addGroup(groupB);
ERRCHECK(result);
/*
Start all the sounds.
*/
for (count = 0; count < 6; count++)
{
result = system->playSound(sound[count], 0, true, &channel[count]);
ERRCHECK(result);
result = channel[count]->setChannelGroup((count < 3) ? groupA : groupB);
ERRCHECK(result);
result = channel[count]->setPaused(false);
ERRCHECK(result);
}
/*
Change the volume of each group, just because we can! (reduce overall noise).
*/
result = groupA->setVolume(0.5f);
ERRCHECK(result);
result = groupB->setVolume(0.5f);
ERRCHECK(result);
/*
Main loop.
*/
do
{
Common_Update();
if (Common_BtnPress(BTN_ACTION1))
{
bool mute = true;
groupA->getMute(&mute);
groupA->setMute(!mute);
}
if (Common_BtnPress(BTN_ACTION2))
{
bool mute = true;
groupB->getMute(&mute);
groupB->setMute(!mute);
}
if (Common_BtnPress(BTN_ACTION3))
{
bool mute = true;
masterGroup->getMute(&mute);
masterGroup->setMute(!mute);
}
result = system->update();
ERRCHECK(result);
{
int channelsplaying = 0;
result = system->getChannelsPlaying(&channelsplaying);
ERRCHECK(result);
Common_Draw("==================================================");
Common_Draw("Channel Groups Example.");
Common_Draw("Copyright (c) Firelight Technologies 2004-2015.");
Common_Draw("==================================================");
Common_Draw("");
Common_Draw("Group A : drumloop.wav, jaguar.wav, swish.wav");
Common_Draw("Group B : c.ogg, d.ogg, e.ogg");
Common_Draw("");
Common_Draw("Press %s to mute/unmute group A", Common_BtnStr(BTN_ACTION1));
Common_Draw("Press %s to mute/unmute group B", Common_BtnStr(BTN_ACTION2));
Common_Draw("Press %s to mute/unmute master group", Common_BtnStr(BTN_ACTION3));
Common_Draw("Press %s to quit", Common_BtnStr(BTN_QUIT));
Common_Draw("");
Common_Draw("Channels playing %d", channelsplaying);
}
Common_Sleep(50);
} while (!Common_BtnPress(BTN_QUIT));
/*
A little fade out over 2 seconds.
*/
{
float pitch = 1.0f;
float vol = 1.0f;
for (count = 0; count < 200; count++)
{
masterGroup->setPitch(pitch);
masterGroup->setVolume(vol);
vol -= (1.0f / 200.0f);
pitch -= (0.5f / 200.0f);
result = system->update();
ERRCHECK(result);
Common_Sleep(10);
}
}
/*
Shut down.
*/
for (count = 0; count < 6; count++)
{
result = sound[count]->release();
ERRCHECK(result);
}
result = groupA->release();
ERRCHECK(result);
result = groupB->release();
ERRCHECK(result);
result = system->close();
ERRCHECK(result);
result = system->release();
ERRCHECK(result);
Common_Close();
return 0;
}

View file

@ -0,0 +1,105 @@
#include "common.h"
#include "fmod_errors.h"
void (*Common_Private_Error)(FMOD_RESULT, const char *, int);
void ERRCHECK_fn(FMOD_RESULT result, const char *file, int line)
{
if (result != FMOD_OK)
{
if (Common_Private_Error)
{
Common_Private_Error(result, file, line);
}
Common_Fatal("%s(%d): FMOD error %d - %s", file, line, result, FMOD_ErrorString(result));
}
}
void Common_Format(char *buffer, int bufferSize, const char *formatString...)
{
va_list args;
va_start(args, formatString);
Common_vsnprintf(buffer, bufferSize, formatString, args);
va_end(args);
buffer[bufferSize-1] = '\0';
}
void Common_Fatal(const char *format, ...)
{
char error[1024];
va_list args;
va_start(args, format);
Common_vsnprintf(error, 1024, format, args);
va_end(args);
error[1023] = '\0';
do
{
Common_Draw("A fatal error has occurred...");
Common_Draw("");
Common_Draw("%s", error);
Common_Draw("");
Common_Draw("Press %s to quit", Common_BtnStr(BTN_QUIT));
Common_Update();
Common_Sleep(50);
} while (!Common_BtnPress(BTN_QUIT));
Common_Exit(0);
}
void Common_Draw(const char *format, ...)
{
char string[1024];
char *stringPtr = string;
va_list args;
va_start(args, format);
Common_vsnprintf(string, 1024, format, args);
va_end(args);
string[1023] = '\0';
unsigned int length = (unsigned int)strlen(string);
do
{
bool consumeNewLine = false;
unsigned int copyLength = length;
// Search for new line characters
char *newLinePtr = strchr(stringPtr, '\n');
if (newLinePtr)
{
consumeNewLine = true;
copyLength = (unsigned int)(newLinePtr - stringPtr);
}
if (copyLength > NUM_COLUMNS)
{
// Hard wrap by default
copyLength = NUM_COLUMNS;
// Loop for a soft wrap
for (int i = NUM_COLUMNS - 1; i >= 0; i--)
{
if (stringPtr[i] == ' ')
{
copyLength = i + 1;
break;
}
}
}
// Null terminate the sub string temporarily by swapping out a char
char tempChar = stringPtr[copyLength];
stringPtr[copyLength] = 0;
Common_DrawText(stringPtr);
stringPtr[copyLength] = tempChar;
copyLength += (consumeNewLine ? 1 : 0);
length -= copyLength;
stringPtr += copyLength;
} while (length > 0);
}

View file

@ -0,0 +1,74 @@
#ifndef FMOD_EXAMPLES_COMMON_H
#define FMOD_EXAMPLES_COMMON_H
#include "common_platform.h"
#include "fmod.h"
#include <stddef.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <stdarg.h>
#include <stdio.h>
#include <assert.h>
#define NUM_COLUMNS 50
#define NUM_ROWS 25
#ifndef Common_Sin
#define Common_Sin sin
#endif
#ifndef Common_snprintf
#define Common_snprintf snprintf
#endif
#ifndef Common_vsnprintf
#define Common_vsnprintf vsnprintf
#endif
enum Common_Button
{
BTN_ACTION1,
BTN_ACTION2,
BTN_ACTION3,
BTN_ACTION4,
BTN_LEFT,
BTN_RIGHT,
BTN_UP,
BTN_DOWN,
BTN_MORE,
BTN_QUIT
};
/* Cross platform functions (common) */
void Common_Fatal(const char *format, ...);
void Common_Draw(const char *format, ...);
void ERRCHECK_fn(FMOD_RESULT result, const char *file, int line);
#define ERRCHECK(_result) ERRCHECK_fn(_result, __FILE__, __LINE__)
#define Common_Max(_a, _b) ((_a) > (_b) ? (_a) : (_b))
#define Common_Min(_a, _b) ((_a) < (_b) ? (_a) : (_b))
#define Common_Clamp(_min, _val, _max) ((_val) < (_min) ? (_min) : ((_val) > (_max) ? (_max) : (_val)))
/* Functions with platform specific implementation (common_platform) */
void Common_Init(void **extraDriverData);
void Common_Close();
void Common_Update();
void Common_Sleep(unsigned int ms);
void Common_Exit(int returnCode);
void Common_DrawText(const char *text);
void Common_LoadFileMemory(const char *name, void **buff, int *length);
void Common_UnloadFileMemory(void *buff);
void Common_Format(char *buffer, int bufferSize, const char *formatString...);
bool Common_BtnPress(Common_Button btn);
bool Common_BtnDown(Common_Button btn);
const char *Common_BtnStr(Common_Button btn);
const char *Common_MediaPath(const char *fileName);
const char *Common_WritePath(const char *fileName);
void Common_Mutex_Create(Common_Mutex *mutex);
void Common_Mutex_Destroy(Common_Mutex *mutex);
void Common_Mutex_Enter(Common_Mutex *mutex);
void Common_Mutex_Leave(Common_Mutex *mutex);
#endif

View file

@ -0,0 +1,196 @@
#include "common.h"
#include <string.h>
#include <jni.h>
#include <unistd.h>
#include <string>
#include <vector>
JNIEnv *gJNIEnv;
jobject gMainActivityObject;
int gDownButtons;
int gLastDownButtons;
int gPressedButtons;
bool gSuspendState;
bool gQuitState;
std::string gUIString;
std::vector<char *> gPathList;
int FMOD_Main(); // Defined in example
void Common_Init(void **extraDriverData)
{
gDownButtons = 0;
gLastDownButtons = 0;
gPressedButtons = 0;
gSuspendState = false;
gQuitState = false;
}
void Common_Close()
{
for (std::vector<char *>::iterator item = gPathList.begin(); item != gPathList.end(); ++item)
{
free(*item);
}
gPathList.clear();
}
void Common_Update()
{
jstring text = gJNIEnv->NewStringUTF(gUIString.c_str());
jclass mainActivityClass = gJNIEnv->GetObjectClass(gMainActivityObject);
jmethodID updateScreenMethodID = gJNIEnv->GetMethodID(mainActivityClass, "updateScreen", "(Ljava/lang/String;)V");
gJNIEnv->CallVoidMethod(gMainActivityObject, updateScreenMethodID, text);
gJNIEnv->DeleteLocalRef(text);
gJNIEnv->DeleteLocalRef(mainActivityClass);
gUIString.clear();
gPressedButtons = (gLastDownButtons ^ gDownButtons) & gDownButtons;
gLastDownButtons = gDownButtons;
if (gQuitState)
{
gPressedButtons |= (1 << BTN_QUIT);
}
}
void Common_Sleep(unsigned int ms)
{
usleep(ms * 1000);
}
void Common_Exit(int returnCode)
{
exit(returnCode);
}
void Common_DrawText(const char *text)
{
char s[256];
snprintf(s, sizeof(s), "%s\n", text);
gUIString.append(s);
}
void Common_LoadFileMemory(const char *name, void **buff, int *length)
{
FILE *file = fopen(name, "rb");
fseek(file, 0, SEEK_END);
long len = ftell(file);
fseek(file, 0, SEEK_SET);
void *mem = malloc(len);
fread(mem, 1, len, file);
fclose(file);
*buff = mem;
*length = len;
}
void Common_UnloadFileMemory(void *buff)
{
free(buff);
}
bool Common_BtnPress(Common_Button btn)
{
return ((gPressedButtons & (1 << btn)) != 0);
}
bool Common_BtnDown(Common_Button btn)
{
return ((gDownButtons & (1 << btn)) != 0);
}
const char *Common_BtnStr(Common_Button btn)
{
switch (btn)
{
case BTN_ACTION1: return "A";
case BTN_ACTION2: return "B";
case BTN_ACTION3: return "C";
case BTN_ACTION4: return "D";
case BTN_UP: return "Up";
case BTN_DOWN: return "Down";
case BTN_LEFT: return "Left";
case BTN_RIGHT: return "Right";
case BTN_MORE: return "E";
case BTN_QUIT: return "Back";
default: return "Unknown";
}
}
const char *Common_MediaPath(const char *fileName)
{
char *filePath = (char *)calloc(256, sizeof(char));
strcat(filePath, "file:///android_asset/");
strcat(filePath, fileName);
gPathList.push_back(filePath);
return filePath;
}
const char *Common_WritePath(const char *fileName)
{
return Common_MediaPath(fileName);
}
bool Common_SuspendState()
{
return gSuspendState;
}
extern "C"
{
jstring Java_org_fmod_example_MainActivity_getButtonLabel(JNIEnv *env, jobject thiz, jint index)
{
return env->NewStringUTF(Common_BtnStr((Common_Button)index));
}
void Java_org_fmod_example_MainActivity_buttonDown(JNIEnv *env, jobject thiz, jint index)
{
gDownButtons |= (1 << index);
}
void Java_org_fmod_example_MainActivity_buttonUp(JNIEnv *env, jobject thiz, jint index)
{
gDownButtons &= ~(1 << index);
}
void Java_org_fmod_example_MainActivity_setStateCreate(JNIEnv *env, jobject thiz)
{
}
void Java_org_fmod_example_MainActivity_setStateStart(JNIEnv *env, jobject thiz)
{
gSuspendState = false;
}
void Java_org_fmod_example_MainActivity_setStateStop(JNIEnv *env, jobject thiz)
{
gSuspendState = true;
}
void Java_org_fmod_example_MainActivity_setStateDestroy(JNIEnv *env, jobject thiz)
{
gQuitState = true;
}
void Java_org_fmod_example_MainActivity_main(JNIEnv *env, jobject thiz)
{
gJNIEnv = env;
gMainActivityObject = thiz;
FMOD_Main();
}
} /* extern "C" */

View file

@ -0,0 +1,35 @@
#include <pthread.h>
#include <assert.h>
bool Common_SuspendState();
typedef pthread_mutex_t Common_Mutex;
inline void Common_Mutex_Create(Common_Mutex *mutex)
{
int err;
pthread_mutexattr_t mutexattr;
pthread_mutexattr_init(&mutexattr);
err = pthread_mutexattr_settype(&mutexattr, PTHREAD_MUTEX_RECURSIVE_NP);
assert(err == 0);
err = pthread_mutex_init(mutex, &mutexattr);
assert(err == 0);
}
inline void Common_Mutex_Destroy(Common_Mutex *mutex)
{
pthread_mutex_destroy(mutex);
}
inline void Common_Mutex_Enter(Common_Mutex *mutex)
{
int err = pthread_mutex_lock(mutex);
assert(err == 0);
}
inline void Common_Mutex_Leave(Common_Mutex *mutex)
{
int err = pthread_mutex_unlock(mutex);
assert(err == 0);
}

View file

@ -0,0 +1,245 @@
/*==============================================================================
Convolution Reverb Example
Copyright (c), Firelight Technologies Pty, Ltd 2004-2015.
This example shows how to set up a convolution reverb DSP as a global
DSP unit that can be routed into by multiple seperate channels.
Convolution reverb uses data from a real world locations called an
"Impulse Response" to model the reflection of audio waves back
to a listener.
Impulse Response is based on "St Andrew's Church" by
www.openairlib.net
Audiolab, University of York
Damian T. Murphy
http://www.openairlib.net/auralizationdb/content/st-andrews-church
licensed under Attribution Share Alike Creative Commons license
http://creativecommons.org/licenses/by-sa/3.0/
Anechoic sample "Operatic Voice" by
www.openairlib.net
http://www.openairlib.net/anechoicdb/content/operatic-voice
licensed under Attribution Share Alike Creative Commons license
http://creativecommons.org/licenses/by-sa/3.0/
### Features Demonstrated ###
+ FMOD_DSP_CONVOLUTION_REVERB
+ DSP::addInput
==============================================================================*/
#include "fmod.hpp"
#include "common.h"
int FMOD_Main()
{
void *extradriverdata = 0;
Common_Init(&extradriverdata);
/*
Create a System object and initialize
*/
FMOD_RESULT result;
FMOD::System* system;
result = FMOD::System_Create(&system);
ERRCHECK(result);
unsigned int version;
result = system->getVersion(&version);
ERRCHECK(result);
if (version < FMOD_VERSION)
{
Common_Fatal("FMOD lib version %08x doesn't match header version %08x", version, FMOD_VERSION);
}
result = system->init(32, FMOD_INIT_NORMAL, extradriverdata);
ERRCHECK(result);
/*
Create a new channel group to hold the convolution DSP unit
*/
FMOD::ChannelGroup* reverbGroup;
result = system->createChannelGroup("reverb", &reverbGroup);
ERRCHECK(result);
/*
Create a new channel group to hold all the channels and process the dry path
*/
FMOD::ChannelGroup* mainGroup;
result = system->createChannelGroup("main", &mainGroup);
ERRCHECK(result);
/*
Create the convultion DSP unit and set it as the tail of the channel group
*/
FMOD::DSP* reverbUnit;
result = system->createDSPByType(FMOD_DSP_TYPE_CONVOLUTIONREVERB, &reverbUnit);
ERRCHECK(result);
result = reverbGroup->addDSP(FMOD_CHANNELCONTROL_DSP_TAIL, reverbUnit);
ERRCHECK(result);
/*
Open the impulse response wav file, but use FMOD_OPENONLY as we want
to read the data into a seperate buffer
*/
FMOD::Sound* irSound;
result = system->createSound(Common_MediaPath("standrews.wav"), FMOD_DEFAULT | FMOD_OPENONLY, NULL, &irSound);
ERRCHECK(result);
/*
Retrieve the sound information for the Impulse Response input file
*/
FMOD_SOUND_FORMAT irSoundFormat;
FMOD_SOUND_TYPE irSoundType;
int irSoundBits, irSoundChannels;
result = irSound->getFormat(&irSoundType, &irSoundFormat, &irSoundChannels, &irSoundBits);
ERRCHECK(result);
unsigned int irSoundLength;
result = irSound->getLength(&irSoundLength, FMOD_TIMEUNIT_PCM);
ERRCHECK(result);
if (irSoundFormat != FMOD_SOUND_FORMAT_PCM16)
{
/*
For simplicity of the example, if the impulse response is the wrong format just display an error
*/
Common_Fatal("Impulse Response file is the wrong audio format");
}
/*
The reverb unit expects a block of data containing a single 16 bit int containing
the number of channels in the impulse response, followed by PCM 16 data
*/
unsigned int irDataLength = sizeof(short) * (irSoundLength * irSoundChannels + 1);
short* irData = (short*)malloc(irDataLength);
irData[0] = irSoundChannels;
unsigned int irDataRead;
result = irSound->readData(&irData[1], irDataLength - sizeof(short), &irDataRead);
ERRCHECK(result);
result = reverbUnit->setParameterData(FMOD_DSP_CONVOLUTION_REVERB_PARAM_IR, irData, irDataLength);
ERRCHECK(result);
/*
Don't pass any dry signal from the reverb unit, instead take the dry part
of the mix from the main signal path
*/
result = reverbUnit->setParameterFloat(FMOD_DSP_CONVOLUTION_REVERB_PARAM_DRY, -80.0f);
ERRCHECK(result);
/*
We can now free our copy of the IR data and release the sound object, the reverb unit
has created it's internal data
*/
free(irData);
result = irSound->release();
ERRCHECK(result);
/*
Load up and play a sample clip recorded in an anechoic chamber
*/
FMOD::Sound* sound;
system->createSound(Common_MediaPath("singing.wav"), FMOD_3D | FMOD_LOOP_NORMAL, NULL, &sound);
ERRCHECK(result);
FMOD::Channel* channel;
system->playSound(sound, mainGroup, true, &channel);
ERRCHECK(result);
/*
Create a send connection between the channel head and the reverb unit
*/
FMOD::DSP* channelHead;
channel->getDSP(FMOD_CHANNELCONTROL_DSP_HEAD, &channelHead);
ERRCHECK(result);
FMOD::DSPConnection* reverbConnection;
result = reverbUnit->addInput(channelHead, &reverbConnection, FMOD_DSPCONNECTION_TYPE_SEND);
ERRCHECK(result);
result = channel->setPaused(false);
ERRCHECK(result);
float wetVolume = 1.0;
float dryVolume = 1.0;
/*
Main loop
*/
do
{
Common_Update();
if (Common_BtnPress(BTN_LEFT))
{
wetVolume = (wetVolume <= 0.0f) ? wetVolume : wetVolume - 0.05;
}
if (Common_BtnPress(BTN_RIGHT))
{
wetVolume = (wetVolume >= 1.0f) ? wetVolume : wetVolume + 0.05f;
}
if (Common_BtnPress(BTN_DOWN))
{
dryVolume = (dryVolume <= 0.0f) ? dryVolume : dryVolume - 0.05f;
}
if (Common_BtnPress(BTN_UP))
{
dryVolume = (dryVolume >= 1.0f) ? dryVolume : dryVolume + 0.05f;
}
result = system->update();
ERRCHECK(result);
result = reverbConnection->setMix(wetVolume);
ERRCHECK(result);
result = mainGroup->setVolume(dryVolume);
ERRCHECK(result);
Common_Draw("==================================================");
Common_Draw("Convolution Example.");
Common_Draw("Copyright (c) Firelight Technologies 2004-2015.");
Common_Draw("==================================================");
Common_Draw("Press %s and %s to change dry mix", Common_BtnStr(BTN_UP), Common_BtnStr(BTN_DOWN));
Common_Draw("Press %s and %s to change wet mix", Common_BtnStr(BTN_LEFT), Common_BtnStr(BTN_RIGHT));
Common_Draw("wet mix [%.2f] dry mix [%.2f]", wetVolume, dryVolume);
Common_Draw("Press %s to quit", Common_BtnStr(BTN_QUIT));
Common_Draw("");
Common_Sleep(50);
} while (!Common_BtnPress(BTN_QUIT));
/*
Shut down
*/
result = sound->release();
ERRCHECK(result);
result = mainGroup->release();
ERRCHECK(result);
result = reverbGroup->removeDSP(reverbUnit);
ERRCHECK(result);
result = reverbUnit->disconnectAll(true, true);
ERRCHECK(result);
result = reverbUnit->release();
ERRCHECK(result);
result = reverbGroup->release();
ERRCHECK(result);
result = system->close();
ERRCHECK(result);
result = system->release();
ERRCHECK(result);
Common_Close();
return 0;
}

View file

@ -0,0 +1,176 @@
/*==============================================================================
Custom DSP Example
Copyright (c), Firelight Technologies Pty, Ltd 2004-2015.
This example shows how to add a user created DSP callback to process audio
data. The read callback is executed at runtime, and can be added anywhere in
the DSP network.
==============================================================================*/
#include "fmod.hpp"
#include "common.h"
FMOD_RESULT F_CALLBACK myDSPCallback(FMOD_DSP_STATE *dsp_state, float *inbuffer, float *outbuffer, unsigned int length, int inchannels, int *outchannels)
{
FMOD_RESULT result;
char name[256];
void* userdata;
FMOD::DSP *thisdsp = (FMOD::DSP *)dsp_state->instance;
/*
This redundant call just shows using the instance parameter of FMOD_DSP_STATE to
call a DSP information function.
*/
result = thisdsp->getInfo(name, 0, 0, 0, 0);
ERRCHECK(result);
result = thisdsp->getUserData(&userdata);
ERRCHECK(result);
/*
This loop assumes inchannels = outchannels, which it will be if the DSP is created with '0'
as the number of channels in FMOD_DSP_DESCRIPTION.
Specifying an actual channel count will mean you have to take care of any number of channels coming in,
but outputting the number of channels specified. Generally it is best to keep the channel
count at 0 for maximum compatibility.
*/
for (unsigned int samp = 0; samp < length; samp++)
{
/*
Feel free to unroll this.
*/
for (int chan = 0; chan < *outchannels; chan++)
{
/*
This DSP filter just halves the volume!
Input is modified, and sent to output.
*/
outbuffer[(samp * *outchannels) + chan] = inbuffer[(samp * inchannels) + chan] * 0.2f;
}
}
return FMOD_OK;
}
int FMOD_Main()
{
FMOD::System *system;
FMOD::Sound *sound;
FMOD::Channel *channel;
FMOD::DSP *mydsp;
FMOD::ChannelGroup *mastergroup;
FMOD_RESULT result;
unsigned int version;
void *extradriverdata = 0;
Common_Init(&extradriverdata);
/*
Create a System object and initialize.
*/
result = FMOD::System_Create(&system);
ERRCHECK(result);
result = system->getVersion(&version);
ERRCHECK(result);
if (version < FMOD_VERSION)
{
Common_Fatal("FMOD lib version %08x doesn't match header version %08x", version, FMOD_VERSION);
}
result = system->init(32, FMOD_INIT_NORMAL, extradriverdata);
ERRCHECK(result);
result = system->createSound(Common_MediaPath("drumloop.wav"), FMOD_LOOP_NORMAL, 0, &sound);
ERRCHECK(result);
result = system->playSound(sound, 0, false, &channel);
ERRCHECK(result);
/*
Create the DSP effect.
*/
{
FMOD_DSP_DESCRIPTION dspdesc;
memset(&dspdesc, 0, sizeof(dspdesc));
strncpy(dspdesc.name, "My first DSP unit", sizeof(dspdesc.name));
dspdesc.version = 0x00010000;
dspdesc.numinputbuffers = 1;
dspdesc.numoutputbuffers = 1;
dspdesc.read = myDSPCallback;
dspdesc.userdata = (void *)0x12345678;
result = system->createDSP(&dspdesc, &mydsp);
ERRCHECK(result);
}
/*
Attach the DSP, inactive by default.
*/
result = mydsp->setBypass(true);
ERRCHECK(result);
result = system->getMasterChannelGroup(&mastergroup);
ERRCHECK(result);
result = mastergroup->addDSP(0, mydsp);
ERRCHECK(result);
/*
Main loop.
*/
do
{
bool bypass;
Common_Update();
result = mydsp->getBypass(&bypass);
ERRCHECK(result);
if (Common_BtnPress(BTN_ACTION1))
{
bypass = !bypass;
result = mydsp->setBypass(bypass);
ERRCHECK(result);
}
result = system->update();
ERRCHECK(result);
Common_Draw("==================================================");
Common_Draw("Custom DSP Example.");
Common_Draw("Copyright (c) Firelight Technologies 2004-2015.");
Common_Draw("==================================================");
Common_Draw("");
Common_Draw("Press %s to toggle filter bypass", Common_BtnStr(BTN_ACTION1));
Common_Draw("Press %s to quit", Common_BtnStr(BTN_QUIT));
Common_Draw("");
Common_Draw("Filter is %s", bypass ? "inactive" : "active");
Common_Sleep(50);
} while (!Common_BtnPress(BTN_QUIT));
/*
Shut down
*/
result = sound->release();
ERRCHECK(result);
result = mastergroup->removeDSP(mydsp);
ERRCHECK(result);
result = mydsp->release();
ERRCHECK(result);
result = system->close();
ERRCHECK(result);
result = system->release();
ERRCHECK(result);
Common_Close();
return 0;
}

View file

@ -0,0 +1,282 @@
/*==============================================================================
DSP Effect Per Speaker Example
Copyright (c), Firelight Technologies Pty, Ltd 2004-2015.
This example shows how to manipulate a DSP network and as an example, creates 2
DSP effects, splitting a single sound into 2 audio paths, which it then filters
seperately.
To only have each audio path come out of one speaker each,
DSPConnection::setMixMatrix is used just before the 2 branches merge back together
again.
For more speakers:
* Use System::setSoftwareFormat
* Create more effects, currently 2 for stereo (lowpass and highpass), create one
per speaker.
* Under the 'Now connect the 2 effects to channeldsp head.' section, connect
the extra effects by duplicating the code more times.
* Filter each effect to each speaker by calling DSPConnection::setMixMatrix.
Expand the existing code by extending the matrices from 2 in and 2 out, to the
number of speakers you require.
==============================================================================*/
#include "fmod.hpp"
#include "common.h"
int FMOD_Main()
{
FMOD::System *system;
FMOD::Sound *sound;
FMOD::Channel *channel;
FMOD::ChannelGroup *mastergroup;
FMOD::DSP *dsplowpass, *dsphighpass, *dsphead, *dspchannelmixer;
FMOD::DSPConnection *dsplowpassconnection, *dsphighpassconnection;
FMOD_RESULT result;
unsigned int version;
float pan = 0.0f;
void *extradriverdata = 0;
Common_Init(&extradriverdata);
/*
Create a System object and initialize.
*/
result = FMOD::System_Create(&system);
ERRCHECK(result);
result = system->getVersion(&version);
ERRCHECK(result);
if (version < FMOD_VERSION)
{
Common_Fatal("FMOD lib version %08x doesn't match header version %08x", version, FMOD_VERSION);
}
/*
In this special case we want to use stereo output and not worry about varying matrix sizes depending on user speaker mode.
*/
system->setSoftwareFormat(48000, FMOD_SPEAKERMODE_STEREO, 0);
ERRCHECK(result);
/*
Initialize FMOD
*/
result = system->init(32, FMOD_INIT_NORMAL, extradriverdata);
ERRCHECK(result);
result = system->createSound(Common_MediaPath("drumloop.wav"), FMOD_LOOP_NORMAL, 0, &sound);
ERRCHECK(result);
result = system->playSound(sound, 0, false, &channel);
ERRCHECK(result);
/*
Create the DSP effects.
*/
result = system->createDSPByType(FMOD_DSP_TYPE_LOWPASS, &dsplowpass);
ERRCHECK(result);
result = dsplowpass->setParameterFloat(FMOD_DSP_LOWPASS_CUTOFF, 1000.0f);
ERRCHECK(result);
result = dsplowpass->setParameterFloat(FMOD_DSP_LOWPASS_RESONANCE, 4.0f);
ERRCHECK(result);
result = system->createDSPByType(FMOD_DSP_TYPE_HIGHPASS, &dsphighpass);
ERRCHECK(result);
result = dsphighpass->setParameterFloat(FMOD_DSP_HIGHPASS_CUTOFF, 4000.0f);
ERRCHECK(result);
result = dsphighpass->setParameterFloat(FMOD_DSP_HIGHPASS_RESONANCE, 4.0f);
ERRCHECK(result);
/*
Connect up the DSP network
*/
/*
When a sound is played, a subnetwork is set up in the DSP network which looks like this.
Wavetable is the drumloop sound, and it feeds its data from right to left.
[DSPHEAD]<------------[DSPCHANNELMIXER]<------------[CHANNEL HEAD]<------------[WAVETABLE - DRUMLOOP.WAV]
*/
result = system->getMasterChannelGroup(&mastergroup);
ERRCHECK(result);
result = mastergroup->getDSP(FMOD_CHANNELCONTROL_DSP_HEAD, &dsphead);
ERRCHECK(result);
result = dsphead->getInput(0, &dspchannelmixer, 0);
ERRCHECK(result);
/*
Now disconnect channeldsp head from wavetable to look like this.
[DSPHEAD] [DSPCHANNELMIXER]<------------[CHANNEL HEAD]<------------[WAVETABLE - DRUMLOOP.WAV]
*/
result = dsphead->disconnectFrom(dspchannelmixer);
ERRCHECK(result);
/*
Now connect the 2 effects to channeldsp head.
Store the 2 connections this makes so we can set their matrix later.
[DSPLOWPASS]
/x
[DSPHEAD] [DSPCHANNELMIXER]<------------[CHANNEL HEAD]<------------[WAVETABLE - DRUMLOOP.WAV]
\y
[DSPHIGHPASS]
*/
result = dsphead->addInput(dsplowpass, &dsplowpassconnection); /* x = dsplowpassconnection */
ERRCHECK(result);
result = dsphead->addInput(dsphighpass, &dsphighpassconnection); /* y = dsphighpassconnection */
ERRCHECK(result);
/*
Now connect the channelmixer to the 2 effects
[DSPLOWPASS]
/x \
[DSPHEAD] [DSPCHANNELMIXER]<------------[CHANNEL HEAD]<------------[WAVETABLE - DRUMLOOP.WAV]
\y /
[DSPHIGHPASS]
*/
result = dsplowpass->addInput(dspchannelmixer); /* Ignore connection - we dont care about it. */
ERRCHECK(result);
result = dsphighpass->addInput(dspchannelmixer); /* Ignore connection - we dont care about it. */
ERRCHECK(result);
/*
Now the drumloop will be twice as loud, because it is being split into 2, then recombined at the end.
What we really want is to only feed the dsphead<-dsplowpass through the left speaker for that effect, and
dsphead<-dsphighpass to the right speaker for that effect.
We can do that simply by setting the pan, or speaker matrix of the connections.
[DSPLOWPASS]
/x=1,0 \
[DSPHEAD] [DSPCHANNELMIXER]<------------[CHANNEL HEAD]<------------[WAVETABLE - DRUMLOOP.WAV]
\y=0,1 /
[DSPHIGHPASS]
*/
{
float lowpassmatrix[2][2] = {
{ 1.0f, 0.0f }, // <- output to front left. Take front left input signal at 1.0.
{ 0.0f, 0.0f } // <- output to front right. Silence
};
float highpassmatrix[2][2] = {
{ 0.0f, 0.0f }, // <- output to front left. Silence
{ 0.0f, 1.0f } // <- output to front right. Take front right input signal at 1.0
};
/*
Upgrade the signal coming from the channel mixer from mono to stereo. Otherwise the lowpass and highpass will get mono signals
*/
result = dspchannelmixer->setChannelFormat(0, 0, FMOD_SPEAKERMODE_STEREO);
ERRCHECK(result);
/*
Now set the above matrices.
*/
result = dsplowpassconnection->setMixMatrix(&lowpassmatrix[0][0], 2, 2);
ERRCHECK(result);
result = dsphighpassconnection->setMixMatrix(&highpassmatrix[0][0], 2, 2);
ERRCHECK(result);
}
result = dsplowpass->setBypass(true);
ERRCHECK(result);
result = dsphighpass->setBypass(true);
ERRCHECK(result);
result = dsplowpass->setActive(true);
ERRCHECK(result);
result = dsphighpass->setActive(true);
ERRCHECK(result);
/*
Main loop.
*/
do
{
bool lowpassbypass, highpassbypass;
Common_Update();
result = dsplowpass->getBypass(&lowpassbypass);
ERRCHECK(result);
result = dsphighpass->getBypass(&highpassbypass);
ERRCHECK(result);
if (Common_BtnPress(BTN_ACTION1))
{
lowpassbypass = !lowpassbypass;
result = dsplowpass->setBypass(lowpassbypass);
ERRCHECK(result);
}
if (Common_BtnPress(BTN_ACTION2))
{
highpassbypass = !highpassbypass;
result = dsphighpass->setBypass(highpassbypass);
ERRCHECK(result);
}
if (Common_BtnDown(BTN_LEFT))
{
pan = (pan <= -0.9f) ? -1.0f : pan - 0.1f;
result = channel->setPan(pan);
ERRCHECK(result);
}
if (Common_BtnDown(BTN_RIGHT))
{
pan = (pan >= 0.9f) ? 1.0f : pan + 0.1f;
result = channel->setPan(pan);
ERRCHECK(result);
}
result = system->update();
ERRCHECK(result);
Common_Draw("==================================================");
Common_Draw("DSP Effect Per Speaker Example.");
Common_Draw("Copyright (c) Firelight Technologies 2004-2015.");
Common_Draw("==================================================");
Common_Draw("");
Common_Draw("Press %s to toggle lowpass (left speaker)", Common_BtnStr(BTN_ACTION1));
Common_Draw("Press %s to toggle highpass (right speaker)", Common_BtnStr(BTN_ACTION2));
Common_Draw("Press %s or %s to pan sound", Common_BtnStr(BTN_LEFT), Common_BtnStr(BTN_RIGHT));
Common_Draw("Press %s to quit", Common_BtnStr(BTN_QUIT));
Common_Draw("");
Common_Draw("Lowpass (left) is %s", lowpassbypass ? "inactive" : "active");
Common_Draw("Highpass (right) is %s", highpassbypass ? "inactive" : "active");
Common_Draw("Pan is %0.2f", pan);
Common_Sleep(50);
} while (!Common_BtnPress(BTN_QUIT));
/*
Shut down
*/
result = sound->release();
ERRCHECK(result);
result = dsplowpass->release();
ERRCHECK(result);
result = dsphighpass->release();
ERRCHECK(result);
result = system->close();
ERRCHECK(result);
result = system->release();
ERRCHECK(result);
Common_Close();
return 0;
}

View file

@ -0,0 +1,329 @@
/*==============================================================================
Plug-in Inspector Example
Copyright (c), Firelight Technologies Pty, Ltd 2004-2015.
This example shows how to enumerate loaded plug-ins and their parameters.
==============================================================================*/
#include "fmod.hpp"
#include "common.h"
const int INTERFACE_UPDATETIME = 50; // 50ms update for interface
const int MAX_PLUGINS_IN_VIEW = 5;
const int MAX_PARAMETERS_IN_VIEW = 14;
enum InspectorState
{
PLUGIN_SELECTOR,
PARAMETER_VIEWER
};
struct PluginSelectorState
{
FMOD::System *system;
int numplugins;
int cursor;
};
struct ParameterViewerState
{
FMOD::DSP *dsp;
int numparams;
int scroll;
};
void drawTitle()
{
Common_Draw("==================================================");
Common_Draw("Plug-in Inspector Example.");
Common_Draw("Copyright (c) Firelight Technologies 2004-2015.");
Common_Draw("==================================================");
Common_Draw("");
}
bool hasDataParameter(const FMOD_DSP_DESCRIPTION *desc, FMOD_DSP_PARAMETER_DATA_TYPE type)
{
for (int i = 0; i < desc->numparameters; i++)
{
if (desc->paramdesc[i]->type == FMOD_DSP_PARAMETER_TYPE_DATA && ((type >= 0 && desc->paramdesc[i]->datadesc.datatype >= 0) || desc->paramdesc[i]->datadesc.datatype == type))
{
return true;
}
}
return false;
}
void drawDSPInfo(const FMOD_DSP_DESCRIPTION *desc)
{
Common_Draw("Name (Version) : %s (%x)", desc->name, desc->version);
Common_Draw("SDK Version : %d", desc->pluginsdkversion);
Common_Draw("Type : %s", desc->numinputbuffers ? "Effect" : "Sound Generator");
Common_Draw("Parameters : %d", desc->numparameters);
Common_Draw("Audio Callback : %s", desc->process ? "process()" : "read()");
Common_Draw("");
Common_Draw(" Reset | Side-Chain | 3D | Audibility | User Data");
Common_Draw(" %s | %s | %s | %s | %s ",
desc->reset ? "Y " : "--",
hasDataParameter(desc, FMOD_DSP_PARAMETER_DATA_TYPE_SIDECHAIN) ? "Y " : "--",
hasDataParameter(desc, FMOD_DSP_PARAMETER_DATA_TYPE_3DATTRIBUTES) ? "Y " : "--",
hasDataParameter(desc, FMOD_DSP_PARAMETER_DATA_TYPE_OVERALLGAIN) ? "Y " : "--",
hasDataParameter(desc, FMOD_DSP_PARAMETER_DATA_TYPE_USER) || desc->userdata ? "Y " : "--");
}
void drawDSPList(PluginSelectorState *state)
{
unsigned int pluginhandle;
char pluginname[256];
FMOD_RESULT result;
Common_Draw("Press %s to select the next plug-in", Common_BtnStr(BTN_DOWN));
Common_Draw("Press %s to select the previous plug-in", Common_BtnStr(BTN_UP));
Common_Draw("Press %s to view the plug-in parameters", Common_BtnStr(BTN_RIGHT));
Common_Draw("");
int start = Common_Clamp(0, state->cursor - (MAX_PLUGINS_IN_VIEW - 1) / 2, state->numplugins - MAX_PLUGINS_IN_VIEW);
for (int i = start; i < start + MAX_PLUGINS_IN_VIEW; i++)
{
result = state->system->getPluginHandle(FMOD_PLUGINTYPE_DSP, i, &pluginhandle);
ERRCHECK(result);
result = state->system->getPluginInfo(pluginhandle, 0, pluginname, 256, 0);
ERRCHECK(result);
Common_Draw("%s %s", i == state->cursor ? ">" : " ", pluginname);
}
Common_Draw("");
Common_Draw("==================================================");
Common_Draw("");
result = state->system->getPluginHandle(FMOD_PLUGINTYPE_DSP, state->cursor, &pluginhandle);
ERRCHECK(result);
const FMOD_DSP_DESCRIPTION *description;
result = state->system->getDSPInfoByPlugin(pluginhandle, &description);
ERRCHECK(result);
drawDSPInfo(description);
}
void drawDSPParameters(ParameterViewerState *state)
{
FMOD_RESULT result;
FMOD_DSP_PARAMETER_DESC *paramdesc;
char pluginname[256];
Common_Draw("Press %s to scroll down", Common_BtnStr(BTN_DOWN));
Common_Draw("Press %s to scroll up", Common_BtnStr(BTN_UP));
Common_Draw("Press %s to return to the plug-in list", Common_BtnStr(BTN_LEFT));
Common_Draw("");
result = state->dsp->getInfo(pluginname, 0, 0, 0, 0);
ERRCHECK(result);
Common_Draw("%s Parameters:", pluginname);
Common_Draw("--------------------------------------------------");
for (int i = state->scroll; i < state->numparams; i++)
{
result = state->dsp->getParameterInfo(i, &paramdesc);
ERRCHECK(result);
switch (paramdesc->type)
{
case FMOD_DSP_PARAMETER_TYPE_FLOAT:
{
char *units = paramdesc->label;
Common_Draw("%2d: %-15s [%g, %g] (%.2f%s)", i, paramdesc->name, paramdesc->floatdesc.min, paramdesc->floatdesc.max, paramdesc->floatdesc.defaultval, units);
break;
}
case FMOD_DSP_PARAMETER_TYPE_INT:
{
if (paramdesc->intdesc.valuenames)
{
int lengthremaining = 1024;
char enums[1024];
char *s = enums;
for (int j = 0; j < paramdesc->intdesc.max - paramdesc->intdesc.min; ++j)
{
int len = Common_snprintf(s, lengthremaining, "%s, ", paramdesc->intdesc.valuenames[j]);
if (!len)
{
break;
}
s += len;
lengthremaining -= len;
}
if (lengthremaining)
{
Common_snprintf(s, lengthremaining, "%s", paramdesc->intdesc.valuenames[paramdesc->intdesc.max - paramdesc->intdesc.min]);
}
Common_Draw("%2d: %-15s [%s] (%s)", i, paramdesc->name, enums, paramdesc->intdesc.valuenames[paramdesc->intdesc.defaultval - paramdesc->intdesc.min]);
}
else
{
char *units = paramdesc->label;
Common_Draw("%2d: %-15s [%d, %d] (%d%s)", i, paramdesc->name, paramdesc->intdesc.min, paramdesc->intdesc.max, paramdesc->intdesc.defaultval, units);
}
break;
}
case FMOD_DSP_PARAMETER_TYPE_BOOL:
{
if (paramdesc->booldesc.valuenames)
{
Common_Draw("%2d: %-15s [%s, %s] (%s)", i, paramdesc->name, paramdesc->booldesc.valuenames[0], paramdesc->booldesc.valuenames[1], paramdesc->booldesc.valuenames[paramdesc->booldesc.defaultval ? 1 : 0]);
}
else
{
Common_Draw("%2d: %-15s [On, Off] (%s)", i, paramdesc->name, paramdesc->booldesc.defaultval ? "On" : "Off");
}
break;
}
case FMOD_DSP_PARAMETER_TYPE_DATA:
{
Common_Draw("%2d: %-15s (Data type: %d)", i, paramdesc->name, paramdesc->datadesc.datatype);
break;
}
}
}
}
InspectorState pluginSelectorDo(PluginSelectorState *state)
{
if (Common_BtnDown(BTN_UP))
{
state->cursor = (state->cursor - 1 + state->numplugins) % state->numplugins;
}
if (Common_BtnDown(BTN_DOWN))
{
state->cursor = (state->cursor + 1) % state->numplugins;
}
if (Common_BtnDown(BTN_RIGHT))
{
return PARAMETER_VIEWER;
}
drawTitle();
drawDSPList(state);
return PLUGIN_SELECTOR;
}
InspectorState parameterViewerDo(ParameterViewerState *state)
{
if (Common_BtnDown(BTN_UP))
{
state->scroll = Common_Max(state->scroll - 1, 0);
}
if (Common_BtnDown(BTN_DOWN))
{
state->scroll = Common_Clamp(0, state->scroll + 1, state->numparams - MAX_PARAMETERS_IN_VIEW / 2);
}
if (Common_BtnDown(BTN_LEFT))
{
return PLUGIN_SELECTOR;
}
drawTitle();
drawDSPParameters(state);
return PARAMETER_VIEWER;
}
int FMOD_Main()
{
FMOD::System *system = 0;
FMOD_RESULT result;
unsigned int version;
void *extradriverdata = 0;
unsigned int pluginhandle;
InspectorState state = PLUGIN_SELECTOR;
PluginSelectorState pluginselector = { 0 };
ParameterViewerState parameterviewer = { 0 };
Common_Init(&extradriverdata);
/*
Create a System object and initialize
*/
result = FMOD::System_Create(&system);
ERRCHECK(result);
result = system->getVersion(&version);
ERRCHECK(result);
if (version < FMOD_VERSION)
{
Common_Fatal("FMOD lib version %08x doesn't match header version %08x", version, FMOD_VERSION);
}
result = system->init(32, FMOD_INIT_NORMAL, extradriverdata);
ERRCHECK(result);
result = system->getNumPlugins(FMOD_PLUGINTYPE_DSP, &pluginselector.numplugins);
ERRCHECK(result);
pluginselector.system = system;
do
{
Common_Update();
if (state == PLUGIN_SELECTOR)
{
state = pluginSelectorDo(&pluginselector);
if (state == PARAMETER_VIEWER)
{
result = pluginselector.system->getPluginHandle(FMOD_PLUGINTYPE_DSP, pluginselector.cursor, &pluginhandle);
ERRCHECK(result);
result = pluginselector.system->createDSPByPlugin(pluginhandle, &parameterviewer.dsp);
ERRCHECK(result);
FMOD_RESULT result = parameterviewer.dsp->getNumParameters(&parameterviewer.numparams);
ERRCHECK(result);
parameterviewer.scroll = 0;
}
}
else if (state == PARAMETER_VIEWER)
{
state = parameterViewerDo(&parameterviewer);
if (state == PLUGIN_SELECTOR)
{
result = parameterviewer.dsp->release();
ERRCHECK(result);
parameterviewer.dsp = 0;
}
}
result = system->update();
ERRCHECK(result);
Common_Sleep(INTERFACE_UPDATETIME - 1);
} while (!Common_BtnPress(BTN_QUIT));
if (parameterviewer.dsp)
{
result = parameterviewer.dsp->release();
ERRCHECK(result);
}
result = system->close();
ERRCHECK(result);
result = system->release();
ERRCHECK(result);
Common_Close();
return 0;
}

View file

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gen"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
<classpathentry exported="true" kind="lib" path="fmod.jar"/>
<classpathentry kind="output" path="bin/classes"/>
</classpath>

View file

@ -0,0 +1,54 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
<storageModule moduleId="org.eclipse.cdt.core.settings">
<cconfiguration id="com.android.toolchain.gcc.367937256">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.android.toolchain.gcc.367937256" moduleId="org.eclipse.cdt.core.settings" name="Default">
<externalSettings/>
<extensions>
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.VCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.MakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactName="${ProjName}" buildProperties="" description="" id="com.android.toolchain.gcc.367937256" name="Default" parent="org.eclipse.cdt.build.core.emptycfg">
<folderInfo id="com.android.toolchain.gcc.367937256.1934632123" name="/" resourcePath="">
<toolChain id="com.android.toolchain.gcc.1304477811" name="com.android.toolchain.gcc" superClass="com.android.toolchain.gcc">
<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="com.android.targetPlatform.515624550" isAbstract="false" superClass="com.android.targetPlatform"/>
<builder arguments="NDK_DEBUG=1" command="ndk-build" id="com.android.builder.222443332" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Android Builder" superClass="com.android.builder">
<outputEntries>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="outputPath" name="obj"/>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="outputPath" name="libs"/>
</outputEntries>
</builder>
<tool id="com.android.gcc.compiler.962627632" name="Android GCC Compiler" superClass="com.android.gcc.compiler">
<inputType id="com.android.gcc.inputType.1936354764" superClass="com.android.gcc.inputType"/>
</tool>
</toolChain>
</folderInfo>
<sourceEntries>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="jni"/>
</sourceEntries>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<project id="Example.null.1010603500" name="Example"/>
</storageModule>
<storageModule moduleId="scannerConfiguration">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
<scannerConfigBuildInfo instanceId="com.android.toolchain.gcc.367937256;com.android.toolchain.gcc.367937256.1934632123;com.android.gcc.compiler.962627632;com.android.gcc.inputType.1936354764">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.android.AndroidPerProjectProfile"/>
</scannerConfigBuildInfo>
</storageModule>
<storageModule moduleId="refreshScope" versionNumber="1">
<resource resourceType="PROJECT" workspacePath="/Example"/>
</storageModule>
</cproject>

View file

@ -0,0 +1,139 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>3d</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
<triggers>clean,full,incremental,</triggers>
<arguments>
<dictionary>
<key>?children?</key>
<value>?name?=outputEntries\|?children?=?name?=entry\\\\\\\|\\\|?name?=entry\\\\\\\|\\\|\||</value>
</dictionary>
<dictionary>
<key>?name?</key>
<value></value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.append_environment</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.buildArguments</key>
<value></value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.buildCommand</key>
<value>ndk-build</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
<value>clean</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.contents</key>
<value>org.eclipse.cdt.make.core.activeConfigSettings</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
<value>false</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.enableFullBuild</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.stopOnError</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
<value>true</value>
</dictionary>
</arguments>
</buildCommand>
<buildCommand>
<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.android.ide.eclipse.adt.ApkBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
<triggers>full,incremental,</triggers>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.cdt.core.cnature</nature>
<nature>org.eclipse.cdt.core.ccnature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
</natures>
<linkedResources>
<link>
<name>jni/3d.cpp</name>
<type>1</type>
<locationURI>PARENT-2-PROJECT_LOC/3d.cpp</locationURI>
</link>
<link>
<name>fmod.jar</name>
<type>1</type>
<locationURI>PARENT-4-PROJECT_LOC/lowlevel/lib/fmod.jar</locationURI>
</link>
<link>
<name>assets</name>
<type>2</type>
<locationURI>PARENT-2-PROJECT_LOC/media</locationURI>
</link>
<link>
<name>src/org</name>
<type>2</type>
<locationURI>PARENT-2-PROJECT_LOC/java/org</locationURI>
</link>
<link>
<name>jni/common.cpp</name>
<type>1</type>
<locationURI>PARENT-2-PROJECT_LOC/common.cpp</locationURI>
</link>
<link>
<name>jni/common.h</name>
<type>1</type>
<locationURI>PARENT-2-PROJECT_LOC/common.h</locationURI>
</link>
<link>
<name>jni/common_platform.cpp</name>
<type>1</type>
<locationURI>PARENT-2-PROJECT_LOC/common_platform.cpp</locationURI>
</link>
<link>
<name>jni/common_platform.h</name>
<type>1</type>
<locationURI>PARENT-2-PROJECT_LOC/common_platform.h</locationURI>
</link>
</linkedResources>
</projectDescription>

View file

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.fmod.example"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk
android:minSdkVersion="4"
android:targetSdkVersion="21" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERNET" />
<application
android:icon="@drawable/icon"
android:allowBackup="true"
android:label="FMOD Example">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>

View file

@ -0,0 +1,26 @@
LOCAL_PATH := $(call my-dir)
#
# FMOD Shared Library
#
include $(CLEAR_VARS)
LOCAL_MODULE := fmod
LOCAL_SRC_FILES := ../../../../../lowlevel/lib/$(TARGET_ARCH_ABI)/libfmodL.so
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../../../../../lowlevel/inc
include $(PREBUILT_SHARED_LIBRARY)
#
# Example Library
#
include $(CLEAR_VARS)
LOCAL_MODULE := example
LOCAL_SRC_FILES := ../../../common_platform.cpp \
../../../common.cpp \
../../../3d.cpp
LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../../
LOCAL_SHARED_LIBRARIES := fmod
include $(BUILD_SHARED_LIBRARY)

View file

@ -0,0 +1,3 @@
APP_PLATFORM := android-4
APP_ABI := armeabi armeabi-v7a x86 arm64-v8a
APP_STL := stlport_shared

View file

@ -0,0 +1,2 @@
# Project target.
target=android-21

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

View file

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gen"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
<classpathentry exported="true" kind="lib" path="fmod.jar"/>
<classpathentry kind="output" path="bin/classes"/>
</classpath>

View file

@ -0,0 +1,54 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
<storageModule moduleId="org.eclipse.cdt.core.settings">
<cconfiguration id="com.android.toolchain.gcc.367937256">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.android.toolchain.gcc.367937256" moduleId="org.eclipse.cdt.core.settings" name="Default">
<externalSettings/>
<extensions>
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.VCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.MakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactName="${ProjName}" buildProperties="" description="" id="com.android.toolchain.gcc.367937256" name="Default" parent="org.eclipse.cdt.build.core.emptycfg">
<folderInfo id="com.android.toolchain.gcc.367937256.1934632123" name="/" resourcePath="">
<toolChain id="com.android.toolchain.gcc.1304477811" name="com.android.toolchain.gcc" superClass="com.android.toolchain.gcc">
<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="com.android.targetPlatform.515624550" isAbstract="false" superClass="com.android.targetPlatform"/>
<builder arguments="NDK_DEBUG=1" command="ndk-build" id="com.android.builder.222443332" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Android Builder" superClass="com.android.builder">
<outputEntries>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="outputPath" name="obj"/>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="outputPath" name="libs"/>
</outputEntries>
</builder>
<tool id="com.android.gcc.compiler.962627632" name="Android GCC Compiler" superClass="com.android.gcc.compiler">
<inputType id="com.android.gcc.inputType.1936354764" superClass="com.android.gcc.inputType"/>
</tool>
</toolChain>
</folderInfo>
<sourceEntries>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="jni"/>
</sourceEntries>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<project id="Example.null.1010603500" name="Example"/>
</storageModule>
<storageModule moduleId="scannerConfiguration">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
<scannerConfigBuildInfo instanceId="com.android.toolchain.gcc.367937256;com.android.toolchain.gcc.367937256.1934632123;com.android.gcc.compiler.962627632;com.android.gcc.inputType.1936354764">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.android.AndroidPerProjectProfile"/>
</scannerConfigBuildInfo>
</storageModule>
<storageModule moduleId="refreshScope" versionNumber="1">
<resource resourceType="PROJECT" workspacePath="/Example"/>
</storageModule>
</cproject>

View file

@ -0,0 +1,139 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>channel_groups</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
<triggers>clean,full,incremental,</triggers>
<arguments>
<dictionary>
<key>?children?</key>
<value>?name?=outputEntries\|?children?=?name?=entry\\\\\\\|\\\|?name?=entry\\\\\\\|\\\|\||</value>
</dictionary>
<dictionary>
<key>?name?</key>
<value></value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.append_environment</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.buildArguments</key>
<value></value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.buildCommand</key>
<value>ndk-build</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
<value>clean</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.contents</key>
<value>org.eclipse.cdt.make.core.activeConfigSettings</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
<value>false</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.enableFullBuild</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.stopOnError</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
<value>true</value>
</dictionary>
</arguments>
</buildCommand>
<buildCommand>
<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.android.ide.eclipse.adt.ApkBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
<triggers>full,incremental,</triggers>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.cdt.core.cnature</nature>
<nature>org.eclipse.cdt.core.ccnature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
</natures>
<linkedResources>
<link>
<name>jni/channel_groups.cpp</name>
<type>1</type>
<locationURI>PARENT-2-PROJECT_LOC/channel_groups.cpp</locationURI>
</link>
<link>
<name>fmod.jar</name>
<type>1</type>
<locationURI>PARENT-4-PROJECT_LOC/lowlevel/lib/fmod.jar</locationURI>
</link>
<link>
<name>assets</name>
<type>2</type>
<locationURI>PARENT-2-PROJECT_LOC/media</locationURI>
</link>
<link>
<name>src/org</name>
<type>2</type>
<locationURI>PARENT-2-PROJECT_LOC/java/org</locationURI>
</link>
<link>
<name>jni/common.cpp</name>
<type>1</type>
<locationURI>PARENT-2-PROJECT_LOC/common.cpp</locationURI>
</link>
<link>
<name>jni/common.h</name>
<type>1</type>
<locationURI>PARENT-2-PROJECT_LOC/common.h</locationURI>
</link>
<link>
<name>jni/common_platform.cpp</name>
<type>1</type>
<locationURI>PARENT-2-PROJECT_LOC/common_platform.cpp</locationURI>
</link>
<link>
<name>jni/common_platform.h</name>
<type>1</type>
<locationURI>PARENT-2-PROJECT_LOC/common_platform.h</locationURI>
</link>
</linkedResources>
</projectDescription>

View file

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.fmod.example"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk
android:minSdkVersion="4"
android:targetSdkVersion="21" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERNET" />
<application
android:icon="@drawable/icon"
android:allowBackup="true"
android:label="FMOD Example">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>

View file

@ -0,0 +1,26 @@
LOCAL_PATH := $(call my-dir)
#
# FMOD Shared Library
#
include $(CLEAR_VARS)
LOCAL_MODULE := fmod
LOCAL_SRC_FILES := ../../../../../lowlevel/lib/$(TARGET_ARCH_ABI)/libfmodL.so
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../../../../../lowlevel/inc
include $(PREBUILT_SHARED_LIBRARY)
#
# Example Library
#
include $(CLEAR_VARS)
LOCAL_MODULE := example
LOCAL_SRC_FILES := ../../../common_platform.cpp \
../../../common.cpp \
../../../channel_groups.cpp
LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../../
LOCAL_SHARED_LIBRARIES := fmod
include $(BUILD_SHARED_LIBRARY)

View file

@ -0,0 +1,3 @@
APP_PLATFORM := android-4
APP_ABI := armeabi armeabi-v7a x86 arm64-v8a
APP_STL := stlport_shared

View file

@ -0,0 +1,2 @@
# Project target.
target=android-21

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

View file

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gen"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
<classpathentry exported="true" kind="lib" path="fmod.jar"/>
<classpathentry kind="output" path="bin/classes"/>
</classpath>

View file

@ -0,0 +1,54 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
<storageModule moduleId="org.eclipse.cdt.core.settings">
<cconfiguration id="com.android.toolchain.gcc.367937256">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.android.toolchain.gcc.367937256" moduleId="org.eclipse.cdt.core.settings" name="Default">
<externalSettings/>
<extensions>
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.VCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.MakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactName="${ProjName}" buildProperties="" description="" id="com.android.toolchain.gcc.367937256" name="Default" parent="org.eclipse.cdt.build.core.emptycfg">
<folderInfo id="com.android.toolchain.gcc.367937256.1934632123" name="/" resourcePath="">
<toolChain id="com.android.toolchain.gcc.1304477811" name="com.android.toolchain.gcc" superClass="com.android.toolchain.gcc">
<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="com.android.targetPlatform.515624550" isAbstract="false" superClass="com.android.targetPlatform"/>
<builder arguments="NDK_DEBUG=1" command="ndk-build" id="com.android.builder.222443332" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Android Builder" superClass="com.android.builder">
<outputEntries>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="outputPath" name="obj"/>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="outputPath" name="libs"/>
</outputEntries>
</builder>
<tool id="com.android.gcc.compiler.962627632" name="Android GCC Compiler" superClass="com.android.gcc.compiler">
<inputType id="com.android.gcc.inputType.1936354764" superClass="com.android.gcc.inputType"/>
</tool>
</toolChain>
</folderInfo>
<sourceEntries>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="jni"/>
</sourceEntries>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<project id="Example.null.1010603500" name="Example"/>
</storageModule>
<storageModule moduleId="scannerConfiguration">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
<scannerConfigBuildInfo instanceId="com.android.toolchain.gcc.367937256;com.android.toolchain.gcc.367937256.1934632123;com.android.gcc.compiler.962627632;com.android.gcc.inputType.1936354764">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.android.AndroidPerProjectProfile"/>
</scannerConfigBuildInfo>
</storageModule>
<storageModule moduleId="refreshScope" versionNumber="1">
<resource resourceType="PROJECT" workspacePath="/Example"/>
</storageModule>
</cproject>

View file

@ -0,0 +1,139 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>convolution_reverb</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
<triggers>clean,full,incremental,</triggers>
<arguments>
<dictionary>
<key>?children?</key>
<value>?name?=outputEntries\|?children?=?name?=entry\\\\\\\|\\\|?name?=entry\\\\\\\|\\\|\||</value>
</dictionary>
<dictionary>
<key>?name?</key>
<value></value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.append_environment</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.buildArguments</key>
<value></value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.buildCommand</key>
<value>ndk-build</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
<value>clean</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.contents</key>
<value>org.eclipse.cdt.make.core.activeConfigSettings</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
<value>false</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.enableFullBuild</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.stopOnError</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
<value>true</value>
</dictionary>
</arguments>
</buildCommand>
<buildCommand>
<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.android.ide.eclipse.adt.ApkBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
<triggers>full,incremental,</triggers>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.cdt.core.cnature</nature>
<nature>org.eclipse.cdt.core.ccnature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
</natures>
<linkedResources>
<link>
<name>jni/convolution_reverb.cpp</name>
<type>1</type>
<locationURI>PARENT-2-PROJECT_LOC/convolution_reverb.cpp</locationURI>
</link>
<link>
<name>fmod.jar</name>
<type>1</type>
<locationURI>PARENT-4-PROJECT_LOC/lowlevel/lib/fmod.jar</locationURI>
</link>
<link>
<name>assets</name>
<type>2</type>
<locationURI>PARENT-2-PROJECT_LOC/media</locationURI>
</link>
<link>
<name>src/org</name>
<type>2</type>
<locationURI>PARENT-2-PROJECT_LOC/java/org</locationURI>
</link>
<link>
<name>jni/common.cpp</name>
<type>1</type>
<locationURI>PARENT-2-PROJECT_LOC/common.cpp</locationURI>
</link>
<link>
<name>jni/common.h</name>
<type>1</type>
<locationURI>PARENT-2-PROJECT_LOC/common.h</locationURI>
</link>
<link>
<name>jni/common_platform.cpp</name>
<type>1</type>
<locationURI>PARENT-2-PROJECT_LOC/common_platform.cpp</locationURI>
</link>
<link>
<name>jni/common_platform.h</name>
<type>1</type>
<locationURI>PARENT-2-PROJECT_LOC/common_platform.h</locationURI>
</link>
</linkedResources>
</projectDescription>

View file

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.fmod.example"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk
android:minSdkVersion="4"
android:targetSdkVersion="21" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERNET" />
<application
android:icon="@drawable/icon"
android:allowBackup="true"
android:label="FMOD Example">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>

View file

@ -0,0 +1,26 @@
LOCAL_PATH := $(call my-dir)
#
# FMOD Shared Library
#
include $(CLEAR_VARS)
LOCAL_MODULE := fmod
LOCAL_SRC_FILES := ../../../../../lowlevel/lib/$(TARGET_ARCH_ABI)/libfmodL.so
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../../../../../lowlevel/inc
include $(PREBUILT_SHARED_LIBRARY)
#
# Example Library
#
include $(CLEAR_VARS)
LOCAL_MODULE := example
LOCAL_SRC_FILES := ../../../common_platform.cpp \
../../../common.cpp \
../../../convolution_reverb.cpp
LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../../
LOCAL_SHARED_LIBRARIES := fmod
include $(BUILD_SHARED_LIBRARY)

View file

@ -0,0 +1,3 @@
APP_PLATFORM := android-4
APP_ABI := armeabi armeabi-v7a x86 arm64-v8a
APP_STL := stlport_shared

View file

@ -0,0 +1,2 @@
# Project target.
target=android-21

View file

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gen"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
<classpathentry exported="true" kind="lib" path="fmod.jar"/>
<classpathentry kind="output" path="bin/classes"/>
</classpath>

View file

@ -0,0 +1,54 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
<storageModule moduleId="org.eclipse.cdt.core.settings">
<cconfiguration id="com.android.toolchain.gcc.367937256">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.android.toolchain.gcc.367937256" moduleId="org.eclipse.cdt.core.settings" name="Default">
<externalSettings/>
<extensions>
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.VCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.MakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactName="${ProjName}" buildProperties="" description="" id="com.android.toolchain.gcc.367937256" name="Default" parent="org.eclipse.cdt.build.core.emptycfg">
<folderInfo id="com.android.toolchain.gcc.367937256.1934632123" name="/" resourcePath="">
<toolChain id="com.android.toolchain.gcc.1304477811" name="com.android.toolchain.gcc" superClass="com.android.toolchain.gcc">
<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="com.android.targetPlatform.515624550" isAbstract="false" superClass="com.android.targetPlatform"/>
<builder arguments="NDK_DEBUG=1" command="ndk-build" id="com.android.builder.222443332" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Android Builder" superClass="com.android.builder">
<outputEntries>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="outputPath" name="obj"/>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="outputPath" name="libs"/>
</outputEntries>
</builder>
<tool id="com.android.gcc.compiler.962627632" name="Android GCC Compiler" superClass="com.android.gcc.compiler">
<inputType id="com.android.gcc.inputType.1936354764" superClass="com.android.gcc.inputType"/>
</tool>
</toolChain>
</folderInfo>
<sourceEntries>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="jni"/>
</sourceEntries>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<project id="Example.null.1010603500" name="Example"/>
</storageModule>
<storageModule moduleId="scannerConfiguration">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
<scannerConfigBuildInfo instanceId="com.android.toolchain.gcc.367937256;com.android.toolchain.gcc.367937256.1934632123;com.android.gcc.compiler.962627632;com.android.gcc.inputType.1936354764">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.android.AndroidPerProjectProfile"/>
</scannerConfigBuildInfo>
</storageModule>
<storageModule moduleId="refreshScope" versionNumber="1">
<resource resourceType="PROJECT" workspacePath="/Example"/>
</storageModule>
</cproject>

View file

@ -0,0 +1,139 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>dsp_custom</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
<triggers>clean,full,incremental,</triggers>
<arguments>
<dictionary>
<key>?children?</key>
<value>?name?=outputEntries\|?children?=?name?=entry\\\\\\\|\\\|?name?=entry\\\\\\\|\\\|\||</value>
</dictionary>
<dictionary>
<key>?name?</key>
<value></value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.append_environment</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.buildArguments</key>
<value></value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.buildCommand</key>
<value>ndk-build</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
<value>clean</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.contents</key>
<value>org.eclipse.cdt.make.core.activeConfigSettings</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
<value>false</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.enableFullBuild</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.stopOnError</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
<value>true</value>
</dictionary>
</arguments>
</buildCommand>
<buildCommand>
<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.android.ide.eclipse.adt.ApkBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
<triggers>full,incremental,</triggers>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.cdt.core.cnature</nature>
<nature>org.eclipse.cdt.core.ccnature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
</natures>
<linkedResources>
<link>
<name>jni/dsp_custom.cpp</name>
<type>1</type>
<locationURI>PARENT-2-PROJECT_LOC/dsp_custom.cpp</locationURI>
</link>
<link>
<name>fmod.jar</name>
<type>1</type>
<locationURI>PARENT-4-PROJECT_LOC/lowlevel/lib/fmod.jar</locationURI>
</link>
<link>
<name>assets</name>
<type>2</type>
<locationURI>PARENT-2-PROJECT_LOC/media</locationURI>
</link>
<link>
<name>src/org</name>
<type>2</type>
<locationURI>PARENT-2-PROJECT_LOC/java/org</locationURI>
</link>
<link>
<name>jni/common.cpp</name>
<type>1</type>
<locationURI>PARENT-2-PROJECT_LOC/common.cpp</locationURI>
</link>
<link>
<name>jni/common.h</name>
<type>1</type>
<locationURI>PARENT-2-PROJECT_LOC/common.h</locationURI>
</link>
<link>
<name>jni/common_platform.cpp</name>
<type>1</type>
<locationURI>PARENT-2-PROJECT_LOC/common_platform.cpp</locationURI>
</link>
<link>
<name>jni/common_platform.h</name>
<type>1</type>
<locationURI>PARENT-2-PROJECT_LOC/common_platform.h</locationURI>
</link>
</linkedResources>
</projectDescription>

View file

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.fmod.example"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk
android:minSdkVersion="4"
android:targetSdkVersion="21" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERNET" />
<application
android:icon="@drawable/icon"
android:allowBackup="true"
android:label="FMOD Example">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>

View file

@ -0,0 +1,26 @@
LOCAL_PATH := $(call my-dir)
#
# FMOD Shared Library
#
include $(CLEAR_VARS)
LOCAL_MODULE := fmod
LOCAL_SRC_FILES := ../../../../../lowlevel/lib/$(TARGET_ARCH_ABI)/libfmodL.so
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../../../../../lowlevel/inc
include $(PREBUILT_SHARED_LIBRARY)
#
# Example Library
#
include $(CLEAR_VARS)
LOCAL_MODULE := example
LOCAL_SRC_FILES := ../../../common_platform.cpp \
../../../common.cpp \
../../../dsp_custom.cpp
LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../../
LOCAL_SHARED_LIBRARIES := fmod
include $(BUILD_SHARED_LIBRARY)

View file

@ -0,0 +1,3 @@
APP_PLATFORM := android-4
APP_ABI := armeabi armeabi-v7a x86 arm64-v8a
APP_STL := stlport_shared

View file

@ -0,0 +1,2 @@
# Project target.
target=android-21

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

View file

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gen"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
<classpathentry exported="true" kind="lib" path="fmod.jar"/>
<classpathentry kind="output" path="bin/classes"/>
</classpath>

View file

@ -0,0 +1,54 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
<storageModule moduleId="org.eclipse.cdt.core.settings">
<cconfiguration id="com.android.toolchain.gcc.367937256">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.android.toolchain.gcc.367937256" moduleId="org.eclipse.cdt.core.settings" name="Default">
<externalSettings/>
<extensions>
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.VCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.MakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactName="${ProjName}" buildProperties="" description="" id="com.android.toolchain.gcc.367937256" name="Default" parent="org.eclipse.cdt.build.core.emptycfg">
<folderInfo id="com.android.toolchain.gcc.367937256.1934632123" name="/" resourcePath="">
<toolChain id="com.android.toolchain.gcc.1304477811" name="com.android.toolchain.gcc" superClass="com.android.toolchain.gcc">
<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="com.android.targetPlatform.515624550" isAbstract="false" superClass="com.android.targetPlatform"/>
<builder arguments="NDK_DEBUG=1" command="ndk-build" id="com.android.builder.222443332" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Android Builder" superClass="com.android.builder">
<outputEntries>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="outputPath" name="obj"/>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="outputPath" name="libs"/>
</outputEntries>
</builder>
<tool id="com.android.gcc.compiler.962627632" name="Android GCC Compiler" superClass="com.android.gcc.compiler">
<inputType id="com.android.gcc.inputType.1936354764" superClass="com.android.gcc.inputType"/>
</tool>
</toolChain>
</folderInfo>
<sourceEntries>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="jni"/>
</sourceEntries>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<project id="Example.null.1010603500" name="Example"/>
</storageModule>
<storageModule moduleId="scannerConfiguration">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
<scannerConfigBuildInfo instanceId="com.android.toolchain.gcc.367937256;com.android.toolchain.gcc.367937256.1934632123;com.android.gcc.compiler.962627632;com.android.gcc.inputType.1936354764">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.android.AndroidPerProjectProfile"/>
</scannerConfigBuildInfo>
</storageModule>
<storageModule moduleId="refreshScope" versionNumber="1">
<resource resourceType="PROJECT" workspacePath="/Example"/>
</storageModule>
</cproject>

View file

@ -0,0 +1,139 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>dsp_effect_per_speaker</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
<triggers>clean,full,incremental,</triggers>
<arguments>
<dictionary>
<key>?children?</key>
<value>?name?=outputEntries\|?children?=?name?=entry\\\\\\\|\\\|?name?=entry\\\\\\\|\\\|\||</value>
</dictionary>
<dictionary>
<key>?name?</key>
<value></value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.append_environment</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.buildArguments</key>
<value></value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.buildCommand</key>
<value>ndk-build</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
<value>clean</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.contents</key>
<value>org.eclipse.cdt.make.core.activeConfigSettings</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
<value>false</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.enableFullBuild</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.stopOnError</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
<value>true</value>
</dictionary>
</arguments>
</buildCommand>
<buildCommand>
<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.android.ide.eclipse.adt.ApkBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
<triggers>full,incremental,</triggers>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.cdt.core.cnature</nature>
<nature>org.eclipse.cdt.core.ccnature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
</natures>
<linkedResources>
<link>
<name>jni/dsp_effect_per_speaker.cpp</name>
<type>1</type>
<locationURI>PARENT-2-PROJECT_LOC/dsp_effect_per_speaker.cpp</locationURI>
</link>
<link>
<name>fmod.jar</name>
<type>1</type>
<locationURI>PARENT-4-PROJECT_LOC/lowlevel/lib/fmod.jar</locationURI>
</link>
<link>
<name>assets</name>
<type>2</type>
<locationURI>PARENT-2-PROJECT_LOC/media</locationURI>
</link>
<link>
<name>src/org</name>
<type>2</type>
<locationURI>PARENT-2-PROJECT_LOC/java/org</locationURI>
</link>
<link>
<name>jni/common.cpp</name>
<type>1</type>
<locationURI>PARENT-2-PROJECT_LOC/common.cpp</locationURI>
</link>
<link>
<name>jni/common.h</name>
<type>1</type>
<locationURI>PARENT-2-PROJECT_LOC/common.h</locationURI>
</link>
<link>
<name>jni/common_platform.cpp</name>
<type>1</type>
<locationURI>PARENT-2-PROJECT_LOC/common_platform.cpp</locationURI>
</link>
<link>
<name>jni/common_platform.h</name>
<type>1</type>
<locationURI>PARENT-2-PROJECT_LOC/common_platform.h</locationURI>
</link>
</linkedResources>
</projectDescription>

View file

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.fmod.example"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk
android:minSdkVersion="4"
android:targetSdkVersion="21" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERNET" />
<application
android:icon="@drawable/icon"
android:allowBackup="true"
android:label="FMOD Example">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>

View file

@ -0,0 +1,26 @@
LOCAL_PATH := $(call my-dir)
#
# FMOD Shared Library
#
include $(CLEAR_VARS)
LOCAL_MODULE := fmod
LOCAL_SRC_FILES := ../../../../../lowlevel/lib/$(TARGET_ARCH_ABI)/libfmodL.so
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../../../../../lowlevel/inc
include $(PREBUILT_SHARED_LIBRARY)
#
# Example Library
#
include $(CLEAR_VARS)
LOCAL_MODULE := example
LOCAL_SRC_FILES := ../../../common_platform.cpp \
../../../common.cpp \
../../../dsp_effect_per_speaker.cpp
LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../../
LOCAL_SHARED_LIBRARIES := fmod
include $(BUILD_SHARED_LIBRARY)

View file

@ -0,0 +1,3 @@
APP_PLATFORM := android-4
APP_ABI := armeabi armeabi-v7a x86 arm64-v8a
APP_STL := stlport_shared

View file

@ -0,0 +1,2 @@
# Project target.
target=android-21

View file

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gen"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
<classpathentry exported="true" kind="lib" path="fmod.jar"/>
<classpathentry kind="output" path="bin/classes"/>
</classpath>

View file

@ -0,0 +1,54 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
<storageModule moduleId="org.eclipse.cdt.core.settings">
<cconfiguration id="com.android.toolchain.gcc.367937256">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.android.toolchain.gcc.367937256" moduleId="org.eclipse.cdt.core.settings" name="Default">
<externalSettings/>
<extensions>
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.VCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.MakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactName="${ProjName}" buildProperties="" description="" id="com.android.toolchain.gcc.367937256" name="Default" parent="org.eclipse.cdt.build.core.emptycfg">
<folderInfo id="com.android.toolchain.gcc.367937256.1934632123" name="/" resourcePath="">
<toolChain id="com.android.toolchain.gcc.1304477811" name="com.android.toolchain.gcc" superClass="com.android.toolchain.gcc">
<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="com.android.targetPlatform.515624550" isAbstract="false" superClass="com.android.targetPlatform"/>
<builder arguments="NDK_DEBUG=1" command="ndk-build" id="com.android.builder.222443332" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Android Builder" superClass="com.android.builder">
<outputEntries>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="outputPath" name="obj"/>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="outputPath" name="libs"/>
</outputEntries>
</builder>
<tool id="com.android.gcc.compiler.962627632" name="Android GCC Compiler" superClass="com.android.gcc.compiler">
<inputType id="com.android.gcc.inputType.1936354764" superClass="com.android.gcc.inputType"/>
</tool>
</toolChain>
</folderInfo>
<sourceEntries>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="jni"/>
</sourceEntries>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<project id="Example.null.1010603500" name="Example"/>
</storageModule>
<storageModule moduleId="scannerConfiguration">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
<scannerConfigBuildInfo instanceId="com.android.toolchain.gcc.367937256;com.android.toolchain.gcc.367937256.1934632123;com.android.gcc.compiler.962627632;com.android.gcc.inputType.1936354764">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.android.AndroidPerProjectProfile"/>
</scannerConfigBuildInfo>
</storageModule>
<storageModule moduleId="refreshScope" versionNumber="1">
<resource resourceType="PROJECT" workspacePath="/Example"/>
</storageModule>
</cproject>

View file

@ -0,0 +1,139 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>dsp_inspector</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
<triggers>clean,full,incremental,</triggers>
<arguments>
<dictionary>
<key>?children?</key>
<value>?name?=outputEntries\|?children?=?name?=entry\\\\\\\|\\\|?name?=entry\\\\\\\|\\\|\||</value>
</dictionary>
<dictionary>
<key>?name?</key>
<value></value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.append_environment</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.buildArguments</key>
<value></value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.buildCommand</key>
<value>ndk-build</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
<value>clean</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.contents</key>
<value>org.eclipse.cdt.make.core.activeConfigSettings</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
<value>false</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.enableFullBuild</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.stopOnError</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
<value>true</value>
</dictionary>
</arguments>
</buildCommand>
<buildCommand>
<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.android.ide.eclipse.adt.ApkBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
<triggers>full,incremental,</triggers>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.cdt.core.cnature</nature>
<nature>org.eclipse.cdt.core.ccnature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
</natures>
<linkedResources>
<link>
<name>jni/dsp_inspector.cpp</name>
<type>1</type>
<locationURI>PARENT-2-PROJECT_LOC/dsp_inspector.cpp</locationURI>
</link>
<link>
<name>fmod.jar</name>
<type>1</type>
<locationURI>PARENT-4-PROJECT_LOC/lowlevel/lib/fmod.jar</locationURI>
</link>
<link>
<name>assets</name>
<type>2</type>
<locationURI>PARENT-2-PROJECT_LOC/media</locationURI>
</link>
<link>
<name>src/org</name>
<type>2</type>
<locationURI>PARENT-2-PROJECT_LOC/java/org</locationURI>
</link>
<link>
<name>jni/common.cpp</name>
<type>1</type>
<locationURI>PARENT-2-PROJECT_LOC/common.cpp</locationURI>
</link>
<link>
<name>jni/common.h</name>
<type>1</type>
<locationURI>PARENT-2-PROJECT_LOC/common.h</locationURI>
</link>
<link>
<name>jni/common_platform.cpp</name>
<type>1</type>
<locationURI>PARENT-2-PROJECT_LOC/common_platform.cpp</locationURI>
</link>
<link>
<name>jni/common_platform.h</name>
<type>1</type>
<locationURI>PARENT-2-PROJECT_LOC/common_platform.h</locationURI>
</link>
</linkedResources>
</projectDescription>

View file

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.fmod.example"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk
android:minSdkVersion="4"
android:targetSdkVersion="21" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERNET" />
<application
android:icon="@drawable/icon"
android:allowBackup="true"
android:label="FMOD Example">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>

View file

@ -0,0 +1,26 @@
LOCAL_PATH := $(call my-dir)
#
# FMOD Shared Library
#
include $(CLEAR_VARS)
LOCAL_MODULE := fmod
LOCAL_SRC_FILES := ../../../../../lowlevel/lib/$(TARGET_ARCH_ABI)/libfmodL.so
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../../../../../lowlevel/inc
include $(PREBUILT_SHARED_LIBRARY)
#
# Example Library
#
include $(CLEAR_VARS)
LOCAL_MODULE := example
LOCAL_SRC_FILES := ../../../common_platform.cpp \
../../../common.cpp \
../../../dsp_inspector.cpp
LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../../
LOCAL_SHARED_LIBRARIES := fmod
include $(BUILD_SHARED_LIBRARY)

View file

@ -0,0 +1,3 @@
APP_PLATFORM := android-4
APP_ABI := armeabi armeabi-v7a x86 arm64-v8a
APP_STL := stlport_shared

View file

@ -0,0 +1,2 @@
# Project target.
target=android-21

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

View file

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gen"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
<classpathentry exported="true" kind="lib" path="fmod.jar"/>
<classpathentry kind="output" path="bin/classes"/>
</classpath>

View file

@ -0,0 +1,54 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
<storageModule moduleId="org.eclipse.cdt.core.settings">
<cconfiguration id="com.android.toolchain.gcc.367937256">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.android.toolchain.gcc.367937256" moduleId="org.eclipse.cdt.core.settings" name="Default">
<externalSettings/>
<extensions>
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.VCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.MakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactName="${ProjName}" buildProperties="" description="" id="com.android.toolchain.gcc.367937256" name="Default" parent="org.eclipse.cdt.build.core.emptycfg">
<folderInfo id="com.android.toolchain.gcc.367937256.1934632123" name="/" resourcePath="">
<toolChain id="com.android.toolchain.gcc.1304477811" name="com.android.toolchain.gcc" superClass="com.android.toolchain.gcc">
<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="com.android.targetPlatform.515624550" isAbstract="false" superClass="com.android.targetPlatform"/>
<builder arguments="NDK_DEBUG=1" command="ndk-build" id="com.android.builder.222443332" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Android Builder" superClass="com.android.builder">
<outputEntries>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="outputPath" name="obj"/>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="outputPath" name="libs"/>
</outputEntries>
</builder>
<tool id="com.android.gcc.compiler.962627632" name="Android GCC Compiler" superClass="com.android.gcc.compiler">
<inputType id="com.android.gcc.inputType.1936354764" superClass="com.android.gcc.inputType"/>
</tool>
</toolChain>
</folderInfo>
<sourceEntries>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="jni"/>
</sourceEntries>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<project id="Example.null.1010603500" name="Example"/>
</storageModule>
<storageModule moduleId="scannerConfiguration">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
<scannerConfigBuildInfo instanceId="com.android.toolchain.gcc.367937256;com.android.toolchain.gcc.367937256.1934632123;com.android.gcc.compiler.962627632;com.android.gcc.inputType.1936354764">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.android.AndroidPerProjectProfile"/>
</scannerConfigBuildInfo>
</storageModule>
<storageModule moduleId="refreshScope" versionNumber="1">
<resource resourceType="PROJECT" workspacePath="/Example"/>
</storageModule>
</cproject>

View file

@ -0,0 +1,139 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>effects</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
<triggers>clean,full,incremental,</triggers>
<arguments>
<dictionary>
<key>?children?</key>
<value>?name?=outputEntries\|?children?=?name?=entry\\\\\\\|\\\|?name?=entry\\\\\\\|\\\|\||</value>
</dictionary>
<dictionary>
<key>?name?</key>
<value></value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.append_environment</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.buildArguments</key>
<value></value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.buildCommand</key>
<value>ndk-build</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
<value>clean</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.contents</key>
<value>org.eclipse.cdt.make.core.activeConfigSettings</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
<value>false</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.enableFullBuild</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.stopOnError</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
<value>true</value>
</dictionary>
</arguments>
</buildCommand>
<buildCommand>
<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.android.ide.eclipse.adt.ApkBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
<triggers>full,incremental,</triggers>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.cdt.core.cnature</nature>
<nature>org.eclipse.cdt.core.ccnature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
</natures>
<linkedResources>
<link>
<name>jni/effects.cpp</name>
<type>1</type>
<locationURI>PARENT-2-PROJECT_LOC/effects.cpp</locationURI>
</link>
<link>
<name>fmod.jar</name>
<type>1</type>
<locationURI>PARENT-4-PROJECT_LOC/lowlevel/lib/fmod.jar</locationURI>
</link>
<link>
<name>assets</name>
<type>2</type>
<locationURI>PARENT-2-PROJECT_LOC/media</locationURI>
</link>
<link>
<name>src/org</name>
<type>2</type>
<locationURI>PARENT-2-PROJECT_LOC/java/org</locationURI>
</link>
<link>
<name>jni/common.cpp</name>
<type>1</type>
<locationURI>PARENT-2-PROJECT_LOC/common.cpp</locationURI>
</link>
<link>
<name>jni/common.h</name>
<type>1</type>
<locationURI>PARENT-2-PROJECT_LOC/common.h</locationURI>
</link>
<link>
<name>jni/common_platform.cpp</name>
<type>1</type>
<locationURI>PARENT-2-PROJECT_LOC/common_platform.cpp</locationURI>
</link>
<link>
<name>jni/common_platform.h</name>
<type>1</type>
<locationURI>PARENT-2-PROJECT_LOC/common_platform.h</locationURI>
</link>
</linkedResources>
</projectDescription>

View file

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.fmod.example"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk
android:minSdkVersion="4"
android:targetSdkVersion="21" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERNET" />
<application
android:icon="@drawable/icon"
android:allowBackup="true"
android:label="FMOD Example">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>

View file

@ -0,0 +1,26 @@
LOCAL_PATH := $(call my-dir)
#
# FMOD Shared Library
#
include $(CLEAR_VARS)
LOCAL_MODULE := fmod
LOCAL_SRC_FILES := ../../../../../lowlevel/lib/$(TARGET_ARCH_ABI)/libfmodL.so
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../../../../../lowlevel/inc
include $(PREBUILT_SHARED_LIBRARY)
#
# Example Library
#
include $(CLEAR_VARS)
LOCAL_MODULE := example
LOCAL_SRC_FILES := ../../../common_platform.cpp \
../../../common.cpp \
../../../effects.cpp
LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../../
LOCAL_SHARED_LIBRARIES := fmod
include $(BUILD_SHARED_LIBRARY)

View file

@ -0,0 +1,3 @@
APP_PLATFORM := android-4
APP_ABI := armeabi armeabi-v7a x86 arm64-v8a
APP_STL := stlport_shared

View file

@ -0,0 +1,2 @@
# Project target.
target=android-21

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

View file

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gen"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
<classpathentry exported="true" kind="lib" path="fmod.jar"/>
<classpathentry kind="output" path="bin/classes"/>
</classpath>

Some files were not shown because too many files have changed in this diff Show more