diff --git a/.DS_Store b/.DS_Store
new file mode 100644
index 0000000..04f40f9
Binary files /dev/null and b/.DS_Store differ
diff --git a/.gitignore b/.gitignore
deleted file mode 100644
index 39fb081..0000000
--- a/.gitignore
+++ /dev/null
@@ -1,9 +0,0 @@
-*.iml
-.gradle
-/local.properties
-/.idea/workspace.xml
-/.idea/libraries
-.DS_Store
-/build
-/captures
-.externalNativeBuild
diff --git a/.idea/caches/build_file_checksums.ser b/.idea/caches/build_file_checksums.ser
deleted file mode 100644
index 91e5575..0000000
Binary files a/.idea/caches/build_file_checksums.ser and /dev/null differ
diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml
deleted file mode 100644
index 30aa626..0000000
--- a/.idea/codeStyles/Project.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/gradle.xml b/.idea/gradle.xml
deleted file mode 100644
index 7ac24c7..0000000
--- a/.idea/gradle.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/markdown-navigator/profiles_settings.xml b/.idea/markdown-navigator/profiles_settings.xml
deleted file mode 100644
index 57927c5..0000000
--- a/.idea/markdown-navigator/profiles_settings.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
deleted file mode 100644
index 2cebb57..0000000
--- a/.idea/misc.xml
+++ /dev/null
@@ -1,118 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 1.8
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
deleted file mode 100644
index e0cc4a4..0000000
--- a/.idea/modules.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml
deleted file mode 100644
index 7f68460..0000000
--- a/.idea/runConfigurations.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
deleted file mode 100644
index 94a25f7..0000000
--- a/.idea/vcs.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/README.md b/README.md
index 395104c..2c6cb9b 100644
--- a/README.md
+++ b/README.md
@@ -1,15 +1,75 @@
# 作者简介
-Mr. Zhu ,英文名aserbao! 从事Android开发多年,技术不高,用来工作刚刚好。对视频音视频处理,硬编码这一块有一定的研究。之前北漂,现在深漂。同名微信公众号aserbao的维护者,喜欢看书,摄影,交友,目前生活这样子。
-
+Mr. Zhu ,英文名aserbao! 从事Android开发多年,技术不高,用来工作刚刚好。对视频音视频处理,硬编码这一块有一定的研究。之前北漂,现在深漂。同名微信公众号aserbao的维护者,喜欢看书,摄影,交友,目前生活这样子。欢迎大家关注我的公众号和微信一起学习交流。
+时间宝贵,咨询技术问题有偿哦。
+
+If you have any question about this repo,please prepare money,no free.
+
+# 学习资料
+- [Android 零基础开发相机](https://gitbook.cn/gitchat/activity/5aeb03e3af08a333483d71c1)
+- [Android openGl开发详解(一) - 简单图形的基本绘制](https://www.jianshu.com/p/92d02ac80611)
+- [Android openGl开发详解(二) - 通过SurfaceView,TextureView,GlSurfaceView显示相机预览(附演示)](https://www.jianshu.com/p/db8ecba6037a)
+- [Android 自定义相机开发(三) —— 了解下EGL](https://www.jianshu.com/p/1e82021b10b4)
+
+# 欢迎关注公众号一起学习交流Android技术
+|公众号(aserbao)|
+|--|
+|
# 项目介绍
-项目是有空闲时间就完善,目前所有功能没有全做完,先留个坑!
-有什么问题,可以私聊我!
+项目目前功能有:
+- 分段录制 RecorderActivity
+- 多段视频合成 RecorderActivity
+- 倒计时录制 RecorderActivity
+- 删除回滚 RecorderActivity
+- 添加滤镜 RecorderActivity
+- 视频裁剪 LocalVideoActivity
+- 视频方向横竖屏切换 LocalVideoActivity
+- 视频旋转 LocalVideoActivity
+- 视频帧处理 SelCoverTimeActivity
+- 添加水印 VideoEditActivity
+- 添加动态贴纸 VideoEditActivity
+- 添加动态字幕 VideoEditActivity
+- 文字转视频 PrimaryMediaCodecActivity
+
+## 整体功能点效果图:
+
+
+
+
+
+
+
+
+## 单个功能点:
+单个点主要是包括MediaCodec,AudioRecord,MediaExtractor,MediaMuxer的使用,界面效果如下:
+
+
+
+
+
+
+## 打赏
+开源不易,若有帮助就打赏一下呗,打赏请备注ID。
+
+|微信打赏|支付宝打赏|
+|--|--|
+|||
+
+### 打赏记录
+|备注|金额|
+|--|--|
+|贺利军|66.66¥|
+|小个子|200¥|
+|小Qiao|66.66¥|
+|一路狂奔|20¥|
+|Passerby「路人‘」不欢|66¥|
+|有点小激动|20¥|
+|Orange| 30¥|
+|卡霾哈霾哈|66¥|
+> 说明:大家挣钱不易,如果项目对你有所帮助再打赏。如果有遇到小问题有时间也会免费帮忙解决。
-
-
-
-
+### Star History
+[](https://star-history.com/#aserbao/AndroidCamera&Date)
diff --git a/README_en.md b/README_en.md
new file mode 100644
index 0000000..24214bd
--- /dev/null
+++ b/README_en.md
@@ -0,0 +1,71 @@
+
+# About the author
+Mr. Zhu, English name aserbao! Engaged in Android development for many years, the technology is not high, and it is just right for work. There is a certain amount of research on video audio & video processing, hardcoding. Before Beipiao, now Shenpiao. The maintainer of the WeChat official account aserbao of the same name, likes reading, photography, making friends, and currently lives like this. Welcome to follow my official account and WeChat to learn and communicate together.
+
+Time is precious, and consulting technical issues is paid.
+
+If you have any question about this repo,please prepare money,no free.
+
+# Learning materials
+- [Android Zero Base Development Camera](https://gitbook.cn/gitchat/activity/5aeb03e3af08a333483d71c1)
+- [Android openGl development details (a) - simple graphics basic drawing](https://www.jianshu.com/p/92d02ac80611)
+- [Android openGl development details (2) - through SurfaceView, TextureView, GlSurfaceView display camera preview (with demo) ](https://www.jianshu.com/p/db8ecba6037a)
+- [Android Custom Camera Development (3) - Learn about EGL](https://www.jianshu.com/p/1e82021b10b4)
+
+# Welcome to pay attention to the official account to learn and communicate Android technology together
+|weChat official account(aserbao)
+|--|
+||
+
+# Project Functions Introduction
+The current functions of the project are::
+- Segmented Record RecorderActivity
+- Multi-video synthesis Record RecorderActivity
+- Countdown Record RecorderActivity
+- Remove Rollback Video RecorderActivity
+- Add Filter RecorderActivity
+- Video cutting LocalVideoActivity
+- Video orientation Change LocalVideoActivity
+- Video Rotation LocalVideoActivity
+- Handle Video Frame SelCoverTimeActivity
+- Add watermark for Video VideoEditActivity
+- Add dynamic stickers for Video VideoEditActivity
+- Add dynamic subtitles for Video VideoEditActivity
+- Text to Video PrimaryMediaCodecActivity
+
+## Overall Functional Button Effect Diagram :
+
+
+
+
+
+
+
+
+## Single Functional Button:
+The single point mainly includes the use of MediaCodec, AudioRecord, MediaExtractor, and MediaMuxer. The interface effect is as follows:
+
+
+
+
+
+
+## Tip
+Open source is not easy, if there is help to reward it, reward please note ID.
+
+|WeChat Tipping | Alipay Tipping|
+|--|--|
+|||
+
+### Tipping Record
+| Remarks | Amount |
+|--|--|
+|贺利军|66.66¥|
+|小个子|200¥|
+|小Qiao|66.66¥|
+|一路狂奔|20¥|
+|Passerby「路人‘」不欢|66¥|
+|有点小激动|20¥|
+|Orange| 30¥|
+|卡霾哈霾哈|66¥|
+> Description: It is not easy for everyone to make money. If the project helps you, you will be rewarded.
diff --git a/app/.DS_Store b/app/.DS_Store
new file mode 100644
index 0000000..78dcfbd
Binary files /dev/null and b/app/.DS_Store differ
diff --git a/app/.gitignore b/app/.gitignore
deleted file mode 100644
index 796b96d..0000000
--- a/app/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/build
diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt
new file mode 100644
index 0000000..7df5dbe
--- /dev/null
+++ b/app/CMakeLists.txt
@@ -0,0 +1,61 @@
+# For more information about using CMake with Android Studio, read the
+# documentation: https://d.android.com/studio/projects/add-native-code.html
+
+# Sets the minimum version of CMake required to build the native library.
+
+cmake_minimum_required(VERSION 3.4.1)
+
+# Creates and names a library, sets it as either STATIC
+# or SHARED, and provides the relative paths to its source code.
+# You can define multiple libraries, and CMake builds them for you.
+# Gradle automatically packages shared libraries with your APK.
+
+
+# Searches for a specified prebuilt library and stores the path as a
+# variable. Because CMake includes system libraries in the search path by
+# default, you only need to specify the name of the public NDK library
+# you want to add. CMake verifies that the library exists before
+# completing its build.
+
+find_library( # Sets the name of the path variable.
+ log-lib
+
+ # Specifies the name of the NDK library that
+ # you want CMake to locate.
+ log )
+
+# Specifies libraries CMake should link to your target library. You
+# can link multiple libraries, such as libraries you define in this
+# build script, prebuilt third-party libraries, or system libraries.
+
+set(distribution_DIR ${CMAKE_SOURCE_DIR}/libs)
+
+add_library( fmod
+ SHARED
+ IMPORTED )
+
+set_target_properties( fmod
+ PROPERTIES IMPORTED_LOCATION
+ ${distribution_DIR}/${ANDROID_ABI}/libfmod.so )
+
+add_library( fmodL
+ SHARED
+ IMPORTED )
+
+set_target_properties( fmodL
+ PROPERTIES IMPORTED_LOCATION
+ ${distribution_DIR}/${ANDROID_ABI}/libfmodL.so )
+
+add_library( # Sets the name of the library.
+ sound
+
+ # Sets the library as a shared library.
+ SHARED
+
+ # Provides a relative path to your source file(s).
+ src/main/cpp/sound.cpp)
+
+include_directories(src/main/cpp/inc)
+
+target_link_libraries( sound fmod fmodL
+ ${log-lib} )
diff --git a/app/build.gradle b/app/build.gradle
index 0ff87b4..a156792 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -1,4 +1,6 @@
apply plugin: 'com.android.application'
+apply plugin: 'kotlin-android-extensions'
+apply plugin: 'kotlin-android'
android {
compileSdkVersion 27
buildToolsVersion '27.0.3'
@@ -9,6 +11,13 @@ android {
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
+
+ externalNativeBuild {
+ cmake {
+ cppFlags " "
+ abiFilters 'armeabi-v7a'
+ }
+ }
}
buildTypes {
release {
@@ -16,16 +25,52 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
+
+ sourceSets.main {
+ jniLibs.srcDirs = ['libs']
+ jni.srcDirs = []
+ }
+
+ externalNativeBuild {
+ cmake {
+ path "CMakeLists.txt"
+ }
+ }
+
+ testOptions {
+ unitTests.all {
+ // All the usual Gradle options.
+ jvmArgs '-XX:MaxPermSize=256m'
+ }
+
+ unitTests.returnDefaultValues = true
+ }
}
dependencies {
- implementation fileTree(dir: 'libs', include: ['*.jar'])
+ implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
testImplementation 'junit:junit:4.12'
//=====================================UI
implementation 'com.android.support:recyclerview-v7:27.1.1'
+ implementation 'com.android.support:cardview-v7:27.1.1'
//======================================ButterKnife
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
implementation 'com.jakewharton:butterknife:8.8.1'
+ implementation 'com.github.yangjie10930:EpMedia:v0.9.5'
+ implementation 'pub.devrel:easypermissions:0.3.0'
+ implementation 'com.github.bumptech.glide:glide:3.7.0'
+ implementation 'com.danikula:videocache:2.7.0'
+ //==================mp4parser====================
+ implementation 'com.googlecode.mp4parser:isoparser:1.1.21'
+ implementation files('libs/fmod.jar')
+ implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
+
+
+ testCompile 'junit:junit:4.12'
+ testCompile "org.mockito:mockito-core:1.9.5"
+}
+repositories {
+ mavenCentral()
}
diff --git a/app/libs/armeabi-v7a/libfmod.so b/app/libs/armeabi-v7a/libfmod.so
new file mode 100755
index 0000000..5c96ff1
Binary files /dev/null and b/app/libs/armeabi-v7a/libfmod.so differ
diff --git a/app/libs/armeabi-v7a/libfmodL.so b/app/libs/armeabi-v7a/libfmodL.so
new file mode 100755
index 0000000..280fd24
Binary files /dev/null and b/app/libs/armeabi-v7a/libfmodL.so differ
diff --git a/app/libs/fmod.jar b/app/libs/fmod.jar
new file mode 100755
index 0000000..30eb0e3
Binary files /dev/null and b/app/libs/fmod.jar differ
diff --git a/app/src/androidTest/java/com/aserbao/androidcustomcamera/ExampleInstrumentedTest.java b/app/src/androidTest/java/com/aserbao/androidcustomcamera/ExampleInstrumentedTest.java
deleted file mode 100644
index e02b4a3..0000000
--- a/app/src/androidTest/java/com/aserbao/androidcustomcamera/ExampleInstrumentedTest.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package com.aserbao.androidcustomcamera;
-
-import android.content.Context;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.runner.AndroidJUnit4;
-
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-import static org.junit.Assert.*;
-
-/**
- * Instrumented test, which will execute on an Android device.
- *
- * @see Testing documentation
- */
-@RunWith(AndroidJUnit4.class)
-public class ExampleInstrumentedTest {
- @Test
- public void useAppContext() throws Exception {
- // Context of the app under test.
- Context appContext = InstrumentationRegistry.getTargetContext();
-
- assertEquals("com.aserbao.androidcustomcamera", appContext.getPackageName());
- }
-}
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 783c9b4..cd50b9f 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -1,45 +1,78 @@
+ package="com.aserbao.androidcustomcamera">
-
-
-
+
+
+
+
-
+
-
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/assets/five.mp3 b/app/src/main/assets/five.mp3
new file mode 100644
index 0000000..1535ff2
Binary files /dev/null and b/app/src/main/assets/five.mp3 differ
diff --git a/app/src/main/assets/images/1.gif b/app/src/main/assets/images/1.gif
deleted file mode 100644
index ce43717..0000000
Binary files a/app/src/main/assets/images/1.gif and /dev/null differ
diff --git "a/app/src/main/assets/images/\346\234\254\345\234\260\347\274\226\350\276\221.gif" "b/app/src/main/assets/images/\346\234\254\345\234\260\347\274\226\350\276\221.gif"
deleted file mode 100644
index ae2b999..0000000
Binary files "a/app/src/main/assets/images/\346\234\254\345\234\260\347\274\226\350\276\221.gif" and /dev/null differ
diff --git "a/app/src/main/assets/images/\347\274\226\350\276\2213.gif" "b/app/src/main/assets/images/\347\274\226\350\276\2213.gif"
deleted file mode 100644
index 6105fe1..0000000
Binary files "a/app/src/main/assets/images/\347\274\226\350\276\2213.gif" and /dev/null differ
diff --git "a/app/src/main/assets/images/\351\200\211\345\260\201\351\235\2422.gif" "b/app/src/main/assets/images/\351\200\211\345\260\201\351\235\2422.gif"
deleted file mode 100644
index 5601e62..0000000
Binary files "a/app/src/main/assets/images/\351\200\211\345\260\201\351\235\2422.gif" and /dev/null differ
diff --git a/app/src/main/assets/league_legends.mp3 b/app/src/main/assets/league_legends.mp3
new file mode 100644
index 0000000..96c6f4f
Binary files /dev/null and b/app/src/main/assets/league_legends.mp3 differ
diff --git a/app/src/main/cpp/com_aserbao_androidcustomcamera_utils_VoiceUtils.h b/app/src/main/cpp/com_aserbao_androidcustomcamera_utils_VoiceUtils.h
new file mode 100644
index 0000000..de9b207
--- /dev/null
+++ b/app/src/main/cpp/com_aserbao_androidcustomcamera_utils_VoiceUtils.h
@@ -0,0 +1,34 @@
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include
+/* Header for class com_aserbao_androidcustomcamera_utils_VoiceUtils */
+
+#ifndef _Included_com_aserbao_androidcustomcamera_utils_VoiceUtils
+#define _Included_com_aserbao_androidcustomcamera_utils_VoiceUtils
+#ifdef __cplusplus
+extern "C" {
+#endif
+#undef com_aserbao_androidcustomcamera_utils_VoiceUtils_MODE_NORMAL
+#define com_aserbao_androidcustomcamera_utils_VoiceUtils_MODE_NORMAL 0L
+#undef com_aserbao_androidcustomcamera_utils_VoiceUtils_MODE_LUOLI
+#define com_aserbao_androidcustomcamera_utils_VoiceUtils_MODE_LUOLI 1L
+#undef com_aserbao_androidcustomcamera_utils_VoiceUtils_MODE_DASHU
+#define com_aserbao_androidcustomcamera_utils_VoiceUtils_MODE_DASHU 2L
+#undef com_aserbao_androidcustomcamera_utils_VoiceUtils_MODE_JINGSONG
+#define com_aserbao_androidcustomcamera_utils_VoiceUtils_MODE_JINGSONG 3L
+#undef com_aserbao_androidcustomcamera_utils_VoiceUtils_MODE_GAOGUAI
+#define com_aserbao_androidcustomcamera_utils_VoiceUtils_MODE_GAOGUAI 4L
+#undef com_aserbao_androidcustomcamera_utils_VoiceUtils_MODE_KONGLING
+#define com_aserbao_androidcustomcamera_utils_VoiceUtils_MODE_KONGLING 5L
+
+/*
+ * Class: com_aserbao_androidcustomcamera_utils_VoiceUtils
+ * Method: fix
+ * Signature: (Ljava/lang/String;I)V
+ */
+JNIEXPORT void JNICALL Java_com_aserbao_androidcustomcamera_utils_VoiceUtils_fix
+ (JNIEnv *, jclass, jstring, jint);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/app/src/main/cpp/inc/fmod.h b/app/src/main/cpp/inc/fmod.h
new file mode 100644
index 0000000..f2d5c53
--- /dev/null
+++ b/app/src/main/cpp/inc/fmod.h
@@ -0,0 +1,718 @@
+/*$ preserve start $*/
+
+/* ======================================================================================== */
+/* FMOD Studio Low Level API - C header file. */
+/* Copyright (c), Firelight Technologies Pty, Ltd. 2012-2017. */
+/* */
+/* Use this header in conjunction with fmod_common.h (which contains all the constants / */
+/* callbacks) to develop using C interface. */
+/* ======================================================================================== */
+
+#ifndef _FMOD_H
+#define _FMOD_H
+
+#include "fmod_common.h"
+
+/* ========================================================================================== */
+/* FUNCTION PROTOTYPES */
+/* ========================================================================================== */
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+/*
+ FMOD global system functions (optional).
+*/
+
+FMOD_RESULT F_API FMOD_Memory_Initialize (void *poolmem, int poollen, FMOD_MEMORY_ALLOC_CALLBACK useralloc, FMOD_MEMORY_REALLOC_CALLBACK userrealloc, FMOD_MEMORY_FREE_CALLBACK userfree, FMOD_MEMORY_TYPE memtypeflags);
+FMOD_RESULT F_API FMOD_Memory_GetStats (int *currentalloced, int *maxalloced, FMOD_BOOL blocking);
+FMOD_RESULT F_API FMOD_Debug_Initialize (FMOD_DEBUG_FLAGS flags, FMOD_DEBUG_MODE mode, FMOD_DEBUG_CALLBACK callback, const char *filename);
+FMOD_RESULT F_API FMOD_File_SetDiskBusy (int busy);
+FMOD_RESULT F_API FMOD_File_GetDiskBusy (int *busy);
+
+/*
+ FMOD System factory functions. Use this to create an FMOD System Instance. below you will see FMOD_System_Init/Close to get started.
+*/
+
+FMOD_RESULT F_API FMOD_System_Create (FMOD_SYSTEM **system);
+FMOD_RESULT F_API FMOD_System_Release (FMOD_SYSTEM *system);
+
+/*$ preserve end $*/
+
+/*
+ 'System' API
+*/
+
+/*
+ Setup functions.
+*/
+
+FMOD_RESULT F_API FMOD_System_SetOutput (FMOD_SYSTEM *system, FMOD_OUTPUTTYPE output);
+FMOD_RESULT F_API FMOD_System_GetOutput (FMOD_SYSTEM *system, FMOD_OUTPUTTYPE *output);
+FMOD_RESULT F_API FMOD_System_GetNumDrivers (FMOD_SYSTEM *system, int *numdrivers);
+FMOD_RESULT F_API FMOD_System_GetDriverInfo (FMOD_SYSTEM *system, int id, char *name, int namelen, FMOD_GUID *guid, int *systemrate, FMOD_SPEAKERMODE *speakermode, int *speakermodechannels);
+FMOD_RESULT F_API FMOD_System_SetDriver (FMOD_SYSTEM *system, int driver);
+FMOD_RESULT F_API FMOD_System_GetDriver (FMOD_SYSTEM *system, int *driver);
+FMOD_RESULT F_API FMOD_System_SetSoftwareChannels (FMOD_SYSTEM *system, int numsoftwarechannels);
+FMOD_RESULT F_API FMOD_System_GetSoftwareChannels (FMOD_SYSTEM *system, int *numsoftwarechannels);
+FMOD_RESULT F_API FMOD_System_SetSoftwareFormat (FMOD_SYSTEM *system, int samplerate, FMOD_SPEAKERMODE speakermode, int numrawspeakers);
+FMOD_RESULT F_API FMOD_System_GetSoftwareFormat (FMOD_SYSTEM *system, int *samplerate, FMOD_SPEAKERMODE *speakermode, int *numrawspeakers);
+FMOD_RESULT F_API FMOD_System_SetDSPBufferSize (FMOD_SYSTEM *system, unsigned int bufferlength, int numbuffers);
+FMOD_RESULT F_API FMOD_System_GetDSPBufferSize (FMOD_SYSTEM *system, unsigned int *bufferlength, int *numbuffers);
+FMOD_RESULT F_API FMOD_System_SetFileSystem (FMOD_SYSTEM *system, FMOD_FILE_OPEN_CALLBACK useropen, FMOD_FILE_CLOSE_CALLBACK userclose, FMOD_FILE_READ_CALLBACK userread, FMOD_FILE_SEEK_CALLBACK userseek, FMOD_FILE_ASYNCREAD_CALLBACK userasyncread, FMOD_FILE_ASYNCCANCEL_CALLBACK userasynccancel, int blockalign);
+FMOD_RESULT F_API FMOD_System_AttachFileSystem (FMOD_SYSTEM *system, FMOD_FILE_OPEN_CALLBACK useropen, FMOD_FILE_CLOSE_CALLBACK userclose, FMOD_FILE_READ_CALLBACK userread, FMOD_FILE_SEEK_CALLBACK userseek);
+FMOD_RESULT F_API FMOD_System_SetAdvancedSettings (FMOD_SYSTEM *system, FMOD_ADVANCEDSETTINGS *settings);
+FMOD_RESULT F_API FMOD_System_GetAdvancedSettings (FMOD_SYSTEM *system, FMOD_ADVANCEDSETTINGS *settings);
+FMOD_RESULT F_API FMOD_System_SetCallback (FMOD_SYSTEM *system, FMOD_SYSTEM_CALLBACK callback, FMOD_SYSTEM_CALLBACK_TYPE callbackmask);
+
+/*
+ Plug-in support.
+*/
+
+FMOD_RESULT F_API FMOD_System_SetPluginPath (FMOD_SYSTEM *system, const char *path);
+FMOD_RESULT F_API FMOD_System_LoadPlugin (FMOD_SYSTEM *system, const char *filename, unsigned int *handle, unsigned int priority);
+FMOD_RESULT F_API FMOD_System_UnloadPlugin (FMOD_SYSTEM *system, unsigned int handle);
+FMOD_RESULT F_API FMOD_System_GetNumNestedPlugins (FMOD_SYSTEM *system, unsigned int handle, int *count);
+FMOD_RESULT F_API FMOD_System_GetNestedPlugin (FMOD_SYSTEM *system, unsigned int handle, int index, unsigned int *nestedhandle);
+FMOD_RESULT F_API FMOD_System_GetNumPlugins (FMOD_SYSTEM *system, FMOD_PLUGINTYPE plugintype, int *numplugins);
+FMOD_RESULT F_API FMOD_System_GetPluginHandle (FMOD_SYSTEM *system, FMOD_PLUGINTYPE plugintype, int index, unsigned int *handle);
+FMOD_RESULT F_API FMOD_System_GetPluginInfo (FMOD_SYSTEM *system, unsigned int handle, FMOD_PLUGINTYPE *plugintype, char *name, int namelen, unsigned int *version);
+FMOD_RESULT F_API FMOD_System_SetOutputByPlugin (FMOD_SYSTEM *system, unsigned int handle);
+FMOD_RESULT F_API FMOD_System_GetOutputByPlugin (FMOD_SYSTEM *system, unsigned int *handle);
+FMOD_RESULT F_API FMOD_System_CreateDSPByPlugin (FMOD_SYSTEM *system, unsigned int handle, FMOD_DSP **dsp);
+FMOD_RESULT F_API FMOD_System_GetDSPInfoByPlugin (FMOD_SYSTEM *system, unsigned int handle, const FMOD_DSP_DESCRIPTION **description);
+FMOD_RESULT F_API FMOD_System_RegisterCodec (FMOD_SYSTEM *system, FMOD_CODEC_DESCRIPTION *description, unsigned int *handle, unsigned int priority);
+FMOD_RESULT F_API FMOD_System_RegisterDSP (FMOD_SYSTEM *system, const FMOD_DSP_DESCRIPTION *description, unsigned int *handle);
+FMOD_RESULT F_API FMOD_System_RegisterOutput (FMOD_SYSTEM *system, const FMOD_OUTPUT_DESCRIPTION *description, unsigned int *handle);
+
+/*
+ Init/Close.
+*/
+
+FMOD_RESULT F_API FMOD_System_Init (FMOD_SYSTEM *system, int maxchannels, FMOD_INITFLAGS flags, void *extradriverdata);
+FMOD_RESULT F_API FMOD_System_Close (FMOD_SYSTEM *system);
+
+/*
+ General post-init system functions.
+*/
+
+FMOD_RESULT F_API FMOD_System_Update (FMOD_SYSTEM *system);
+
+FMOD_RESULT F_API FMOD_System_SetSpeakerPosition (FMOD_SYSTEM *system, FMOD_SPEAKER speaker, float x, float y, FMOD_BOOL active);
+FMOD_RESULT F_API FMOD_System_GetSpeakerPosition (FMOD_SYSTEM *system, FMOD_SPEAKER speaker, float *x, float *y, FMOD_BOOL *active);
+FMOD_RESULT F_API FMOD_System_SetStreamBufferSize (FMOD_SYSTEM *system, unsigned int filebuffersize, FMOD_TIMEUNIT filebuffersizetype);
+FMOD_RESULT F_API FMOD_System_GetStreamBufferSize (FMOD_SYSTEM *system, unsigned int *filebuffersize, FMOD_TIMEUNIT *filebuffersizetype);
+FMOD_RESULT F_API FMOD_System_Set3DSettings (FMOD_SYSTEM *system, float dopplerscale, float distancefactor, float rolloffscale);
+FMOD_RESULT F_API FMOD_System_Get3DSettings (FMOD_SYSTEM *system, float *dopplerscale, float *distancefactor, float *rolloffscale);
+FMOD_RESULT F_API FMOD_System_Set3DNumListeners (FMOD_SYSTEM *system, int numlisteners);
+FMOD_RESULT F_API FMOD_System_Get3DNumListeners (FMOD_SYSTEM *system, int *numlisteners);
+FMOD_RESULT F_API FMOD_System_Set3DListenerAttributes (FMOD_SYSTEM *system, int listener, const FMOD_VECTOR *pos, const FMOD_VECTOR *vel, const FMOD_VECTOR *forward, const FMOD_VECTOR *up);
+FMOD_RESULT F_API FMOD_System_Get3DListenerAttributes (FMOD_SYSTEM *system, int listener, FMOD_VECTOR *pos, FMOD_VECTOR *vel, FMOD_VECTOR *forward, FMOD_VECTOR *up);
+FMOD_RESULT F_API FMOD_System_Set3DRolloffCallback (FMOD_SYSTEM *system, FMOD_3D_ROLLOFF_CALLBACK callback);
+FMOD_RESULT F_API FMOD_System_MixerSuspend (FMOD_SYSTEM *system);
+FMOD_RESULT F_API FMOD_System_MixerResume (FMOD_SYSTEM *system);
+FMOD_RESULT F_API FMOD_System_GetDefaultMixMatrix (FMOD_SYSTEM *system, FMOD_SPEAKERMODE sourcespeakermode, FMOD_SPEAKERMODE targetspeakermode, float *matrix, int matrixhop);
+FMOD_RESULT F_API FMOD_System_GetSpeakerModeChannels (FMOD_SYSTEM *system, FMOD_SPEAKERMODE mode, int *channels);
+
+/*
+ System information functions.
+*/
+
+FMOD_RESULT F_API FMOD_System_GetVersion (FMOD_SYSTEM *system, unsigned int *version);
+FMOD_RESULT F_API FMOD_System_GetOutputHandle (FMOD_SYSTEM *system, void **handle);
+FMOD_RESULT F_API FMOD_System_GetChannelsPlaying (FMOD_SYSTEM *system, int *channels, int *realchannels);
+FMOD_RESULT F_API FMOD_System_GetCPUUsage (FMOD_SYSTEM *system, float *dsp, float *stream, float *geometry, float *update, float *total);
+FMOD_RESULT F_API FMOD_System_GetFileUsage (FMOD_SYSTEM *system, long long *sampleBytesRead, long long *streamBytesRead, long long *otherBytesRead);
+FMOD_RESULT F_API FMOD_System_GetSoundRAM (FMOD_SYSTEM *system, int *currentalloced, int *maxalloced, int *total);
+
+/*
+ Sound/DSP/Channel/FX creation and retrieval.
+*/
+
+FMOD_RESULT F_API FMOD_System_CreateSound (FMOD_SYSTEM *system, const char *name_or_data, FMOD_MODE mode, FMOD_CREATESOUNDEXINFO *exinfo, FMOD_SOUND **sound);
+FMOD_RESULT F_API FMOD_System_CreateStream (FMOD_SYSTEM *system, const char *name_or_data, FMOD_MODE mode, FMOD_CREATESOUNDEXINFO *exinfo, FMOD_SOUND **sound);
+FMOD_RESULT F_API FMOD_System_CreateDSP (FMOD_SYSTEM *system, const FMOD_DSP_DESCRIPTION *description, FMOD_DSP **dsp);
+FMOD_RESULT F_API FMOD_System_CreateDSPByType (FMOD_SYSTEM *system, FMOD_DSP_TYPE type, FMOD_DSP **dsp);
+FMOD_RESULT F_API FMOD_System_CreateChannelGroup (FMOD_SYSTEM *system, const char *name, FMOD_CHANNELGROUP **channelgroup);
+FMOD_RESULT F_API FMOD_System_CreateSoundGroup (FMOD_SYSTEM *system, const char *name, FMOD_SOUNDGROUP **soundgroup);
+FMOD_RESULT F_API FMOD_System_CreateReverb3D (FMOD_SYSTEM *system, FMOD_REVERB3D **reverb);
+
+FMOD_RESULT F_API FMOD_System_PlaySound (FMOD_SYSTEM *system, FMOD_SOUND *sound, FMOD_CHANNELGROUP *channelgroup, FMOD_BOOL paused, FMOD_CHANNEL **channel);
+FMOD_RESULT F_API FMOD_System_PlayDSP (FMOD_SYSTEM *system, FMOD_DSP *dsp, FMOD_CHANNELGROUP *channelgroup, FMOD_BOOL paused, FMOD_CHANNEL **channel);
+FMOD_RESULT F_API FMOD_System_GetChannel (FMOD_SYSTEM *system, int channelid, FMOD_CHANNEL **channel);
+FMOD_RESULT F_API FMOD_System_GetMasterChannelGroup (FMOD_SYSTEM *system, FMOD_CHANNELGROUP **channelgroup);
+FMOD_RESULT F_API FMOD_System_GetMasterSoundGroup (FMOD_SYSTEM *system, FMOD_SOUNDGROUP **soundgroup);
+
+/*
+ Routing to ports.
+*/
+
+FMOD_RESULT F_API FMOD_System_AttachChannelGroupToPort (FMOD_SYSTEM *system, FMOD_PORT_TYPE portType, FMOD_PORT_INDEX portIndex, FMOD_CHANNELGROUP *channelgroup, FMOD_BOOL passThru);
+FMOD_RESULT F_API FMOD_System_DetachChannelGroupFromPort(FMOD_SYSTEM *system, FMOD_CHANNELGROUP *channelgroup);
+
+/*
+ Reverb API.
+*/
+
+FMOD_RESULT F_API FMOD_System_SetReverbProperties (FMOD_SYSTEM *system, int instance, const FMOD_REVERB_PROPERTIES *prop);
+FMOD_RESULT F_API FMOD_System_GetReverbProperties (FMOD_SYSTEM *system, int instance, FMOD_REVERB_PROPERTIES *prop);
+
+/*
+ System level DSP functionality.
+*/
+
+FMOD_RESULT F_API FMOD_System_LockDSP (FMOD_SYSTEM *system);
+FMOD_RESULT F_API FMOD_System_UnlockDSP (FMOD_SYSTEM *system);
+
+/*
+ Recording API.
+*/
+
+FMOD_RESULT F_API FMOD_System_GetRecordNumDrivers (FMOD_SYSTEM *system, int *numdrivers, int *numconnected);
+FMOD_RESULT F_API FMOD_System_GetRecordDriverInfo (FMOD_SYSTEM *system, int id, char *name, int namelen, FMOD_GUID *guid, int *systemrate, FMOD_SPEAKERMODE *speakermode, int *speakermodechannels, FMOD_DRIVER_STATE *state);
+FMOD_RESULT F_API FMOD_System_GetRecordPosition (FMOD_SYSTEM *system, int id, unsigned int *position);
+FMOD_RESULT F_API FMOD_System_RecordStart (FMOD_SYSTEM *system, int id, FMOD_SOUND *sound, FMOD_BOOL loop);
+FMOD_RESULT F_API FMOD_System_RecordStop (FMOD_SYSTEM *system, int id);
+FMOD_RESULT F_API FMOD_System_IsRecording (FMOD_SYSTEM *system, int id, FMOD_BOOL *recording);
+
+/*
+ Geometry API.
+*/
+
+FMOD_RESULT F_API FMOD_System_CreateGeometry (FMOD_SYSTEM *system, int maxpolygons, int maxvertices, FMOD_GEOMETRY **geometry);
+FMOD_RESULT F_API FMOD_System_SetGeometrySettings (FMOD_SYSTEM *system, float maxworldsize);
+FMOD_RESULT F_API FMOD_System_GetGeometrySettings (FMOD_SYSTEM *system, float *maxworldsize);
+FMOD_RESULT F_API FMOD_System_LoadGeometry (FMOD_SYSTEM *system, const void *data, int datasize, FMOD_GEOMETRY **geometry);
+FMOD_RESULT F_API FMOD_System_GetGeometryOcclusion (FMOD_SYSTEM *system, const FMOD_VECTOR *listener, const FMOD_VECTOR *source, float *direct, float *reverb);
+
+/*
+ Network functions.
+*/
+
+FMOD_RESULT F_API FMOD_System_SetNetworkProxy (FMOD_SYSTEM *system, const char *proxy);
+FMOD_RESULT F_API FMOD_System_GetNetworkProxy (FMOD_SYSTEM *system, char *proxy, int proxylen);
+FMOD_RESULT F_API FMOD_System_SetNetworkTimeout (FMOD_SYSTEM *system, int timeout);
+FMOD_RESULT F_API FMOD_System_GetNetworkTimeout (FMOD_SYSTEM *system, int *timeout);
+
+/*
+ Userdata set/get.
+*/
+
+FMOD_RESULT F_API FMOD_System_SetUserData (FMOD_SYSTEM *system, void *userdata);
+FMOD_RESULT F_API FMOD_System_GetUserData (FMOD_SYSTEM *system, void **userdata);
+
+/*
+ 'Sound' API
+*/
+
+FMOD_RESULT F_API FMOD_Sound_Release (FMOD_SOUND *sound);
+FMOD_RESULT F_API FMOD_Sound_GetSystemObject (FMOD_SOUND *sound, FMOD_SYSTEM **system);
+
+/*
+ Standard sound manipulation functions.
+*/
+
+FMOD_RESULT F_API FMOD_Sound_Lock (FMOD_SOUND *sound, unsigned int offset, unsigned int length, void **ptr1, void **ptr2, unsigned int *len1, unsigned int *len2);
+FMOD_RESULT F_API FMOD_Sound_Unlock (FMOD_SOUND *sound, void *ptr1, void *ptr2, unsigned int len1, unsigned int len2);
+FMOD_RESULT F_API FMOD_Sound_SetDefaults (FMOD_SOUND *sound, float frequency, int priority);
+FMOD_RESULT F_API FMOD_Sound_GetDefaults (FMOD_SOUND *sound, float *frequency, int *priority);
+FMOD_RESULT F_API FMOD_Sound_Set3DMinMaxDistance (FMOD_SOUND *sound, float min, float max);
+FMOD_RESULT F_API FMOD_Sound_Get3DMinMaxDistance (FMOD_SOUND *sound, float *min, float *max);
+FMOD_RESULT F_API FMOD_Sound_Set3DConeSettings (FMOD_SOUND *sound, float insideconeangle, float outsideconeangle, float outsidevolume);
+FMOD_RESULT F_API FMOD_Sound_Get3DConeSettings (FMOD_SOUND *sound, float *insideconeangle, float *outsideconeangle, float *outsidevolume);
+FMOD_RESULT F_API FMOD_Sound_Set3DCustomRolloff (FMOD_SOUND *sound, FMOD_VECTOR *points, int numpoints);
+FMOD_RESULT F_API FMOD_Sound_Get3DCustomRolloff (FMOD_SOUND *sound, FMOD_VECTOR **points, int *numpoints);
+FMOD_RESULT F_API FMOD_Sound_GetSubSound (FMOD_SOUND *sound, int index, FMOD_SOUND **subsound);
+FMOD_RESULT F_API FMOD_Sound_GetSubSoundParent (FMOD_SOUND *sound, FMOD_SOUND **parentsound);
+FMOD_RESULT F_API FMOD_Sound_GetName (FMOD_SOUND *sound, char *name, int namelen);
+FMOD_RESULT F_API FMOD_Sound_GetLength (FMOD_SOUND *sound, unsigned int *length, FMOD_TIMEUNIT lengthtype);
+FMOD_RESULT F_API FMOD_Sound_GetFormat (FMOD_SOUND *sound, FMOD_SOUND_TYPE *type, FMOD_SOUND_FORMAT *format, int *channels, int *bits);
+FMOD_RESULT F_API FMOD_Sound_GetNumSubSounds (FMOD_SOUND *sound, int *numsubsounds);
+FMOD_RESULT F_API FMOD_Sound_GetNumTags (FMOD_SOUND *sound, int *numtags, int *numtagsupdated);
+FMOD_RESULT F_API FMOD_Sound_GetTag (FMOD_SOUND *sound, const char *name, int index, FMOD_TAG *tag);
+FMOD_RESULT F_API FMOD_Sound_GetOpenState (FMOD_SOUND *sound, FMOD_OPENSTATE *openstate, unsigned int *percentbuffered, FMOD_BOOL *starving, FMOD_BOOL *diskbusy);
+FMOD_RESULT F_API FMOD_Sound_ReadData (FMOD_SOUND *sound, void *buffer, unsigned int length, unsigned int *read);
+FMOD_RESULT F_API FMOD_Sound_SeekData (FMOD_SOUND *sound, unsigned int pcm);
+
+FMOD_RESULT F_API FMOD_Sound_SetSoundGroup (FMOD_SOUND *sound, FMOD_SOUNDGROUP *soundgroup);
+FMOD_RESULT F_API FMOD_Sound_GetSoundGroup (FMOD_SOUND *sound, FMOD_SOUNDGROUP **soundgroup);
+
+/*
+ Synchronization point API. These points can come from markers embedded in wav files, and can also generate channel callbacks.
+*/
+
+FMOD_RESULT F_API FMOD_Sound_GetNumSyncPoints (FMOD_SOUND *sound, int *numsyncpoints);
+FMOD_RESULT F_API FMOD_Sound_GetSyncPoint (FMOD_SOUND *sound, int index, FMOD_SYNCPOINT **point);
+FMOD_RESULT F_API FMOD_Sound_GetSyncPointInfo (FMOD_SOUND *sound, FMOD_SYNCPOINT *point, char *name, int namelen, unsigned int *offset, FMOD_TIMEUNIT offsettype);
+FMOD_RESULT F_API FMOD_Sound_AddSyncPoint (FMOD_SOUND *sound, unsigned int offset, FMOD_TIMEUNIT offsettype, const char *name, FMOD_SYNCPOINT **point);
+FMOD_RESULT F_API FMOD_Sound_DeleteSyncPoint (FMOD_SOUND *sound, FMOD_SYNCPOINT *point);
+
+/*
+ Functions also in Channel class but here they are the 'default' to save having to change it in Channel all the time.
+*/
+
+FMOD_RESULT F_API FMOD_Sound_SetMode (FMOD_SOUND *sound, FMOD_MODE mode);
+FMOD_RESULT F_API FMOD_Sound_GetMode (FMOD_SOUND *sound, FMOD_MODE *mode);
+FMOD_RESULT F_API FMOD_Sound_SetLoopCount (FMOD_SOUND *sound, int loopcount);
+FMOD_RESULT F_API FMOD_Sound_GetLoopCount (FMOD_SOUND *sound, int *loopcount);
+FMOD_RESULT F_API FMOD_Sound_SetLoopPoints (FMOD_SOUND *sound, unsigned int loopstart, FMOD_TIMEUNIT loopstarttype, unsigned int loopend, FMOD_TIMEUNIT loopendtype);
+FMOD_RESULT F_API FMOD_Sound_GetLoopPoints (FMOD_SOUND *sound, unsigned int *loopstart, FMOD_TIMEUNIT loopstarttype, unsigned int *loopend, FMOD_TIMEUNIT loopendtype);
+
+/*
+ For MOD/S3M/XM/IT/MID sequenced formats only.
+*/
+
+FMOD_RESULT F_API FMOD_Sound_GetMusicNumChannels (FMOD_SOUND *sound, int *numchannels);
+FMOD_RESULT F_API FMOD_Sound_SetMusicChannelVolume (FMOD_SOUND *sound, int channel, float volume);
+FMOD_RESULT F_API FMOD_Sound_GetMusicChannelVolume (FMOD_SOUND *sound, int channel, float *volume);
+FMOD_RESULT F_API FMOD_Sound_SetMusicSpeed (FMOD_SOUND *sound, float speed);
+FMOD_RESULT F_API FMOD_Sound_GetMusicSpeed (FMOD_SOUND *sound, float *speed);
+
+/*
+ Userdata set/get.
+*/
+
+FMOD_RESULT F_API FMOD_Sound_SetUserData (FMOD_SOUND *sound, void *userdata);
+FMOD_RESULT F_API FMOD_Sound_GetUserData (FMOD_SOUND *sound, void **userdata);
+
+/*
+ 'Channel' API
+*/
+
+FMOD_RESULT F_API FMOD_Channel_GetSystemObject (FMOD_CHANNEL *channel, FMOD_SYSTEM **system);
+
+/*
+ General control functionality for Channels and ChannelGroups.
+*/
+
+FMOD_RESULT F_API FMOD_Channel_Stop (FMOD_CHANNEL *channel);
+FMOD_RESULT F_API FMOD_Channel_SetPaused (FMOD_CHANNEL *channel, FMOD_BOOL paused);
+FMOD_RESULT F_API FMOD_Channel_GetPaused (FMOD_CHANNEL *channel, FMOD_BOOL *paused);
+FMOD_RESULT F_API FMOD_Channel_SetVolume (FMOD_CHANNEL *channel, float volume);
+FMOD_RESULT F_API FMOD_Channel_GetVolume (FMOD_CHANNEL *channel, float *volume);
+FMOD_RESULT F_API FMOD_Channel_SetVolumeRamp (FMOD_CHANNEL *channel, FMOD_BOOL ramp);
+FMOD_RESULT F_API FMOD_Channel_GetVolumeRamp (FMOD_CHANNEL *channel, FMOD_BOOL *ramp);
+FMOD_RESULT F_API FMOD_Channel_GetAudibility (FMOD_CHANNEL *channel, float *audibility);
+FMOD_RESULT F_API FMOD_Channel_SetPitch (FMOD_CHANNEL *channel, float pitch);
+FMOD_RESULT F_API FMOD_Channel_GetPitch (FMOD_CHANNEL *channel, float *pitch);
+FMOD_RESULT F_API FMOD_Channel_SetMute (FMOD_CHANNEL *channel, FMOD_BOOL mute);
+FMOD_RESULT F_API FMOD_Channel_GetMute (FMOD_CHANNEL *channel, FMOD_BOOL *mute);
+FMOD_RESULT F_API FMOD_Channel_SetReverbProperties (FMOD_CHANNEL *channel, int instance, float wet);
+FMOD_RESULT F_API FMOD_Channel_GetReverbProperties (FMOD_CHANNEL *channel, int instance, float *wet);
+FMOD_RESULT F_API FMOD_Channel_SetLowPassGain (FMOD_CHANNEL *channel, float gain);
+FMOD_RESULT F_API FMOD_Channel_GetLowPassGain (FMOD_CHANNEL *channel, float *gain);
+FMOD_RESULT F_API FMOD_Channel_SetMode (FMOD_CHANNEL *channel, FMOD_MODE mode);
+FMOD_RESULT F_API FMOD_Channel_GetMode (FMOD_CHANNEL *channel, FMOD_MODE *mode);
+FMOD_RESULT F_API FMOD_Channel_SetCallback (FMOD_CHANNEL *channel, FMOD_CHANNELCONTROL_CALLBACK callback);
+FMOD_RESULT F_API FMOD_Channel_IsPlaying (FMOD_CHANNEL *channel, FMOD_BOOL *isplaying);
+
+/*
+ Note all 'set' functions alter a final matrix, this is why the only get function is getMixMatrix, to avoid other get functions returning incorrect/obsolete values.
+*/
+
+FMOD_RESULT F_API FMOD_Channel_SetPan (FMOD_CHANNEL *channel, float pan);
+FMOD_RESULT F_API FMOD_Channel_SetMixLevelsOutput (FMOD_CHANNEL *channel, float frontleft, float frontright, float center, float lfe, float surroundleft, float surroundright, float backleft, float backright);
+FMOD_RESULT F_API FMOD_Channel_SetMixLevelsInput (FMOD_CHANNEL *channel, float *levels, int numlevels);
+FMOD_RESULT F_API FMOD_Channel_SetMixMatrix (FMOD_CHANNEL *channel, float *matrix, int outchannels, int inchannels, int inchannel_hop);
+FMOD_RESULT F_API FMOD_Channel_GetMixMatrix (FMOD_CHANNEL *channel, float *matrix, int *outchannels, int *inchannels, int inchannel_hop);
+
+/*
+ Clock based functionality.
+*/
+
+FMOD_RESULT F_API FMOD_Channel_GetDSPClock (FMOD_CHANNEL *channel, unsigned long long *dspclock, unsigned long long *parentclock);
+FMOD_RESULT F_API FMOD_Channel_SetDelay (FMOD_CHANNEL *channel, unsigned long long dspclock_start, unsigned long long dspclock_end, FMOD_BOOL stopchannels);
+FMOD_RESULT F_API FMOD_Channel_GetDelay (FMOD_CHANNEL *channel, unsigned long long *dspclock_start, unsigned long long *dspclock_end, FMOD_BOOL *stopchannels);
+FMOD_RESULT F_API FMOD_Channel_AddFadePoint (FMOD_CHANNEL *channel, unsigned long long dspclock, float volume);
+FMOD_RESULT F_API FMOD_Channel_SetFadePointRamp (FMOD_CHANNEL *channel, unsigned long long dspclock, float volume);
+FMOD_RESULT F_API FMOD_Channel_RemoveFadePoints (FMOD_CHANNEL *channel, unsigned long long dspclock_start, unsigned long long dspclock_end);
+FMOD_RESULT F_API FMOD_Channel_GetFadePoints (FMOD_CHANNEL *channel, unsigned int *numpoints, unsigned long long *point_dspclock, float *point_volume);
+
+/*
+ DSP effects.
+*/
+
+FMOD_RESULT F_API FMOD_Channel_GetDSP (FMOD_CHANNEL *channel, int index, FMOD_DSP **dsp);
+FMOD_RESULT F_API FMOD_Channel_AddDSP (FMOD_CHANNEL *channel, int index, FMOD_DSP *dsp);
+FMOD_RESULT F_API FMOD_Channel_RemoveDSP (FMOD_CHANNEL *channel, FMOD_DSP *dsp);
+FMOD_RESULT F_API FMOD_Channel_GetNumDSPs (FMOD_CHANNEL *channel, int *numdsps);
+FMOD_RESULT F_API FMOD_Channel_SetDSPIndex (FMOD_CHANNEL *channel, FMOD_DSP *dsp, int index);
+FMOD_RESULT F_API FMOD_Channel_GetDSPIndex (FMOD_CHANNEL *channel, FMOD_DSP *dsp, int *index);
+
+/*
+ 3D functionality.
+*/
+
+FMOD_RESULT F_API FMOD_Channel_Set3DAttributes (FMOD_CHANNEL *channel, const FMOD_VECTOR *pos, const FMOD_VECTOR *vel, const FMOD_VECTOR *alt_pan_pos);
+FMOD_RESULT F_API FMOD_Channel_Get3DAttributes (FMOD_CHANNEL *channel, FMOD_VECTOR *pos, FMOD_VECTOR *vel, FMOD_VECTOR *alt_pan_pos);
+FMOD_RESULT F_API FMOD_Channel_Set3DMinMaxDistance (FMOD_CHANNEL *channel, float mindistance, float maxdistance);
+FMOD_RESULT F_API FMOD_Channel_Get3DMinMaxDistance (FMOD_CHANNEL *channel, float *mindistance, float *maxdistance);
+FMOD_RESULT F_API FMOD_Channel_Set3DConeSettings (FMOD_CHANNEL *channel, float insideconeangle, float outsideconeangle, float outsidevolume);
+FMOD_RESULT F_API FMOD_Channel_Get3DConeSettings (FMOD_CHANNEL *channel, float *insideconeangle, float *outsideconeangle, float *outsidevolume);
+FMOD_RESULT F_API FMOD_Channel_Set3DConeOrientation (FMOD_CHANNEL *channel, FMOD_VECTOR *orientation);
+FMOD_RESULT F_API FMOD_Channel_Get3DConeOrientation (FMOD_CHANNEL *channel, FMOD_VECTOR *orientation);
+FMOD_RESULT F_API FMOD_Channel_Set3DCustomRolloff (FMOD_CHANNEL *channel, FMOD_VECTOR *points, int numpoints);
+FMOD_RESULT F_API FMOD_Channel_Get3DCustomRolloff (FMOD_CHANNEL *channel, FMOD_VECTOR **points, int *numpoints);
+FMOD_RESULT F_API FMOD_Channel_Set3DOcclusion (FMOD_CHANNEL *channel, float directocclusion, float reverbocclusion);
+FMOD_RESULT F_API FMOD_Channel_Get3DOcclusion (FMOD_CHANNEL *channel, float *directocclusion, float *reverbocclusion);
+FMOD_RESULT F_API FMOD_Channel_Set3DSpread (FMOD_CHANNEL *channel, float angle);
+FMOD_RESULT F_API FMOD_Channel_Get3DSpread (FMOD_CHANNEL *channel, float *angle);
+FMOD_RESULT F_API FMOD_Channel_Set3DLevel (FMOD_CHANNEL *channel, float level);
+FMOD_RESULT F_API FMOD_Channel_Get3DLevel (FMOD_CHANNEL *channel, float *level);
+FMOD_RESULT F_API FMOD_Channel_Set3DDopplerLevel (FMOD_CHANNEL *channel, float level);
+FMOD_RESULT F_API FMOD_Channel_Get3DDopplerLevel (FMOD_CHANNEL *channel, float *level);
+FMOD_RESULT F_API FMOD_Channel_Set3DDistanceFilter (FMOD_CHANNEL *channel, FMOD_BOOL custom, float customLevel, float centerFreq);
+FMOD_RESULT F_API FMOD_Channel_Get3DDistanceFilter (FMOD_CHANNEL *channel, FMOD_BOOL *custom, float *customLevel, float *centerFreq);
+
+/*
+ Userdata set/get.
+*/
+
+FMOD_RESULT F_API FMOD_Channel_SetUserData (FMOD_CHANNEL *channel, void *userdata);
+FMOD_RESULT F_API FMOD_Channel_GetUserData (FMOD_CHANNEL *channel, void **userdata);
+
+/*
+ Channel specific control functionality.
+*/
+
+FMOD_RESULT F_API FMOD_Channel_SetFrequency (FMOD_CHANNEL *channel, float frequency);
+FMOD_RESULT F_API FMOD_Channel_GetFrequency (FMOD_CHANNEL *channel, float *frequency);
+FMOD_RESULT F_API FMOD_Channel_SetPriority (FMOD_CHANNEL *channel, int priority);
+FMOD_RESULT F_API FMOD_Channel_GetPriority (FMOD_CHANNEL *channel, int *priority);
+FMOD_RESULT F_API FMOD_Channel_SetPosition (FMOD_CHANNEL *channel, unsigned int position, FMOD_TIMEUNIT postype);
+FMOD_RESULT F_API FMOD_Channel_GetPosition (FMOD_CHANNEL *channel, unsigned int *position, FMOD_TIMEUNIT postype);
+FMOD_RESULT F_API FMOD_Channel_SetChannelGroup (FMOD_CHANNEL *channel, FMOD_CHANNELGROUP *channelgroup);
+FMOD_RESULT F_API FMOD_Channel_GetChannelGroup (FMOD_CHANNEL *channel, FMOD_CHANNELGROUP **channelgroup);
+FMOD_RESULT F_API FMOD_Channel_SetLoopCount (FMOD_CHANNEL *channel, int loopcount);
+FMOD_RESULT F_API FMOD_Channel_GetLoopCount (FMOD_CHANNEL *channel, int *loopcount);
+FMOD_RESULT F_API FMOD_Channel_SetLoopPoints (FMOD_CHANNEL *channel, unsigned int loopstart, FMOD_TIMEUNIT loopstarttype, unsigned int loopend, FMOD_TIMEUNIT loopendtype);
+FMOD_RESULT F_API FMOD_Channel_GetLoopPoints (FMOD_CHANNEL *channel, unsigned int *loopstart, FMOD_TIMEUNIT loopstarttype, unsigned int *loopend, FMOD_TIMEUNIT loopendtype);
+
+/*
+ Information only functions.
+*/
+
+FMOD_RESULT F_API FMOD_Channel_IsVirtual (FMOD_CHANNEL *channel, FMOD_BOOL *isvirtual);
+FMOD_RESULT F_API FMOD_Channel_GetCurrentSound (FMOD_CHANNEL *channel, FMOD_SOUND **sound);
+FMOD_RESULT F_API FMOD_Channel_GetIndex (FMOD_CHANNEL *channel, int *index);
+
+/*
+ 'ChannelGroup' API
+*/
+
+FMOD_RESULT F_API FMOD_ChannelGroup_GetSystemObject (FMOD_CHANNELGROUP *channelgroup, FMOD_SYSTEM **system);
+
+/*
+ General control functionality for Channels and ChannelGroups.
+*/
+
+FMOD_RESULT F_API FMOD_ChannelGroup_Stop (FMOD_CHANNELGROUP *channelgroup);
+FMOD_RESULT F_API FMOD_ChannelGroup_SetPaused (FMOD_CHANNELGROUP *channelgroup, FMOD_BOOL paused);
+FMOD_RESULT F_API FMOD_ChannelGroup_GetPaused (FMOD_CHANNELGROUP *channelgroup, FMOD_BOOL *paused);
+FMOD_RESULT F_API FMOD_ChannelGroup_SetVolume (FMOD_CHANNELGROUP *channelgroup, float volume);
+FMOD_RESULT F_API FMOD_ChannelGroup_GetVolume (FMOD_CHANNELGROUP *channelgroup, float *volume);
+FMOD_RESULT F_API FMOD_ChannelGroup_SetVolumeRamp (FMOD_CHANNELGROUP *channelgroup, FMOD_BOOL ramp);
+FMOD_RESULT F_API FMOD_ChannelGroup_GetVolumeRamp (FMOD_CHANNELGROUP *channelgroup, FMOD_BOOL *ramp);
+FMOD_RESULT F_API FMOD_ChannelGroup_GetAudibility (FMOD_CHANNELGROUP *channelgroup, float *audibility);
+FMOD_RESULT F_API FMOD_ChannelGroup_SetPitch (FMOD_CHANNELGROUP *channelgroup, float pitch);
+FMOD_RESULT F_API FMOD_ChannelGroup_GetPitch (FMOD_CHANNELGROUP *channelgroup, float *pitch);
+FMOD_RESULT F_API FMOD_ChannelGroup_SetMute (FMOD_CHANNELGROUP *channelgroup, FMOD_BOOL mute);
+FMOD_RESULT F_API FMOD_ChannelGroup_GetMute (FMOD_CHANNELGROUP *channelgroup, FMOD_BOOL *mute);
+FMOD_RESULT F_API FMOD_ChannelGroup_SetReverbProperties (FMOD_CHANNELGROUP *channelgroup, int instance, float wet);
+FMOD_RESULT F_API FMOD_ChannelGroup_GetReverbProperties (FMOD_CHANNELGROUP *channelgroup, int instance, float *wet);
+FMOD_RESULT F_API FMOD_ChannelGroup_SetLowPassGain (FMOD_CHANNELGROUP *channelgroup, float gain);
+FMOD_RESULT F_API FMOD_ChannelGroup_GetLowPassGain (FMOD_CHANNELGROUP *channelgroup, float *gain);
+FMOD_RESULT F_API FMOD_ChannelGroup_SetMode (FMOD_CHANNELGROUP *channelgroup, FMOD_MODE mode);
+FMOD_RESULT F_API FMOD_ChannelGroup_GetMode (FMOD_CHANNELGROUP *channelgroup, FMOD_MODE *mode);
+FMOD_RESULT F_API FMOD_ChannelGroup_SetCallback (FMOD_CHANNELGROUP *channelgroup, FMOD_CHANNELCONTROL_CALLBACK callback);
+FMOD_RESULT F_API FMOD_ChannelGroup_IsPlaying (FMOD_CHANNELGROUP *channelgroup, FMOD_BOOL *isplaying);
+
+/*
+ Note all 'set' functions alter a final matrix, this is why the only get function is getMixMatrix, to avoid other get functions returning incorrect/obsolete values.
+*/
+
+FMOD_RESULT F_API FMOD_ChannelGroup_SetPan (FMOD_CHANNELGROUP *channelgroup, float pan);
+FMOD_RESULT F_API FMOD_ChannelGroup_SetMixLevelsOutput (FMOD_CHANNELGROUP *channelgroup, float frontleft, float frontright, float center, float lfe, float surroundleft, float surroundright, float backleft, float backright);
+FMOD_RESULT F_API FMOD_ChannelGroup_SetMixLevelsInput (FMOD_CHANNELGROUP *channelgroup, float *levels, int numlevels);
+FMOD_RESULT F_API FMOD_ChannelGroup_SetMixMatrix (FMOD_CHANNELGROUP *channelgroup, float *matrix, int outchannels, int inchannels, int inchannel_hop);
+FMOD_RESULT F_API FMOD_ChannelGroup_GetMixMatrix (FMOD_CHANNELGROUP *channelgroup, float *matrix, int *outchannels, int *inchannels, int inchannel_hop);
+
+/*
+ Clock based functionality.
+*/
+
+FMOD_RESULT F_API FMOD_ChannelGroup_GetDSPClock (FMOD_CHANNELGROUP *channelgroup, unsigned long long *dspclock, unsigned long long *parentclock);
+FMOD_RESULT F_API FMOD_ChannelGroup_SetDelay (FMOD_CHANNELGROUP *channelgroup, unsigned long long dspclock_start, unsigned long long dspclock_end, FMOD_BOOL stopchannels);
+FMOD_RESULT F_API FMOD_ChannelGroup_GetDelay (FMOD_CHANNELGROUP *channelgroup, unsigned long long *dspclock_start, unsigned long long *dspclock_end, FMOD_BOOL *stopchannels);
+FMOD_RESULT F_API FMOD_ChannelGroup_AddFadePoint (FMOD_CHANNELGROUP *channelgroup, unsigned long long dspclock, float volume);
+FMOD_RESULT F_API FMOD_ChannelGroup_SetFadePointRamp (FMOD_CHANNELGROUP *channelgroup, unsigned long long dspclock, float volume);
+FMOD_RESULT F_API FMOD_ChannelGroup_RemoveFadePoints (FMOD_CHANNELGROUP *channelgroup, unsigned long long dspclock_start, unsigned long long dspclock_end);
+FMOD_RESULT F_API FMOD_ChannelGroup_GetFadePoints (FMOD_CHANNELGROUP *channelgroup, unsigned int *numpoints, unsigned long long *point_dspclock, float *point_volume);
+
+/*
+ DSP effects.
+*/
+
+FMOD_RESULT F_API FMOD_ChannelGroup_GetDSP (FMOD_CHANNELGROUP *channelgroup, int index, FMOD_DSP **dsp);
+FMOD_RESULT F_API FMOD_ChannelGroup_AddDSP (FMOD_CHANNELGROUP *channelgroup, int index, FMOD_DSP *dsp);
+FMOD_RESULT F_API FMOD_ChannelGroup_RemoveDSP (FMOD_CHANNELGROUP *channelgroup, FMOD_DSP *dsp);
+FMOD_RESULT F_API FMOD_ChannelGroup_GetNumDSPs (FMOD_CHANNELGROUP *channelgroup, int *numdsps);
+FMOD_RESULT F_API FMOD_ChannelGroup_SetDSPIndex (FMOD_CHANNELGROUP *channelgroup, FMOD_DSP *dsp, int index);
+FMOD_RESULT F_API FMOD_ChannelGroup_GetDSPIndex (FMOD_CHANNELGROUP *channelgroup, FMOD_DSP *dsp, int *index);
+
+/*
+ 3D functionality.
+*/
+
+FMOD_RESULT F_API FMOD_ChannelGroup_Set3DAttributes (FMOD_CHANNELGROUP *channelgroup, const FMOD_VECTOR *pos, const FMOD_VECTOR *vel, const FMOD_VECTOR *alt_pan_pos);
+FMOD_RESULT F_API FMOD_ChannelGroup_Get3DAttributes (FMOD_CHANNELGROUP *channelgroup, FMOD_VECTOR *pos, FMOD_VECTOR *vel, FMOD_VECTOR *alt_pan_pos);
+FMOD_RESULT F_API FMOD_ChannelGroup_Set3DMinMaxDistance (FMOD_CHANNELGROUP *channelgroup, float mindistance, float maxdistance);
+FMOD_RESULT F_API FMOD_ChannelGroup_Get3DMinMaxDistance (FMOD_CHANNELGROUP *channelgroup, float *mindistance, float *maxdistance);
+FMOD_RESULT F_API FMOD_ChannelGroup_Set3DConeSettings (FMOD_CHANNELGROUP *channelgroup, float insideconeangle, float outsideconeangle, float outsidevolume);
+FMOD_RESULT F_API FMOD_ChannelGroup_Get3DConeSettings (FMOD_CHANNELGROUP *channelgroup, float *insideconeangle, float *outsideconeangle, float *outsidevolume);
+FMOD_RESULT F_API FMOD_ChannelGroup_Set3DConeOrientation(FMOD_CHANNELGROUP *channelgroup, FMOD_VECTOR *orientation);
+FMOD_RESULT F_API FMOD_ChannelGroup_Get3DConeOrientation(FMOD_CHANNELGROUP *channelgroup, FMOD_VECTOR *orientation);
+FMOD_RESULT F_API FMOD_ChannelGroup_Set3DCustomRolloff (FMOD_CHANNELGROUP *channelgroup, FMOD_VECTOR *points, int numpoints);
+FMOD_RESULT F_API FMOD_ChannelGroup_Get3DCustomRolloff (FMOD_CHANNELGROUP *channelgroup, FMOD_VECTOR **points, int *numpoints);
+FMOD_RESULT F_API FMOD_ChannelGroup_Set3DOcclusion (FMOD_CHANNELGROUP *channelgroup, float directocclusion, float reverbocclusion);
+FMOD_RESULT F_API FMOD_ChannelGroup_Get3DOcclusion (FMOD_CHANNELGROUP *channelgroup, float *directocclusion, float *reverbocclusion);
+FMOD_RESULT F_API FMOD_ChannelGroup_Set3DSpread (FMOD_CHANNELGROUP *channelgroup, float angle);
+FMOD_RESULT F_API FMOD_ChannelGroup_Get3DSpread (FMOD_CHANNELGROUP *channelgroup, float *angle);
+FMOD_RESULT F_API FMOD_ChannelGroup_Set3DLevel (FMOD_CHANNELGROUP *channelgroup, float level);
+FMOD_RESULT F_API FMOD_ChannelGroup_Get3DLevel (FMOD_CHANNELGROUP *channelgroup, float *level);
+FMOD_RESULT F_API FMOD_ChannelGroup_Set3DDopplerLevel (FMOD_CHANNELGROUP *channelgroup, float level);
+FMOD_RESULT F_API FMOD_ChannelGroup_Get3DDopplerLevel (FMOD_CHANNELGROUP *channelgroup, float *level);
+FMOD_RESULT F_API FMOD_ChannelGroup_Set3DDistanceFilter (FMOD_CHANNELGROUP *channelgroup, FMOD_BOOL custom, float customLevel, float centerFreq);
+FMOD_RESULT F_API FMOD_ChannelGroup_Get3DDistanceFilter (FMOD_CHANNELGROUP *channelgroup, FMOD_BOOL *custom, float *customLevel, float *centerFreq);
+
+/*
+ Userdata set/get.
+*/
+
+FMOD_RESULT F_API FMOD_ChannelGroup_SetUserData (FMOD_CHANNELGROUP *channelgroup, void *userdata);
+FMOD_RESULT F_API FMOD_ChannelGroup_GetUserData (FMOD_CHANNELGROUP *channelgroup, void **userdata);
+
+FMOD_RESULT F_API FMOD_ChannelGroup_Release (FMOD_CHANNELGROUP *channelgroup);
+
+/*
+ Nested channel groups.
+*/
+
+FMOD_RESULT F_API FMOD_ChannelGroup_AddGroup (FMOD_CHANNELGROUP *channelgroup, FMOD_CHANNELGROUP *group, FMOD_BOOL propagatedspclock, FMOD_DSPCONNECTION **connection);
+FMOD_RESULT F_API FMOD_ChannelGroup_GetNumGroups (FMOD_CHANNELGROUP *channelgroup, int *numgroups);
+FMOD_RESULT F_API FMOD_ChannelGroup_GetGroup (FMOD_CHANNELGROUP *channelgroup, int index, FMOD_CHANNELGROUP **group);
+FMOD_RESULT F_API FMOD_ChannelGroup_GetParentGroup (FMOD_CHANNELGROUP *channelgroup, FMOD_CHANNELGROUP **group);
+
+/*
+ Information only functions.
+*/
+
+FMOD_RESULT F_API FMOD_ChannelGroup_GetName (FMOD_CHANNELGROUP *channelgroup, char *name, int namelen);
+FMOD_RESULT F_API FMOD_ChannelGroup_GetNumChannels (FMOD_CHANNELGROUP *channelgroup, int *numchannels);
+FMOD_RESULT F_API FMOD_ChannelGroup_GetChannel (FMOD_CHANNELGROUP *channelgroup, int index, FMOD_CHANNEL **channel);
+
+/*
+ 'SoundGroup' API
+*/
+
+FMOD_RESULT F_API FMOD_SoundGroup_Release (FMOD_SOUNDGROUP *soundgroup);
+FMOD_RESULT F_API FMOD_SoundGroup_GetSystemObject (FMOD_SOUNDGROUP *soundgroup, FMOD_SYSTEM **system);
+
+/*
+ SoundGroup control functions.
+*/
+
+FMOD_RESULT F_API FMOD_SoundGroup_SetMaxAudible (FMOD_SOUNDGROUP *soundgroup, int maxaudible);
+FMOD_RESULT F_API FMOD_SoundGroup_GetMaxAudible (FMOD_SOUNDGROUP *soundgroup, int *maxaudible);
+FMOD_RESULT F_API FMOD_SoundGroup_SetMaxAudibleBehavior (FMOD_SOUNDGROUP *soundgroup, FMOD_SOUNDGROUP_BEHAVIOR behavior);
+FMOD_RESULT F_API FMOD_SoundGroup_GetMaxAudibleBehavior (FMOD_SOUNDGROUP *soundgroup, FMOD_SOUNDGROUP_BEHAVIOR *behavior);
+FMOD_RESULT F_API FMOD_SoundGroup_SetMuteFadeSpeed (FMOD_SOUNDGROUP *soundgroup, float speed);
+FMOD_RESULT F_API FMOD_SoundGroup_GetMuteFadeSpeed (FMOD_SOUNDGROUP *soundgroup, float *speed);
+FMOD_RESULT F_API FMOD_SoundGroup_SetVolume (FMOD_SOUNDGROUP *soundgroup, float volume);
+FMOD_RESULT F_API FMOD_SoundGroup_GetVolume (FMOD_SOUNDGROUP *soundgroup, float *volume);
+FMOD_RESULT F_API FMOD_SoundGroup_Stop (FMOD_SOUNDGROUP *soundgroup);
+
+/*
+ Information only functions.
+*/
+
+FMOD_RESULT F_API FMOD_SoundGroup_GetName (FMOD_SOUNDGROUP *soundgroup, char *name, int namelen);
+FMOD_RESULT F_API FMOD_SoundGroup_GetNumSounds (FMOD_SOUNDGROUP *soundgroup, int *numsounds);
+FMOD_RESULT F_API FMOD_SoundGroup_GetSound (FMOD_SOUNDGROUP *soundgroup, int index, FMOD_SOUND **sound);
+FMOD_RESULT F_API FMOD_SoundGroup_GetNumPlaying (FMOD_SOUNDGROUP *soundgroup, int *numplaying);
+
+/*
+ Userdata set/get.
+*/
+
+FMOD_RESULT F_API FMOD_SoundGroup_SetUserData (FMOD_SOUNDGROUP *soundgroup, void *userdata);
+FMOD_RESULT F_API FMOD_SoundGroup_GetUserData (FMOD_SOUNDGROUP *soundgroup, void **userdata);
+
+/*
+ 'DSP' API
+*/
+
+FMOD_RESULT F_API FMOD_DSP_Release (FMOD_DSP *dsp);
+FMOD_RESULT F_API FMOD_DSP_GetSystemObject (FMOD_DSP *dsp, FMOD_SYSTEM **system);
+
+/*
+ Connection / disconnection / input and output enumeration.
+*/
+
+FMOD_RESULT F_API FMOD_DSP_AddInput (FMOD_DSP *dsp, FMOD_DSP *input, FMOD_DSPCONNECTION **connection, FMOD_DSPCONNECTION_TYPE type);
+FMOD_RESULT F_API FMOD_DSP_DisconnectFrom (FMOD_DSP *dsp, FMOD_DSP *target, FMOD_DSPCONNECTION *connection);
+FMOD_RESULT F_API FMOD_DSP_DisconnectAll (FMOD_DSP *dsp, FMOD_BOOL inputs, FMOD_BOOL outputs);
+FMOD_RESULT F_API FMOD_DSP_GetNumInputs (FMOD_DSP *dsp, int *numinputs);
+FMOD_RESULT F_API FMOD_DSP_GetNumOutputs (FMOD_DSP *dsp, int *numoutputs);
+FMOD_RESULT F_API FMOD_DSP_GetInput (FMOD_DSP *dsp, int index, FMOD_DSP **input, FMOD_DSPCONNECTION **inputconnection);
+FMOD_RESULT F_API FMOD_DSP_GetOutput (FMOD_DSP *dsp, int index, FMOD_DSP **output, FMOD_DSPCONNECTION **outputconnection);
+
+/*
+ DSP unit control.
+*/
+
+FMOD_RESULT F_API FMOD_DSP_SetActive (FMOD_DSP *dsp, FMOD_BOOL active);
+FMOD_RESULT F_API FMOD_DSP_GetActive (FMOD_DSP *dsp, FMOD_BOOL *active);
+FMOD_RESULT F_API FMOD_DSP_SetBypass (FMOD_DSP *dsp, FMOD_BOOL bypass);
+FMOD_RESULT F_API FMOD_DSP_GetBypass (FMOD_DSP *dsp, FMOD_BOOL *bypass);
+FMOD_RESULT F_API FMOD_DSP_SetWetDryMix (FMOD_DSP *dsp, float prewet, float postwet, float dry);
+FMOD_RESULT F_API FMOD_DSP_GetWetDryMix (FMOD_DSP *dsp, float *prewet, float *postwet, float *dry);
+FMOD_RESULT F_API FMOD_DSP_SetChannelFormat (FMOD_DSP *dsp, FMOD_CHANNELMASK channelmask, int numchannels, FMOD_SPEAKERMODE source_speakermode);
+FMOD_RESULT F_API FMOD_DSP_GetChannelFormat (FMOD_DSP *dsp, FMOD_CHANNELMASK *channelmask, int *numchannels, FMOD_SPEAKERMODE *source_speakermode);
+FMOD_RESULT F_API FMOD_DSP_GetOutputChannelFormat (FMOD_DSP *dsp, FMOD_CHANNELMASK inmask, int inchannels, FMOD_SPEAKERMODE inspeakermode, FMOD_CHANNELMASK *outmask, int *outchannels, FMOD_SPEAKERMODE *outspeakermode);
+FMOD_RESULT F_API FMOD_DSP_Reset (FMOD_DSP *dsp);
+
+/*
+ DSP parameter control.
+*/
+
+FMOD_RESULT F_API FMOD_DSP_SetParameterFloat (FMOD_DSP *dsp, int index, float value);
+FMOD_RESULT F_API FMOD_DSP_SetParameterInt (FMOD_DSP *dsp, int index, int value);
+FMOD_RESULT F_API FMOD_DSP_SetParameterBool (FMOD_DSP *dsp, int index, FMOD_BOOL value);
+FMOD_RESULT F_API FMOD_DSP_SetParameterData (FMOD_DSP *dsp, int index, void *data, unsigned int length);
+FMOD_RESULT F_API FMOD_DSP_GetParameterFloat (FMOD_DSP *dsp, int index, float *value, char *valuestr, int valuestrlen);
+FMOD_RESULT F_API FMOD_DSP_GetParameterInt (FMOD_DSP *dsp, int index, int *value, char *valuestr, int valuestrlen);
+FMOD_RESULT F_API FMOD_DSP_GetParameterBool (FMOD_DSP *dsp, int index, FMOD_BOOL *value, char *valuestr, int valuestrlen);
+FMOD_RESULT F_API FMOD_DSP_GetParameterData (FMOD_DSP *dsp, int index, void **data, unsigned int *length, char *valuestr, int valuestrlen);
+FMOD_RESULT F_API FMOD_DSP_GetNumParameters (FMOD_DSP *dsp, int *numparams);
+FMOD_RESULT F_API FMOD_DSP_GetParameterInfo (FMOD_DSP *dsp, int index, FMOD_DSP_PARAMETER_DESC **desc);
+FMOD_RESULT F_API FMOD_DSP_GetDataParameterIndex (FMOD_DSP *dsp, int datatype, int *index);
+FMOD_RESULT F_API FMOD_DSP_ShowConfigDialog (FMOD_DSP *dsp, void *hwnd, FMOD_BOOL show);
+
+/*
+ DSP attributes.
+*/
+
+FMOD_RESULT F_API FMOD_DSP_GetInfo (FMOD_DSP *dsp, char *name, unsigned int *version, int *channels, int *configwidth, int *configheight);
+FMOD_RESULT F_API FMOD_DSP_GetType (FMOD_DSP *dsp, FMOD_DSP_TYPE *type);
+FMOD_RESULT F_API FMOD_DSP_GetIdle (FMOD_DSP *dsp, FMOD_BOOL *idle);
+
+/*
+ Userdata set/get.
+*/
+
+FMOD_RESULT F_API FMOD_DSP_SetUserData (FMOD_DSP *dsp, void *userdata);
+FMOD_RESULT F_API FMOD_DSP_GetUserData (FMOD_DSP *dsp, void **userdata);
+
+/*
+ Metering.
+*/
+
+FMOD_RESULT F_API FMOD_DSP_SetMeteringEnabled (FMOD_DSP *dsp, FMOD_BOOL inputEnabled, FMOD_BOOL outputEnabled);
+FMOD_RESULT F_API FMOD_DSP_GetMeteringEnabled (FMOD_DSP *dsp, FMOD_BOOL *inputEnabled, FMOD_BOOL *outputEnabled);
+FMOD_RESULT F_API FMOD_DSP_GetMeteringInfo (FMOD_DSP *dsp, FMOD_DSP_METERING_INFO *inputInfo, FMOD_DSP_METERING_INFO *outputInfo);
+
+/*
+ 'DSPConnection' API
+*/
+
+FMOD_RESULT F_API FMOD_DSPConnection_GetInput (FMOD_DSPCONNECTION *dspconnection, FMOD_DSP **input);
+FMOD_RESULT F_API FMOD_DSPConnection_GetOutput (FMOD_DSPCONNECTION *dspconnection, FMOD_DSP **output);
+FMOD_RESULT F_API FMOD_DSPConnection_SetMix (FMOD_DSPCONNECTION *dspconnection, float volume);
+FMOD_RESULT F_API FMOD_DSPConnection_GetMix (FMOD_DSPCONNECTION *dspconnection, float *volume);
+FMOD_RESULT F_API FMOD_DSPConnection_SetMixMatrix (FMOD_DSPCONNECTION *dspconnection, float *matrix, int outchannels, int inchannels, int inchannel_hop);
+FMOD_RESULT F_API FMOD_DSPConnection_GetMixMatrix (FMOD_DSPCONNECTION *dspconnection, float *matrix, int *outchannels, int *inchannels, int inchannel_hop);
+FMOD_RESULT F_API FMOD_DSPConnection_GetType (FMOD_DSPCONNECTION *dspconnection, FMOD_DSPCONNECTION_TYPE *type);
+
+/*
+ Userdata set/get.
+*/
+
+FMOD_RESULT F_API FMOD_DSPConnection_SetUserData (FMOD_DSPCONNECTION *dspconnection, void *userdata);
+FMOD_RESULT F_API FMOD_DSPConnection_GetUserData (FMOD_DSPCONNECTION *dspconnection, void **userdata);
+
+/*
+ 'Geometry' API
+*/
+
+FMOD_RESULT F_API FMOD_Geometry_Release (FMOD_GEOMETRY *geometry);
+
+/*
+ Polygon manipulation.
+*/
+
+FMOD_RESULT F_API FMOD_Geometry_AddPolygon (FMOD_GEOMETRY *geometry, float directocclusion, float reverbocclusion, FMOD_BOOL doublesided, int numvertices, const FMOD_VECTOR *vertices, int *polygonindex);
+FMOD_RESULT F_API FMOD_Geometry_GetNumPolygons (FMOD_GEOMETRY *geometry, int *numpolygons);
+FMOD_RESULT F_API FMOD_Geometry_GetMaxPolygons (FMOD_GEOMETRY *geometry, int *maxpolygons, int *maxvertices);
+FMOD_RESULT F_API FMOD_Geometry_GetPolygonNumVertices (FMOD_GEOMETRY *geometry, int index, int *numvertices);
+FMOD_RESULT F_API FMOD_Geometry_SetPolygonVertex (FMOD_GEOMETRY *geometry, int index, int vertexindex, const FMOD_VECTOR *vertex);
+FMOD_RESULT F_API FMOD_Geometry_GetPolygonVertex (FMOD_GEOMETRY *geometry, int index, int vertexindex, FMOD_VECTOR *vertex);
+FMOD_RESULT F_API FMOD_Geometry_SetPolygonAttributes (FMOD_GEOMETRY *geometry, int index, float directocclusion, float reverbocclusion, FMOD_BOOL doublesided);
+FMOD_RESULT F_API FMOD_Geometry_GetPolygonAttributes (FMOD_GEOMETRY *geometry, int index, float *directocclusion, float *reverbocclusion, FMOD_BOOL *doublesided);
+
+/*
+ Object manipulation.
+*/
+
+FMOD_RESULT F_API FMOD_Geometry_SetActive (FMOD_GEOMETRY *geometry, FMOD_BOOL active);
+FMOD_RESULT F_API FMOD_Geometry_GetActive (FMOD_GEOMETRY *geometry, FMOD_BOOL *active);
+FMOD_RESULT F_API FMOD_Geometry_SetRotation (FMOD_GEOMETRY *geometry, const FMOD_VECTOR *forward, const FMOD_VECTOR *up);
+FMOD_RESULT F_API FMOD_Geometry_GetRotation (FMOD_GEOMETRY *geometry, FMOD_VECTOR *forward, FMOD_VECTOR *up);
+FMOD_RESULT F_API FMOD_Geometry_SetPosition (FMOD_GEOMETRY *geometry, const FMOD_VECTOR *position);
+FMOD_RESULT F_API FMOD_Geometry_GetPosition (FMOD_GEOMETRY *geometry, FMOD_VECTOR *position);
+FMOD_RESULT F_API FMOD_Geometry_SetScale (FMOD_GEOMETRY *geometry, const FMOD_VECTOR *scale);
+FMOD_RESULT F_API FMOD_Geometry_GetScale (FMOD_GEOMETRY *geometry, FMOD_VECTOR *scale);
+FMOD_RESULT F_API FMOD_Geometry_Save (FMOD_GEOMETRY *geometry, void *data, int *datasize);
+
+/*
+ Userdata set/get.
+*/
+
+FMOD_RESULT F_API FMOD_Geometry_SetUserData (FMOD_GEOMETRY *geometry, void *userdata);
+FMOD_RESULT F_API FMOD_Geometry_GetUserData (FMOD_GEOMETRY *geometry, void **userdata);
+
+/*
+ 'Reverb3D' API
+*/
+
+FMOD_RESULT F_API FMOD_Reverb3D_Release (FMOD_REVERB3D *reverb3d);
+
+/*
+ Reverb manipulation.
+*/
+
+FMOD_RESULT F_API FMOD_Reverb3D_Set3DAttributes (FMOD_REVERB3D *reverb3d, const FMOD_VECTOR *position, float mindistance, float maxdistance);
+FMOD_RESULT F_API FMOD_Reverb3D_Get3DAttributes (FMOD_REVERB3D *reverb3d, FMOD_VECTOR *position, float *mindistance, float *maxdistance);
+FMOD_RESULT F_API FMOD_Reverb3D_SetProperties (FMOD_REVERB3D *reverb3d, const FMOD_REVERB_PROPERTIES *properties);
+FMOD_RESULT F_API FMOD_Reverb3D_GetProperties (FMOD_REVERB3D *reverb3d, FMOD_REVERB_PROPERTIES *properties);
+FMOD_RESULT F_API FMOD_Reverb3D_SetActive (FMOD_REVERB3D *reverb3d, FMOD_BOOL active);
+FMOD_RESULT F_API FMOD_Reverb3D_GetActive (FMOD_REVERB3D *reverb3d, FMOD_BOOL *active);
+
+/*
+ Userdata set/get.
+*/
+
+FMOD_RESULT F_API FMOD_Reverb3D_SetUserData (FMOD_REVERB3D *reverb3d, void *userdata);
+FMOD_RESULT F_API FMOD_Reverb3D_GetUserData (FMOD_REVERB3D *reverb3d, void **userdata);
+
+/*$ preserve start $*/
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _FMOD_H */
+
+/*$ preserve end $*/
diff --git a/app/src/main/cpp/inc/fmod.hpp b/app/src/main/cpp/inc/fmod.hpp
new file mode 100644
index 0000000..4134507
--- /dev/null
+++ b/app/src/main/cpp/inc/fmod.hpp
@@ -0,0 +1,605 @@
+/* ========================================================================================== */
+/* FMOD Studio - C++ header file. Copyright (c), Firelight Technologies Pty, Ltd. 2004-2017. */
+/* */
+/* Use this header in conjunction with fmod_common.h (which contains all the constants / */
+/* callbacks) to develop using C++ classes. */
+/* ========================================================================================== */
+
+#ifndef _FMOD_HPP
+#define _FMOD_HPP
+
+#include "fmod_common.h"
+#include "fmod.h"
+
+/*
+ Constant and defines
+*/
+
+/*
+ FMOD Namespace
+*/
+namespace FMOD
+{
+ class System;
+ class Sound;
+ class ChannelControl;
+ class Channel;
+ class ChannelGroup;
+ class SoundGroup;
+ class DSP;
+ class DSPConnection;
+ class Geometry;
+ class Reverb3D;
+
+ /*
+ FMOD global system functions (optional).
+ */
+ inline FMOD_RESULT Memory_Initialize (void *poolmem, int poollen, FMOD_MEMORY_ALLOC_CALLBACK useralloc, FMOD_MEMORY_REALLOC_CALLBACK userrealloc, FMOD_MEMORY_FREE_CALLBACK userfree, FMOD_MEMORY_TYPE memtypeflags = FMOD_MEMORY_ALL) { return FMOD_Memory_Initialize(poolmem, poollen, useralloc, userrealloc, userfree, memtypeflags); }
+ inline FMOD_RESULT Memory_GetStats (int *currentalloced, int *maxalloced, bool blocking = true) { return FMOD_Memory_GetStats(currentalloced, maxalloced, blocking); }
+ inline FMOD_RESULT Debug_Initialize (FMOD_DEBUG_FLAGS flags, FMOD_DEBUG_MODE mode = FMOD_DEBUG_MODE_TTY, FMOD_DEBUG_CALLBACK callback = 0, const char *filename = 0) { return FMOD_Debug_Initialize(flags, mode, callback, filename); }
+ inline FMOD_RESULT File_SetDiskBusy (int busy) { return FMOD_File_SetDiskBusy(busy); }
+ inline FMOD_RESULT File_GetDiskBusy (int *busy) { return FMOD_File_GetDiskBusy(busy); }
+
+ /*
+ FMOD System factory functions.
+ */
+ inline FMOD_RESULT System_Create (System **system) { return FMOD_System_Create((FMOD_SYSTEM **)system); }
+
+ /*
+ 'System' API
+ */
+ class System
+ {
+ private:
+
+ // Constructor made private so user cannot statically instance a System class. System_Create must be used.
+ System();
+ System(const System &);
+
+ public:
+
+ FMOD_RESULT F_API release ();
+
+ // Setup functions.
+ FMOD_RESULT F_API setOutput (FMOD_OUTPUTTYPE output);
+ FMOD_RESULT F_API getOutput (FMOD_OUTPUTTYPE *output);
+ FMOD_RESULT F_API getNumDrivers (int *numdrivers);
+ FMOD_RESULT F_API getDriverInfo (int id, char *name, int namelen, FMOD_GUID *guid, int *systemrate, FMOD_SPEAKERMODE *speakermode, int *speakermodechannels);
+ FMOD_RESULT F_API setDriver (int driver);
+ FMOD_RESULT F_API getDriver (int *driver);
+ FMOD_RESULT F_API setSoftwareChannels (int numsoftwarechannels);
+ FMOD_RESULT F_API getSoftwareChannels (int *numsoftwarechannels);
+ FMOD_RESULT F_API setSoftwareFormat (int samplerate, FMOD_SPEAKERMODE speakermode, int numrawspeakers);
+ FMOD_RESULT F_API getSoftwareFormat (int *samplerate, FMOD_SPEAKERMODE *speakermode, int *numrawspeakers);
+ FMOD_RESULT F_API setDSPBufferSize (unsigned int bufferlength, int numbuffers);
+ FMOD_RESULT F_API getDSPBufferSize (unsigned int *bufferlength, int *numbuffers);
+ FMOD_RESULT F_API setFileSystem (FMOD_FILE_OPEN_CALLBACK useropen, FMOD_FILE_CLOSE_CALLBACK userclose, FMOD_FILE_READ_CALLBACK userread, FMOD_FILE_SEEK_CALLBACK userseek, FMOD_FILE_ASYNCREAD_CALLBACK userasyncread, FMOD_FILE_ASYNCCANCEL_CALLBACK userasynccancel, int blockalign);
+ FMOD_RESULT F_API attachFileSystem (FMOD_FILE_OPEN_CALLBACK useropen, FMOD_FILE_CLOSE_CALLBACK userclose, FMOD_FILE_READ_CALLBACK userread, FMOD_FILE_SEEK_CALLBACK userseek);
+ FMOD_RESULT F_API setAdvancedSettings (FMOD_ADVANCEDSETTINGS *settings);
+ FMOD_RESULT F_API getAdvancedSettings (FMOD_ADVANCEDSETTINGS *settings);
+ FMOD_RESULT F_API setCallback (FMOD_SYSTEM_CALLBACK callback, FMOD_SYSTEM_CALLBACK_TYPE callbackmask = FMOD_SYSTEM_CALLBACK_ALL);
+
+ // Plug-in support.
+ FMOD_RESULT F_API setPluginPath (const char *path);
+ FMOD_RESULT F_API loadPlugin (const char *filename, unsigned int *handle, unsigned int priority = 0);
+ FMOD_RESULT F_API unloadPlugin (unsigned int handle);
+ FMOD_RESULT F_API getNumNestedPlugins (unsigned int handle, int *count);
+ FMOD_RESULT F_API getNestedPlugin (unsigned int handle, int index, unsigned int *nestedhandle);
+ FMOD_RESULT F_API getNumPlugins (FMOD_PLUGINTYPE plugintype, int *numplugins);
+ FMOD_RESULT F_API getPluginHandle (FMOD_PLUGINTYPE plugintype, int index, unsigned int *handle);
+ FMOD_RESULT F_API getPluginInfo (unsigned int handle, FMOD_PLUGINTYPE *plugintype, char *name, int namelen, unsigned int *version);
+ FMOD_RESULT F_API setOutputByPlugin (unsigned int handle);
+ FMOD_RESULT F_API getOutputByPlugin (unsigned int *handle);
+ FMOD_RESULT F_API createDSPByPlugin (unsigned int handle, DSP **dsp);
+ FMOD_RESULT F_API getDSPInfoByPlugin (unsigned int handle, const FMOD_DSP_DESCRIPTION **description);
+ FMOD_RESULT F_API registerCodec (FMOD_CODEC_DESCRIPTION *description, unsigned int *handle, unsigned int priority = 0);
+ FMOD_RESULT F_API registerDSP (const FMOD_DSP_DESCRIPTION *description, unsigned int *handle);
+ FMOD_RESULT F_API registerOutput (const FMOD_OUTPUT_DESCRIPTION *description, unsigned int *handle);
+
+ // Init/Close.
+ FMOD_RESULT F_API init (int maxchannels, FMOD_INITFLAGS flags, void *extradriverdata);
+ FMOD_RESULT F_API close ();
+
+ // General post-init system functions.
+ FMOD_RESULT F_API update (); /* IMPORTANT! CALL THIS ONCE PER FRAME! */
+
+ FMOD_RESULT F_API setSpeakerPosition (FMOD_SPEAKER speaker, float x, float y, bool active);
+ FMOD_RESULT F_API getSpeakerPosition (FMOD_SPEAKER speaker, float *x, float *y, bool *active);
+ FMOD_RESULT F_API setStreamBufferSize (unsigned int filebuffersize, FMOD_TIMEUNIT filebuffersizetype);
+ FMOD_RESULT F_API getStreamBufferSize (unsigned int *filebuffersize, FMOD_TIMEUNIT *filebuffersizetype);
+ FMOD_RESULT F_API set3DSettings (float dopplerscale, float distancefactor, float rolloffscale);
+ FMOD_RESULT F_API get3DSettings (float *dopplerscale, float *distancefactor, float *rolloffscale);
+ FMOD_RESULT F_API set3DNumListeners (int numlisteners);
+ FMOD_RESULT F_API get3DNumListeners (int *numlisteners);
+ FMOD_RESULT F_API set3DListenerAttributes (int listener, const FMOD_VECTOR *pos, const FMOD_VECTOR *vel, const FMOD_VECTOR *forward, const FMOD_VECTOR *up);
+ FMOD_RESULT F_API get3DListenerAttributes (int listener, FMOD_VECTOR *pos, FMOD_VECTOR *vel, FMOD_VECTOR *forward, FMOD_VECTOR *up);
+ FMOD_RESULT F_API set3DRolloffCallback (FMOD_3D_ROLLOFF_CALLBACK callback);
+ FMOD_RESULT F_API mixerSuspend ();
+ FMOD_RESULT F_API mixerResume ();
+ FMOD_RESULT F_API getDefaultMixMatrix (FMOD_SPEAKERMODE sourcespeakermode, FMOD_SPEAKERMODE targetspeakermode, float *matrix, int matrixhop);
+ FMOD_RESULT F_API getSpeakerModeChannels (FMOD_SPEAKERMODE mode, int *channels);
+
+ // System information functions.
+ FMOD_RESULT F_API getVersion (unsigned int *version);
+ FMOD_RESULT F_API getOutputHandle (void **handle);
+ FMOD_RESULT F_API getChannelsPlaying (int *channels, int *realchannels = 0);
+ FMOD_RESULT F_API getCPUUsage (float *dsp, float *stream, float *geometry, float *update, float *total);
+ FMOD_RESULT F_API getFileUsage (long long *sampleBytesRead, long long *streamBytesRead, long long *otherBytesRead);
+ FMOD_RESULT F_API getSoundRAM (int *currentalloced, int *maxalloced, int *total);
+
+ // Sound/DSP/Channel/FX creation and retrieval.
+ FMOD_RESULT F_API createSound (const char *name_or_data, FMOD_MODE mode, FMOD_CREATESOUNDEXINFO *exinfo, Sound **sound);
+ FMOD_RESULT F_API createStream (const char *name_or_data, FMOD_MODE mode, FMOD_CREATESOUNDEXINFO *exinfo, Sound **sound);
+ FMOD_RESULT F_API createDSP (const FMOD_DSP_DESCRIPTION *description, DSP **dsp);
+ FMOD_RESULT F_API createDSPByType (FMOD_DSP_TYPE type, DSP **dsp);
+ FMOD_RESULT F_API createChannelGroup (const char *name, ChannelGroup **channelgroup);
+ FMOD_RESULT F_API createSoundGroup (const char *name, SoundGroup **soundgroup);
+ FMOD_RESULT F_API createReverb3D (Reverb3D **reverb);
+
+ FMOD_RESULT F_API playSound (Sound *sound, ChannelGroup *channelgroup, bool paused, Channel **channel);
+ FMOD_RESULT F_API playDSP (DSP *dsp, ChannelGroup *channelgroup, bool paused, Channel **channel);
+ FMOD_RESULT F_API getChannel (int channelid, Channel **channel);
+ FMOD_RESULT F_API getMasterChannelGroup (ChannelGroup **channelgroup);
+ FMOD_RESULT F_API getMasterSoundGroup (SoundGroup **soundgroup);
+
+ // Routing to ports.
+ FMOD_RESULT F_API attachChannelGroupToPort (FMOD_PORT_TYPE portType, FMOD_PORT_INDEX portIndex, ChannelGroup *channelgroup, bool passThru = false);
+ FMOD_RESULT F_API detachChannelGroupFromPort (ChannelGroup *channelgroup);
+
+ // Reverb API.
+ FMOD_RESULT F_API setReverbProperties (int instance, const FMOD_REVERB_PROPERTIES *prop);
+ FMOD_RESULT F_API getReverbProperties (int instance, FMOD_REVERB_PROPERTIES *prop);
+
+ // System level DSP functionality.
+ FMOD_RESULT F_API lockDSP ();
+ FMOD_RESULT F_API unlockDSP ();
+
+ // Recording API.
+ FMOD_RESULT F_API getRecordNumDrivers (int *numdrivers, int *numconnected);
+ FMOD_RESULT F_API getRecordDriverInfo (int id, char *name, int namelen, FMOD_GUID *guid, int *systemrate, FMOD_SPEAKERMODE *speakermode, int *speakermodechannels, FMOD_DRIVER_STATE *state);
+ FMOD_RESULT F_API getRecordPosition (int id, unsigned int *position);
+ FMOD_RESULT F_API recordStart (int id, Sound *sound, bool loop);
+ FMOD_RESULT F_API recordStop (int id);
+ FMOD_RESULT F_API isRecording (int id, bool *recording);
+
+ // Geometry API.
+ FMOD_RESULT F_API createGeometry (int maxpolygons, int maxvertices, Geometry **geometry);
+ FMOD_RESULT F_API setGeometrySettings (float maxworldsize);
+ FMOD_RESULT F_API getGeometrySettings (float *maxworldsize);
+ FMOD_RESULT F_API loadGeometry (const void *data, int datasize, Geometry **geometry);
+ FMOD_RESULT F_API getGeometryOcclusion (const FMOD_VECTOR *listener, const FMOD_VECTOR *source, float *direct, float *reverb);
+
+ // Network functions.
+ FMOD_RESULT F_API setNetworkProxy (const char *proxy);
+ FMOD_RESULT F_API getNetworkProxy (char *proxy, int proxylen);
+ FMOD_RESULT F_API setNetworkTimeout (int timeout);
+ FMOD_RESULT F_API getNetworkTimeout (int *timeout);
+
+ // Userdata set/get.
+ FMOD_RESULT F_API setUserData (void *userdata);
+ FMOD_RESULT F_API getUserData (void **userdata);
+ };
+
+ /*
+ 'Sound' API
+ */
+ class Sound
+ {
+ private:
+
+ // Constructor made private so user cannot statically instance a Sound class. Appropriate Sound creation or retrieval function must be used.
+ Sound();
+ Sound(const Sound &);
+
+ public:
+
+ FMOD_RESULT F_API release ();
+ FMOD_RESULT F_API getSystemObject (System **system);
+
+ // Standard sound manipulation functions.
+ FMOD_RESULT F_API lock (unsigned int offset, unsigned int length, void **ptr1, void **ptr2, unsigned int *len1, unsigned int *len2);
+ FMOD_RESULT F_API unlock (void *ptr1, void *ptr2, unsigned int len1, unsigned int len2);
+ FMOD_RESULT F_API setDefaults (float frequency, int priority);
+ FMOD_RESULT F_API getDefaults (float *frequency, int *priority);
+ FMOD_RESULT F_API set3DMinMaxDistance (float min, float max);
+ FMOD_RESULT F_API get3DMinMaxDistance (float *min, float *max);
+ FMOD_RESULT F_API set3DConeSettings (float insideconeangle, float outsideconeangle, float outsidevolume);
+ FMOD_RESULT F_API get3DConeSettings (float *insideconeangle, float *outsideconeangle, float *outsidevolume);
+ FMOD_RESULT F_API set3DCustomRolloff (FMOD_VECTOR *points, int numpoints);
+ FMOD_RESULT F_API get3DCustomRolloff (FMOD_VECTOR **points, int *numpoints);
+ FMOD_RESULT F_API getSubSound (int index, Sound **subsound);
+ FMOD_RESULT F_API getSubSoundParent (Sound **parentsound);
+ FMOD_RESULT F_API getName (char *name, int namelen);
+ FMOD_RESULT F_API getLength (unsigned int *length, FMOD_TIMEUNIT lengthtype);
+ FMOD_RESULT F_API getFormat (FMOD_SOUND_TYPE *type, FMOD_SOUND_FORMAT *format, int *channels, int *bits);
+ FMOD_RESULT F_API getNumSubSounds (int *numsubsounds);
+ FMOD_RESULT F_API getNumTags (int *numtags, int *numtagsupdated);
+ FMOD_RESULT F_API getTag (const char *name, int index, FMOD_TAG *tag);
+ FMOD_RESULT F_API getOpenState (FMOD_OPENSTATE *openstate, unsigned int *percentbuffered, bool *starving, bool *diskbusy);
+ FMOD_RESULT F_API readData (void *buffer, unsigned int length, unsigned int *read);
+ FMOD_RESULT F_API seekData (unsigned int pcm);
+
+ FMOD_RESULT F_API setSoundGroup (SoundGroup *soundgroup);
+ FMOD_RESULT F_API getSoundGroup (SoundGroup **soundgroup);
+
+ // Synchronization point API. These points can come from markers embedded in wav files, and can also generate channel callbacks.
+ FMOD_RESULT F_API getNumSyncPoints (int *numsyncpoints);
+ FMOD_RESULT F_API getSyncPoint (int index, FMOD_SYNCPOINT **point);
+ FMOD_RESULT F_API getSyncPointInfo (FMOD_SYNCPOINT *point, char *name, int namelen, unsigned int *offset, FMOD_TIMEUNIT offsettype);
+ FMOD_RESULT F_API addSyncPoint (unsigned int offset, FMOD_TIMEUNIT offsettype, const char *name, FMOD_SYNCPOINT **point);
+ FMOD_RESULT F_API deleteSyncPoint (FMOD_SYNCPOINT *point);
+
+ // Functions also in Channel class but here they are the 'default' to save having to change it in Channel all the time.
+ FMOD_RESULT F_API setMode (FMOD_MODE mode);
+ FMOD_RESULT F_API getMode (FMOD_MODE *mode);
+ FMOD_RESULT F_API setLoopCount (int loopcount);
+ FMOD_RESULT F_API getLoopCount (int *loopcount);
+ FMOD_RESULT F_API setLoopPoints (unsigned int loopstart, FMOD_TIMEUNIT loopstarttype, unsigned int loopend, FMOD_TIMEUNIT loopendtype);
+ FMOD_RESULT F_API getLoopPoints (unsigned int *loopstart, FMOD_TIMEUNIT loopstarttype, unsigned int *loopend, FMOD_TIMEUNIT loopendtype);
+
+ // For MOD/S3M/XM/IT/MID sequenced formats only.
+ FMOD_RESULT F_API getMusicNumChannels (int *numchannels);
+ FMOD_RESULT F_API setMusicChannelVolume (int channel, float volume);
+ FMOD_RESULT F_API getMusicChannelVolume (int channel, float *volume);
+ FMOD_RESULT F_API setMusicSpeed (float speed);
+ FMOD_RESULT F_API getMusicSpeed (float *speed);
+
+ // Userdata set/get.
+ FMOD_RESULT F_API setUserData (void *userdata);
+ FMOD_RESULT F_API getUserData (void **userdata);
+ };
+
+
+ /*
+ 'ChannelControl API'. This is a base class for Channel and ChannelGroup so they can share the same functionality. This cannot be used or instansiated explicitly.
+ */
+ class ChannelControl
+ {
+ private:
+
+ // Constructor made private so user cannot statically instance a Control class.
+ ChannelControl();
+ ChannelControl(const ChannelControl &);
+
+ public:
+
+ FMOD_RESULT F_API getSystemObject (System **system);
+
+ // General control functionality for Channels and ChannelGroups.
+ FMOD_RESULT F_API stop ();
+ FMOD_RESULT F_API setPaused (bool paused);
+ FMOD_RESULT F_API getPaused (bool *paused);
+ FMOD_RESULT F_API setVolume (float volume);
+ FMOD_RESULT F_API getVolume (float *volume);
+ FMOD_RESULT F_API setVolumeRamp (bool ramp);
+ FMOD_RESULT F_API getVolumeRamp (bool *ramp);
+ FMOD_RESULT F_API getAudibility (float *audibility);
+ FMOD_RESULT F_API setPitch (float pitch);
+ FMOD_RESULT F_API getPitch (float *pitch);
+ FMOD_RESULT F_API setMute (bool mute);
+ FMOD_RESULT F_API getMute (bool *mute);
+ FMOD_RESULT F_API setReverbProperties (int instance, float wet);
+ FMOD_RESULT F_API getReverbProperties (int instance, float *wet);
+ FMOD_RESULT F_API setLowPassGain (float gain);
+ FMOD_RESULT F_API getLowPassGain (float *gain);
+ FMOD_RESULT F_API setMode (FMOD_MODE mode);
+ FMOD_RESULT F_API getMode (FMOD_MODE *mode);
+ FMOD_RESULT F_API setCallback (FMOD_CHANNELCONTROL_CALLBACK callback);
+ FMOD_RESULT F_API isPlaying (bool *isplaying);
+
+ // Panning and level adjustment.
+ // Note all 'set' functions alter a final matrix, this is why the only get function is getMixMatrix, to avoid other get functions returning incorrect/obsolete values.
+ FMOD_RESULT F_API setPan (float pan);
+ FMOD_RESULT F_API setMixLevelsOutput (float frontleft, float frontright, float center, float lfe, float surroundleft, float surroundright, float backleft, float backright);
+ FMOD_RESULT F_API setMixLevelsInput (float *levels, int numlevels);
+ FMOD_RESULT F_API setMixMatrix (float *matrix, int outchannels, int inchannels, int inchannel_hop = 0);
+ FMOD_RESULT F_API getMixMatrix (float *matrix, int *outchannels, int *inchannels, int inchannel_hop = 0);
+
+ // Clock based functionality.
+ FMOD_RESULT F_API getDSPClock (unsigned long long *dspclock, unsigned long long *parentclock);
+ FMOD_RESULT F_API setDelay (unsigned long long dspclock_start, unsigned long long dspclock_end, bool stopchannels = true);
+ FMOD_RESULT F_API getDelay (unsigned long long *dspclock_start, unsigned long long *dspclock_end, bool *stopchannels = 0);
+ FMOD_RESULT F_API addFadePoint (unsigned long long dspclock, float volume);
+ FMOD_RESULT F_API setFadePointRamp (unsigned long long dspclock, float volume);
+ FMOD_RESULT F_API removeFadePoints (unsigned long long dspclock_start, unsigned long long dspclock_end);
+ FMOD_RESULT F_API getFadePoints (unsigned int *numpoints, unsigned long long *point_dspclock, float *point_volume);
+
+ // DSP effects.
+ FMOD_RESULT F_API getDSP (int index, DSP **dsp);
+ FMOD_RESULT F_API addDSP (int index, DSP *dsp);
+ FMOD_RESULT F_API removeDSP (DSP *dsp);
+ FMOD_RESULT F_API getNumDSPs (int *numdsps);
+ FMOD_RESULT F_API setDSPIndex (DSP *dsp, int index);
+ FMOD_RESULT F_API getDSPIndex (DSP *dsp, int *index);
+
+ // 3D functionality.
+ FMOD_RESULT F_API set3DAttributes (const FMOD_VECTOR *pos, const FMOD_VECTOR *vel, const FMOD_VECTOR *alt_pan_pos = 0);
+ FMOD_RESULT F_API get3DAttributes (FMOD_VECTOR *pos, FMOD_VECTOR *vel, FMOD_VECTOR *alt_pan_pos = 0);
+ FMOD_RESULT F_API set3DMinMaxDistance (float mindistance, float maxdistance);
+ FMOD_RESULT F_API get3DMinMaxDistance (float *mindistance, float *maxdistance);
+ FMOD_RESULT F_API set3DConeSettings (float insideconeangle, float outsideconeangle, float outsidevolume);
+ FMOD_RESULT F_API get3DConeSettings (float *insideconeangle, float *outsideconeangle, float *outsidevolume);
+ FMOD_RESULT F_API set3DConeOrientation (FMOD_VECTOR *orientation);
+ FMOD_RESULT F_API get3DConeOrientation (FMOD_VECTOR *orientation);
+ FMOD_RESULT F_API set3DCustomRolloff (FMOD_VECTOR *points, int numpoints);
+ FMOD_RESULT F_API get3DCustomRolloff (FMOD_VECTOR **points, int *numpoints);
+ FMOD_RESULT F_API set3DOcclusion (float directocclusion, float reverbocclusion);
+ FMOD_RESULT F_API get3DOcclusion (float *directocclusion, float *reverbocclusion);
+ FMOD_RESULT F_API set3DSpread (float angle);
+ FMOD_RESULT F_API get3DSpread (float *angle);
+ FMOD_RESULT F_API set3DLevel (float level);
+ FMOD_RESULT F_API get3DLevel (float *level);
+ FMOD_RESULT F_API set3DDopplerLevel (float level);
+ FMOD_RESULT F_API get3DDopplerLevel (float *level);
+ FMOD_RESULT F_API set3DDistanceFilter (bool custom, float customLevel, float centerFreq);
+ FMOD_RESULT F_API get3DDistanceFilter (bool *custom, float *customLevel, float *centerFreq);
+
+ // Userdata set/get.
+ FMOD_RESULT F_API setUserData (void *userdata);
+ FMOD_RESULT F_API getUserData (void **userdata);
+ };
+
+ /*
+ 'Channel' API.
+ */
+ class Channel : public ChannelControl
+ {
+ private:
+
+ // Constructor made private so user cannot statically instance a Channel class. Appropriate Channel creation or retrieval function must be used.
+ Channel();
+ Channel(const Channel &);
+
+ public:
+
+ // Channel specific control functionality.
+ FMOD_RESULT F_API setFrequency (float frequency);
+ FMOD_RESULT F_API getFrequency (float *frequency);
+ FMOD_RESULT F_API setPriority (int priority);
+ FMOD_RESULT F_API getPriority (int *priority);
+ FMOD_RESULT F_API setPosition (unsigned int position, FMOD_TIMEUNIT postype);
+ FMOD_RESULT F_API getPosition (unsigned int *position, FMOD_TIMEUNIT postype);
+ FMOD_RESULT F_API setChannelGroup (ChannelGroup *channelgroup);
+ FMOD_RESULT F_API getChannelGroup (ChannelGroup **channelgroup);
+ FMOD_RESULT F_API setLoopCount (int loopcount);
+ FMOD_RESULT F_API getLoopCount (int *loopcount);
+ FMOD_RESULT F_API setLoopPoints (unsigned int loopstart, FMOD_TIMEUNIT loopstarttype, unsigned int loopend, FMOD_TIMEUNIT loopendtype);
+ FMOD_RESULT F_API getLoopPoints (unsigned int *loopstart, FMOD_TIMEUNIT loopstarttype, unsigned int *loopend, FMOD_TIMEUNIT loopendtype);
+
+ // Information only functions.
+ FMOD_RESULT F_API isVirtual (bool *isvirtual);
+ FMOD_RESULT F_API getCurrentSound (Sound **sound);
+ FMOD_RESULT F_API getIndex (int *index);
+ };
+
+ /*
+ 'ChannelGroup' API
+ */
+ class ChannelGroup : public ChannelControl
+ {
+ private:
+
+ // Constructor made private so user cannot statically instance a ChannelGroup class. Appropriate ChannelGroup creation or retrieval function must be used.
+ ChannelGroup();
+ ChannelGroup(const ChannelGroup &);
+
+ public:
+
+ FMOD_RESULT F_API release ();
+
+ // Nested channel groups.
+ FMOD_RESULT F_API addGroup (ChannelGroup *group, bool propagatedspclock = true, DSPConnection **connection = 0);
+ FMOD_RESULT F_API getNumGroups (int *numgroups);
+ FMOD_RESULT F_API getGroup (int index, ChannelGroup **group);
+ FMOD_RESULT F_API getParentGroup (ChannelGroup **group);
+
+ // Information only functions.
+ FMOD_RESULT F_API getName (char *name, int namelen);
+ FMOD_RESULT F_API getNumChannels (int *numchannels);
+ FMOD_RESULT F_API getChannel (int index, Channel **channel);
+ };
+
+ /*
+ 'SoundGroup' API
+ */
+ class SoundGroup
+ {
+ private:
+
+ // Constructor made private so user cannot statically instance a SoundGroup class. Appropriate SoundGroup creation or retrieval function must be used.
+ SoundGroup();
+ SoundGroup(const SoundGroup &);
+
+ public:
+
+ FMOD_RESULT F_API release ();
+ FMOD_RESULT F_API getSystemObject (System **system);
+
+ // SoundGroup control functions.
+ FMOD_RESULT F_API setMaxAudible (int maxaudible);
+ FMOD_RESULT F_API getMaxAudible (int *maxaudible);
+ FMOD_RESULT F_API setMaxAudibleBehavior (FMOD_SOUNDGROUP_BEHAVIOR behavior);
+ FMOD_RESULT F_API getMaxAudibleBehavior (FMOD_SOUNDGROUP_BEHAVIOR *behavior);
+ FMOD_RESULT F_API setMuteFadeSpeed (float speed);
+ FMOD_RESULT F_API getMuteFadeSpeed (float *speed);
+ FMOD_RESULT F_API setVolume (float volume);
+ FMOD_RESULT F_API getVolume (float *volume);
+ FMOD_RESULT F_API stop ();
+
+ // Information only functions.
+ FMOD_RESULT F_API getName (char *name, int namelen);
+ FMOD_RESULT F_API getNumSounds (int *numsounds);
+ FMOD_RESULT F_API getSound (int index, Sound **sound);
+ FMOD_RESULT F_API getNumPlaying (int *numplaying);
+
+ // Userdata set/get.
+ FMOD_RESULT F_API setUserData (void *userdata);
+ FMOD_RESULT F_API getUserData (void **userdata);
+ };
+
+ /*
+ 'DSP' API
+ */
+ class DSP
+ {
+ private:
+
+ // Constructor made private so user cannot statically instance a DSP class. Appropriate DSP creation or retrieval function must be used.
+ DSP();
+ DSP(const DSP &);
+
+ public:
+
+ FMOD_RESULT F_API release ();
+ FMOD_RESULT F_API getSystemObject (System **system);
+
+ // Connection / disconnection / input and output enumeration.
+ FMOD_RESULT F_API addInput (DSP *input, DSPConnection **connection = 0, FMOD_DSPCONNECTION_TYPE type = FMOD_DSPCONNECTION_TYPE_STANDARD);
+ FMOD_RESULT F_API disconnectFrom (DSP *target, DSPConnection *connection = 0);
+ FMOD_RESULT F_API disconnectAll (bool inputs, bool outputs);
+ FMOD_RESULT F_API getNumInputs (int *numinputs);
+ FMOD_RESULT F_API getNumOutputs (int *numoutputs);
+ FMOD_RESULT F_API getInput (int index, DSP **input, DSPConnection **inputconnection);
+ FMOD_RESULT F_API getOutput (int index, DSP **output, DSPConnection **outputconnection);
+
+ // DSP unit control.
+ FMOD_RESULT F_API setActive (bool active);
+ FMOD_RESULT F_API getActive (bool *active);
+ FMOD_RESULT F_API setBypass (bool bypass);
+ FMOD_RESULT F_API getBypass (bool *bypass);
+ FMOD_RESULT F_API setWetDryMix (float prewet, float postwet, float dry);
+ FMOD_RESULT F_API getWetDryMix (float *prewet, float *postwet, float *dry);
+ FMOD_RESULT F_API setChannelFormat (FMOD_CHANNELMASK channelmask, int numchannels, FMOD_SPEAKERMODE source_speakermode);
+ FMOD_RESULT F_API getChannelFormat (FMOD_CHANNELMASK *channelmask, int *numchannels, FMOD_SPEAKERMODE *source_speakermode);
+ FMOD_RESULT F_API getOutputChannelFormat (FMOD_CHANNELMASK inmask, int inchannels, FMOD_SPEAKERMODE inspeakermode, FMOD_CHANNELMASK *outmask, int *outchannels, FMOD_SPEAKERMODE *outspeakermode);
+ FMOD_RESULT F_API reset ();
+
+ // DSP parameter control.
+ FMOD_RESULT F_API setParameterFloat (int index, float value);
+ FMOD_RESULT F_API setParameterInt (int index, int value);
+ FMOD_RESULT F_API setParameterBool (int index, bool value);
+ FMOD_RESULT F_API setParameterData (int index, void *data, unsigned int length);
+ FMOD_RESULT F_API getParameterFloat (int index, float *value, char *valuestr, int valuestrlen);
+ FMOD_RESULT F_API getParameterInt (int index, int *value, char *valuestr, int valuestrlen);
+ FMOD_RESULT F_API getParameterBool (int index, bool *value, char *valuestr, int valuestrlen);
+ FMOD_RESULT F_API getParameterData (int index, void **data, unsigned int *length, char *valuestr, int valuestrlen);
+ FMOD_RESULT F_API getNumParameters (int *numparams);
+ FMOD_RESULT F_API getParameterInfo (int index, FMOD_DSP_PARAMETER_DESC **desc);
+ FMOD_RESULT F_API getDataParameterIndex (int datatype, int *index);
+ FMOD_RESULT F_API showConfigDialog (void *hwnd, bool show);
+
+ // DSP attributes.
+ FMOD_RESULT F_API getInfo (char *name, unsigned int *version, int *channels, int *configwidth, int *configheight);
+ FMOD_RESULT F_API getType (FMOD_DSP_TYPE *type);
+ FMOD_RESULT F_API getIdle (bool *idle);
+
+ // Userdata set/get.
+ FMOD_RESULT F_API setUserData (void *userdata);
+ FMOD_RESULT F_API getUserData (void **userdata);
+
+ // Metering.
+ FMOD_RESULT F_API setMeteringEnabled (bool inputEnabled, bool outputEnabled);
+ FMOD_RESULT F_API getMeteringEnabled (bool *inputEnabled, bool *outputEnabled);
+ FMOD_RESULT F_API getMeteringInfo (FMOD_DSP_METERING_INFO *inputInfo, FMOD_DSP_METERING_INFO *outputInfo);
+ };
+
+
+ /*
+ 'DSPConnection' API
+ */
+ class DSPConnection
+ {
+ private:
+
+ // Constructor made private so user cannot statically instance a DSPConnection class. Appropriate DSPConnection creation or retrieval function must be used.
+ DSPConnection();
+ DSPConnection(const DSPConnection &);
+
+ public:
+
+ FMOD_RESULT F_API getInput (DSP **input);
+ FMOD_RESULT F_API getOutput (DSP **output);
+ FMOD_RESULT F_API setMix (float volume);
+ FMOD_RESULT F_API getMix (float *volume);
+ FMOD_RESULT F_API setMixMatrix (float *matrix, int outchannels, int inchannels, int inchannel_hop = 0);
+ FMOD_RESULT F_API getMixMatrix (float *matrix, int *outchannels, int *inchannels, int inchannel_hop = 0);
+ FMOD_RESULT F_API getType (FMOD_DSPCONNECTION_TYPE *type);
+
+ // Userdata set/get.
+ FMOD_RESULT F_API setUserData (void *userdata);
+ FMOD_RESULT F_API getUserData (void **userdata);
+ };
+
+
+ /*
+ 'Geometry' API
+ */
+ class Geometry
+ {
+ private:
+
+ // Constructor made private so user cannot statically instance a Geometry class. Appropriate Geometry creation or retrieval function must be used.
+ Geometry();
+ Geometry(const Geometry &);
+
+ public:
+
+ FMOD_RESULT F_API release ();
+
+ // Polygon manipulation.
+ FMOD_RESULT F_API addPolygon (float directocclusion, float reverbocclusion, bool doublesided, int numvertices, const FMOD_VECTOR *vertices, int *polygonindex);
+ FMOD_RESULT F_API getNumPolygons (int *numpolygons);
+ FMOD_RESULT F_API getMaxPolygons (int *maxpolygons, int *maxvertices);
+ FMOD_RESULT F_API getPolygonNumVertices (int index, int *numvertices);
+ FMOD_RESULT F_API setPolygonVertex (int index, int vertexindex, const FMOD_VECTOR *vertex);
+ FMOD_RESULT F_API getPolygonVertex (int index, int vertexindex, FMOD_VECTOR *vertex);
+ FMOD_RESULT F_API setPolygonAttributes (int index, float directocclusion, float reverbocclusion, bool doublesided);
+ FMOD_RESULT F_API getPolygonAttributes (int index, float *directocclusion, float *reverbocclusion, bool *doublesided);
+
+ // Object manipulation.
+ FMOD_RESULT F_API setActive (bool active);
+ FMOD_RESULT F_API getActive (bool *active);
+ FMOD_RESULT F_API setRotation (const FMOD_VECTOR *forward, const FMOD_VECTOR *up);
+ FMOD_RESULT F_API getRotation (FMOD_VECTOR *forward, FMOD_VECTOR *up);
+ FMOD_RESULT F_API setPosition (const FMOD_VECTOR *position);
+ FMOD_RESULT F_API getPosition (FMOD_VECTOR *position);
+ FMOD_RESULT F_API setScale (const FMOD_VECTOR *scale);
+ FMOD_RESULT F_API getScale (FMOD_VECTOR *scale);
+ FMOD_RESULT F_API save (void *data, int *datasize);
+
+ // Userdata set/get.
+ FMOD_RESULT F_API setUserData (void *userdata);
+ FMOD_RESULT F_API getUserData (void **userdata);
+ };
+
+
+ /*
+ 'Reverb' API
+ */
+ class Reverb3D
+ {
+ private:
+
+ // Constructor made private so user cannot statically instance a Reverb3D class. Appropriate Reverb creation or retrieval function must be used.
+ Reverb3D();
+ Reverb3D(const Reverb3D &);
+
+ public:
+
+ FMOD_RESULT F_API release ();
+
+ // Reverb manipulation.
+ FMOD_RESULT F_API set3DAttributes (const FMOD_VECTOR *position, float mindistance, float maxdistance);
+ FMOD_RESULT F_API get3DAttributes (FMOD_VECTOR *position, float *mindistance,float *maxdistance);
+ FMOD_RESULT F_API setProperties (const FMOD_REVERB_PROPERTIES *properties);
+ FMOD_RESULT F_API getProperties (FMOD_REVERB_PROPERTIES *properties);
+ FMOD_RESULT F_API setActive (bool active);
+ FMOD_RESULT F_API getActive (bool *active);
+
+ // Userdata set/get.
+ FMOD_RESULT F_API setUserData (void *userdata);
+ FMOD_RESULT F_API getUserData (void **userdata);
+ };
+}
+
+#endif
diff --git a/app/src/main/cpp/inc/fmod_codec.h b/app/src/main/cpp/inc/fmod_codec.h
new file mode 100644
index 0000000..80c9695
--- /dev/null
+++ b/app/src/main/cpp/inc/fmod_codec.h
@@ -0,0 +1,178 @@
+/* ======================================================================================================== */
+/* FMOD Studio - codec development header file. Copyright (c), Firelight Technologies Pty, Ltd. 2004-2017. */
+/* */
+/* Use this header if you are wanting to develop your own file format plugin to use with */
+/* FMOD's codec system. With this header you can make your own fileformat plugin that FMOD */
+/* can register and use. See the documentation and examples on how to make a working plugin. */
+/* */
+/* ======================================================================================================== */
+
+#ifndef _FMOD_CODEC_H
+#define _FMOD_CODEC_H
+
+typedef struct FMOD_CODEC_STATE FMOD_CODEC_STATE;
+typedef struct FMOD_CODEC_WAVEFORMAT FMOD_CODEC_WAVEFORMAT;
+
+/*
+ Codec callbacks
+*/
+typedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_OPEN_CALLBACK) (FMOD_CODEC_STATE *codec_state, FMOD_MODE usermode, FMOD_CREATESOUNDEXINFO *userexinfo);
+typedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_CLOSE_CALLBACK) (FMOD_CODEC_STATE *codec_state);
+typedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_READ_CALLBACK) (FMOD_CODEC_STATE *codec_state, void *buffer, unsigned int samples_in, unsigned int *samples_out);
+typedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_GETLENGTH_CALLBACK) (FMOD_CODEC_STATE *codec_state, unsigned int *length, FMOD_TIMEUNIT lengthtype);
+typedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_SETPOSITION_CALLBACK) (FMOD_CODEC_STATE *codec_state, int subsound, unsigned int position, FMOD_TIMEUNIT postype);
+typedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_GETPOSITION_CALLBACK) (FMOD_CODEC_STATE *codec_state, unsigned int *position, FMOD_TIMEUNIT postype);
+typedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_SOUNDCREATE_CALLBACK) (FMOD_CODEC_STATE *codec_state, int subsound, FMOD_SOUND *sound);
+typedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_METADATA_CALLBACK) (FMOD_CODEC_STATE *codec_state, FMOD_TAGTYPE tagtype, char *name, void *data, unsigned int datalen, FMOD_TAGDATATYPE datatype, int unique);
+typedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_GETWAVEFORMAT_CALLBACK)(FMOD_CODEC_STATE *codec_state, int index, FMOD_CODEC_WAVEFORMAT *waveformat);
+
+
+/*
+[STRUCTURE]
+[
+ [DESCRIPTION]
+ When creating a codec, declare one of these and provide the relevant callbacks and name for FMOD to use when it opens and reads a file.
+
+ [REMARKS]
+ Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only. Do not change this value.
+ Members marked with [w] mean the variable can be written to. The user can set the value.
+
+ [SEE_ALSO]
+ FMOD_CODEC_STATE
+ FMOD_CODEC_WAVEFORMAT
+]
+*/
+typedef struct FMOD_CODEC_DESCRIPTION
+{
+ const char *name; /* [w] Name of the codec. */
+ unsigned int version; /* [w] Plugin writer's version number. */
+ int defaultasstream; /* [w] Tells FMOD to open the file as a stream when calling System::createSound, and not a static sample. Should normally be 0 (FALSE), because generally the user wants to decode the file into memory when using System::createSound. Mainly used for formats that decode for a very long time, or could use large amounts of memory when decoded. Usually sequenced formats such as mod/s3m/xm/it/midi fall into this category. It is mainly to stop users that don't know what they're doing from getting FMOD_ERR_MEMORY returned from createSound when they should have in fact called System::createStream or used FMOD_CREATESTREAM in System::createSound. */
+ FMOD_TIMEUNIT timeunits; /* [w] When setposition codec is called, only these time formats will be passed to the codec. Use bitwise OR to accumulate different types. */
+ FMOD_CODEC_OPEN_CALLBACK open; /* [w] Open callback for the codec for when FMOD tries to open a sound using this codec. */
+ FMOD_CODEC_CLOSE_CALLBACK close; /* [w] Close callback for the codec for when FMOD tries to close a sound using this codec. */
+ FMOD_CODEC_READ_CALLBACK read; /* [w] Read callback for the codec for when FMOD tries to read some data from the file to the destination format (specified in the open callback). */
+ FMOD_CODEC_GETLENGTH_CALLBACK getlength; /* [w] Callback to return the length of the song in whatever format required when Sound::getLength is called. */
+ FMOD_CODEC_SETPOSITION_CALLBACK setposition; /* [w] Seek callback for the codec for when FMOD tries to seek within the file with Channel::setPosition. */
+ FMOD_CODEC_GETPOSITION_CALLBACK getposition; /* [w] Tell callback for the codec for when FMOD tries to get the current position within the with Channel::getPosition. */
+ FMOD_CODEC_SOUNDCREATE_CALLBACK soundcreate; /* [w] Sound creation callback for the codec when FMOD finishes creating the sound. (So the codec can set more parameters for the related created sound, ie loop points/mode or 3D attributes etc). */
+ FMOD_CODEC_GETWAVEFORMAT_CALLBACK getwaveformat; /* [w] Callback to tell FMOD about the waveformat of a particular subsound. This is to save memory, rather than saving 1000 FMOD_CODEC_WAVEFORMAT structures in the codec, the codec might have a more optimal way of storing this information. */
+} FMOD_CODEC_DESCRIPTION;
+
+
+/*
+[STRUCTURE]
+[
+ [DESCRIPTION]
+ Set these values marked to tell fmod what sort of sound to create when the codec open callback is called.
+ The format, channels, frequency and lengthpcm tell FMOD what sort of sound buffer to create when you initialize your code.
+ If you wrote an MP3 codec that decoded to stereo 16bit integer PCM for a 44khz sound, you would specify FMOD_SOUND_FORMAT_PCM16, and channels would be equal to 2, and frequency would be 44100.
+
+ [REMARKS]
+ Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only. Do not change this value.
+ Members marked with [w] mean the variable can be written to. The user can set the value.
+
+ 1.07 Note. 'blockalign' member which was in bytes has been removed. 'pcmblocksize' is now the replacement, and is measured in PCM samples only, not bytes. This is purely to support buffering
+ internal to FMOD for codecs that are not sample accurate.
+
+ Note: When registering a codec, format, channels, frequency and lengthpcm must be supplied, otherwise there will be an error.
+ This structure is optional if FMOD_CODEC_GETWAVEFORMAT_CALLBACK is specified.
+ An array of these structures may be needed if FMOD_CODEC_STATE::numsubsounds is larger than 1.
+
+
+ [SEE_ALSO]
+ FMOD_CODEC_STATE
+ FMOD_SOUND_FORMAT
+ FMOD_MODE
+ FMOD_CHANNELMASK
+ FMOD_CHANNELORDER
+ FMOD_CODEC_WAVEFORMAT_VERSION
+]
+*/
+struct FMOD_CODEC_WAVEFORMAT
+{
+ const char* name; /* [w] Name of sound. Optional. If used, the codec must own the lifetime of the string memory until the codec is destroyed. */
+ FMOD_SOUND_FORMAT format; /* [w] Format for (decompressed) codec output, ie FMOD_SOUND_FORMAT_PCM8, FMOD_SOUND_FORMAT_PCM16. Mandantory - Must be supplied. */
+ int channels; /* [w] Number of channels used by codec, ie mono = 1, stereo = 2. Mandantory - Must be supplied. */
+ int frequency; /* [w] Default frequency in hz of the codec, ie 44100. Mandantory - Must be supplied. */
+ unsigned int lengthbytes; /* [w] Length in bytes of the source data. Used for FMOD_TIMEUNIT_RAWBYTES. Optional. Default = 0. */
+ unsigned int lengthpcm; /* [w] Length in decompressed, PCM samples of the file, ie length in seconds * frequency. Used for Sound::getLength and for memory allocation of static decompressed sample data. Mandantory - Must be supplied. */
+ unsigned int pcmblocksize; /* [w] Minimum, optimal number of decompressed PCM samples codec can handle. 0 or 1 = no buffering. Anything higher means FMOD will allocate a PCM buffer of this size to read in chunks. The codec read callback will be called in multiples of this value. Optional. */
+ int loopstart; /* [w] Loopstart in decompressed, PCM samples of file. Optional. Default = 0. */
+ int loopend; /* [w] Loopend in decompressed, PCM samples of file. Optional. Default = 0. */
+ FMOD_MODE mode; /* [w] Mode to determine whether the sound should by default load as looping, non looping, 2d or 3d. Optional. Default = FMOD_DEFAULT. */
+ FMOD_CHANNELMASK channelmask; /* [w] Defined channel bitmask to describe which speakers the channels in the codec map to, in order of channel count. See fmod_common.h. Optional. Leave at 0 to map to the speaker layout defined in FMOD_SPEAKER. */
+ FMOD_CHANNELORDER channelorder; /* [w] Defined channel order type, to describe where each sound channel should pan for the number of channels specified. See fmod_common.h. Optional. Leave at 0 to play in default speaker order. */
+ float peakvolume; /* [w] Peak volume of sound. Optional. Default = 0 if not used. */
+};
+
+
+/*
+[DEFINE]
+[
+ [NAME]
+ FMOD_CODEC_WAVEFORMAT_VERSION
+
+ [DESCRIPTION]
+ Version number of FMOD_CODEC_WAVEFORMAT structure. Should be set into FMOD_CODEC_STATE in the FMOD_CODEC_OPEN_CALLBACK.
+
+ [REMARKS]
+ Use this for binary compatibility and for future expansion.
+
+ [SEE_ALSO]
+ FMOD_CODEC_STATE
+ FMOD_CODEC_DESCRIPTION
+ FMOD_CODEC_OPEN_CALLBACK
+]
+*/
+#define FMOD_CODEC_WAVEFORMAT_VERSION 3
+/* [DEFINE_END] */
+
+
+/*
+[STRUCTURE]
+[
+ [DESCRIPTION]
+ Codec plugin structure that is passed into each callback.
+
+ Optionally set the numsubsounds and waveformat members when called in FMOD_CODEC_OPEN_CALLBACK to tell fmod what sort of sound to create.
+
+ [REMARKS]
+ Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only. Do not change this value.
+ Members marked with [w] mean the variable can be written to. The user can set the value.
+
+ 'numsubsounds' should be 0 if the file is a normal single sound stream or sound. Examples of this would be .WAV, .WMA, .MP3, .AIFF.
+ 'numsubsounds' should be 1+ if the file is a container format, and does not contain wav data itself. Examples of these types would be FSB (contains multiple sounds), DLS (contain instruments).
+ The waveformat value should point to an arrays of information based on how many subsounds are in the format. If the number of subsounds is 0 then it should point to 1 waveformat, the same as if the number of subsounds was 1. If subsounds was 100 for example, there should be a pointer to an array of 100 waveformat structures.
+
+ The waveformat pointer is optional and could be 0, if using FMOD_CODEC_GETWAVEFORMAT_CALLBACK is preferred.
+
+ When a sound has 1 or more subsounds, the caller must play the individual sounds specified by first obtaining the subsound with Sound::getSubSound.
+
+ [SEE_ALSO]
+ FMOD_CODEC_WAVEFORMAT
+ FMOD_FILE_READ_CALLBACK
+ FMOD_FILE_SEEK_CALLBACK
+ FMOD_CODEC_METADATA_CALLBACK
+ Sound::getSubSound
+ Sound::getNumSubSounds
+ FMOD_CODEC_WAVEFORMAT_VERSION
+]
+*/
+struct FMOD_CODEC_STATE
+{
+ int numsubsounds; /* [w] Number of 'subsounds' in this sound. Anything other than 0 makes it a 'container' format (ie DLS/FSB etc which contain 1 or more subsounds). For most normal, single sound codec such as WAV/AIFF/MP3, this should be 0 as they are not a container for subsounds, they are the sound by itself. */
+ FMOD_CODEC_WAVEFORMAT *waveformat; /* [w] Pointer to an array of format structures containing information about each sample. Can be 0 or NULL if FMOD_CODEC_GETWAVEFORMAT_CALLBACK callback is preferred. The number of entries here must equal the number of subsounds defined in the subsound parameter. If numsubsounds = 0 then there should be 1 instance of this structure. */
+ void *plugindata; /* [w] Plugin writer created data the codec author wants to attach to this object. */
+
+ void *filehandle; /* [r] This will return an internal FMOD file handle to use with the callbacks provided. */
+ unsigned int filesize; /* [r] This will contain the size of the file in bytes. */
+ FMOD_FILE_READ_CALLBACK fileread; /* [r] This will return a callable FMOD file function to use from codec. */
+ FMOD_FILE_SEEK_CALLBACK fileseek; /* [r] This will return a callable FMOD file function to use from codec. */
+ FMOD_CODEC_METADATA_CALLBACK metadata; /* [r] This will return a callable FMOD metadata function to use from codec. */
+
+ int waveformatversion; /* [w] Must be set to FMOD_CODEC_WAVEFORMAT_VERSION in the FMOD_CODEC_OPEN_CALLBACK. */
+};
+
+#endif
+
+
diff --git a/app/src/main/cpp/inc/fmod_common.h b/app/src/main/cpp/inc/fmod_common.h
new file mode 100644
index 0000000..9ba0bf1
--- /dev/null
+++ b/app/src/main/cpp/inc/fmod_common.h
@@ -0,0 +1,1725 @@
+/*$ preserve start $*/
+
+/* ================================================================================================== */
+/* FMOD Studio - Common C/C++ header file. Copyright (c), Firelight Technologies Pty, Ltd. 2004-2017. */
+/* */
+/* This header is included by fmod.hpp (C++ interface) and fmod.h (C interface) therefore is the */
+/* base header for all FMOD headers. */
+/* ================================================================================================== */
+
+#ifndef _FMOD_COMMON_H
+#define _FMOD_COMMON_H
+
+/*
+ FMOD version number. Check this against FMOD::System::getVersion.
+ 0xaaaabbcc -> aaaa = major version number. bb = minor version number. cc = development version number.
+*/
+
+#define FMOD_VERSION 0x00010906
+
+/*
+ Compiler specific settings.
+*/
+
+#if defined(_WIN32) || defined(__CYGWIN__)
+ #define F_CALL __stdcall
+#elif defined(__ANDROID__) && defined(__arm__) && !defined(__LP64__) && !defined(__clang__)
+ #define F_CALL __attribute__((pcs("aapcs")))
+#else
+ #define F_CALL
+#endif
+
+#if defined(_WIN32) || defined(__CYGWIN__) || defined(__ORBIS__) || defined(__psp2__)
+ #define F_EXPORT __declspec(dllexport)
+#elif defined(__APPLE__) || defined(__ANDROID__) || defined(__linux__)
+ #define F_EXPORT __attribute__((visibility("default")))
+#else
+ #define F_EXPORT
+#endif
+
+#ifdef DLL_EXPORTS
+ #define F_API F_EXPORT F_CALL
+#else
+ #define F_API F_CALL
+#endif
+
+#define F_CALLBACK F_CALL
+
+/*
+ FMOD types.
+*/
+
+typedef int FMOD_BOOL;
+typedef struct FMOD_SYSTEM FMOD_SYSTEM;
+typedef struct FMOD_SOUND FMOD_SOUND;
+typedef struct FMOD_CHANNELCONTROL FMOD_CHANNELCONTROL;
+typedef struct FMOD_CHANNEL FMOD_CHANNEL;
+typedef struct FMOD_CHANNELGROUP FMOD_CHANNELGROUP;
+typedef struct FMOD_SOUNDGROUP FMOD_SOUNDGROUP;
+typedef struct FMOD_REVERB3D FMOD_REVERB3D;
+typedef struct FMOD_DSP FMOD_DSP;
+typedef struct FMOD_DSPCONNECTION FMOD_DSPCONNECTION;
+typedef struct FMOD_POLYGON FMOD_POLYGON;
+typedef struct FMOD_GEOMETRY FMOD_GEOMETRY;
+typedef struct FMOD_SYNCPOINT FMOD_SYNCPOINT;
+typedef struct FMOD_ASYNCREADINFO FMOD_ASYNCREADINFO;
+typedef unsigned int FMOD_MODE;
+typedef unsigned int FMOD_TIMEUNIT;
+typedef unsigned int FMOD_INITFLAGS;
+typedef unsigned int FMOD_DEBUG_FLAGS;
+typedef unsigned int FMOD_MEMORY_TYPE;
+typedef unsigned int FMOD_SYSTEM_CALLBACK_TYPE;
+typedef unsigned int FMOD_CHANNELMASK;
+typedef unsigned int FMOD_DRIVER_STATE;
+typedef unsigned int FMOD_PORT_TYPE;
+typedef unsigned long long FMOD_PORT_INDEX;
+
+/*$ fmod result start $*/
+/*
+[ENUM]
+[
+ [DESCRIPTION]
+ error codes. Returned from every function.
+
+ [REMARKS]
+
+ [SEE_ALSO]
+]
+*/
+typedef enum
+{
+ FMOD_OK, /* No errors. */
+ FMOD_ERR_BADCOMMAND, /* Tried to call a function on a data type that does not allow this type of functionality (ie calling Sound::lock on a streaming sound). */
+ FMOD_ERR_CHANNEL_ALLOC, /* Error trying to allocate a channel. */
+ FMOD_ERR_CHANNEL_STOLEN, /* The specified channel has been reused to play another sound. */
+ FMOD_ERR_DMA, /* DMA Failure. See debug output for more information. */
+ FMOD_ERR_DSP_CONNECTION, /* DSP connection error. Connection possibly caused a cyclic dependency or connected dsps with incompatible buffer counts. */
+ FMOD_ERR_DSP_DONTPROCESS, /* DSP return code from a DSP process query callback. Tells mixer not to call the process callback and therefore not consume CPU. Use this to optimize the DSP graph. */
+ FMOD_ERR_DSP_FORMAT, /* DSP Format error. A DSP unit may have attempted to connect to this network with the wrong format, or a matrix may have been set with the wrong size if the target unit has a specified channel map. */
+ FMOD_ERR_DSP_INUSE, /* DSP is already in the mixer's DSP network. It must be removed before being reinserted or released. */
+ FMOD_ERR_DSP_NOTFOUND, /* DSP connection error. Couldn't find the DSP unit specified. */
+ FMOD_ERR_DSP_RESERVED, /* DSP operation error. Cannot perform operation on this DSP as it is reserved by the system. */
+ FMOD_ERR_DSP_SILENCE, /* DSP return code from a DSP process query callback. Tells mixer silence would be produced from read, so go idle and not consume CPU. Use this to optimize the DSP graph. */
+ FMOD_ERR_DSP_TYPE, /* DSP operation cannot be performed on a DSP of this type. */
+ FMOD_ERR_FILE_BAD, /* Error loading file. */
+ FMOD_ERR_FILE_COULDNOTSEEK, /* Couldn't perform seek operation. This is a limitation of the medium (ie netstreams) or the file format. */
+ FMOD_ERR_FILE_DISKEJECTED, /* Media was ejected while reading. */
+ FMOD_ERR_FILE_EOF, /* End of file unexpectedly reached while trying to read essential data (truncated?). */
+ FMOD_ERR_FILE_ENDOFDATA, /* End of current chunk reached while trying to read data. */
+ FMOD_ERR_FILE_NOTFOUND, /* File not found. */
+ FMOD_ERR_FORMAT, /* Unsupported file or audio format. */
+ FMOD_ERR_HEADER_MISMATCH, /* There is a version mismatch between the FMOD header and either the FMOD Studio library or the FMOD Low Level library. */
+ FMOD_ERR_HTTP, /* A HTTP error occurred. This is a catch-all for HTTP errors not listed elsewhere. */
+ FMOD_ERR_HTTP_ACCESS, /* The specified resource requires authentication or is forbidden. */
+ FMOD_ERR_HTTP_PROXY_AUTH, /* Proxy authentication is required to access the specified resource. */
+ FMOD_ERR_HTTP_SERVER_ERROR, /* A HTTP server error occurred. */
+ FMOD_ERR_HTTP_TIMEOUT, /* The HTTP request timed out. */
+ FMOD_ERR_INITIALIZATION, /* FMOD was not initialized correctly to support this function. */
+ FMOD_ERR_INITIALIZED, /* Cannot call this command after System::init. */
+ FMOD_ERR_INTERNAL, /* An error occurred that wasn't supposed to. Contact support. */
+ FMOD_ERR_INVALID_FLOAT, /* Value passed in was a NaN, Inf or denormalized float. */
+ FMOD_ERR_INVALID_HANDLE, /* An invalid object handle was used. */
+ FMOD_ERR_INVALID_PARAM, /* An invalid parameter was passed to this function. */
+ FMOD_ERR_INVALID_POSITION, /* An invalid seek position was passed to this function. */
+ FMOD_ERR_INVALID_SPEAKER, /* An invalid speaker was passed to this function based on the current speaker mode. */
+ FMOD_ERR_INVALID_SYNCPOINT, /* The syncpoint did not come from this sound handle. */
+ FMOD_ERR_INVALID_THREAD, /* Tried to call a function on a thread that is not supported. */
+ FMOD_ERR_INVALID_VECTOR, /* The vectors passed in are not unit length, or perpendicular. */
+ FMOD_ERR_MAXAUDIBLE, /* Reached maximum audible playback count for this sound's soundgroup. */
+ FMOD_ERR_MEMORY, /* Not enough memory or resources. */
+ FMOD_ERR_MEMORY_CANTPOINT, /* Can't use FMOD_OPENMEMORY_POINT on non PCM source data, or non mp3/xma/adpcm data if FMOD_CREATECOMPRESSEDSAMPLE was used. */
+ FMOD_ERR_NEEDS3D, /* Tried to call a command on a 2d sound when the command was meant for 3d sound. */
+ FMOD_ERR_NEEDSHARDWARE, /* Tried to use a feature that requires hardware support. */
+ FMOD_ERR_NET_CONNECT, /* Couldn't connect to the specified host. */
+ FMOD_ERR_NET_SOCKET_ERROR, /* A socket error occurred. This is a catch-all for socket-related errors not listed elsewhere. */
+ FMOD_ERR_NET_URL, /* The specified URL couldn't be resolved. */
+ FMOD_ERR_NET_WOULD_BLOCK, /* Operation on a non-blocking socket could not complete immediately. */
+ FMOD_ERR_NOTREADY, /* Operation could not be performed because specified sound/DSP connection is not ready. */
+ FMOD_ERR_OUTPUT_ALLOCATED, /* Error initializing output device, but more specifically, the output device is already in use and cannot be reused. */
+ FMOD_ERR_OUTPUT_CREATEBUFFER, /* Error creating hardware sound buffer. */
+ FMOD_ERR_OUTPUT_DRIVERCALL, /* A call to a standard soundcard driver failed, which could possibly mean a bug in the driver or resources were missing or exhausted. */
+ FMOD_ERR_OUTPUT_FORMAT, /* Soundcard does not support the specified format. */
+ FMOD_ERR_OUTPUT_INIT, /* Error initializing output device. */
+ FMOD_ERR_OUTPUT_NODRIVERS, /* The output device has no drivers installed. If pre-init, FMOD_OUTPUT_NOSOUND is selected as the output mode. If post-init, the function just fails. */
+ FMOD_ERR_PLUGIN, /* An unspecified error has been returned from a plugin. */
+ FMOD_ERR_PLUGIN_MISSING, /* A requested output, dsp unit type or codec was not available. */
+ FMOD_ERR_PLUGIN_RESOURCE, /* A resource that the plugin requires cannot be found. (ie the DLS file for MIDI playback) */
+ FMOD_ERR_PLUGIN_VERSION, /* A plugin was built with an unsupported SDK version. */
+ FMOD_ERR_RECORD, /* An error occurred trying to initialize the recording device. */
+ FMOD_ERR_REVERB_CHANNELGROUP, /* Reverb properties cannot be set on this channel because a parent channelgroup owns the reverb connection. */
+ FMOD_ERR_REVERB_INSTANCE, /* Specified instance in FMOD_REVERB_PROPERTIES couldn't be set. Most likely because it is an invalid instance number or the reverb doesn't exist. */
+ FMOD_ERR_SUBSOUNDS, /* The error occurred because the sound referenced contains subsounds when it shouldn't have, or it doesn't contain subsounds when it should have. The operation may also not be able to be performed on a parent sound. */
+ FMOD_ERR_SUBSOUND_ALLOCATED, /* This subsound is already being used by another sound, you cannot have more than one parent to a sound. Null out the other parent's entry first. */
+ FMOD_ERR_SUBSOUND_CANTMOVE, /* Shared subsounds cannot be replaced or moved from their parent stream, such as when the parent stream is an FSB file. */
+ FMOD_ERR_TAGNOTFOUND, /* The specified tag could not be found or there are no tags. */
+ FMOD_ERR_TOOMANYCHANNELS, /* The sound created exceeds the allowable input channel count. This can be increased using the 'maxinputchannels' parameter in System::setSoftwareFormat. */
+ FMOD_ERR_TRUNCATED, /* The retrieved string is too long to fit in the supplied buffer and has been truncated. */
+ FMOD_ERR_UNIMPLEMENTED, /* Something in FMOD hasn't been implemented when it should be! contact support! */
+ FMOD_ERR_UNINITIALIZED, /* This command failed because System::init or System::setDriver was not called. */
+ FMOD_ERR_UNSUPPORTED, /* A command issued was not supported by this object. Possibly a plugin without certain callbacks specified. */
+ FMOD_ERR_VERSION, /* The version number of this file format is not supported. */
+ FMOD_ERR_EVENT_ALREADY_LOADED, /* The specified bank has already been loaded. */
+ FMOD_ERR_EVENT_LIVEUPDATE_BUSY, /* The live update connection failed due to the game already being connected. */
+ FMOD_ERR_EVENT_LIVEUPDATE_MISMATCH, /* The live update connection failed due to the game data being out of sync with the tool. */
+ FMOD_ERR_EVENT_LIVEUPDATE_TIMEOUT, /* The live update connection timed out. */
+ FMOD_ERR_EVENT_NOTFOUND, /* The requested event, bus or vca could not be found. */
+ FMOD_ERR_STUDIO_UNINITIALIZED, /* The Studio::System object is not yet initialized. */
+ FMOD_ERR_STUDIO_NOT_LOADED, /* The specified resource is not loaded, so it can't be unloaded. */
+ FMOD_ERR_INVALID_STRING, /* An invalid string was passed to this function. */
+ FMOD_ERR_ALREADY_LOCKED, /* The specified resource is already locked. */
+ FMOD_ERR_NOT_LOCKED, /* The specified resource is not locked, so it can't be unlocked. */
+ FMOD_ERR_RECORD_DISCONNECTED, /* The specified recording driver has been disconnected. */
+ FMOD_ERR_TOOMANYSAMPLES, /* The length provided exceeds the allowable limit. */
+
+ FMOD_RESULT_FORCEINT = 65536 /* Makes sure this enum is signed 32bit. */
+} FMOD_RESULT;
+/*$ fmod result end $*/
+
+
+/*
+[ENUM]
+[
+ [DESCRIPTION]
+ Used to distinguish if a FMOD_CHANNELCONTROL parameter is actually a channel or a channelgroup.
+
+ [REMARKS]
+ Cast the FMOD_CHANNELCONTROL to an FMOD_CHANNEL/FMOD::Channel, or FMOD_CHANNELGROUP/FMOD::ChannelGroup if specific functionality is needed for either class.
+ Otherwise use as FMOD_CHANNELCONTROL/FMOD::ChannelControl and use that API.
+
+ [SEE_ALSO]
+ Channel::setCallback
+ ChannelGroup::setCallback
+]
+*/
+typedef enum
+{
+ FMOD_CHANNELCONTROL_CHANNEL,
+ FMOD_CHANNELCONTROL_CHANNELGROUP,
+
+ FMOD_CHANNELCONTROL_FORCEINT = 65536 /* Makes sure this enum is signed 32bit. */
+} FMOD_CHANNELCONTROL_TYPE;
+
+
+/*
+[STRUCTURE]
+[
+ [DESCRIPTION]
+ Structure describing a point in 3D space.
+
+ [REMARKS]
+ FMOD uses a left handed co-ordinate system by default.
+ To use a right handed co-ordinate system specify FMOD_INIT_3D_RIGHTHANDED from FMOD_INITFLAGS in System::init.
+
+ [SEE_ALSO]
+ System::set3DListenerAttributes
+ System::get3DListenerAttributes
+ Channel::set3DAttributes
+ Channel::get3DAttributes
+ Channel::set3DCustomRolloff
+ Channel::get3DCustomRolloff
+ Sound::set3DCustomRolloff
+ Sound::get3DCustomRolloff
+ Geometry::addPolygon
+ Geometry::setPolygonVertex
+ Geometry::getPolygonVertex
+ Geometry::setRotation
+ Geometry::getRotation
+ Geometry::setPosition
+ Geometry::getPosition
+ Geometry::setScale
+ Geometry::getScale
+ FMOD_INITFLAGS
+]
+*/
+typedef struct
+{
+ float x; /* X co-ordinate in 3D space. */
+ float y; /* Y co-ordinate in 3D space. */
+ float z; /* Z co-ordinate in 3D space. */
+} FMOD_VECTOR;
+
+
+/*
+[STRUCTURE]
+[
+ [DESCRIPTION]
+ Structure describing a position, velocity and orientation.
+
+ [REMARKS]
+
+ [SEE_ALSO]
+ FMOD_VECTOR
+ FMOD_DSP_PARAMETER_3DATTRIBUTES
+]
+*/
+typedef struct FMOD_3D_ATTRIBUTES
+{
+ FMOD_VECTOR position; /* The position of the object in world space, measured in distance units. */
+ FMOD_VECTOR velocity; /* The velocity of the object measured in distance units **per second**. */
+ FMOD_VECTOR forward; /* The forwards orientation of the object. This vector must be of unit length (1.0) and perpendicular to the up vector. */
+ FMOD_VECTOR up; /* The upwards orientation of the object. This vector must be of unit length (1.0) and perpendicular to the forward vector. */
+} FMOD_3D_ATTRIBUTES;
+
+
+/*
+[STRUCTURE]
+[
+ [DESCRIPTION]
+ Structure describing a globally unique identifier.
+
+ [REMARKS]
+
+ [SEE_ALSO]
+ System::getDriverInfo
+]
+*/
+typedef struct FMOD_GUID
+{
+ unsigned int Data1; /* Specifies the first 8 hexadecimal digits of the GUID */
+ unsigned short Data2; /* Specifies the first group of 4 hexadecimal digits. */
+ unsigned short Data3; /* Specifies the second group of 4 hexadecimal digits. */
+ unsigned char Data4[8]; /* Array of 8 bytes. The first 2 bytes contain the third group of 4 hexadecimal digits. The remaining 6 bytes contain the final 12 hexadecimal digits. */
+} FMOD_GUID;
+
+typedef void (F_CALLBACK *FMOD_FILE_ASYNCDONE_FUNC) (FMOD_ASYNCREADINFO *info, FMOD_RESULT result);
+
+/*
+[STRUCTURE]
+[
+ [DESCRIPTION]
+ Structure that is passed into FMOD_FILE_ASYNCREAD_CALLBACK. Use the information in this structure to perform
+
+ [REMARKS]
+ Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only. Do not change this value.
+ Members marked with [w] mean the variable can be written to. The user can set the value.
+
+ Instructions: write to 'buffer', and 'bytesread' BEFORE calling 'done'.
+ As soon as done is called, FMOD will asynchronously continue internally using the data provided in this structure.
+
+ Set result in the 'done' function pointer to the result expected from a normal file read callback.
+ If the read was successful, set it to FMOD_OK.
+ If it read some data but hit the end of the file, set it to FMOD_ERR_FILE_EOF.
+ If a bad error occurred, return FMOD_ERR_FILE_BAD
+ If a disk was ejected, return FMOD_ERR_FILE_DISKEJECTED.
+
+ [SEE_ALSO]
+ FMOD_FILE_ASYNCREAD_CALLBACK
+ FMOD_FILE_ASYNCCANCEL_CALLBACK
+ FMOD_FILE_ASYNCDONE_FUNC
+]
+*/
+struct FMOD_ASYNCREADINFO
+{
+ void *handle; /* [r] The file handle that was filled out in the open callback. */
+ unsigned int offset; /* [r] Seek position, make sure you read from this file offset. */
+ unsigned int sizebytes; /* [r] how many bytes requested for read. */
+ int priority; /* [r] 0 = low importance. 100 = extremely important (ie 'must read now or stuttering may occur') */
+
+ void *userdata; /* [r/w] User data pointer specific to this request. Initially 0, can be ignored or set by the user. Not related to the file's main userdata member. */
+
+ void *buffer; /* [w] Buffer to read file data into. */
+ unsigned int bytesread; /* [w] Fill this in before setting result code to tell FMOD how many bytes were read. */
+
+ FMOD_FILE_ASYNCDONE_FUNC done; /* [r] FMOD file system wake up function. Call this when user file read is finished. Pass result of file read as a parameter. */
+};
+
+
+/*
+[ENUM]
+[
+ [DESCRIPTION]
+ These output types are used with System::setOutput / System::getOutput, to choose which output method to use.
+
+ [REMARKS]
+ To pass information to the driver when initializing fmod use the *extradriverdata* parameter in System::init for the following reasons.
+
+ - FMOD_OUTPUTTYPE_WAVWRITER - extradriverdata is a pointer to a char * file name that the wav writer will output to.
+ - FMOD_OUTPUTTYPE_WAVWRITER_NRT - extradriverdata is a pointer to a char * file name that the wav writer will output to.
+ - FMOD_OUTPUTTYPE_DSOUND - extradriverdata is cast to a HWND type, so that FMOD can set the focus on the audio for a particular window.
+ - FMOD_OUTPUTTYPE_PS3 - extradriverdata is a pointer to a FMOD_PS3_EXTRADRIVERDATA struct. This can be found in fmodps3.h.
+ - FMOD_OUTPUTTYPE_XAUDIO - (Xbox360) extradriverdata is a pointer to a FMOD_360_EXTRADRIVERDATA struct. This can be found in fmodxbox360.h.
+
+ Currently these are the only FMOD drivers that take extra information. Other unknown plugins may have different requirements.
+
+ Note! If FMOD_OUTPUTTYPE_WAVWRITER_NRT or FMOD_OUTPUTTYPE_NOSOUND_NRT are used, and if the System::update function is being called
+ very quickly (ie for a non realtime decode) it may be being called too quickly for the FMOD streamer thread to respond to.
+ The result will be a skipping/stuttering output in the captured audio.
+
+ To remedy this, disable the FMOD streamer thread, and use FMOD_INIT_STREAM_FROM_UPDATE to avoid skipping in the output stream,
+ as it will lock the mixer and the streamer together in the same thread.
+
+ [SEE_ALSO]
+ System::setOutput
+ System::getOutput
+ System::init
+ System::update
+]
+*/
+typedef enum
+{
+ FMOD_OUTPUTTYPE_AUTODETECT, /* Picks the best output mode for the platform. This is the default. */
+
+ FMOD_OUTPUTTYPE_UNKNOWN, /* All - 3rd party plugin, unknown. This is for use with System::getOutput only. */
+ FMOD_OUTPUTTYPE_NOSOUND, /* All - Perform all mixing but discard the final output. */
+ FMOD_OUTPUTTYPE_WAVWRITER, /* All - Writes output to a .wav file. */
+ FMOD_OUTPUTTYPE_NOSOUND_NRT, /* All - Non-realtime version of FMOD_OUTPUTTYPE_NOSOUND. User can drive mixer with System::update at whatever rate they want. */
+ FMOD_OUTPUTTYPE_WAVWRITER_NRT, /* All - Non-realtime version of FMOD_OUTPUTTYPE_WAVWRITER. User can drive mixer with System::update at whatever rate they want. */
+
+ FMOD_OUTPUTTYPE_DSOUND, /* Win - Direct Sound. (Default on Windows XP and below) */
+ FMOD_OUTPUTTYPE_WINMM, /* Win - Windows Multimedia. */
+ FMOD_OUTPUTTYPE_WASAPI, /* Win/WinStore/XboxOne - Windows Audio Session API. (Default on Windows Vista and above, Xbox One and Windows Store Applications) */
+ FMOD_OUTPUTTYPE_ASIO, /* Win - Low latency ASIO 2.0. */
+ FMOD_OUTPUTTYPE_PULSEAUDIO, /* Linux - Pulse Audio. (Default on Linux if available) */
+ FMOD_OUTPUTTYPE_ALSA, /* Linux - Advanced Linux Sound Architecture. (Default on Linux if PulseAudio isn't available) */
+ FMOD_OUTPUTTYPE_COREAUDIO, /* Mac/iOS - Core Audio. (Default on Mac and iOS) */
+ FMOD_OUTPUTTYPE_XAUDIO, /* Xbox 360 - XAudio. (Default on Xbox 360) */
+ FMOD_OUTPUTTYPE_PS3, /* PS3 - Audio Out. (Default on PS3) */
+ FMOD_OUTPUTTYPE_AUDIOTRACK, /* Android - Java Audio Track. (Default on Android 2.2 and below) */
+ FMOD_OUTPUTTYPE_OPENSL, /* Android - OpenSL ES. (Default on Android 2.3 and above) */
+ FMOD_OUTPUTTYPE_WIIU, /* Wii U - AX. (Default on Wii U) */
+ FMOD_OUTPUTTYPE_AUDIOOUT, /* PS4/PSVita - Audio Out. (Default on PS4 and PS Vita) */
+ FMOD_OUTPUTTYPE_AUDIO3D, /* PS4 - Audio3D. */
+ FMOD_OUTPUTTYPE_ATMOS, /* Win - Dolby Atmos (WASAPI). */
+ FMOD_OUTPUTTYPE_WEBAUDIO, /* Web Browser - JavaScript webaudio output. (Default on JavaScript) */
+ FMOD_OUTPUTTYPE_NNAUDIO, /* NX - NX nn::audio. (Default on NX)*/
+
+ FMOD_OUTPUTTYPE_MAX, /* Maximum number of output types supported. */
+ FMOD_OUTPUTTYPE_FORCEINT = 65536 /* Makes sure this enum is signed 32bit. */
+} FMOD_OUTPUTTYPE;
+
+
+/*
+[ENUM]
+[
+ [DESCRIPTION]
+ Specify the destination of log output when using the logging version of FMOD.
+
+ [REMARKS]
+ TTY destination can vary depending on platform, common examples include the
+ Visual Studio / Xcode output window, stderr and LogCat.
+
+ [SEE_ALSO]
+ FMOD_Debug_Initialize
+]
+*/
+typedef enum
+{
+ FMOD_DEBUG_MODE_TTY, /* Default log location per platform, i.e. Visual Studio output window, stderr, LogCat, etc */
+ FMOD_DEBUG_MODE_FILE, /* Write log to specified file path */
+ FMOD_DEBUG_MODE_CALLBACK, /* Call specified callback with log information */
+
+ FMOD_DEBUG_MODE_FORCEINT = 65536 /* Makes sure this enum is signed 32bit. */
+} FMOD_DEBUG_MODE;
+
+
+/*
+[DEFINE]
+[
+ [NAME]
+ FMOD_DEBUG_FLAGS
+
+ [DESCRIPTION]
+ Specify the requested information to be output when using the logging version of FMOD.
+
+ [REMARKS]
+
+ [SEE_ALSO]
+ FMOD_Debug_Initialize
+]
+*/
+#define FMOD_DEBUG_LEVEL_NONE 0x00000000 /* Disable all messages */
+#define FMOD_DEBUG_LEVEL_ERROR 0x00000001 /* Enable only error messages. */
+#define FMOD_DEBUG_LEVEL_WARNING 0x00000002 /* Enable warning and error messages. */
+#define FMOD_DEBUG_LEVEL_LOG 0x00000004 /* Enable informational, warning and error messages (default). */
+#define FMOD_DEBUG_TYPE_MEMORY 0x00000100 /* Verbose logging for memory operations, only use this if you are debugging a memory related issue. */
+#define FMOD_DEBUG_TYPE_FILE 0x00000200 /* Verbose logging for file access, only use this if you are debugging a file related issue. */
+#define FMOD_DEBUG_TYPE_CODEC 0x00000400 /* Verbose logging for codec initialization, only use this if you are debugging a codec related issue. */
+#define FMOD_DEBUG_TYPE_TRACE 0x00000800 /* Verbose logging for internal errors, use this for tracking the origin of error codes. */
+#define FMOD_DEBUG_DISPLAY_TIMESTAMPS 0x00010000 /* Display the time stamp of the log message in milliseconds. */
+#define FMOD_DEBUG_DISPLAY_LINENUMBERS 0x00020000 /* Display the source code file and line number for where the message originated. */
+#define FMOD_DEBUG_DISPLAY_THREAD 0x00040000 /* Display the thread ID of the calling function that generated the message. */
+/* [DEFINE_END] */
+
+
+/*
+[DEFINE]
+[
+ [NAME]
+ FMOD_MEMORY_TYPE
+
+ [DESCRIPTION]
+ Bit fields for memory allocation type being passed into FMOD memory callbacks.
+
+ [REMARKS]
+ Remember this is a bitfield. You may get more than 1 bit set (ie physical + persistent) so do not simply switch on the types! You must check each bit individually or clear out the bits that you do not want within the callback.
+ Bits can be excluded if you want during Memory_Initialize so that you never get them.
+
+ [SEE_ALSO]
+ FMOD_MEMORY_ALLOC_CALLBACK
+ FMOD_MEMORY_REALLOC_CALLBACK
+ FMOD_MEMORY_FREE_CALLBACK
+ Memory_Initialize
+]
+*/
+#define FMOD_MEMORY_NORMAL 0x00000000 /* Standard memory. */
+#define FMOD_MEMORY_STREAM_FILE 0x00000001 /* Stream file buffer, size controllable with System::setStreamBufferSize. */
+#define FMOD_MEMORY_STREAM_DECODE 0x00000002 /* Stream decode buffer, size controllable with FMOD_CREATESOUNDEXINFO::decodebuffersize. */
+#define FMOD_MEMORY_SAMPLEDATA 0x00000004 /* Sample data buffer. Raw audio data, usually PCM/MPEG/ADPCM/XMA data. */
+#define FMOD_MEMORY_DSP_BUFFER 0x00000008 /* DSP memory block allocated when more than 1 output exists on a DSP node. */
+#define FMOD_MEMORY_PLUGIN 0x00000010 /* Memory allocated by a third party plugin. */
+#define FMOD_MEMORY_XBOX360_PHYSICAL 0x00100000 /* Requires XPhysicalAlloc / XPhysicalFree. */
+#define FMOD_MEMORY_PERSISTENT 0x00200000 /* Persistent memory. Memory will be freed when System::release is called. */
+#define FMOD_MEMORY_SECONDARY 0x00400000 /* Secondary memory. Allocation should be in secondary memory. For example RSX on the PS3. */
+#define FMOD_MEMORY_ALL 0xFFFFFFFF
+/* [DEFINE_END] */
+
+
+/*
+[ENUM]
+[
+ [DESCRIPTION]
+ These are speaker types defined for use with the System::setSoftwareFormat command.
+
+ [REMARKS]
+ Note below the phrase 'sound channels' is used. These are the subchannels inside a sound, they are not related and
+ have nothing to do with the FMOD class "Channel".
+ For example a mono sound has 1 sound channel, a stereo sound has 2 sound channels, and an AC3 or 6 channel wav file have 6 "sound channels".
+
+ FMOD_SPEAKERMODE_RAW
+ ---------------------
+ This mode is for output devices that are not specifically mono/stereo/quad/surround/5.1 or 7.1, but are multichannel.
+ Use System::setSoftwareFormat to specify the number of speakers you want to address, otherwise it will default to 2 (stereo).
+ Sound channels map to speakers sequentially, so a mono sound maps to output speaker 0, stereo sound maps to output speaker 0 & 1.
+ The user assumes knowledge of the speaker order. FMOD_SPEAKER enumerations may not apply, so raw channel indices should be used.
+ Multichannel sounds map input channels to output channels 1:1.
+ Channel::setPan and Channel::setPanLevels do not work.
+ Speaker levels must be manually set with Channel::setPanMatrix.
+
+ FMOD_SPEAKERMODE_MONO
+ ---------------------
+ This mode is for a 1 speaker arrangement.
+ Panning does not work in this speaker mode.
+ Mono, stereo and multichannel sounds have each sound channel played on the one speaker unity.
+ Mix behavior for multichannel sounds can be set with Channel::setPanMatrix.
+ Channel::setPanLevels does not work.
+
+ FMOD_SPEAKERMODE_STEREO
+ -----------------------
+ This mode is for 2 speaker arrangements that have a left and right speaker.
+
Mono sounds default to an even distribution between left and right. They can be panned with Channel::setPan.
+
Stereo sounds default to the middle, or full left in the left speaker and full right in the right speaker.
+
They can be cross faded with Channel::setPan.
+
Multichannel sounds have each sound channel played on each speaker at unity.
+
Mix behavior for multichannel sounds can be set with Channel::setPanMatrix.
+
Channel::setPanLevels works but only front left and right parameters are used, the rest are ignored.
+
+ FMOD_SPEAKERMODE_QUAD
+ ------------------------
+ This mode is for 4 speaker arrangements that have a front left, front right, surround left and a surround right speaker.
+
Mono sounds default to an even distribution between front left and front right. They can be panned with Channel::setPan.
+
Stereo sounds default to the left sound channel played on the front left, and the right sound channel played on the front right.
+
They can be cross faded with Channel::setPan.
+
Multichannel sounds default to all of their sound channels being played on each speaker in order of input.
+
Mix behavior for multichannel sounds can be set with Channel::setPanMatrix.
+
Channel::setPanLevels works but rear left, rear right, center and lfe are ignored.
+
+ FMOD_SPEAKERMODE_SURROUND
+ ------------------------
+ This mode is for 5 speaker arrangements that have a left/right/center/surround left/surround right.
+
Mono sounds default to the center speaker. They can be panned with Channel::setPan.
+
Stereo sounds default to the left sound channel played on the front left, and the right sound channel played on the front right.
+
They can be cross faded with Channel::setPan.
+
Multichannel sounds default to all of their sound channels being played on each speaker in order of input.
+
Mix behavior for multichannel sounds can be set with Channel::setPanMatrix.
+
Channel::setPanLevels works but rear left / rear right are ignored.
+
+ FMOD_SPEAKERMODE_5POINT1
+ ---------------------------------------------------------
+ This mode is for 5.1 speaker arrangements that have a left/right/center/surround left/surround right and a subwoofer speaker.
+
Mono sounds default to the center speaker. They can be panned with Channel::setPan.
+
Stereo sounds default to the left sound channel played on the front left, and the right sound channel played on the front right.
+
They can be cross faded with Channel::setPan.
+
Multichannel sounds default to all of their sound channels being played on each speaker in order of input.
+
Mix behavior for multichannel sounds can be set with Channel::setPanMatrix.
+
Channel::setPanLevels works but rear left / rear right are ignored.
+
+ FMOD_SPEAKERMODE_7POINT1
+ ------------------------
+ This mode is for 7.1 speaker arrangements that have a left/right/center/surround left/surround right/rear left/rear right
+ and a subwoofer speaker.
+
Mono sounds default to the center speaker. They can be panned with Channel::setPan.
+
Stereo sounds default to the left sound channel played on the front left, and the right sound channel played on the front right.
+
They can be cross faded with Channel::setPan.
+
Multichannel sounds default to all of their sound channels being played on each speaker in order of input.
+
Mix behavior for multichannel sounds can be set with Channel::setPanMatrix.
+
Channel::setPanLevels works and every parameter is used to set the balance of a sound in any speaker.
+
+
+ [SEE_ALSO]
+ System::setSoftwareFormat
+ System::getSoftwareFormat
+ DSP::setChannelFormat
+]
+*/
+typedef enum
+{
+ FMOD_SPEAKERMODE_DEFAULT, /* Default speaker mode based on operating system/output mode. Windows = control panel setting, Xbox = 5.1, PS3 = 7.1 etc. */
+ FMOD_SPEAKERMODE_RAW, /* There is no specific speakermode. Sound channels are mapped in order of input to output. Use System::setSoftwareFormat to specify speaker count. See remarks for more information. */
+ FMOD_SPEAKERMODE_MONO, /* The speakers are monaural. */
+ FMOD_SPEAKERMODE_STEREO, /* The speakers are stereo. */
+ FMOD_SPEAKERMODE_QUAD, /* 4 speaker setup. This includes front left, front right, surround left, surround right. */
+ FMOD_SPEAKERMODE_SURROUND, /* 5 speaker setup. This includes front left, front right, center, surround left, surround right. */
+ FMOD_SPEAKERMODE_5POINT1, /* 5.1 speaker setup. This includes front left, front right, center, surround left, surround right and an LFE speaker. */
+ FMOD_SPEAKERMODE_7POINT1, /* 7.1 speaker setup. This includes front left, front right, center, surround left, surround right, back left, back right and an LFE speaker. */
+
+ FMOD_SPEAKERMODE_MAX, /* Maximum number of speaker modes supported. */
+ FMOD_SPEAKERMODE_FORCEINT = 65536 /* Makes sure this enum is signed 32bit. */
+} FMOD_SPEAKERMODE;
+
+
+/*
+[DEFINE]
+[
+ [NAME]
+ FMOD_MAX_CHANNEL_WIDTH
+
+ [DESCRIPTION]
+ The maximum number of channels per frame of audio supported by audio files, buffers, connections and DSPs.
+
+ [REMARKS]
+
+ [SEE_ALSO]
+ FMOD_CHANNELORDER
+ FMOD_CREATESOUNDEXINFO
+ System::setSoftwareFormat
+ System::getDefaultMixMatrix
+ ChannelControl::setMixMatrix
+ ChannelControl::getMixMatrix
+ FMOD::DSP::setChannelFormat
+]
+*/
+#define FMOD_MAX_CHANNEL_WIDTH 32
+/* [DEFINE_END] */
+
+/*
+[DEFINE]
+[
+ [NAME]
+ FMOD_MAX_LISTENERS
+
+ [DESCRIPTION]
+ The maximum number of listeners supported.
+
+ [REMARKS]
+
+ [SEE_ALSO]
+ System::set3DNumListeners
+ System::set3DListenerAttributes
+ System::get3DListenerAttributes
+]
+*/
+#define FMOD_MAX_LISTENERS 8
+/* [DEFINE_END] */
+
+
+/*
+[ENUM]
+[
+ [DESCRIPTION]
+ Assigns an enumeration for a speaker index.
+
+ [REMARKS]
+
+ [SEE_ALSO]
+ System::setSpeakerPosition
+ System::getSpeakerPosition
+]
+*/
+typedef enum
+{
+ FMOD_SPEAKER_FRONT_LEFT, /* The front left speaker */
+ FMOD_SPEAKER_FRONT_RIGHT, /* The front right speaker */
+ FMOD_SPEAKER_FRONT_CENTER, /* The front center speaker */
+ FMOD_SPEAKER_LOW_FREQUENCY, /* The LFE or 'subwoofer' speaker */
+ FMOD_SPEAKER_SURROUND_LEFT, /* The surround left (usually to the side) speaker */
+ FMOD_SPEAKER_SURROUND_RIGHT, /* The surround right (usually to the side) speaker */
+ FMOD_SPEAKER_BACK_LEFT, /* The back left speaker */
+ FMOD_SPEAKER_BACK_RIGHT, /* The back right speaker */
+
+ FMOD_SPEAKER_MAX, /* Maximum number of speaker types supported. */
+ FMOD_SPEAKER_FORCEINT = 65536 /* Makes sure this enum is signed 32bit. */
+} FMOD_SPEAKER;
+
+
+/*
+[DEFINE]
+[
+ [NAME]
+ FMOD_CHANNELMASK
+
+ [DESCRIPTION]
+ These are bitfields to describe for a certain number of channels in a signal, which channels are being represented.
+ For example, a signal could be 1 channel, but contain the LFE channel only.
+
+ [REMARKS]
+ FMOD_CHANNELMASK_BACK_CENTER is not represented as an output speaker in fmod - but it is encountered in input formats and is down or upmixed appropriately to the nearest speakers.
+
+ [SEE_ALSO]
+ DSP::setChannelFormat
+ DSP::getChannelFormat
+ FMOD_SPEAKERMODE
+]
+*/
+#define FMOD_CHANNELMASK_FRONT_LEFT 0x00000001
+#define FMOD_CHANNELMASK_FRONT_RIGHT 0x00000002
+#define FMOD_CHANNELMASK_FRONT_CENTER 0x00000004
+#define FMOD_CHANNELMASK_LOW_FREQUENCY 0x00000008
+#define FMOD_CHANNELMASK_SURROUND_LEFT 0x00000010
+#define FMOD_CHANNELMASK_SURROUND_RIGHT 0x00000020
+#define FMOD_CHANNELMASK_BACK_LEFT 0x00000040
+#define FMOD_CHANNELMASK_BACK_RIGHT 0x00000080
+#define FMOD_CHANNELMASK_BACK_CENTER 0x00000100
+
+#define FMOD_CHANNELMASK_MONO (FMOD_CHANNELMASK_FRONT_LEFT)
+#define FMOD_CHANNELMASK_STEREO (FMOD_CHANNELMASK_FRONT_LEFT | FMOD_CHANNELMASK_FRONT_RIGHT)
+#define FMOD_CHANNELMASK_LRC (FMOD_CHANNELMASK_FRONT_LEFT | FMOD_CHANNELMASK_FRONT_RIGHT | FMOD_CHANNELMASK_FRONT_CENTER)
+#define FMOD_CHANNELMASK_QUAD (FMOD_CHANNELMASK_FRONT_LEFT | FMOD_CHANNELMASK_FRONT_RIGHT | FMOD_CHANNELMASK_SURROUND_LEFT | FMOD_CHANNELMASK_SURROUND_RIGHT)
+#define FMOD_CHANNELMASK_SURROUND (FMOD_CHANNELMASK_FRONT_LEFT | FMOD_CHANNELMASK_FRONT_RIGHT | FMOD_CHANNELMASK_FRONT_CENTER | FMOD_CHANNELMASK_SURROUND_LEFT | FMOD_CHANNELMASK_SURROUND_RIGHT)
+#define FMOD_CHANNELMASK_5POINT1 (FMOD_CHANNELMASK_FRONT_LEFT | FMOD_CHANNELMASK_FRONT_RIGHT | FMOD_CHANNELMASK_FRONT_CENTER | FMOD_CHANNELMASK_LOW_FREQUENCY | FMOD_CHANNELMASK_SURROUND_LEFT | FMOD_CHANNELMASK_SURROUND_RIGHT)
+#define FMOD_CHANNELMASK_5POINT1_REARS (FMOD_CHANNELMASK_FRONT_LEFT | FMOD_CHANNELMASK_FRONT_RIGHT | FMOD_CHANNELMASK_FRONT_CENTER | FMOD_CHANNELMASK_LOW_FREQUENCY | FMOD_CHANNELMASK_BACK_LEFT | FMOD_CHANNELMASK_BACK_RIGHT)
+#define FMOD_CHANNELMASK_7POINT0 (FMOD_CHANNELMASK_FRONT_LEFT | FMOD_CHANNELMASK_FRONT_RIGHT | FMOD_CHANNELMASK_FRONT_CENTER | FMOD_CHANNELMASK_SURROUND_LEFT | FMOD_CHANNELMASK_SURROUND_RIGHT | FMOD_CHANNELMASK_BACK_LEFT | FMOD_CHANNELMASK_BACK_RIGHT)
+#define FMOD_CHANNELMASK_7POINT1 (FMOD_CHANNELMASK_FRONT_LEFT | FMOD_CHANNELMASK_FRONT_RIGHT | FMOD_CHANNELMASK_FRONT_CENTER | FMOD_CHANNELMASK_LOW_FREQUENCY | FMOD_CHANNELMASK_SURROUND_LEFT | FMOD_CHANNELMASK_SURROUND_RIGHT | FMOD_CHANNELMASK_BACK_LEFT | FMOD_CHANNELMASK_BACK_RIGHT)
+/* [DEFINE_END] */
+
+/*
+[ENUM]
+[
+ [DESCRIPTION]
+ When creating a multichannel sound, FMOD will pan them to their default speaker locations, for example a 6 channel sound will default to one channel per 5.1 output speaker.
+ Another example is a stereo sound. It will default to left = front left, right = front right.
+
+ This is for sounds that are not 'default'. For example you might have a sound that is 6 channels but actually made up of 3 stereo pairs, that should all be located in front left, front right only.
+
+ [REMARKS]
+
+ [SEE_ALSO]
+ FMOD_CREATESOUNDEXINFO
+ FMOD_MAX_CHANNEL_WIDTH
+]
+*/
+typedef enum FMOD_CHANNELORDER
+{
+ FMOD_CHANNELORDER_DEFAULT, /* Left, Right, Center, LFE, Surround Left, Surround Right, Back Left, Back Right (see FMOD_SPEAKER enumeration) */
+ FMOD_CHANNELORDER_WAVEFORMAT, /* Left, Right, Center, LFE, Back Left, Back Right, Surround Left, Surround Right (as per Microsoft .wav WAVEFORMAT structure master order) */
+ FMOD_CHANNELORDER_PROTOOLS, /* Left, Center, Right, Surround Left, Surround Right, LFE */
+ FMOD_CHANNELORDER_ALLMONO, /* Mono, Mono, Mono, Mono, Mono, Mono, ... (each channel all the way up to FMOD_MAX_CHANNEL_WIDTH channels are treated as if they were mono) */
+ FMOD_CHANNELORDER_ALLSTEREO, /* Left, Right, Left, Right, Left, Right, ... (each pair of channels is treated as stereo all the way up to FMOD_MAX_CHANNEL_WIDTH channels) */
+ FMOD_CHANNELORDER_ALSA, /* Left, Right, Surround Left, Surround Right, Center, LFE (as per Linux ALSA channel order) */
+
+ FMOD_CHANNELORDER_MAX, /* Maximum number of channel orderings supported. */
+ FMOD_CHANNELORDER_FORCEINT = 65536 /* Makes sure this enum is signed 32bit. */
+} FMOD_CHANNELORDER;
+
+
+/*
+[ENUM]
+[
+ [DESCRIPTION]
+ These are plugin types defined for use with the System::getNumPlugins,
+ System::getPluginInfo and System::unloadPlugin functions.
+
+ [REMARKS]
+
+ [SEE_ALSO]
+ System::getNumPlugins
+ System::getPluginInfo
+ System::unloadPlugin
+]
+*/
+typedef enum
+{
+ FMOD_PLUGINTYPE_OUTPUT, /* The plugin type is an output module. FMOD mixed audio will play through one of these devices */
+ FMOD_PLUGINTYPE_CODEC, /* The plugin type is a file format codec. FMOD will use these codecs to load file formats for playback. */
+ FMOD_PLUGINTYPE_DSP, /* The plugin type is a DSP unit. FMOD will use these plugins as part of its DSP network to apply effects to output or generate sound in realtime. */
+
+ FMOD_PLUGINTYPE_MAX, /* Maximum number of plugin types supported. */
+ FMOD_PLUGINTYPE_FORCEINT = 65536 /* Makes sure this enum is signed 32bit. */
+} FMOD_PLUGINTYPE;
+
+/*
+[STRUCTURE]
+[
+ [DESCRIPTION]
+ Used to support lists of plugins within the one file.
+
+ [REMARKS]
+ The description field is either a pointer to FMOD_DSP_DESCRIPTION, FMOD_OUTPUT_DESCRIPTION, FMOD_CODEC_DESCRIPTION.
+
+ This structure is returned from a plugin as a pointer to a list where the last entry has FMOD_PLUGINTYPE_MAX and
+ a null description pointer.
+
+ [SEE_ALSO]
+ System::getNumNestedPlugins
+ System::getNestedPlugin
+]
+*/
+typedef struct FMOD_PLUGINLIST
+{
+ FMOD_PLUGINTYPE type; /* The plugin type */
+ void* description; /* One of FMOD_DSP_DESCRIPTION, FMOD_OUTPUT_DESCRIPTION, FMOD_CODEC_DESCRIPTION */
+} FMOD_PLUGINLIST;
+
+
+/*
+[DEFINE]
+[
+ [NAME]
+ FMOD_INITFLAGS
+
+ [DESCRIPTION]
+ Initialization flags. Use them with System::init in the *flags* parameter to change various behavior.
+
+ [REMARKS]
+ Use System::setAdvancedSettings to adjust settings for some of the features that are enabled by these flags.
+
+ [SEE_ALSO]
+ System::init
+ System::update
+ System::setAdvancedSettings
+ Channel::set3DOcclusion
+]
+*/
+#define FMOD_INIT_NORMAL 0x00000000 /* Initialize normally */
+#define FMOD_INIT_STREAM_FROM_UPDATE 0x00000001 /* No stream thread is created internally. Streams are driven from System::update. Mainly used with non-realtime outputs. */
+#define FMOD_INIT_MIX_FROM_UPDATE 0x00000002 /* No mixer thread is created internally. Mixing is driven from System::update. Only applies to polling based output modes such as FMOD_OUTPUTTYPE_NOSOUND, FMOD_OUTPUTTYPE_WAVWRITER, FMOD_OUTPUTTYPE_DSOUND, FMOD_OUTPUTTYPE_WINMM,FMOD_OUTPUTTYPE_XAUDIO. */
+#define FMOD_INIT_3D_RIGHTHANDED 0x00000004 /* FMOD will treat +X as right, +Y as up and +Z as backwards (towards you). */
+#define FMOD_INIT_CHANNEL_LOWPASS 0x00000100 /* All FMOD_3D based voices will add a software lowpass filter effect into the DSP chain which is automatically used when Channel::set3DOcclusion is used or the geometry API. This also causes sounds to sound duller when the sound goes behind the listener, as a fake HRTF style effect. Use System::setAdvancedSettings to disable or adjust cutoff frequency for this feature. */
+#define FMOD_INIT_CHANNEL_DISTANCEFILTER 0x00000200 /* All FMOD_3D based voices will add a software lowpass and highpass filter effect into the DSP chain which will act as a distance-automated bandpass filter. Use System::setAdvancedSettings to adjust the center frequency. */
+#define FMOD_INIT_PROFILE_ENABLE 0x00010000 /* Enable TCP/IP based host which allows FMOD Designer or FMOD Profiler to connect to it, and view memory, CPU and the DSP network graph in real-time. */
+#define FMOD_INIT_VOL0_BECOMES_VIRTUAL 0x00020000 /* Any sounds that are 0 volume will go virtual and not be processed except for having their positions updated virtually. Use System::setAdvancedSettings to adjust what volume besides zero to switch to virtual at. */
+#define FMOD_INIT_GEOMETRY_USECLOSEST 0x00040000 /* With the geometry engine, only process the closest polygon rather than accumulating all polygons the sound to listener line intersects. */
+#define FMOD_INIT_PREFER_DOLBY_DOWNMIX 0x00080000 /* When using FMOD_SPEAKERMODE_5POINT1 with a stereo output device, use the Dolby Pro Logic II downmix algorithm instead of the SRS Circle Surround algorithm. */
+#define FMOD_INIT_THREAD_UNSAFE 0x00100000 /* Disables thread safety for API calls. Only use this if FMOD low level is being called from a single thread, and if Studio API is not being used! */
+#define FMOD_INIT_PROFILE_METER_ALL 0x00200000 /* Slower, but adds level metering for every single DSP unit in the graph. Use DSP::setMeteringEnabled to turn meters off individually. */
+#define FMOD_INIT_DISABLE_SRS_HIGHPASSFILTER 0x00400000 /* Using FMOD_SPEAKERMODE_5POINT1 with a stereo output device will enable the SRS Circle Surround downmixer. By default the SRS downmixer applies a high pass filter with a cutoff frequency of 80Hz. Use this flag to diable the high pass fitler, or use FMOD_INIT_PREFER_DOLBY_DOWNMIX to use the Dolby Pro Logic II downmix algorithm instead. */
+/* [DEFINE_END] */
+
+
+/*
+[ENUM]
+[
+ [DESCRIPTION]
+ These definitions describe the type of song being played.
+
+ [REMARKS]
+
+ [SEE_ALSO]
+ Sound::getFormat
+]
+*/
+typedef enum
+{
+ FMOD_SOUND_TYPE_UNKNOWN, /* 3rd party / unknown plugin format. */
+ FMOD_SOUND_TYPE_AIFF, /* AIFF. */
+ FMOD_SOUND_TYPE_ASF, /* Microsoft Advanced Systems Format (ie WMA/ASF/WMV). */
+ FMOD_SOUND_TYPE_DLS, /* Sound font / downloadable sound bank. */
+ FMOD_SOUND_TYPE_FLAC, /* FLAC lossless codec. */
+ FMOD_SOUND_TYPE_FSB, /* FMOD Sample Bank. */
+ FMOD_SOUND_TYPE_IT, /* Impulse Tracker. */
+ FMOD_SOUND_TYPE_MIDI, /* MIDI. */
+ FMOD_SOUND_TYPE_MOD, /* Protracker / Fasttracker MOD. */
+ FMOD_SOUND_TYPE_MPEG, /* MP2/MP3 MPEG. */
+ FMOD_SOUND_TYPE_OGGVORBIS, /* Ogg vorbis. */
+ FMOD_SOUND_TYPE_PLAYLIST, /* Information only from ASX/PLS/M3U/WAX playlists */
+ FMOD_SOUND_TYPE_RAW, /* Raw PCM data. */
+ FMOD_SOUND_TYPE_S3M, /* ScreamTracker 3. */
+ FMOD_SOUND_TYPE_USER, /* User created sound. */
+ FMOD_SOUND_TYPE_WAV, /* Microsoft WAV. */
+ FMOD_SOUND_TYPE_XM, /* FastTracker 2 XM. */
+ FMOD_SOUND_TYPE_XMA, /* Xbox360 XMA */
+ FMOD_SOUND_TYPE_AUDIOQUEUE, /* iPhone hardware decoder, supports AAC, ALAC and MP3. */
+ FMOD_SOUND_TYPE_AT9, /* PS4 / PSVita ATRAC 9 format */
+ FMOD_SOUND_TYPE_VORBIS, /* Vorbis */
+ FMOD_SOUND_TYPE_MEDIA_FOUNDATION,/* Windows Store Application built in system codecs */
+ FMOD_SOUND_TYPE_MEDIACODEC, /* Android MediaCodec */
+ FMOD_SOUND_TYPE_FADPCM, /* FMOD Adaptive Differential Pulse Code Modulation */
+
+ FMOD_SOUND_TYPE_MAX, /* Maximum number of sound types supported. */
+ FMOD_SOUND_TYPE_FORCEINT = 65536 /* Makes sure this enum is signed 32bit. */
+} FMOD_SOUND_TYPE;
+
+
+/*
+[ENUM]
+[
+ [DESCRIPTION]
+ These definitions describe the native format of the hardware or software buffer that will be used.
+
+ [REMARKS]
+ This is the format the native hardware or software buffer will be or is created in.
+
+ [SEE_ALSO]
+ System::createSound
+ Sound::getFormat
+]
+*/
+typedef enum
+{
+ FMOD_SOUND_FORMAT_NONE, /* Unitialized / unknown. */
+ FMOD_SOUND_FORMAT_PCM8, /* 8bit integer PCM data. */
+ FMOD_SOUND_FORMAT_PCM16, /* 16bit integer PCM data. */
+ FMOD_SOUND_FORMAT_PCM24, /* 24bit integer PCM data. */
+ FMOD_SOUND_FORMAT_PCM32, /* 32bit integer PCM data. */
+ FMOD_SOUND_FORMAT_PCMFLOAT, /* 32bit floating point PCM data. */
+ FMOD_SOUND_FORMAT_BITSTREAM, /* Sound data is in its native compressed format. */
+
+ FMOD_SOUND_FORMAT_MAX, /* Maximum number of sound formats supported. */
+ FMOD_SOUND_FORMAT_FORCEINT = 65536 /* Makes sure this enum is signed 32bit. */
+} FMOD_SOUND_FORMAT;
+
+
+/*
+[DEFINE]
+[
+ [NAME]
+ FMOD_MODE
+
+ [DESCRIPTION]
+ Sound description bitfields, bitwise OR them together for loading and describing sounds.
+
+ [REMARKS]
+ By default a sound will open as a static sound that is decompressed fully into memory to PCM. (ie equivalent of FMOD_CREATESAMPLE)
+ To have a sound stream instead, use FMOD_CREATESTREAM, or use the wrapper function System::createStream.
+ Some opening modes (ie FMOD_OPENUSER, FMOD_OPENMEMORY, FMOD_OPENMEMORY_POINT, FMOD_OPENRAW) will need extra information.
+ This can be provided using the FMOD_CREATESOUNDEXINFO structure.
+
+ Specifying FMOD_OPENMEMORY_POINT will POINT to your memory rather allocating its own sound buffers and duplicating it internally.
+ This means you cannot free the memory while FMOD is using it, until after Sound::release is called.
+ With FMOD_OPENMEMORY_POINT, for PCM formats, only WAV, FSB, and RAW are supported. For compressed formats, only those formats supported by FMOD_CREATECOMPRESSEDSAMPLE are supported.
+ With FMOD_OPENMEMORY_POINT and FMOD_OPENRAW or PCM, if using them together, note that you must pad the data on each side by 16 bytes. This is so fmod can modify the ends of the data for looping/interpolation/mixing purposes. If a wav file, you will need to insert silence, and then reset loop points to stop the playback from playing that silence.
+
+ Xbox 360 memory On Xbox 360 Specifying FMOD_OPENMEMORY_POINT to a virtual memory address will cause FMOD_ERR_INVALID_ADDRESS
+ to be returned. Use physical memory only for this functionality.
+
+ FMOD_LOWMEM is used on a sound if you want to minimize the memory overhead, by having FMOD not allocate memory for certain
+ features that are not likely to be used in a game environment. These are :
+ 1. Sound::getName functionality is removed. 256 bytes per sound is saved.
+
+ [SEE_ALSO]
+ System::createSound
+ System::createStream
+ Sound::setMode
+ Sound::getMode
+ Channel::setMode
+ Channel::getMode
+ Sound::set3DCustomRolloff
+ Channel::set3DCustomRolloff
+ Sound::getOpenState
+]
+*/
+#define FMOD_DEFAULT 0x00000000 /* Default for all modes listed below. FMOD_LOOP_OFF, FMOD_2D, FMOD_3D_WORLDRELATIVE, FMOD_3D_INVERSEROLLOFF */
+#define FMOD_LOOP_OFF 0x00000001 /* For non looping sounds. (DEFAULT). Overrides FMOD_LOOP_NORMAL / FMOD_LOOP_BIDI. */
+#define FMOD_LOOP_NORMAL 0x00000002 /* For forward looping sounds. */
+#define FMOD_LOOP_BIDI 0x00000004 /* For bidirectional looping sounds. (only works on software mixed static sounds). */
+#define FMOD_2D 0x00000008 /* Ignores any 3d processing. (DEFAULT). */
+#define FMOD_3D 0x00000010 /* Makes the sound positionable in 3D. Overrides FMOD_2D. */
+#define FMOD_CREATESTREAM 0x00000080 /* Decompress at runtime, streaming from the source provided (ie from disk). Overrides FMOD_CREATESAMPLE and FMOD_CREATECOMPRESSEDSAMPLE. Note a stream can only be played once at a time due to a stream only having 1 stream buffer and file handle. Open multiple streams to have them play concurrently. */
+#define FMOD_CREATESAMPLE 0x00000100 /* Decompress at loadtime, decompressing or decoding whole file into memory as the target sample format (ie PCM). Fastest for playback and most flexible. */
+#define FMOD_CREATECOMPRESSEDSAMPLE 0x00000200 /* Load MP2/MP3/FADPCM/IMAADPCM/Vorbis/AT9 or XMA into memory and leave it compressed. Vorbis/AT9/FADPCM encoding only supported in the .FSB container format. During playback the FMOD software mixer will decode it in realtime as a 'compressed sample'. Overrides FMOD_CREATESAMPLE. If the sound data is not one of the supported formats, it will behave as if it was created with FMOD_CREATESAMPLE and decode the sound into PCM. */
+#define FMOD_OPENUSER 0x00000400 /* Opens a user created static sample or stream. Use FMOD_CREATESOUNDEXINFO to specify format and/or read callbacks. If a user created 'sample' is created with no read callback, the sample will be empty. Use Sound::lock and Sound::unlock to place sound data into the sound if this is the case. */
+#define FMOD_OPENMEMORY 0x00000800 /* "name_or_data" will be interpreted as a pointer to memory instead of filename for creating sounds. Use FMOD_CREATESOUNDEXINFO to specify length. If used with FMOD_CREATESAMPLE or FMOD_CREATECOMPRESSEDSAMPLE, FMOD duplicates the memory into its own buffers. Your own buffer can be freed after open. If used with FMOD_CREATESTREAM, FMOD will stream out of the buffer whose pointer you passed in. In this case, your own buffer should not be freed until you have finished with and released the stream.*/
+#define FMOD_OPENMEMORY_POINT 0x10000000 /* "name_or_data" will be interpreted as a pointer to memory instead of filename for creating sounds. Use FMOD_CREATESOUNDEXINFO to specify length. This differs to FMOD_OPENMEMORY in that it uses the memory as is, without duplicating the memory into its own buffers. Cannot be freed after open, only after Sound::release. Will not work if the data is compressed and FMOD_CREATECOMPRESSEDSAMPLE is not used. */
+#define FMOD_OPENRAW 0x00001000 /* Will ignore file format and treat as raw pcm. Use FMOD_CREATESOUNDEXINFO to specify format. Requires at least defaultfrequency, numchannels and format to be specified before it will open. Must be little endian data. */
+#define FMOD_OPENONLY 0x00002000 /* Just open the file, dont prebuffer or read. Good for fast opens for info, or when sound::readData is to be used. */
+#define FMOD_ACCURATETIME 0x00004000 /* For System::createSound - for accurate Sound::getLength/Channel::setPosition on VBR MP3, and MOD/S3M/XM/IT/MIDI files. Scans file first, so takes longer to open. FMOD_OPENONLY does not affect this. */
+#define FMOD_MPEGSEARCH 0x00008000 /* For corrupted / bad MP3 files. This will search all the way through the file until it hits a valid MPEG header. Normally only searches for 4k. */
+#define FMOD_NONBLOCKING 0x00010000 /* For opening sounds and getting streamed subsounds (seeking) asyncronously. Use Sound::getOpenState to poll the state of the sound as it opens or retrieves the subsound in the background. */
+#define FMOD_UNIQUE 0x00020000 /* Unique sound, can only be played one at a time */
+#define FMOD_3D_HEADRELATIVE 0x00040000 /* Make the sound's position, velocity and orientation relative to the listener. */
+#define FMOD_3D_WORLDRELATIVE 0x00080000 /* Make the sound's position, velocity and orientation absolute (relative to the world). (DEFAULT) */
+#define FMOD_3D_INVERSEROLLOFF 0x00100000 /* This sound will follow the inverse rolloff model where mindistance = full volume, maxdistance = where sound stops attenuating, and rolloff is fixed according to the global rolloff factor. (DEFAULT) */
+#define FMOD_3D_LINEARROLLOFF 0x00200000 /* This sound will follow a linear rolloff model where mindistance = full volume, maxdistance = silence. */
+#define FMOD_3D_LINEARSQUAREROLLOFF 0x00400000 /* This sound will follow a linear-square rolloff model where mindistance = full volume, maxdistance = silence. */
+#define FMOD_3D_INVERSETAPEREDROLLOFF 0x00800000 /* This sound will follow the inverse rolloff model at distances close to mindistance and a linear-square rolloff close to maxdistance. */
+#define FMOD_3D_CUSTOMROLLOFF 0x04000000 /* This sound will follow a rolloff model defined by Sound::set3DCustomRolloff / Channel::set3DCustomRolloff. */
+#define FMOD_3D_IGNOREGEOMETRY 0x40000000 /* Is not affect by geometry occlusion. If not specified in Sound::setMode, or Channel::setMode, the flag is cleared and it is affected by geometry again. */
+/* Unused 0x01000000 Used to be FMOD_UNICODE */
+#define FMOD_IGNORETAGS 0x02000000 /* Skips id3v2/asf/etc tag checks when opening a sound, to reduce seek/read overhead when opening files (helps with CD performance). */
+#define FMOD_LOWMEM 0x08000000 /* Removes some features from samples to give a lower memory overhead, like Sound::getName. See remarks. */
+#define FMOD_LOADSECONDARYRAM 0x20000000 /* Load sound into the secondary RAM of supported platform. On PS3, sounds will be loaded into RSX/VRAM. */
+#define FMOD_VIRTUAL_PLAYFROMSTART 0x80000000 /* For sounds that start virtual (due to being quiet or low importance), instead of swapping back to audible, and playing at the correct offset according to time, this flag makes the sound play from the start. */
+/* [DEFINE_END] */
+
+
+/*
+[ENUM]
+[
+ [DESCRIPTION]
+ These values describe what state a sound is in after FMOD_NONBLOCKING has been used to open it.
+
+ [REMARKS]
+ With streams, if you are using FMOD_NONBLOCKING, note that if the user calls Sound::getSubSound, a stream will go into FMOD_OPENSTATE_SEEKING state and sound related commands will return FMOD_ERR_NOTREADY.
+ With streams, if you are using FMOD_NONBLOCKING, note that if the user calls Channel::getPosition, a stream will go into FMOD_OPENSTATE_SETPOSITION state and sound related commands will return FMOD_ERR_NOTREADY.
+
+ [SEE_ALSO]
+ Sound::getOpenState
+ FMOD_MODE
+]
+*/
+typedef enum
+{
+ FMOD_OPENSTATE_READY = 0, /* Opened and ready to play. */
+ FMOD_OPENSTATE_LOADING, /* Initial load in progress. */
+ FMOD_OPENSTATE_ERROR, /* Failed to open - file not found, out of memory etc. See return value of Sound::getOpenState for what happened. */
+ FMOD_OPENSTATE_CONNECTING, /* Connecting to remote host (internet sounds only). */
+ FMOD_OPENSTATE_BUFFERING, /* Buffering data. */
+ FMOD_OPENSTATE_SEEKING, /* Seeking to subsound and re-flushing stream buffer. */
+ FMOD_OPENSTATE_PLAYING, /* Ready and playing, but not possible to release at this time without stalling the main thread. */
+ FMOD_OPENSTATE_SETPOSITION, /* Seeking within a stream to a different position. */
+
+ FMOD_OPENSTATE_MAX, /* Maximum number of open state types. */
+ FMOD_OPENSTATE_FORCEINT = 65536 /* Makes sure this enum is signed 32bit. */
+} FMOD_OPENSTATE;
+
+
+/*
+[ENUM]
+[
+ [DESCRIPTION]
+ These values are used with SoundGroup::setMaxAudibleBehavior to determine what happens when more sounds
+ are played than are specified with SoundGroup::setMaxAudible.
+
+ [REMARKS]
+ When using FMOD_SOUNDGROUP_BEHAVIOR_MUTE, SoundGroup::setMuteFadeSpeed can be used to stop a sudden transition.
+ Instead, the time specified will be used to cross fade between the sounds that go silent and the ones that become audible.
+
+ [SEE_ALSO]
+ SoundGroup::setMaxAudibleBehavior
+ SoundGroup::getMaxAudibleBehavior
+ SoundGroup::setMaxAudible
+ SoundGroup::getMaxAudible
+ SoundGroup::setMuteFadeSpeed
+ SoundGroup::getMuteFadeSpeed
+]
+*/
+typedef enum
+{
+ FMOD_SOUNDGROUP_BEHAVIOR_FAIL, /* Any sound played that puts the sound count over the SoundGroup::setMaxAudible setting, will simply fail during System::playSound. */
+ FMOD_SOUNDGROUP_BEHAVIOR_MUTE, /* Any sound played that puts the sound count over the SoundGroup::setMaxAudible setting, will be silent, then if another sound in the group stops the sound that was silent before becomes audible again. */
+ FMOD_SOUNDGROUP_BEHAVIOR_STEALLOWEST, /* Any sound played that puts the sound count over the SoundGroup::setMaxAudible setting, will steal the quietest / least important sound playing in the group. */
+
+ FMOD_SOUNDGROUP_BEHAVIOR_MAX, /* Maximum number of sound group behaviors. */
+ FMOD_SOUNDGROUP_BEHAVIOR_FORCEINT = 65536 /* Makes sure this enum is signed 32bit. */
+} FMOD_SOUNDGROUP_BEHAVIOR;
+
+
+/*
+[ENUM]
+[
+ [DESCRIPTION]
+ These callback types are used with Channel::setCallback.
+
+ [REMARKS]
+ Each callback has commanddata parameters passed as int unique to the type of callback.
+ See reference to FMOD_CHANNELCONTROL_CALLBACK to determine what they might mean for each type of callback.
+
+ Note! Currently the user must call System::update for these callbacks to trigger!
+
+ [SEE_ALSO]
+ Channel::setCallback
+ ChannelGroup::setCallback
+ FMOD_CHANNELCONTROL_CALLBACK
+ System::update
+]
+*/
+typedef enum
+{
+ FMOD_CHANNELCONTROL_CALLBACK_END, /* Called when a sound ends. */
+ FMOD_CHANNELCONTROL_CALLBACK_VIRTUALVOICE, /* Called when a voice is swapped out or swapped in. */
+ FMOD_CHANNELCONTROL_CALLBACK_SYNCPOINT, /* Called when a syncpoint is encountered. Can be from wav file markers. */
+ FMOD_CHANNELCONTROL_CALLBACK_OCCLUSION, /* Called when the channel has its geometry occlusion value calculated. Can be used to clamp or change the value. */
+
+ FMOD_CHANNELCONTROL_CALLBACK_MAX, /* Maximum number of callback types supported. */
+ FMOD_CHANNELCONTROL_CALLBACK_FORCEINT = 65536 /* Makes sure this enum is signed 32bit. */
+} FMOD_CHANNELCONTROL_CALLBACK_TYPE;
+
+
+/*
+[ENUM]
+[
+ [DESCRIPTION]
+ These enums denote special types of node within a DSP chain.
+
+ [REMARKS]
+ By default there is 1 fader for a ChannelGroup or Channel, and it is the head.
+
+ [SEE_ALSO]
+ Channel::getDSP
+ ChannelGroup::getDSP
+ ChannelControl::getNumDSPs
+ ChannelControl::setDSPIndex
+]
+*/
+typedef enum
+{
+ FMOD_CHANNELCONTROL_DSP_HEAD = -1, /* Head of the DSP chain. Equivalent of index 0. */
+ FMOD_CHANNELCONTROL_DSP_FADER = -2, /* Built in fader DSP. */
+ FMOD_CHANNELCONTROL_DSP_TAIL = -3, /* Tail of the DSP chain. Equivalent of the number of dsps minus 1. */
+
+ FMOD_CHANNELCONTROL_DSP_FORCEINT = 65536 /* Makes sure this enum is signed 32bit. */
+} FMOD_CHANNELCONTROL_DSP_INDEX;
+
+/*
+[ENUM]
+[
+ [DESCRIPTION]
+ Used to distinguish the instance type passed into FMOD_ERROR_CALLBACK.
+
+ [REMARKS]
+ Cast the instance of FMOD_ERROR_CALLBACK to the appropriate class indicated by this enum.
+
+ [SEE_ALSO]
+]
+*/
+typedef enum
+{
+ FMOD_ERRORCALLBACK_INSTANCETYPE_NONE,
+ FMOD_ERRORCALLBACK_INSTANCETYPE_SYSTEM,
+ FMOD_ERRORCALLBACK_INSTANCETYPE_CHANNEL,
+ FMOD_ERRORCALLBACK_INSTANCETYPE_CHANNELGROUP,
+ FMOD_ERRORCALLBACK_INSTANCETYPE_CHANNELCONTROL,
+ FMOD_ERRORCALLBACK_INSTANCETYPE_SOUND,
+ FMOD_ERRORCALLBACK_INSTANCETYPE_SOUNDGROUP,
+ FMOD_ERRORCALLBACK_INSTANCETYPE_DSP,
+ FMOD_ERRORCALLBACK_INSTANCETYPE_DSPCONNECTION,
+ FMOD_ERRORCALLBACK_INSTANCETYPE_GEOMETRY,
+ FMOD_ERRORCALLBACK_INSTANCETYPE_REVERB3D,
+ FMOD_ERRORCALLBACK_INSTANCETYPE_STUDIO_SYSTEM,
+ FMOD_ERRORCALLBACK_INSTANCETYPE_STUDIO_EVENTDESCRIPTION,
+ FMOD_ERRORCALLBACK_INSTANCETYPE_STUDIO_EVENTINSTANCE,
+ FMOD_ERRORCALLBACK_INSTANCETYPE_STUDIO_PARAMETERINSTANCE,
+ FMOD_ERRORCALLBACK_INSTANCETYPE_STUDIO_BUS,
+ FMOD_ERRORCALLBACK_INSTANCETYPE_STUDIO_VCA,
+ FMOD_ERRORCALLBACK_INSTANCETYPE_STUDIO_BANK,
+ FMOD_ERRORCALLBACK_INSTANCETYPE_STUDIO_COMMANDREPLAY,
+
+ FMOD_ERRORCALLBACK_INSTANCETYPE_FORCEINT = 65536 /* Makes sure this enum is signed 32bit. */
+} FMOD_ERRORCALLBACK_INSTANCETYPE;
+
+/*
+[STRUCTURE]
+[
+ [DESCRIPTION]
+ Structure that is passed into FMOD_SYSTEM_CALLBACK for the FMOD_SYSTEM_CALLBACK_ERROR callback type.
+
+ [REMARKS]
+ The instance pointer will be a type corresponding to the instanceType enum.
+
+ [SEE_ALSO]
+ FMOD_ERRORCALLBACK_INSTANCETYPE
+]
+*/
+typedef struct
+{
+ FMOD_RESULT result; /* Error code result */
+ FMOD_ERRORCALLBACK_INSTANCETYPE instancetype; /* Type of instance the error occurred on */
+ void *instance; /* Instance pointer */
+ const char *functionname; /* Function that the error occurred on */
+ const char *functionparams; /* Function parameters that the error ocurred on */
+} FMOD_ERRORCALLBACK_INFO;
+
+/*
+[DEFINE]
+[
+ [NAME]
+ FMOD_SYSTEM_CALLBACK_TYPE
+
+ [DESCRIPTION]
+ These callback types are used with System::setCallback.
+
+ [REMARKS]
+ Each callback has commanddata parameters passed as void* unique to the type of callback.
+ See reference to FMOD_SYSTEM_CALLBACK to determine what they might mean for each type of callback.
+
+ Note! Using FMOD_SYSTEM_CALLBACK_DEVICELISTCHANGED (Windows only) will disable any automated device ejection/insertion handling by FMOD. Use this callback to control the behaviour yourself.
+
+ Note! Using FMOD_SYSTEM_CALLBACK_DEVICELISTCHANGED (on Mac only) requires the application to be running an event loop which will allow external changes to device list to be detected by FMOD.
+
+ Note! The 'system' object pointer will be null for FMOD_SYSTEM_CALLBACK_MEMORYALLOCATIONFAILED callback.
+
+ [SEE_ALSO]
+ System::setCallback
+ System::update
+ DSP::addInput
+]
+*/
+#define FMOD_SYSTEM_CALLBACK_DEVICELISTCHANGED 0x00000001 /* Called from System::update when the enumerated list of devices has changed. */
+#define FMOD_SYSTEM_CALLBACK_DEVICELOST 0x00000002 /* Called from System::update when an output device has been lost due to control panel parameter changes and FMOD cannot automatically recover. */
+#define FMOD_SYSTEM_CALLBACK_MEMORYALLOCATIONFAILED 0x00000004 /* Called directly when a memory allocation fails somewhere in FMOD. (NOTE - 'system' will be NULL in this callback type.)*/
+#define FMOD_SYSTEM_CALLBACK_THREADCREATED 0x00000008 /* Called directly when a thread is created. */
+#define FMOD_SYSTEM_CALLBACK_BADDSPCONNECTION 0x00000010 /* Called when a bad connection was made with DSP::addInput. Usually called from mixer thread because that is where the connections are made. */
+#define FMOD_SYSTEM_CALLBACK_PREMIX 0x00000020 /* Called each tick before a mix update happens. */
+#define FMOD_SYSTEM_CALLBACK_POSTMIX 0x00000040 /* Called each tick after a mix update happens. */
+#define FMOD_SYSTEM_CALLBACK_ERROR 0x00000080 /* Called when each API function returns an error code, including delayed async functions. */
+#define FMOD_SYSTEM_CALLBACK_MIDMIX 0x00000100 /* Called each tick in mix update after clocks have been updated before the main mix occurs. */
+#define FMOD_SYSTEM_CALLBACK_THREADDESTROYED 0x00000200 /* Called directly when a thread is destroyed. */
+#define FMOD_SYSTEM_CALLBACK_PREUPDATE 0x00000400 /* Called at start of System::update function. */
+#define FMOD_SYSTEM_CALLBACK_POSTUPDATE 0x00000800 /* Called at end of System::update function. */
+#define FMOD_SYSTEM_CALLBACK_RECORDLISTCHANGED 0x00001000 /* Called from System::update when the enumerated list of recording devices has changed. */
+#define FMOD_SYSTEM_CALLBACK_ALL 0xFFFFFFFF /* Pass this mask to System::setCallback to receive all callback types. */
+
+/* [DEFINE_END] */
+
+
+/*
+ FMOD Callbacks
+*/
+typedef FMOD_RESULT (F_CALLBACK *FMOD_DEBUG_CALLBACK) (FMOD_DEBUG_FLAGS flags, const char *file, int line, const char *func, const char *message);
+
+typedef FMOD_RESULT (F_CALLBACK *FMOD_SYSTEM_CALLBACK) (FMOD_SYSTEM *system, FMOD_SYSTEM_CALLBACK_TYPE type, void *commanddata1, void *commanddata2, void *userdata);
+
+typedef FMOD_RESULT (F_CALLBACK *FMOD_CHANNELCONTROL_CALLBACK) (FMOD_CHANNELCONTROL *channelcontrol, FMOD_CHANNELCONTROL_TYPE controltype, FMOD_CHANNELCONTROL_CALLBACK_TYPE callbacktype, void *commanddata1, void *commanddata2);
+
+typedef FMOD_RESULT (F_CALLBACK *FMOD_SOUND_NONBLOCK_CALLBACK) (FMOD_SOUND *sound, FMOD_RESULT result);
+typedef FMOD_RESULT (F_CALLBACK *FMOD_SOUND_PCMREAD_CALLBACK) (FMOD_SOUND *sound, void *data, unsigned int datalen);
+typedef FMOD_RESULT (F_CALLBACK *FMOD_SOUND_PCMSETPOS_CALLBACK) (FMOD_SOUND *sound, int subsound, unsigned int position, FMOD_TIMEUNIT postype);
+
+typedef FMOD_RESULT (F_CALLBACK *FMOD_FILE_OPEN_CALLBACK) (const char *name, unsigned int *filesize, void **handle, void *userdata);
+typedef FMOD_RESULT (F_CALLBACK *FMOD_FILE_CLOSE_CALLBACK) (void *handle, void *userdata);
+typedef FMOD_RESULT (F_CALLBACK *FMOD_FILE_READ_CALLBACK) (void *handle, void *buffer, unsigned int sizebytes, unsigned int *bytesread, void *userdata);
+typedef FMOD_RESULT (F_CALLBACK *FMOD_FILE_SEEK_CALLBACK) (void *handle, unsigned int pos, void *userdata);
+typedef FMOD_RESULT (F_CALLBACK *FMOD_FILE_ASYNCREAD_CALLBACK) (FMOD_ASYNCREADINFO *info, void *userdata);
+typedef FMOD_RESULT (F_CALLBACK *FMOD_FILE_ASYNCCANCEL_CALLBACK)(FMOD_ASYNCREADINFO *info, void *userdata);
+
+typedef void * (F_CALLBACK *FMOD_MEMORY_ALLOC_CALLBACK) (unsigned int size, FMOD_MEMORY_TYPE type, const char *sourcestr);
+typedef void * (F_CALLBACK *FMOD_MEMORY_REALLOC_CALLBACK) (void *ptr, unsigned int size, FMOD_MEMORY_TYPE type, const char *sourcestr);
+typedef void (F_CALLBACK *FMOD_MEMORY_FREE_CALLBACK) (void *ptr, FMOD_MEMORY_TYPE type, const char *sourcestr);
+
+typedef float (F_CALLBACK *FMOD_3D_ROLLOFF_CALLBACK) (FMOD_CHANNELCONTROL *channelcontrol, float distance);
+
+
+
+
+/*
+[ENUM]
+[
+ [DESCRIPTION]
+ List of interpolation types that the FMOD Studio software mixer supports.
+
+ [REMARKS]
+ The default resampler type is FMOD_DSP_RESAMPLER_LINEAR.
+ Use System::setAdvancedSettings and the resamplerMethod member to tell FMOD the resampling quality you require for sample rate conversion during sound playback.
+
+ [SEE_ALSO]
+ System::setAdvancedSettings
+ System::setAdvancedSettings
+ FMOD_ADVANCEDSETINGS
+]
+*/
+typedef enum
+{
+ FMOD_DSP_RESAMPLER_DEFAULT, /* Default interpolation method. Currently equal to FMOD_DSP_RESAMPLER_LINEAR. */
+ FMOD_DSP_RESAMPLER_NOINTERP, /* No interpolation. High frequency aliasing hiss will be audible depending on the sample rate of the sound. */
+ FMOD_DSP_RESAMPLER_LINEAR, /* Linear interpolation (default method). Fast and good quality, causes very slight lowpass effect on low frequency sounds. */
+ FMOD_DSP_RESAMPLER_CUBIC, /* Cubic interpolation. Slower than linear interpolation but better quality. */
+ FMOD_DSP_RESAMPLER_SPLINE, /* 5 point spline interpolation. Slowest resampling method but best quality. */
+
+ FMOD_DSP_RESAMPLER_MAX, /* Maximum number of resample methods supported. */
+ FMOD_DSP_RESAMPLER_FORCEINT = 65536 /* Makes sure this enum is signed 32bit. */
+} FMOD_DSP_RESAMPLER;
+
+
+/*
+[ENUM]
+[
+ [DESCRIPTION]
+ List of connection types between 2 DSP nodes.
+
+ [REMARKS]
+ FMOD_DSP_CONNECTION_TYPE_STANDARD
+ ----------------------------------
+ Default DSPConnection type. Audio is mixed from the input to the output DSP's audible buffer, meaning it will be part of the audible signal. A standard connection will execute its input DSP if it has not been executed before.
+
+ FMOD_DSP_CONNECTION_TYPE_SIDECHAIN
+ ----------------------------------
+ Sidechain DSPConnection type. Audio is mixed from the input to the output DSP's sidechain buffer, meaning it will NOT be part of the audible signal. A sidechain connection will execute its input DSP if it has not been executed before.
+ The purpose of the seperate sidechain buffer in a DSP, is so that the DSP effect can privately access for analysis purposes. An example of use in this case, could be a compressor which analyzes the signal, to control its own effect parameters (ie a compression level or gain).
+
+ For the effect developer, to accept sidechain data, the sidechain data will appear in the FMOD_DSP_STATE struct which is passed into the read callback of a DSP unit.
+ FMOD_DSP_STATE::sidechaindata and FMOD_DSP::sidechainchannels will hold the mixed result of any sidechain data flowing into it.
+
+ FMOD_DSP_CONNECTION_TYPE_SEND
+ -----------------------------
+ Send DSPConnection type. Audio is mixed from the input to the output DSP's audible buffer, meaning it will be part of the audible signal. A send connection will NOT execute its input DSP if it has not been executed before.
+ A send connection will only read what exists at the input's buffer at the time of executing the output DSP unit (which can be considered the 'return')
+
+ FMOD_DSP_CONNECTION_TYPE_SEND_SIDECHAIN
+ ---------------------------------------
+ Send sidechain DSPConnection type. Audio is mixed from the input to the output DSP's sidechain buffer, meaning it will NOT be part of the audible signal. A send sidechain connection will NOT execute its input DSP if it has not been executed before.
+ A send sidechain connection will only read what exists at the input's buffer at the time of executing the output DSP unit (which can be considered the 'sidechain return').
+
+ For the effect developer, to accept sidechain data, the sidechain data will appear in the FMOD_DSP_STATE struct which is passed into the read callback of a DSP unit.
+ FMOD_DSP_STATE::sidechaindata and FMOD_DSP::sidechainchannels will hold the mixed result of any sidechain data flowing into it.
+
+ [SEE_ALSO]
+ DSP::addInput
+ DSPConnection::getType
+]
+*/
+typedef enum
+{
+ FMOD_DSPCONNECTION_TYPE_STANDARD, /* Default connection type. Audio is mixed from the input to the output DSP's audible buffer. */
+ FMOD_DSPCONNECTION_TYPE_SIDECHAIN, /* Sidechain connection type. Audio is mixed from the input to the output DSP's sidechain buffer. */
+ FMOD_DSPCONNECTION_TYPE_SEND, /* Send connection type. Audio is mixed from the input to the output DSP's audible buffer, but the input is NOT executed, only copied from. A standard connection or sidechain needs to make an input execute to generate data. */
+ FMOD_DSPCONNECTION_TYPE_SEND_SIDECHAIN, /* Send sidechain connection type. Audio is mixed from the input to the output DSP's sidechain buffer, but the input is NOT executed, only copied from. A standard connection or sidechain needs to make an input execute to generate data. */
+
+ FMOD_DSPCONNECTION_TYPE_MAX, /* Maximum number of DSP connection types supported. */
+ FMOD_DSPCONNECTION_TYPE_FORCEINT = 65536 /* Makes sure this enum is signed 32bit. */
+} FMOD_DSPCONNECTION_TYPE;
+
+
+/*
+[ENUM]
+[
+ [DESCRIPTION]
+ List of tag types that could be stored within a sound. These include id3 tags, metadata from netstreams and vorbis/asf data.
+
+ [REMARKS]
+
+ [SEE_ALSO]
+ Sound::getTag
+]
+*/
+typedef enum
+{
+ FMOD_TAGTYPE_UNKNOWN = 0,
+ FMOD_TAGTYPE_ID3V1,
+ FMOD_TAGTYPE_ID3V2,
+ FMOD_TAGTYPE_VORBISCOMMENT,
+ FMOD_TAGTYPE_SHOUTCAST,
+ FMOD_TAGTYPE_ICECAST,
+ FMOD_TAGTYPE_ASF,
+ FMOD_TAGTYPE_MIDI,
+ FMOD_TAGTYPE_PLAYLIST,
+ FMOD_TAGTYPE_FMOD,
+ FMOD_TAGTYPE_USER,
+
+ FMOD_TAGTYPE_MAX, /* Maximum number of tag types supported. */
+ FMOD_TAGTYPE_FORCEINT = 65536 /* Makes sure this enum is signed 32bit. */
+} FMOD_TAGTYPE;
+
+
+/*
+[ENUM]
+[
+ [DESCRIPTION]
+ List of data types that can be returned by Sound::getTag
+
+ [REMARKS]
+
+ [SEE_ALSO]
+ Sound::getTag
+]
+*/
+typedef enum
+{
+ FMOD_TAGDATATYPE_BINARY = 0,
+ FMOD_TAGDATATYPE_INT,
+ FMOD_TAGDATATYPE_FLOAT,
+ FMOD_TAGDATATYPE_STRING,
+ FMOD_TAGDATATYPE_STRING_UTF16,
+ FMOD_TAGDATATYPE_STRING_UTF16BE,
+ FMOD_TAGDATATYPE_STRING_UTF8,
+ FMOD_TAGDATATYPE_CDTOC,
+
+ FMOD_TAGDATATYPE_MAX, /* Maximum number of tag datatypes supported. */
+ FMOD_TAGDATATYPE_FORCEINT = 65536 /* Makes sure this enum is signed 32bit. */
+} FMOD_TAGDATATYPE;
+
+
+/*
+[STRUCTURE]
+[
+ [DESCRIPTION]
+ Structure describing a piece of tag data.
+
+ [REMARKS]
+ Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only. Do not change this value.
+ Members marked with [w] mean the variable can be written to. The user can set the value.
+
+ [SEE_ALSO]
+ Sound::getTag
+ FMOD_TAGTYPE
+ FMOD_TAGDATATYPE
+]
+*/
+typedef struct FMOD_TAG
+{
+ FMOD_TAGTYPE type; /* [r] The type of this tag. */
+ FMOD_TAGDATATYPE datatype; /* [r] The type of data that this tag contains */
+ char *name; /* [r] The name of this tag i.e. "TITLE", "ARTIST" etc. */
+ void *data; /* [r] Pointer to the tag data - its format is determined by the datatype member */
+ unsigned int datalen; /* [r] Length of the data contained in this tag */
+ FMOD_BOOL updated; /* [r] True if this tag has been updated since last being accessed with Sound::getTag */
+} FMOD_TAG;
+
+
+/*
+[DEFINE]
+[
+ [NAME]
+ FMOD_TIMEUNIT
+
+ [DESCRIPTION]
+ List of time types that can be returned by Sound::getLength and used with Channel::setPosition or Channel::getPosition.
+
+ [REMARKS]
+ Do not combine flags except FMOD_TIMEUNIT_BUFFERED.
+
+ [SEE_ALSO]
+ Sound::getLength
+ Channel::setPosition
+ Channel::getPosition
+]
+*/
+#define FMOD_TIMEUNIT_MS 0x00000001 /* Milliseconds. */
+#define FMOD_TIMEUNIT_PCM 0x00000002 /* PCM samples, related to milliseconds * samplerate / 1000. */
+#define FMOD_TIMEUNIT_PCMBYTES 0x00000004 /* Bytes, related to PCM samples * channels * datawidth (ie 16bit = 2 bytes). */
+#define FMOD_TIMEUNIT_RAWBYTES 0x00000008 /* Raw file bytes of (compressed) sound data (does not include headers). Only used by Sound::getLength and Channel::getPosition. */
+#define FMOD_TIMEUNIT_PCMFRACTION 0x00000010 /* Fractions of 1 PCM sample. Unsigned int range 0 to 0xFFFFFFFF. Used for sub-sample granularity for DSP purposes. */
+#define FMOD_TIMEUNIT_MODORDER 0x00000100 /* MOD/S3M/XM/IT. Order in a sequenced module format. Use Sound::getFormat to determine the PCM format being decoded to. */
+#define FMOD_TIMEUNIT_MODROW 0x00000200 /* MOD/S3M/XM/IT. Current row in a sequenced module format. Sound::getLength will return the number of rows in the currently playing or seeked to pattern. */
+#define FMOD_TIMEUNIT_MODPATTERN 0x00000400 /* MOD/S3M/XM/IT. Current pattern in a sequenced module format. Sound::getLength will return the number of patterns in the song and Channel::getPosition will return the currently playing pattern. */
+#define FMOD_TIMEUNIT_BUFFERED 0x10000000 /* Time value as seen by buffered stream. This is always ahead of audible time, and is only used for processing. */
+/* [DEFINE_END] */
+
+/*
+[DEFINE]
+[
+ [NAME]
+ FMOD_PORT_INDEX
+
+ [DESCRIPTION]
+
+ [REMARKS]
+
+ [SEE_ALSO]
+ System::AttachChannelGroupToPort
+]
+*/
+#define FMOD_PORT_INDEX_NONE 0xFFFFFFFFFFFFFFFF /* Use when a port index is not required */
+/* [DEFINE_END] */
+
+
+/*
+[STRUCTURE]
+[
+ [DESCRIPTION]
+ Use this structure with System::createSound when more control is needed over loading.
+ The possible reasons to use this with System::createSound are:
+
+ - Loading a file from memory.
+ - Loading a file from within another larger (possibly wad/pak) file, by giving the loader an offset and length.
+ - To create a user created / non file based sound.
+ - To specify a starting subsound to seek to within a multi-sample sounds (ie FSB/DLS) when created as a stream.
+ - To specify which subsounds to load for multi-sample sounds (ie FSB/DLS) so that memory is saved and only a subset is actually loaded/read from disk.
+ - To specify 'piggyback' read and seek callbacks for capture of sound data as fmod reads and decodes it. Useful for ripping decoded PCM data from sounds as they are loaded / played.
+ - To specify a MIDI DLS sample set file to load when opening a MIDI file.
+
+ See below on what members to fill for each of the above types of sound you want to create.
+
+ [REMARKS]
+ This structure is optional! Specify 0 or NULL in System::createSound if you don't need it!
+
+ Loading a file from memory.
+
+ - Create the sound using the FMOD_OPENMEMORY flag.
+ - Mandatory. Specify 'length' for the size of the memory block in bytes.
+ - Other flags are optional.
+
+ Loading a file from within another larger (possibly wad/pak) file, by giving the loader an offset and length.
+
+ - Mandatory. Specify 'fileoffset' and 'length'.
+ - Other flags are optional.
+
+ To create a user created / non file based sound.
+
+ - Create the sound using the FMOD_OPENUSER flag.
+ - Mandatory. Specify 'defaultfrequency, 'numchannels' and 'format'.
+ - Other flags are optional.
+
+ To specify a starting subsound to seek to and flush with, within a multi-sample stream (ie FSB/DLS).
+
+ - Mandatory. Specify 'initialsubsound'.
+
+ To specify which subsounds to load for multi-sample sounds (ie FSB/DLS) so that memory is saved and only a subset is actually loaded/read from disk.
+
+ - Mandatory. Specify 'inclusionlist' and 'inclusionlistnum'.
+
+ To specify 'piggyback' read and seek callbacks for capture of sound data as fmod reads and decodes it. Useful for ripping decoded PCM data from sounds as they are loaded / played.
+
+ - Mandatory. Specify 'pcmreadcallback' and 'pcmseekcallback'.
+
+ To specify a MIDI DLS sample set file to load when opening a MIDI file.
+
+ - Mandatory. Specify 'dlsname'.
+
+ Setting the 'decodebuffersize' is for cpu intensive codecs that may be causing stuttering, not file intensive codecs (ie those from CD or netstreams) which are normally
+ altered with System::setStreamBufferSize. As an example of cpu intensive codecs, an mp3 file will take more cpu to decode than a PCM wav file.
+
+ If you have a stuttering effect, then it is using more cpu than the decode buffer playback rate can keep up with. Increasing the decode buffersize will most likely solve this problem.
+
+ FSB codec. If inclusionlist and numsubsounds are used together, this will trigger a special mode where subsounds are shuffled down to save memory. (useful for large FSB
+ files where you only want to load 1 sound). There will be no gaps, ie no null subsounds. As an example, if there are 10,000 subsounds and there is an inclusionlist with only 1 entry,
+ and numsubsounds = 1, then subsound 0 will be that entry, and there will only be the memory allocated for 1 subsound. Previously there would still be 10,000 subsound pointers and other
+ associated codec entries allocated along with it multiplied by 10,000.
+
+ Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only. Do not change this value.
+ Members marked with [w] mean the variable can be written to. The user can set the value.
+
+ [SEE_ALSO]
+ System::createSound
+ System::setStreamBufferSize
+ FMOD_MODE
+ FMOD_SOUND_FORMAT
+ FMOD_SOUND_TYPE
+ FMOD_CHANNELMASK
+ FMOD_CHANNELORDER
+ FMOD_MAX_CHANNEL_WIDTH
+]
+*/
+typedef struct FMOD_CREATESOUNDEXINFO
+{
+ int cbsize; /* [w] Size of this structure. This is used so the structure can be expanded in the future and still work on older versions of FMOD Studio. */
+ unsigned int length; /* [w] Optional. Specify 0 to ignore. Number of bytes to load starting at 'fileoffset', or size of sound to create (if FMOD_OPENUSER is used). Required if loading from memory. If 0 is specified, then it will use the size of the file (unless loading from memory then an error will be returned). */
+ unsigned int fileoffset; /* [w] Optional. Specify 0 to ignore. Offset from start of the file to start loading from. This is useful for loading files from inside big data files. */
+ int numchannels; /* [w] Optional. Specify 0 to ignore. Number of channels in a sound mandatory if FMOD_OPENUSER or FMOD_OPENRAW is used. Can be specified up to FMOD_MAX_CHANNEL_WIDTH. */
+ int defaultfrequency; /* [w] Optional. Specify 0 to ignore. Default frequency of sound in Hz, mandatory if FMOD_OPENUSER or FMOD_OPENRAW is used. Other formats use the frequency determined by the file format. */
+ FMOD_SOUND_FORMAT format; /* [w] Optional. Specify 0 or FMOD_SOUND_FORMAT_NONE to ignore. Format of the sound, mandatory if FMOD_OPENUSER or FMOD_OPENRAW is used. Other formats use the format determined by the file format. */
+ unsigned int decodebuffersize; /* [w] Optional. Specify 0 to ignore. For streams. This determines the size of the double buffer (in PCM samples) that a stream uses. Use this for user created streams if you want to determine the size of the callback buffer passed to you. Specify 0 to use FMOD's default size which is currently equivalent to 400ms of the sound format created/loaded. */
+ int initialsubsound; /* [w] Optional. Specify 0 to ignore. In a multi-sample file format such as .FSB/.DLS, specify the initial subsound to seek to, only if FMOD_CREATESTREAM is used. */
+ int numsubsounds; /* [w] Optional. Specify 0 to ignore or have no subsounds. In a sound created with FMOD_OPENUSER, specify the number of subsounds that are accessable with Sound::getSubSound. If not created with FMOD_OPENUSER, this will limit the number of subsounds loaded within a multi-subsound file. If using FSB, then if FMOD_CREATESOUNDEXINFO::inclusionlist is used, this will shuffle subsounds down so that there are not any gaps. It will mean that the indices of the sounds will be different. */
+ int *inclusionlist; /* [w] Optional. Specify 0 to ignore. In a multi-sample format such as .FSB/.DLS it may be desirable to specify only a subset of sounds to be loaded out of the whole file. This is an array of subsound indices to load into memory when created. */
+ int inclusionlistnum; /* [w] Optional. Specify 0 to ignore. This is the number of integers contained within the inclusionlist array. */
+ FMOD_SOUND_PCMREAD_CALLBACK pcmreadcallback; /* [w] Optional. Specify 0 to ignore. Callback to 'piggyback' on FMOD's read functions and accept or even write PCM data while FMOD is opening the sound. Used for user sounds created with FMOD_OPENUSER or for capturing decoded data as FMOD reads it. */
+ FMOD_SOUND_PCMSETPOS_CALLBACK pcmsetposcallback; /* [w] Optional. Specify 0 to ignore. Callback for when the user calls a seeking function such as Channel::setTime or Channel::setPosition within a multi-sample sound, and for when it is opened.*/
+ FMOD_SOUND_NONBLOCK_CALLBACK nonblockcallback; /* [w] Optional. Specify 0 to ignore. Callback for successful completion, or error while loading a sound that used the FMOD_NONBLOCKING flag. Also called duing seeking, when setPosition is called or a stream is restarted. */
+ const char *dlsname; /* [w] Optional. Specify 0 to ignore. Filename for a DLS sample set when loading a MIDI file. If not specified, on Windows it will attempt to open /windows/system32/drivers/gm.dls or /windows/system32/drivers/etc/gm.dls, on Mac it will attempt to load /System/Library/Components/CoreAudio.component/Contents/Resources/gs_instruments.dls, otherwise the MIDI will fail to open. Current DLS support is for level 1 of the specification. */
+ const char *encryptionkey; /* [w] Optional. Specify 0 to ignore. Key for encrypted FSB file. Without this key an encrypted FSB file will not load. */
+ int maxpolyphony; /* [w] Optional. Specify 0 to ignore. For sequenced formats with dynamic channel allocation such as .MID and .IT, this specifies the maximum voice count allowed while playing. .IT defaults to 64. .MID defaults to 32. */
+ void *userdata; /* [w] Optional. Specify 0 to ignore. This is user data to be attached to the sound during creation. Access via Sound::getUserData. Note: This is not passed to FMOD_FILE_OPEN_CALLBACK - use fileuserdata for that. */
+ FMOD_SOUND_TYPE suggestedsoundtype; /* [w] Optional. Specify 0 or FMOD_SOUND_TYPE_UNKNOWN to ignore. Instead of scanning all codec types, use this to speed up loading by making it jump straight to this codec. */
+ FMOD_FILE_OPEN_CALLBACK fileuseropen; /* [w] Optional. Specify 0 to ignore. Callback for opening this file. */
+ FMOD_FILE_CLOSE_CALLBACK fileuserclose; /* [w] Optional. Specify 0 to ignore. Callback for closing this file. */
+ FMOD_FILE_READ_CALLBACK fileuserread; /* [w] Optional. Specify 0 to ignore. Callback for reading from this file. */
+ FMOD_FILE_SEEK_CALLBACK fileuserseek; /* [w] Optional. Specify 0 to ignore. Callback for seeking within this file. */
+ FMOD_FILE_ASYNCREAD_CALLBACK fileuserasyncread; /* [w] Optional. Specify 0 to ignore. Callback for seeking within this file. */
+ FMOD_FILE_ASYNCCANCEL_CALLBACK fileuserasynccancel;/* [w] Optional. Specify 0 to ignore. Callback for seeking within this file. */
+ void *fileuserdata; /* [w] Optional. Specify 0 to ignore. User data to be passed into the file callbacks. */
+ int filebuffersize; /* [w] Optional. Specify 0 to ignore. Buffer size for reading the file, -1 to disable buffering, or 0 for system default. */
+ FMOD_CHANNELORDER channelorder; /* [w] Optional. Specify 0 to ignore. Use this to differ the way fmod maps multichannel sounds to speakers. See FMOD_CHANNELORDER for more. */
+ FMOD_CHANNELMASK channelmask; /* [w] Optional. Specify 0 to ignore. Use this to specify which channels map to which speakers. See FMOD_CHANNELMASK for more. */
+ FMOD_SOUNDGROUP *initialsoundgroup; /* [w] Optional. Specify 0 to ignore. Specify a sound group if required, to put sound in as it is created. */
+ unsigned int initialseekposition;/* [w] Optional. Specify 0 to ignore. For streams. Specify an initial position to seek the stream to. */
+ FMOD_TIMEUNIT initialseekpostype; /* [w] Optional. Specify 0 to ignore. For streams. Specify the time unit for the position set in initialseekposition. */
+ int ignoresetfilesystem;/* [w] Optional. Specify 0 to ignore. Set to 1 to use fmod's built in file system. Ignores setFileSystem callbacks and also FMOD_CREATESOUNEXINFO file callbacks. Useful for specific cases where you don't want to use your own file system but want to use fmod's file system (ie net streaming). */
+ unsigned int audioqueuepolicy; /* [w] Optional. Specify 0 or FMOD_AUDIOQUEUE_CODECPOLICY_DEFAULT to ignore. Policy used to determine whether hardware or software is used for decoding, see FMOD_AUDIOQUEUE_CODECPOLICY for options (iOS >= 3.0 required, otherwise only hardware is available) */
+ unsigned int minmidigranularity; /* [w] Optional. Specify 0 to ignore. Allows you to set a minimum desired MIDI mixer granularity. Values smaller than 512 give greater than default accuracy at the cost of more CPU and vice versa. Specify 0 for default (512 samples). */
+ int nonblockthreadid; /* [w] Optional. Specify 0 to ignore. Specifies a thread index to execute non blocking load on. Allows for up to 5 threads to be used for loading at once. This is to avoid one load blocking another. Maximum value = 4. */
+ FMOD_GUID *fsbguid; /* [r/w] Optional. Specify 0 to ignore. Allows you to provide the GUID lookup for cached FSB header info. Once loaded the GUID will be written back to the pointer. This is to avoid seeking and reading the FSB header. */
+} FMOD_CREATESOUNDEXINFO;
+
+
+/*
+[DEFINE]
+[
+ [NAME]
+ FMOD_REVERB_MAXINSTANCES
+
+ [DESCRIPTION]
+ The maximum number of global/physical reverb instances.
+
+ [REMARKS]
+ Each instance of a physical reverb is an instance of a FMOD_DSP_SFXREVERB dsp in the mix graph.
+ This is unrelated to the number of possible Reverb3D objects, which is unlimited.
+
+ [SEE_ALSO]
+ ChannelControl::setReverbProperties
+ ChannelControl::setReverbProperties
+ System::setReverbProperties
+ System::getReverbProperties
+]
+*/
+#define FMOD_REVERB_MAXINSTANCES 4
+/* [DEFINE_END] */
+
+
+/*
+[STRUCTURE]
+[
+ [DESCRIPTION]
+ Structure defining a reverb environment.
+
+ [REMARKS]
+ Note the default reverb properties are the same as the FMOD_PRESET_GENERIC preset.
+
+ All members are read/write [r/w], written to by FMOD when queried with System::getReverbProperties and read by FMOD when set with System::setReverbProperties.
+
+ [SEE_ALSO]
+ System::setReverbProperties
+ System::getReverbProperties
+ FMOD_REVERB_PRESETS
+]
+*/
+typedef struct FMOD_REVERB_PROPERTIES
+{ /* MIN MAX DEFAULT DESCRIPTION */
+ float DecayTime; /* [r/w] 0.0 20000.0 1500.0 Reverberation decay time (ms) */
+ float EarlyDelay; /* [r/w] 0.0 300.0 7.0 Initial reflection delay time (ms) */
+ float LateDelay; /* [r/w] 0.0 100 11.0 Late reverberation delay time relative to initial reflection (ms) */
+ float HFReference; /* [r/w] 20.0 20000.0 5000 Reference high frequency (Hz) */
+ float HFDecayRatio; /* [r/w] 10.0 100.0 50.0 High-frequency to mid-frequency decay time ratio (%) */
+ float Diffusion; /* [r/w] 0.0 100.0 100.0 Value that controls the echo density in the late reverberation decay (%) */
+ float Density; /* [r/w] 0.0 100.0 100.0 Value that controls the modal density in the late reverberation decay (%) */
+ float LowShelfFrequency; /* [r/w] 20.0 1000.0 250.0 Reference low frequency (Hz) */
+ float LowShelfGain; /* [r/w] -36.0 12.0 0.0 Relative room effect level at low frequencies (dB) */
+ float HighCut; /* [r/w] 20.0 20000.0 20000.0 Relative room effect level at high frequencies (Hz) */
+ float EarlyLateMix; /* [r/w] 0.0 100.0 50.0 Early reflections level relative to room effect (%) */
+ float WetLevel; /* [r/w] -80.0 20.0 -6.0 Room effect level at mid frequencies (dB) */
+} FMOD_REVERB_PROPERTIES;
+
+
+/*
+[DEFINE]
+[
+ [NAME]
+ FMOD_REVERB_PRESETS
+
+ [DESCRIPTION]
+ Sets of predefined reverb properties used to initialize an FMOD_REVERB_PROPERTIES structure statically.
+
+ i.e. FMOD_REVERB_PROPERTIES prop = FMOD_PRESET_GENERIC;
+
+ [REMARKS]
+
+ [SEE_ALSO]
+ System::setReverbProperties
+ System::getReverbProperties
+]
+*/
+/* Decay LateDly HFDecay Densty LoGain E/L-Mix
+ EarlyDly HFRef Diffus LoFreq HiCut WetLvl */
+#define FMOD_PRESET_OFF { 1000, 7, 11, 5000, 100, 100, 100, 250, 0, 20, 96, -80.0f } /* Off / disabled */
+#define FMOD_PRESET_GENERIC { 1500, 7, 11, 5000, 83, 100, 100, 250, 0, 14500, 96, -8.0f } /* Generic / default */
+#define FMOD_PRESET_PADDEDCELL { 170, 1, 2, 5000, 10, 100, 100, 250, 0, 160, 84, -7.8f } /* Padded cell */
+#define FMOD_PRESET_ROOM { 400, 2, 3, 5000, 83, 100, 100, 250, 0, 6050, 88, -9.4f } /* Room */
+#define FMOD_PRESET_BATHROOM { 1500, 7, 11, 5000, 54, 100, 60, 250, 0, 2900, 83, 0.5f } /* Bathroom */
+#define FMOD_PRESET_LIVINGROOM { 500, 3, 4, 5000, 10, 100, 100, 250, 0, 160, 58, -19.0f } /* Living room */
+#define FMOD_PRESET_STONEROOM { 2300, 12, 17, 5000, 64, 100, 100, 250, 0, 7800, 71, -8.5f } /* Stone room */
+#define FMOD_PRESET_AUDITORIUM { 4300, 20, 30, 5000, 59, 100, 100, 250, 0, 5850, 64, -11.7f } /* Auditorium */
+#define FMOD_PRESET_CONCERTHALL { 3900, 20, 29, 5000, 70, 100, 100, 250, 0, 5650, 80, -9.8f } /* Convert hall */
+#define FMOD_PRESET_CAVE { 2900, 15, 22, 5000, 100, 100, 100, 250, 0, 20000, 59, -11.3f } /* Cave */
+#define FMOD_PRESET_ARENA { 7200, 20, 30, 5000, 33, 100, 100, 250, 0, 4500, 80, -9.6f } /* Arena */
+#define FMOD_PRESET_HANGAR { 10000, 20, 30, 5000, 23, 100, 100, 250, 0, 3400, 72, -7.4f } /* Hangar */
+#define FMOD_PRESET_CARPETTEDHALLWAY { 300, 2, 30, 5000, 10, 100, 100, 250, 0, 500, 56, -24.0f } /* Carpeted hallway */
+#define FMOD_PRESET_HALLWAY { 1500, 7, 11, 5000, 59, 100, 100, 250, 0, 7800, 87, -5.5f } /* Hallway */
+#define FMOD_PRESET_STONECORRIDOR { 270, 13, 20, 5000, 79, 100, 100, 250, 0, 9000, 86, -6.0f } /* Stone corridor */
+#define FMOD_PRESET_ALLEY { 1500, 7, 11, 5000, 86, 100, 100, 250, 0, 8300, 80, -9.8f } /* Alley */
+#define FMOD_PRESET_FOREST { 1500, 162, 88, 5000, 54, 79, 100, 250, 0, 760, 94, -12.3f } /* Forest */
+#define FMOD_PRESET_CITY { 1500, 7, 11, 5000, 67, 50, 100, 250, 0, 4050, 66, -26.0f } /* City */
+#define FMOD_PRESET_MOUNTAINS { 1500, 300, 100, 5000, 21, 27, 100, 250, 0, 1220, 82, -24.0f } /* Mountains */
+#define FMOD_PRESET_QUARRY { 1500, 61, 25, 5000, 83, 100, 100, 250, 0, 3400, 100, -5.0f } /* Quarry */
+#define FMOD_PRESET_PLAIN { 1500, 179, 100, 5000, 50, 21, 100, 250, 0, 1670, 65, -28.0f } /* Plain */
+#define FMOD_PRESET_PARKINGLOT { 1700, 8, 12, 5000, 100, 100, 100, 250, 0, 20000, 56, -19.5f } /* Parking lot */
+#define FMOD_PRESET_SEWERPIPE { 2800, 14, 21, 5000, 14, 80, 60, 250, 0, 3400, 66, 1.2f } /* Sewer pipe */
+#define FMOD_PRESET_UNDERWATER { 1500, 7, 11, 5000, 10, 100, 100, 250, 0, 500, 92, 7.0f } /* Underwater */
+/* [DEFINE_END] */
+
+
+/*
+[STRUCTURE]
+[
+ [DESCRIPTION]
+ Settings for advanced features like configuring memory and cpu usage for the FMOD_CREATECOMPRESSEDSAMPLE feature.
+
+ [REMARKS]
+ maxMPEGCodecs / maxADPCMCodecs / maxXMACodecs will determine the maximum cpu usage of playing realtime samples. Use this to lower potential excess cpu usage and also control memory usage.
+
+ maxPCMCodecs is for use with PS3 only. It will determine the maximum number of PCM voices that can be played at once. This includes streams of any format and all sounds created
+ *without* the FMOD_CREATECOMPRESSEDSAMPLE flag.
+
+ Memory will be allocated for codecs 'up front' (during System::init) if these values are specified as non zero. If any are zero, it allocates memory for the codec whenever a file of the type in question is loaded. So if maxMPEGCodecs is 0 for example, it will allocate memory for the mpeg codecs the first time an mp3 is loaded or an mp3 based .FSB file is loaded.
+
+ Due to inefficient encoding techniques on certain .wav based ADPCM files, FMOD can can need an extra 29720 bytes per codec. This means for lowest memory consumption. Use FSB as it uses an optimal/small ADPCM block size.
+
+ Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only. Do not change this value.
+ Members marked with [w] mean the variable can be written to. The user can set the value.
+ Members marked with [r/w] are either read or write depending on if you are using System::setAdvancedSettings (w) or System::getAdvancedSettings (r).
+
+ [SEE_ALSO]
+ System::setAdvancedSettings
+ System::getAdvancedSettings
+ System::init
+ FMOD_MODE
+]
+*/
+typedef struct FMOD_ADVANCEDSETTINGS
+{
+ int cbSize; /* [w] Size of this structure. Use sizeof(FMOD_ADVANCEDSETTINGS) NOTE: This must be set before calling System::getAdvancedSettings or System::setAdvancedSettings! */
+ int maxMPEGCodecs; /* [r/w] Optional. Specify 0 to ignore. For use with FMOD_CREATECOMPRESSEDSAMPLE only. MPEG codecs consume 22,216 bytes per instance and this number will determine how many MPEG channels can be played simultaneously. Default = 32. */
+ int maxADPCMCodecs; /* [r/w] Optional. Specify 0 to ignore. For use with FMOD_CREATECOMPRESSEDSAMPLE only. ADPCM codecs consume 2,480 bytes per instance and this number will determine how many ADPCM channels can be played simultaneously. Default = 32. */
+ int maxXMACodecs; /* [r/w] Optional. Specify 0 to ignore. For use with FMOD_CREATECOMPRESSEDSAMPLE only. XMA codecs consume 6,263 bytes per instance and this number will determine how many XMA channels can be played simultaneously. Default = 32. */
+ int maxVorbisCodecs; /* [r/w] Optional. Specify 0 to ignore. For use with FMOD_CREATECOMPRESSEDSAMPLE only. Vorbis codecs consume 16,512 bytes per instance and this number will determine how many Vorbis channels can be played simultaneously. Default = 32. */
+ int maxAT9Codecs; /* [r/w] Optional. Specify 0 to ignore. For use with FMOD_CREATECOMPRESSEDSAMPLE only. AT9 codecs consume 20,664 bytes per instance and this number will determine how many AT9 channels can be played simultaneously. Default = 32. */
+ int maxFADPCMCodecs; /* [r/w] Optional. Specify 0 to ignore. For use with FMOD_CREATECOMPRESSEDSAMPLE only. FADPCM codecs consume 2,232 bytes per instance and this number will determine how many FADPCM channels can be played simultaneously. Default = 32. */
+ int maxPCMCodecs; /* [r/w] Optional. Specify 0 to ignore. For use with PS3 only. PCM codecs consume 2,536 bytes per instance and this number will determine how many streams and PCM voices can be played simultaneously. Default = 32. */
+ int ASIONumChannels; /* [r/w] Optional. Specify 0 to ignore. Number of channels available on the ASIO device. */
+ char **ASIOChannelList; /* [r/w] Optional. Specify 0 to ignore. Pointer to an array of strings (number of entries defined by ASIONumChannels) with ASIO channel names. */
+ FMOD_SPEAKER *ASIOSpeakerList; /* [r/w] Optional. Specify 0 to ignore. Pointer to a list of speakers that the ASIO channels map to. This can be called after System::init to remap ASIO output. */
+ float HRTFMinAngle; /* [r/w] Optional. For use with FMOD_INIT_HRTF_LOWPASS. The angle range (0-360) of a 3D sound in relation to the listener, at which the HRTF function begins to have an effect. 0 = in front of the listener. 180 = from 90 degrees to the left of the listener to 90 degrees to the right. 360 = behind the listener. Default = 180.0. */
+ float HRTFMaxAngle; /* [r/w] Optional. For use with FMOD_INIT_HRTF_LOWPASS. The angle range (0-360) of a 3D sound in relation to the listener, at which the HRTF function has maximum effect. 0 = front of the listener. 180 = from 90 degrees to the left of the listener to 90 degrees to the right. 360 = behind the listener. Default = 360.0. */
+ float HRTFFreq; /* [r/w] Optional. Specify 0 to ignore. For use with FMOD_INIT_HRTF_LOWPASS. The cutoff frequency of the HRTF's lowpass filter function when at maximum effect. (i.e. at HRTFMaxAngle). Default = 4000.0. */
+ float vol0virtualvol; /* [r/w] Optional. Specify 0 to ignore. For use with FMOD_INIT_VOL0_BECOMES_VIRTUAL. If this flag is used, and the volume is below this, then the sound will become virtual. Use this value to raise the threshold to a different point where a sound goes virtual. */
+ unsigned int defaultDecodeBufferSize; /* [r/w] Optional. Specify 0 to ignore. For streams. This determines the default size of the double buffer (in milliseconds) that a stream uses. Default = 400ms */
+ unsigned short profilePort; /* [r/w] Optional. Specify 0 to ignore. For use with FMOD_INIT_PROFILE_ENABLE. Specify the port to listen on for connections by the profiler application. */
+ unsigned int geometryMaxFadeTime; /* [r/w] Optional. Specify 0 to ignore. The maximum time in miliseconds it takes for a channel to fade to the new level when its occlusion changes. */
+ float distanceFilterCenterFreq; /* [r/w] Optional. Specify 0 to ignore. For use with FMOD_INIT_DISTANCE_FILTERING. The default center frequency in Hz for the distance filtering effect. Default = 1500.0. */
+ int reverb3Dinstance; /* [r/w] Optional. Specify 0 to ignore. Out of 0 to 3, 3d reverb spheres will create a phyical reverb unit on this instance slot. See FMOD_REVERB_PROPERTIES. */
+ int DSPBufferPoolSize; /* [r/w] Optional. Specify 0 to ignore. Number of buffers in DSP buffer pool. Each buffer will be DSPBlockSize * sizeof(float) * SpeakerModeChannelCount. ie 7.1 @ 1024 DSP block size = 8 * 1024 * 4 = 32kb. Default = 8. */
+ unsigned int stackSizeStream; /* [r/w] Optional. Specify 0 to ignore. Specify the stack size for the FMOD Stream thread in bytes. Useful for custom codecs that use excess stack. Default 49,152 (48kb) */
+ unsigned int stackSizeNonBlocking; /* [r/w] Optional. Specify 0 to ignore. Specify the stack size for the FMOD_NONBLOCKING loading thread. Useful for custom codecs that use excess stack. Default 65,536 (64kb) */
+ unsigned int stackSizeMixer; /* [r/w] Optional. Specify 0 to ignore. Specify the stack size for the FMOD mixer thread. Useful for custom dsps that use excess stack. Default 49,152 (48kb) */
+ FMOD_DSP_RESAMPLER resamplerMethod; /* [r/w] Optional. Specify 0 to ignore. Resampling method used with fmod's software mixer. See FMOD_DSP_RESAMPLER for details on methods. */
+ unsigned int commandQueueSize; /* [r/w] Optional. Specify 0 to ignore. Specify the command queue size for thread safe processing. Default 2048 (2kb) */
+ unsigned int randomSeed; /* [r/w] Optional. Specify 0 to ignore. Seed value that FMOD will use to initialize its internal random number generators. */
+} FMOD_ADVANCEDSETTINGS;
+
+
+/*
+[DEFINE]
+[
+ [NAME]
+ FMOD_DRIVER_STATE
+
+ [DESCRIPTION]
+ Flags that provide additional information about a particular driver.
+
+ [REMARKS]
+
+ [SEE_ALSO]
+ System::getRecordDriverInfo
+]
+*/
+#define FMOD_DRIVER_STATE_CONNECTED 0x00000001 /* Device is currently plugged in. */
+#define FMOD_DRIVER_STATE_DEFAULT 0x00000002 /* Device is the users preferred choice. */
+/* [DEFINE_END] */
+
+
+/*$ preserve start $*/
+
+#include "fmod_codec.h"
+#include "fmod_dsp.h"
+#include "fmod_output.h"
+
+#endif
+
+/*$ preserve end $*/
diff --git a/app/src/main/cpp/inc/fmod_dsp.h b/app/src/main/cpp/inc/fmod_dsp.h
new file mode 100644
index 0000000..c324075
--- /dev/null
+++ b/app/src/main/cpp/inc/fmod_dsp.h
@@ -0,0 +1,916 @@
+/* ========================================================================================== */
+/* FMOD Studio - DSP header file. Copyright (c), Firelight Technologies Pty, Ltd. 2004-2017. */
+/* */
+/* Use this header if you are interested in delving deeper into the FMOD software mixing / */
+/* DSP engine. */
+/* Also use this header if you are wanting to develop your own DSP plugin to use with FMOD's */
+/* dsp system. With this header you can make your own DSP plugin that FMOD can */
+/* register and use. See the documentation and examples on how to make a working plugin. */
+/* */
+/* ========================================================================================== */
+
+#ifndef _FMOD_DSP_H
+#define _FMOD_DSP_H
+
+#include "fmod_dsp_effects.h"
+
+typedef struct FMOD_DSP_STATE FMOD_DSP_STATE;
+
+/*
+[STRUCTURE]
+[
+ [DESCRIPTION]
+ Structure for FMOD_DSP_PROCESS_CALLBACK input and output buffers.
+
+ [REMARKS]
+ Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only. Do not change this value.
+ Members marked with [w] mean the variable can be written to. The user can set the value.
+
+ [SEE_ALSO]
+ FMOD_DSP_DESCRIPTION
+]
+*/
+typedef struct FMOD_DSP_BUFFER_ARRAY
+{
+ int numbuffers; /* [r/w] number of buffers */
+ int *buffernumchannels; /* [r/w] array of number of channels for each buffer */
+ FMOD_CHANNELMASK *bufferchannelmask; /* [r/w] array of channel masks for each buffer */
+ float **buffers; /* [r/w] array of buffers */
+ FMOD_SPEAKERMODE speakermode; /* [r/w] speaker mode for all buffers in the array */
+} FMOD_DSP_BUFFER_ARRAY;
+
+
+/*
+[ENUM]
+[
+ [DESCRIPTION]
+ Operation type for FMOD_DSP_PROCESS_CALLBACK.
+
+ [REMARKS]
+ A process callback will be called twice per mix for a DSP unit. Once with the FMOD_DSP_PROCESS_QUERY command, then conditionally, FMOD_DSP_PROCESS_PERFORM.
+ FMOD_DSP_PROCESS_QUERY is to be handled only by filling out the outputarray information, and returning a relevant return code.
+ It should not really do any logic besides checking and returning one of the following codes:
+ - FMOD_OK - Meaning yes, it should execute the dsp process function with FMOD_DSP_PROCESS_PERFORM
+ - FMOD_ERR_DSP_DONTPROCESS - Meaning no, it should skip the process function and not call it with FMOD_DSP_PROCESS_PERFORM.
+ - FMOD_ERR_DSP_SILENCE - Meaning no, it should skip the process function and not call it with FMOD_DSP_PROCESS_PERFORM, AND, tell the signal chain to follow that it is now idle, so that no more processing happens down the chain.
+ If audio is to be processed, 'outbufferarray' must be filled with the expected output format, channel count and mask. Mask can be 0.
+
+ FMOD_DSP_PROCESS_PROCESS is to be handled by reading the data from the input, processing it, and writing it to the output. Always write to the output buffer and fill it fully to avoid unpredictable audio output.
+ Always return FMOD_OK, the return value is ignored from the process stage.
+
+ [SEE_ALSO]
+ FMOD_DSP_DESCRIPTION
+]
+*/
+typedef enum
+{
+ FMOD_DSP_PROCESS_PERFORM, /* Process the incoming audio in 'inbufferarray' and output to 'outbufferarray'. */
+ FMOD_DSP_PROCESS_QUERY /* The DSP is being queried for the expected output format and whether it needs to process audio or should be bypassed. The function should return FMOD_OK, or FMOD_ERR_DSP_DONTPROCESS or FMOD_ERR_DSP_SILENCE if audio can pass through unprocessed. See remarks for more. If audio is to be processed, 'outbufferarray' must be filled with the expected output format, channel count and mask. */
+} FMOD_DSP_PROCESS_OPERATION;
+
+
+/*
+[STRUCTURE]
+[
+ [DESCRIPTION]
+ Complex number structure used for holding FFT frequency domain-data for FMOD_FFTREAL and FMOD_IFFTREAL DSP functions.
+
+ [REMARKS]
+
+ [SEE_ALSO]
+ FMOD_DSP_STATE_FUNCTIONS
+ FMOD_DSP_STATE_DFT_FUNCTIONS
+]
+*/
+typedef struct FMOD_COMPLEX
+{
+ float real; /* Real component */
+ float imag; /* Imaginary component */
+} FMOD_COMPLEX;
+
+
+/*
+[ENUM]
+[
+ [DESCRIPTION]
+ Flags for the FMOD_DSP_PAN_SUMSURROUNDMATRIX_FUNC function.
+
+ [REMARKS]
+ This functionality is experimental, please contact support@fmod.org for more information.
+
+ [SEE_ALSO]
+ FMOD_DSP_STATE_PAN_FUNCTIONS
+]
+*/
+typedef enum FMOD_DSP_PAN_SURROUND_FLAGS
+{
+ FMOD_DSP_PAN_SURROUND_DEFAULT = 0,
+ FMOD_DSP_PAN_SURROUND_ROTATION_NOT_BIASED = 1,
+
+ FMOD_DSP_PAN_SURROUND_FLAGS_FORCEINT = 65536 /* Makes sure this enum is signed 32bit. */
+} FMOD_DSP_PAN_SURROUND_FLAGS;
+
+
+/*
+ FMOD_DSP_DESCRIPTION callbacks
+*/
+typedef FMOD_RESULT (F_CALL *FMOD_DSP_CREATE_CALLBACK) (FMOD_DSP_STATE *dsp_state);
+typedef FMOD_RESULT (F_CALL *FMOD_DSP_RELEASE_CALLBACK) (FMOD_DSP_STATE *dsp_state);
+typedef FMOD_RESULT (F_CALL *FMOD_DSP_RESET_CALLBACK) (FMOD_DSP_STATE *dsp_state);
+typedef FMOD_RESULT (F_CALL *FMOD_DSP_READ_CALLBACK) (FMOD_DSP_STATE *dsp_state, float *inbuffer, float *outbuffer, unsigned int length, int inchannels, int *outchannels);
+typedef FMOD_RESULT (F_CALL *FMOD_DSP_PROCESS_CALLBACK) (FMOD_DSP_STATE *dsp_state, unsigned int length, const FMOD_DSP_BUFFER_ARRAY *inbufferarray, FMOD_DSP_BUFFER_ARRAY *outbufferarray, FMOD_BOOL inputsidle, FMOD_DSP_PROCESS_OPERATION op);
+typedef FMOD_RESULT (F_CALL *FMOD_DSP_SETPOSITION_CALLBACK) (FMOD_DSP_STATE *dsp_state, unsigned int pos);
+typedef FMOD_RESULT (F_CALL *FMOD_DSP_SHOULDIPROCESS_CALLBACK) (FMOD_DSP_STATE *dsp_state, FMOD_BOOL inputsidle, unsigned int length, FMOD_CHANNELMASK inmask, int inchannels, FMOD_SPEAKERMODE speakermode);
+
+typedef FMOD_RESULT (F_CALL *FMOD_DSP_SETPARAM_FLOAT_CALLBACK) (FMOD_DSP_STATE *dsp_state, int index, float value);
+typedef FMOD_RESULT (F_CALL *FMOD_DSP_SETPARAM_INT_CALLBACK) (FMOD_DSP_STATE *dsp_state, int index, int value);
+typedef FMOD_RESULT (F_CALL *FMOD_DSP_SETPARAM_BOOL_CALLBACK) (FMOD_DSP_STATE *dsp_state, int index, FMOD_BOOL value);
+typedef FMOD_RESULT (F_CALL *FMOD_DSP_SETPARAM_DATA_CALLBACK) (FMOD_DSP_STATE *dsp_state, int index, void *data, unsigned int length);
+typedef FMOD_RESULT (F_CALL *FMOD_DSP_GETPARAM_FLOAT_CALLBACK) (FMOD_DSP_STATE *dsp_state, int index, float *value, char *valuestr);
+typedef FMOD_RESULT (F_CALL *FMOD_DSP_GETPARAM_INT_CALLBACK) (FMOD_DSP_STATE *dsp_state, int index, int *value, char *valuestr);
+typedef FMOD_RESULT (F_CALL *FMOD_DSP_GETPARAM_BOOL_CALLBACK) (FMOD_DSP_STATE *dsp_state, int index, FMOD_BOOL *value, char *valuestr);
+typedef FMOD_RESULT (F_CALL *FMOD_DSP_GETPARAM_DATA_CALLBACK) (FMOD_DSP_STATE *dsp_state, int index, void **data, unsigned int *length, char *valuestr);
+
+typedef FMOD_RESULT (F_CALL *FMOD_DSP_SYSTEM_REGISTER_CALLBACK) (FMOD_DSP_STATE *dsp_state);
+typedef FMOD_RESULT (F_CALL *FMOD_DSP_SYSTEM_DEREGISTER_CALLBACK) (FMOD_DSP_STATE *dsp_state);
+typedef FMOD_RESULT (F_CALL *FMOD_DSP_SYSTEM_MIX_CALLBACK) (FMOD_DSP_STATE *dsp_state, int stage);
+
+
+/*
+ FMOD_DSP_STATE functions
+*/
+typedef void * (F_CALL *FMOD_DSP_ALLOC_FUNC) (unsigned int size, FMOD_MEMORY_TYPE type, const char *sourcestr);
+typedef void * (F_CALL *FMOD_DSP_REALLOC_FUNC) (void *ptr, unsigned int size, FMOD_MEMORY_TYPE type, const char *sourcestr);
+typedef void (F_CALL *FMOD_DSP_FREE_FUNC) (void *ptr, FMOD_MEMORY_TYPE type, const char *sourcestr);
+typedef void (F_CALL *FMOD_DSP_LOG_FUNC) (FMOD_DEBUG_FLAGS level, const char *file, int line, const char *function, const char *string, ...);
+typedef FMOD_RESULT (F_CALL *FMOD_DSP_GETSAMPLERATE_FUNC) (FMOD_DSP_STATE *dsp_state, int *rate);
+typedef FMOD_RESULT (F_CALL *FMOD_DSP_GETBLOCKSIZE_FUNC) (FMOD_DSP_STATE *dsp_state, unsigned int *blocksize);
+typedef FMOD_RESULT (F_CALL *FMOD_DSP_GETSPEAKERMODE_FUNC) (FMOD_DSP_STATE *dsp_state, FMOD_SPEAKERMODE *speakermode_mixer, FMOD_SPEAKERMODE *speakermode_output);
+typedef FMOD_RESULT (F_CALL *FMOD_DSP_GETCLOCK_FUNC) (FMOD_DSP_STATE *dsp_state, unsigned long long *clock, unsigned int *offset, unsigned int *length);
+typedef FMOD_RESULT (F_CALL *FMOD_DSP_GETLISTENERATTRIBUTES_FUNC) (FMOD_DSP_STATE *dsp_state, int *numlisteners, FMOD_3D_ATTRIBUTES *attributes);
+typedef FMOD_RESULT (F_CALL *FMOD_DSP_GETUSERDATA_FUNC) (FMOD_DSP_STATE *dsp_state, void **userdata);
+
+typedef FMOD_RESULT (F_CALL *FMOD_DSP_DFT_FFTREAL_FUNC) (FMOD_DSP_STATE *dsp_state, int size, const float *signal, FMOD_COMPLEX* dft, const float *window, int signalhop);
+typedef FMOD_RESULT (F_CALL *FMOD_DSP_DFT_IFFTREAL_FUNC) (FMOD_DSP_STATE *dsp_state, int size, const FMOD_COMPLEX *dft, float* signal, const float *window, int signalhop);
+
+typedef FMOD_RESULT (F_CALL *FMOD_DSP_PAN_SUMMONOMATRIX_FUNC) (FMOD_DSP_STATE *dsp_state, int sourceSpeakerMode, float lowFrequencyGain, float overallGain, float *matrix);
+typedef FMOD_RESULT (F_CALL *FMOD_DSP_PAN_SUMSTEREOMATRIX_FUNC) (FMOD_DSP_STATE *dsp_state, int sourceSpeakerMode, float pan, float lowFrequencyGain, float overallGain, int matrixHop, float *matrix);
+typedef FMOD_RESULT (F_CALL *FMOD_DSP_PAN_SUMSURROUNDMATRIX_FUNC) (FMOD_DSP_STATE *dsp_state, int sourceSpeakerMode, int targetSpeakerMode, float direction, float extent, float rotation, float lowFrequencyGain, float overallGain, int matrixHop, float *matrix, FMOD_DSP_PAN_SURROUND_FLAGS flags);
+typedef FMOD_RESULT (F_CALL *FMOD_DSP_PAN_SUMMONOTOSURROUNDMATRIX_FUNC) (FMOD_DSP_STATE *dsp_state, int targetSpeakerMode, float direction, float extent, float lowFrequencyGain, float overallGain, int matrixHop, float *matrix);
+typedef FMOD_RESULT (F_CALL *FMOD_DSP_PAN_SUMSTEREOTOSURROUNDMATRIX_FUNC) (FMOD_DSP_STATE *dsp_state, int targetSpeakerMode, float direction, float extent, float rotation, float lowFrequencyGain, float overallGain, int matrixHop, float *matrix);
+typedef FMOD_RESULT (F_CALL *FMOD_DSP_PAN_GETROLLOFFGAIN_FUNC) (FMOD_DSP_STATE *dsp_state, FMOD_DSP_PAN_3D_ROLLOFF_TYPE rolloff, float distance, float mindistance, float maxdistance, float *gain);
+
+
+/*
+[DEFINE]
+[
+ [NAME]
+ FMOD_DSP_GETPARAM_VALUESTR_LENGTH
+
+ [DESCRIPTION]
+ Length in bytes of the buffer pointed to by the valuestr argument of FMOD_DSP_GETPARAM_XXXX_CALLBACK functions.
+
+ [REMARKS]
+ DSP plugins should not copy more than this number of bytes into the buffer or memory corruption will occur.
+
+ [SEE_ALSO]
+ FMOD_DSP_GETPARAM_FLOAT_CALLBACK
+ FMOD_DSP_GETPARAM_INT_CALLBACK
+ FMOD_DSP_GETPARAM_BOOL_CALLBACK
+ FMOD_DSP_GETPARAM_DATA_CALLBACK
+]
+*/
+#define FMOD_DSP_GETPARAM_VALUESTR_LENGTH 32
+/* [DEFINE_END] */
+
+/*
+[ENUM]
+[
+ [DESCRIPTION]
+ DSP parameter types.
+
+ [REMARKS]
+
+ [SEE_ALSO]
+ FMOD_DSP_PARAMETER_DESC
+]
+*/
+typedef enum
+{
+ FMOD_DSP_PARAMETER_TYPE_FLOAT, /* FMOD_DSP_PARAMETER_DESC will use the FMOD_DSP_PARAMETER_DESC_FLOAT. */
+ FMOD_DSP_PARAMETER_TYPE_INT, /* FMOD_DSP_PARAMETER_DESC will use the FMOD_DSP_PARAMETER_DESC_INT. */
+ FMOD_DSP_PARAMETER_TYPE_BOOL, /* FMOD_DSP_PARAMETER_DESC will use the FMOD_DSP_PARAMETER_DESC_BOOL. */
+ FMOD_DSP_PARAMETER_TYPE_DATA, /* FMOD_DSP_PARAMETER_DESC will use the FMOD_DSP_PARAMETER_DESC_DATA. */
+
+ FMOD_DSP_PARAMETER_TYPE_MAX, /* Maximum number of DSP parameter types. */
+ FMOD_DSP_PARAMETER_TYPE_FORCEINT = 65536 /* Makes sure this enum is signed 32bit. */
+} FMOD_DSP_PARAMETER_TYPE;
+
+
+/*
+[ENUM]
+[
+ [DESCRIPTION]
+ DSP float parameter mappings. These determine how values are mapped across dials and automation curves.
+
+ [REMARKS]
+ FMOD_DSP_PARAMETER_FLOAT_MAPPING_TYPE_AUTO generates a mapping based on range and units. For example, if the units are in Hertz and the range is with-in the audio spectrum, a Bark scale will be chosen. Logarithmic scales may also be generated for ranges above zero spanning several orders of magnitude.
+
+ [SEE_ALSO]
+ FMOD_DSP_PARAMETER_FLOAT_MAPPING
+]
+*/
+typedef enum
+{
+ FMOD_DSP_PARAMETER_FLOAT_MAPPING_TYPE_LINEAR, /* Values mapped linearly across range. */
+ FMOD_DSP_PARAMETER_FLOAT_MAPPING_TYPE_AUTO, /* A mapping is automatically chosen based on range and units. See remarks. */
+ FMOD_DSP_PARAMETER_FLOAT_MAPPING_TYPE_PIECEWISE_LINEAR, /* Values mapped in a piecewise linear fashion defined by FMOD_DSP_PARAMETER_FLOAT_MAPPING_PIECEWISE_LINEAR. */
+
+ FMOD_DSP_PARAMETER_FLOAT_MAPPING_TYPE_FORCEINT = 65536 /* Makes sure this enum is signed 32bit. */
+} FMOD_DSP_PARAMETER_FLOAT_MAPPING_TYPE;
+
+/*
+[STRUCTURE]
+[
+ [DESCRIPTION]
+ Structure to define a piecewise linear mapping.
+
+ [REMARKS]
+ Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only. Do not change this value.
+ Members marked with [w] mean the variable can be written to. The user can set the value.
+
+ [SEE_ALSO]
+ FMOD_DSP_PARAMETER_FLOAT_MAPPING_TYPE
+ FMOD_DSP_PARAMETER_FLOAT_MAPPING
+]
+*/
+typedef struct FMOD_DSP_PARAMETER_FLOAT_MAPPING_PIECEWISE_LINEAR
+{
+ int numpoints; /* [w] The number of pairs in the piecewise mapping (at least 2). */
+ float *pointparamvalues; /* [w] The values in the parameter's units for each point */
+ float *pointpositions; /* [w] The positions along the control's scale (e.g. dial angle) corresponding to each parameter value. The range of this scale is arbitrary and all positions will be relative to the minimum and maximum values (e.g. [0,1,3] is equivalent to [1,2,4] and [2,4,8]). If this array is zero, pointparamvalues will be distributed with equal spacing. */
+} FMOD_DSP_PARAMETER_FLOAT_MAPPING_PIECEWISE_LINEAR;
+
+
+/*
+[STRUCTURE]
+[
+ [DESCRIPTION]
+ Structure to define a mapping for a DSP unit's float parameter.
+
+ [REMARKS]
+ Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only. Do not change this value.
+ Members marked with [w] mean the variable can be written to. The user can set the value.
+
+ [SEE_ALSO]
+ FMOD_DSP_PARAMETER_FLOAT_MAPPING_TYPE
+ FMOD_DSP_PARAMETER_FLOAT_MAPPING_PIECEWISE_LINEAR
+ FMOD_DSP_PARAMETER_DESC_FLOAT
+]
+*/
+typedef struct FMOD_DSP_PARAMETER_FLOAT_MAPPING
+{
+ FMOD_DSP_PARAMETER_FLOAT_MAPPING_TYPE type;
+ FMOD_DSP_PARAMETER_FLOAT_MAPPING_PIECEWISE_LINEAR piecewiselinearmapping; /* [w] Only required for FMOD_DSP_PARAMETER_FLOAT_MAPPING_TYPE_PIECEWISE_LINEAR type mapping. */
+} FMOD_DSP_PARAMETER_FLOAT_MAPPING;
+
+
+/*
+[STRUCTURE]
+[
+ [DESCRIPTION]
+ Structure to define a float parameter for a DSP unit.
+
+ [REMARKS]
+ Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only. Do not change this value.
+ Members marked with [w] mean the variable can be written to. The user can set the value.
+
+ [SEE_ALSO]
+ System::createDSP
+ DSP::setParameterFloat
+ DSP::getParameterFloat
+ FMOD_DSP_PARAMETER_DESC
+ FMOD_DSP_PARAMETER_FLOAT_MAPPING
+]
+*/
+typedef struct FMOD_DSP_PARAMETER_DESC_FLOAT
+{
+ float min; /* [w] Minimum parameter value. */
+ float max; /* [w] Maximum parameter value. */
+ float defaultval; /* [w] Default parameter value. */
+ FMOD_DSP_PARAMETER_FLOAT_MAPPING mapping; /* [w] How the values are distributed across dials and automation curves (e.g. linearly, exponentially etc). */
+} FMOD_DSP_PARAMETER_DESC_FLOAT;
+
+
+/*
+[STRUCTURE]
+[
+ [DESCRIPTION]
+ Structure to define a int parameter for a DSP unit.
+
+ [REMARKS]
+ Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only. Do not change this value.
+ Members marked with [w] mean the variable can be written to. The user can set the value.
+
+ [SEE_ALSO]
+ System::createDSP
+ DSP::setParameterInt
+ DSP::getParameterInt
+ FMOD_DSP_PARAMETER_DESC
+]
+*/
+typedef struct FMOD_DSP_PARAMETER_DESC_INT
+{
+ int min; /* [w] Minimum parameter value. */
+ int max; /* [w] Maximum parameter value. */
+ int defaultval; /* [w] Default parameter value. */
+ FMOD_BOOL goestoinf; /* [w] Whether the last value represents infiniy. */
+ const char* const* valuenames; /* [w] Names for each value. There should be as many strings as there are possible values (max - min + 1). Optional. */
+} FMOD_DSP_PARAMETER_DESC_INT;
+
+
+/*
+[STRUCTURE]
+[
+ [DESCRIPTION]
+ Structure to define a boolean parameter for a DSP unit.
+
+ [REMARKS]
+ Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only. Do not change this value.
+ Members marked with [w] mean the variable can be written to. The user can set the value.
+
+ [SEE_ALSO]
+ System::createDSP
+ DSP::setParameterBool
+ DSP::getParameterBool
+ FMOD_DSP_PARAMETER_DESC
+]
+*/
+typedef struct FMOD_DSP_PARAMETER_DESC_BOOL
+{
+ FMOD_BOOL defaultval; /* [w] Default parameter value. */
+ const char* const* valuenames; /* [w] Names for false and true, respectively. There should be two strings. Optional. */
+} FMOD_DSP_PARAMETER_DESC_BOOL;
+
+
+/*
+[STRUCTURE]
+[
+ [DESCRIPTION]
+ Structure to define a data parameter for a DSP unit. Use 0 or above for custom types. This parameter will be treated specially by the system if set to one of the FMOD_DSP_PARAMETER_DATA_TYPE values.
+
+ [REMARKS]
+ Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only. Do not change this value.
+ Members marked with [w] mean the variable can be written to. The user can set the value.
+
+ [SEE_ALSO]
+ System::createDSP
+ DSP::setParameterData
+ DSP::getParameterData
+ FMOD_DSP_PARAMETER_DATA_TYPE
+ FMOD_DSP_PARAMETER_DESC
+]
+*/
+typedef struct FMOD_DSP_PARAMETER_DESC_DATA
+{
+ int datatype; /* [w] The type of data for this parameter. Use 0 or above for custom types or set to one of the FMOD_DSP_PARAMETER_DATA_TYPE values. */
+} FMOD_DSP_PARAMETER_DESC_DATA;
+
+
+/*
+[STRUCTURE]
+[
+ [DESCRIPTION]
+ Base Structure for DSP parameter descriptions.
+
+ [REMARKS]
+ Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only. Do not change this value.
+ Members marked with [w] mean the variable can be written to. The user can set the value.
+
+ [SEE_ALSO]
+ System::createDSP
+ DSP::setParameterFloat
+ DSP::getParameterFloat
+ DSP::setParameterInt
+ DSP::getParameterInt
+ DSP::setParameterBool
+ DSP::getParameterBool
+ DSP::setParameterData
+ DSP::getParameterData
+ FMOD_DSP_PARAMETER_DESC_FLOAT
+ FMOD_DSP_PARAMETER_DESC_INT
+ FMOD_DSP_PARAMETER_DESC_BOOL
+ FMOD_DSP_PARAMETER_DESC_DATA
+]
+*/
+typedef struct FMOD_DSP_PARAMETER_DESC
+{
+ FMOD_DSP_PARAMETER_TYPE type; /* [w] Type of this parameter. */
+ char name[16]; /* [w] Name of the parameter to be displayed (ie "Cutoff frequency"). */
+ char label[16]; /* [w] Short string to be put next to value to denote the unit type (ie "hz"). */
+ const char *description; /* [w] Description of the parameter to be displayed as a help item / tooltip for this parameter. */
+
+ union
+ {
+ FMOD_DSP_PARAMETER_DESC_FLOAT floatdesc; /* [w] Struct containing information about the parameter in floating point format. Use when type is FMOD_DSP_PARAMETER_TYPE_FLOAT. */
+ FMOD_DSP_PARAMETER_DESC_INT intdesc; /* [w] Struct containing information about the parameter in integer format. Use when type is FMOD_DSP_PARAMETER_TYPE_INT. */
+ FMOD_DSP_PARAMETER_DESC_BOOL booldesc; /* [w] Struct containing information about the parameter in boolean format. Use when type is FMOD_DSP_PARAMETER_TYPE_BOOL. */
+ FMOD_DSP_PARAMETER_DESC_DATA datadesc; /* [w] Struct containing information about the parameter in data format. Use when type is FMOD_DSP_PARAMETER_TYPE_DATA. */
+ };
+} FMOD_DSP_PARAMETER_DESC;
+
+
+/*
+[ENUM]
+[
+ [DESCRIPTION]
+ Built-in types for the 'datatype' member of FMOD_DSP_PARAMETER_DESC_DATA. Data parameters of type other than FMOD_DSP_PARAMETER_DATA_TYPE_USER will be treated specially by the system.
+
+ [REMARKS]
+
+ [SEE_ALSO]
+ FMOD_DSP_PARAMETER_DESC_DATA
+ FMOD_DSP_PARAMETER_OVERALLGAIN
+ FMOD_DSP_PARAMETER_3DATTRIBUTES
+ FMOD_DSP_PARAMETER_3DATTRIBUTES_MULTI
+ FMOD_DSP_PARAMETER_SIDECHAIN
+]
+*/
+typedef enum
+{
+ FMOD_DSP_PARAMETER_DATA_TYPE_USER = 0, /* The default data type. All user data types should be 0 or above. */
+ FMOD_DSP_PARAMETER_DATA_TYPE_OVERALLGAIN = -1, /* The data type for FMOD_DSP_PARAMETER_OVERALLGAIN parameters. There should a maximum of one per DSP. */
+ FMOD_DSP_PARAMETER_DATA_TYPE_3DATTRIBUTES = -2, /* The data type for FMOD_DSP_PARAMETER_3DATTRIBUTES parameters. There should a maximum of one per DSP. */
+ FMOD_DSP_PARAMETER_DATA_TYPE_SIDECHAIN = -3, /* The data type for FMOD_DSP_PARAMETER_SIDECHAIN parameters. There should a maximum of one per DSP. */
+ FMOD_DSP_PARAMETER_DATA_TYPE_FFT = -4, /* The data type for FMOD_DSP_PARAMETER_FFT parameters. There should a maximum of one per DSP. */
+ FMOD_DSP_PARAMETER_DATA_TYPE_3DATTRIBUTES_MULTI = -5, /* The data type for FMOD_DSP_PARAMETER_3DATTRIBUTES_MULTI parameters. There should a maximum of one per DSP. */
+} FMOD_DSP_PARAMETER_DATA_TYPE;
+
+
+/*
+[STRUCTURE]
+[
+ [DESCRIPTION]
+ Structure for data parameters of type FMOD_DSP_PARAMETER_DATA_TYPE_OVERALLGAIN.
+ A parameter of this type is used in effects that affect the overgain of the signal in a predictable way.
+ This parameter is read by the system to determine the effect's gain for voice virtualization.
+
+ [REMARKS]
+ Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only. Do not change this value.
+ Members marked with [w] mean the variable can be written to. The user can set the value.
+
+ [SEE_ALSO]
+ FMOD_DSP_PARAMETER_DATA_TYPE
+ FMOD_DSP_PARAMETER_DESC
+]
+*/
+typedef struct FMOD_DSP_PARAMETER_OVERALLGAIN
+{
+ float linear_gain; /* [r] The overall linear gain of the effect on the direct signal path */
+ float linear_gain_additive; /* [r] Additive gain, for parallel signal paths */
+} FMOD_DSP_PARAMETER_OVERALLGAIN;
+
+
+/*
+[STRUCTURE]
+[
+ [DESCRIPTION]
+ Structure for data parameters of type FMOD_DSP_PARAMETER_DATA_TYPE_3DATTRIBUTES.
+
+ A parameter of this type is used in effects that respond to a 3D position.
+
+ [REMARKS]
+ The FMOD::Studio::System will set this parameter automatically if an FMOD::Studio::EventInstance position
+ changes, however if using the low level FMOD::System you must set this DSP parameter explicitly.
+
+ FMOD will convert passed in co-ordinates to left-handed for the plugin if the System was initialized with the FMOD_INIT_3D_RIGHTHANDED flag.
+
+ Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only. Do not change this value.
+ Members marked with [w] mean the variable can be written to. The user can set the value.
+
+ [SEE_ALSO]
+ FMOD_DSP_PARAMETER_DATA_TYPE
+ FMOD_DSP_PARAMETER_DESC
+]
+*/
+typedef struct FMOD_DSP_PARAMETER_3DATTRIBUTES
+{
+ FMOD_3D_ATTRIBUTES relative; /* [w] The position of the sound relative to the listener. */
+ FMOD_3D_ATTRIBUTES absolute; /* [w] The position of the sound in world coordinates. */
+} FMOD_DSP_PARAMETER_3DATTRIBUTES;
+
+
+/*
+[STRUCTURE]
+[
+ [DESCRIPTION]
+ Structure for data parameters of type FMOD_DSP_PARAMETER_DATA_TYPE_3DATTRIBUTES_MULTI.
+
+ A parameter of this type is used in effects that respond to a 3D position and support multiple listeners.
+
+ [REMARKS]
+ The FMOD::Studio::System will set this parameter automatically if an FMOD::Studio::EventInstance position
+ changes, however if using the low level FMOD::System you must set this DSP parameter explicitly.
+
+ FMOD will convert passed in co-ordinates to left-handed for the plugin if the System was initialized with the FMOD_INIT_3D_RIGHTHANDED flag.
+
+ Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only. Do not change this value.
+ Members marked with [w] mean the variable can be written to. The user can set the value.
+
+ [SEE_ALSO]
+ FMOD_DSP_PARAMETER_DATA_TYPE
+ FMOD_DSP_PARAMETER_DESC
+]
+*/
+typedef struct FMOD_DSP_PARAMETER_3DATTRIBUTES_MULTI
+{
+ int numlisteners; /* [w] The number of listeners. */
+ FMOD_3D_ATTRIBUTES relative[FMOD_MAX_LISTENERS]; /* [w] The position of the sound relative to the listeners. */
+ float weight[FMOD_MAX_LISTENERS]; /* [w] The weighting of the listeners where 0 means listener has no contribution and 1 means full contribution. */
+ FMOD_3D_ATTRIBUTES absolute; /* [w] The position of the sound in world coordinates. */
+} FMOD_DSP_PARAMETER_3DATTRIBUTES_MULTI;
+
+
+/*
+[STRUCTURE]
+[
+ [DESCRIPTION]
+ Structure for data parameters of type FMOD_DSP_PARAMETER_DATA_TYPE_SIDECHAIN.
+ A parameter of this type is declared for effects which support sidechaining.
+
+ [REMARKS]
+ Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only. Do not change this value.
+ Members marked with [w] mean the variable can be written to. The user can set the value.
+
+ [SEE_ALSO]
+ FMOD_DSP_PARAMETER_DATA_TYPE
+ FMOD_DSP_PARAMETER_DESC
+]
+*/
+typedef struct FMOD_DSP_PARAMETER_SIDECHAIN
+{
+ FMOD_BOOL sidechainenable; /* [r/w] Whether sidechains are enabled. */
+} FMOD_DSP_PARAMETER_SIDECHAIN;
+
+
+/*
+[STRUCTURE]
+[
+ [DESCRIPTION]
+ Structure for data parameters of type FMOD_DSP_PARAMETER_DATA_TYPE_FFT.
+ A parameter of this type is declared for the FMOD_DSP_TYPE_FFT effect.
+
+ [REMARKS]
+ Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only. Do not change this value.
+ Members marked with [w] mean the variable can be written to. The user can set the value.
+
+ Notes on the spectrum data member. Values inside the float buffer are typically between 0 and 1.0.
+ Each top level array represents one PCM channel of data.
+ Address data as spectrum[channel][bin]. A bin is 1 fft window entry.
+ Only read/display half of the buffer typically for analysis as the 2nd half is usually the same data reversed due to the nature of the way FFT works.
+
+ [SEE_ALSO]
+ FMOD_DSP_PARAMETER_DATA_TYPE
+ FMOD_DSP_PARAMETER_DESC
+ FMOD_DSP_PARAMETER_DATA_TYPE_FFT
+ FMOD_DSP_TYPE
+ FMOD_DSP_FFT
+]
+*/
+typedef struct FMOD_DSP_PARAMETER_FFT
+{
+ int length; /* [r] Number of entries in this spectrum window. Divide this by the output rate to get the hz per entry. */
+ int numchannels; /* [r] Number of channels in spectrum. */
+ float *spectrum[32]; /* [r] Per channel spectrum arrays. See remarks for more. */
+} FMOD_DSP_PARAMETER_FFT;
+
+
+/*
+ Helpers for declaring parameters in custom DSPSs
+*/
+#define FMOD_DSP_INIT_PARAMDESC_FLOAT(_paramstruct, _name, _label, _description, _min, _max, _defaultval) \
+ memset(&(_paramstruct), 0, sizeof(_paramstruct)); \
+ (_paramstruct).type = FMOD_DSP_PARAMETER_TYPE_FLOAT; \
+ strncpy((_paramstruct).name, _name, 15); \
+ strncpy((_paramstruct).label, _label, 15); \
+ (_paramstruct).description = _description; \
+ (_paramstruct).floatdesc.min = _min; \
+ (_paramstruct).floatdesc.max = _max; \
+ (_paramstruct).floatdesc.defaultval = _defaultval; \
+ (_paramstruct).floatdesc.mapping.type = FMOD_DSP_PARAMETER_FLOAT_MAPPING_TYPE_AUTO;
+
+#define FMOD_DSP_INIT_PARAMDESC_FLOAT_WITH_MAPPING(_paramstruct, _name, _label, _description, _defaultval, _values, _positions); \
+ memset(&(_paramstruct), 0, sizeof(_paramstruct)); \
+ (_paramstruct).type = FMOD_DSP_PARAMETER_TYPE_FLOAT; \
+ strncpy((_paramstruct).name, _name , 15); \
+ strncpy((_paramstruct).label, _label, 15); \
+ (_paramstruct).description = _description; \
+ (_paramstruct).floatdesc.min = _values[0]; \
+ (_paramstruct).floatdesc.max = _values[sizeof(_values) / sizeof(float) - 1]; \
+ (_paramstruct).floatdesc.defaultval = _defaultval; \
+ (_paramstruct).floatdesc.mapping.type = FMOD_DSP_PARAMETER_FLOAT_MAPPING_TYPE_PIECEWISE_LINEAR; \
+ (_paramstruct).floatdesc.mapping.piecewiselinearmapping.numpoints = sizeof(_values) / sizeof(float); \
+ (_paramstruct).floatdesc.mapping.piecewiselinearmapping.pointparamvalues = _values; \
+ (_paramstruct).floatdesc.mapping.piecewiselinearmapping.pointpositions = _positions;
+
+#define FMOD_DSP_INIT_PARAMDESC_INT(_paramstruct, _name, _label, _description, _min, _max, _defaultval, _goestoinf, _valuenames) \
+ memset(&(_paramstruct), 0, sizeof(_paramstruct)); \
+ (_paramstruct).type = FMOD_DSP_PARAMETER_TYPE_INT; \
+ strncpy((_paramstruct).name, _name , 15); \
+ strncpy((_paramstruct).label, _label, 15); \
+ (_paramstruct).description = _description; \
+ (_paramstruct).intdesc.min = _min; \
+ (_paramstruct).intdesc.max = _max; \
+ (_paramstruct).intdesc.defaultval = _defaultval; \
+ (_paramstruct).intdesc.goestoinf = _goestoinf; \
+ (_paramstruct).intdesc.valuenames = _valuenames;
+
+#define FMOD_DSP_INIT_PARAMDESC_INT_ENUMERATED(_paramstruct, _name, _label, _description, _defaultval, _valuenames) \
+ memset(&(_paramstruct), 0, sizeof(_paramstruct)); \
+ (_paramstruct).type = FMOD_DSP_PARAMETER_TYPE_INT; \
+ strncpy((_paramstruct).name, _name , 15); \
+ strncpy((_paramstruct).label, _label, 15); \
+ (_paramstruct).description = _description; \
+ (_paramstruct).intdesc.min = 0; \
+ (_paramstruct).intdesc.max = sizeof(_valuenames) / sizeof(char*) - 1; \
+ (_paramstruct).intdesc.defaultval = _defaultval; \
+ (_paramstruct).intdesc.goestoinf = false; \
+ (_paramstruct).intdesc.valuenames = _valuenames;
+
+#define FMOD_DSP_INIT_PARAMDESC_BOOL(_paramstruct, _name, _label, _description, _defaultval, _valuenames) \
+ memset(&(_paramstruct), 0, sizeof(_paramstruct)); \
+ (_paramstruct).type = FMOD_DSP_PARAMETER_TYPE_BOOL; \
+ strncpy((_paramstruct).name, _name , 15); \
+ strncpy((_paramstruct).label, _label, 15); \
+ (_paramstruct).description = _description; \
+ (_paramstruct).booldesc.defaultval = _defaultval; \
+ (_paramstruct).booldesc.valuenames = _valuenames;
+
+#define FMOD_DSP_INIT_PARAMDESC_DATA(_paramstruct, _name, _label, _description, _datatype) \
+ memset(&(_paramstruct), 0, sizeof(_paramstruct)); \
+ (_paramstruct).type = FMOD_DSP_PARAMETER_TYPE_DATA; \
+ strncpy((_paramstruct).name, _name , 15); \
+ strncpy((_paramstruct).label, _label, 15); \
+ (_paramstruct).description = _description; \
+ (_paramstruct).datadesc.datatype = _datatype;
+
+#define FMOD_PLUGIN_SDK_VERSION 110
+
+/*
+[STRUCTURE]
+[
+ [DESCRIPTION]
+ When creating a DSP unit, declare one of these and provide the relevant callbacks and name for FMOD to use when it creates and uses a DSP unit of this type.
+
+ [REMARKS]
+ Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only. Do not change this value.
+ Members marked with [w] mean the variable can be written to. The user can set the value.
+
+ There are 2 different ways to change a parameter in this architecture.
+ One is to use DSP::setParameterFloat / DSP::setParameterInt / DSP::setParameterBool / DSP::setParameterData. This is platform independant and is dynamic, so new unknown plugins can have their parameters enumerated and used.
+ The other is to use DSP::showConfigDialog. This is platform specific and requires a GUI, and will display a dialog box to configure the plugin.
+
+ [SEE_ALSO]
+ System::createDSP
+ DSP::setParameterFloat
+ DSP::setParameterInt
+ DSP::setParameterBool
+ DSP::setParameterData
+ FMOD_DSP_STATE
+ FMOD_DSP_CREATE_CALLBACK
+ FMOD_DSP_RELEASE_CALLBACK
+ FMOD_DSP_RESET_CALLBACK
+ FMOD_DSP_READ_CALLBACK
+ FMOD_DSP_PROCESS_CALLBACK
+ FMOD_DSP_SETPOSITION_CALLBACK
+ FMOD_DSP_PARAMETER_DESC
+ FMOD_DSP_SETPARAM_FLOAT_CALLBACK
+ FMOD_DSP_SETPARAM_INT_CALLBACK
+ FMOD_DSP_SETPARAM_BOOL_CALLBACK
+ FMOD_DSP_SETPARAM_DATA_CALLBACK
+ FMOD_DSP_GETPARAM_FLOAT_CALLBACK
+ FMOD_DSP_GETPARAM_INT_CALLBACK
+ FMOD_DSP_GETPARAM_BOOL_CALLBACK
+ FMOD_DSP_GETPARAM_DATA_CALLBACK
+ FMOD_DSP_SHOULDIPROCESS_CALLBACK
+ FMOD_DSP_SYSTEM_REGISTER_CALLBACK
+ FMOD_DSP_SYSTEM_DEREGISTER_CALLBACK
+ FMOD_DSP_SYSTEM_MIX_CALLBACK
+]
+*/
+typedef struct FMOD_DSP_DESCRIPTION
+{
+ unsigned int pluginsdkversion; /* [w] The plugin SDK version this plugin is built for. Set to this to FMOD_PLUGIN_SDK_VERSION defined above. */
+ char name[32]; /* [w] The identifier of the DSP. This will also be used as the name of DSP and shouldn't change between versions. */
+ unsigned int version; /* [w] Plugin writer's version number. */
+ int numinputbuffers; /* [w] Number of input buffers to process. Use 0 for DSPs that only generate sound and 1 for effects that process incoming sound. */
+ int numoutputbuffers; /* [w] Number of audio output buffers. Only one output buffer is currently supported. */
+ FMOD_DSP_CREATE_CALLBACK create; /* [w] Create callback. This is called when DSP unit is created. Can be null. */
+ FMOD_DSP_RELEASE_CALLBACK release; /* [w] Release callback. This is called just before the unit is freed so the user can do any cleanup needed for the unit. Can be null. */
+ FMOD_DSP_RESET_CALLBACK reset; /* [w] Reset callback. This is called by the user to reset any history buffers that may need resetting for a filter, when it is to be used or re-used for the first time to its initial clean state. Use to avoid clicks or artifacts. */
+ FMOD_DSP_READ_CALLBACK read; /* [w] Read callback. Processing is done here. Can be null. */
+ FMOD_DSP_PROCESS_CALLBACK process; /* [w] Process callback. Can be specified instead of the read callback if any channel format changes occur between input and output. This also replaces shouldiprocess and should return an error if the effect is to be bypassed. Can be null. */
+ FMOD_DSP_SETPOSITION_CALLBACK setposition; /* [w] Set position callback. This is called if the unit wants to update its position info but not process data, or reset a cursor position internally if it is reading data from a certain source. Can be null. */
+
+ int numparameters; /* [w] Number of parameters used in this filter. The user finds this with DSP::getNumParameters */
+ FMOD_DSP_PARAMETER_DESC **paramdesc; /* [w] Variable number of parameter structures. */
+ FMOD_DSP_SETPARAM_FLOAT_CALLBACK setparameterfloat; /* [w] This is called when the user calls DSP::setParameterFloat. Can be null. */
+ FMOD_DSP_SETPARAM_INT_CALLBACK setparameterint; /* [w] This is called when the user calls DSP::setParameterInt. Can be null. */
+ FMOD_DSP_SETPARAM_BOOL_CALLBACK setparameterbool; /* [w] This is called when the user calls DSP::setParameterBool. Can be null. */
+ FMOD_DSP_SETPARAM_DATA_CALLBACK setparameterdata; /* [w] This is called when the user calls DSP::setParameterData. Can be null. */
+ FMOD_DSP_GETPARAM_FLOAT_CALLBACK getparameterfloat; /* [w] This is called when the user calls DSP::getParameterFloat. Can be null. */
+ FMOD_DSP_GETPARAM_INT_CALLBACK getparameterint; /* [w] This is called when the user calls DSP::getParameterInt. Can be null. */
+ FMOD_DSP_GETPARAM_BOOL_CALLBACK getparameterbool; /* [w] This is called when the user calls DSP::getParameterBool. Can be null. */
+ FMOD_DSP_GETPARAM_DATA_CALLBACK getparameterdata; /* [w] This is called when the user calls DSP::getParameterData. Can be null. */
+ FMOD_DSP_SHOULDIPROCESS_CALLBACK shouldiprocess; /* [w] This is called before processing. You can detect if inputs are idle and return FMOD_OK to process, or any other error code to avoid processing the effect. Use a count down timer to allow effect tails to process before idling! */
+ void *userdata; /* [w] Optional. Specify 0 to ignore. This is user data to be attached to the DSP unit during creation. Access via FMOD_DSP_STATE_FUNCTIONS::getuserdata. */
+
+ FMOD_DSP_SYSTEM_REGISTER_CALLBACK sys_register; /* [w] Register callback. This is called when DSP unit is loaded/registered. Useful for 'global'/per system object init for plugin. Can be null. */
+ FMOD_DSP_SYSTEM_DEREGISTER_CALLBACK sys_deregister; /* [w] Deregister callback. This is called when DSP unit is unloaded/deregistered. Useful as 'global'/per system object shutdown for plugin. Can be null. */
+ FMOD_DSP_SYSTEM_MIX_CALLBACK sys_mix; /* [w] System mix stage callback. This is called when the mixer starts to execute or is just finishing executing. Useful for 'global'/per system object once a mix update calls for a plugin. Can be null. */
+
+} FMOD_DSP_DESCRIPTION;
+
+
+/*
+[STRUCTURE]
+[
+ [DESCRIPTION]
+ Struct containing DFT functions to enable a plugin to perform optimized time-frequency domain conversion.
+
+ [REMARKS]
+ Members marked with [r] mean read only for the developer, read/write for the FMOD system.
+
+ Members marked with [w] mean read/write for the developer, read only for the FMOD system.
+
+ [SEE_ALSO]
+ FMOD_DSP_STATE_FUNCTIONS
+]
+*/
+typedef struct FMOD_DSP_STATE_DFT_FUNCTIONS
+{
+ FMOD_DSP_DFT_FFTREAL_FUNC fftreal; /* [r] Function for performing an FFT on a real signal. */
+ FMOD_DSP_DFT_IFFTREAL_FUNC inversefftreal; /* [r] Function for performing an inverse FFT to get a real signal. */
+} FMOD_DSP_STATE_DFT_FUNCTIONS;
+
+
+/*
+[STRUCTURE]
+[
+ [DESCRIPTION]
+ Struct containing panning helper functions for spatialization plugins.
+
+ [REMARKS]
+ These are experimental, please contact support@fmod.org for more information.
+
+ Members marked with [r] mean read only for the developer, read/write for the FMOD system.
+
+ Members marked with [w] mean read/write for the developer, read only for the FMOD system.
+
+ [SEE_ALSO]
+ FMOD_DSP_STATE_FUNCTIONS
+ FMOD_DSP_PAN_SURROUND_FLAGS
+]
+*/
+typedef struct FMOD_DSP_STATE_PAN_FUNCTIONS
+{
+ FMOD_DSP_PAN_SUMMONOMATRIX_FUNC summonomatrix; /* [r] TBD. */
+ FMOD_DSP_PAN_SUMSTEREOMATRIX_FUNC sumstereomatrix; /* [r] TBD. */
+ FMOD_DSP_PAN_SUMSURROUNDMATRIX_FUNC sumsurroundmatrix; /* [r] TBD. */
+ FMOD_DSP_PAN_SUMMONOTOSURROUNDMATRIX_FUNC summonotosurroundmatrix; /* [r] TBD. */
+ FMOD_DSP_PAN_SUMSTEREOTOSURROUNDMATRIX_FUNC sumstereotosurroundmatrix; /* [r] TBD. */
+ FMOD_DSP_PAN_GETROLLOFFGAIN_FUNC getrolloffgain; /* [r] TBD. */
+} FMOD_DSP_STATE_PAN_FUNCTIONS;
+
+
+/*
+[STRUCTURE]
+[
+ [DESCRIPTION]
+ Struct containing functions to give plugin developers the ability to query system state, access system level functionality and helpers.
+
+ [REMARKS]
+ Members marked with [r] mean read only for the developer, read/write for the FMOD system.
+
+ Members marked with [w] mean read/write for the developer, read only for the FMOD system.
+
+ [SEE_ALSO]
+ FMOD_DSP_STATE
+ FMOD_DSP_STATE_DFT_FUNCTIONS
+ FMOD_DSP_STATE_PAN_FUNCTIONS
+]
+*/
+typedef struct FMOD_DSP_STATE_FUNCTIONS
+{
+ FMOD_DSP_ALLOC_FUNC alloc; /* [r] Function to allocate memory using the FMOD memory system. */
+ FMOD_DSP_REALLOC_FUNC realloc; /* [r] Function to reallocate memory using the FMOD memory system. */
+ FMOD_DSP_FREE_FUNC free; /* [r] Function to free memory allocated with FMOD_DSP_ALLOC_FUNC. */
+ FMOD_DSP_GETSAMPLERATE_FUNC getsamplerate; /* [r] Function to query the system sample rate. */
+ FMOD_DSP_GETBLOCKSIZE_FUNC getblocksize; /* [r] Function to query the system block size, DSPs will be requested to process blocks of varying length up to this size. */
+ FMOD_DSP_STATE_DFT_FUNCTIONS *dft; /* [r] Struct containing DFT functions to enable a plugin to perform optimized time-frequency domain conversion. */
+ FMOD_DSP_STATE_PAN_FUNCTIONS *pan; /* [r] Struct containing panning helper functions for spatialization plugins. */
+ FMOD_DSP_GETSPEAKERMODE_FUNC getspeakermode; /* [r] Function to query the system speaker modes. One is the mixer's default speaker mode, the other is the output mode the system is downmixing or upmixing to.*/
+ FMOD_DSP_GETCLOCK_FUNC getclock; /* [r] Function to get the clock of the current DSP, as well as the subset of the input buffer that contains the signal. */
+ FMOD_DSP_GETLISTENERATTRIBUTES_FUNC getlistenerattributes; /* [r] Callback for getting the absolute listener attributes set via the API (returned as left-handed co-ordinates). */
+ FMOD_DSP_LOG_FUNC log; /* [r] Function to write to the FMOD logging system. */
+ FMOD_DSP_GETUSERDATA_FUNC getuserdata; /* [r] Function to get the user data attached to this DSP. See FMOD_DSP_DESCRIPTION::userdata. */
+} FMOD_DSP_STATE_FUNCTIONS;
+
+
+/*
+[STRUCTURE]
+[
+ [DESCRIPTION]
+ DSP plugin structure that is passed into each callback.
+
+ [REMARKS]
+ Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only. Do not change this value.
+ Members marked with [w] mean the variable can be written to. The user can set the value.
+
+ 'systemobject' is an integer that relates to the System object that created the DSP or registered the DSP plugin. If only 1 System object is created then it should be 0. A second object would be 1 and so on.
+ FMOD_DSP_STATE_FUNCTIONS::getsamplerate/getblocksize/getspeakermode could return different results so it could be relevant to plugin developers to monitor which object is being used.
+
+ [SEE_ALSO]
+ FMOD_DSP_DESCRIPTION
+ FMOD_DSP_STATE_FUNCTIONS
+]
+*/
+struct FMOD_DSP_STATE
+{
+ FMOD_DSP *instance; /* [r] Handle to the FMOD_DSP object the callback is associated with. Not to be modified. C++ users cast to FMOD::DSP to use. */
+ void *plugindata; /* [w] Plugin writer created data the output author wants to attach to this object. */
+ FMOD_CHANNELMASK channelmask; /* [r] Specifies which speakers the DSP effect is active on */
+ FMOD_SPEAKERMODE source_speakermode; /* [r] Specifies which speaker mode the signal originated for information purposes, ie in case panning needs to be done differently. */
+ float *sidechaindata; /* [r] The mixed result of all incoming sidechains is stored at this pointer address. */
+ int sidechainchannels; /* [r] The number of channels of pcm data stored within the sidechain buffer. */
+ FMOD_DSP_STATE_FUNCTIONS *functions; /* [r] Struct containing functions to give plugin developers the ability to query system state, access system level functionality and helpers. */
+ int systemobject; /* [r] FMOD::System object index, relating to the System object that created this DSP. */
+};
+
+
+/*
+ Macro helpers for accessing FMOD_DSP_STATE_FUNCTIONS
+*/
+#define FMOD_DSP_ALLOC(_state, _size) \
+ (_state)->functions->alloc(_size, FMOD_MEMORY_NORMAL, __FILE__)
+#define FMOD_DSP_REALLOC(_state, _ptr, _size) \
+ (_state)->functions->realloc(_ptr, _size, FMOD_MEMORY_NORMAL, __FILE__)
+#define FMOD_DSP_FREE(_state, _ptr) \
+ (_state)->functions->free(_ptr, FMOD_MEMORY_NORMAL, __FILE__)
+#define FMOD_DSP_LOG(_state, _level, _location, _format, ...) \
+ (_state)->functions->log(_level, __FILE__, __LINE__, _location, _format, __VA_ARGS__)
+#define FMOD_DSP_GETSAMPLERATE(_state, _rate) \
+ (_state)->functions->getsamplerate(_state, _rate)
+#define FMOD_DSP_GETBLOCKSIZE(_state, _blocksize) \
+ (_state)->functions->getblocksize(_state, _blocksize)
+#define FMOD_DSP_GETSPEAKERMODE(_state, _speakermodemix, _speakermodeout) \
+ (_state)->functions->getspeakermode(_state, _speakermodemix, _speakermodeout)
+#define FMOD_DSP_GETCLOCK(_state, _clock, _offset, _length) \
+ (_state)->functions->getclock(_state, _clock, _offset, _length)
+#define FMOD_DSP_GETLISTENERATTRIBUTES(_state, _numlisteners, _attributes) \
+ (_state)->functions->getlistenerattributes(_state, _numlisteners, _attributes)
+#define FMOD_DSP_GETUSERDATA(_state, _userdata) \
+ (_state)->functions->getuserdata(_state, _userdata)
+#define FMOD_DSP_DFT_FFTREAL(_state, _size, _signal, _dft, _window, _signalhop) \
+ (_state)->functions->dft->fftreal(_state, _size, _signal, _dft, _window, _signalhop)
+#define FMOD_DSP_DFT_IFFTREAL(_state, _size, _dft, _signal, _window, _signalhop) \
+ (_state)->functions->dft->inversefftreal(_state, _size, _dft, _signal, _window, _signalhop)
+#define FMOD_DSP_PAN_SUMMONOMATRIX(_state, _sourcespeakermode, _lowfrequencygain, _overallgain, _matrix) \
+ (_state)->functions->pan->summonomatrix(_state, _sourcespeakermode, _lowfrequencygain, _overallgain, _matrix)
+#define FMOD_DSP_PAN_SUMSTEREOMATRIX(_state, _sourcespeakermode, _pan, _lowfrequencygain, _overallgain, _matrixhop, _matrix) \
+ (_state)->functions->pan->sumstereomatrix(_state, _sourcespeakermode, _pan, _lowfrequencygain, _overallgain, _matrixhop, _matrix)
+#define FMOD_DSP_PAN_SUMSURROUNDMATRIX(_state, _sourcespeakermode, _targetspeakermode, _direction, _extent, _rotation, _lowfrequencygain, _overallgain, _matrixhop, _matrix, _flags) \
+ (_state)->functions->pan->sumsurroundmatrix(_state, _sourcespeakermode, _targetspeakermode, _direction, _extent, _rotation, _lowfrequencygain, _overallgain, _matrixhop, _matrix, _flags)
+#define FMOD_DSP_PAN_SUMMONOTOSURROUNDMATRIX(_state, _targetspeakermode, _direction, _extent, _lowfrequencygain, _overallgain, _matrixhop, _matrix) \
+ (_state)->functions->pan->summonotosurroundmatrix(_state, _targetspeakermode, _direction, _extent, _lowfrequencygain, _overallgain, _matrixhop, _matrix)
+#define FMOD_DSP_PAN_SUMSTEREOTOSURROUNDMATRIX(_state, _targetspeakermode, _direction, _extent, _rotation, _lowfrequencygain, _overallgain, matrixhop, _matrix) \
+ (_state)->functions->pan->sumstereotosurroundmatrix(_state, _targetspeakermode, _direction, _extent, _rotation, _lowfrequencygain, _overallgain, matrixhop, _matrix)
+#define FMOD_DSP_PAN_GETROLLOFFGAIN(_state, _rolloff, _distance, _mindistance, _maxdistance, _gain) \
+ (_state)->functions->pan->getrolloffgain(_state, _rolloff, _distance, _mindistance, _maxdistance, _gain)
+
+
+/*
+[STRUCTURE]
+[
+ [DESCRIPTION]
+ DSP metering info used for retrieving metering info with DSP::getMeteringInfo
+
+ [REMARKS]
+ Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only. Do not change this value.
+ Members marked with [w] mean the variable can be written to. The user can set the value.
+
+ [SEE_ALSO]
+ FMOD_SPEAKER
+ DSP::getMeteringInfo
+]
+*/
+typedef struct FMOD_DSP_METERING_INFO
+{
+ int numsamples; /* [r] The number of samples considered for this metering info. */
+ float peaklevel[32]; /* [r] The peak level per channel. */
+ float rmslevel[32]; /* [r] The rms level per channel. */
+ short numchannels; /* [r] Number of channels. */
+} FMOD_DSP_METERING_INFO;
+
+#endif
+
diff --git a/app/src/main/cpp/inc/fmod_dsp_effects.h b/app/src/main/cpp/inc/fmod_dsp_effects.h
new file mode 100644
index 0000000..9b30800
--- /dev/null
+++ b/app/src/main/cpp/inc/fmod_dsp_effects.h
@@ -0,0 +1,1273 @@
+/* ========================================================================================== */
+/* FMOD Studio - Built-in effects header file. */
+/* Copyright (c), Firelight Technologies Pty, Ltd. 2004-2017. */
+/* */
+/* In this header you can find parameter structures for FMOD system registered DSP effects */
+/* and generators. */
+/* */
+/* ========================================================================================== */
+
+#ifndef _FMOD_DSP_EFFECTS_H
+#define _FMOD_DSP_EFFECTS_H
+
+/*
+[ENUM]
+[
+ [DESCRIPTION]
+ These definitions can be used for creating FMOD defined special effects or DSP units.
+
+ [REMARKS]
+ To get them to be active, first create the unit, then add it somewhere into the DSP network,
+ either at the front of the network near the soundcard unit to affect the global output
+ (by using System::getDSPHead), or on a single channel (using Channel::getDSPHead).
+
+ [SEE_ALSO]
+ System::createDSPByType
+]
+*/
+typedef enum
+{
+ FMOD_DSP_TYPE_UNKNOWN, /* This unit was created via a non FMOD plugin so has an unknown purpose. */
+ FMOD_DSP_TYPE_MIXER, /* This unit does nothing but take inputs and mix them together then feed the result to the soundcard unit. */
+ FMOD_DSP_TYPE_OSCILLATOR, /* This unit generates sine/square/saw/triangle or noise tones. */
+ FMOD_DSP_TYPE_LOWPASS, /* This unit filters sound using a high quality, resonant lowpass filter algorithm but consumes more CPU time. Deprecated and will be removed in a future release (see FMOD_DSP_LOWPASS remarks for alternatives). */
+ FMOD_DSP_TYPE_ITLOWPASS, /* This unit filters sound using a resonant lowpass filter algorithm that is used in Impulse Tracker, but with limited cutoff range (0 to 8060hz). */
+ FMOD_DSP_TYPE_HIGHPASS, /* This unit filters sound using a resonant highpass filter algorithm. Deprecated and will be removed in a future release (see FMOD_DSP_HIGHPASS remarks for alternatives). */
+ FMOD_DSP_TYPE_ECHO, /* This unit produces an echo on the sound and fades out at the desired rate. */
+ FMOD_DSP_TYPE_FADER, /* This unit pans and scales the volume of a unit. */
+ FMOD_DSP_TYPE_FLANGE, /* This unit produces a flange effect on the sound. */
+ FMOD_DSP_TYPE_DISTORTION, /* This unit distorts the sound. */
+ FMOD_DSP_TYPE_NORMALIZE, /* This unit normalizes or amplifies the sound to a certain level. */
+ FMOD_DSP_TYPE_LIMITER, /* This unit limits the sound to a certain level. */
+ FMOD_DSP_TYPE_PARAMEQ, /* This unit attenuates or amplifies a selected frequency range. Deprecated and will be removed in a future release (see FMOD_DSP_PARAMEQ remarks for alternatives). */
+ FMOD_DSP_TYPE_PITCHSHIFT, /* This unit bends the pitch of a sound without changing the speed of playback. */
+ FMOD_DSP_TYPE_CHORUS, /* This unit produces a chorus effect on the sound. */
+ FMOD_DSP_TYPE_VSTPLUGIN, /* This unit allows the use of Steinberg VST plugins */
+ FMOD_DSP_TYPE_WINAMPPLUGIN, /* This unit allows the use of Nullsoft Winamp plugins */
+ FMOD_DSP_TYPE_ITECHO, /* This unit produces an echo on the sound and fades out at the desired rate as is used in Impulse Tracker. */
+ FMOD_DSP_TYPE_COMPRESSOR, /* This unit implements dynamic compression (linked/unlinked multichannel, wideband) */
+ FMOD_DSP_TYPE_SFXREVERB, /* This unit implements SFX reverb */
+ FMOD_DSP_TYPE_LOWPASS_SIMPLE, /* This unit filters sound using a simple lowpass with no resonance, but has flexible cutoff and is fast. Deprecated and will be removed in a future release (see FMOD_DSP_LOWPASS_SIMPLE remarks for alternatives). */
+ FMOD_DSP_TYPE_DELAY, /* This unit produces different delays on individual channels of the sound. */
+ FMOD_DSP_TYPE_TREMOLO, /* This unit produces a tremolo / chopper effect on the sound. */
+ FMOD_DSP_TYPE_LADSPAPLUGIN, /* Unsupported / Deprecated. */
+ FMOD_DSP_TYPE_SEND, /* This unit sends a copy of the signal to a return DSP anywhere in the DSP tree. */
+ FMOD_DSP_TYPE_RETURN, /* This unit receives signals from a number of send DSPs. */
+ FMOD_DSP_TYPE_HIGHPASS_SIMPLE, /* This unit filters sound using a simple highpass with no resonance, but has flexible cutoff and is fast. Deprecated and will be removed in a future release (see FMOD_DSP_HIGHPASS_SIMPLE remarks for alternatives). */
+ FMOD_DSP_TYPE_PAN, /* This unit pans the signal, possibly upmixing or downmixing as well. */
+ FMOD_DSP_TYPE_THREE_EQ, /* This unit is a three-band equalizer. */
+ FMOD_DSP_TYPE_FFT, /* This unit simply analyzes the signal and provides spectrum information back through getParameter. */
+ FMOD_DSP_TYPE_LOUDNESS_METER, /* This unit analyzes the loudness and true peak of the signal. */
+ FMOD_DSP_TYPE_ENVELOPEFOLLOWER, /* This unit tracks the envelope of the input/sidechain signal. Format to be publicly disclosed soon. */
+ FMOD_DSP_TYPE_CONVOLUTIONREVERB, /* This unit implements convolution reverb. */
+ FMOD_DSP_TYPE_CHANNELMIX, /* This unit provides per signal channel gain, and output channel mapping to allow 1 multichannel signal made up of many groups of signals to map to a single output signal. */
+ FMOD_DSP_TYPE_TRANSCEIVER, /* This unit 'sends' and 'receives' from a selection of up to 32 different slots. It is like a send/return but it uses global slots rather than returns as the destination. It also has other features. Multiple transceivers can receive from a single channel, or multiple transceivers can send to a single channel, or a combination of both. */
+ FMOD_DSP_TYPE_OBJECTPAN, /* This unit sends the signal to a 3d object encoder like Dolby Atmos. Supports a subset of the FMOD_DSP_TYPE_PAN parameters. */
+ FMOD_DSP_TYPE_MULTIBAND_EQ, /* This unit is a flexible five band parametric equalizer. */
+
+ FMOD_DSP_TYPE_MAX, /* Maximum number of pre-defined DSP types. */
+ FMOD_DSP_TYPE_FORCEINT = 65536 /* Makes sure this enum is signed 32bit. */
+} FMOD_DSP_TYPE;
+
+/*
+ ===================================================================================================
+
+ FMOD built in effect parameters.
+ Use DSP::setParameter with these enums for the 'index' parameter.
+
+ ===================================================================================================
+*/
+
+/*
+[ENUM]
+[
+ [DESCRIPTION]
+ Parameter types for the FMOD_DSP_TYPE_OSCILLATOR filter.
+
+ [REMARKS]
+
+ [SEE_ALSO]
+ DSP::setParameterFloat
+ DSP::setParameterInt
+ DSP::getParameterFloat
+ DSP::getParameterInt
+ FMOD_DSP_TYPE
+]
+*/
+typedef enum
+{
+ FMOD_DSP_OSCILLATOR_TYPE, /* (Type:int) - Waveform type. 0 = sine. 1 = square. 2 = sawup. 3 = sawdown. 4 = triangle. 5 = noise. */
+ FMOD_DSP_OSCILLATOR_RATE /* (Type:float) - Frequency of the sinewave in hz. 1.0 to 22000.0. Default = 220.0. */
+} FMOD_DSP_OSCILLATOR;
+
+
+/*
+[ENUM]
+[
+ [DESCRIPTION]
+ Parameter types for the FMOD_DSP_TYPE_LOWPASS filter.
+
+ [REMARKS]
+ Deprecated and will be removed in a future release, to emulate with FMOD_DSP_TYPE_MULTIBAND_EQ:
+
+ // Configure a single band (band A) as a lowpass (all other bands default to off).
+ // 24dB rolloff to approximate the old effect curve.
+ // Cutoff frequency can be used the same as with the old effect.
+ // Resonance can be applied by setting the 'Q' value of the new effect.
+ FMOD_DSP_SetParameterInt(multiband, FMOD_DSP_MULTIBAND_EQ_A_FILTER, FMOD_DSP_MULTIBAND_EQ_FILTER_LOWPASS_24DB);
+ FMOD_DSP_SetParameterFloat(multiband, FMOD_DSP_MULTIBAND_EQ_A_FREQUENCY, frequency);
+ FMOD_DSP_SetParameterFloat(multiband, FMOD_DSP_MULTIBAND_EQ_A_Q, resonance);
+
+ [SEE_ALSO]
+ DSP::setParameterFloat
+ DSP::getParameterFloat
+ FMOD_DSP_TYPE
+]
+*/
+typedef enum
+{
+ FMOD_DSP_LOWPASS_CUTOFF, /* (Type:float) - Lowpass cutoff frequency in hz. 10.0 to 22000.0. Default = 5000.0. */
+ FMOD_DSP_LOWPASS_RESONANCE /* (Type:float) - Lowpass resonance Q value. 1.0 to 10.0. Default = 1.0. */
+} FMOD_DSP_LOWPASS;
+
+
+/*
+[ENUM]
+[
+ [DESCRIPTION]
+ Parameter types for the FMOD_DSP_TYPE_ITLOWPASS filter.
+ This is different to the default FMOD_DSP_TYPE_ITLOWPASS filter in that it uses a different quality algorithm and is
+ the filter used to produce the correct sounding playback in .IT files.
+ FMOD Studio's .IT playback uses this filter.
+
+ [REMARKS]
+ Note! This filter actually has a limited cutoff frequency below the specified maximum, due to its limited design,
+ so for a more open range filter use FMOD_DSP_LOWPASS or if you don't mind not having resonance,
+ FMOD_DSP_LOWPASS_SIMPLE.
+ The effective maximum cutoff is about 8060hz.
+
+ [SEE_ALSO]
+ DSP::setParameterFloat
+ DSP::getParameterFloat
+ FMOD_DSP_TYPE
+]
+*/
+typedef enum
+{
+ FMOD_DSP_ITLOWPASS_CUTOFF, /* (Type:float) - Lowpass cutoff frequency in hz. 1.0 to 22000.0. Default = 5000.0/ */
+ FMOD_DSP_ITLOWPASS_RESONANCE /* (Type:float) - Lowpass resonance Q value. 0.0 to 127.0. Default = 1.0. */
+} FMOD_DSP_ITLOWPASS;
+
+
+/*
+[ENUM]
+[
+ [DESCRIPTION]
+ Parameter types for the FMOD_DSP_TYPE_HIGHPASS filter.
+
+ [REMARKS]
+ Deprecated and will be removed in a future release, to emulate with FMOD_DSP_TYPE_MULTIBAND_EQ:
+
+ // Configure a single band (band A) as a highpass (all other bands default to off).
+ // 12dB rolloff to approximate the old effect curve.
+ // Cutoff frequency can be used the same as with the old effect.
+ // Resonance can be applied by setting the 'Q' value of the new effect.
+ FMOD_DSP_SetParameterInt(multiband, FMOD_DSP_MULTIBAND_EQ_A_FILTER, FMOD_DSP_MULTIBAND_EQ_FILTER_HIGHPASS_12DB);
+ FMOD_DSP_SetParameterFloat(multiband, FMOD_DSP_MULTIBAND_EQ_A_FREQUENCY, frequency);
+ FMOD_DSP_SetParameterFloat(multiband, FMOD_DSP_MULTIBAND_EQ_A_Q, resonance);
+
+ [SEE_ALSO]
+ DSP::setParameterFloat
+ DSP::getParameterFloat
+ FMOD_DSP_TYPE
+]
+*/
+typedef enum
+{
+ FMOD_DSP_HIGHPASS_CUTOFF, /* (Type:float) - Highpass cutoff frequency in hz. 1.0 to output 22000.0. Default = 5000.0. */
+ FMOD_DSP_HIGHPASS_RESONANCE /* (Type:float) - Highpass resonance Q value. 1.0 to 10.0. Default = 1.0. */
+} FMOD_DSP_HIGHPASS;
+
+
+/*
+[ENUM]
+[
+ [DESCRIPTION]
+ Parameter types for the FMOD_DSP_TYPE_ECHO filter.
+
+ [REMARKS]
+ Note. Every time the delay is changed, the plugin re-allocates the echo buffer. This means the echo will dissapear at that time while it refills its new buffer.
+ Larger echo delays result in larger amounts of memory allocated.
+
+ [SEE_ALSO]
+ DSP::setParameterFloat
+ DSP::getParameterFloat
+ FMOD_DSP_TYPE
+]
+*/
+typedef enum
+{
+ FMOD_DSP_ECHO_DELAY, /* (Type:float) - Echo delay in ms. 10 to 5000. Default = 500. */
+ FMOD_DSP_ECHO_FEEDBACK, /* (Type:float) - Echo decay per delay. 0 to 100. 100.0 = No decay, 0.0 = total decay (ie simple 1 line delay). Default = 50.0. */
+ FMOD_DSP_ECHO_DRYLEVEL, /* (Type:float) - Original sound volume in dB. -80.0 to 10.0. Default = 0. */
+ FMOD_DSP_ECHO_WETLEVEL /* (Type:float) - Volume of echo signal to pass to output in dB. -80.0 to 10.0. Default = 0. */
+} FMOD_DSP_ECHO;
+
+
+/*
+[ENUM]
+[
+ [DESCRIPTION]
+ Parameter types for the FMOD_DSP_TYPE_FLANGE filter.
+
+ [REMARKS]
+ Flange is an effect where the signal is played twice at the same time, and one copy slides back and forth creating a whooshing or flanging effect.
+ As there are 2 copies of the same signal, by default each signal is given 50% mix, so that the total is not louder than the original unaffected signal.
+
+ Flange depth is a percentage of a 10ms shift from the original signal. Anything above 10ms is not considered flange because to the ear it begins to 'echo' so 10ms is the highest value possible.
+
+ [SEE_ALSO]
+ DSP::setParameterFloat
+ DSP::getParameterFloat
+ FMOD_DSP_TYPE
+]
+*/
+typedef enum
+{
+ FMOD_DSP_FLANGE_MIX, /* (Type:float) - Percentage of wet signal in mix. 0 to 100. Default = 50. */
+ FMOD_DSP_FLANGE_DEPTH, /* (Type:float) - Flange depth (percentage of 40ms delay). 0.01 to 1.0. Default = 1.0. */
+ FMOD_DSP_FLANGE_RATE /* (Type:float) - Flange speed in hz. 0.0 to 20.0. Default = 0.1. */
+} FMOD_DSP_FLANGE;
+
+
+/*
+[ENUM]
+[
+ [DESCRIPTION]
+ Parameter types for the FMOD_DSP_TYPE_DISTORTION filter.
+
+ [REMARKS]
+
+ [SEE_ALSO]
+ DSP::setParameterFloat
+ DSP::getParameterFloat
+ FMOD_DSP_TYPE
+]
+*/
+typedef enum
+{
+ FMOD_DSP_DISTORTION_LEVEL /* (Type:float) - Distortion value. 0.0 to 1.0. Default = 0.5. */
+} FMOD_DSP_DISTORTION;
+
+
+/*
+[ENUM]
+[
+ [DESCRIPTION]
+ Parameter types for the FMOD_DSP_TYPE_NORMALIZE filter.
+
+ [REMARKS]
+ Normalize amplifies the sound based on the maximum peaks within the signal.
+ For example if the maximum peaks in the signal were 50% of the bandwidth, it would scale the whole sound by 2.
+ The lower threshold value makes the normalizer ignores peaks below a certain point, to avoid over-amplification if a loud signal suddenly came in, and also to avoid amplifying to maximum things like background hiss.
+
+ Because FMOD is a realtime audio processor, it doesn't have the luxury of knowing the peak for the whole sound (ie it can't see into the future), so it has to process data as it comes in.
+ To avoid very sudden changes in volume level based on small samples of new data, fmod fades towards the desired amplification which makes for smooth gain control. The fadetime parameter can control this.
+
+ [SEE_ALSO]
+ DSP::setParameterFloat
+ DSP::getParameterFloat
+ FMOD_DSP_TYPE
+]
+*/
+typedef enum
+{
+ FMOD_DSP_NORMALIZE_FADETIME, /* (Type:float) - Time to ramp the silence to full in ms. 0.0 to 20000.0. Default = 5000.0. */
+ FMOD_DSP_NORMALIZE_THRESHHOLD, /* (Type:float) - Lower volume range threshold to ignore. 0.0 to 1.0. Default = 0.1. Raise higher to stop amplification of very quiet signals. */
+ FMOD_DSP_NORMALIZE_MAXAMP /* (Type:float) - Maximum amplification allowed. 1.0 to 100000.0. Default = 20.0. 1.0 = no amplifaction, higher values allow more boost. */
+} FMOD_DSP_NORMALIZE;
+
+
+/*
+[ENUM]
+[
+ [DESCRIPTION]
+ Parameter types for the FMOD_DSP_TYPE_LIMITER filter.
+
+ [REMARKS]
+
+ [SEE_ALSO]
+ DSP::setParameterFloat
+ DSP::getParameterFloat
+ FMOD_DSP_TYPE
+]
+*/
+typedef enum
+{
+ FMOD_DSP_LIMITER_RELEASETIME, /* (Type:float) - Time to ramp the silence to full in ms. 1.0 to 1000.0. Default = 10.0. */
+ FMOD_DSP_LIMITER_CEILING, /* (Type:float) - Maximum level of the output signal in dB. -12.0 to 0.0. Default = 0.0. */
+ FMOD_DSP_LIMITER_MAXIMIZERGAIN, /* (Type:float) - Maximum amplification allowed in dB. 0.0 to 12.0. Default = 0.0. 0.0 = no amplifaction, higher values allow more boost. */
+ FMOD_DSP_LIMITER_MODE, /* (Type:float) - Channel processing mode. 0 or 1. Default = 0. 0 = Independent (limiter per channel), 1 = Linked. */
+} FMOD_DSP_LIMITER;
+
+
+/*
+[ENUM]
+[
+ [DESCRIPTION]
+ Parameter types for the FMOD_DSP_TYPE_PARAMEQ filter.
+
+ [REMARKS]
+ Deprecated and will be removed in a future release, to emulate with FMOD_DSP_TYPE_MULTIBAND_EQ:
+
+ // Configure a single band (band A) as a peaking EQ (all other bands default to off).
+ // Center frequency can be used as with the old effect.
+ // Bandwidth can be applied by setting the 'Q' value of the new effect.
+ // Gain at the center frequency can be used the same as with the old effect.
+ FMOD_DSP_SetParameterInt(multiband, FMOD_DSP_MULTIBAND_EQ_A_FILTER, FMOD_DSP_MULTIBAND_EQ_FILTER_PEAKING);
+ FMOD_DSP_SetParameterFloat(multiband, FMOD_DSP_MULTIBAND_EQ_A_FREQUENCY, center);
+ FMOD_DSP_SetParameterFloat(multiband, FMOD_DSP_MULTIBAND_EQ_A_Q, bandwidth);
+ FMOD_DSP_SetParameterFloat(multiband, FMOD_DSP_MULTIBAND_EQ_A_GAIN, gain);
+
+ Parametric EQ is a single band peaking EQ filter that attenuates or amplifies a selected frequency and its neighbouring frequencies.
+
+ When a frequency has its gain set to 1.0, the sound will be unaffected and represents the original signal exactly.
+
+ [SEE_ALSO]
+ DSP::setParameterFloat
+ DSP::getParameterFloat
+ FMOD_DSP_TYPE
+]
+*/
+typedef enum
+{
+ FMOD_DSP_PARAMEQ_CENTER, /* (Type:float) - Frequency center. 20.0 to 22000.0. Default = 8000.0. */
+ FMOD_DSP_PARAMEQ_BANDWIDTH, /* (Type:float) - Octave range around the center frequency to filter. 0.2 to 5.0. Default = 1.0. */
+ FMOD_DSP_PARAMEQ_GAIN /* (Type:float) - Frequency Gain in dB. -30 to 30. Default = 0. */
+} FMOD_DSP_PARAMEQ;
+
+
+/*
+[ENUM]
+[
+ [DESCRIPTION]
+ Parameter types for the FMOD_DSP_TYPE_MULTIBAND_EQ filter.
+
+ [REMARKS]
+ Flexible five band parametric equalizer.
+
+ [SEE_ALSO]
+ DSP::setParameterInt
+ DSP::getParameterInt
+ DSP::setParameterFloat
+ DSP::getParameterFloat
+ FMOD_DSP_TYPE
+]
+*/
+typedef enum FMOD_DSP_MULTIBAND_EQ
+{
+ FMOD_DSP_MULTIBAND_EQ_A_FILTER, /* (Type:int) - Band A: FMOD_DSP_MULTIBAND_EQ_FILTER_TYPE used to interpret the behavior of the remaining parameters. Default = FMOD_DSP_MULTIBAND_EQ_FILTER_LOWPASS_12DB */
+ FMOD_DSP_MULTIBAND_EQ_A_FREQUENCY, /* (Type:float) - Band A: Significant frequency in Hz, cutoff [low/high pass, low/high shelf], center [notch, peaking, band-pass], phase transition point [all-pass]. 20 to 22000. Default = 8000. */
+ FMOD_DSP_MULTIBAND_EQ_A_Q, /* (Type:float) - Band A: Quality factor, resonance [low/high pass], bandwidth [notch, peaking, band-pass], phase transition sharpness [all-pass], unused [low/high shelf]. 0.1 to 10.0. Default = 0.707. */
+ FMOD_DSP_MULTIBAND_EQ_A_GAIN, /* (Type:float) - Band A: Boost or attenuation in dB [peaking, high/low shelf only]. -30 to 30. Default = 0. */
+ FMOD_DSP_MULTIBAND_EQ_B_FILTER, /* (Type:int) - Band B: See Band A. Default = FMOD_DSP_MULTIBAND_EQ_FILTER_DISABLED */
+ FMOD_DSP_MULTIBAND_EQ_B_FREQUENCY, /* (Type:float) - Band B: See Band A */
+ FMOD_DSP_MULTIBAND_EQ_B_Q, /* (Type:float) - Band B: See Band A */
+ FMOD_DSP_MULTIBAND_EQ_B_GAIN, /* (Type:float) - Band B: See Band A */
+ FMOD_DSP_MULTIBAND_EQ_C_FILTER, /* (Type:int) - Band C: See Band A. Default = FMOD_DSP_MULTIBAND_EQ_FILTER_DISABLED */
+ FMOD_DSP_MULTIBAND_EQ_C_FREQUENCY, /* (Type:float) - Band C: See Band A. */
+ FMOD_DSP_MULTIBAND_EQ_C_Q, /* (Type:float) - Band C: See Band A. */
+ FMOD_DSP_MULTIBAND_EQ_C_GAIN, /* (Type:float) - Band C: See Band A. */
+ FMOD_DSP_MULTIBAND_EQ_D_FILTER, /* (Type:int) - Band D: See Band A. Default = FMOD_DSP_MULTIBAND_EQ_FILTER_DISABLED */
+ FMOD_DSP_MULTIBAND_EQ_D_FREQUENCY, /* (Type:float) - Band D: See Band A. */
+ FMOD_DSP_MULTIBAND_EQ_D_Q, /* (Type:float) - Band D: See Band A. */
+ FMOD_DSP_MULTIBAND_EQ_D_GAIN, /* (Type:float) - Band D: See Band A. */
+ FMOD_DSP_MULTIBAND_EQ_E_FILTER, /* (Type:int) - Band E: See Band A. Default = FMOD_DSP_MULTIBAND_EQ_FILTER_DISABLED */
+ FMOD_DSP_MULTIBAND_EQ_E_FREQUENCY, /* (Type:float) - Band E: See Band A. */
+ FMOD_DSP_MULTIBAND_EQ_E_Q, /* (Type:float) - Band E: See Band A. */
+ FMOD_DSP_MULTIBAND_EQ_E_GAIN, /* (Type:float) - Band E: See Band A. */
+} FMOD_DSP_MULTIBAND_EQ;
+
+
+/*
+[ENUM]
+[
+ [DESCRIPTION]
+ Filter types for FMOD_DSP_MULTIBAND_EQ.
+
+ [REMARKS]
+
+ [SEE_ALSO]
+ FMOD_DSP_MULTIBAND_EQ
+]
+*/
+typedef enum FMOD_DSP_MULTIBAND_EQ_FILTER_TYPE
+{
+ FMOD_DSP_MULTIBAND_EQ_FILTER_DISABLED, /* Disabled filter, no processing. */
+ FMOD_DSP_MULTIBAND_EQ_FILTER_LOWPASS_12DB, /* Resonant low-pass filter, attenuates frequencies (12dB per octave) above a given point (with specificed resonance) while allowing the rest to pass. */
+ FMOD_DSP_MULTIBAND_EQ_FILTER_LOWPASS_24DB, /* Resonant low-pass filter, attenuates frequencies (24dB per octave) above a given point (with specificed resonance) while allowing the rest to pass. */
+ FMOD_DSP_MULTIBAND_EQ_FILTER_LOWPASS_48DB, /* Resonant low-pass filter, attenuates frequencies (48dB per octave) above a given point (with specificed resonance) while allowing the rest to pass. */
+ FMOD_DSP_MULTIBAND_EQ_FILTER_HIGHPASS_12DB, /* Resonant low-pass filter, attenuates frequencies (12dB per octave) below a given point (with specificed resonance) while allowing the rest to pass. */
+ FMOD_DSP_MULTIBAND_EQ_FILTER_HIGHPASS_24DB, /* Resonant low-pass filter, attenuates frequencies (24dB per octave) below a given point (with specificed resonance) while allowing the rest to pass. */
+ FMOD_DSP_MULTIBAND_EQ_FILTER_HIGHPASS_48DB, /* Resonant low-pass filter, attenuates frequencies (48dB per octave) below a given point (with specificed resonance) while allowing the rest to pass. */
+ FMOD_DSP_MULTIBAND_EQ_FILTER_LOWSHELF, /* Low-shelf filter, boosts or attenuates frequencies (with specified gain) below a given point while allowing the rest to pass. */
+ FMOD_DSP_MULTIBAND_EQ_FILTER_HIGHSHELF, /* High-shelf filter, boosts or attenuates frequencies (with specified gain) above a given point while allowing the rest to pass. */
+ FMOD_DSP_MULTIBAND_EQ_FILTER_PEAKING, /* Peaking filter, boosts or attenuates frequencies (with specified gain) at a given point (with specificed bandwidth) while allowing the rest to pass. */
+ FMOD_DSP_MULTIBAND_EQ_FILTER_BANDPASS, /* Band-pass filter, allows frequencies at a given point (with specificed bandwidth) to pass while attenuating frequencies outside this range. */
+ FMOD_DSP_MULTIBAND_EQ_FILTER_NOTCH, /* Notch or band-reject filter, attenuates frequencies at a given point (with specificed bandwidth) while allowing frequencies outside this range to pass. */
+ FMOD_DSP_MULTIBAND_EQ_FILTER_ALLPASS, /* All-pass filter, allows all frequencies to pass, but changes the phase response at a given point (with specified sharpness). */
+} FMOD_DSP_MULTIBAND_EQ_FILTER_TYPE;
+
+
+/*
+[ENUM]
+[
+ [DESCRIPTION]
+ Parameter types for the FMOD_DSP_TYPE_PITCHSHIFT filter.
+
+ [REMARKS]
+ This pitch shifting unit can be used to change the pitch of a sound without speeding it up or slowing it down.
+ It can also be used for time stretching or scaling, for example if the pitch was doubled, and the frequency of the sound was halved, the pitch of the sound would sound correct but it would be twice as slow.
+
+ Warning! This filter is very computationally expensive! Similar to a vocoder, it requires several overlapping FFT and IFFT's to produce smooth output, and can require around 440mhz for 1 stereo 48khz signal using the default settings.
+ Reducing the signal to mono will half the cpu usage.
+ Reducing this will lower audio quality, but what settings to use are largely dependant on the sound being played. A noisy polyphonic signal will need higher fft size compared to a speaking voice for example.
+
+ This pitch shifter is based on the pitch shifter code at http://www.dspdimension.com, written by Stephan M. Bernsee.
+ The original code is COPYRIGHT 1999-2003 Stephan M. Bernsee .
+
+ 'maxchannels' dictates the amount of memory allocated. By default, the maxchannels value is 0. If FMOD is set to stereo, the pitch shift unit will allocate enough memory for 2 channels. If it is 5.1, it will allocate enough memory for a 6 channel pitch shift, etc.
+ If the pitch shift effect is only ever applied to the global mix (ie it was added with ChannelGroup::addDSP), then 0 is the value to set as it will be enough to handle all speaker modes.
+ When the pitch shift is added to a channel (ie Channel::addDSP) then the channel count that comes in could be anything from 1 to 8 possibly. It is only in this case where you might want to increase the channel count above the output's channel count.
+ If a channel pitch shift is set to a lower number than the sound's channel count that is coming in, it will not pitch shift the sound.
+
+ NOTE! Not supported on PlayStation 3.
+
+ [SEE_ALSO]
+ DSP::setParameterFloat
+ DSP::getParameterFloat
+ ChannelGroup::addDSP
+ FMOD_DSP_TYPE
+]
+*/
+typedef enum
+{
+ FMOD_DSP_PITCHSHIFT_PITCH, /* (Type:float) - Pitch value. 0.5 to 2.0. Default = 1.0. 0.5 = one octave down, 2.0 = one octave up. 1.0 does not change the pitch. */
+ FMOD_DSP_PITCHSHIFT_FFTSIZE, /* (Type:float) - FFT window size. 256, 512, 1024, 2048, 4096. Default = 1024. Increase this to reduce 'smearing'. This effect is a warbling sound similar to when an mp3 is encoded at very low bitrates. */
+ FMOD_DSP_PITCHSHIFT_OVERLAP, /* (Type:float) - Removed. Do not use. FMOD now uses 4 overlaps and cannot be changed. */
+ FMOD_DSP_PITCHSHIFT_MAXCHANNELS /* (Type:float) - Maximum channels supported. 0 to 16. 0 = same as fmod's default output polyphony, 1 = mono, 2 = stereo etc. See remarks for more. Default = 0. It is suggested to leave at 0! */
+} FMOD_DSP_PITCHSHIFT;
+
+
+/*
+[ENUM]
+[
+ [DESCRIPTION]
+ Parameter types for the FMOD_DSP_TYPE_CHORUS filter.
+
+ [REMARKS]
+ Chorous is an effect where the sound is more 'spacious' due to 1 to 3 versions of the sound being played along side the original signal but with the pitch of each copy modulating on a sine wave.
+
+ [SEE_ALSO]
+ DSP::setParameterFloat
+ DSP::getParameterFloat
+ FMOD_DSP_TYPE
+]
+*/
+typedef enum
+{
+ FMOD_DSP_CHORUS_MIX, /* (Type:float) - Volume of original signal to pass to output. 0.0 to 100.0. Default = 50.0. */
+ FMOD_DSP_CHORUS_RATE, /* (Type:float) - Chorus modulation rate in Hz. 0.0 to 20.0. Default = 0.8 Hz. */
+ FMOD_DSP_CHORUS_DEPTH, /* (Type:float) - Chorus modulation depth. 0.0 to 100.0. Default = 3.0. */
+} FMOD_DSP_CHORUS;
+
+
+/*
+[ENUM]
+[
+ [DESCRIPTION]
+ Parameter types for the FMOD_DSP_TYPE_ITECHO filter.
+ This is effectively a software based echo filter that emulates the DirectX DMO echo effect. Impulse tracker files can support this, and FMOD will produce the effect on ANY platform, not just those that support DirectX effects!
+
+ [REMARKS]
+ Note. Every time the delay is changed, the plugin re-allocates the echo buffer. This means the echo will dissapear at that time while it refills its new buffer.
+ Larger echo delays result in larger amounts of memory allocated.
+
+ As this is a stereo filter made mainly for IT playback, it is targeted for stereo signals.
+ With mono signals only the FMOD_DSP_ITECHO_LEFTDELAY is used.
+ For multichannel signals (>2) there will be no echo on those channels.
+
+ [SEE_ALSO]
+ DSP::setParameterFloat
+ DSP::getParameterFloat
+ FMOD_DSP_TYPE
+]
+*/
+typedef enum
+{
+ FMOD_DSP_ITECHO_WETDRYMIX, /* (Type:float) - Ratio of wet (processed) signal to dry (unprocessed) signal. Must be in the range from 0.0 through 100.0 (all wet). Default = 50. */
+ FMOD_DSP_ITECHO_FEEDBACK, /* (Type:float) - Percentage of output fed back into input, in the range from 0.0 through 100.0. Default = 50. */
+ FMOD_DSP_ITECHO_LEFTDELAY, /* (Type:float) - Delay for left channel, in milliseconds, in the range from 1.0 through 2000.0. Default = 500 ms. */
+ FMOD_DSP_ITECHO_RIGHTDELAY, /* (Type:float) - Delay for right channel, in milliseconds, in the range from 1.0 through 2000.0. Default = 500 ms. */
+ FMOD_DSP_ITECHO_PANDELAY /* (Type:float) - Value that specifies whether to swap left and right delays with each successive echo. Ranges from 0.0 (equivalent to FALSE) to 1.0 (equivalent to TRUE), meaning no swap. Default = 0. CURRENTLY NOT SUPPORTED. */
+} FMOD_DSP_ITECHO;
+
+/*
+[ENUM]
+[
+ [DESCRIPTION]
+ Parameter types for the FMOD_DSP_TYPE_COMPRESSOR unit.
+ This is a multichannel software limiter that is uniform across the whole spectrum.
+
+ [REMARKS]
+ The limiter is not guaranteed to catch every peak above the threshold level,
+ because it cannot apply gain reduction instantaneously - the time delay is
+ determined by the attack time. However setting the attack time too short will
+ distort the sound, so it is a compromise. High level peaks can be avoided by
+ using a short attack time - but not too short, and setting the threshold a few
+ decibels below the critical level.
+
+
+ [SEE_ALSO]
+ DSP::setParameterFloat
+ DSP::getParameterFloat
+ DSP::setParameterBool
+ DSP::getParameterBool
+ FMOD_DSP_TYPE
+]
+*/
+typedef enum
+{
+ FMOD_DSP_COMPRESSOR_THRESHOLD, /* (Type:float) - Threshold level (dB) in the range from -80 through 0. Default = 0. */
+ FMOD_DSP_COMPRESSOR_RATIO, /* (Type:float) - Compression Ratio (dB/dB) in the range from 1 to 50. Default = 2.5. */
+ FMOD_DSP_COMPRESSOR_ATTACK, /* (Type:float) - Attack time (milliseconds), in the range from 0.1 through 1000. Default value is 20. */
+ FMOD_DSP_COMPRESSOR_RELEASE, /* (Type:float) - Release time (milliseconds), in the range from 10 through 5000. Default value is 100 */
+ FMOD_DSP_COMPRESSOR_GAINMAKEUP, /* (Type:float) - Make-up gain (dB) applied after limiting, in the range from 0 through 30. Default = 0. */
+ FMOD_DSP_COMPRESSOR_USESIDECHAIN, /* (Type:data) - Data of type FMOD_DSP_PARAMETER_SIDECHAIN. Whether to analyse the sidechain signal instead of the input signal. Default is { false } */
+ FMOD_DSP_COMPRESSOR_LINKED /* (Type:bool) - FALSE = Independent (compressor per channel), TRUE = Linked. Default = TRUE. */
+} FMOD_DSP_COMPRESSOR;
+
+/*
+[ENUM]
+[
+ [DESCRIPTION]
+ Parameter types for the FMOD_DSP_TYPE_SFXREVERB unit.
+
+ [REMARKS]
+ This is a high quality I3DL2 based reverb.
+ On top of the I3DL2 property set, "Dry Level" is also included to allow the dry mix to be changed.
+
+ These properties can be set with presets in FMOD_REVERB_PRESETS.
+
+ [SEE_ALSO]
+ DSP::setParameterFloat
+ DSP::getParameterFloat
+ FMOD_DSP_TYPE
+ FMOD_REVERB_PRESETS
+]
+*/
+typedef enum
+{
+ FMOD_DSP_SFXREVERB_DECAYTIME, /* (Type:float) - Decay Time : Reverberation decay time at low-frequencies in milliseconds. Ranges from 100.0 to 20000.0. Default is 1500. */
+ FMOD_DSP_SFXREVERB_EARLYDELAY, /* (Type:float) - Early Delay : Delay time of first reflection in milliseconds. Ranges from 0.0 to 300.0. Default is 20. */
+ FMOD_DSP_SFXREVERB_LATEDELAY, /* (Type:float) - Reverb Delay : Late reverberation delay time relative to first reflection in milliseconds. Ranges from 0.0 to 100.0. Default is 40. */
+ FMOD_DSP_SFXREVERB_HFREFERENCE, /* (Type:float) - HF Reference : Reference frequency for high-frequency decay in Hz. Ranges from 20.0 to 20000.0. Default is 5000. */
+ FMOD_DSP_SFXREVERB_HFDECAYRATIO, /* (Type:float) - Decay HF Ratio : High-frequency decay time relative to decay time in percent. Ranges from 10.0 to 100.0. Default is 50. */
+ FMOD_DSP_SFXREVERB_DIFFUSION, /* (Type:float) - Diffusion : Reverberation diffusion (echo density) in percent. Ranges from 0.0 to 100.0. Default is 100. */
+ FMOD_DSP_SFXREVERB_DENSITY, /* (Type:float) - Density : Reverberation density (modal density) in percent. Ranges from 0.0 to 100.0. Default is 100. */
+ FMOD_DSP_SFXREVERB_LOWSHELFFREQUENCY, /* (Type:float) - Low Shelf Frequency : Transition frequency of low-shelf filter in Hz. Ranges from 20.0 to 1000.0. Default is 250. */
+ FMOD_DSP_SFXREVERB_LOWSHELFGAIN, /* (Type:float) - Low Shelf Gain : Gain of low-shelf filter in dB. Ranges from -36.0 to 12.0. Default is 0. */
+ FMOD_DSP_SFXREVERB_HIGHCUT, /* (Type:float) - High Cut : Cutoff frequency of low-pass filter in Hz. Ranges from 20.0 to 20000.0. Default is 20000. */
+ FMOD_DSP_SFXREVERB_EARLYLATEMIX, /* (Type:float) - Early/Late Mix : Blend ratio of late reverb to early reflections in percent. Ranges from 0.0 to 100.0. Default is 50. */
+ FMOD_DSP_SFXREVERB_WETLEVEL, /* (Type:float) - Wet Level : Reverb signal level in dB. Ranges from -80.0 to 20.0. Default is -6. */
+ FMOD_DSP_SFXREVERB_DRYLEVEL /* (Type:float) - Dry Level : Dry signal level in dB. Ranges from -80.0 to 20.0. Default is 0. */
+} FMOD_DSP_SFXREVERB;
+
+/*
+[ENUM]
+[
+ [DESCRIPTION]
+ Parameter types for the FMOD_DSP_TYPE_LOWPASS_SIMPLE filter.
+
+ [REMARKS]
+ Deprecated and will be removed in a future release, to emulate with FMOD_DSP_TYPE_MULTIBAND_EQ:
+
+ // Configure a single band (band A) as a lowpass (all other bands default to off).
+ // 12dB rolloff to approximate the old effect curve.
+ // Cutoff frequency can be used the same as with the old effect.
+ // Resonance / 'Q' should remain at default 0.707.
+ FMOD_DSP_SetParameterInt(multiband, FMOD_DSP_MULTIBAND_EQ_A_FILTER, FMOD_DSP_MULTIBAND_EQ_FILTER_LOWPASS_12DB);
+ FMOD_DSP_SetParameterFloat(multiband, FMOD_DSP_MULTIBAND_EQ_A_FREQUENCY, frequency);
+
+ This is a very simple low pass filter, based on two single-pole RC time-constant modules.
+
+ The emphasis is on speed rather than accuracy, so this should not be used for task requiring critical filtering.
+
+ [SEE_ALSO]
+ DSP::setParameterFloat
+ DSP::getParameterFloat
+ FMOD_DSP_TYPE
+]
+*/
+typedef enum
+{
+ FMOD_DSP_LOWPASS_SIMPLE_CUTOFF /* (Type:float) - Lowpass cutoff frequency in hz. 10.0 to 22000.0. Default = 5000.0 */
+} FMOD_DSP_LOWPASS_SIMPLE;
+
+
+/*
+[ENUM]
+[
+ [DESCRIPTION]
+ Parameter types for the FMOD_DSP_TYPE_DELAY filter.
+
+ [REMARKS]
+ Note. Every time MaxDelay is changed, the plugin re-allocates the delay buffer. This means the delay will dissapear at that time while it refills its new buffer.
+ A larger MaxDelay results in larger amounts of memory allocated.
+ Channel delays above MaxDelay will be clipped to MaxDelay and the delay buffer will not be resized.
+
+ NOTE! Not supported on PlayStation 3.
+
+ [SEE_ALSO]
+ DSP::setParameterFloat
+ DSP::getParameterFloat
+ FMOD_DSP_TYPE
+]
+*/
+typedef enum
+{
+ FMOD_DSP_DELAY_CH0, /* (Type:float) - Channel #0 Delay in ms. 0 to 10000. Default = 0. */
+ FMOD_DSP_DELAY_CH1, /* (Type:float) - Channel #1 Delay in ms. 0 to 10000. Default = 0. */
+ FMOD_DSP_DELAY_CH2, /* (Type:float) - Channel #2 Delay in ms. 0 to 10000. Default = 0. */
+ FMOD_DSP_DELAY_CH3, /* (Type:float) - Channel #3 Delay in ms. 0 to 10000. Default = 0. */
+ FMOD_DSP_DELAY_CH4, /* (Type:float) - Channel #4 Delay in ms. 0 to 10000. Default = 0. */
+ FMOD_DSP_DELAY_CH5, /* (Type:float) - Channel #5 Delay in ms. 0 to 10000. Default = 0. */
+ FMOD_DSP_DELAY_CH6, /* (Type:float) - Channel #6 Delay in ms. 0 to 10000. Default = 0. */
+ FMOD_DSP_DELAY_CH7, /* (Type:float) - Channel #7 Delay in ms. 0 to 10000. Default = 0. */
+ FMOD_DSP_DELAY_CH8, /* (Type:float) - Channel #8 Delay in ms. 0 to 10000. Default = 0. */
+ FMOD_DSP_DELAY_CH9, /* (Type:float) - Channel #9 Delay in ms. 0 to 10000. Default = 0. */
+ FMOD_DSP_DELAY_CH10, /* (Type:float) - Channel #10 Delay in ms. 0 to 10000. Default = 0. */
+ FMOD_DSP_DELAY_CH11, /* (Type:float) - Channel #11 Delay in ms. 0 to 10000. Default = 0. */
+ FMOD_DSP_DELAY_CH12, /* (Type:float) - Channel #12 Delay in ms. 0 to 10000. Default = 0. */
+ FMOD_DSP_DELAY_CH13, /* (Type:float) - Channel #13 Delay in ms. 0 to 10000. Default = 0. */
+ FMOD_DSP_DELAY_CH14, /* (Type:float) - Channel #14 Delay in ms. 0 to 10000. Default = 0. */
+ FMOD_DSP_DELAY_CH15, /* (Type:float) - Channel #15 Delay in ms. 0 to 10000. Default = 0. */
+ FMOD_DSP_DELAY_MAXDELAY /* (Type:float) - Maximum delay in ms. 0 to 10000. Default = 10. */
+} FMOD_DSP_DELAY;
+
+
+/*
+[ENUM]
+[
+ [DESCRIPTION]
+ Parameter types for the FMOD_DSP_TYPE_TREMOLO filter.
+
+ [REMARKS]
+ The tremolo effect varies the amplitude of a sound. Depending on the settings, this unit can produce a tremolo, chopper or auto-pan effect.
+
+ The shape of the LFO (low freq. oscillator) can morphed between sine, triangle and sawtooth waves using the FMOD_DSP_TREMOLO_SHAPE and FMOD_DSP_TREMOLO_SKEW parameters.
+ FMOD_DSP_TREMOLO_DUTY and FMOD_DSP_TREMOLO_SQUARE are useful for a chopper-type effect where the first controls the on-time duration and second controls the flatness of the envelope.
+ FMOD_DSP_TREMOLO_SPREAD varies the LFO phase between channels to get an auto-pan effect. This works best with a sine shape LFO.
+ The LFO can be synchronized using the FMOD_DSP_TREMOLO_PHASE parameter which sets its instantaneous phase.
+
+ [SEE_ALSO]
+ DSP::setParameterFloat
+ DSP::getParameterFloat
+ FMOD_DSP_TYPE
+]
+*/
+typedef enum
+{
+ FMOD_DSP_TREMOLO_FREQUENCY, /* (Type:float) - LFO frequency in Hz. 0.1 to 20. Default = 5. */
+ FMOD_DSP_TREMOLO_DEPTH, /* (Type:float) - Tremolo depth. 0 to 1. Default = 1. */
+ FMOD_DSP_TREMOLO_SHAPE, /* (Type:float) - LFO shape morph between triangle and sine. 0 to 1. Default = 0. */
+ FMOD_DSP_TREMOLO_SKEW, /* (Type:float) - Time-skewing of LFO cycle. -1 to 1. Default = 0. */
+ FMOD_DSP_TREMOLO_DUTY, /* (Type:float) - LFO on-time. 0 to 1. Default = 0.5. */
+ FMOD_DSP_TREMOLO_SQUARE, /* (Type:float) - Flatness of the LFO shape. 0 to 1. Default = 0. */
+ FMOD_DSP_TREMOLO_PHASE, /* (Type:float) - Instantaneous LFO phase. 0 to 1. Default = 0. */
+ FMOD_DSP_TREMOLO_SPREAD /* (Type:float) - Rotation / auto-pan effect. -1 to 1. Default = 0. */
+} FMOD_DSP_TREMOLO;
+
+
+/*
+[ENUM]
+[
+ [DESCRIPTION]
+ Parameter types for the FMOD_DSP_TYPE_SEND DSP.
+
+ [REMARKS]
+
+ [SEE_ALSO]
+ DSP::setParameterInt
+ DSP::getParameterInt
+ DSP::setParameterFloat
+ DSP::getParameterFloat
+ FMOD_DSP_TYPE
+]
+*/
+typedef enum
+{
+ FMOD_DSP_SEND_RETURNID, /* (Type:int) - ID of the Return DSP this send is connected to (integer values only). -1 indicates no connected Return DSP. Default = -1. */
+ FMOD_DSP_SEND_LEVEL, /* (Type:float) - Send level. 0.0 to 1.0. Default = 1.0 */
+} FMOD_DSP_SEND;
+
+
+/*
+[ENUM]
+[
+ [DESCRIPTION]
+ Parameter types for the FMOD_DSP_TYPE_RETURN DSP.
+
+ [REMARKS]
+
+ [SEE_ALSO]
+ DSP::setParameterInt
+ DSP::getParameterInt
+ FMOD_DSP_TYPE
+]
+*/
+typedef enum
+{
+ FMOD_DSP_RETURN_ID, /* (Type:int) - [r] ID of this Return DSP. Read-only. Default = -1. */
+ FMOD_DSP_RETURN_INPUT_SPEAKER_MODE /* (Type:int) - [r/w] Input speaker mode of this return. Default = FMOD_SPEAKERMODE_DEFAULT. */
+} FMOD_DSP_RETURN;
+
+
+/*
+[ENUM]
+[
+ [DESCRIPTION]
+ Parameter types for the FMOD_DSP_TYPE_HIGHPASS_SIMPLE filter.
+
+ [REMARKS]
+ Deprecated and will be removed in a future release, to emulate with FMOD_DSP_TYPE_MULTIBAND_EQ:
+
+ // Configure a single band (band A) as a highpass (all other bands default to off).
+ // 12dB rolloff to approximate the old effect curve.
+ // Cutoff frequency can be used the same as with the old effect.
+ // Resonance / 'Q' should remain at default 0.707.
+ FMOD_DSP_SetParameterInt(multiband, FMOD_DSP_MULTIBAND_EQ_A_FILTER, FMOD_DSP_MULTIBAND_EQ_FILTER_HIGHPASS_12DB);
+ FMOD_DSP_SetParameterFloat(multiband, FMOD_DSP_MULTIBAND_EQ_A_FREQUENCY, frequency);
+
+ This is a very simple single-order high pass filter.
+
+ The emphasis is on speed rather than accuracy, so this should not be used for task requiring critical filtering.
+
+ [SEE_ALSO]
+ DSP::setParameterFloat
+ DSP::getParameterFloat
+ FMOD_DSP_TYPE
+]
+*/
+typedef enum
+{
+ FMOD_DSP_HIGHPASS_SIMPLE_CUTOFF /* (Type:float) - Highpass cutoff frequency in hz. 10.0 to 22000.0. Default = 1000.0 */
+} FMOD_DSP_HIGHPASS_SIMPLE;
+
+
+/*
+[ENUM]
+[
+ [DESCRIPTION]
+ Parameter values for the FMOD_DSP_PAN_2D_STEREO_MODE parameter of the FMOD_DSP_TYPE_PAN DSP.
+
+ [REMARKS]
+
+ [SEE_ALSO]
+ FMOD_DSP_PAN
+]
+*/
+typedef enum
+{
+ FMOD_DSP_PAN_2D_STEREO_MODE_DISTRIBUTED, /* The parts of a stereo sound are spread around desination speakers based on FMOD_DSP_PAN_2D_EXTENT / FMOD_DSP_PAN_2D_DIRECTION */
+ FMOD_DSP_PAN_2D_STEREO_MODE_DISCRETE /* The L/R parts of a stereo sound are rotated around a circle based on FMOD_DSP_PAN_2D_STEREO_AXIS / FMOD_DSP_PAN_2D_STEREO_SEPARATION. */
+} FMOD_DSP_PAN_2D_STEREO_MODE_TYPE;
+
+
+/*
+[ENUM]
+[
+ [DESCRIPTION]
+ Parameter values for the FMOD_DSP_PAN_MODE parameter of the FMOD_DSP_TYPE_PAN DSP.
+
+ [REMARKS]
+
+ [SEE_ALSO]
+ FMOD_DSP_PAN
+]
+*/
+typedef enum
+{
+ FMOD_DSP_PAN_MODE_MONO,
+ FMOD_DSP_PAN_MODE_STEREO,
+ FMOD_DSP_PAN_MODE_SURROUND
+} FMOD_DSP_PAN_MODE_TYPE;
+
+
+/*
+[ENUM]
+[
+ [DESCRIPTION]
+ Parameter values for the FMOD_DSP_PAN_3D_ROLLOFF parameter of the FMOD_DSP_TYPE_PAN DSP.
+
+ [REMARKS]
+
+ [SEE_ALSO]
+ FMOD_DSP_PAN
+]
+*/
+typedef enum
+{
+ FMOD_DSP_PAN_3D_ROLLOFF_LINEARSQUARED,
+ FMOD_DSP_PAN_3D_ROLLOFF_LINEAR,
+ FMOD_DSP_PAN_3D_ROLLOFF_INVERSE,
+ FMOD_DSP_PAN_3D_ROLLOFF_INVERSETAPERED,
+ FMOD_DSP_PAN_3D_ROLLOFF_CUSTOM
+} FMOD_DSP_PAN_3D_ROLLOFF_TYPE;
+
+
+/*
+[ENUM]
+[
+ [DESCRIPTION]
+ Parameter values for the FMOD_DSP_PAN_3D_EXTENT_MODE parameter of the FMOD_DSP_TYPE_PAN DSP.
+
+ [REMARKS]
+
+ [SEE_ALSO]
+ FMOD_DSP_PAN
+]
+*/
+typedef enum
+{
+ FMOD_DSP_PAN_3D_EXTENT_MODE_AUTO,
+ FMOD_DSP_PAN_3D_EXTENT_MODE_USER,
+ FMOD_DSP_PAN_3D_EXTENT_MODE_OFF
+} FMOD_DSP_PAN_3D_EXTENT_MODE_TYPE;
+
+
+/*
+[ENUM]
+[
+ [DESCRIPTION]
+ Parameter types for the FMOD_DSP_TYPE_PAN DSP.
+
+ [REMARKS]
+ FMOD_DSP_PAN_3D_PAN_BLEND controls the percentage of the effect supplied by FMOD_DSP_PAN_2D_DIRECTION and FMOD_DSP_PAN_2D_EXTENT.
+
+ For FMOD_DSP_PAN_3D_POSITION, the following members in the FMOD_DSP_PARAMETER_3DATTRIBUTES_MULTI struct should be non zero.
+ - numlisteners - This is typically 1, can be up to 8. Typically more than 1 is only used for split screen purposes. The FMOD Panner will average angles and produce the best compromise for panning and attenuation.
+ - relative[listenernum].position - This is the delta between the listener position and the sound position. Typically the listener position is subtracted from the sound position.
+ - relative[listenernum].forward - This is the sound's forward vector. Optional, set to 0,0,1 if not needed. This is only relevant for more than mono sounds in 3D, that are spread amongst the destination speakers at the time of panning.
+ If the sound rotates then the L/R part of a stereo sound will rotate amongst its destination speakers.
+ If the sound has moved and pinpointed into a single speaker, rotation of the sound will have no effect as at that point the channels are collapsed into a single point.
+
+ For FMOD_DSP_PAN_2D_STEREO_MODE, when it is set to FMOD_DSP_PAN_2D_STEREO_MODE_DISCRETE, only FMOD_DSP_PAN_2D_STEREO_SEPARATION and FMOD_DSP_PAN_2D_STEREO_AXIS are used.
+ When it is set to FMOD_DSP_PAN_2D_STEREO_MODE_DISTRIBUTED, then standard FMOD_DSP_PAN_2D_DIRECTION/FMOD_DSP_PAN_2D_EXTENT parameters are used.
+
+ [SEE_ALSO]
+ DSP::setParameterFloat
+ DSP::getParameterFloat
+ DSP::setParameterInt
+ DSP::getParameterInt
+ DSP::setParameterData
+ DSP::getParameterData
+ FMOD_DSP_TYPE
+]
+*/
+typedef enum
+{
+ FMOD_DSP_PAN_MODE, /* (Type:int) - Panner mode. FMOD_DSP_PAN_MODE_MONO for mono down-mix, FMOD_DSP_PAN_MODE_STEREO for stereo panning or FMOD_DSP_PAN_MODE_SURROUND for surround panning. Default = FMOD_DSP_PAN_MODE_SURROUND */
+ FMOD_DSP_PAN_2D_STEREO_POSITION, /* (Type:float) - 2D Stereo pan position. -100.0 to 100.0. Default = 0.0. */
+ FMOD_DSP_PAN_2D_DIRECTION, /* (Type:float) - 2D Surround pan direction. Direction from center point of panning circle. -180.0 (degrees) to 180.0 (degrees). 0 = front center, -180 or +180 = rear speakers center point. Default = 0.0. */
+ FMOD_DSP_PAN_2D_EXTENT, /* (Type:float) - 2D Surround pan extent. Distance from center point of panning circle. 0.0 (degrees) to 360.0 (degrees). Default = 360.0. */
+ FMOD_DSP_PAN_2D_ROTATION, /* (Type:float) - 2D Surround pan rotation. -180.0 (degrees) to 180.0 (degrees). Default = 0.0. */
+ FMOD_DSP_PAN_2D_LFE_LEVEL, /* (Type:float) - 2D Surround pan LFE level. 2D LFE level in dB. -80.0 (db) to 20.0 (db). Default = 0.0. */
+ FMOD_DSP_PAN_2D_STEREO_MODE, /* (Type:int) - Stereo-To-Surround Mode. FMOD_DSP_PAN_2D_STEREO_MODE_DISTRIBUTED to FMOD_DSP_PAN_2D_STEREO_MODE_DISCRETE. Default = FMOD_DSP_PAN_2D_STEREO_MODE_DISCRETE.*/
+ FMOD_DSP_PAN_2D_STEREO_SEPARATION, /* (Type:float) - Stereo-To-Surround Stereo For FMOD_DSP_PAN_2D_STEREO_MODE_DISCRETE mode. Separation/width of L/R parts of stereo sound. -180.0 (degrees) to +180.0 (degrees). Default = 60.0. */
+ FMOD_DSP_PAN_2D_STEREO_AXIS, /* (Type:float) - Stereo-To-Surround Stereo For FMOD_DSP_PAN_2D_STEREO_MODE_DISCRETE mode. Axis/rotation of L/R parts of stereo sound. -180.0 (degrees) to +180.0 (degrees). Default = 0.0. */
+ FMOD_DSP_PAN_ENABLED_SPEAKERS, /* (Type:int) - Speakers Enabled. Bitmask for each speaker from 0 to 32 to be considered by panner. Use to disable speakers from being panned to. 0 to 0xFFF. Default = 0xFFF (All on). */
+ FMOD_DSP_PAN_3D_POSITION, /* (Type:data) - 3D Position. Data of type FMOD_DSP_PARAMETER_3DATTRIBUTES_MULTI. See remarks on what to fill out. */
+ FMOD_DSP_PAN_3D_ROLLOFF, /* (Type:int) - 3D Rolloff. FMOD_DSP_PAN_3D_ROLLOFF_LINEARSQUARED to FMOD_DSP_PAN_3D_ROLLOFF_CUSTOM. Default = FMOD_DSP_PAN_3D_ROLLOFF_LINEARSQUARED. */
+ FMOD_DSP_PAN_3D_MIN_DISTANCE, /* (Type:float) - 3D Min Distance. 0.0 to 1e+18f. Default = 1.0. */
+ FMOD_DSP_PAN_3D_MAX_DISTANCE, /* (Type:float) - 3D Max Distance. 0.0 to 1e+18f. Default = 20.0. */
+ FMOD_DSP_PAN_3D_EXTENT_MODE, /* (Type:int) - 3D Extent Mode. FMOD_DSP_PAN_3D_EXTENT_MODE_AUTO to FMOD_DSP_PAN_3D_EXTENT_MODE_OFF. Default = FMOD_DSP_PAN_3D_EXTENT_MODE_AUTO. */
+ FMOD_DSP_PAN_3D_SOUND_SIZE, /* (Type:float) - 3D Sound Size. 0.0 to 1e+18f. Default = 0.0. */
+ FMOD_DSP_PAN_3D_MIN_EXTENT, /* (Type:float) - 3D Min Extent. 0.0 (degrees) to 360.0 (degrees). Default = 0.0. */
+ FMOD_DSP_PAN_3D_PAN_BLEND, /* (Type:float) - 3D Pan Blend. 0.0 (fully 2D) to 1.0 (fully 3D). Default = 0.0. */
+ FMOD_DSP_PAN_LFE_UPMIX_ENABLED, /* (Type:int) - LFE Upmix Enabled. Determines whether non-LFE source channels should mix to the LFE or leave it alone. 0 (off) to 1 (on). Default = 0 (off). */
+ FMOD_DSP_PAN_OVERALL_GAIN, /* (Type:data) - Overall gain. For information only, not set by user. Data of type FMOD_DSP_PARAMETER_DATA_TYPE_OVERALLGAIN to provide to FMOD, to allow FMOD to know the DSP is scaling the signal for virtualization purposes. */
+ FMOD_DSP_PAN_SURROUND_SPEAKER_MODE /* (Type:int) - Surround speaker mode. Target speaker mode for surround panning. Default = FMOD_SPEAKERMODE_DEFAULT. */
+} FMOD_DSP_PAN;
+
+
+/*
+[ENUM]
+[
+ [DESCRIPTION]
+ Parameter values for the FMOD_DSP_THREE_EQ_CROSSOVERSLOPE parameter of the FMOD_DSP_TYPE_THREE_EQ DSP.
+
+ [REMARKS]
+
+ [SEE_ALSO]
+ FMOD_DSP_THREE_EQ
+]
+*/
+typedef enum
+{
+ FMOD_DSP_THREE_EQ_CROSSOVERSLOPE_12DB,
+ FMOD_DSP_THREE_EQ_CROSSOVERSLOPE_24DB,
+ FMOD_DSP_THREE_EQ_CROSSOVERSLOPE_48DB
+} FMOD_DSP_THREE_EQ_CROSSOVERSLOPE_TYPE;
+
+
+/*
+[ENUM]
+[
+ [DESCRIPTION]
+ Parameter types for the FMOD_DSP_TYPE_THREE_EQ filter.
+
+ [REMARKS]
+
+ [SEE_ALSO]
+ DSP::setParameterFloat
+ DSP::getParameterFloat
+ DSP::setParameterInt
+ DSP::getParameterInt
+ FMOD_DSP_TYPE
+ FMOD_DSP_THREE_EQ_CROSSOVERSLOPE_TYPE
+]
+*/
+typedef enum
+{
+ FMOD_DSP_THREE_EQ_LOWGAIN, /* (Type:float) - Low frequency gain in dB. -80.0 to 10.0. Default = 0. */
+ FMOD_DSP_THREE_EQ_MIDGAIN, /* (Type:float) - Mid frequency gain in dB. -80.0 to 10.0. Default = 0. */
+ FMOD_DSP_THREE_EQ_HIGHGAIN, /* (Type:float) - High frequency gain in dB. -80.0 to 10.0. Default = 0. */
+ FMOD_DSP_THREE_EQ_LOWCROSSOVER, /* (Type:float) - Low-to-mid crossover frequency in Hz. 10.0 to 22000.0. Default = 400.0. */
+ FMOD_DSP_THREE_EQ_HIGHCROSSOVER, /* (Type:float) - Mid-to-high crossover frequency in Hz. 10.0 to 22000.0. Default = 4000.0. */
+ FMOD_DSP_THREE_EQ_CROSSOVERSLOPE /* (Type:int) - Crossover Slope. 0 = 12dB/Octave, 1 = 24dB/Octave, 2 = 48dB/Octave. Default = 1 (24dB/Octave). */
+} FMOD_DSP_THREE_EQ;
+
+
+/*
+[ENUM]
+[
+ [DESCRIPTION]
+ List of windowing methods for the FMOD_DSP_TYPE_FFT unit. Used in spectrum analysis to reduce leakage / transient signals intefering with the analysis.
+ This is a problem with analysis of continuous signals that only have a small portion of the signal sample (the fft window size).
+ Windowing the signal with a curve or triangle tapers the sides of the fft window to help alleviate this problem.
+
+ [REMARKS]
+ Cyclic signals such as a sine wave that repeat their cycle in a multiple of the window size do not need windowing.
+ I.e. If the sine wave repeats every 1024, 512, 256 etc samples and the FMOD fft window is 1024, then the signal would not need windowing.
+ Not windowing is the same as FMOD_DSP_FFT_WINDOW_RECT, which is the default.
+ If the cycle of the signal (ie the sine wave) is not a multiple of the window size, it will cause frequency abnormalities, so a different windowing method is needed.
+
+
+ FMOD_DSP_FFT_WINDOW_RECT.
+
+
+ FMOD_DSP_FFT_WINDOW_TRIANGLE.
+
+
+ FMOD_DSP_FFT_WINDOW_HAMMING.
+
+
+ FMOD_DSP_FFT_WINDOW_HANNING.
+
+
+ FMOD_DSP_FFT_WINDOW_BLACKMAN.
+
+
+ FMOD_DSP_FFT_WINDOW_BLACKMANHARRIS.
+
+
+
+ [SEE_ALSO]
+ FMOD_DSP_FFT
+]
+*/
+typedef enum
+{
+ FMOD_DSP_FFT_WINDOW_RECT, /* w[n] = 1.0 */
+ FMOD_DSP_FFT_WINDOW_TRIANGLE, /* w[n] = TRI(2n/N) */
+ FMOD_DSP_FFT_WINDOW_HAMMING, /* w[n] = 0.54 - (0.46 * COS(n/N) ) */
+ FMOD_DSP_FFT_WINDOW_HANNING, /* w[n] = 0.5 * (1.0 - COS(n/N) ) */
+ FMOD_DSP_FFT_WINDOW_BLACKMAN, /* w[n] = 0.42 - (0.5 * COS(n/N) ) + (0.08 * COS(2.0 * n/N) ) */
+ FMOD_DSP_FFT_WINDOW_BLACKMANHARRIS /* w[n] = 0.35875 - (0.48829 * COS(1.0 * n/N)) + (0.14128 * COS(2.0 * n/N)) - (0.01168 * COS(3.0 * n/N)) */
+} FMOD_DSP_FFT_WINDOW;
+
+
+/*
+[ENUM]
+[
+ [DESCRIPTION]
+ Parameter types for the FMOD_DSP_TYPE_FFT dsp effect.
+
+ [REMARKS]
+ Set the attributes for the spectrum analysis with FMOD_DSP_FFT_WINDOWSIZE and FMOD_DSP_FFT_WINDOWTYPE, and retrieve the results with FMOD_DSP_FFT_SPECTRUM and FMOD_DSP_FFT_DOMINANT_FREQ.
+ FMOD_DSP_FFT_SPECTRUM stores its data in the FMOD_DSP_PARAMETER_DATA_TYPE_FFT. You will need to cast to this structure to get the right data.
+
+ [SEE_ALSO]
+ DSP::setParameterFloat
+ DSP::getParameterFloat
+ DSP::setParameterInt
+ DSP::getParameterInt
+ DSP::setParameterData
+ DSP::getParameterData
+ FMOD_DSP_TYPE
+ FMOD_DSP_FFT_WINDOW
+]
+*/
+typedef enum
+{
+ FMOD_DSP_FFT_WINDOWSIZE, /* (Type:int) - [r/w] Must be a power of 2 between 128 and 16384. 128, 256, 512, 1024, 2048, 4096, 8192, 16384 are accepted. Default = 2048. */
+ FMOD_DSP_FFT_WINDOWTYPE, /* (Type:int) - [r/w] Refer to FMOD_DSP_FFT_WINDOW enumeration. Default = FMOD_DSP_FFT_WINDOW_HAMMING. */
+ FMOD_DSP_FFT_SPECTRUMDATA, /* (Type:data) - [r] Returns the current spectrum values between 0 and 1 for each 'fft bin'. Cast data to FMOD_DSP_PARAMETER_DATA_TYPE_FFT. Divide the niquist rate by the window size to get the hz value per entry. */
+ FMOD_DSP_FFT_DOMINANT_FREQ /* (Type:float) - [r] Returns the dominant frequencies for each channel. */
+} FMOD_DSP_FFT;
+
+
+/*
+[ENUM]
+[
+ [DESCRIPTION]
+ Parameter types for the FMOD_DSP_TYPE_ENVELOPEFOLLOWER unit.
+ This is a simple envelope follower for tracking the signal level.
+
+ [REMARKS]
+ This unit does not affect the incoming signal
+
+
+ [SEE_ALSO]
+ DSP::setParameterFloat
+ DSP::getParameterFloat
+ DSP::setParameterData
+ DSP::getParameterData
+ FMOD_DSP_TYPE
+]
+*/
+typedef enum
+{
+ FMOD_DSP_ENVELOPEFOLLOWER_ATTACK, /* (Type:float) [r/w] - Attack time (milliseconds), in the range from 0.1 through 1000. Default = 20. */
+ FMOD_DSP_ENVELOPEFOLLOWER_RELEASE, /* (Type:float) [r/w] - Release time (milliseconds), in the range from 10 through 5000. Default = 100 */
+ FMOD_DSP_ENVELOPEFOLLOWER_ENVELOPE, /* (Type:float) [r] - Current value of the envelope, in the range 0 to 1. Read-only. */
+ FMOD_DSP_ENVELOPEFOLLOWER_USESIDECHAIN /* (Type:data) [r/w] - Data of type FMOD_DSP_PARAMETER_SIDECHAIN. Whether to analyse the sidechain signal instead of the input signal. Default is { false } */
+} FMOD_DSP_ENVELOPEFOLLOWER;
+
+/*
+[ENUM]
+[
+ [DESCRIPTION]
+ Parameter types for the FMOD_DSP_TYPE_CONVOLUTIONREVERB filter.
+
+ [REMARKS]
+ Convolution Reverb reverb IR.
+
+ [SEE_ALSO]
+ DSP::setParameterFloat
+ DSP::getParameterFloat
+ DSP::setParameterData
+ DSP::getParameterData
+ FMOD_DSP_TYPE
+]
+*/
+typedef enum
+{
+ FMOD_DSP_CONVOLUTION_REVERB_PARAM_IR, /* (Type:data) - [w] 16-bit reverb IR (short*) with an extra sample prepended to the start which specifies the number of channels. */
+ FMOD_DSP_CONVOLUTION_REVERB_PARAM_WET, /* (Type:float) - [r/w] Volume of echo signal to pass to output in dB. -80.0 to 10.0. Default = 0. */
+ FMOD_DSP_CONVOLUTION_REVERB_PARAM_DRY, /* (Type:float) - [r/w] Original sound volume in dB. -80.0 to 10.0. Default = 0. */
+ FMOD_DSP_CONVOLUTION_REVERB_PARAM_LINKED /* (Type:bool) - [r/w] Linked - channels are mixed together before processing through the reverb. Default = TRUE. */
+} FMOD_DSP_CONVOLUTION_REVERB;
+
+/*
+[ENUM]
+[
+ [DESCRIPTION]
+ Parameter types for the FMOD_DSP_CHANNELMIX_OUTPUTGROUPING parameter for FMOD_DSP_TYPE_CHANNELMIX effect.
+
+ [REMARKS]
+
+ [SEE_ALSO]
+ DSP::setParameterInt
+ DSP::getParameterInt
+ FMOD_DSP_TYPE
+]
+*/
+typedef enum
+{
+ FMOD_DSP_CHANNELMIX_OUTPUT_DEFAULT, /* Output channel count = input channel count. Mapping: See FMOD_SPEAKER enumeration. */
+ FMOD_DSP_CHANNELMIX_OUTPUT_ALLMONO, /* Output channel count = 1. Mapping: Mono, Mono, Mono, Mono, Mono, Mono, ... (each channel all the way up to FMOD_MAX_CHANNEL_WIDTH channels are treated as if they were mono) */
+ FMOD_DSP_CHANNELMIX_OUTPUT_ALLSTEREO, /* Output channel count = 2. Mapping: Left, Right, Left, Right, Left, Right, ... (each pair of channels is treated as stereo all the way up to FMOD_MAX_CHANNEL_WIDTH channels) */
+ FMOD_DSP_CHANNELMIX_OUTPUT_ALLQUAD, /* Output channel count = 4. Mapping: Repeating pattern of Front Left, Front Right, Surround Left, Surround Right. */
+ FMOD_DSP_CHANNELMIX_OUTPUT_ALL5POINT1, /* Output channel count = 6. Mapping: Repeating pattern of Front Left, Front Right, Center, LFE, Surround Left, Surround Right. */
+ FMOD_DSP_CHANNELMIX_OUTPUT_ALL7POINT1, /* Output channel count = 8. Mapping: Repeating pattern of Front Left, Front Right, Center, LFE, Surround Left, Surround Right, Back Left, Back Right. */
+ FMOD_DSP_CHANNELMIX_OUTPUT_ALLLFE /* Output channel count = 6. Mapping: Repeating pattern of LFE in a 5.1 output signal. */
+} FMOD_DSP_CHANNELMIX_OUTPUT;
+
+/*
+[ENUM]
+[
+ [DESCRIPTION]
+ Parameter types for the FMOD_DSP_TYPE_CHANNELMIX filter.
+
+ [REMARKS]
+ For FMOD_DSP_CHANNELMIX_OUTPUTGROUPING, this value will set the output speaker format for the DSP, and also map the incoming channels to the
+ outgoing channels in a round-robin fashion. Use this for example play a 32 channel input signal as if it were a repeating group of output signals.
+ Ie.
+ FMOD_DSP_CHANNELMIX_OUTPUT_ALLMONO = all incoming channels are mixed to a mono output.
+ FMOD_DSP_CHANNELMIX_OUTPUT_ALLSTEREO = all incoming channels are mixed to a stereo output, ie even incoming channels 0,2,4,6,etc are mixed to left, and odd incoming channels 1,3,5,7,etc are mixed to right.
+ FMOD_DSP_CHANNELMIX_OUTPUT_ALL5POINT1 = all incoming channels are mixed to a 5.1 output. If there are less than 6 coming in, it will just fill the first n channels in the 6 output channels.
+ If there are more, then it will repeat the input pattern to the output like it did with the stereo case, ie 12 incoming channels are mapped as 0-5 mixed to the
+ 5.1 output and 6 to 11 mapped to the 5.1 output.
+ FMOD_DSP_CHANNELMIX_OUTPUT_ALLLFE = all incoming channels are mixed to a 5.1 output but via the LFE channel only.
+
+ [SEE_ALSO]
+ DSP::setParameterInt
+ DSP::getParameterInt
+ DSP::setParameterFloat
+ DSP::getParameterFloat
+ FMOD_DSP_TYPE
+]
+*/
+typedef enum
+{
+ FMOD_DSP_CHANNELMIX_OUTPUTGROUPING, /* (Type:int) - Refer to FMOD_DSP_CHANNELMIX_OUTPUT enumeration. Default = FMOD_DSP_CHANNELMIX_OUTPUT_DEFAULT. See remarks. */
+ FMOD_DSP_CHANNELMIX_GAIN_CH0, /* (Type:float) - Channel #0 gain in dB. -80.0 to 10.0. Default = 0. */
+ FMOD_DSP_CHANNELMIX_GAIN_CH1, /* (Type:float) - Channel #1 gain in dB. -80.0 to 10.0. Default = 0. */
+ FMOD_DSP_CHANNELMIX_GAIN_CH2, /* (Type:float) - Channel #2 gain in dB. -80.0 to 10.0. Default = 0. */
+ FMOD_DSP_CHANNELMIX_GAIN_CH3, /* (Type:float) - Channel #3 gain in dB. -80.0 to 10.0. Default = 0. */
+ FMOD_DSP_CHANNELMIX_GAIN_CH4, /* (Type:float) - Channel #4 gain in dB. -80.0 to 10.0. Default = 0. */
+ FMOD_DSP_CHANNELMIX_GAIN_CH5, /* (Type:float) - Channel #5 gain in dB. -80.0 to 10.0. Default = 0. */
+ FMOD_DSP_CHANNELMIX_GAIN_CH6, /* (Type:float) - Channel #6 gain in dB. -80.0 to 10.0. Default = 0. */
+ FMOD_DSP_CHANNELMIX_GAIN_CH7, /* (Type:float) - Channel #7 gain in dB. -80.0 to 10.0. Default = 0. */
+ FMOD_DSP_CHANNELMIX_GAIN_CH8, /* (Type:float) - Channel #8 gain in dB. -80.0 to 10.0. Default = 0. */
+ FMOD_DSP_CHANNELMIX_GAIN_CH9, /* (Type:float) - Channel #9 gain in dB. -80.0 to 10.0. Default = 0. */
+ FMOD_DSP_CHANNELMIX_GAIN_CH10, /* (Type:float) - Channel #10 gain in dB. -80.0 to 10.0. Default = 0. */
+ FMOD_DSP_CHANNELMIX_GAIN_CH11, /* (Type:float) - Channel #11 gain in dB. -80.0 to 10.0. Default = 0. */
+ FMOD_DSP_CHANNELMIX_GAIN_CH12, /* (Type:float) - Channel #12 gain in dB. -80.0 to 10.0. Default = 0. */
+ FMOD_DSP_CHANNELMIX_GAIN_CH13, /* (Type:float) - Channel #13 gain in dB. -80.0 to 10.0. Default = 0. */
+ FMOD_DSP_CHANNELMIX_GAIN_CH14, /* (Type:float) - Channel #14 gain in dB. -80.0 to 10.0. Default = 0. */
+ FMOD_DSP_CHANNELMIX_GAIN_CH15, /* (Type:float) - Channel #15 gain in dB. -80.0 to 10.0. Default = 0. */
+ FMOD_DSP_CHANNELMIX_GAIN_CH16, /* (Type:float) - Channel #16 gain in dB. -80.0 to 10.0. Default = 0. */
+ FMOD_DSP_CHANNELMIX_GAIN_CH17, /* (Type:float) - Channel #17 gain in dB. -80.0 to 10.0. Default = 0. */
+ FMOD_DSP_CHANNELMIX_GAIN_CH18, /* (Type:float) - Channel #18 gain in dB. -80.0 to 10.0. Default = 0. */
+ FMOD_DSP_CHANNELMIX_GAIN_CH19, /* (Type:float) - Channel #19 gain in dB. -80.0 to 10.0. Default = 0. */
+ FMOD_DSP_CHANNELMIX_GAIN_CH20, /* (Type:float) - Channel #20 gain in dB. -80.0 to 10.0. Default = 0. */
+ FMOD_DSP_CHANNELMIX_GAIN_CH21, /* (Type:float) - Channel #21 gain in dB. -80.0 to 10.0. Default = 0. */
+ FMOD_DSP_CHANNELMIX_GAIN_CH22, /* (Type:float) - Channel #22 gain in dB. -80.0 to 10.0. Default = 0. */
+ FMOD_DSP_CHANNELMIX_GAIN_CH23, /* (Type:float) - Channel #23 gain in dB. -80.0 to 10.0. Default = 0. */
+ FMOD_DSP_CHANNELMIX_GAIN_CH24, /* (Type:float) - Channel #24 gain in dB. -80.0 to 10.0. Default = 0. */
+ FMOD_DSP_CHANNELMIX_GAIN_CH25, /* (Type:float) - Channel #25 gain in dB. -80.0 to 10.0. Default = 0. */
+ FMOD_DSP_CHANNELMIX_GAIN_CH26, /* (Type:float) - Channel #26 gain in dB. -80.0 to 10.0. Default = 0. */
+ FMOD_DSP_CHANNELMIX_GAIN_CH27, /* (Type:float) - Channel #27 gain in dB. -80.0 to 10.0. Default = 0. */
+ FMOD_DSP_CHANNELMIX_GAIN_CH28, /* (Type:float) - Channel #28 gain in dB. -80.0 to 10.0. Default = 0. */
+ FMOD_DSP_CHANNELMIX_GAIN_CH29, /* (Type:float) - Channel #29 gain in dB. -80.0 to 10.0. Default = 0. */
+ FMOD_DSP_CHANNELMIX_GAIN_CH30, /* (Type:float) - Channel #30 gain in dB. -80.0 to 10.0. Default = 0. */
+ FMOD_DSP_CHANNELMIX_GAIN_CH31 /* (Type:float) - Channel #31 gain in dB. -80.0 to 10.0. Default = 0. */
+} FMOD_DSP_CHANNELMIX;
+
+/*
+[ENUM]
+[
+ [DESCRIPTION]
+ Parameter types for the FMOD_DSP_TRANSCEIVER_SPEAKERMODE parameter for FMOD_DSP_TYPE_TRANSCEIVER effect.
+
+ [REMARKS]
+ The speaker mode of a transceiver buffer (of which there are up to 32 of) is determined automatically depending on the signal flowing through the transceiver effect, or it can be forced.
+ Use a smaller fixed speaker mode buffer to save memory.
+
+ Only relevant for transmitter dsps, as they control the format of the transceiver channel's buffer.
+
+ If multiple transceivers transmit to a single buffer in different speaker modes, it will allocate memory for each speaker mode. This uses more memory than a single speaker mode.
+ If there are multiple receivers reading from a channel with multiple speaker modes, it will read them all and mix them together.
+
+ If the system's speaker mode is stereo or mono, it will not create a 3rd buffer, it will just use the mono/stereo speaker mode buffer.
+
+ [SEE_ALSO]
+ DSP::setParameterInt
+ DSP::getParameterInt
+ FMOD_DSP_TYPE
+]
+*/
+typedef enum
+{
+ FMOD_DSP_TRANSCEIVER_SPEAKERMODE_AUTO = -1, /* A transmitter will use whatever signal channel count coming in to the transmitter, to determine which speaker mode is allocated for the transceiver channel. */
+ FMOD_DSP_TRANSCEIVER_SPEAKERMODE_MONO = 0, /* A transmitter will always downmix to a mono channel buffer. */
+ FMOD_DSP_TRANSCEIVER_SPEAKERMODE_STEREO, /* A transmitter will always upmix or downmix to a stereo channel buffer. */
+ FMOD_DSP_TRANSCEIVER_SPEAKERMODE_SURROUND, /* A transmitter will always upmix or downmix to a surround channel buffer. Surround is the speaker mode of the system above stereo, so could be quad/surround/5.1/7.1. */
+} FMOD_DSP_TRANSCEIVER_SPEAKERMODE;
+
+
+/*
+[ENUM]
+[
+ [DESCRIPTION]
+ Parameter types for the FMOD_DSP_TYPE_TRANSCEIVER filter.
+
+ [REMARKS]
+ The transceiver only transmits and receives to a global array of 32 channels. The transceiver can be set to receiver mode (like a return) and can receive the signal at a variable gain (FMOD_DSP_TRANSCEIVER_GAIN).
+ The transceiver can also be set to transmit to a chnnel (like a send) and can transmit the signal with a variable gain (FMOD_DSP_TRANSCEIVER_GAIN).
+
+ The FMOD_DSP_TRANSCEIVER_TRANSMITSPEAKERMODE is only applicable to the transmission format, not the receive format. This means this parameter is ignored in 'receive mode'. This allows receivers to receive at
+ the speaker mode of the user's choice. Receiving from a mono channel, is cheaper than receiving from a surround channel for example.
+ The 3 speaker modes FMOD_DSP_TRANSCEIVER_SPEAKERMODE_MONO, FMOD_DSP_TRANSCEIVER_SPEAKERMODE_STEREO, FMOD_DSP_TRANSCEIVER_SPEAKERMODE_SURROUND are stored as seperate buffers in memory for a tranmitter channel.
+ To save memory, use 1 common speaker mode for a transmitter.
+
+ The transceiver is double buffered to avoid desyncing of transmitters and receivers. This means there will be a 1 block delay on a receiver, compared to the data sent from a transmitter.
+
+ Multiple transmitters sending to the same channel will be mixed together.
+
+ [SEE_ALSO]
+ DSP::setParameterFloat
+ DSP::getParameterFloat
+ DSP::setParameterInt
+ DSP::getParameterInt
+ DSP::setParameterBool
+ DSP::getParameterBool
+ FMOD_DSP_TYPE
+]
+*/
+typedef enum
+{
+ FMOD_DSP_TRANSCEIVER_TRANSMIT, /* (Type:bool) - [r/w] - FALSE = Transceiver is a 'receiver' (like a return) and accepts data from a channel. TRUE = Transceiver is a 'transmitter' (like a send). Default = FALSE. */
+ FMOD_DSP_TRANSCEIVER_GAIN, /* (Type:float) - [r/w] - Gain to receive or transmit at in dB. -80.0 to 10.0. Default = 0. */
+ FMOD_DSP_TRANSCEIVER_CHANNEL, /* (Type:int) - [r/w] - Integer to select current global slot, shared by all Transceivers, that can be transmitted to or received from. 0 to 31. Default = 0.*/
+ FMOD_DSP_TRANSCEIVER_TRANSMITSPEAKERMODE /* (Type:int) - [r/w] - Speaker mode (transmitter mode only). Specifies either 0 (Auto) Default = 0.*/
+} FMOD_DSP_TRANSCEIVER;
+
+
+/*
+[ENUM]
+[
+ [DESCRIPTION]
+ Parameter types for the FMOD_DSP_TYPE_OBJECTPAN DSP. 3D Object panners are meant for hardware 3d object systems like Dolby Atmos or Sony Morpheus.
+ These object panners take input in, and send it to the 7.1 bed, but do not send the signal further down the DSP chain (the output of the dsp is silence).
+
+ [REMARKS]
+
+ [SEE_ALSO]
+ DSP::setParameterFloat
+ DSP::getParameterFloat
+ DSP::setParameterInt
+ DSP::getParameterInt
+ DSP::setParameterData
+ DSP::getParameterData
+ FMOD_DSP_TYPE
+]
+*/
+typedef enum
+{
+ FMOD_DSP_OBJECTPAN_3D_POSITION, /* (Type:data) - 3D Position. data of type FMOD_DSP_PARAMETER_3DATTRIBUTES_MULTI */
+ FMOD_DSP_OBJECTPAN_3D_ROLLOFF, /* (Type:int) - 3D Rolloff. FMOD_DSP_PAN_3D_ROLLOFF_LINEARSQUARED to FMOD_DSP_PAN_3D_ROLLOFF_CUSTOM. Default = FMOD_DSP_PAN_3D_ROLLOFF_LINEARSQUARED. */
+ FMOD_DSP_OBJECTPAN_3D_MIN_DISTANCE, /* (Type:float) - 3D Min Distance. 0.0 to 1e+18f. Default = 1.0. */
+ FMOD_DSP_OBJECTPAN_3D_MAX_DISTANCE, /* (Type:float) - 3D Max Distance. 0.0 to 1e+18f. Default = 20.0. */
+ FMOD_DSP_OBJECTPAN_3D_EXTENT_MODE, /* (Type:int) - 3D Extent Mode. FMOD_DSP_PAN_3D_EXTENT_MODE_AUTO to FMOD_DSP_PAN_3D_EXTENT_MODE_OFF. Default = FMOD_DSP_PAN_3D_EXTENT_MODE_AUTO. */
+ FMOD_DSP_OBJECTPAN_3D_SOUND_SIZE, /* (Type:float) - 3D Sound Size. 0.0 to 1e+18f. Default = 0.0. */
+ FMOD_DSP_OBJECTPAN_3D_MIN_EXTENT, /* (Type:float) - 3D Min Extent. 0.0 (degrees) to 360.0 (degrees). Default = 0.0. */
+ FMOD_DSP_OBJECTPAN_OVERALL_GAIN, /* (Type:data) - Overall gain. For information only, not set by user. Data of type FMOD_DSP_PARAMETER_DATA_TYPE_OVERALLGAIN to provide to FMOD, to allow FMOD to know the DSP is scaling the signal for virtualization purposes. */
+ FMOD_DSP_OBJECTPAN_OUTPUTGAIN /* (Type:float) - Output gain level. 0.0 to 1.0 linear scale. For the user to scale the output of the object panner's signal. */
+} FMOD_DSP_OBJECTPAN;
+
+#endif
+
diff --git a/app/src/main/cpp/inc/fmod_errors.h b/app/src/main/cpp/inc/fmod_errors.h
new file mode 100644
index 0000000..0b7be1e
--- /dev/null
+++ b/app/src/main/cpp/inc/fmod_errors.h
@@ -0,0 +1,113 @@
+/*$ preserve start $*/
+
+/* ================================================================================================== */
+/* FMOD Studio - Error string header file. Copyright (c), Firelight Technologies Pty, Ltd. 2004-2017. */
+/* */
+/* Use this header if you want to store or display a string version / english explanation of */
+/* the FMOD error codes. */
+/* */
+/* ================================================================================================== */
+
+#ifndef _FMOD_ERRORS_H
+#define _FMOD_ERRORS_H
+
+#include "fmod.h"
+
+#ifdef __GNUC__
+static const char *FMOD_ErrorString(FMOD_RESULT errcode) __attribute__((unused));
+#endif
+
+static const char *FMOD_ErrorString(FMOD_RESULT errcode)
+{
+ switch (errcode)
+ {
+/*$ preserve end $*/
+ case FMOD_OK: return "No errors.";
+ case FMOD_ERR_BADCOMMAND: return "Tried to call a function on a data type that does not allow this type of functionality (ie calling Sound::lock on a streaming sound).";
+ case FMOD_ERR_CHANNEL_ALLOC: return "Error trying to allocate a channel.";
+ case FMOD_ERR_CHANNEL_STOLEN: return "The specified channel has been reused to play another sound.";
+ case FMOD_ERR_DMA: return "DMA Failure. See debug output for more information.";
+ case FMOD_ERR_DSP_CONNECTION: return "DSP connection error. Connection possibly caused a cyclic dependency or connected dsps with incompatible buffer counts.";
+ case FMOD_ERR_DSP_DONTPROCESS: return "DSP return code from a DSP process query callback. Tells mixer not to call the process callback and therefore not consume CPU. Use this to optimize the DSP graph.";
+ case FMOD_ERR_DSP_FORMAT: return "DSP Format error. A DSP unit may have attempted to connect to this network with the wrong format, or a matrix may have been set with the wrong size if the target unit has a specified channel map.";
+ case FMOD_ERR_DSP_INUSE: return "DSP is already in the mixer's DSP network. It must be removed before being reinserted or released.";
+ case FMOD_ERR_DSP_NOTFOUND: return "DSP connection error. Couldn't find the DSP unit specified.";
+ case FMOD_ERR_DSP_RESERVED: return "DSP operation error. Cannot perform operation on this DSP as it is reserved by the system.";
+ case FMOD_ERR_DSP_SILENCE: return "DSP return code from a DSP process query callback. Tells mixer silence would be produced from read, so go idle and not consume CPU. Use this to optimize the DSP graph.";
+ case FMOD_ERR_DSP_TYPE: return "DSP operation cannot be performed on a DSP of this type.";
+ case FMOD_ERR_FILE_BAD: return "Error loading file.";
+ case FMOD_ERR_FILE_COULDNOTSEEK: return "Couldn't perform seek operation. This is a limitation of the medium (ie netstreams) or the file format.";
+ case FMOD_ERR_FILE_DISKEJECTED: return "Media was ejected while reading.";
+ case FMOD_ERR_FILE_EOF: return "End of file unexpectedly reached while trying to read essential data (truncated?).";
+ case FMOD_ERR_FILE_ENDOFDATA: return "End of current chunk reached while trying to read data.";
+ case FMOD_ERR_FILE_NOTFOUND: return "File not found.";
+ case FMOD_ERR_FORMAT: return "Unsupported file or audio format.";
+ case FMOD_ERR_HEADER_MISMATCH: return "There is a version mismatch between the FMOD header and either the FMOD Studio library or the FMOD Low Level library.";
+ case FMOD_ERR_HTTP: return "A HTTP error occurred. This is a catch-all for HTTP errors not listed elsewhere.";
+ case FMOD_ERR_HTTP_ACCESS: return "The specified resource requires authentication or is forbidden.";
+ case FMOD_ERR_HTTP_PROXY_AUTH: return "Proxy authentication is required to access the specified resource.";
+ case FMOD_ERR_HTTP_SERVER_ERROR: return "A HTTP server error occurred.";
+ case FMOD_ERR_HTTP_TIMEOUT: return "The HTTP request timed out.";
+ case FMOD_ERR_INITIALIZATION: return "FMOD was not initialized correctly to support this function.";
+ case FMOD_ERR_INITIALIZED: return "Cannot call this command after System::init.";
+ case FMOD_ERR_INTERNAL: return "An error occurred that wasn't supposed to. Contact support.";
+ case FMOD_ERR_INVALID_FLOAT: return "Value passed in was a NaN, Inf or denormalized float.";
+ case FMOD_ERR_INVALID_HANDLE: return "An invalid object handle was used.";
+ case FMOD_ERR_INVALID_PARAM: return "An invalid parameter was passed to this function.";
+ case FMOD_ERR_INVALID_POSITION: return "An invalid seek position was passed to this function.";
+ case FMOD_ERR_INVALID_SPEAKER: return "An invalid speaker was passed to this function based on the current speaker mode.";
+ case FMOD_ERR_INVALID_SYNCPOINT: return "The syncpoint did not come from this sound handle.";
+ case FMOD_ERR_INVALID_THREAD: return "Tried to call a function on a thread that is not supported.";
+ case FMOD_ERR_INVALID_VECTOR: return "The vectors passed in are not unit length, or perpendicular.";
+ case FMOD_ERR_MAXAUDIBLE: return "Reached maximum audible playback count for this sound's soundgroup.";
+ case FMOD_ERR_MEMORY: return "Not enough memory or resources.";
+ case FMOD_ERR_MEMORY_CANTPOINT: return "Can't use FMOD_OPENMEMORY_POINT on non PCM source data, or non mp3/xma/adpcm data if FMOD_CREATECOMPRESSEDSAMPLE was used.";
+ case FMOD_ERR_NEEDS3D: return "Tried to call a command on a 2d sound when the command was meant for 3d sound.";
+ case FMOD_ERR_NEEDSHARDWARE: return "Tried to use a feature that requires hardware support.";
+ case FMOD_ERR_NET_CONNECT: return "Couldn't connect to the specified host.";
+ case FMOD_ERR_NET_SOCKET_ERROR: return "A socket error occurred. This is a catch-all for socket-related errors not listed elsewhere.";
+ case FMOD_ERR_NET_URL: return "The specified URL couldn't be resolved.";
+ case FMOD_ERR_NET_WOULD_BLOCK: return "Operation on a non-blocking socket could not complete immediately.";
+ case FMOD_ERR_NOTREADY: return "Operation could not be performed because specified sound/DSP connection is not ready.";
+ case FMOD_ERR_OUTPUT_ALLOCATED: return "Error initializing output device, but more specifically, the output device is already in use and cannot be reused.";
+ case FMOD_ERR_OUTPUT_CREATEBUFFER: return "Error creating hardware sound buffer.";
+ case FMOD_ERR_OUTPUT_DRIVERCALL: return "A call to a standard soundcard driver failed, which could possibly mean a bug in the driver or resources were missing or exhausted.";
+ case FMOD_ERR_OUTPUT_FORMAT: return "Soundcard does not support the specified format.";
+ case FMOD_ERR_OUTPUT_INIT: return "Error initializing output device.";
+ case FMOD_ERR_OUTPUT_NODRIVERS: return "The output device has no drivers installed. If pre-init, FMOD_OUTPUT_NOSOUND is selected as the output mode. If post-init, the function just fails.";
+ case FMOD_ERR_PLUGIN: return "An unspecified error has been returned from a plugin.";
+ case FMOD_ERR_PLUGIN_MISSING: return "A requested output, dsp unit type or codec was not available.";
+ case FMOD_ERR_PLUGIN_RESOURCE: return "A resource that the plugin requires cannot be found. (ie the DLS file for MIDI playback)";
+ case FMOD_ERR_PLUGIN_VERSION: return "A plugin was built with an unsupported SDK version.";
+ case FMOD_ERR_RECORD: return "An error occurred trying to initialize the recording device.";
+ case FMOD_ERR_REVERB_CHANNELGROUP: return "Reverb properties cannot be set on this channel because a parent channelgroup owns the reverb connection.";
+ case FMOD_ERR_REVERB_INSTANCE: return "Specified instance in FMOD_REVERB_PROPERTIES couldn't be set. Most likely because it is an invalid instance number or the reverb doesn't exist.";
+ case FMOD_ERR_SUBSOUNDS: return "The error occurred because the sound referenced contains subsounds when it shouldn't have, or it doesn't contain subsounds when it should have. The operation may also not be able to be performed on a parent sound.";
+ case FMOD_ERR_SUBSOUND_ALLOCATED: return "This subsound is already being used by another sound, you cannot have more than one parent to a sound. Null out the other parent's entry first.";
+ case FMOD_ERR_SUBSOUND_CANTMOVE: return "Shared subsounds cannot be replaced or moved from their parent stream, such as when the parent stream is an FSB file.";
+ case FMOD_ERR_TAGNOTFOUND: return "The specified tag could not be found or there are no tags.";
+ case FMOD_ERR_TOOMANYCHANNELS: return "The sound created exceeds the allowable input channel count. This can be increased using the 'maxinputchannels' parameter in System::setSoftwareFormat.";
+ case FMOD_ERR_TRUNCATED: return "The retrieved string is too long to fit in the supplied buffer and has been truncated.";
+ case FMOD_ERR_UNIMPLEMENTED: return "Something in FMOD hasn't been implemented when it should be! contact support!";
+ case FMOD_ERR_UNINITIALIZED: return "This command failed because System::init or System::setDriver was not called.";
+ case FMOD_ERR_UNSUPPORTED: return "A command issued was not supported by this object. Possibly a plugin without certain callbacks specified.";
+ case FMOD_ERR_VERSION: return "The version number of this file format is not supported.";
+ case FMOD_ERR_EVENT_ALREADY_LOADED: return "The specified bank has already been loaded.";
+ case FMOD_ERR_EVENT_LIVEUPDATE_BUSY: return "The live update connection failed due to the game already being connected.";
+ case FMOD_ERR_EVENT_LIVEUPDATE_MISMATCH: return "The live update connection failed due to the game data being out of sync with the tool.";
+ case FMOD_ERR_EVENT_LIVEUPDATE_TIMEOUT: return "The live update connection timed out.";
+ case FMOD_ERR_EVENT_NOTFOUND: return "The requested event, bus or vca could not be found.";
+ case FMOD_ERR_STUDIO_UNINITIALIZED: return "The Studio::System object is not yet initialized.";
+ case FMOD_ERR_STUDIO_NOT_LOADED: return "The specified resource is not loaded, so it can't be unloaded.";
+ case FMOD_ERR_INVALID_STRING: return "An invalid string was passed to this function.";
+ case FMOD_ERR_ALREADY_LOCKED: return "The specified resource is already locked.";
+ case FMOD_ERR_NOT_LOCKED: return "The specified resource is not locked, so it can't be unlocked.";
+ case FMOD_ERR_RECORD_DISCONNECTED: return "The specified recording driver has been disconnected.";
+ case FMOD_ERR_TOOMANYSAMPLES: return "The length provided exceeds the allowable limit.";
+ default : return "Unknown error.";
+/*$ preserve start $*/
+ };
+}
+
+#endif
+/*$ preserve end $*/
diff --git a/app/src/main/cpp/inc/fmod_output.h b/app/src/main/cpp/inc/fmod_output.h
new file mode 100644
index 0000000..ff90557
--- /dev/null
+++ b/app/src/main/cpp/inc/fmod_output.h
@@ -0,0 +1,174 @@
+/* ======================================================================================================== */
+/* FMOD Studio - output development header file. Copyright (c), Firelight Technologies Pty, Ltd. 2004-2017. */
+/* */
+/* Use this header if you are wanting to develop your own output plugin to use with */
+/* FMOD's output system. With this header you can make your own output plugin that FMOD */
+/* can register and use. See the documentation and examples on how to make a working plugin. */
+/* */
+/* ======================================================================================================== */
+
+#ifndef _FMOD_OUTPUT_H
+#define _FMOD_OUTPUT_H
+
+#define FMOD_OUTPUT_PLUGIN_VERSION 2
+
+typedef struct FMOD_OUTPUT_STATE FMOD_OUTPUT_STATE;
+typedef struct FMOD_OUTPUT_OBJECT3DINFO FMOD_OUTPUT_OBJECT3DINFO;
+
+/*
+ FMOD_OUTPUT_DESCRIPTION callbacks
+*/
+typedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_GETNUMDRIVERS_CALLBACK) (FMOD_OUTPUT_STATE *output_state, int *numdrivers);
+typedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_GETDRIVERINFO_CALLBACK) (FMOD_OUTPUT_STATE *output_state, int id, char *name, int namelen, FMOD_GUID *guid, int *systemrate, FMOD_SPEAKERMODE *speakermode, int *speakermodechannels);
+typedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_INIT_CALLBACK) (FMOD_OUTPUT_STATE *output_state, int selecteddriver, FMOD_INITFLAGS flags, int *outputrate, FMOD_SPEAKERMODE *speakermode, int *speakermodechannels, FMOD_SOUND_FORMAT *outputformat, int dspbufferlength, int dspnumbuffers, void *extradriverdata);
+typedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_START_CALLBACK) (FMOD_OUTPUT_STATE *output_state);
+typedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_STOP_CALLBACK) (FMOD_OUTPUT_STATE *output_state);
+typedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_CLOSE_CALLBACK) (FMOD_OUTPUT_STATE *output_state);
+typedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_UPDATE_CALLBACK) (FMOD_OUTPUT_STATE *output_state);
+typedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_GETHANDLE_CALLBACK) (FMOD_OUTPUT_STATE *output_state, void **handle);
+typedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_GETPOSITION_CALLBACK) (FMOD_OUTPUT_STATE *output_state, unsigned int *pcm);
+typedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_LOCK_CALLBACK) (FMOD_OUTPUT_STATE *output_state, unsigned int offset, unsigned int length, void **ptr1, void **ptr2, unsigned int *len1, unsigned int *len2);
+typedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_UNLOCK_CALLBACK) (FMOD_OUTPUT_STATE *output_state, void *ptr1, void *ptr2, unsigned int len1, unsigned int len2);
+typedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_MIXER_CALLBACK) (FMOD_OUTPUT_STATE *output_state);
+
+typedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_OBJECT3DGETINFO_CALLBACK) (FMOD_OUTPUT_STATE *output_state, int *maxhardwareobjects);
+typedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_OBJECT3DALLOC_CALLBACK) (FMOD_OUTPUT_STATE *output_state, void **object3d);
+typedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_OBJECT3DFREE_CALLBACK) (FMOD_OUTPUT_STATE *output_state, void *object3d);
+typedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_OBJECT3DUPDATE_CALLBACK) (FMOD_OUTPUT_STATE *output_state, void *object3d, const FMOD_OUTPUT_OBJECT3DINFO *info);
+
+typedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_OPENPORT_CALLBACK) (FMOD_OUTPUT_STATE *output, FMOD_PORT_TYPE portType, FMOD_PORT_INDEX portIndex, int *portId, int *portRate, int *portChannels, FMOD_SOUND_FORMAT *portFormat);
+typedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_CLOSEPORT_CALLBACK) (FMOD_OUTPUT_STATE *output, int portId);
+
+
+/*
+ FMOD_OUTPUT_STATE functions
+*/
+typedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_READFROMMIXER) (FMOD_OUTPUT_STATE *output_state, void *buffer, unsigned int length);
+typedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_COPYPORT) (FMOD_OUTPUT_STATE *output, int portId, void *buffer, unsigned int length);
+typedef void * (F_CALLBACK *FMOD_OUTPUT_ALLOC) (unsigned int size, unsigned int align, const char *file, int line);
+typedef void (F_CALLBACK *FMOD_OUTPUT_FREE) (void *ptr, const char *file, int line);
+typedef void (F_CALLBACK *FMOD_OUTPUT_LOG) (FMOD_DEBUG_FLAGS level, const char *file, int line, const char *function, const char *string, ...);
+
+
+/*
+[STRUCTURE]
+[
+ [DESCRIPTION]
+ When creating an output, declare one of these and provide the relevant callbacks and name for FMOD to use when it creates and uses an output of this type.
+
+ [REMARKS]
+ There are several methods for driving the FMOD mixer to service the audio hardware.
+
+ * Polled: if the audio hardware must be polled regularly set 'polling' to TRUE, FMOD will create a mixer thread that calls back via FMOD_OUTPUT_GETPOSITION_CALLBACK. Once an entire block of samples have played FMOD will call FMOD_OUTPUT_LOCK_CALLBACK to allow you to provide a destination pointer to write the next mix.
+ * Callback: if the audio hardware provides a callback where you must provide a buffer of samples then set 'polling' to FALSE and directly call FMOD_OUTPUT_READFROMMIXER.
+ * Synchronization: if the audio hardware provides a synchronization primitive to wait on then set 'polling' to FALSE and give a FMOD_OUTPUT_MIXER_CALLBACK pointer. FMOD will create a mixer thread and call you repeatedly once FMOD_OUTPUT_START_CALLBACK has finished, you must wait on your primitive in this callback and upon wake call FMOD_OUTPUT_READFROMMIXER.
+ * Non-realtime: if you are writing a file or driving a non-realtime output call FMOD_OUTPUT_READFROMMIXER from FMOD_OUTPUT_UPDATE_CALLBACK.
+
+ Callbacks marked with 'user thread' will be called in response to the user of the FMOD low level API, in the case of the Studio runtime API, the user is the Studio Update thread.
+
+ Members marked with [r] mean read only for the developer, read/write for the FMOD system.
+
+ Members marked with [w] mean read/write for the developer, read only for the FMOD system.
+
+ [SEE_ALSO]
+ FMOD_OUTPUT_STATE
+ FMOD_OUTPUT_GETNUMDRIVERS_CALLBACK
+ FMOD_OUTPUT_GETDRIVERINFO_CALLBACK
+ FMOD_OUTPUT_INIT_CALLBACK
+ FMOD_OUTPUT_START_CALLBACK
+ FMOD_OUTPUT_STOP_CALLBACK
+ FMOD_OUTPUT_CLOSE_CALLBACK
+ FMOD_OUTPUT_UPDATE_CALLBACK
+ FMOD_OUTPUT_GETHANDLE_CALLBACK
+ FMOD_OUTPUT_GETPOSITION_CALLBACK
+ FMOD_OUTPUT_LOCK_CALLBACK
+ FMOD_OUTPUT_UNLOCK_CALLBACK
+ FMOD_OUTPUT_MIXER_CALLBACK
+ FMOD_OUTPUT_OBJECT3DGETINFO_CALLBACK
+ FMOD_OUTPUT_OBJECT3DALLOC_CALLBACK
+ FMOD_OUTPUT_OBJECT3DFREE_CALLBACK
+ FMOD_OUTPUT_OBJECT3DUPDATE_CALLBACK
+]
+*/
+typedef struct FMOD_OUTPUT_DESCRIPTION
+{
+ unsigned int apiversion; /* [w] The output plugin API version this plugin is built for. Set to this to FMOD_OUTPUT_PLUGIN_VERSION. */
+ const char *name; /* [w] Name of the output plugin. */
+ unsigned int version; /* [w] Version of the output plugin. */
+ int polling; /* [w] If TRUE (non-zero) a mixer thread is created that calls FMOD_OUTPUT_GETPOSITION_CALLBACK / FMOD_OUTPUT_LOCK_CALLBACK / FMOD_OUTPUT_UNLOCK_CALLBACK to drive the mixer. If FALSE (zero) you must call FMOD_OUTPUT_READFROMMIXER to drive the mixer yourself. */
+ FMOD_OUTPUT_GETNUMDRIVERS_CALLBACK getnumdrivers; /* [w] Required user thread callback to provide the number of attached sound devices. Called from System::getNumDrivers. */
+ FMOD_OUTPUT_GETDRIVERINFO_CALLBACK getdriverinfo; /* [w] Required user thread callback to provide information about a particular sound device. Called from System::getDriverInfo. */
+ FMOD_OUTPUT_INIT_CALLBACK init; /* [w] Required user thread callback to allocate resources and provide information about hardware capabilities. Called from System::init. */
+ FMOD_OUTPUT_START_CALLBACK start; /* [w] Optional user thread callback just before mixing should begin, calls to FMOD_OUTPUT_GETPOSITION_CALLBACK / FMOD_OUTPUT_LOCK_CALLBACK / FMOD_OUTPUT_UNLOCK_CALLBACK / FMOD_OUTPUT_MIXER_CALLBACK will start, you may call FMOD_OUTPUT_READFROMMIXER after this point. Called from System::init. */
+ FMOD_OUTPUT_STOP_CALLBACK stop; /* [w] Optional user thread callback just after mixing has finished, calls to FMOD_OUTPUT_GETPOSITION_CALLBACK / FMOD_OUTPUT_LOCK_CALLBACK / FMOD_OUTPUT_UNLOCK_CALLBACK / FMOD_OUTPUT_MIXER_CALLBACK have stopped, you may not call FMOD_OUTPUT_READFROMMIXER after this point. Called from System::close. */
+ FMOD_OUTPUT_CLOSE_CALLBACK close; /* [w] Required user thread callback to clean up resources allocated during FMOD_OUTPUT_INIT_CALLBACK. Called from System::init and System::close. */
+ FMOD_OUTPUT_UPDATE_CALLBACK update; /* [w] Optional user thread callback once per frame to update internal state. Called from System::update. */
+ FMOD_OUTPUT_GETHANDLE_CALLBACK gethandle; /* [w] Optional user thread callback to provide a pointer to the internal device object used to share with other audio systems. Called from System::getOutputHandle. */
+ FMOD_OUTPUT_GETPOSITION_CALLBACK getposition; /* [w] Required mixer thread callback (if 'polling' is TRUE) to provide the hardware playback position in the output ring buffer. Called before a mix. */
+ FMOD_OUTPUT_LOCK_CALLBACK lock; /* [w] Required mixer thread callback (if 'polling' is TRUE) to provide a pointer the mixer can write to for the next block of audio data. Called before a mix. */
+ FMOD_OUTPUT_UNLOCK_CALLBACK unlock; /* [w] Optional mixer thread callback (if 'polling' is TRUE) to signify the mixer has finished writing to the pointer from FMOD_OUTPUT_LOCK_CALLBACK. Called after a mix. */
+ FMOD_OUTPUT_MIXER_CALLBACK mixer; /* [w] Optional mixer thread callback (if 'polling' is FALSE) called repeatedly to give a thread for waiting on an audio hardware synchronization primitive (see remarks for details). Ensure you have a reasonable timeout (~200ms) on your synchronization primitive and allow this callback to return once per wakeup to avoid deadlocks. */
+ FMOD_OUTPUT_OBJECT3DGETINFO_CALLBACK object3dgetinfo; /* [w] Optional mixer thread callback to provide information about the capabilities of 3D object hardware. Called during a mix. */
+ FMOD_OUTPUT_OBJECT3DALLOC_CALLBACK object3dalloc; /* [w] Optional mixer thread callback to reserve a hardware resources for a single 3D object. Called during a mix. */
+ FMOD_OUTPUT_OBJECT3DFREE_CALLBACK object3dfree; /* [w] Optional mixer thread callback to release a hardware resource previously acquired with FMOD_OUTPUT_OBJECT3DALLOC_CALLBACK. Called during a mix. */
+ FMOD_OUTPUT_OBJECT3DUPDATE_CALLBACK object3dupdate; /* [w] Optional mixer thread callback once for every acquired 3D object every mix to provide 3D information and buffered audio. Called during a mix. */
+ FMOD_OUTPUT_OPENPORT_CALLBACK openport; /* [w] Optional main thread callback to open an auxiliary output port on the device. */
+ FMOD_OUTPUT_CLOSEPORT_CALLBACK closeport; /* [w] Optional main thread callback to close an auxiliary output port on the device. */
+} FMOD_OUTPUT_DESCRIPTION;
+
+
+/*
+[STRUCTURE]
+[
+ [DESCRIPTION]
+ Output object state passed into every callback provides access to plugin developers data and system functionality.
+
+ [REMARKS]
+ Members marked with [r] mean read only for the developer, read/write for the FMOD system.
+ Members marked with [w] mean read/write for the developer, read only for the FMOD system.
+
+ [SEE_ALSO]
+ FMOD_OUTPUT_DESCRIPTION
+]
+*/
+struct FMOD_OUTPUT_STATE
+{
+ void *plugindata; /* [w] Pointer used to store any plugin specific state so it's available in all callbacks. */
+ FMOD_OUTPUT_READFROMMIXER readfrommixer; /* [r] Function to execute the mixer producing a buffer of audio. Used to control when the mix occurs manually as an alternative to FMOD_OUTPUT_DESCRIPTION::polling == TRUE. */
+ FMOD_OUTPUT_ALLOC alloc; /* [r] Function to allocate memory using the FMOD memory system. */
+ FMOD_OUTPUT_FREE free; /* [r] Function to free memory allocated with FMOD_OUTPUT_ALLOC. */
+ FMOD_OUTPUT_LOG log; /* [r] Function to write to the FMOD logging system. */
+ FMOD_OUTPUT_COPYPORT copyport; /* [r] Function to copy the output from the mixer for the given auxiliary port */
+};
+
+
+/*
+[STRUCTURE]
+[
+ [DESCRIPTION]
+ This structure is passed to the plugin via FMOD_OUTPUT_OBJECT3DUPDATE_CALLBACK, so that whatever object based panning solution available can position it in the speakers correctly.
+ Object based panning is a 3D panning solution that sends a mono only signal to a hardware device, such as Dolby Atmos or other similar panning solutions.
+
+ [REMARKS]
+ FMOD does not attenuate the buffer, but provides a 'gain' parameter that the user must use to scale the buffer by. Rather than pre-attenuating the buffer, the plugin developer
+ can access untouched data for other purposes, like reverb sending for example.
+ The 'gain' parameter is based on the user's 3D custom rolloff model.
+
+ Members marked with [r] mean read only for the developer, read/write for the FMOD system.
+ Members marked with [w] mean read/write for the developer, read only for the FMOD system.
+
+ [SEE_ALSO]
+ FMOD_OUTPUT_OBJECT3DUPDATE_CALLBACK
+]
+*/
+struct FMOD_OUTPUT_OBJECT3DINFO
+{
+ float *buffer; /* [r] Mono PCM floating point buffer. This buffer needs to be scaled by the gain value to get distance attenuation. */
+ unsigned int bufferlength; /* [r] Length in PCM samples of buffer. */
+ FMOD_VECTOR position; /* [r] Vector relative between object and listener. */
+ float gain; /* [r] 0.0 to 1.0 - 1 = 'buffer' is not attenuated, 0 = 'buffer' is fully attenuated. */
+ float spread; /* [r] 0 - 360 degrees. 0 = point source, 360 = sound is spread around all speakers */
+ float priority; /* [r] 0.0 to 1.0 - 0 = most important, 1 = least important. Based on height and distance (height is more important). */
+};
+
+#endif /* _FMOD_OUTPUT_H */
diff --git a/app/src/main/cpp/sound.cpp b/app/src/main/cpp/sound.cpp
new file mode 100644
index 0000000..6d70c50
--- /dev/null
+++ b/app/src/main/cpp/sound.cpp
@@ -0,0 +1,104 @@
+#include "inc/fmod.hpp"
+#include
+#include
+#include "com_aserbao_androidcustomcamera_utils_VoiceUtils.h"
+
+#include
+
+#include
+#define LOGI(FORMAT,...) __android_log_print(ANDROID_LOG_INFO,"zph",FORMAT,##__VA_ARGS__);
+#define LOGE(FORMAT,...) __android_log_print(ANDROID_LOG_ERROR,"zph",FORMAT,##__VA_ARGS__);
+
+#define MODE_NORMAL 0
+#define MODE_LUOLI 1
+#define MODE_DASHU 2
+#define MODE_JINGSONG 3
+#define MODE_GAOGUAI 4
+#define MODE_KONGLING 5
+
+using namespace FMOD;
+
+JNIEXPORT void JNICALL Java_com_aserbao_androidcustomcamera_utils_VoiceUtils_fix(JNIEnv *env,
+ jclass jcls, jstring path_jstr, jint type) {
+ //声音引擎
+ System *system;
+ //声音
+ Sound *sound;
+ //数字处理(音效)
+ DSP *dsp;
+ //正在播放
+ bool playing = true;
+ //音乐轨道
+ Channel *channel;
+ //播放速度
+ float frequency = 0;
+ //音频地址
+ const char* path_cstr = env->GetStringUTFChars(path_jstr, NULL);
+
+ System_Create(&system);
+ system->init(32, FMOD_INIT_NORMAL, NULL);
+
+ try {
+ //创建声音
+ system->createSound(path_cstr, FMOD_DEFAULT, NULL, &sound);
+ switch (type) {
+ case MODE_NORMAL:
+ //原生播放
+ system->playSound(sound, 0, false, &channel);
+ break;
+ case MODE_LUOLI:
+ //提升或者降低音调的一种音效
+ system->createDSPByType(FMOD_DSP_TYPE_PITCHSHIFT, &dsp);
+ //设置音调的参数
+ dsp->setParameterFloat(FMOD_DSP_PITCHSHIFT_PITCH, 1.8);
+ //添加进到channel,添加进轨道
+ system->playSound(sound, 0, false, &channel);
+ channel->addDSP(0, dsp);
+ break;
+ case MODE_DASHU:
+ system->createDSPByType(FMOD_DSP_TYPE_PITCHSHIFT, &dsp);
+ dsp->setParameterFloat(FMOD_DSP_PITCHSHIFT_PITCH, 0.8);
+ system->playSound(sound, 0, false, &channel);
+ channel->addDSP(0, dsp);
+ break;
+ case MODE_JINGSONG:
+ system->createDSPByType(FMOD_DSP_TYPE_TREMOLO, &dsp);
+ dsp->setParameterFloat(FMOD_DSP_TREMOLO_SKEW, 0.8);
+ system->playSound(sound, 0, false, &channel);
+ channel->addDSP(0, dsp);
+ break;
+ case MODE_GAOGUAI:
+ //提高说话的速度
+ system->playSound(sound, 0, false, &channel);
+ channel->getFrequency(&frequency);
+ frequency = frequency * 2;
+ channel->setFrequency(frequency);
+ break;
+ case MODE_KONGLING:
+ system->createDSPByType(FMOD_DSP_TYPE_ECHO, &dsp);
+ dsp->setParameterFloat(FMOD_DSP_ECHO_DELAY, 300);
+ dsp->setParameterFloat(FMOD_DSP_ECHO_FEEDBACK, 20);
+ system->playSound(sound, 0, false, &channel);
+ channel->addDSP(0, dsp);
+ break;
+ }
+ } catch (...) {
+ LOGE("%s", "发生异常");
+ goto end;
+ }
+ system->update();
+
+ //单位是微妙
+ //每秒钟判断下是否是播放
+ while (playing) {
+ channel->isPlaying(&playing);
+ usleep(1000);
+ }
+ goto end;
+
+ //释放资源
+ end: env->ReleaseStringUTFChars(path_jstr, path_cstr);
+ sound->release();
+ system->close();
+ system->release();
+}
diff --git a/app/src/main/java/com/aserbao/androidcustomcamera/HomeActivity.kt b/app/src/main/java/com/aserbao/androidcustomcamera/HomeActivity.kt
new file mode 100644
index 0000000..fd3c68e
--- /dev/null
+++ b/app/src/main/java/com/aserbao/androidcustomcamera/HomeActivity.kt
@@ -0,0 +1,19 @@
+package com.aserbao.androidcustomcamera
+
+import android.view.View
+import com.aserbao.androidcustomcamera.base.activity.RVBaseActivity
+import com.aserbao.androidcustomcamera.base.beans.BaseRecyclerBean
+import com.aserbao.androidcustomcamera.blocks.BlocksActivity
+import com.aserbao.androidcustomcamera.blocks.ffmpeg.FFmpegActivity
+import com.aserbao.androidcustomcamera.blocks.others.changeVoice.ChangeVoiceActivity
+import com.aserbao.androidcustomcamera.whole.WholeActivity
+
+class HomeActivity : RVBaseActivity() {
+ override fun initGetData() {
+ mBaseRecyclerBeen.add(BaseRecyclerBean("每个功能点单独代码实现", BlocksActivity::class.java))
+ mBaseRecyclerBeen.add(BaseRecyclerBean("所有功能点整合代码实现", WholeActivity::class.java))
+ mBaseRecyclerBeen.add(BaseRecyclerBean("当前调用界面", FFmpegActivity::class.java))
+ }
+
+ override fun itemClickBack(view: View, position: Int, isLongClick: Boolean, comeFrom: Int) {}
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/aserbao/androidcustomcamera/MainActivity.java b/app/src/main/java/com/aserbao/androidcustomcamera/MainActivity.java
deleted file mode 100644
index 424c40d..0000000
--- a/app/src/main/java/com/aserbao/androidcustomcamera/MainActivity.java
+++ /dev/null
@@ -1,17 +0,0 @@
-package com.aserbao.androidcustomcamera;
-
-import com.aserbao.androidcustomcamera.base.activity.RVBaseActivity;
-import com.aserbao.androidcustomcamera.base.beans.ClassBean;
-import com.aserbao.androidcustomcamera.blocks.BlocksActivity;
-import com.aserbao.androidcustomcamera.whole.WholeActivity;
-
-import java.util.List;
-
-public class MainActivity extends RVBaseActivity {
- @Override
- public List initData() {
- mClassBeans.add(new ClassBean("每个功能点单独代码实现", BlocksActivity.class));
- mClassBeans.add(new ClassBean("所有功能点整合代码实现", WholeActivity.class));
- return mClassBeans;
- }
-}
diff --git a/app/src/main/java/com/aserbao/androidcustomcamera/WelcomeActivity.kt b/app/src/main/java/com/aserbao/androidcustomcamera/WelcomeActivity.kt
new file mode 100644
index 0000000..0ef193a
--- /dev/null
+++ b/app/src/main/java/com/aserbao/androidcustomcamera/WelcomeActivity.kt
@@ -0,0 +1,48 @@
+package com.aserbao.androidcustomcamera
+
+import android.animation.Animator
+import android.animation.AnimatorListenerAdapter
+import android.animation.ObjectAnimator
+import android.animation.PropertyValuesHolder
+import android.content.Intent
+import android.util.Log
+import com.aserbao.androidcustomcamera.base.activity.BaseActivity
+import com.aserbao.androidcustomcamera.utils.CheckPermissionUtil
+import com.aserbao.androidcustomcamera.whole.record.RecorderActivity
+import kotlinx.android.synthetic.main.activity_welcome.*
+
+
+class WelcomeActivity : BaseActivity() {
+
+ override fun setLayoutId(): Int {
+ return R.layout.activity_welcome
+ }
+
+ override fun initView() {
+ super.initView()
+ }
+
+ fun exectorAnimator(){
+ val valuesHolder0 = PropertyValuesHolder.ofFloat("scaleX", 1.0f, 1.5f)
+ val valuesHolder1 = PropertyValuesHolder.ofFloat("scaleY", 1.0f, 1.5f)
+ val objectAnimator: ObjectAnimator = ObjectAnimator.ofPropertyValuesHolder(bgIV, valuesHolder0, valuesHolder1)
+ objectAnimator.addListener(object : AnimatorListenerAdapter() {
+ override fun onAnimationEnd(animation: Animator?) {
+ super.onAnimationEnd(animation)
+ startActivity(Intent(this@WelcomeActivity, RecorderActivity::class.java))
+ finish()
+ }
+ })
+ objectAnimator.setDuration(2000).start()
+ }
+
+ override fun onRequestPermissionsResult(requestCode: Int, permissions: Array, grantResults: IntArray) {
+ super.onRequestPermissionsResult(requestCode, permissions, grantResults)
+ Log.e("TAG", "onRequestPermissionsResult: $requestCode")
+ if(CheckPermissionUtil.isCameraGranted()) {
+ exectorAnimator()
+ }else{
+ startRequestPermission()
+ }
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/aserbao/androidcustomcamera/agithubProject/readme.txt b/app/src/main/java/com/aserbao/androidcustomcamera/agithubProject/readme.txt
new file mode 100644
index 0000000..e69de29
diff --git a/app/src/main/java/com/aserbao/androidcustomcamera/base/MyApplication.java b/app/src/main/java/com/aserbao/androidcustomcamera/base/MyApplication.java
index baa9d2b..9faeadb 100644
--- a/app/src/main/java/com/aserbao/androidcustomcamera/base/MyApplication.java
+++ b/app/src/main/java/com/aserbao/androidcustomcamera/base/MyApplication.java
@@ -4,6 +4,8 @@
import android.content.Context;
import android.util.DisplayMetrics;
+import com.danikula.videocache.HttpProxyCacheServer;
+
/**
* description:
* Created by aserbao on 2018/5/15.
@@ -23,9 +25,28 @@ public void onCreate() {
.getDisplayMetrics();
screenWidth = mDisplayMetrics.widthPixels;
screenHeight = mDisplayMetrics.heightPixels;
+ app = this;
}
public static Context getContext() {
return mContext;
}
+
+ public static MyApplication app;
+ public static MyApplication getInstance() {
+ return app;
+ }
+
+ //=====================================================缓存区
+ private HttpProxyCacheServer proxy;
+
+ public static HttpProxyCacheServer getProxy() {
+ MyApplication app = getInstance();
+ return app.proxy == null ? (app.proxy = app.newProxy()) : app.proxy;
+ }
+
+ private HttpProxyCacheServer newProxy() {
+ return new HttpProxyCacheServer(this);
+ }
+
}
diff --git a/app/src/main/java/com/aserbao/androidcustomcamera/base/activity/BaseActivity.java b/app/src/main/java/com/aserbao/androidcustomcamera/base/activity/BaseActivity.java
index a1c9fe9..99f4259 100644
--- a/app/src/main/java/com/aserbao/androidcustomcamera/base/activity/BaseActivity.java
+++ b/app/src/main/java/com/aserbao/androidcustomcamera/base/activity/BaseActivity.java
@@ -30,7 +30,7 @@ public void onCreate(Bundle savedInstanceState) {
initView();
}
- private void startRequestPermission() {
+ protected void startRequestPermission() {
ActivityCompat.requestPermissions(this,BASIC_PERMISSIONS,123);
}
public void initView(){
diff --git a/app/src/main/java/com/aserbao/androidcustomcamera/base/activity/RVBaseActivity.java b/app/src/main/java/com/aserbao/androidcustomcamera/base/activity/RVBaseActivity.java
index a03f1d9..2f9b7d2 100644
--- a/app/src/main/java/com/aserbao/androidcustomcamera/base/activity/RVBaseActivity.java
+++ b/app/src/main/java/com/aserbao/androidcustomcamera/base/activity/RVBaseActivity.java
@@ -7,7 +7,9 @@
import com.aserbao.androidcustomcamera.R;
import com.aserbao.androidcustomcamera.base.adapter.CommonAdapter;
-import com.aserbao.androidcustomcamera.base.beans.ClassBean;
+import com.aserbao.androidcustomcamera.base.beans.BaseRecyclerBean;
+import com.aserbao.androidcustomcamera.base.utils.APermissionUtils;
+import com.aserbao.androidcustomcamera.base.viewHolder.IBaseRecyclerItemClickListener;
import java.util.ArrayList;
import java.util.List;
@@ -15,29 +17,31 @@
import butterknife.BindView;
import butterknife.ButterKnife;
-public abstract class RVBaseActivity extends AppCompatActivity {
-
+public abstract class RVBaseActivity extends AppCompatActivity implements IBaseRecyclerItemClickListener {
+ public final String TAG = this.getClass().getCanonicalName();
@BindView(R.id.base_rv)
- RecyclerView mBaseRv;
+ public RecyclerView mBaseRv;
public CommonAdapter mCommonAdapter;
public LinearLayoutManager mLinearLayoutManager;
- public List mClassBeans;
+ public List mBaseRecyclerBeen = new ArrayList<>();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_base);
ButterKnife.bind(this);
- mClassBeans = new ArrayList<>();
+ initGetData();
initView();
}
+ protected abstract void initGetData();
+
+
protected void initView() {
- mCommonAdapter = new CommonAdapter(this, this, initData());
+ mCommonAdapter = new CommonAdapter(this, this, mBaseRecyclerBeen,this);
mLinearLayoutManager = new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false);
mBaseRv.setLayoutManager(mLinearLayoutManager);
mBaseRv.setAdapter(mCommonAdapter);
+ APermissionUtils.checkPermission(this);
}
-
- public abstract List initData();
}
diff --git a/app/src/main/java/com/aserbao/androidcustomcamera/base/adapter/CommonAdapter.java b/app/src/main/java/com/aserbao/androidcustomcamera/base/adapter/CommonAdapter.java
index 69b9df3..2d4b539 100644
--- a/app/src/main/java/com/aserbao/androidcustomcamera/base/adapter/CommonAdapter.java
+++ b/app/src/main/java/com/aserbao/androidcustomcamera/base/adapter/CommonAdapter.java
@@ -10,7 +10,10 @@
import android.widget.Button;
import com.aserbao.androidcustomcamera.R;
-import com.aserbao.androidcustomcamera.base.beans.ClassBean;
+import com.aserbao.androidcustomcamera.base.beans.BaseRecyclerBean;
+import com.aserbao.androidcustomcamera.base.utils.StaticFinalValues;
+import com.aserbao.androidcustomcamera.base.viewHolder.IBaseRecyclerItemClickListener;
+import com.aserbao.androidcustomcamera.base.viewHolder.TextViewHolder;
import java.util.ArrayList;
import java.util.List;
@@ -23,53 +26,59 @@
* Created by aserbao on 2018/5/4.
*/
-public class CommonAdapter extends RecyclerView.Adapter {
+public class CommonAdapter extends RecyclerView.Adapter {
private Context mContext;
private Activity mActivity;
- private List mClassBeen = new ArrayList<>();
-
- public CommonAdapter(Context context, Activity activity, List classBeen) {
+ private List mBaseRecyclerBean = new ArrayList<>();
+ protected IBaseRecyclerItemClickListener mIBaseRecyclerItemClickListener;
+ public CommonAdapter(Context context, Activity activity, List classBeen,IBaseRecyclerItemClickListener listener) {
mContext = context;
mActivity = activity;
- mClassBeen = classBeen;
+ mBaseRecyclerBean = classBeen;
+ mIBaseRecyclerItemClickListener = listener;
}
@Override
- public CommonViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
- View view = LayoutInflater.from(mContext).inflate(R.layout.common_item, parent, false);
- return new CommonViewHolder(view);
+ public int getItemViewType(int position) {
+ if (mBaseRecyclerBean != null ){
+ return mBaseRecyclerBean.get(position % mBaseRecyclerBean.size()).getViewType();
+ }
+ return StaticFinalValues.VIEW_HOLDER_TEXT;
}
@Override
- public void onBindViewHolder(CommonViewHolder holder, int position) {
- if(mClassBeen != null && position < mClassBeen.size()) {
- final ClassBean classBean = mClassBeen.get(position);
- holder.mBtnItemCommon.setText(classBean.getName());
- holder.mBtnItemCommon.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- mActivity.startActivity(new Intent(mActivity, classBean.getClazz()));
- }
- });
+ public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
+ View view;
+ switch (viewType){
+ case StaticFinalValues.VIEW_HOLDER_CLASS:
+ view = LayoutInflater.from(mContext).inflate(R.layout.common_item, parent, false);
+ return new CommonViewHolder(view);
+ case StaticFinalValues.VIEW_HOLDER_TEXT:
+ view = LayoutInflater.from(mContext).inflate(R.layout.base_recycler_view_text_item, parent, false);
+ return new TextViewHolder(view);
+ }
+ return null;
+ }
+
+ @Override
+ public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
+ final BaseRecyclerBean classBean = mBaseRecyclerBean.get(position % mBaseRecyclerBean.size());
+ if (holder instanceof TextViewHolder) {
+ ((TextViewHolder) holder).setDataSource(classBean,holder.getAdapterPosition(),mIBaseRecyclerItemClickListener);
+ }else if (holder instanceof CommonViewHolder){
+ ((CommonViewHolder) holder).setDataSource(classBean,mActivity);
}
}
@Override
public int getItemCount() {
int ret = 0;
- if (mClassBeen.size() > 0) {
- ret = mClassBeen.size();
+ if (mBaseRecyclerBean.size() > 0) {
+ ret = mBaseRecyclerBean.size();
}
return ret;
}
- public static class CommonViewHolder extends RecyclerView.ViewHolder {
- @BindView(R.id.btn_item_common)
- Button mBtnItemCommon;
- public CommonViewHolder(View itemView) {
- super(itemView);
- ButterKnife.bind(this, itemView);
- }
- }
+
}
diff --git a/app/src/main/java/com/aserbao/androidcustomcamera/base/adapter/CommonViewHolder.java b/app/src/main/java/com/aserbao/androidcustomcamera/base/adapter/CommonViewHolder.java
new file mode 100644
index 0000000..70089d2
--- /dev/null
+++ b/app/src/main/java/com/aserbao/androidcustomcamera/base/adapter/CommonViewHolder.java
@@ -0,0 +1,44 @@
+package com.aserbao.androidcustomcamera.base.adapter;
+
+import android.app.Activity;
+import android.content.Intent;
+import android.support.v7.widget.RecyclerView;
+import android.view.View;
+import android.widget.Button;
+
+import com.aserbao.androidcustomcamera.R;
+import com.aserbao.androidcustomcamera.base.beans.BaseRecyclerBean;
+
+import butterknife.BindView;
+import butterknife.ButterKnife;
+
+/**
+ * 功能:
+ *
+ * @author aserbao
+ * @date : On 2020-01-15 17:32
+ * @project:AndroidCamera
+ * @package:com.aserbao.androidcustomcamera.base.adapter
+ */
+public class CommonViewHolder extends RecyclerView.ViewHolder {
+ @BindView(R.id.btn_item_common)
+ Button mBtnItemCommon;
+ private Activity mActivity;
+ private BaseRecyclerBean mClassBean;
+ public CommonViewHolder(View itemView) {
+ super(itemView);
+ ButterKnife.bind(this, itemView);
+ }
+
+ public void setDataSource(BaseRecyclerBean classBean,Activity activity){
+ mActivity = activity;
+ mClassBean = classBean;
+ mBtnItemCommon.setText(classBean.getName());
+ mBtnItemCommon.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ mActivity.startActivity(new Intent(mActivity, mClassBean.getClazz()));
+ }
+ });
+ }
+}
diff --git a/app/src/main/java/com/aserbao/androidcustomcamera/base/beans/BaseRecyclerBean.java b/app/src/main/java/com/aserbao/androidcustomcamera/base/beans/BaseRecyclerBean.java
new file mode 100644
index 0000000..50d2311
--- /dev/null
+++ b/app/src/main/java/com/aserbao/androidcustomcamera/base/beans/BaseRecyclerBean.java
@@ -0,0 +1,69 @@
+package com.aserbao.androidcustomcamera.base.beans;
+
+import com.aserbao.androidcustomcamera.base.utils.StaticFinalValues;
+
+/**
+ * description:
+ * Created by aserbao on 2018/1/25.
+ */
+
+
+public class BaseRecyclerBean {
+ private String name;
+ String extra_info; //补充信息
+ int tag = -1; //标记
+ private Class> clazz;
+ int viewType = StaticFinalValues.VIEW_HOLDER_TEXT;
+
+ public BaseRecyclerBean(String name, int tag) {
+ this.name = name;
+ this.tag = tag;
+ this.viewType = StaticFinalValues.VIEW_HOLDER_TEXT;
+ }
+
+ public BaseRecyclerBean(String name, Class> clazz) {
+ this.name = name;
+ this.clazz = clazz;
+ this.viewType = StaticFinalValues.VIEW_HOLDER_CLASS;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public Class> getClazz() {
+ return clazz;
+ }
+
+ public void setClazz(Class> clazz) {
+ this.clazz = clazz;
+ }
+
+ public String getExtra_info() {
+ return extra_info;
+ }
+
+ public void setExtra_info(String extra_info) {
+ this.extra_info = extra_info;
+ }
+
+ public int getTag() {
+ return tag;
+ }
+
+ public void setTag(int tag) {
+ this.tag = tag;
+ }
+
+ public int getViewType() {
+ return viewType;
+ }
+
+ public void setViewType(int viewType) {
+ this.viewType = viewType;
+ }
+}
diff --git a/app/src/main/java/com/aserbao/androidcustomcamera/base/beans/ClassBean.java b/app/src/main/java/com/aserbao/androidcustomcamera/base/beans/ClassBean.java
deleted file mode 100644
index e783efd..0000000
--- a/app/src/main/java/com/aserbao/androidcustomcamera/base/beans/ClassBean.java
+++ /dev/null
@@ -1,33 +0,0 @@
-package com.aserbao.androidcustomcamera.base.beans;
-
-/**
- * description:
- * Created by aserbao on 2018/1/25.
- */
-
-
-public class ClassBean {
- private String name;
- private Class> clazz;
-
- public ClassBean(String name, Class> clazz) {
- this.name = name;
- this.clazz = clazz;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public Class> getClazz() {
- return clazz;
- }
-
- public void setClazz(Class> clazz) {
- this.clazz = clazz;
- }
-}
diff --git a/app/src/main/java/com/aserbao/androidcustomcamera/base/interfaces/IDetailCallBackListener.java b/app/src/main/java/com/aserbao/androidcustomcamera/base/interfaces/IDetailCallBackListener.java
new file mode 100644
index 0000000..17ee542
--- /dev/null
+++ b/app/src/main/java/com/aserbao/androidcustomcamera/base/interfaces/IDetailCallBackListener.java
@@ -0,0 +1,16 @@
+package com.aserbao.androidcustomcamera.base.interfaces;
+
+/**
+ * 功能:
+ *
+ * @author aserbao
+ * @date : On 2019/1/3 7:02 PM
+ * @email: 1142803753@qq.com
+ * @project:AndroidCamera
+ * @package:com.aserbao.androidcustomcamera.base.interfaces
+ * @Copyright: 个人版权所有
+ */
+public interface IDetailCallBackListener {
+ void success();
+ void failed(Exception e);
+}
diff --git a/app/src/main/java/com/aserbao/androidcustomcamera/base/utils/APermissionUtils.java b/app/src/main/java/com/aserbao/androidcustomcamera/base/utils/APermissionUtils.java
new file mode 100644
index 0000000..cb32e59
--- /dev/null
+++ b/app/src/main/java/com/aserbao/androidcustomcamera/base/utils/APermissionUtils.java
@@ -0,0 +1,42 @@
+package com.aserbao.androidcustomcamera.base.utils;
+
+import android.Manifest;
+import android.app.Activity;
+import android.content.pm.PackageManager;
+import android.support.v4.app.ActivityCompat;
+import android.support.v4.content.ContextCompat;
+import android.util.Log;
+
+/**
+ * 功能:
+ *
+ * @author aserbao
+ * @date : On 2019/1/4 5:37 PM
+ * @email: 1142803753@qq.com
+ * @project:AndroidCamera
+ * @package:com.aserbao.androidcustomcamera.base.utils
+ * @Copyright: 个人版权所有
+ */
+public class APermissionUtils {
+
+ public static final String[] BASIC_PERMISSIONS = new String[]{
+ Manifest.permission.WRITE_EXTERNAL_STORAGE,
+ Manifest.permission.CAMERA,
+ Manifest.permission.RECORD_AUDIO,
+ };
+
+ /**
+ * 检测权限
+ * @param activity
+ */
+ public static void checkPermission(Activity activity) {
+ ActivityCompat.requestPermissions(activity, BASIC_PERMISSIONS, 1);
+ // TODO: 2019/1/4 之后再完善权限请求
+ /*for (String basicPermission : BASIC_PERMISSIONS) {
+ Log.e("wer", "checkPermission: " );
+ if (ContextCompat.checkSelfPermission(activity, basicPermission) != PackageManager.PERMISSION_GRANTED) {
+ ActivityCompat.requestPermissions(activity, new String[]{basicPermission}, 1);
+ }
+ }*/
+ }
+}
diff --git a/app/src/main/java/com/aserbao/androidcustomcamera/base/utils/CommonUtils.java b/app/src/main/java/com/aserbao/androidcustomcamera/base/utils/CommonUtils.java
new file mode 100644
index 0000000..e526858
--- /dev/null
+++ b/app/src/main/java/com/aserbao/androidcustomcamera/base/utils/CommonUtils.java
@@ -0,0 +1,103 @@
+package com.aserbao.androidcustomcamera.base.utils;
+
+import android.graphics.Bitmap;
+import android.graphics.Canvas;
+import android.graphics.Color;
+import android.graphics.Paint;
+import android.text.Layout;
+import android.text.StaticLayout;
+import android.text.TextPaint;
+
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * Created by Administrator on 2017/4/21.
+ */
+
+public class CommonUtils {
+
+
+ /**
+ * 判断是否为电话号码的正则表达式
+ *
+ * @param phoneNumber
+ * @return
+ */
+ public static boolean isPhoneNumberValid(String phoneNumber) {
+ boolean isValid = false;
+ /*
+ * 可接受的电话格式有:
+ */
+ String expression = "^((13[0-9])|(15[^4,\\D])|(18[0-9]))\\d{8}$";
+
+ CharSequence inputStr = phoneNumber;
+ Pattern pattern = Pattern.compile(expression);
+ Matcher matcher = pattern.matcher(inputStr);
+
+ if (matcher.matches()) {
+ isValid = true;
+ }
+ return isValid;
+ }
+
+
+
+ //将文本转换成Bitmap
+ public static Bitmap textAsBitmap(String text, float textSize) {
+
+ TextPaint textPaint = new TextPaint();
+
+ // textPaint.setARGB(0x31, 0x31, 0x31, 0);
+ textPaint.setColor(Color.WHITE);
+
+ textPaint.setTextSize(textSize);
+
+ StaticLayout layout = new StaticLayout(text, textPaint, getTextWidth(textPaint,text),
+ Layout.Alignment.ALIGN_NORMAL, 1.3f, 0.0f, true);
+ Bitmap bitmap = Bitmap.createBitmap(layout.getWidth() + 20,
+ layout.getHeight() + 20, Bitmap.Config.ARGB_8888);
+ Canvas canvas = new Canvas(bitmap);
+ canvas.translate(10, 10);
+// canvas.drawColor(0xFF31306B);
+ canvas.drawColor(0x00000000);
+
+ layout.draw(canvas);
+ return bitmap;
+ }
+
+
+
+ public static int getTextWidth(Paint paint, String str) {
+ int iRet = 0;
+ if (str != null && str.length() > 0) {
+ int len = str.length();
+ float[] widths = new float[len];
+ paint.getTextWidths(str, widths);
+ for (int j = 0; j < len; j++) {
+ iRet += (int) Math.ceil(widths[j]);
+ }
+ }
+ return iRet;
+ }
+
+
+ /**
+ * 计算分享内容的字数,一个汉字=两个英文字母,一个中文标点=两个英文标点 注意:该函数的不适用于对单个字符进行计算,因为单个字符四舍五入后都是1
+ *
+ * @param c
+ * @return
+ */
+ public static long calculateLength(CharSequence c) {
+ double len = 0;
+ for (int i = 0; i < c.length(); i++) {
+ int tmp = (int) c.charAt(i);
+ if (tmp > 0 && tmp < 127) {
+ len += 0.5;
+ } else {
+ len++;
+ }
+ }
+ return Math.round(len);
+ }
+}
diff --git a/app/src/main/java/com/aserbao/androidcustomcamera/base/utils/ConstantUtils.java b/app/src/main/java/com/aserbao/androidcustomcamera/base/utils/ConstantUtils.java
new file mode 100644
index 0000000..403025e
--- /dev/null
+++ b/app/src/main/java/com/aserbao/androidcustomcamera/base/utils/ConstantUtils.java
@@ -0,0 +1,25 @@
+package com.aserbao.androidcustomcamera.base.utils;
+
+import com.aserbao.androidcustomcamera.R;
+
+import java.util.Random;
+
+/**
+ * description:
+ * Created by aserbao on 2018/1/25.
+ */
+
+
+public class ConstantUtils {
+
+ public static int getDrawable(){
+ return drawables[new Random().nextInt(drawables.length)];
+ }
+ public static int[] drawables = {
+ R.drawable.emoji_00,
+ R.drawable.emoji_01,
+ R.drawable.emoji_02,
+ R.drawable.emoji_03,
+ R.drawable.emoji_04,
+ };
+}
diff --git a/app/src/main/java/com/aserbao/androidcustomcamera/base/utils/FlowLayout.java b/app/src/main/java/com/aserbao/androidcustomcamera/base/utils/FlowLayout.java
new file mode 100644
index 0000000..5c31cba
--- /dev/null
+++ b/app/src/main/java/com/aserbao/androidcustomcamera/base/utils/FlowLayout.java
@@ -0,0 +1,217 @@
+package com.aserbao.androidcustomcamera.base.utils;
+
+import android.content.Context;
+import android.content.res.TypedArray;
+import android.support.v4.text.TextUtilsCompat;
+import android.util.AttributeSet;
+import android.util.LayoutDirection;
+import android.view.View;
+import android.view.ViewGroup;
+
+import com.aserbao.androidcustomcamera.R;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Locale;
+
+public class FlowLayout extends ViewGroup {
+ private static final String TAG = "FlowLayout";
+ private static final int LEFT = -1;
+ private static final int CENTER = 0;
+ private static final int RIGHT = 1;
+
+ protected List> mAllViews = new ArrayList>();
+ protected List mLineHeight = new ArrayList();
+ protected List mLineWidth = new ArrayList();
+ private int mGravity;
+ private List lineViews = new ArrayList<>();
+
+ public FlowLayout(Context context, AttributeSet attrs, int defStyle) {
+ super(context, attrs, defStyle);
+ TypedArray ta = context.obtainStyledAttributes(attrs, R.styleable.TagFlowLayout);
+ mGravity = ta.getInt(R.styleable.TagFlowLayout_tag_gravity, LEFT);
+ int layoutDirection = TextUtilsCompat.getLayoutDirectionFromLocale(Locale.getDefault());
+ if (layoutDirection == LayoutDirection.RTL) {
+ if (mGravity == LEFT) {
+ mGravity = RIGHT;
+ } else {
+ mGravity = LEFT;
+ }
+ }
+ ta.recycle();
+ }
+
+ public FlowLayout(Context context, AttributeSet attrs) {
+ this(context, attrs, 0);
+ }
+
+ public FlowLayout(Context context) {
+ this(context, null);
+ }
+
+ @Override
+ protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
+ int sizeWidth = MeasureSpec.getSize(widthMeasureSpec);
+ int modeWidth = MeasureSpec.getMode(widthMeasureSpec);
+ int sizeHeight = MeasureSpec.getSize(heightMeasureSpec);
+ int modeHeight = MeasureSpec.getMode(heightMeasureSpec);
+
+ // wrap_content
+ int width = 0;
+ int height = 0;
+
+ int lineWidth = 0;
+ int lineHeight = 0;
+
+ int cCount = getChildCount();
+
+ for (int i = 0; i < cCount; i++) {
+ View child = getChildAt(i);
+ if (child.getVisibility() == View.GONE) {
+ if (i == cCount - 1) {
+ width = Math.max(lineWidth, width);
+ height += lineHeight;
+ }
+ continue;
+ }
+ measureChild(child, widthMeasureSpec, heightMeasureSpec);
+ MarginLayoutParams lp = (MarginLayoutParams) child
+ .getLayoutParams();
+
+ int childWidth = child.getMeasuredWidth() + lp.leftMargin
+ + lp.rightMargin;
+ int childHeight = child.getMeasuredHeight() + lp.topMargin
+ + lp.bottomMargin;
+
+ if (lineWidth + childWidth > sizeWidth - getPaddingLeft() - getPaddingRight()) {
+ width = Math.max(width, lineWidth);
+ lineWidth = childWidth;
+ height += lineHeight;
+ lineHeight = childHeight;
+ } else {
+ lineWidth += childWidth;
+ lineHeight = Math.max(lineHeight, childHeight);
+ }
+ if (i == cCount - 1) {
+ width = Math.max(lineWidth, width);
+ height += lineHeight;
+ }
+ }
+ setMeasuredDimension(
+ //
+ modeWidth == MeasureSpec.EXACTLY ? sizeWidth : width + getPaddingLeft() + getPaddingRight(),
+ modeHeight == MeasureSpec.EXACTLY ? sizeHeight : height + getPaddingTop() + getPaddingBottom()//
+ );
+
+ }
+
+
+ @Override
+ protected void onLayout(boolean changed, int l, int t, int r, int b) {
+ mAllViews.clear();
+ mLineHeight.clear();
+ mLineWidth.clear();
+ lineViews.clear();
+
+ int width = getWidth();
+
+ int lineWidth = 0;
+ int lineHeight = 0;
+
+ int cCount = getChildCount();
+
+ for (int i = 0; i < cCount; i++) {
+ View child = getChildAt(i);
+ if (child.getVisibility() == View.GONE) continue;
+ MarginLayoutParams lp = (MarginLayoutParams) child
+ .getLayoutParams();
+
+ int childWidth = child.getMeasuredWidth();
+ int childHeight = child.getMeasuredHeight();
+
+ if (childWidth + lineWidth + lp.leftMargin + lp.rightMargin > width - getPaddingLeft() - getPaddingRight()) {
+ mLineHeight.add(lineHeight);
+ mAllViews.add(lineViews);
+ mLineWidth.add(lineWidth);
+
+ lineWidth = 0;
+ lineHeight = childHeight + lp.topMargin + lp.bottomMargin;
+ lineViews = new ArrayList();
+ }
+ lineWidth += childWidth + lp.leftMargin + lp.rightMargin;
+ lineHeight = Math.max(lineHeight, childHeight + lp.topMargin
+ + lp.bottomMargin);
+ lineViews.add(child);
+
+ }
+ mLineHeight.add(lineHeight);
+ mLineWidth.add(lineWidth);
+ mAllViews.add(lineViews);
+
+
+ int left = getPaddingLeft();
+ int top = getPaddingTop();
+
+ int lineNum = mAllViews.size();
+
+ for (int i = 0; i < lineNum; i++) {
+ lineViews = mAllViews.get(i);
+ lineHeight = mLineHeight.get(i);
+
+ // set gravity
+ int currentLineWidth = this.mLineWidth.get(i);
+ switch (this.mGravity) {
+ case LEFT:
+ left = getPaddingLeft();
+ break;
+ case CENTER:
+ left = (width - currentLineWidth) / 2 + getPaddingLeft();
+ break;
+ case RIGHT:
+ // 适配了rtl,需要补偿一个padding值
+ left = width - (currentLineWidth + getPaddingLeft()) - getPaddingRight();
+ // 适配了rtl,需要把lineViews里面的数组倒序排
+ Collections.reverse(lineViews);
+ break;
+ }
+
+ for (int j = 0; j < lineViews.size(); j++) {
+ View child = lineViews.get(j);
+ if (child.getVisibility() == View.GONE) {
+ continue;
+ }
+
+ MarginLayoutParams lp = (MarginLayoutParams) child
+ .getLayoutParams();
+
+ int lc = left + lp.leftMargin;
+ int tc = top + lp.topMargin;
+ int rc = lc + child.getMeasuredWidth();
+ int bc = tc + child.getMeasuredHeight();
+
+ child.layout(lc, tc, rc, bc);
+
+ left += child.getMeasuredWidth() + lp.leftMargin
+ + lp.rightMargin;
+ }
+ top += lineHeight;
+ }
+
+ }
+
+ @Override
+ public LayoutParams generateLayoutParams(AttributeSet attrs) {
+ return new MarginLayoutParams(getContext(), attrs);
+ }
+
+ @Override
+ protected LayoutParams generateDefaultLayoutParams() {
+ return new MarginLayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
+ }
+
+ @Override
+ protected LayoutParams generateLayoutParams(LayoutParams p) {
+ return new MarginLayoutParams(p);
+ }
+}
diff --git a/app/src/main/java/com/aserbao/androidcustomcamera/base/utils/StaticFinalValues.java b/app/src/main/java/com/aserbao/androidcustomcamera/base/utils/StaticFinalValues.java
index 07f7d82..3d430a8 100644
--- a/app/src/main/java/com/aserbao/androidcustomcamera/base/utils/StaticFinalValues.java
+++ b/app/src/main/java/com/aserbao/androidcustomcamera/base/utils/StaticFinalValues.java
@@ -1,5 +1,9 @@
package com.aserbao.androidcustomcamera.base.utils;
+import android.os.Environment;
+
+import com.aserbao.androidcustomcamera.whole.record.other.MagicFilterType;
+
/**
* description:
* Created by aserbao on 2018/5/15.
@@ -10,8 +14,53 @@ public class StaticFinalValues {
//int final
public static final int RECORD_MIN_TIME = 5 * 1000;
//=======================handler
+ public static final int EMPTY = 0;
public static final int DELAY_DETAL = 1;
public static final int MY_TOPIC_ADAPTER = 9;
public static final int CHANGE_IMAGE = 10;
public static final int OVER_CLICK = 11;//视频定时结束
+ //================================================path
+ public static final String SAVETOPHOTOPATH = "/storage/emulated/0/DCIM/Camera/";//保存至本地相册路径
+ public static final String ISSAVEVIDEOTEMPEXIST = "/storage/emulated/0/aserbaoCamera/";
+ public static final String VIDEOTEMP = "/storage/emulated/0/aserbaoCamera/videotemp/";
+ public static final String STORAGE_TEMP_VIDEO_PATH = Environment.getExternalStorageDirectory().getAbsolutePath() + "/123.mp4";
+ public static final String STORAGE_TEMP_VIDEO_PATH1 = Environment.getExternalStorageDirectory().getAbsolutePath() + "/1233.mp4";
+
+ //======================string
+ public static final String MAX_NUMBER = "MaxNumber";
+ public static final String RESULT_PICK_VIDEO = "ResultPickVideo";
+ public static final String VIDEOFILEPATH = "VideoFilePath";
+ public static final String MISNOTCOMELOCAL = "mIsNotComeLocal";//0表示本地视频,1表示非本地视频
+ public static final String BUNDLE = "bundle";
+ public static final String CUT_TIME = "cut_time";
+
+ private static final String VIDEO_PATH = "video_path";
+
+ //-------------type---------------
+ public static final int VIEW_HOLDER_HEAD = 99;
+ public static final int VIEW_HOLDER_TEXT = 100;
+ public static final int VIEW_HOLDER_IMAGE_100H = 101;
+ public static final int VIEW_HOLDER_CIRCLE_IMAGE_ITEM = 1001;
+ public static final int VIEW_FULL_IMAGE_ITEM = 1002;
+ public static final int VIEW_HOLDER_CLASS = 102;
+ public static final int VIEW_BLEND_MODE = 103;
+
+ //=======================requestCode and resultCode
+ public static final int COMR_FROM_SEL_COVER_TIME_ACTIVITY = 1;
+ public static final int COMR_FROM_VIDEO_EDIT_TIME_ACTIVITY = 2;
+ //======================int
+ public static final int REQUEST_CODE_PICK_VIDEO = 0x200;
+ public static final int REQUEST_CODE_TAKE_VIDEO = 0x201;
+ public static float VIDEO_WIDTH_HEIGHT = 0.85f;
+
+
+ //滤镜效果
+ public static MagicFilterType[] types = new MagicFilterType[]{
+ MagicFilterType.NONE,
+ MagicFilterType.WARM,
+ MagicFilterType.COOL,//淡雅
+ MagicFilterType.HUDSON,//粉嫩
+ MagicFilterType.WARM,
+ MagicFilterType.N1977,//红润
+ };
}
diff --git a/app/src/main/java/com/aserbao/androidcustomcamera/base/utils/StatusBarUtil.java b/app/src/main/java/com/aserbao/androidcustomcamera/base/utils/StatusBarUtil.java
new file mode 100644
index 0000000..c669cdf
--- /dev/null
+++ b/app/src/main/java/com/aserbao/androidcustomcamera/base/utils/StatusBarUtil.java
@@ -0,0 +1,192 @@
+package com.aserbao.androidcustomcamera.base.utils;
+
+import android.annotation.TargetApi;
+import android.app.Activity;
+import android.graphics.Color;
+import android.os.Build;
+import android.view.View;
+import android.view.Window;
+import android.view.WindowManager;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+
+/**
+ * http://blog.csdn.net/fkq_2016/article/details/77967157?locationNum=9&fps=1
+ * Created by Administrator on 2017/12/18.
+ */
+
+public class StatusBarUtil {
+
+ /**
+ * 修改状态栏为全透明
+ * @param activity
+ */
+ @TargetApi(19)
+ public static void transparencyBar(Activity activity){
+ if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
+ Window window = activity.getWindow();
+ window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
+ window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
+ | View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
+ window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
+ window.setStatusBarColor(Color.TRANSPARENT);
+
+ } else
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
+ Window window =activity.getWindow();
+ window.setFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS,
+ WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
+ }
+ }
+
+ /**
+ * 修改状态栏颜色,支持4.4以上版本
+ * @param activity
+ * @param colorId
+ */
+ public static void setStatusBarColor(Activity activity, int colorId) {
+
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
+ Window window = activity.getWindow();
+// window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
+ window.setStatusBarColor(activity.getResources().getColor(colorId));
+ }
+// } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
+// //使用SystemBarTint库使4.4版本状态栏变色,需要先将状态栏设置为透明
+// transparencyBar(activity);
+// SystemBarTintManager tintManager = new SystemBarTintManager(activity);
+// tintManager.setStatusBarTintEnabled(true);
+// tintManager.setStatusBarTintResource(colorId);
+// }
+ }
+
+ /**
+ *状态栏亮色模式,设置状态栏黑色文字、图标,
+ * 适配4.4以上版本MIUIV、Flyme和6.0以上版本其他Android
+ * @param activity
+ * @return 1:MIUUI 2:Flyme 3:android6.0
+ */
+ public static int StatusBarLightMode(Activity activity){
+ int result=0;
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
+ if(MIUISetStatusBarLightMode(activity, true)){
+ result=1;
+ }else if(FlymeSetStatusBarLightMode(activity.getWindow(), true)){
+ result=2;
+ }else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
+ activity.getWindow().getDecorView().setSystemUiVisibility( View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN| View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
+ result=3;
+ }
+ }
+ return result;
+ }
+
+ /**
+ * 已知系统类型时,设置状态栏黑色文字、图标。
+ * 适配4.4以上版本MIUIV、Flyme和6.0以上版本其他Android
+ * @param activity
+ * @param type 1:MIUUI 2:Flyme 3:android6.0
+ */
+ public static void StatusBarLightMode(Activity activity, int type){
+ if(type==1){
+ MIUISetStatusBarLightMode(activity, true);
+ }else if(type==2){
+ FlymeSetStatusBarLightMode(activity.getWindow(), true);
+ }else if(type==3){
+ activity.getWindow().getDecorView().setSystemUiVisibility( View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN| View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
+ }
+
+ }
+
+ /**
+ * 状态栏暗色模式,清除MIUI、flyme或6.0以上版本状态栏黑色文字、图标
+ */
+ public static void StatusBarDarkMode(Activity activity, int type){
+ if(type==1){
+ MIUISetStatusBarLightMode(activity, false);
+ }else if(type==2){
+ FlymeSetStatusBarLightMode(activity.getWindow(), false);
+ }else if(type==3){
+ activity.getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_VISIBLE);
+ }
+
+ }
+
+
+ /**
+ * 设置状态栏图标为深色和魅族特定的文字风格
+ * 可以用来判断是否为Flyme用户
+ * @param window 需要设置的窗口
+ * @param dark 是否把状态栏文字及图标颜色设置为深色
+ * @return boolean 成功执行返回true
+ *
+ */
+ public static boolean FlymeSetStatusBarLightMode(Window window, boolean dark) {
+ boolean result = false;
+ if (window != null) {
+ try {
+ WindowManager.LayoutParams lp = window.getAttributes();
+ Field darkFlag = WindowManager.LayoutParams.class
+ .getDeclaredField("MEIZU_FLAG_DARK_STATUS_BAR_ICON");
+ Field meizuFlags = WindowManager.LayoutParams.class
+ .getDeclaredField("meizuFlags");
+ darkFlag.setAccessible(true);
+ meizuFlags.setAccessible(true);
+ int bit = darkFlag.getInt(null);
+ int value = meizuFlags.getInt(lp);
+ if (dark) {
+ value |= bit;
+ } else {
+ value &= ~bit;
+ }
+ meizuFlags.setInt(lp, value);
+ window.setAttributes(lp);
+ result = true;
+ } catch (Exception e) {
+
+ }
+ }
+ return result;
+ }
+
+ /**
+ * 需要MIUIV6以上
+ * @param activity
+ * @param dark 是否把状态栏文字及图标颜色设置为深色
+ * @return boolean 成功执行返回true
+ *
+ */
+ public static boolean MIUISetStatusBarLightMode(Activity activity, boolean dark) {
+ boolean result = false;
+ Window window=activity.getWindow();
+ if (window != null) {
+ Class clazz = window.getClass();
+ try {
+ int darkModeFlag = 0;
+ Class layoutParams = Class.forName("android.view.MiuiWindowManager$LayoutParams");
+ Field field = layoutParams.getField("EXTRA_FLAG_STATUS_BAR_DARK_MODE");
+ darkModeFlag = field.getInt(layoutParams);
+ Method extraFlagField = clazz.getMethod("setExtraFlags", int.class, int.class);
+ if(dark){
+ extraFlagField.invoke(window,darkModeFlag,darkModeFlag);//状态栏透明且黑色字体
+ }else{
+ extraFlagField.invoke(window, 0, darkModeFlag);//清除黑色字体
+ }
+ result=true;
+
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
+ //开发版 7.7.13 及以后版本采用了系统API,旧方法无效但不会报错,所以两个方式都要加上
+ if(dark){
+ activity.getWindow().getDecorView().setSystemUiVisibility( View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN| View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
+ }else {
+ activity.getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_VISIBLE);
+ }
+ }
+ }catch (Exception e){
+
+ }
+ }
+ return result;
+ }
+}
diff --git a/app/src/main/java/com/aserbao/androidcustomcamera/base/viewHolder/BaseClickViewHolder.java b/app/src/main/java/com/aserbao/androidcustomcamera/base/viewHolder/BaseClickViewHolder.java
new file mode 100644
index 0000000..78482d1
--- /dev/null
+++ b/app/src/main/java/com/aserbao/androidcustomcamera/base/viewHolder/BaseClickViewHolder.java
@@ -0,0 +1,65 @@
+package com.aserbao.androidcustomcamera.base.viewHolder;
+
+import android.support.annotation.NonNull;
+import android.support.v7.widget.RecyclerView;
+import android.view.View;
+
+import butterknife.ButterKnife;
+
+/**
+ * 功能:
+ *
+ * @author aserbao
+ * @date : On 2019-08-16 15:39
+ * @project:AserbaosAndroid
+ * @package:com.aserbao.aserbaosandroid.base.viewHolder
+ */
+public class BaseClickViewHolder extends RecyclerView.ViewHolder {
+
+ public static final int COME_FROM_RV_ITEM = 0;
+
+ public BaseClickViewHolder(@NonNull View itemView) {
+ super(itemView);
+ ButterKnife.bind(this,itemView);
+ }
+
+ public void setDataSource(final int position, final IBaseRecyclerItemClickListener mIBaseRecyclerItemClickListener){
+ itemView.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ int tempFlag = getTempFlag(v, position);
+ if (mIBaseRecyclerItemClickListener != null) {
+ mIBaseRecyclerItemClickListener.itemClickBack(v, tempFlag,false, COME_FROM_RV_ITEM);
+ }
+ }
+ });
+
+ itemView.setOnLongClickListener(new View.OnLongClickListener() {
+ @Override
+ public boolean onLongClick(View v) {
+ int tempFlag = getTempFlag(v, position);
+ if (mIBaseRecyclerItemClickListener != null) {
+ mIBaseRecyclerItemClickListener.itemClickBack(v, tempFlag,true, COME_FROM_RV_ITEM);
+ }
+ return true;
+ }
+ });
+ }
+
+ private int getTempFlag(View v, int position) {
+ int tempFlag = 0;
+ Object viewTag = v.getTag();
+ if (viewTag instanceof Integer) {
+ int tag = (int) viewTag;
+ if (tag >= 0) {
+ tempFlag = tag;
+ } else {
+ tempFlag = position;
+ }
+ } else {
+ tempFlag = position;
+ }
+ return tempFlag;
+ }
+
+}
diff --git a/app/src/main/java/com/aserbao/androidcustomcamera/base/viewHolder/IBaseRecyclerItemClickListener.java b/app/src/main/java/com/aserbao/androidcustomcamera/base/viewHolder/IBaseRecyclerItemClickListener.java
new file mode 100644
index 0000000..a813460
--- /dev/null
+++ b/app/src/main/java/com/aserbao/androidcustomcamera/base/viewHolder/IBaseRecyclerItemClickListener.java
@@ -0,0 +1,17 @@
+package com.aserbao.androidcustomcamera.base.viewHolder;
+
+import android.view.View;
+
+/**
+ * 功能:
+ *
+ * @author aserbao
+ * @date : On 2019/2/19 4:53 PM
+ * @email: this is empty email
+ * @project:AserbaosAndroid
+ * @package:com.aserbao.aserbaosandroid.base.interfaces
+ */
+public interface IBaseRecyclerItemClickListener {
+ void itemClickBack(View view, int position, boolean isLongClick, int comeFrom);
+
+}
diff --git a/app/src/main/java/com/aserbao/androidcustomcamera/base/viewHolder/TextViewHolder.java b/app/src/main/java/com/aserbao/androidcustomcamera/base/viewHolder/TextViewHolder.java
new file mode 100644
index 0000000..5f8b291
--- /dev/null
+++ b/app/src/main/java/com/aserbao/androidcustomcamera/base/viewHolder/TextViewHolder.java
@@ -0,0 +1,34 @@
+package com.aserbao.androidcustomcamera.base.viewHolder;
+
+import android.view.View;
+import android.widget.TextView;
+
+import com.aserbao.androidcustomcamera.R;
+import com.aserbao.androidcustomcamera.base.beans.BaseRecyclerBean;
+
+import butterknife.BindView;
+import butterknife.ButterKnife;
+
+public class TextViewHolder extends BaseClickViewHolder {
+ @BindView(R.id.base_recycler_view_item_tv)
+ public TextView mBaseRecyclerViewItemTv;
+
+ public TextViewHolder(View itemView) {
+ super(itemView);
+ ButterKnife.bind(this, itemView);
+ }
+
+ public void setDataSource(BaseRecyclerBean classBean, int position, IBaseRecyclerItemClickListener mIBaseRecyclerItemClickListener){
+ super.setDataSource(position,mIBaseRecyclerItemClickListener);
+ int tag = classBean.getTag();
+ String name = classBean.getName();
+ if (tag >= 0) {
+ itemView.setTag(tag);
+ name = name + String.valueOf(tag);
+ } else {
+ name = name + String.valueOf(position);
+ }
+ mBaseRecyclerViewItemTv.setText(name);
+ }
+
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/aserbao/androidcustomcamera/blocks/BlocksActivity.java b/app/src/main/java/com/aserbao/androidcustomcamera/blocks/BlocksActivity.java
index 18083dd..551d937 100644
--- a/app/src/main/java/com/aserbao/androidcustomcamera/blocks/BlocksActivity.java
+++ b/app/src/main/java/com/aserbao/androidcustomcamera/blocks/BlocksActivity.java
@@ -1,16 +1,32 @@
package com.aserbao.androidcustomcamera.blocks;
+import android.view.View;
+
import com.aserbao.androidcustomcamera.base.activity.RVBaseActivity;
-import com.aserbao.androidcustomcamera.base.beans.ClassBean;
+import com.aserbao.androidcustomcamera.base.beans.BaseRecyclerBean;
+import com.aserbao.androidcustomcamera.blocks.audioRecord.AudioRecordActivity;
+import com.aserbao.androidcustomcamera.blocks.others.OthersActivity;
+import com.aserbao.androidcustomcamera.blocks.others.changeHue.ChangeHueActivity;
+import com.aserbao.androidcustomcamera.blocks.mediaExtractor.MediaExtractorActivity;
import com.aserbao.androidcustomcamera.blocks.mediaCodec.MediaCodecActivity;
-
-import java.util.List;
+import com.aserbao.androidcustomcamera.blocks.mediaMuxer.MediaMuxerActivity;
+import com.aserbao.androidcustomcamera.blocks.mediaMuxer.functions.CreateVideoAddAudioToMp4;
public class BlocksActivity extends RVBaseActivity {
+
@Override
- public List initData() {
- mClassBeans.add(new ClassBean("MediaCodec", MediaCodecActivity.class));
- return mClassBeans;
+ protected void initGetData() {
+ mBaseRecyclerBeen.add(new BaseRecyclerBean("修改hue", ChangeHueActivity.class));
+ mBaseRecyclerBeen.add(new BaseRecyclerBean("AudioRecord", AudioRecordActivity.class));
+ mBaseRecyclerBeen.add(new BaseRecyclerBean("MediaCodec", MediaCodecActivity.class));
+ mBaseRecyclerBeen.add(new BaseRecyclerBean("MediaExtractor", MediaExtractorActivity.class));
+ mBaseRecyclerBeen.add(new BaseRecyclerBean("MediaMuxer", MediaMuxerActivity.class));
+ mBaseRecyclerBeen.add(new BaseRecyclerBean("合成", CreateVideoAddAudioToMp4.class));
+ mBaseRecyclerBeen.add(new BaseRecyclerBean("其他", OthersActivity.class));
}
+ @Override
+ public void itemClickBack(View view, int position, boolean isLongClick, int comeFrom) {
+
+ }
}
diff --git a/app/src/main/java/com/aserbao/androidcustomcamera/blocks/atestcases/EncodeDecodeTest.java b/app/src/main/java/com/aserbao/androidcustomcamera/blocks/atestcases/EncodeDecodeTest.java
new file mode 100644
index 0000000..c47c091
--- /dev/null
+++ b/app/src/main/java/com/aserbao/androidcustomcamera/blocks/atestcases/EncodeDecodeTest.java
@@ -0,0 +1,993 @@
+/*
+ * Copyright (C) 2013 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.aserbao.androidcustomcamera.blocks.atestcases;
+import android.graphics.SurfaceTexture;
+import android.media.MediaCodec;
+import android.media.MediaCodecInfo;
+import android.media.MediaCodecList;
+import android.media.MediaFormat;
+import android.opengl.EGL14;
+import android.opengl.GLES20;
+import android.opengl.GLES11Ext;
+import android.opengl.GLSurfaceView;
+import android.opengl.Matrix;
+import android.os.Environment;
+import android.test.AndroidTestCase;
+import android.util.Log;
+import android.view.Surface;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
+import java.nio.FloatBuffer;
+import java.util.Arrays;
+import javax.microedition.khronos.egl.EGL10;
+import javax.microedition.khronos.egl.EGLConfig;
+import javax.microedition.khronos.egl.EGLContext;
+import javax.microedition.khronos.egl.EGLDisplay;
+import javax.microedition.khronos.egl.EGLSurface;
+import javax.microedition.khronos.opengles.GL;
+import javax.microedition.khronos.opengles.GL10;
+/**
+ * Generates a series of video frames, encodes them, decodes them, and tests for significant
+ * divergence from the original.
+ *
+ * There are two ways to connect an encoder to a decoder. The first is to pass the output
+ * buffers from the encoder to the input buffers of the decoder, using ByteBuffer.put() to
+ * copy the bytes. With this approach, we need to watch for BUFFER_FLAG_CODEC_CONFIG, and
+ * if seen we use format.setByteBuffer("csd-0") followed by decoder.configure() to pass the
+ * meta-data through.
+ *
+ * The second way is to write the buffers to a file and then stream it back in. With this
+ * approach it is necessary to use a MediaExtractor to retrieve the format info and skip past
+ * the meta-data.
+ *
+ * The former can be done entirely in memory, but requires that the encoder and decoder
+ * operate simultaneously (the I/O buffers are owned by MediaCodec). The latter requires
+ * writing to disk, because MediaExtractor can only accept a file or URL as a source.
+ *
+ * The direct encoder-to-decoder approach isn't currently tested elsewhere in this CTS
+ * package, so we use that here.
+ *
+ * @link https://android.googlesource.com/platform/cts/+/b04c81bfc2761b21293f9c095da38c757e570fd3/tests/tests/media/src/android/media/cts/EncodeDecodeTest.java
+ */
+public class EncodeDecodeTest extends AndroidTestCase {
+ private static final String TAG = "EncodeDecodeTest";
+ private static final boolean VERBOSE = false; // lots of logging
+ private static final boolean DEBUG_SAVE_FILE = false; // save copy of encoded movie
+ private static final String DEBUG_FILE_NAME_BASE = "/storage/emulated/0/";
+ // parameters for the encoder
+ private static final String MIME_TYPE = "video/avc"; // H.264 Advanced Video Coding
+ private static final int BIT_RATE = 1000000; // 1Mbps
+ private static final int FRAME_RATE = 15; // 15fps
+ private static final int IFRAME_INTERVAL = 10; // 10 seconds between I-frames
+ // movie length, in frames
+ private static final int NUM_FRAMES = 30; // two seconds of video
+ private static final int TEST_Y = 240; // YUV values for colored rect
+ private static final int TEST_U = 220;
+ private static final int TEST_V = 200;
+ private static final int TEST_R0 = 0; // RGB eqivalent of {0,0,0}
+ private static final int TEST_G0 = 136;
+ private static final int TEST_B0 = 0;
+ private static final int TEST_R1 = 255; // RGB equivalent of {240,220,200}
+ private static final int TEST_G1 = 166;
+ private static final int TEST_B1 = 255;
+ // size of a frame, in pixels
+ private int mWidth = -1;
+ private int mHeight = -1;
+ /**
+ * Tests streaming of AVC video through the encoder and decoder. Data is encoded from
+ * a series of byte[] buffers and decoded into ByteBuffers. The output is checked for
+ * validity.
+ */
+ public void testEncodeDecodeVideoFromBufferToBufferQCIF() throws Exception {
+ setSize(176, 144);
+ testEncodeDecodeVideoFromBuffer(false);
+ }
+ public void testEncodeDecodeVideoFromBufferToBufferQVGA() throws Exception {
+ setSize(320, 240);
+ testEncodeDecodeVideoFromBuffer(false);
+ }
+ public void testEncodeDecodeVideoFromBufferToBuffer720p() throws Exception {
+ setSize(1280, 720);
+ testEncodeDecodeVideoFromBuffer(false);
+ }
+ /**
+ * Tests streaming of AVC video through the encoder and decoder. Data is encoded from
+ * a series of byte[] buffers and decoded into Surfaces. The output is checked for
+ * validity but some frames may be dropped.
+ *
+ * Because of the way SurfaceTexture.OnFrameAvailableListener works, we need to run this
+ * test on a thread that doesn't have a Looper configured. If we don't, the test will
+ * pass, but we won't actually test the output because we'll never receive the "frame
+ * available" notifications". The CTS test framework seems to be configuring a Looper on
+ * the test thread, so we have to hand control off to a new thread for the duration of
+ * the test.
+ */
+ public void testEncodeDecodeVideoFromBufferToSurfaceQCIF() throws Throwable {
+ setSize(176, 144);
+ BufferToSurfaceWrapper.runTest(this);
+ }
+ public void testEncodeDecodeVideoFromBufferToSurfaceQVGA() throws Throwable {
+ setSize(320, 240);
+ BufferToSurfaceWrapper.runTest(this);
+ }
+ public void testEncodeDecodeVideoFromBufferToSurface720p() throws Throwable {
+ setSize(1280, 720);
+ BufferToSurfaceWrapper.runTest(this);
+ }
+ /** Wraps testEncodeDecodeVideoFromBuffer(true) */
+ private static class BufferToSurfaceWrapper implements Runnable {
+ private Throwable mThrowable;
+ private EncodeDecodeTest mTest;
+ private BufferToSurfaceWrapper(EncodeDecodeTest test) {
+ mTest = test;
+ }
+ public void run() {
+ try {
+ mTest.testEncodeDecodeVideoFromBuffer(true);
+ } catch (Throwable th) {
+ mThrowable = th;
+ }
+ }
+ /**
+ * Entry point.
+ */
+ public static void runTest(EncodeDecodeTest obj) throws Throwable {
+ BufferToSurfaceWrapper wrapper = new BufferToSurfaceWrapper(obj);
+ Thread th = new Thread(wrapper, "codec test");
+ th.start();
+ th.join();
+ if (wrapper.mThrowable != null) {
+ throw wrapper.mThrowable;
+ }
+ }
+ }
+ /**
+ * Sets the desired frame size.
+ */
+ private void setSize(int width, int height) {
+ if ((width % 16) != 0 || (height % 16) != 0) {
+ Log.w(TAG, "WARNING: width or height not multiple of 16");
+ }
+ mWidth = width;
+ mHeight = height;
+ }
+ /**
+ * Tests encoding and subsequently decoding video from frames generated into a buffer.
+ *
+ * We encode several frames of a video test pattern using MediaCodec, then decode the
+ * output with MediaCodec and do some simple checks.
+ *
+ * See http://b.android.com/37769 for a discussion of input format pitfalls.
+ */
+ private void testEncodeDecodeVideoFromBuffer(boolean toSurface) throws Exception {
+ MediaCodecInfo codecInfo = selectCodec(MIME_TYPE);
+ if (codecInfo == null) {
+ // Don't fail CTS if they don't have an AVC codec (not here, anyway).
+ Log.e(TAG, "Unable to find an appropriate codec for " + MIME_TYPE);
+ return;
+ }
+ if (VERBOSE) Log.d(TAG, "found codec: " + codecInfo.getName());
+ int colorFormat = selectColorFormat(codecInfo, MIME_TYPE);
+ if (VERBOSE) Log.d(TAG, "found colorFormat: " + colorFormat);
+ // We avoid the device-specific limitations on width and height by using values that
+ // are multiples of 16, which all tested devices seem to be able to handle.
+ MediaFormat format = MediaFormat.createVideoFormat(MIME_TYPE, mWidth, mHeight);
+ // Set some properties. Failing to specify some of these can cause the MediaCodec
+ // configure() call to throw an unhelpful exception.
+ format.setInteger(MediaFormat.KEY_COLOR_FORMAT, colorFormat);
+ format.setInteger(MediaFormat.KEY_BIT_RATE, BIT_RATE);
+ format.setInteger(MediaFormat.KEY_FRAME_RATE, FRAME_RATE);
+ format.setInteger(MediaFormat.KEY_I_FRAME_INTERVAL, IFRAME_INTERVAL);
+ if (VERBOSE) Log.d(TAG, "format: " + format);
+ // Create a MediaCodec for the desired codec, then configure it as an encoder with
+ // our desired properties.
+ MediaCodec encoder = MediaCodec.createByCodecName(codecInfo.getName());
+ encoder.configure(format, null, null, MediaCodec.CONFIGURE_FLAG_ENCODE);
+ encoder.start();
+ // Create a MediaCodec for the decoder, just based on the MIME type. The various
+ // format details will be passed through the csd-0 meta-data later on.
+ MediaCodec decoder = MediaCodec.createDecoderByType(MIME_TYPE);
+ try {
+ encodeDecodeVideoFromBuffer(encoder, colorFormat, decoder, toSurface);
+ } finally {
+ if (VERBOSE) Log.d(TAG, "releasing codecs");
+ encoder.stop();
+ decoder.stop();
+ encoder.release();
+ decoder.release();
+ }
+ }
+ /**
+ * Returns the first codec capable of encoding the specified MIME type, or null if no
+ * match was found.
+ */
+ private static MediaCodecInfo selectCodec(String mimeType) {
+ int numCodecs = MediaCodecList.getCodecCount();
+ for (int i = 0; i < numCodecs; i++) {
+ MediaCodecInfo codecInfo = MediaCodecList.getCodecInfoAt(i);
+ if (!codecInfo.isEncoder()) {
+ continue;
+ }
+ String[] types = codecInfo.getSupportedTypes();
+ for (int j = 0; j < types.length; j++) {
+ if (types[j].equalsIgnoreCase(mimeType)) {
+ return codecInfo;
+ }
+ }
+ }
+ return null;
+ }
+ /**
+ * Returns a color format that is supported by the codec and by this test code. If no
+ * match is found, this throws a test failure -- the set of formats known to the test
+ * should be expanded for new platforms.
+ */
+ private static int selectColorFormat(MediaCodecInfo codecInfo, String mimeType) {
+ MediaCodecInfo.CodecCapabilities capabilities = codecInfo.getCapabilitiesForType(mimeType);
+ for (int i = 0; i < capabilities.colorFormats.length; i++) {
+ int colorFormat = capabilities.colorFormats[i];
+ switch (colorFormat) {
+ // these are the formats we know how to handle for this test
+ case MediaCodecInfo.CodecCapabilities.COLOR_FormatYUV420Planar:
+ case MediaCodecInfo.CodecCapabilities.COLOR_FormatYUV420PackedPlanar:
+ case MediaCodecInfo.CodecCapabilities.COLOR_FormatYUV420SemiPlanar:
+ case MediaCodecInfo.CodecCapabilities.COLOR_FormatYUV420PackedSemiPlanar:
+ case MediaCodecInfo.CodecCapabilities.COLOR_TI_FormatYUV420PackedSemiPlanar:
+ return colorFormat;
+ default:
+ break;
+ }
+ }
+ fail("couldn't find a good color format for " + codecInfo.getName() + " / " + mimeType);
+ return 0; // not reached
+ }
+ /**
+ * Does the actual work for encoding frames from buffers of byte[].
+ */
+ private void encodeDecodeVideoFromBuffer(MediaCodec encoder, int encoderColorFormat,
+ MediaCodec decoder, boolean toSurface) {
+ final int TIMEOUT_USEC = 10000;
+ ByteBuffer[] encoderInputBuffers = encoder.getInputBuffers();
+ ByteBuffer[] encoderOutputBuffers = encoder.getOutputBuffers();
+ ByteBuffer[] decoderInputBuffers = null;
+ ByteBuffer[] decoderOutputBuffers = null;
+ MediaCodec.BufferInfo info = new MediaCodec.BufferInfo();
+ int decoderColorFormat = -12345; // init to invalid value
+ int generateIndex = 0;
+ int checkIndex = 0;
+ boolean decoderConfigured = false;
+ SurfaceStuff surfaceStuff = null;
+ // The size of a frame of video data, in the formats we handle, is stride*sliceHeight
+ // for Y, and (stride/2)*(sliceHeight/2) for each of the Cb and Cr channels. Application
+ // of algebra and assuming that stride==width and sliceHeight==height yields:
+ byte[] frameData = new byte[mWidth * mHeight * 3 / 2];
+ // Just out of curiosity.
+ long rawSize = 0;
+ long encodedSize = 0;
+ // Save a copy to disk. Useful for debugging the test.
+ FileOutputStream outputStream = null;
+ if (DEBUG_SAVE_FILE) {
+ String fileName = DEBUG_FILE_NAME_BASE + mWidth + "x" + mHeight + ".mp4";
+ try {
+ outputStream = new FileOutputStream(fileName);
+ Log.d(TAG, "encoded output will be saved as " + fileName);
+ } catch (IOException ioe) {
+ Log.w(TAG, "Unable to create debug output file " + fileName);
+ throw new RuntimeException(ioe);
+ }
+ }
+ if (toSurface) {
+ surfaceStuff = new SurfaceStuff(mWidth, mHeight);
+ }
+ // Loop until the output side is done.
+ boolean inputDone = false;
+ boolean encoderDone = false;
+ boolean outputDone = false;
+ while (!outputDone) {
+ if (VERBOSE) Log.d(TAG, "loop");
+ // If we're not done submitting frames, generate a new one and submit it. By
+ // doing this on every loop we're working to ensure that the encoder always has
+ // work to do.
+ //
+ // We don't really want a timeout here, but sometimes there's a delay opening
+ // the encoder device, so a short timeout can keep us from spinning hard.
+ if (!inputDone) {
+ int inputBufIndex = encoder.dequeueInputBuffer(TIMEOUT_USEC);
+ if (VERBOSE) Log.d(TAG, "inputBufIndex=" + inputBufIndex);
+ if (inputBufIndex >= 0) {
+ long ptsUsec = generateIndex * 1000000 / FRAME_RATE;
+ if (generateIndex == NUM_FRAMES) {
+ // Send an empty frame with the end-of-stream flag set. If we set EOS
+ // on a frame with data, that frame data will be ignored, and the
+ // output will be short one frame.
+ encoder.queueInputBuffer(inputBufIndex, 0, 0, ptsUsec,
+ MediaCodec.BUFFER_FLAG_END_OF_STREAM);
+ inputDone = true;
+ if (VERBOSE) Log.d(TAG, "sent input EOS (with zero-length frame)");
+ } else {
+ generateFrame(generateIndex, encoderColorFormat, frameData);
+ ByteBuffer inputBuf = encoderInputBuffers[inputBufIndex];
+ // the buffer should be sized to hold one full frame
+ assertTrue(inputBuf.capacity() >= frameData.length);
+ inputBuf.clear();
+ inputBuf.put(frameData);
+ encoder.queueInputBuffer(inputBufIndex, 0, frameData.length, ptsUsec, 0);
+ if (VERBOSE) Log.d(TAG, "submitted frame " + generateIndex + " to enc");
+ }
+ generateIndex++;
+ } else {
+ // either all in use, or we timed out during initial setup
+ if (VERBOSE) Log.d(TAG, "input buffer not available");
+ }
+ }
+ // Check for output from the encoder. If there's no output yet, we either need to
+ // provide more input, or we need to wait for the encoder to work its magic. We
+ // can't actually tell which is the case, so if we can't get an output buffer right
+ // away we loop around and see if it wants more input.
+ //
+ // Once we get EOS from the encoder, we don't need to do this anymore.
+ if (!encoderDone) {
+ int encoderStatus = encoder.dequeueOutputBuffer(info, TIMEOUT_USEC);
+ if (encoderStatus == MediaCodec.INFO_TRY_AGAIN_LATER) {
+ // no output available yet
+ if (VERBOSE) Log.d(TAG, "no output from encoder available");
+ } else if (encoderStatus == MediaCodec.INFO_OUTPUT_BUFFERS_CHANGED) {
+ // not expected for an encoder
+ encoderOutputBuffers = encoder.getOutputBuffers();
+ if (VERBOSE) Log.d(TAG, "encoder output buffers changed");
+ } else if (encoderStatus == MediaCodec.INFO_OUTPUT_FORMAT_CHANGED) {
+ // not expected for an encoder
+ MediaFormat newFormat = encoder.getOutputFormat();
+ if (VERBOSE) Log.d(TAG, "encoder output format changed: " + newFormat);
+ } else if (encoderStatus < 0) {
+ fail("unexpected result from encoder.dequeueOutputBuffer: " + encoderStatus);
+ } else { // encoderStatus >= 0
+ ByteBuffer encodedData = encoderOutputBuffers[encoderStatus];
+ if (encodedData == null) {
+ fail("encoderOutputBuffer " + encoderStatus + " was null");
+ }
+ // It's usually necessary to adjust the ByteBuffer values to match BufferInfo.
+ encodedData.position(info.offset);
+ encodedData.limit(info.offset + info.size);
+ encodedSize += info.size;
+ if (outputStream != null) {
+ byte[] data = new byte[info.size];
+ encodedData.get(data);
+ encodedData.position(info.offset);
+ try {
+ outputStream.write(data);
+ } catch (IOException ioe) {
+ Log.w(TAG, "failed writing debug data to file");
+ throw new RuntimeException(ioe);
+ }
+ }
+ if ((info.flags & MediaCodec.BUFFER_FLAG_CODEC_CONFIG) != 0) {
+ // Codec config info. Only expected on first packet.
+ assertFalse(decoderConfigured);
+ MediaFormat format =
+ MediaFormat.createVideoFormat(MIME_TYPE, mWidth, mHeight);
+ format.setByteBuffer("csd-0", encodedData);
+ decoder.configure(format, toSurface ? surfaceStuff.getSurface() : null,
+ null, 0);
+ decoder.start();
+ decoderInputBuffers = decoder.getInputBuffers();
+ decoderOutputBuffers = decoder.getOutputBuffers();
+ decoderConfigured = true;
+ if (VERBOSE) Log.d(TAG, "decoder configured (" + info.size + " bytes)");
+ } else {
+ // Get a decoder input buffer, blocking until it's available.
+ assertTrue(decoderConfigured);
+ int inputBufIndex = decoder.dequeueInputBuffer(-1);
+ ByteBuffer inputBuf = decoderInputBuffers[inputBufIndex];
+ inputBuf.clear();
+ inputBuf.put(encodedData);
+ decoder.queueInputBuffer(inputBufIndex, 0, info.size, info.presentationTimeUs,
+ info.flags);
+ encoderDone = (info.flags & MediaCodec.BUFFER_FLAG_END_OF_STREAM) != 0;
+ if (VERBOSE) Log.d(TAG, "passed " + info.size + " bytes to decoder"
+ + (encoderDone ? " (EOS)" : ""));
+ }
+ encoder.releaseOutputBuffer(encoderStatus, false);
+ }
+ }
+ // Check for output from the decoder. We want to do this on every loop to avoid
+ // the possibility of stalling the pipeline. We use a short timeout to avoid
+ // burning CPU if the decoder is hard at work but the next frame isn't quite ready.
+ //
+ // If we're decoding to a Surface, we'll get notified here as usual but the
+ // ByteBuffer references will be null. The data is sent to Surface instead.
+ if (decoderConfigured) {
+ int decoderStatus = decoder.dequeueOutputBuffer(info, TIMEOUT_USEC);
+ if (decoderStatus == MediaCodec.INFO_TRY_AGAIN_LATER) {
+ // no output available yet
+ if (VERBOSE) Log.d(TAG, "no output from decoder available");
+ } else if (decoderStatus == MediaCodec.INFO_OUTPUT_BUFFERS_CHANGED) {
+ if (VERBOSE) Log.d(TAG, "decoder output buffers changed");
+ decoderOutputBuffers = decoder.getOutputBuffers();
+ } else if (decoderStatus == MediaCodec.INFO_OUTPUT_FORMAT_CHANGED) {
+ // this happens before the first frame is returned
+ MediaFormat decoderOutputFormat = decoder.getOutputFormat();
+ decoderColorFormat =
+ decoderOutputFormat.getInteger(MediaFormat.KEY_COLOR_FORMAT);
+ if (VERBOSE) Log.d(TAG, "decoder output format changed: " +
+ decoderOutputFormat);
+ } else if (decoderStatus < 0) {
+ fail("unexpected result from deocder.dequeueOutputBuffer: " + decoderStatus);
+ } else { // decoderStatus >= 0
+ if (!toSurface) {
+ ByteBuffer outputFrame = decoderOutputBuffers[decoderStatus];
+ outputFrame.position(info.offset);
+ outputFrame.limit(info.offset + info.size);
+ rawSize += info.size;
+ if (info.size == 0) {
+ if (VERBOSE) Log.d(TAG, "got empty frame");
+ } else {
+ if (VERBOSE) Log.d(TAG, "decoded, checking frame " + checkIndex);
+ checkFrame(checkIndex++, decoderColorFormat, outputFrame);
+ }
+ if ((info.flags & MediaCodec.BUFFER_FLAG_END_OF_STREAM) != 0) {
+ if (VERBOSE) Log.d(TAG, "output EOS");
+ outputDone = true;
+ }
+ } else {
+ // Before we release+render this buffer, check to see if data from a
+ // previous go-round has latched.
+ surfaceStuff.checkNewImageIfAvailable();
+ if (VERBOSE) Log.d(TAG, "surface decoder given buffer " + decoderStatus +
+ " (size=" + info.size + ")");
+ rawSize += info.size;
+ if ((info.flags & MediaCodec.BUFFER_FLAG_END_OF_STREAM) != 0) {
+ if (VERBOSE) Log.d(TAG, "output EOS");
+ outputDone = true;
+ }
+ }
+ // If output is going to a Surface, the second argument should be true.
+ // If not, the value doesn't matter.
+ //
+ // If we are sending to a Surface, then some time after we call this the
+ // data will be made available to SurfaceTexture, and the onFrameAvailable()
+ // callback will fire.
+ decoder.releaseOutputBuffer(decoderStatus, true /*render*/);
+ }
+ }
+ }
+ if (VERBOSE) Log.d(TAG, "encoded " + NUM_FRAMES + " frames at "
+ + mWidth + "x" + mHeight + ": raw=" + rawSize + ", enc=" + encodedSize);
+ if (outputStream != null) {
+ try {
+ outputStream.close();
+ } catch (IOException ioe) {
+ Log.w(TAG, "failed closing debug file");
+ throw new RuntimeException(ioe);
+ }
+ }
+ }
+ /**
+ * Generates data for frame N into the supplied buffer. We have an 8-frame animation
+ * sequence that wraps around. It looks like this:
+ *
+ * 0 1 2 3
+ * 7 6 5 4
+ *
+ * We draw one of the eight rectangles and leave the rest set to the zero-fill color.
+ */
+ private void generateFrame(int frameIndex, int colorFormat, byte[] frameData) {
+ final int HALF_WIDTH = mWidth / 2;
+ boolean semiPlanar = isSemiPlanarYUV(colorFormat);
+ // Set to zero. In YUV this is a dull green.
+ Arrays.fill(frameData, (byte) 0);
+ int startX, startY, countX, countY;
+ frameIndex %= 8;
+ //frameIndex = (frameIndex / 8) % 8; // use this instead for debug -- easier to see
+ if (frameIndex < 4) {
+ startX = frameIndex * (mWidth / 4);
+ startY = 0;
+ } else {
+ startX = (7 - frameIndex) * (mWidth / 4);
+ startY = mHeight / 2;
+ }
+ for (int y = startY + (mHeight/2) - 1; y >= startY; --y) {
+ for (int x = startX + (mWidth/4) - 1; x >= startX; --x) {
+ if (semiPlanar) {
+ // full-size Y, followed by CbCr pairs at half resolution
+ // e.g. Nexus 4 OMX.qcom.video.encoder.avc COLOR_FormatYUV420SemiPlanar
+ // e.g. Galaxy Nexus OMX.TI.DUCATI1.VIDEO.H264E
+ // OMX_TI_COLOR_FormatYUV420PackedSemiPlanar
+ frameData[y * mWidth + x] = (byte) TEST_Y;
+ if ((x & 0x01) == 0 && (y & 0x01) == 0) {
+ frameData[mWidth*mHeight + y * HALF_WIDTH + x] = (byte) TEST_U;
+ frameData[mWidth*mHeight + y * HALF_WIDTH + x + 1] = (byte) TEST_V;
+ }
+ } else {
+ // full-size Y, followed by quarter-size Cb and quarter-size Cr
+ // e.g. Nexus 10 OMX.Exynos.AVC.Encoder COLOR_FormatYUV420Planar
+ // e.g. Nexus 7 OMX.Nvidia.h264.encoder COLOR_FormatYUV420Planar
+ frameData[y * mWidth + x] = (byte) TEST_Y;
+ if ((x & 0x01) == 0 && (y & 0x01) == 0) {
+ frameData[mWidth*mHeight + (y/2) * HALF_WIDTH + (x/2)] = (byte) TEST_U;
+ frameData[mWidth*mHeight + HALF_WIDTH * (mHeight / 2) +
+ (y/2) * HALF_WIDTH + (x/2)] = (byte) TEST_V;
+ }
+ }
+ }
+ }
+ if (false) {
+ // make sure that generate and check agree
+ Log.d(TAG, "SPOT CHECK");
+ checkFrame(frameIndex, colorFormat, ByteBuffer.wrap(frameData));
+ Log.d(TAG, "SPOT CHECK DONE");
+ }
+ }
+ /**
+ * Performs a simple check to see if the frame is more or less right.
+ *
+ * See {@link generateFrame} for a description of the layout. The idea is to sample
+ * one pixel from the middle of the 8 regions, and verify that the correct one has
+ * the non-background color. We can't know exactly what the video encoder has done
+ * with our frames, so we just check to see if it looks like more or less the right thing.
+ *
+ * Throws a failure if the frame looks wrong.
+ */
+ private void checkFrame(int frameIndex, int colorFormat, ByteBuffer frameData) {
+ final int HALF_WIDTH = mWidth / 2;
+ boolean frameFailed = false;
+ if (colorFormat == 0x7FA30C03) {
+ // Nexus 4 decoder output OMX_QCOM_COLOR_FormatYUV420PackedSemiPlanar64x32Tile2m8ka
+ Log.d(TAG, "unable to check frame contents for colorFormat=" +
+ Integer.toHexString(colorFormat));
+ return;
+ }
+ boolean semiPlanar = isSemiPlanarYUV(colorFormat);
+ frameIndex %= 8;
+ for (int i = 0; i < 8; i++) {
+ int x, y;
+ if (i < 4) {
+ x = i * (mWidth / 4) + (mWidth / 8);
+ y = mHeight / 4;
+ } else {
+ x = (7 - i) * (mWidth / 4) + (mWidth / 8);
+ y = (mHeight * 3) / 4;
+ }
+ int testY, testU, testV;
+ if (semiPlanar) {
+ // Galaxy Nexus uses OMX_TI_COLOR_FormatYUV420PackedSemiPlanar
+ testY = frameData.get(y * mWidth + x) & 0xff;
+ testU = frameData.get(mWidth*mHeight + 2*(y/2) * HALF_WIDTH + 2*(x/2)) & 0xff;
+ testV = frameData.get(mWidth*mHeight + 2*(y/2) * HALF_WIDTH + 2*(x/2) + 1) & 0xff;
+ } else {
+ // Nexus 10, Nexus 7 use COLOR_FormatYUV420Planar
+ testY = frameData.get(y * mWidth + x) & 0xff;
+ testU = frameData.get(mWidth*mHeight + (y/2) * HALF_WIDTH + (x/2)) & 0xff;
+ testV = frameData.get(mWidth*mHeight + HALF_WIDTH * (mHeight / 2) +
+ (y/2) * HALF_WIDTH + (x/2)) & 0xff;
+ }
+ boolean failed = false;
+ if (i == frameIndex) {
+ failed = !isColorClose(testY, TEST_Y) ||
+ !isColorClose(testU, TEST_U) ||
+ !isColorClose(testV, TEST_V);
+ } else {
+ // should be our zeroed-out buffer
+ failed = !isColorClose(testY, 0) ||
+ !isColorClose(testU, 0) ||
+ !isColorClose(testV, 0);
+ }
+ if (failed) {
+ Log.w(TAG, "Bad frame " + frameIndex + " (r=" + i + ": Y=" + testY +
+ " U=" + testU + " V=" + testV + ")");
+ frameFailed = true;
+ }
+ }
+ if (frameFailed) {
+ fail("bad frame (" + frameIndex + ")");
+ }
+ }
+ /**
+ * Returns true if the actual color value is close to the expected color value.
+ */
+ static boolean isColorClose(int actual, int expected) {
+ if (expected < 5) {
+ return actual < (expected + 5);
+ } else if (expected > 250) {
+ return actual > (expected - 5);
+ } else {
+ return actual > (expected - 5) && actual < (expected + 5);
+ }
+ }
+ /**
+ * Returns true if the specified color format is semi-planar YUV. Throws an exception
+ * if the color format is not recognized (e.g. not YUV).
+ */
+ private static boolean isSemiPlanarYUV(int colorFormat) {
+ switch (colorFormat) {
+ case MediaCodecInfo.CodecCapabilities.COLOR_FormatYUV420Planar:
+ case MediaCodecInfo.CodecCapabilities.COLOR_FormatYUV420PackedPlanar:
+ return false;
+ case MediaCodecInfo.CodecCapabilities.COLOR_FormatYUV420SemiPlanar:
+ case MediaCodecInfo.CodecCapabilities.COLOR_FormatYUV420PackedSemiPlanar:
+ case MediaCodecInfo.CodecCapabilities.COLOR_TI_FormatYUV420PackedSemiPlanar:
+ return true;
+ default:
+ throw new RuntimeException("unknown format " + colorFormat);
+ }
+ }
+ /**
+ * Holds state associated with a Surface used for output.
+ *
+ * By default, the Surface will be using a BufferQueue in asynchronous mode, so we
+ * will likely miss a number of frames.
+ */
+ private static class SurfaceStuff implements SurfaceTexture.OnFrameAvailableListener {
+ private static final int EGL_OPENGL_ES2_BIT = 4;
+ private EGL10 mEGL;
+ private EGLDisplay mEGLDisplay;
+ private EGLContext mEGLContext;
+ private EGLSurface mEGLSurface;
+ private SurfaceTexture mSurfaceTexture;
+ private Surface mSurface;
+ private boolean mFrameAvailable = false; // guarded by "this"
+ private int mWidth;
+ private int mHeight;
+ private VideoRender mVideoRender;
+ public SurfaceStuff(int width, int height) {
+ mWidth = width;
+ mHeight = height;
+ eglSetup();
+ mVideoRender = new VideoRender();
+ mVideoRender.onSurfaceCreated();
+ // Even if we don't access the SurfaceTexture after the constructor returns, we
+ // still need to keep a reference to it. The Surface doesn't retain a reference
+ // at the Java level, so if we don't either then the object can get GCed, which
+ // causes the native finalizer to run.
+ if (VERBOSE) Log.d(TAG, "textureID=" + mVideoRender.getTextureId());
+ mSurfaceTexture = new SurfaceTexture(mVideoRender.getTextureId());
+ // This doesn't work if SurfaceStuff is created on the thread that CTS started for
+ // these test cases.
+ //
+ // The CTS-created thread has a Looper, and the SurfaceTexture constructor will
+ // create a Handler that uses it. The "frame available" message is delivered
+ // there, but since we're not a Looper-based thread we'll never see it. For
+ // this to do anything useful, SurfaceStuff must be created on a thread without
+ // a Looper, so that SurfaceTexture uses the main application Looper instead.
+ //
+ // Java language note: passing "this" out of a constructor is generally unwise,
+ // but we should be able to get away with it here.
+ mSurfaceTexture.setOnFrameAvailableListener(this);
+ mSurface = new Surface(mSurfaceTexture);
+ }
+ /**
+ * Prepares EGL. We want a GLES 2.0 context and a surface that supports pbuffer.
+ */
+ private void eglSetup() {
+ mEGL = (EGL10)EGLContext.getEGL();
+ mEGLDisplay = mEGL.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY);
+ if (!mEGL.eglInitialize(mEGLDisplay, null)) {
+ fail("unable to initialize EGL10");
+ }
+ // Configure surface for pbuffer and OpenGL ES 2.0. We want enough RGB bits
+ // to be able to tell if the frame is reasonable.
+ int[] attribList = {
+ EGL10.EGL_RED_SIZE, 8,
+ EGL10.EGL_GREEN_SIZE, 8,
+ EGL10.EGL_BLUE_SIZE, 8,
+ EGL10.EGL_SURFACE_TYPE, EGL10.EGL_PBUFFER_BIT,
+ EGL10.EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
+ EGL10.EGL_NONE
+ };
+ EGLConfig[] configs = new EGLConfig[1];
+ int[] numConfigs = new int[1];
+ if (!mEGL.eglChooseConfig(mEGLDisplay, attribList, configs, 1, numConfigs)) {
+ fail("unable to find RGB888+pbuffer EGL config");
+ }
+ // Configure context for OpenGL ES 2.0.
+ int[] attrib_list = {
+ EGL14.EGL_CONTEXT_CLIENT_VERSION, 2,
+ EGL10.EGL_NONE
+ };
+ mEGLContext = mEGL.eglCreateContext(mEGLDisplay, configs[0], EGL10.EGL_NO_CONTEXT,
+ attrib_list);
+ checkEglError("eglCreateContext");
+ assertNotNull(mEGLContext);
+ // Create a pbuffer surface. By using this for output, we can use glReadPixels
+ // to test values in the output.
+ int[] surfaceAttribs = {
+ EGL10.EGL_WIDTH, mWidth,
+ EGL10.EGL_HEIGHT, mHeight,
+ EGL10.EGL_NONE
+ };
+ mEGLSurface = mEGL.eglCreatePbufferSurface(mEGLDisplay, configs[0], surfaceAttribs);
+ checkEglError("eglCreatePbufferSurface");
+ assertNotNull(mEGLSurface);
+ if (!mEGL.eglMakeCurrent(mEGLDisplay, mEGLSurface, mEGLSurface, mEGLContext)) {
+ fail("eglMakeCurrent failed");
+ }
+ }
+ /**
+ * Checks for EGL errors.
+ */
+ private void checkEglError(String msg) {
+ boolean failed = false;
+ int error;
+ while ((error = mEGL.eglGetError()) != EGL10.EGL_SUCCESS) {
+ Log.e(TAG, msg + ": EGL error: 0x" + Integer.toHexString(error));
+ failed = true;
+ }
+ if (failed) {
+ fail("EGL error encountered (see log)");
+ }
+ }
+ /**
+ * Returns the Surface that the MediaCodec will draw onto.
+ */
+ public Surface getSurface() {
+ return mSurface;
+ }
+ /**
+ * Latches the next buffer into the texture if one is available, and checks it for
+ * validity. Must be called from the thread that created the SurfaceStuff object.
+ */
+ public void checkNewImageIfAvailable() {
+ boolean newStuff = false;
+ synchronized (this) {
+ if (mSurfaceTexture != null && mFrameAvailable) {
+ mFrameAvailable = false;
+ newStuff = true;
+ }
+ }
+ if (newStuff) {
+ mVideoRender.checkGlError("before updateTexImage");
+ mSurfaceTexture.updateTexImage();
+ mVideoRender.onDrawFrame(mSurfaceTexture);
+ checkSurfaceFrame();
+ }
+ }
+ @Override
+ public void onFrameAvailable(SurfaceTexture st) {
+ if (VERBOSE) Log.d(TAG, "new frame available");
+ synchronized (this) {
+ mFrameAvailable = true;
+ }
+ }
+ /**
+ * Attempts to check the frame for correctness.
+ *
+ * Our definition of "correct" is based on knowing what the frame sequence number is,
+ * which we can't reliably get by counting frames since the underlying mechanism can
+ * drop frames. The alternative would be to use the presentation time stamp that
+ * we passed to the video encoder, but there's no way to get that from the texture.
+ *
+ * All we can do is verify that it looks something like a frame we'd expect, i.e.
+ * green with exactly one pink rectangle.
+ */
+ private void checkSurfaceFrame() {
+ ByteBuffer pixelBuf = ByteBuffer.allocateDirect(4); // TODO - reuse this
+ int numColoredRects = 0;
+ int rectPosn = -1;
+ for (int i = 0; i < 8; i++) {
+ // Note the coordinates are inverted on the Y-axis in GL.
+ int x, y;
+ if (i < 4) {
+ x = i * (mWidth / 4) + (mWidth / 8);
+ y = (mHeight * 3) / 4;
+ } else {
+ x = (7 - i) * (mWidth / 4) + (mWidth / 8);
+ y = mHeight / 4;
+ }
+ GLES20.glReadPixels(x, y, 1, 1, GL10.GL_RGBA, GL10.GL_UNSIGNED_BYTE, pixelBuf);
+ int r = pixelBuf.get(0) & 0xff;
+ int g = pixelBuf.get(1) & 0xff;
+ int b = pixelBuf.get(2) & 0xff;
+ if (isColorClose(r, TEST_R0) &&
+ isColorClose(g, TEST_G0) &&
+ isColorClose(b, TEST_B0)) {
+ // empty space
+ } else if (isColorClose(r, TEST_R1) &&
+ isColorClose(g, TEST_G1) &&
+ isColorClose(b, TEST_B1)) {
+ // colored rect
+ numColoredRects++;
+ rectPosn = i;
+ } else {
+ // wtf
+ Log.w(TAG, "found unexpected color r=" + r + " g=" + g + " b=" + b);
+ }
+ }
+ if (numColoredRects != 1) {
+ fail("Found surface with colored rects != 1 (" + numColoredRects + ")");
+ } else {
+ if (VERBOSE) Log.d(TAG, "good surface, looks like index " + rectPosn);
+ }
+ }
+ }
+ /**
+ * GL code to fill a surface with a texture. This class was largely copied from
+ * VideoSurfaceView.VideoRender.
+ *
+ */
+
+public class SelectViewBean {
+ private long timeStamp;
+ private long startTime;
+ private long endTime;
+
+ public long getStartTime() {
+ return startTime;
+ }
+
+ public void setStartTime(long startTime) {
+ this.startTime = startTime;
+ }
+
+ public long getEndTime() {
+ return endTime;
+ }
+
+ public void setEndTime(long endTime) {
+ this.endTime = endTime;
+ }
+
+ public long getTimeStamp() {
+ return timeStamp;
+ }
+
+ public void setTimeStamp(long timeStamp) {
+ this.timeStamp = timeStamp;
+ }
+}
diff --git a/app/src/main/java/com/aserbao/androidcustomcamera/whole/editVideo/beans/StickerPropertyModel.java b/app/src/main/java/com/aserbao/androidcustomcamera/whole/editVideo/beans/StickerPropertyModel.java
new file mode 100644
index 0000000..1ebaca9
--- /dev/null
+++ b/app/src/main/java/com/aserbao/androidcustomcamera/whole/editVideo/beans/StickerPropertyModel.java
@@ -0,0 +1,105 @@
+package com.aserbao.androidcustomcamera.whole.editVideo.beans;
+
+import java.io.Serializable;
+
+/**
+ * Created by Abner on 15/6/11.
+ * QQ 230877476
+ * Email nimengbo@gmail.com
+ */
+public class StickerPropertyModel implements Serializable {
+ private static final long serialVersionUID = 3800737478616389410L;
+
+ //贴纸id
+ private long stickerId;
+ //文本
+ private String text;
+ //x坐标
+ private float xLocation;
+ //y坐标
+ private float yLocation;
+ //角度
+ private float degree;
+ //缩放值
+ private float scaling;
+ //气泡顺序
+ private int order;
+
+ //水平镜像 1镜像 2未镜像
+ private int horizonMirror;
+
+ //贴纸PNG URL
+ private String stickerURL;
+
+ public int getHorizonMirror() {
+ return horizonMirror;
+ }
+
+ public void setHorizonMirror(int horizonMirror) {
+ this.horizonMirror = horizonMirror;
+ }
+
+ public String getStickerURL() {
+ return stickerURL;
+ }
+
+ public void setStickerURL(String stickerURL) {
+ this.stickerURL = stickerURL;
+ }
+
+ public long getStickerId() {
+ return stickerId;
+ }
+
+ public void setStickerId(long stickerId) {
+ this.stickerId = stickerId;
+ }
+
+ public String getText() {
+ return text;
+ }
+
+ public void setText(String text) {
+ this.text = text;
+ }
+
+ public float getxLocation() {
+ return xLocation;
+ }
+
+ public void setxLocation(float xLocation) {
+ this.xLocation = xLocation;
+ }
+
+ public float getyLocation() {
+ return yLocation;
+ }
+
+ public void setyLocation(float yLocation) {
+ this.yLocation = yLocation;
+ }
+
+ public float getDegree() {
+ return degree;
+ }
+
+ public void setDegree(float degree) {
+ this.degree = degree;
+ }
+
+ public float getScaling() {
+ return scaling;
+ }
+
+ public void setScaling(float scaling) {
+ this.scaling = scaling;
+ }
+
+ public int getOrder() {
+ return order;
+ }
+
+ public void setOrder(int order) {
+ this.order = order;
+ }
+}
diff --git a/app/src/main/java/com/aserbao/androidcustomcamera/whole/editVideo/fragment/FilterDialogFragment.java b/app/src/main/java/com/aserbao/androidcustomcamera/whole/editVideo/fragment/FilterDialogFragment.java
new file mode 100644
index 0000000..19da0e4
--- /dev/null
+++ b/app/src/main/java/com/aserbao/androidcustomcamera/whole/editVideo/fragment/FilterDialogFragment.java
@@ -0,0 +1,277 @@
+package com.aserbao.androidcustomcamera.whole.editVideo.fragment;
+
+import android.app.Dialog;
+import android.app.DialogFragment;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.graphics.Color;
+import android.os.Bundle;
+import android.util.Log;
+import android.view.Gravity;
+import android.view.View;
+import android.view.Window;
+import android.view.WindowManager;
+import android.widget.HorizontalScrollView;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+
+import com.aserbao.androidcustomcamera.R;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import butterknife.BindView;
+import butterknife.ButterKnife;
+import butterknife.OnClick;
+
+
+/**
+ * description:
+ * Created by aserbao on 2018/1/27.
+ */
+
+
+public class FilterDialogFragment extends DialogFragment {
+
+
+ @BindView(R.id.pop_filter_tv)
+ TextView mPopFilterTv;
+ @BindView(R.id.origin)
+ TextView mOrigin;
+ @BindView(R.id.delta)
+ TextView mDelta;
+ @BindView(R.id.electric)
+ TextView mElectric;
+ @BindView(R.id.slowlived)
+ TextView mSlowlived;
+ @BindView(R.id.tokyo)
+ TextView mTokyo;
+ @BindView(R.id.warm)
+ TextView mWarm;
+ @BindView(R.id.pop_filter_sv)
+ HorizontalScrollView mPopFilterSv;
+ @BindView(R.id.none_iv)
+ ImageView mNoneIv;
+ @BindView(R.id.one_tv)
+ TextView mOneTv;
+ @BindView(R.id.two_tv)
+ TextView mTwoTv;
+ @BindView(R.id.three_tv)
+ TextView mThreeTv;
+ @BindView(R.id.four_tv)
+ TextView mFourTv;
+ @BindView(R.id.five_tv)
+ TextView mFiveTv;
+ @BindView(R.id.pop_beauty_ll)
+ LinearLayout mPopBeautyLl;
+ @BindView(R.id.pop_filter_ll)
+ LinearLayout mPopFilterLl;
+ @BindView(R.id.mking_tv)
+ TextView mMkingTv;
+ @BindView(R.id.filter_tv)
+ TextView mFilterTv;
+ @BindView(R.id.beauty_tv)
+ TextView mBeautyTv;
+
+
+ private int making = 0,mBeauty = 0,mFilter = 0;//美型,美颜,滤镜类型
+ private boolean mIsMaking = true,mIsBeauty;
+ private Dialog mDialog;
+ private Context mContext;
+ private String[] mFilterType = {"origin", "delta", "electric", "slowlived", "tokyo", "warm"};
+ private List mBeautyTvList = new ArrayList<>();
+ private List mFilterTvList = new ArrayList<>();
+ private ResultListener mResultListener;
+ public int mComeFrom;
+
+ @Override
+ public Dialog onCreateDialog(Bundle savedInstanceState) {
+ mDialog = new Dialog(getActivity(), R.style.BottomDialog);
+ mDialog.requestWindowFeature(Window.FEATURE_NO_TITLE); // 设置Content前设定
+ mDialog.setContentView(R.layout.pop_filter_camera);
+ mDialog.setCanceledOnTouchOutside(true); // 外部点击取消
+ mDialog.getWindow().setWindowAnimations(R.style.expression_dialog_anim_style);
+ // 设置宽度为屏宽, 靠近屏幕底部。
+ Window window = mDialog.getWindow();
+ WindowManager.LayoutParams lp = window.getAttributes();
+ lp.gravity = Gravity.BOTTOM; // 紧贴底部
+ lp.width = WindowManager.LayoutParams.MATCH_PARENT; // 宽度持平
+ lp.height = WindowManager.LayoutParams.WRAP_CONTENT; // 高度持平
+ window.setAttributes(lp);
+ ButterKnife.bind(this, mDialog);
+ mContext = mDialog.getContext();
+ initData();
+ initView();
+ return mDialog;
+ }
+
+ @Override
+ public void dismiss() {
+ super.dismiss();
+ Log.e("atest", "dismiss: " );
+ }
+
+ private void initData() {
+ Bundle bundle = getArguments();
+
+ mBeautyTvList.add(mNoneIv);
+ mBeautyTvList.add(mOneTv);
+ mBeautyTvList.add(mTwoTv);
+ mBeautyTvList.add(mThreeTv);
+ mBeautyTvList.add(mFourTv);
+ mBeautyTvList.add(mFiveTv);
+
+ mFilterTvList.add(mOrigin);
+ mFilterTvList.add(mDelta);
+ mFilterTvList.add(mElectric);
+ mFilterTvList.add(mSlowlived);
+ mFilterTvList.add(mTokyo);
+ mFilterTvList.add(mWarm);
+
+ }
+
+ @Override
+ public void onDismiss(DialogInterface dialog) {
+ super.onDismiss(dialog);
+ mResultListener.result(making,mFilter,mBeauty,true);
+ }
+
+ private void initView() {
+ switch (mComeFrom){
+ case 0://从相机进入
+ clickBeauty(making);
+ break;
+ case 1://本地视频编辑
+ mPopFilterLl.setVisibility(View.GONE);
+ clickFilter(mFilter);
+ mPopBeautyLl.setVisibility(View.GONE);
+ mPopFilterSv.setVisibility(View.VISIBLE);
+ break;
+ }
+ }
+
+ @OnClick({R.id.origin, R.id.delta, R.id.electric, R.id.slowlived, R.id.tokyo, R.id.warm, R.id.none_iv, R.id.one_tv, R.id.two_tv, R.id.three_tv, R.id.four_tv, R.id.five_tv, R.id.mking_tv, R.id.filter_tv, R.id.beauty_tv})
+ public void onViewClicked(View view) {
+ switch (view.getId()) {
+ case R.id.origin:
+ clickFilter(0);
+ break;
+ case R.id.delta:
+ clickFilter(1);
+ break;
+ case R.id.electric:
+ clickFilter(2);
+ break;
+ case R.id.slowlived:
+ clickFilter(3);
+ break;
+ case R.id.tokyo:
+ clickFilter(4);
+ break;
+ case R.id.warm:
+ clickFilter(5);
+ break;
+ case R.id.none_iv:
+ clickBeauty(0);
+ break;
+ case R.id.one_tv:
+ clickBeauty(1);
+ break;
+ case R.id.two_tv:
+ clickBeauty(2);
+ break;
+ case R.id.three_tv:
+ clickBeauty(3);
+ break;
+ case R.id.four_tv:
+ clickBeauty(4);
+ break;
+ case R.id.five_tv:
+ clickBeauty(5);
+ break;
+ case R.id.mking_tv:
+ mMkingTv.setTextColor(Color.parseColor("#FFEB58"));
+ mFilterTv.setTextColor(Color.parseColor("#7FFFFFFF"));
+ mBeautyTv.setTextColor(Color.parseColor("#7FFFFFFF"));
+ mIsBeauty = false;
+ mIsMaking = true;
+ clickBeauty(making);
+ mPopBeautyLl.setVisibility(View.VISIBLE);
+ mPopFilterSv.setVisibility(View.GONE);
+ break;
+ case R.id.filter_tv:
+ mMkingTv.setTextColor(Color.parseColor("#7FFFFFFF"));
+ mFilterTv.setTextColor(Color.parseColor("#FFEB58"));
+ mBeautyTv.setTextColor(Color.parseColor("#7FFFFFFF"));
+ clickFilter(mFilter);
+ mPopBeautyLl.setVisibility(View.GONE);
+ mPopFilterSv.setVisibility(View.VISIBLE);
+ break;
+ case R.id.beauty_tv:
+ mBeautyTv.setTextColor(Color.parseColor("#FFEB58"));
+ mFilterTv.setTextColor(Color.parseColor("#7FFFFFFF"));
+ mMkingTv.setTextColor(Color.parseColor("#7FFFFFFF"));
+ mIsBeauty = true;
+ mIsMaking = false;
+ clickBeauty(mBeauty);
+ mPopBeautyLl.setVisibility(View.VISIBLE);
+ mPopFilterSv.setVisibility(View.GONE);
+ break;
+ }
+ }
+
+
+ public void clickBeauty(int position){
+ if(mIsMaking){
+ making = position;
+ }
+ if(mIsBeauty){
+ mBeauty = position;
+ }
+ for (int i = 0; i < mBeautyTvList.size(); i++) {
+ View view = mBeautyTvList.get(i);
+ if(i == position){
+ if(i == 0) {
+ ((ImageView) view).setImageResource(R.drawable.bigicon_no_light);
+ }else{
+ ((TextView) view).setTextColor(Color.parseColor("#ffffff"));
+ }
+ view.setBackgroundResource(R.drawable.tv_circle_white40_bg);
+ }else{
+ if(i == 0){
+ ((ImageView) view).setImageResource(R.drawable.bigicon_no);
+ }else{
+ ((TextView) view).setTextColor(Color.parseColor("#7fffffff"));
+ }
+ view.setBackgroundResource(R.drawable.tv_circle_white10_bg);
+ }
+ }
+ mResultListener.result(making,mFilter,mBeauty,false);
+ }
+
+ public void clickFilter(int position){
+ mFilter = position;
+ for (int i = 0; i < mFilterTvList.size(); i++) {
+ if(position == i){
+ mFilterTvList.get(i).setAlpha(1);
+ ((TextView) mFilterTvList.get(i)).setTextColor(Color.parseColor("#FFEB58"));
+ }else{
+ ((TextView) mFilterTvList.get(i)).setTextColor(getResources().getColor(R.color.white40));
+ mFilterTvList.get(i).setAlpha(0.5f);
+ }
+ }
+ if(mComeFrom == 1) {
+ mDialog.dismiss();
+ }else {
+ mResultListener.result(making, mFilter, mBeauty, false);
+ }
+ }
+
+ public void setResultListener(ResultListener resultListener) {
+ mResultListener = resultListener;
+ }
+ public interface ResultListener{
+ void result(int making, int mFilterType, int mBeauty, boolean isDismiss);
+ }
+}
diff --git a/app/src/main/java/com/aserbao/androidcustomcamera/whole/editVideo/mediacodec/OutputSurface.java b/app/src/main/java/com/aserbao/androidcustomcamera/whole/editVideo/mediacodec/OutputSurface.java
new file mode 100644
index 0000000..1c04ce2
--- /dev/null
+++ b/app/src/main/java/com/aserbao/androidcustomcamera/whole/editVideo/mediacodec/OutputSurface.java
@@ -0,0 +1,370 @@
+package com.aserbao.androidcustomcamera.whole.editVideo.mediacodec;
+/*
+ * Copyright (C) 2013 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+import android.content.res.Resources;
+import android.graphics.Bitmap;
+import android.graphics.Matrix;
+import android.graphics.SurfaceTexture;
+import android.opengl.EGL14;
+import android.util.Log;
+import android.view.Surface;
+
+import com.aserbao.androidcustomcamera.base.MyApplication;
+import com.aserbao.androidcustomcamera.base.utils.StaticFinalValues;
+import com.aserbao.androidcustomcamera.whole.createVideoByVoice.localEdit.VideoDrawer;
+import com.aserbao.androidcustomcamera.whole.createVideoByVoice.localEdit.VideoInfo;
+import com.aserbao.androidcustomcamera.whole.editVideo.view.BaseImageView;
+import com.aserbao.androidcustomcamera.whole.record.filters.gpuFilters.baseFilter.GPUImageFilter;
+
+import java.util.ArrayList;
+
+import javax.microedition.khronos.egl.EGL10;
+import javax.microedition.khronos.egl.EGLConfig;
+import javax.microedition.khronos.egl.EGLContext;
+import javax.microedition.khronos.egl.EGLDisplay;
+import javax.microedition.khronos.egl.EGLSurface;
+
+/**
+ * Holds state associated with a Surface used for MediaCodec decoder output.
+ *
+ * The (width,height) constructor for this class will prepare GL, create a SurfaceTexture,
+ * and then create a Surface for that SurfaceTexture. The Surface can be passed to
+ * MediaCodec.configure() to receive decoder output. When a frame arrives, we latch the
+ * texture with updateTexImage, then render the texture with GL to a pbuffer.
+ *
+ * The no-arg constructor skips the GL preparation step and doesn't allocate a pbuffer.
+ * Instead, it just creates the Surface and SurfaceTexture, and when a frame arrives
+ * we just draw it on whatever surface is current.
+ *