diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 25eb372d..9bbddeae 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.9.0 +current_version = 0.10.0 [bumpversion:file:setup.cfg] diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index e2ccfbd7..667d1ce2 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1,2 +1,4 @@ github: Wasted-Audio patreon: WastedAudio +ko_fi: wastedaudio +liberapay: WastedAudio diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c046aeaa..f7cf8353 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,10 +8,10 @@ on: jobs: build: - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 strategy: matrix: - python-version: ['3.7', '3.8', '3.9', '3.10', '3.11'] + python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] steps: - uses: actions/checkout@v3 diff --git a/CHANGELOG.md b/CHANGELOG.md index c4ede5bd..cae21eef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,22 @@ CHANGELOG ===== +0.10.0 +----- + +* Objects: `[bang~]` +* Object improvements: support `[clear(` message for `[delwrite~]` +* Documentation fixes/additions +* Daisy: ability to set samplerate and blocksize +* Daisy: adding midirealtimein, polytouchin/out, midiin (midiout WIP) +* Daisy: use `libdaisy_path` in meta config; both string/path and int/depth possible +* DPF: enum for UI parameter IDs +* DPF bugfixes: correct input PortGroup names; correct UI slider updates; midiout reimplementation +* Wwise: complete rewrite/refactor - now uses SDK build tools - thanks to @eu-ch !! +* Bugfix: correct alignment in AVX pow~ implementation +* Cleanup: remove deprecated build.json +* Deprecate py37, enable py312 + 0.9.0 ----- diff --git a/README.md b/README.md index 481ecc09..b991d17c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ # Heavy Compiler Collection (hvcc) [![Build Status](https://github.com/Wasted-Audio/hvcc/actions/workflows/build.yml/badge.svg)](https://github.com/Wasted-Audio/hvcc/actions) +[![pypi](https://img.shields.io/pypi/v/hvcc.svg)](https://pypi.python.org/pypi/hvcc) +[![python](https://img.shields.io/pypi/pyversions/hvcc.svg)](https://pypi.python.org/pypi/hvcc) `hvcc` is a python-based dataflow audio programming language compiler that generates C/C++ code and a variety of specific framework wrappers. @@ -12,9 +14,36 @@ The goal was to leverage Pure Data as a design interface and statically interpre It has since then been expanded to provide further support for many different platforms and frameworks, targeting game audio design, daw plugins and embedded production tools. In 2021 Wasted Audio took over maintenance of the project. +## Documentation + +* [Introduction](/docs/01.introduction.md) + * [What is heavy?](/docs/01.introduction.md#what-is-heavy) + * [Supported patch formats](/docs/01.introduction.md#supported-patch-formats) + * [Supported platforms](/docs/01.introduction.md#supported-platforms) + * [Supported frameworks](/docs/01.introduction.md#supported-frameworks) + * [Licensing](/docs/01.introduction.md#licensing) +* [Getting Started](/docs/02.getting_started.md) +* [Generators](/docs/03.generators.md) +* [MIDI](/docs/04.midi.md) +* [C API](/docs/05.c.md) +* [C++ API](/docs/06.cpp.md) +* [Heavy Lang Info](/docs/07.heavy_lang.md) +* [Heavy IR Info](/docs/08.heavy_ir_lang.md) +* [Supported vanilla objects](/docs/09.supported_vanilla_objects.md) +* [Unsupported vanilla objects](/docs/10.unsupported_vanilla_objects.md) + +## Integrations + +hvcc has been integrated into several projects and services. This allows to easily compile patches without having to install hvcc manually. + +* [plugdata](https://plugdata.org/) - a new way to use Pure Data. Includes a full toolchain and targets Daisy, DPF and pd externals. +* [mod-cloud-builder](https://github.com/moddevices/mod-cloud-builder) - An online service for building LV2 plugins for the MOD platform. +* [OWL Patch Library](https://www.rebeltech.org/patch-library) - An online service for building OWL plugins (uses an old fork). + ## Requirements -* python 3.7 or higher +python 3.8 until 3.12 + * `jinja2` (for generator templating) * `importlib_resources` (for reading static resources) * `json2daisy` (for daisy integration) @@ -113,24 +142,6 @@ This can be changed with `--copyright` parameter Displays all the available parameters and options for hvcc. -## Documentation - -* [Introduction](/docs/01.introduction.md) - * [What is heavy?](/docs/01.introduction.md#what-is-heavy) - * [Supported patch formats](/docs/01.introduction.md#supported-patch-formats) - * [Supported platforms](/docs/01.introduction.md#supported-platforms) - * [Supported frameworks](/docs/01.introduction.md#supported-frameworks) - * [Licensing](/docs/01.introduction.md#licensing) -* [Getting Started](/docs/02.getting_started.md) -* [Generators](/docs/03.generators.md) -* [MIDI](/docs/04.midi.md) -* [C API](/docs/05.c.md) -* [C++ API](/docs/06.cpp.md) -* [Heavy Lang Info](/docs/07.heavy_lang.md) -* [Heavy IR Info](/docs/08.heavy_ir_lang.md) -* [Supported vanilla objects](/docs/09.supported_vanilla_objects.md) -* [Unsupported vanilla objects](/docs/10.unsupported_vanilla_objects.md) - ## Contact There are several places where heavy/hvcc conversation is happening: diff --git a/docs/01.introduction.md b/docs/01.introduction.md index 03736d94..f15e3491 100644 --- a/docs/01.introduction.md +++ b/docs/01.introduction.md @@ -25,7 +25,7 @@ Heavy can interpret and convert a subset of features from Pure Data patches: ## Supported Platforms -* Windows 8, 10 and WSA +* Windows 10, 11 and WSA * Mac OSX * Linux * PS4 diff --git a/docs/02.getting_started.md b/docs/02.getting_started.md index c8e2496f..9d9c65ea 100644 --- a/docs/02.getting_started.md +++ b/docs/02.getting_started.md @@ -80,9 +80,24 @@ Heavy will also perform patch analysis to look for common mistakes and inconsite If you experience any problems or have some thoughts on how to improve heavy make sure to browse and contribute to our [public issue tracker](https://github.com/Wasted-Audio/hvcc/issues). +## Tips and Tricks + +Just because pd-vanilla can run your patch, does not mean it will behave exactly the same using Heavy. Extra care needs to be taken when dealing with control messages and certain PD object features. + +* Make sure to go over the [known limitations](#known-limitations) to see if you are using objects incorrectly. +* Try to move as much of your patch into the signal domain as you can. Heavy is optimized for signal processing and every control rate operation can introduce interruptions and additional delay. Use control logic at the very beginning or the very end of the dataflow if possible. +* Make sure the order in your control flow works as intended. Use `[t]`/trigger objects to force the correct order of operations. +* When using Daisy the receive objects continuously output control messages, which can potentially interrupt your intended behavior. +* If you run into problems with a patch try to reduce it in order to localize the problem to a specific object or use-case before reporting an issue. + ## Known Limitations +This list will be continuously epanded to document differences in object behavior between PD and Heavy. + +* Many objects do not take control signals on their left inlet. `[osc~]` for instance always requires the use of `[sig~]` before connecting a value. +* Heavy does not support symbols in `[pack]`. e.g. `[pack s f]`. * Heavy does not support numbers in `[unpack]`, e.g. `[unpack 0 0]` gives `Heavy only supports arguments 'f' and 's' to unpack.` Workaround is to use `f` instead, e.g. `[unpack f f]`, and if necessary prime the default values with a `[loadbang]` and `[0 0(`. +* Sliders and number inputs are converted to `[f ]` and thus do not store send/receive/initialization/etc. settings. * Heavy does not accept arguments and control connections to: `[rzero~]`, `[rzero_rev~]`, `[czero~]`, `[czero_rev~]`. In Heavy, these objects accept only signal inputs. Arguments and control connections are ignored. * On the `[select]` object it is currently not possible to set the arguments via the right inlet (internally a hardcoded switch_case is used). * `[metro]` and `[timer]` objects do not accept tempo messages or unit arguments. diff --git a/docs/03.gen.daisy.md b/docs/03.gen.daisy.md index 3b92c859..362e5c26 100644 --- a/docs/03.gen.daisy.md +++ b/docs/03.gen.daisy.md @@ -2,15 +2,15 @@ Daisy is an embedded platform for music. It features everything you need for creating high fidelity audio hardware devices. -This Generator is typically it is used in combination with [pd2dsy](https://github.com/electro-smith/pd2dsy). - Currently daisy platform is supported for: -* `field` * `seed` * `pod` * `petal` * `patch` +* `patch_init` +* `patch_sm` +* `field` Which can be configured using the `-m` metadata.json `daisy.board` setting: @@ -34,6 +34,26 @@ The custom layout can be passed on via the meta.json as such: } ``` +You can also set a custom path to your libDaisy directory. This can either be a string to the full or relative path or a number indicating the levels deep this directory is compared to the output directory. The default value for this is `2`. + +```json +{ + "daisy": { + "libdaisy_path": "/somewhere/libdaisy/" + } +} +``` + +Or the level: + +```json +{ + "daisy": { + "libdaisy_path": 5 + } +} +``` + ## MIDI Board files that have `OOPSY_TARGET_HAS_MIDI_INPUT` configured will automatically set up UART MIDI on the default USART1 Rx and Tx pins of the Daisy (D13/14). @@ -50,6 +70,8 @@ Additionally `usb_midi`, running on the onboard micro-usb, can be enabled separa At the moment all midi messages will be merged between USB and UART MIDI interfaces. In the future it will likely be possible to assign additional UART pins and group them under a specific PD midi "port". +Currently supported MIDI messages are: Note On/Off, Poly Aftertouch, Control Change, Program Change, Channel Pressure, Pitch Bend, and Midi Realtime messages. + ## [print] object Printing to serial console can be enabled using the `debug_printing` flag in the meta.json: @@ -63,3 +85,33 @@ Printing to serial console can be enabled using the `debug_printing` flag in the ``` This will increase the program size with a few kb and will disable `usb_midi` as we currently do not have composite USB device yet. + +## Custom samplerate and blocksize + +This can be done by adding either to the meta.json: + +```json +{ + "daisy": { + "samplerate": 96000, + "blocksize": 128 + } +} +``` + +Do note that the samplerate will be automatically set to either 16k, 32k, 48k, or 96k. Blocksize will need to be 256 or less and is automatically capped. + +## Custom Linker script and Bootloader APP_TYPE + +Using the Daisy bootloader you can flash the program to other parts of the Daisy memory. Read the [libDaisy documentation](https://github.com/electro-smith/libDaisy/blob/master/doc/md/_a7_Getting-Started-Daisy-Bootloader.md) for more information. + +The linker and `APP_TYPE` can be set in the json metadata accordingly: + +```json +{ + "daisy": { + "linker_script": , + "bootloader": + } +} +``` \ No newline at end of file diff --git a/docs/03.gen.wwise.md b/docs/03.gen.wwise.md index 71c69202..e4db9337 100644 --- a/docs/03.gen.wwise.md +++ b/docs/03.gen.wwise.md @@ -1,22 +1,30 @@ # Wwise -## Version Support +`hvcc` will generate a Wwise plugin project that can be built with Audiokinetic's build system, see [Using the Development Tools](https://www.audiokinetic.com/en/library/edge/?source=SDK&id=effectplugin_tools.html). This system can generate project files for all supported platforms, as well as package the plugin for distribution with Wwise Launcher. Please refer to the official documentation for more details. -`hvcc` will generate a Wwise plugin project that links against a particular Wwise SDK version. +The minimum required SDK version is `2022.1.x` or higher. -The default is currently `2017.2.2.6553`, however if it's necessary to link against a different Wwise SDK, change the value of `wwise_sdk_version` in the c2wwise generator (found [here](https://github.com/Wasted-Audio/hvcc/blob/master/generators/c2wwise/c2wwise.py#L58)) to the required SDK version string. +## Feature Overview -## Source Generator or FX Unit +Heavy currently supports the following Wwise features: + +- Source or Effect plugins +- Using uncompressed audio to build samplers +- Input parameters are RTPC-controllable +- Output parameters can set RTPC in Wwise +- Output events can post arbitrary events in Wwise from the plugin -The type of plugin that **heavy** generates is dynamically determined depending on the [I/O channel configuration](02.getting_started.md#audio-input-output). +![Feature overview](img/docs_wwise_overview.png) + +## Source Generator or FX Unit -If an `[adc~]` object exists in the patch the generated plugin with be an FX unit. Otherwise it'll be a source generator plugin. +The type of plugin that **heavy** generates is dynamically determined depending on the [I/O channel configuration](02.getting_started.md#audio-input-output). If an `[adc~]` object exists in the patch the generated plugin with be an FX unit. Otherwise it'll be a source generator plugin. ## RTPCs The Wwise target supports both [input and output parameters](02.getting_started.md#exposing-parameters). -![rtpcs](img/docs_wwise_params.png) +![Send param](img/docs_wwise_params.png) ### Input Parameters @@ -24,176 +32,129 @@ Exposing an input parameter will automatically generate a Slider UI in the plugi ### Output Parameters -Sending a `single float value` to an output parameters will in turn cause the corresponding Global RTPC of the same name to be set. - -This is useful for letting the plugins control other behaviours within the game system. - -**Note**: it's important that the naming of the output parameter and the global RTPC set up in Wwise are exactly the same. - -The example patch below describes a simple envelope follower: - -![authoring_plugin](img/docs_wwise_env.png) - -## Authoring Plugin Installation - -### Authoring Assets - -The Authoring plugin is what shows up in the Wwise Authoring interface, you can assign this plugin to Sound SFX objects and hook up RTPCs to its parameters. - -### Runtime Assets - -The runtime components are used by the Wwise integration engine, these are the files that will be actually used by your game or application. We provide both a dynamic plugin that can be easily loaded into development engines like Unity and Unreal, as well a static library that can be compiled directly into the Wwise Integration. +Sending a `single float value` to an output parameters will in turn cause the corresponding RTPC of the same name to be set. It will be set on the same game object. **Note**: it's important that the naming of the output parameter and the global RTPC set up in Wwise are exactly the same. -### Windows Authoring 32bit +The example patch below describes a simple envelope follower that can be used to modulate other parameters of the same voice: -Take the following files found in the `Wwise Win32` target: +![Envelope follower with an output RTPC](img/docs_wwise_env.png) -* `HV_{PATCH_NAME}_WwiseSourceAuthPlugin.dll` -* `HV_{PATCH_NAME}_WwiseSourceAuthPlugin.xml` +### Posting Wwise Events from the Plugin -And place them in the following location: +Sending any message to an output event will post a Wwise event with the same name on the same game object. This can be used, for example, to trigger events in Wwise in response to RTPC changes, or to implement a generative event triggering system. -* `C:\Program Files (x86)\Audiokinetic\Wwise 2017.1.0.6302\Authoring\Win32\Release\bin\plugins` +Note, in some situations, Heavy may only be able to send one output message per tick, e.g. posting an event and setting an RTPC at the same time won't be possible. To work around this, you can spread these actions apart with a `[delay 1]` node, for example. -### Windows Authoring 64bit +### Multi-channel plugins -Take the following files found in the `Wwise Win64` target: +The plugin supports the following channel configurations: -* `HV_{PATCH_NAME}_WwiseSourceAuthPlugin.dll` -* `HV_{PATCH_NAME}_WwiseSourceAuthPlugin.xml` +- AK_SPEAKER_SETUP_MONO +- AK_SPEAKER_SETUP_STEREO +- AK_SPEAKER_SETUP_5POINT1 +- AK_SPEAKER_SETUP_7POINT1 +- AK_SPEAKER_SETUP_DOLBY_7_1_4 -And place them in one of the following locations: +An appropriate configuration will be selected at compile time based on the number of inputs and outputs in a patch (e.g. `[adc~ 1 2 3 4 5 6]` will create a 5.1 plugin). As this information is compiled in, the plugins can only be used on busses with corresponding channel configurations and will print an error if used elsewhere. To work around this, you can enforce bus channel configuration in the 'General Settings' tab. -* `C:\Program Files (x86)\Audiokinetic\Wwise 2017.1.0.6302\Authoring\x64\Release\bin\plugins` +## Example: Building Your Plugin on Windows -### Mac OSX Authoring +### Installing Visual Studio and Required Components -The Wwise Authoring application for Mac OSX uses a Wine wrapper and therefore requires plugin binaries compiled for Windows. +To build Authoring and Engine plugins on Windows you’ll need: -Take the following files found in the `Wwise Win32` target: +- If using Visual Studio 2019: + - Desktop development with C++ workload + - MSVC v142 - VS 2019 C++ x64/x86 build tools + - C++ ATL for latest v142 build tools (x86 & x64) + - C++ MFC for latest v142 build tools (x86 & x64) + - Windows Universal CRT SDK + - Windows 10 SDK (10.0.19041.0) + - Different version can be specified in a generated + PremakePlugin.lua file +- If using Visual Studio 2022 + - Requirements are the same as for 2019, but components of version v143 must be installed instead + - *Note:* Wwise of version at least 2022.1.5 is required to build plugins with this version of Visual Studio +- Wwise 2022 or later + - Version 2021 should work, too, but it wasn't tested + - SDKs with required deployment platforms must be installed through + Wwise Launcher -* `HV_{PATCH_NAME}_WwiseSourceAuthPlugin.dll` -* `HV_{PATCH_NAME}_WwiseSourceAuthPlugin.xml` +### Converting a Pure Data Patch to C++ Code -And place them in the following location: +Let's say we've got a Pd patch HvccTestFX71.pd which was saved on a Desktop. These commands will generate code for this patch and place it in *Hvcc_Out_Dir* directory: -* `/Applications/Audiokinetic/Wwise 2017.1.0.6302/Wwise.app/Contents/SharedSupport/Wwise2016/support/wwise/drive_c/Program Files/Audiokinetic/Wwise/Authoring/Win32/Release/bin/plugins/` - -After installing the plugins the Wine cache will need to be refreshed, in a command-line application like Terminal run the following commands: - -```bash -cd "/Applications/Audiokinetic/Wwise 2017.1.0.6302/Wwise.app/Contents/SharedSupport/Wwise2017/" +```cmd +cd C:\Users\login\Desktop +hvcc HvccTestFX71.pd -o Hvcc_Out_Dir -g wwise -n HvccTestFX71 ``` -```bash -CX_ROOT="/Applications/Audiokinetic/Wwise 2017.1.0.6302/Wwise.app/Contents/SharedSupport/Wwise2017/" WINEPREFIX="/Applications/Audiokinetic/Wwise 2017.1.0.6302/Wwise.app/Contents/SharedSupport/Wwise2017/support/wwise/" ./bin/wineprefixcreate --snapshot -``` - -Note: for different versions of Wwise make sure to edit the command text to include the relevant version string (`Wwise 2017.1.0.6302`). - -## Adding a Source Plugin - -![source_plugin](img/docs_wwise_source_plug.gif) - -## Unity Integration - -### Setting up the projects - -First create a new Wwise project, add a Source plugin to a game object, create an Event to trigger it and add it to a Soundbank. - -Then create a new Unity project, add the Wwise Unity integration package, reference your Wwise authoring application and previously created project. - -Add an empty GameObject to your scene, add an AKBank and AKEvent object and initialise them with ones created in your Wwise project. +### Building C++ Code -After following the instructions below to install the plugin, make sure your soundbanks have been generated and press play in the Unity editor. +Heavy generates a project compatible with Audiokinetic's [Development Tools](https://www.audiokinetic.com/en/library/edge/?source=SDK&id=effectplugin_tools.html), which can build the plugins for all supported platforms, see the documentation for more details. **Important:** Please close any running Wwise Authoring instance as it'll prevent the plugin from being built. -### Windows 32bit +Change into the generated directory: -From the `Wwise Windows 32bit` target take the following file: - -* `HV_{PATCH_NAME}_WwiseSourcePlugin.dll` - -And place it in the following directory: - -* `{UNITY_PROJECT}/Assets/Wwise/Deployment/Plugins/Windows/x86/DSP/` - -### Windows 64bit - -From the `Wwise Windows 64bit` target take the following file: - -* `HV_{PATCH_NAME}_WwiseSourcePlugin.dll` - -And place it in the following directory: - -* `{UNITY_PROJECT}/Assets/Wwise/Deployment/Plugins/Windows/x86_64/DSP/` - -### Mac OSX - -From the `Wwise macOS 64bit` target take the following file from the `/osx/x86_64/Release/` directory: - -* `libHV_{PATCH_NAME}_WwiseSourcePlugin.bundle` - -And place it in the following directory: - -* `{UNITY_PROJECT}/Assets/Wwise/Deployment/Plugins/Mac/DSP/` - -*Note: the Mac OSX builds are 64bit only.* - -### iOS - -From the `Wwise iOS armv7a` target take the downloaded files: +```cmd +cd Hvcc_Out_Dir\wwise +``` -* `libHV_{PATCH_NAME}_WwiseSourcePluginFactory.h` -* `libHV_{PATCH_NAME}_WwiseSourcePlugin.a` +Generate Visual Studio project files; note, WWISEROOT environment variable can be set from Wwise Launcher by clicking on *Set Environment Variables* button in front of an installed Wwise entry: -And place it in the following directory: +```cmd +python %WWISEROOT%\Scripts\Build\Plugins\wp.py premake Authoring +python %WWISEROOT%\Scripts\Build\Plugins\wp.py premake Windows_vc160 +``` -* `{UNITY_PROJECT}/Assets/Wwise/Deployment/Plugins/iOS/DSP/` +Build Authoring and Engine plugins in Release configurations; for Visual Studio 2022 replace vc160 with vc170: -## Compiling the Plugin +```cmd +python %WWISEROOT%\Scripts\Build\Plugins\wp.py build -c Release -x x64 -t vc160 Authoring +python %WWISEROOT%\Scripts\Build\Plugins\wp.py build -c Release -x x64 -t vc160 Windows_vc160 +``` -Each platform has its own way of compiling the plugins. +At this point, the plugins should be placed in correct SDK directories and be ready for use in the Authoring app. -### Mac OSX +### Optional: Packaging the Binaries for Wwise Launcher -An Xcode project exists in the `unity/xcode` directory and the plugin may be built manually. It can also be compiled directly from the commandline. +We can go a step further and package the plugins into a bundle that can be installed conveniently from Wwise Launcher. -```bash -$ cd unity/xcode -$ xcodebuild -project Hv_heavy_WwiseSourcePlugin.xcodeproj -target Hv_heavy_WwiseSourcePlugin -arch x86_64 +```cmd +python %WWISEROOT%\Scripts\Build\Plugins\wp.py package --version 2022.1.0.1 Authoring +python %WWISEROOT%\Scripts\Build\Plugins\wp.py package --version 2022.1.0.1 Windows_vc160 +python %WWISEROOT%\Scripts\Build\Plugins\wp.py generate-bundle --version 2022.1.0.1 +mkdir Bundle +copy /y bundle.json Bundle +copy /y *.tar.xz Bundle ``` -The results are placed in `unity/build/macos/x86_64/Release`. +The *Bundle* directory now contains a packaged plugin you can install through Wwise Launcher, see Wwise Version -> Manage Plug-ins -> Install from directory / Install from archive. + +## Example: Building Your Plugin on Linux -### iOS +Building Linux plugin binaries is relatively easy. It requires python3 to be installed. +Also make sure the Linux SDK is in a path without spaces or special characters. -An Xcode project exists in the `unity/xcode` directory and the plugin may be built manually. It can also be compiled directly from the commandline. +Then make sure the `premake5` binary in the SDK has the executable flag set: ```bash -$ cd unity/xcode -$ xcodebuild -project Hv_heavy_WwiseSourcePlugin.xcodeproj -target Hv_heavy_WwiseSourcePlugin -arch armv7s +$ chmod +x Tools/Linux/bin/premake5 ``` -The results are placed in `unity/build/macos/armv7s/Release`. - -### Linux +Now run the premake and build commands from your hvcc output directory: ```bash -$ cd unity/linux -$ make -j +$ cd /wwise/ +/wwise$ python3 /Scripts/Build/Plugins/wp.py premake Linux +/wwise$ python3 /Scripts/Build/Plugins/wp.py build -c Release -x x64 Linux ``` -The results are placed in `unity/build/linux/x86_64/release`. +This will put a plugin build into your `/SDK/Linux_x64/Release/bin/` directory. -### Windows - -A Visual Studio 2015 project exists in the `unity/vs2015` directory and the plugin may be built manually. It can also be compiled directly from the commandline. +To create a package and bundle subsequently do the following: ```bash -$ cd unity/vs2015 -$ "C:/Program Files (x86)/MSBuild/14.0/Bin/MSBuild.exe" /property:Configuration=Release /property:Platform=x64 /t:Rebuild Hv_heavy_WwiseSourcePlugin.sln /m +/wwise$ python3 /Scripts/Build/Plugins/wp.py package -v Linux +/wwise$ python3 /Scripts/Build/Plugins/wp.py generate-bundle -v +/wwise$ mkdir Bundle +/wwise$ cp bundle.json *.tar.xz Bundle/ ``` - -The results are placed in `unity/build/win/x64/Release`. - -Plugins for x86 may also be built by specifying `/property:Platform=x86`. diff --git a/docs/09.supported_vanilla_objects.md b/docs/09.supported_vanilla_objects.md index e3f09221..6a98bc30 100644 --- a/docs/09.supported_vanilla_objects.md +++ b/docs/09.supported_vanilla_objects.md @@ -124,6 +124,7 @@ wrap /~ abs~ adc~ +bang~ biquad~ bp~ catch~ diff --git a/docs/10.unsupported_vanilla_objects.md b/docs/10.unsupported_vanilla_objects.md index 393b5b39..783c8a68 100644 --- a/docs/10.unsupported_vanilla_objects.md +++ b/docs/10.unsupported_vanilla_objects.md @@ -67,7 +67,6 @@ value ## Signal Objects ```list -bang~ block~ bob~ bonk~ diff --git a/docs/img/docs_wwise_overview.png b/docs/img/docs_wwise_overview.png new file mode 100644 index 00000000..eaf4d206 Binary files /dev/null and b/docs/img/docs_wwise_overview.png differ diff --git a/hvcc/generators/buildjson/__init__.py b/hvcc/generators/buildjson/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/hvcc/generators/buildjson/buildjson.py b/hvcc/generators/buildjson/buildjson.py deleted file mode 100644 index 752b4f35..00000000 --- a/hvcc/generators/buildjson/buildjson.py +++ /dev/null @@ -1,85 +0,0 @@ -# Copyright (C) 2014-2018 Enzien Audio, Ltd. -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -from collections import defaultdict -import json -import os -from typing import Dict, List, Optional - -# generate build configuration files for use with https://github.com/enzienaudio/courtesan -# Example arguments: -# macos_x64_args=["-project", "Hv_test_WwiseSourcePlugin.xcodeproj", "-arch", "x86_64", "-alltargets"] -# android_armv7a_args=["APP_ABI=armeabi-v7a", "-j"] -# win_x64_args=["/property:Configuration=Release", "/property:Platform=x64", -# "/t:Rebuild", "Hv_{0}_Unity.sln".format(patch_name), "/m"] - - -def generate_json( - out_dir: str, - android_armv7a_args: Optional[List] = None, - ios_armv7a_args: Optional[List] = None, - linux_armv7a_args: Optional[List] = None, - linux_x64_args: Optional[List] = None, - macos_x64_args: Optional[List] = None, - win_x64_args: Optional[List] = None, - win_x86_args: Optional[List] = None -) -> None: - build_json: Dict = defaultdict(dict) - - if android_armv7a_args: - build_json["android"]["armv7a"] = { - "args": [android_armv7a_args], - "projectDir": ["android", "jni"], - "binaryDir": ["android", "libs", "armeabi-v7a"] - } - if ios_armv7a_args: - build_json["ios"]["armv7a"] = { - "args": [ios_armv7a_args], - "projectDir": ["xcode"], - "binaryDir": ["build", "ios", "armv7s", "Release"] - } - if linux_armv7a_args: - build_json["linux"]["armv7a"] = { - "args": [linux_armv7a_args], - "projectDir": ["linux"], - "binaryDir": ["build", "linux", "armv7a", "release"] - } - if linux_x64_args: - build_json["linux"]["x64"] = { - "args": [linux_x64_args], - "projectDir": ["linux"], - "binaryDir": ["build", "linux", "x64", "release"] - } - if macos_x64_args: - build_json["macos"]["x64"] = { - "args": [macos_x64_args], - "projectDir": ["xcode"], - "binaryDir": ["build", "macos", "x86_64", "Release"] - } - if win_x64_args: - build_json["win"]["x64"] = { - "args": [win_x64_args], - "projectDir": ["vs2015"], - "binaryDir": ["build", "win", "x64", "Release"] - } - if win_x86_args: - build_json["win"]["x86"] = { - "args": [win_x86_args], - "projectDir": ["vs2015"], - "binaryDir": ["build", "win", "x86", "Release"] - } - - with open(os.path.join(out_dir, "build.json"), "w") as f: - json.dump(build_json, f) diff --git a/hvcc/generators/c2daisy/c2daisy.py b/hvcc/generators/c2daisy/c2daisy.py index 7cce9b44..490f5009 100644 --- a/hvcc/generators/c2daisy/c2daisy.py +++ b/hvcc/generators/c2daisy/c2daisy.py @@ -6,7 +6,6 @@ from typing import Dict, Optional -from ..buildjson import buildjson from ..copyright import copyright_manager from . import parameters @@ -14,10 +13,12 @@ hv_midi_messages = { "__hv_noteout", "__hv_ctlout", + "__hv_polytouchout", "__hv_pgmout", "__hv_touchout", "__hv_bendout", - "__hv_midiout" + "__hv_midiout", + "__hv_midioutport" } @@ -84,9 +85,29 @@ def compile( component_glue['header'] = f"HeavyDaisy_{patch_name}.hpp" component_glue['max_channels'] = board_info['channels'] component_glue['num_output_channels'] = num_output_channels + component_glue['has_midi'] = board_info['has_midi'] component_glue['debug_printing'] = daisy_meta.get('debug_printing', False) component_glue['usb_midi'] = daisy_meta.get('usb_midi', False) - component_glue['has_midi'] = board_info['has_midi'] + + # samplerate + samplerate = daisy_meta.get('samplerate', 48000) + if samplerate >= 96000: + component_glue['samplerate'] = 96000 + elif samplerate >= 48000: + component_glue['samplerate'] = 48000 + elif samplerate >= 32000: + component_glue['samplerate'] = 32000 + elif samplerate >= 16000: + component_glue['samplerate'] = 16000 + else: + component_glue['samplerate'] = 8000 + + # blocksize + blocksize = daisy_meta.get('blocksize') + if blocksize: + component_glue['blocksize'] = max(min(256, blocksize), 1) + else: + component_glue['blocksize'] = None component_glue['copyright'] = copyright_c @@ -106,8 +127,14 @@ def compile( makefile_replacements['linker_script'] = daisy_meta.get('linker_script', '') if makefile_replacements['linker_script'] != '': makefile_replacements['linker_script'] = daisy_meta["linker_script"] - depth = daisy_meta.get('libdaisy_depth', 2) - makefile_replacements['libdaisy_path'] = f'{"../" * depth}libdaisy' + + # libdaisy path + path = daisy_meta.get('libdaisy_path', 2) + if isinstance(path, int): + makefile_replacements['libdaisy_path'] = f'{"../" * path}libdaisy' + elif isinstance(path, str): + makefile_replacements['libdaisy_path'] = path + makefile_replacements['bootloader'] = daisy_meta.get('bootloader', '') makefile_replacements['debug_printing'] = daisy_meta.get('debug_printing', False) @@ -117,10 +144,6 @@ def compile( # ====================================================================================== - buildjson.generate_json( - out_dir, - linux_x64_args=["-j"]) - return { "stage": "c2daisy", "notifs": { diff --git a/hvcc/generators/c2daisy/templates/HeavyDaisy.cpp b/hvcc/generators/c2daisy/templates/HeavyDaisy.cpp index 1c55ffb1..72190bfe 100644 --- a/hvcc/generators/c2daisy/templates/HeavyDaisy.cpp +++ b/hvcc/generators/c2daisy/templates/HeavyDaisy.cpp @@ -4,11 +4,12 @@ #include "Heavy_{{patch_name}}.hpp" #include "HeavyDaisy_{{patch_name}}.hpp" -#define SAMPLE_RATE 48000.f +#define SAMPLE_RATE {{samplerate}}.f {% if has_midi or usb_midi %} #define HV_HASH_NOTEIN 0x67E37CA3 #define HV_HASH_CTLIN 0x41BE0f9C +#define HV_HASH_POLYTOUCHIN 0xBC530F59 #define HV_HASH_PGMIN 0x2E1EA03D #define HV_HASH_TOUCHIN 0x553925BD #define HV_HASH_BENDIN 0x3083F0F7 @@ -17,6 +18,7 @@ #define HV_HASH_NOTEOUT 0xD1D4AC2 #define HV_HASH_CTLOUT 0xE5e2A040 +#define HV_HASH_POLYTOUCHOUT 0xD5ACA9D1 #define HV_HASH_PGMOUT 0x8753E39E #define HV_HASH_TOUCHOUT 0x476D4387 #define HV_HASH_BENDOUT 0xE8458013 @@ -46,6 +48,8 @@ FIFO, 64> event_log; {% elif usb_midi %} daisy::MidiUsbHandler midiusb; {% endif %} +// int midiOutCount; +// uint8_t* midiOutData; void CallbackWriteIn(Heavy_{{patch_name}}& hv); void LoopWriteIn(Heavy_{{patch_name}}& hv); void CallbackWriteOut(); @@ -95,8 +99,43 @@ DaisyHvParamOut DaisyOutputParameters[DaisyNumOutputParameters] = { // Typical Switch case for Message Type. void HandleMidiMessage(MidiEvent m) { + for (int i = 0; i <= 2; ++i) { + hv.sendMessageToReceiverV(HV_HASH_MIDIIN, 0, "ff", + (float) m.data[i], + (float) m.channel); + } + switch(m.type) { + case SystemRealTime: { + float srtType; + + switch(m.srt_type) + { + case TimingClock: + srtType = MIDI_RT_CLOCK; + break; + case Start: + srtType = MIDI_RT_START; + break; + case Continue: + srtType = MIDI_RT_CONTINUE; + break; + case Stop: + srtType = MIDI_RT_STOP; + break; + case ActiveSensing: + srtType = MIDI_RT_ACTIVESENSE; + break; + case Reset: + srtType = MIDI_RT_RESET; + break; + } + + hv.sendMessageToReceiverV(HV_HASH_MIDIREALTIMEIN, 0, "ff", + (float) srtType); + break; + } case NoteOff: { NoteOnEvent p = m.AsNoteOn(); hv.sendMessageToReceiverV(HV_HASH_NOTEIN, 0, "fff", @@ -113,6 +152,14 @@ void HandleMidiMessage(MidiEvent m) (float) p.channel); break; } + case PolyphonicKeyPressure: { // polyphonic aftertouch + PolyphonicKeyPressureEvent p = m.AsPolyphonicKeyPressure(); + hv.sendMessageToReceiverV(HV_HASH_POLYTOUCHIN, 0, "fff", + (float) p.pressure, // pressure + (float) p.note, // note + (float) p.channel); + break; + } case ControlChange: { ControlChangeEvent p = m.AsControlChange(); hv.sendMessageToReceiverV(HV_HASH_CTLIN, 0, "fff", @@ -153,6 +200,12 @@ void HandleMidiMessage(MidiEvent m) int main(void) { hardware.Init(true); + {% if samplerate %} + hardware.SetAudioSampleRate({{samplerate}}); + {% endif %} + {% if blocksize %} + hardware.SetAudioBlockSize({{blocksize}}); + {% endif %} {% if has_midi %} MidiUartHandler::Config midi_config; hardware.midi.Init(midi_config); @@ -277,6 +330,22 @@ void HandleMidiSend(uint32_t sendHash, const HvMessage *m) HandleMidiOut(midiData, numElements); break; } + case HV_HASH_POLYTOUCHOUT: + { + uint8_t value = hv_msg_getFloat(m, 0); + uint8_t note = hv_msg_getFloat(m, 1); + uint8_t ch = hv_msg_getFloat(m, 2); + ch %= 16; // drop any pd "ports" + + const uint8_t numElements = 3; + uint8_t midiData[numElements]; + midiData[0] = 0xA0 | ch; // send Poly Aftertouch + midiData[1] = note; + midiData[2] = value; + + HandleMidiOut(midiData, numElements); + break; + } case HV_HASH_CTLOUT: { uint8_t value = hv_msg_getFloat(m, 0); @@ -338,26 +407,24 @@ void HandleMidiSend(uint32_t sendHash, const HvMessage *m) HandleMidiOut(midiData, numElements); break; } - case HV_HASH_MIDIOUT: // __hv_midiout - { - const uint8_t numElements = m->numElements; - uint8_t midiData[numElements]; - if (numElements <=4 ) - { - for (int i = 0; i < numElements; ++i) - { - midiData[i] = hv_msg_getFloat(m, i); - } - } - else - { - // we do not support sysex yet - break; - } - - HandleMidiOut(midiData, numElements); - break; - } + // not functional yet + // case HV_HASH_MIDIOUT: // __hv_midiout + // { + // if (midiOutCount == 0 ) { + // uint8_t midiOutData[3]; + // } + + // midiOutData[midiOutCount] = hv_msg_getFloat(m, 0); + + // if (midiOutCount < 2) { + // midiOutCount++; + // break; + // } + + // HandleMidiOut(midiOutData, 3); + // midiOutCount = 0; + // break; + // } default: break; } diff --git a/hvcc/generators/c2dpf/templates/HeavyDPF.hpp b/hvcc/generators/c2dpf/templates/HeavyDPF.hpp index 4bc6e079..df6480cd 100644 --- a/hvcc/generators/c2dpf/templates/HeavyDPF.hpp +++ b/hvcc/generators/c2dpf/templates/HeavyDPF.hpp @@ -146,6 +146,10 @@ class {{class_name}} : public Plugin double nextClockTick; double sampleAtCycleStart; + // midi out buffer + int midiOutCount; + MidiEvent midiOutEvent; + // heavy context HeavyContextInterface *_context; diff --git a/hvcc/generators/c2dpf/templates/HeavyDPF_MIDI_Output.cpp b/hvcc/generators/c2dpf/templates/HeavyDPF_MIDI_Output.cpp index d7593ea2..cdaaa039 100644 --- a/hvcc/generators/c2dpf/templates/HeavyDPF_MIDI_Output.cpp +++ b/hvcc/generators/c2dpf/templates/HeavyDPF_MIDI_Output.cpp @@ -100,30 +100,22 @@ void {{class_name}}::handleMidiSend(uint32_t sendHash, const HvMessage *m) } case HV_HASH_MIDIOUT: // __hv_midiout { - const uint8_t numElements = m->numElements; - if (numElements <=4 ) - { - for (int i = 0; i < numElements; ++i) - { - midiSendEvent.data[i] = hv_msg_getFloat(m, i); - } - } - else - { - printf("> we do not support sysex yet \n"); - break; + if (midiOutCount == 0) { + midiOutEvent.frame = 0; + midiOutEvent.dataExt = nullptr; + // we don't support sysex + midiOutEvent.size = 4; } - // unsigned char* rawData = new unsigned char; - // for (int i = 0; i < numElements; ++i) { - // rawData[i] = (uint8_t) hv_msg_getFloat(m, i); - // printf("> data: %d \n", rawData[i]); - // } + midiOutEvent.data[midiOutCount] = hv_msg_getFloat(m, 0); - midiSendEvent.size = numElements; - // midiSendEvent.dataExt = (const uint8_t *) rawData; + if (midiOutCount < 3) { + midiOutCount++; + break; + } - writeMidiEvent(midiSendEvent); + writeMidiEvent(midiOutEvent); + midiOutCount = 0; break; } default: diff --git a/hvcc/generators/c2dpf/templates/HeavyDPF_PortGroups.cpp b/hvcc/generators/c2dpf/templates/HeavyDPF_PortGroups.cpp index 12c8417c..31d5a1da 100644 --- a/hvcc/generators/c2dpf/templates/HeavyDPF_PortGroups.cpp +++ b/hvcc/generators/c2dpf/templates/HeavyDPF_PortGroups.cpp @@ -10,8 +10,8 @@ void {{class_name}}::initAudioPort(bool input, uint32_t index, AudioPort& port) {%- for group, gConfig in meta.port_groups.input.items() %} {%- for port, value in gConfig.items() %} case {{value}}: - port.name = "Output {{port}} ({{group}})"; - port.symbol = "out_{{port|lower}}_{{group|lower}}"; + port.name = "Input {{port}} ({{group}})"; + port.symbol = "in_{{port|lower}}_{{group|lower}}"; port.groupId = kPortGroup{{group}}; break; {%- endfor %} diff --git a/hvcc/generators/c2dpf/templates/HeavyDPF_UI.cpp b/hvcc/generators/c2dpf/templates/HeavyDPF_UI.cpp index 01bb782f..8ab79302 100644 --- a/hvcc/generators/c2dpf/templates/HeavyDPF_UI.cpp +++ b/hvcc/generators/c2dpf/templates/HeavyDPF_UI.cpp @@ -6,6 +6,14 @@ START_NAMESPACE_DISTRHO // -------------------------------------------------------------------------------------------------------------------- +{%- if receivers|length > 0 %} +enum HeavyParams { + {%- for k, v in receivers %} + {{v.display|upper}}, + {%- endfor %} +}; +{%- endif %} + class ImGuiPluginUI : public UI { {% for k, v in receivers -%} @@ -51,7 +59,7 @@ class ImGuiPluginUI : public UI {%- if receivers|length > 0 %} switch (index) { {% for k, v in receivers -%} - case {{loop.index-1}}: + case {{v.display|upper}}: {%- if v.attributes.type == 'bool': %} f{{v.display|lower}} = value != 0.0f; {%- else %} @@ -105,8 +113,8 @@ class ImGuiPluginUI : public UI if (ImGui::Selectable({{enum_list}}[n], is_selected)) { f{{v_display}} = n; - editParameter({{loop.index-1}}, true); - setParameterValue({{loop.index-1}}, f{{v_display}}); + editParameter({{v.display|upper}}, true); + setParameterValue({{v.display|upper}}, f{{v_display}}); } if (is_selected) ImGui::SetItemDefaultFocus(); @@ -116,23 +124,25 @@ class ImGuiPluginUI : public UI {%- else %} {%- if v.attributes.type == 'bool': %} if (ImGui::Toggle("{{v.display.replace('_', ' ')}}", &f{{v_display}})) + {%- elif v.attributes.type == 'int' %} + if (ImGui::SliderInt("{{v.display.replace('_', ' ')}}", &f{{v_display}}, {{v.attributes.min}}f, {{v.attributes.max}}f)) {%- else %} if (ImGui::SliderFloat("{{v.display.replace('_', ' ')}}", &f{{v_display}}, {{v.attributes.min}}f, {{v.attributes.max}}f)) {%- endif %} { if (ImGui::IsItemActivated()) { - editParameter({{loop.index-1}}, true); - setParameterValue({{loop.index-1}}, f{{v_display}}); + editParameter({{v.display|upper}}, true); } + setParameterValue({{v.display|upper}}, f{{v_display}}); } {%- endif %} {% endfor %} if (ImGui::IsItemDeactivated()) { - {%- for i in range(0, receivers|length) %} - editParameter({{i}}, false); - {%- endfor %} + {%- for k, v in receivers -%} + editParameter({{v.display|upper}}, false); + {% endfor -%} } } ImGui::End(); diff --git a/hvcc/generators/c2owl/c2owl.py b/hvcc/generators/c2owl/c2owl.py index 5e94f234..908938bb 100644 --- a/hvcc/generators/c2owl/c2owl.py +++ b/hvcc/generators/c2owl/c2owl.py @@ -5,10 +5,9 @@ import jinja2 import json from typing import Dict, List, Optional -from ..buildjson import buildjson -from ..copyright import copyright_manager import hvcc.core.hv2ir.HeavyLangObject as HeavyLangObject +from ..copyright import copyright_manager heavy_hash = HeavyLangObject.HeavyLangObject.get_hash @@ -121,29 +120,7 @@ def compile( jdata=jdata, copyright=copyright_c)) - # generate list of Heavy source files - # files = os.listdir(out_dir) - # ====================================================================================== - # Linux - # - # linux_path = os.path.join(out_dir, "linux") - # os.makedirs(linux_path) - - # with open(os.path.join(out_dir, "Makefile"), "w") as f: - # f.write(env.get_template("Makefile").render( - # name=patch_name, - # class_name=f"HeavyOWL_{patch_name}")) - - buildjson.generate_json( - out_dir, - linux_x64_args=["-j"]) - # macos_x64_args=["-project", "{0}.xcodeproj".format(patch_name), "-arch", - # "x86_64", "-alltargets"], - # win_x64_args=["/property:Configuration=Release", "/property:Platform=x64", - # "/t:Rebuild", "{0}.sln".format(patch_name), "/m"], - # win_x86_args=["/property:Configuration=Release", "/property:Platform=x86", - # "/t:Rebuild", "{0}.sln".format(patch_name), "/m"]) return { "stage": "c2owl", diff --git a/hvcc/generators/c2unity/c2unity.py b/hvcc/generators/c2unity/c2unity.py index a4644716..09150b3e 100644 --- a/hvcc/generators/c2unity/c2unity.py +++ b/hvcc/generators/c2unity/c2unity.py @@ -21,7 +21,6 @@ from typing import Dict, Optional from ..copyright import copyright_manager -from ..buildjson import buildjson from ..filters import filter_string_cap, filter_templates, filter_xcode_build, filter_xcode_fileref @@ -100,17 +99,6 @@ def compile( compile_files=os.listdir(src_out_dir), copyright=copyright)) - buildjson.generate_json( - out_dir, - android_armv7a_args=["APP_ABI=armeabi-v7a", "-j"], - linux_x64_args=["-j"], - macos_x64_args=["-project", f"Hv_{patch_name}_Unity.xcodeproj", - "-arch", "x86_64", "-alltargets"], - win_x64_args=["/property:Configuration=Release", "/property:Platform=x64", - "/t:Rebuild", f"Hv_{patch_name}_Unity.sln", "/m"], - win_x86_args=["/property:Configuration=Release", "/property:Platform=x86", - "/t:Rebuild", f"Hv_{patch_name}_Unity.sln", "/m"]) - return { "stage": "c2unity", "notifs": { diff --git a/hvcc/generators/c2wwise/c2wwise.py b/hvcc/generators/c2wwise/c2wwise.py index 28f7bd85..aa53ab9b 100644 --- a/hvcc/generators/c2wwise/c2wwise.py +++ b/hvcc/generators/c2wwise/c2wwise.py @@ -20,9 +20,8 @@ import jinja2 from typing import Dict, Optional -from ..buildjson import buildjson from ..copyright import copyright_manager -from ..filters import filter_plugin_id, filter_xcode_build, filter_xcode_fileref +from ..filters import filter_plugin_id class c2wwise: @@ -32,123 +31,79 @@ class c2wwise: @classmethod def compile( - cls, - c_src_dir: str, - out_dir: str, - externs: Dict, - patch_name: Optional[str] = None, - patch_meta: Optional[Dict] = None, - num_input_channels: int = 0, - num_output_channels: int = 0, - copyright: Optional[str] = None, - verbose: Optional[bool] = False + cls, + c_src_dir: str, + out_dir: str, + externs: Dict, + patch_name: Optional[str] = None, + patch_meta: Optional[Dict] = None, + num_input_channels: int = 0, + num_output_channels: int = 0, + copyright: Optional[str] = None, + verbose: Optional[bool] = False ) -> Dict: - tick = time.time() in_parameter_list = externs["parameters"]["in"] out_parameter_list = externs["parameters"]["out"] event_list = externs["events"]["in"] + out_event_list = externs["events"]["out"] table_list = externs["tables"] - - out_dir = os.path.join(out_dir, "wwise") patch_name = patch_name or "heavy" - copyright_c = copyright_manager.get_copyright_for_c(copyright) copyright_xml = copyright_manager.get_copyright_for_xml(copyright) - wwise_sdk_version = "2017.2.2.6553" + templates_dir = os.path.join(os.path.dirname(__file__), "templates") + is_source_plugin = num_input_channels == 0 + plugin_type = "Source" if is_source_plugin else "FX" + plugin_id = filter_plugin_id(patch_name) + out_dir = os.path.join(out_dir, "wwise") if not os.path.exists(out_dir): os.makedirs(out_dir) - templates_dir = os.path.join(os.path.dirname(__file__), "templates") - plugin_type = "Source" if num_input_channels == 0 else "FX" - plugin_id = filter_plugin_id(patch_name) - env = jinja2.Environment() - env.filters["xcode_build"] = filter_xcode_build - env.filters["xcode_fileref"] = filter_xcode_fileref env.loader = jinja2.FileSystemLoader( encoding="utf-8-sig", searchpath=[templates_dir]) - try: + channel_config = None + if num_output_channels == 0: + # Workaround to support patches that don't have any outputs, + # e.g. that only ever set RTPCs or post events + channel_config = "AK_SPEAKER_SETUP_MONO" + elif num_output_channels == 1: + channel_config = "AK_SPEAKER_SETUP_MONO" + elif num_output_channels == 2: + channel_config = "AK_SPEAKER_SETUP_STEREO" + elif num_output_channels == 6: + channel_config = "AK_SPEAKER_SETUP_5POINT1" + elif num_output_channels == 8: + channel_config = "AK_SPEAKER_SETUP_7POINT1" + elif num_output_channels == 12: + channel_config = "AK_SPEAKER_SETUP_DOLBY_7_1_4" + else: + raise Exception("Wwise plugins support only mono, stereo, 5.1, 7.1, " + "and 7.1.4 (Atmos) configurations, number of [dac~] channels should be appropriate") + if plugin_type == "FX": - if num_input_channels > 2: - raise Exception("Wwise FX plugins support a maximum of 2 channels (i.e. [adc~ 1] or [adc~ 1 2]).") if num_input_channels != num_output_channels: raise Exception("Wwise FX plugins require the same input/output channel" "configuration (i.e. [adc~ 1] -> [dac~ 1]).") - # copy over generated C source files - patch_src_dir = os.path.join(out_dir, "source", "heavy") + patch_src_dir = os.path.join(out_dir, "SoundEnginePlugin", "Heavy") if os.path.exists(patch_src_dir): shutil.rmtree(patch_src_dir) shutil.copytree(c_src_dir, patch_src_dir) - # template all source files - src_extns = ["h", "hpp", "c", "cpp", "xml", "def", "rc", "plist"] - for f in env.list_templates(extensions=src_extns): + src_ext_list = ["h", "hpp", "c", "cpp", "xml", "def", "rc", "lua", "json"] + for f in env.list_templates(extensions=src_ext_list): file_dir = os.path.join(out_dir, os.path.dirname(f)) file_name = os.path.basename(f) - # ignore source plugin files if type is FX - if (file_dir.endswith("plugin_source") and plugin_type != "Source"): - continue - - # ignore fx plugin files if type is Source - elif (file_dir.endswith("plugin_fx") and plugin_type != "FX"): - continue - - # static files - if file_name in ["stdafx.h", "Info.plist"]: - file_path = os.path.join(file_dir, file_name) - - if not os.path.exists(os.path.dirname(file_path)): - os.makedirs(os.path.dirname(file_path)) - - shutil.copyfile(os.path.join(templates_dir, f), file_path) - - # templated files - else: - file_name = file_name.replace("{{name}}", patch_name) - file_name = file_name.replace("{{type}}", plugin_type) - file_path = os.path.join(file_dir, file_name) - - if not os.path.exists(os.path.dirname(file_path)): - os.makedirs(os.path.dirname(file_path)) - - with open(file_path, "w") as g: - g.write(env.get_template(f).render( - name=patch_name, - parameters=in_parameter_list, - sends=out_parameter_list, - events=event_list, - tables=table_list, - pool_sizes_kb=externs["memoryPoolSizesKb"], - plugin_type=plugin_type, - plugin_id=plugin_id, - copyright=copyright_xml if file_name.endswith(".xml") else copyright_c)) - - files = [f for f in os.listdir(patch_src_dir)] - - # template all ide project files - for f in env.list_templates(extensions=["vcxproj", "sln", "pbxproj", "xcconfig"]): - - # xcode projects are structured differently to visual studio projects - if f.endswith("pbxproj"): - xcode_proj_dir = os.path.splitext(os.path.dirname(f)) - file_path = os.path.join( - out_dir, - os.path.dirname(xcode_proj_dir[0]), - f"Hv_ {patch_name}_Wwise {plugin_type}" - f" {os.path.basename(xcode_proj_dir[0])} {xcode_proj_dir[1]}", - os.path.basename(f)) - else: - file_path = f.replace("{{name}}", patch_name) - file_path = file_path.replace("{{type}}", plugin_type) - file_path = os.path.join(out_dir, file_path.replace("{{type}}", plugin_type)) + file_name = file_name.replace("{{name}}", patch_name) + file_name = file_name.replace("{{plugin_type}}", plugin_type) + file_path = os.path.join(file_dir, file_name) if not os.path.exists(os.path.dirname(file_path)): os.makedirs(os.path.dirname(file_path)) @@ -157,52 +112,18 @@ def compile( g.write(env.get_template(f).render( name=patch_name, parameters=in_parameter_list, - sends=out_parameter_list, + out_params=out_parameter_list, + out_events=out_event_list, events=event_list, tables=table_list, + pool_sizes_kb=externs["memoryPoolSizesKb"], + is_source=is_source_plugin, + num_input_channels=num_input_channels, + num_output_channels=num_output_channels, + channel_config=channel_config, plugin_type=plugin_type, plugin_id=plugin_id, - wwise_version=wwise_sdk_version, - msbuild_version="140", - files=files)) - - # linux makefile - linux_makefile = os.path.join(out_dir, "linux", "Makefile") - - if not os.path.exists(os.path.dirname(linux_makefile)): - os.makedirs(os.path.dirname(linux_makefile)) - - with open(linux_makefile, "w") as g: - g.write(env.get_template("linux/Makefile").render( - name=patch_name, - plugin_type=plugin_type, - plugin_id=plugin_id, - files=files, - wwise_version=wwise_sdk_version)) - - proj_name = f"Hv_{patch_name}_Wwise{plugin_type}Plugin" - - buildjson.generate_json( - out_dir, - ios_armv7a_args=[ - "-arch", "armv7s", - "-target", f"{proj_name}_iOS", - "-project", f"{proj_name}.xcodeproj"], - linux_x64_args=["-j"], - macos_x64_args=[ - "-arch", "x86_64", - "-target", f"{proj_name}", - "-project", f"{proj_name}.xcodeproj"], - win_x64_args=[ - "/property:Configuration=Release", - "/property:Platform=x64", - "/t:Rebuild", "/m", - f"{proj_name}.sln"], - win_x86_args=[ - "/property:Configuration=Release", - "/property:Platform=x86", - "/t:Rebuild", "/m", - f"{proj_name}.sln"]) + copyright=copyright_xml if file_name.endswith(".xml") else copyright_c)) return { "stage": "c2wwise", diff --git a/hvcc/generators/c2wwise/templates/source/include/libnyquist/AudioDecoder.h b/hvcc/generators/c2wwise/templates/Includes/libnyquist/AudioDecoder.h similarity index 100% rename from hvcc/generators/c2wwise/templates/source/include/libnyquist/AudioDecoder.h rename to hvcc/generators/c2wwise/templates/Includes/libnyquist/AudioDecoder.h diff --git a/hvcc/generators/c2wwise/templates/source/include/libnyquist/Common.h b/hvcc/generators/c2wwise/templates/Includes/libnyquist/Common.h similarity index 100% rename from hvcc/generators/c2wwise/templates/source/include/libnyquist/Common.h rename to hvcc/generators/c2wwise/templates/Includes/libnyquist/Common.h diff --git a/hvcc/generators/c2wwise/templates/source/include/libnyquist/Dither.h b/hvcc/generators/c2wwise/templates/Includes/libnyquist/Dither.h similarity index 100% rename from hvcc/generators/c2wwise/templates/source/include/libnyquist/Dither.h rename to hvcc/generators/c2wwise/templates/Includes/libnyquist/Dither.h diff --git a/hvcc/generators/c2wwise/templates/source/include/libnyquist/IMA4Util.h b/hvcc/generators/c2wwise/templates/Includes/libnyquist/IMA4Util.h similarity index 100% rename from hvcc/generators/c2wwise/templates/source/include/libnyquist/IMA4Util.h rename to hvcc/generators/c2wwise/templates/Includes/libnyquist/IMA4Util.h diff --git a/hvcc/generators/c2wwise/templates/source/include/libnyquist/ModplugDecoder.h b/hvcc/generators/c2wwise/templates/Includes/libnyquist/ModplugDecoder.h similarity index 100% rename from hvcc/generators/c2wwise/templates/source/include/libnyquist/ModplugDecoder.h rename to hvcc/generators/c2wwise/templates/Includes/libnyquist/ModplugDecoder.h diff --git a/hvcc/generators/c2wwise/templates/source/include/libnyquist/PostProcess.h b/hvcc/generators/c2wwise/templates/Includes/libnyquist/PostProcess.h similarity index 100% rename from hvcc/generators/c2wwise/templates/source/include/libnyquist/PostProcess.h rename to hvcc/generators/c2wwise/templates/Includes/libnyquist/PostProcess.h diff --git a/hvcc/generators/c2wwise/templates/source/include/libnyquist/RiffUtils.h b/hvcc/generators/c2wwise/templates/Includes/libnyquist/RiffUtils.h similarity index 100% rename from hvcc/generators/c2wwise/templates/source/include/libnyquist/RiffUtils.h rename to hvcc/generators/c2wwise/templates/Includes/libnyquist/RiffUtils.h diff --git a/hvcc/generators/c2wwise/templates/source/include/libnyquist/WavDecoder.h b/hvcc/generators/c2wwise/templates/Includes/libnyquist/WavDecoder.h similarity index 100% rename from hvcc/generators/c2wwise/templates/source/include/libnyquist/WavDecoder.h rename to hvcc/generators/c2wwise/templates/Includes/libnyquist/WavDecoder.h diff --git a/hvcc/generators/c2wwise/templates/source/include/libnyquist/WavEncoder.h b/hvcc/generators/c2wwise/templates/Includes/libnyquist/WavEncoder.h similarity index 100% rename from hvcc/generators/c2wwise/templates/source/include/libnyquist/WavEncoder.h rename to hvcc/generators/c2wwise/templates/Includes/libnyquist/WavEncoder.h diff --git a/hvcc/generators/c2wwise/templates/PremakePlugin.lua b/hvcc/generators/c2wwise/templates/PremakePlugin.lua new file mode 100644 index 00000000..f7aedc68 --- /dev/null +++ b/hvcc/generators/c2wwise/templates/PremakePlugin.lua @@ -0,0 +1,73 @@ +if not _AK_PREMAKE then + error('You must use the custom Premake5 scripts by adding the following parameter: --scripts="Scripts\\Premake"', 1) +end + +local Plugin = {} +Plugin.name = "{{name}}" +Plugin.factoryheader = "../SoundEnginePlugin/{{name}}{{plugin_type}}Factory.h" +Plugin.sdk = {} +Plugin.sdk.static = {} +Plugin.sdk.shared = {} +Plugin.authoring = {} + +Plugin.sdk.static.includedirs = {} +Plugin.sdk.static.files = +{ + "**.cpp", + "**.h", + "**.hpp", + "**.c", +} +Plugin.sdk.static.excludes = +{ + "{{name}}{{plugin_type}}Shared.cpp" +} +Plugin.sdk.static.links = {} +Plugin.sdk.static.libsuffix = "{{plugin_type}}" +Plugin.sdk.static.libdirs = {} +Plugin.sdk.static.defines = {} +Plugin.sdk.static.custom = function() + filter "system:Windows" + systemversion "10.0.19041.0" +end + +Plugin.sdk.shared.includedirs = {} +Plugin.sdk.shared.files = +{ + "{{name}}{{plugin_type}}Shared.cpp", + "{{name}}{{plugin_type}}Factory.h", +} +Plugin.sdk.shared.excludes = {} +Plugin.sdk.shared.links = {} +Plugin.sdk.shared.libdirs = {} +Plugin.sdk.shared.defines = {} +Plugin.sdk.shared.custom = function() + filter "system:Windows" + systemversion "10.0.19041.0" +end + +Plugin.authoring.includedirs = +{ + "../Includes", + path.join(_AK_SDK_ROOT, "samples/Common/") +} +Plugin.authoring.files = +{ + "**.cpp", + "**.h", + "**.hpp", + "**.c", + "{{name}}.def", + "{{name}}.xml", + "{{name}}.rc", +} +Plugin.authoring.excludes = {} +Plugin.authoring.links = {} +Plugin.authoring.libdirs = {} +Plugin.authoring.defines = {} +Plugin.authoring.custom = function() + filter "system:Windows" + systemversion "10.0.19041.0" +end + +return Plugin diff --git a/hvcc/generators/c2wwise/templates/SoundEnginePlugin/{{name}}{{plugin_type}}.cpp b/hvcc/generators/c2wwise/templates/SoundEnginePlugin/{{name}}{{plugin_type}}.cpp new file mode 100644 index 00000000..61841232 --- /dev/null +++ b/hvcc/generators/c2wwise/templates/SoundEnginePlugin/{{name}}{{plugin_type}}.cpp @@ -0,0 +1,296 @@ +{%- set register_send_hook = out_params|length > 0 or out_events|length > 0 -%} +{{copyright}} + +#include "{{name}}{{plugin_type}}.h" +#include "{{name}}{{plugin_type}}Params.h" +#include "../{{name}}Config.h" + +#include "Heavy/Heavy_{{name}}.hpp" + +#include +#include + +namespace {{name}}_Private +{ + typedef struct WavHeader + { + uint32_t ChunkID; // 0 + uint32_t ChunkSize; // 4 + uint32_t Format; // 8 + uint32_t Subchunk1ID; // 12 + uint32_t Subchunk1Size; // 16 + uint16_t AudioFormat; // 20 + uint16_t NumChannels; // 22 + uint32_t SampleRate; // 24 + uint32_t ByteRate; // 28 + uint16_t BlockAlign; // 32 + uint16_t BitsPerSample; // 34 + uint32_t Subchunk2ID; // 36 + uint32_t Subchunk2Size; // 40 + uint32_t Subchunk2Data; // 44 + uint32_t Subchunk3ID; // 48 + uint32_t Subchunk3Size; // 52 + // data -> 56 + } WavHeader; + + void LoadPluginMediaToHeavyTable(AK::IAkPluginContextBase* in_pWwiseCtx, HeavyContextInterface* in_pHeavyCtx, + uint32_t in_uMediaIndex, uint32_t in_uTableHash, uint32_t in_uTableSizeReceiverHash) + { + AkUInt8* pPluginData = NULL; + AkUInt32 uPluginDataSize; + in_pWwiseCtx->GetPluginMedia(in_uMediaIndex, pPluginData, uPluginDataSize); // retrieve stored plugin data + + if (pPluginData != NULL) + { + // determine wav header format + WavHeader h; + hv_memcpy(&h, pPluginData, sizeof(WavHeader)); + uint32_t offsetBytes = 0; + const uint32_t dataID = 0x61746164; // 'data' + const uint32_t factID = 0x74636166; // 'fact' + if (h.Subchunk2ID == dataID) { + offsetBytes = 44; + } + else if (h.Subchunk2ID == factID && h.Subchunk3ID == dataID) { + offsetBytes = 56; + } + + uint32_t newSizeBytes = uPluginDataSize - offsetBytes; + if (offsetBytes > 0 && newSizeBytes > 0) + { + // adjust table size + const uint32_t numSamples = newSizeBytes * 8 / h.BitsPerSample; + in_pHeavyCtx->setLengthForTable(in_uTableHash, numSamples); + + float* buffer = in_pHeavyCtx->getBufferForTable(in_uTableHash); + if (buffer != NULL && newSizeBytes > 0) { + // copy contents and notify respective receiver + hv_memcpy(buffer, (float*)(pPluginData + offsetBytes), newSizeBytes); + in_pHeavyCtx->sendFloatToReceiver(in_uTableSizeReceiverHash, (float)numSamples); + } + } + } + } + + static void SetOutRTPC(AK::IAkPluginContextBase* in_pCtx, const char* in_szRtpcName, const uint32_t& in_uNameLen, const float& in_fValue) + { + AK::FNVHash32 HashFunc; + const uint32_t RtpcID = HashFunc.Compute(in_szRtpcName, sizeof(char) * in_uNameLen); + const AkGameObjectID ObjectID = in_pCtx->GetGameObjectInfo()->GetGameObjectID(); + in_pCtx->GlobalContext()->SetRTPCValue(RtpcID, in_fValue, ObjectID, 0, AkCurveInterpolation_Linear, false); + } + +{% if out_events|length > 0 %} + static void PostOutEvent({{name}}{{plugin_type}}* in_pPlugin, const char* in_szEventName, const uint32_t& in_uNameLen) + { + AK::FNVHash32 HashFunc; + const uint32_t EventID = HashFunc.Compute(in_szEventName, sizeof(char) * in_uNameLen); + in_pPlugin->m_EventQueue.Enqueue(EventID); + } +{% endif %} + + static void OnHeavyPrint(HeavyContextInterface* in_pHeavyCtx, const char* in_szPrintName, const char* in_szMessage, const HvMessage* in_pHvMessage) + { + auto* pPlugin = reinterpret_cast<{{name}}{{plugin_type}}*>(in_pHeavyCtx->getUserData()); + pPlugin->m_pWwiseCtx->PostMonitorMessage(in_szMessage, AK::Monitor::ErrorLevel::ErrorLevel_Message); + } +{% if register_send_hook %} + static void OnSendMessageCallback(HeavyContextInterface *in_pHeavyCtx, const char *in_szSendName, uint32_t in_uSendHash, const HvMessage *in_pHvMessage) + { + auto* pPlugin = reinterpret_cast<{{name}}{{plugin_type}}*>(in_pHeavyCtx->getUserData()); + if (pPlugin != nullptr && hv_msg_isFloat(in_pHvMessage, 0)) + { + switch (in_uSendHash) + { + {%- for k, v in out_params %} + case {{v.hash}}: SetOutRTPC(pPlugin->m_pWwiseCtx, "{{k|lower}}", {{k|length}}, hv_msg_getFloat(in_pHvMessage, 0)); break; + {%- endfor %} + {%- for k, v in out_events %} + case {{v.hash}}: PostOutEvent(pPlugin, "{{k|lower}}", {{k|length}}); break; + {%- endfor %} + default: return; + } + } + } +{%- endif %} +{% if out_events|length > 0 %} + static void OnGlobalCallback(AK::IAkGlobalPluginContext* in_pContext, AkGlobalCallbackLocation in_eLocation, void* in_pCookie) + { + if (in_eLocation != AkGlobalCallbackLocation_BeginRender) + return; + auto* pPlugin = reinterpret_cast<{{name}}{{plugin_type}}*>(in_pCookie); + if (!pPlugin) + return; + + const AkGameObjectID GameObjectID = pPlugin->m_pWwiseCtx->GetGameObjectInfo()->GetGameObjectID(); + uint32_t uEventID = 0; + while (pPlugin->m_EventQueue.Dequeue(uEventID)) + { + in_pContext->PostEventSync(uEventID, GameObjectID); + } + } +{%- endif %} +} + +AK::IAkPlugin* Create{{name}}{{plugin_type}}(AK::IAkPluginMemAlloc* in_pAllocator) +{ + return AK_PLUGIN_NEW(in_pAllocator, {{name}}{{plugin_type}}()); +} + +AK::IAkPluginParam* Create{{name}}{{plugin_type}}Params(AK::IAkPluginMemAlloc* in_pAllocator) +{ + return AK_PLUGIN_NEW(in_pAllocator, {{name}}{{plugin_type}}Params()); +} + +AK_IMPLEMENT_PLUGIN_FACTORY({{name}}{{plugin_type}}, {{"AkPluginTypeSource" if is_source else "AkPluginTypeEffect"}}, {{name}}Config::CompanyID, {{name}}Config::PluginID) + +{{name}}{{plugin_type}}::{{name}}{{plugin_type}}() + : m_pWwiseCtx(nullptr) + , m_pHeavyCtx(nullptr) + , m_pParams(nullptr) + , m_uSampleRate(0) +{ +} + +AKRESULT {{name}}{{plugin_type}}::Init(AK::IAkPluginMemAlloc* in_pAllocator, ContextType* in_pContext, AK::IAkPluginParam* in_pParams, AkAudioFormat& in_rFormat) +{ + using namespace {{name}}_Private; + + m_pParams = ({{name}}{{plugin_type}}Params*)in_pParams; + m_pWwiseCtx = in_pContext; + m_uSampleRate = in_rFormat.uSampleRate; + + // Initialise Heavy context + m_pHeavyCtx = AK_PLUGIN_NEW(in_pAllocator, Heavy_{{name}}((double) m_uSampleRate, {{pool_sizes_kb.internal}}, {{pool_sizes_kb.inputQueue}}, {{pool_sizes_kb.outputQueue}})); + m_pHeavyCtx->setUserData(this); +{%- if register_send_hook %} + m_pHeavyCtx->setSendHook(&OnSendMessageCallback); +{% endif %} +#ifndef AK_OPTIMIZED + m_pHeavyCtx->setPrintHook(&OnHeavyPrint); +#endif +{% if is_source %} + // Notify pipeline of chosen output format change. + in_rFormat.channelConfig.SetStandard({{channel_config}}); + {% if num_output_channels > 0 %} + if (in_rFormat.GetNumChannels() != hv_getNumOutputChannels(m_pHeavyCtx)) + { + return AK_UnsupportedChannelConfig; + } + {% endif %} +{% else %} + {% if num_output_channels > 2 %} + // Multi-channel plugins have string channel configuration requirementkk + if (in_rFormat.channelConfig.uChannelMask != {{channel_config}}) + { + m_pWwiseCtx->PostMonitorMessage("{{name}} only supports the following channel configuration {{channel_config}}", AK::Monitor::ErrorLevel_Error); + return AK_UnsupportedChannelConfig; + } + {% else %} + if (in_rFormat.GetNumChannels() > 2) + { + m_pWwiseCtx->PostMonitorMessage("{{name}} only supports one and two channel bus configurations", AK::Monitor::ErrorLevel_Error); + return AK_UnsupportedChannelConfig; + } + {% endif %} +{% endif %} +{%- for k, v in parameters %} + hv_sendFloatToReceiver(m_pHeavyCtx, Heavy_{{name}}::Parameter::In::{{k|upper}}, m_pParams->RTPC.{{k}}); +{%- endfor %} +{% if out_events|length > 0 %} + m_EventQueue.Init(4); + m_pWwiseCtx->GlobalContext()->RegisterGlobalCallback( + {{"AkPluginTypeSource" if is_source else "AkPluginTypeEffect"}}, + {{name}}Config::CompanyID, + {{name}}Config::PluginID, + &OnGlobalCallback, + AkGlobalCallbackLocation_BeginRender, + this); +{%- endif %} +{% if tables|length > 0 %} + // Initialise tables with media + {%- for k, v in tables %} + LoadPluginMediaToHeavyTable(m_pWwiseCtx, m_pHeavyCtx, {{loop.index-1}}, {{v.hash}}, hv_stringToHash("setTableSize-{{v.display}}")); // table '{{v.display}}' + {%- endfor %} +{% endif %} + AK_PERF_RECORDING_RESET(); + + return AK_Success; +} + +AKRESULT {{name}}{{plugin_type}}::Term(AK::IAkPluginMemAlloc* in_pAllocator) +{ + using namespace {{name}}_Private; +{% if out_events|length > 0 %} + uint32_t EventID = 0; + while (m_EventQueue.Dequeue(EventID)) + { + // the queue must be empty before termination + } + m_EventQueue.Term(); + m_pWwiseCtx->GlobalContext()->UnregisterGlobalCallback(OnGlobalCallback, AkGlobalCallbackLocation_BeginRender); +{% endif %} + AK_PLUGIN_DELETE(in_pAllocator, m_pHeavyCtx); + AK_PLUGIN_DELETE(in_pAllocator, this); + return AK_Success; +} + +AKRESULT {{name}}{{plugin_type}}::Reset() +{ + return AK_Success; +} + +AKRESULT {{name}}{{plugin_type}}::GetPluginInfo(AkPluginInfo& out_rPluginInfo) +{ + out_rPluginInfo.eType = {{"AkPluginTypeSource" if is_source else "AkPluginTypeEffect"}}; + out_rPluginInfo.bIsInPlace = true; + out_rPluginInfo.bCanProcessObjects = false; + out_rPluginInfo.uBuildVersion = AK_WWISESDK_VERSION_COMBINED; + return AK_Success; +} + +void {{name}}{{plugin_type}}::Execute(AkAudioBuffer* io_pBuffer) +{ + AK_PERF_RECORDING_START("{{name}}{{plugin_type}}", 25, 30); + + // Retrieve RTPC values and send in as a message to context +{%- for k, v in parameters %} + if (m_pParams->m_paramChangeHandler.HasChanged({{loop.index-1}})) + { + hv_sendFloatToReceiver(m_pHeavyCtx, Heavy_{{name}}::Parameter::In::{{k|upper}}, m_pParams->RTPC.{{k}}); + m_pParams->m_paramChangeHandler.ResetParamChange({{loop.index-1}}); + } +{%- endfor %} +{% if not is_source %} + // zero-pad the rest of the buffer in case the numFrames is not a multiple of 4 + io_pBuffer->ZeroPadToMaxFrames(); +{%- endif %} + + // Calculate num frames to process and retrieve buffer + AkUInt16 numFramesToProcess = io_pBuffer->MaxFrames(); + float *pBuffer = (float *) io_pBuffer->GetChannel(0); +{% if is_source %} + m_pHeavyCtx->processInline(nullptr, pBuffer, numFramesToProcess); + io_pBuffer->eState = AK_DataReady; +{% else %} + // Check for channel configuration mismatch + if (io_pBuffer->NumChannels() == 1 && + ((m_pHeavyCtx->getNumInputChannels() == 2) || (m_pHeavyCtx->getNumOutputChannels() == 2))) + { + float *pTempBuffer[2] = { pBuffer, pBuffer }; + m_pHeavyCtx->process(pTempBuffer, pTempBuffer, numFramesToProcess); + } + else + { + m_pHeavyCtx->processInline(pBuffer, pBuffer, numFramesToProcess); + } +{% endif %} +{% if num_output_channels > 0 %} + io_pBuffer->uValidFrames = numFramesToProcess; +{% else %} + // Edge case - a control-only plugin was built, outputting silence + io_pBuffer->ZeroPadToMaxFrames(); +{% endif %} + AK_PERF_RECORDING_STOP("{{name}}{{plugin_type}}", 25, 30); +} + diff --git a/hvcc/generators/c2wwise/templates/SoundEnginePlugin/{{name}}{{plugin_type}}.h b/hvcc/generators/c2wwise/templates/SoundEnginePlugin/{{name}}{{plugin_type}}.h new file mode 100644 index 00000000..91b5003e --- /dev/null +++ b/hvcc/generators/c2wwise/templates/SoundEnginePlugin/{{name}}{{plugin_type}}.h @@ -0,0 +1,65 @@ +{{copyright}} + +#ifndef {{name}}{{plugin_type}}_H +#define {{name}}{{plugin_type}}_H + +#include +{%- if out_events|length > 0 %} +#include +{%- endif %} + + +class HeavyContextInterface; +struct {{name}}{{plugin_type}}Params; + +class {{name}}{{plugin_type}} + : public {{"AK::IAkSourcePlugin" if is_source else "AK::IAkInPlaceEffectPlugin"}} +{ +public: + using ContextType = {{"AK::IAkSourcePluginContext" if is_source else "AK::IAkEffectPluginContext"}}; + +{% if out_events|length > 0 %} + // Note(ech): AkFifoQueue requires an allocator from AkMemoryMgr at compile time which we don't link against + // We need a queue implementation that can inject AK::IAkPluginMemAlloc at runtime to avoid using default OS allocator + struct SysAlloc + { + static AkForceInline void* Alloc(size_t in_uSize) + { + return malloc(in_uSize); + } + + static AkForceInline void Free(void* in_pAddress) + { + free(in_pAddress); + } + }; +{%- endif %} + + {{name}}{{plugin_type}}(); + ~{{name}}{{plugin_type}}() = default; + + AKRESULT Init(AK::IAkPluginMemAlloc* in_pAllocator, ContextType* in_pContext, AK::IAkPluginParam* in_pParams, AkAudioFormat& in_rFormat) override; + AKRESULT Term(AK::IAkPluginMemAlloc* in_pAllocator) override; + AKRESULT Reset() override; + AKRESULT GetPluginInfo(AkPluginInfo& out_rPluginInfo) override; + void Execute(AkAudioBuffer* io_pBuffer) override; +{%- if is_source %} + virtual AkReal32 GetDuration() const override { return 0.f; } + virtual AkReal32 GetEnvelope() const override { return 1.f; } + virtual AKRESULT StopLooping() override { return AK_Success; } +{%- else %} + AKRESULT TimeSkip(AkUInt32 in_uFrames) override { return AK_Success; } +{%- endif %} + +{% if out_events|length > 0 %} + // Holds event IDs until global callback + AkFifoQueue m_EventQueue; +{%- endif %} + + AK::IAkPluginContextBase* m_pWwiseCtx; + HeavyContextInterface *m_pHeavyCtx; // Main Heavy patch context + {{name}}{{plugin_type}}Params* m_pParams; + uint32_t m_uSampleRate; +}; + +#endif // {{name}}{{plugin_type}}_H diff --git a/hvcc/generators/c2wwise/templates/SoundEnginePlugin/{{name}}{{plugin_type}}Factory.h b/hvcc/generators/c2wwise/templates/SoundEnginePlugin/{{name}}{{plugin_type}}Factory.h new file mode 100644 index 00000000..881bb4da --- /dev/null +++ b/hvcc/generators/c2wwise/templates/SoundEnginePlugin/{{name}}{{plugin_type}}Factory.h @@ -0,0 +1,8 @@ +{{copyright}} + +#ifndef {{name}}{{plugin_type}}Factory_H +#define {{name}}{{plugin_type}}Factory_H + +AK_STATIC_LINK_PLUGIN({{name}}{{plugin_type}}) + +#endif // {{name}}{{plugin_type}}Factory_H diff --git a/hvcc/generators/c2wwise/templates/SoundEnginePlugin/{{name}}{{plugin_type}}Params.cpp b/hvcc/generators/c2wwise/templates/SoundEnginePlugin/{{name}}{{plugin_type}}Params.cpp new file mode 100644 index 00000000..494fa566 --- /dev/null +++ b/hvcc/generators/c2wwise/templates/SoundEnginePlugin/{{name}}{{plugin_type}}Params.cpp @@ -0,0 +1,82 @@ +{{copyright}} + +#include "{{name}}{{plugin_type}}Params.h" + +#include + +{{name}}{{plugin_type}}Params::{{name}}{{plugin_type}}Params(const {{name}}{{plugin_type}}Params& in_rParams) +{ +{% if parameters|length > 0 %} + RTPC = in_rParams.RTPC; + m_paramChangeHandler.SetAllParamChanges(); +{% endif %} +} + +AK::IAkPluginParam* {{name}}{{plugin_type}}Params::Clone(AK::IAkPluginMemAlloc* in_pAllocator) +{ + return AK_PLUGIN_NEW(in_pAllocator, {{name}}{{plugin_type}}Params(*this)); +} + +AKRESULT {{name}}{{plugin_type}}Params::Init(AK::IAkPluginMemAlloc* in_pAllocator, const void* in_pParamsBlock, AkUInt32 in_ulBlockSize) +{ + if (in_ulBlockSize == 0) + { +{%- for k, v in parameters %} + RTPC.{{k}} = {{v.attributes.default}}; +{%- endfor %} +{% if parameters|length > 0 %} + m_paramChangeHandler.SetAllParamChanges(); +{% endif %} + return AK_Success; + } + + return SetParamsBlock(in_pParamsBlock, in_ulBlockSize); +} + +AKRESULT {{name}}{{plugin_type}}Params::Term(AK::IAkPluginMemAlloc* in_pAllocator) +{ + AK_PLUGIN_DELETE(in_pAllocator, this); + return AK_Success; +} + +AKRESULT {{name}}{{plugin_type}}Params::SetParamsBlock(const void* in_pParamsBlock, AkUInt32 in_ulBlockSize) +{ + AKRESULT eResult = AK_Success; + AkUInt8* pParamsBlock = (AkUInt8*)in_pParamsBlock; + +{%- for k, v in parameters %} + RTPC.{{k}} = READBANKDATA(AkReal32, pParamsBlock, in_ulBlockSize); +{%- endfor %} + CHECKBANKDATASIZE(in_ulBlockSize, eResult); +{% if parameters|length > 0 %} + m_paramChangeHandler.SetAllParamChanges(); +{%- endif %} + + return eResult; +} + +AKRESULT {{name}}{{plugin_type}}Params::SetParam(AkPluginParamID in_paramID, const void* in_pValue, AkUInt32 in_ulParamSize) +{ + AKRESULT eResult = AK_Success; + +{% if parameters|length > 0 %} + switch (in_paramID) + { +{%- for k, v in parameters %} + case {{loop.index-1}}: + { + const float fNewValue = *((AkReal32*)in_pValue); + const bool bChanged = RTPC.{{k}} != fNewValue; + RTPC.{{k}} = fNewValue; + if (bChanged) + m_paramChangeHandler.SetParamChange({{loop.index-1}}); + } break; +{%- endfor %} + default: + eResult = AK_InvalidParameter; + break; + } +{% endif %} + + return eResult; +} diff --git a/hvcc/generators/c2wwise/templates/SoundEnginePlugin/{{name}}{{plugin_type}}Params.h b/hvcc/generators/c2wwise/templates/SoundEnginePlugin/{{name}}{{plugin_type}}Params.h new file mode 100644 index 00000000..ffe4a5cb --- /dev/null +++ b/hvcc/generators/c2wwise/templates/SoundEnginePlugin/{{name}}{{plugin_type}}Params.h @@ -0,0 +1,38 @@ +{{copyright}} +{# force new line #} +#ifndef {{name}}{{plugin_type}}Params_H +#define {{name}}{{plugin_type}}Params_H + +#include +#include + +{% if parameters|length > 0 %} +struct {{name}}RTPCParams +{ + {%- for k, v in parameters %} + AkReal32 {{k}} = {{v.attributes.default}}; + {%- endfor %} +}; +{% endif %} + +struct {{name}}{{plugin_type}}Params + : public AK::IAkPluginParam +{ + {{name}}{{plugin_type}}Params() = default; + {{name}}{{plugin_type}}Params(const {{name}}{{plugin_type}}Params& in_rParams); + + ~{{name}}{{plugin_type}}Params() = default; + + IAkPluginParam* Clone(AK::IAkPluginMemAlloc* in_pAllocator) override; + AKRESULT Init(AK::IAkPluginMemAlloc* in_pAllocator, const void* in_pParamsBlock, AkUInt32 in_ulBlockSize) override; + AKRESULT Term(AK::IAkPluginMemAlloc* in_pAllocator) override; + AKRESULT SetParamsBlock(const void* in_pParamsBlock, AkUInt32 in_ulBlockSize) override; + AKRESULT SetParam(AkPluginParamID in_paramID, const void* in_pValue, AkUInt32 in_ulParamSize) override; + +{% if parameters|length > 0 %} + AK::AkFXParameterChangeHandler<{{parameters|length}}> m_paramChangeHandler; + {{name}}RTPCParams RTPC; +{% endif %} +}; + +#endif // {{name}}{{plugin_type}}Params_H diff --git a/hvcc/generators/c2wwise/templates/SoundEnginePlugin/{{name}}{{plugin_type}}Shared.cpp b/hvcc/generators/c2wwise/templates/SoundEnginePlugin/{{name}}{{plugin_type}}Shared.cpp new file mode 100644 index 00000000..fbdb6728 --- /dev/null +++ b/hvcc/generators/c2wwise/templates/SoundEnginePlugin/{{name}}{{plugin_type}}Shared.cpp @@ -0,0 +1,9 @@ +{{copyright}} + +#include +#include "{{name}}{{plugin_type}}Factory.h" + +#include + +DEFINEDUMMYASSERTHOOK; +DEFINE_PLUGIN_REGISTER_HOOK; diff --git a/hvcc/generators/c2wwise/templates/source/include/stdafx.h b/hvcc/generators/c2wwise/templates/WwisePlugin/Win32/stdafx.h similarity index 100% rename from hvcc/generators/c2wwise/templates/source/include/stdafx.h rename to hvcc/generators/c2wwise/templates/WwisePlugin/Win32/stdafx.h diff --git a/hvcc/generators/c2wwise/templates/WwisePlugin/Win32/{{name}}PluginGUI.cpp b/hvcc/generators/c2wwise/templates/WwisePlugin/Win32/{{name}}PluginGUI.cpp new file mode 100644 index 00000000..f7d44449 --- /dev/null +++ b/hvcc/generators/c2wwise/templates/WwisePlugin/Win32/{{name}}PluginGUI.cpp @@ -0,0 +1,191 @@ +{{copyright}} + +#include "{{name}}PluginGUI.h" +#include "../resource.h" +#include "stdafx.h" + +using namespace AK::Wwise::Plugin; + +namespace {{name}}_Private +{ + static bool SaveAudioFileToTableId(ObjectMedia& in_pObjectMedia, const uint32_t& in_uTableId) + { + AFX_MANAGE_STATE(AfxGetStaticModuleState()); + static TCHAR BASED_CODE szFilter[] = _T("Audio Files (*.wav)|*.wav|"); + CFileDialog Dialog(TRUE, NULL, NULL, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, szFilter); + if (Dialog.DoModal() == IDOK) + { + const bool bOk = in_pObjectMedia.SetMediaSource(Dialog.GetPathName(), in_uTableId, true); + if (bOk) + { + in_pObjectMedia.InvalidateMediaSource(in_uTableId); + return true; + } + } + return false; + }; +} + +{{name}}PluginGUI::{{name}}PluginGUI() + : m_hwndPropView(nullptr) + , m_hwndObjPane(nullptr) + , m_uiBigDialogID(IDD_HV_{{name|upper}}_PLUGIN_BIG) + , m_uiSmallDialogID(IDD_HV_{{name|upper}}_PLUGIN_SMALL) +{%- if (parameters|length + sends|length + tables|length) > 10 %} + , m_iScrollPos(0) +{% endif -%} +{ +} + +bool {{name}}PluginGUI::GetDialog(eDialog in_eDialog, uint32_t& out_uiDialogID, PopulateTableItem*& out_pTable) const +{ + switch (in_eDialog) { + case SettingsDialog: + out_uiDialogID = m_uiBigDialogID; + out_pTable = nullptr; + return true; + case ContentsEditorDialog: + out_uiDialogID = m_uiSmallDialogID; + out_pTable = nullptr; + return true; + } + return false; +} + +bool {{name}}PluginGUI::WindowProc(eDialog in_eDialog, HWND in_hWnd, uint32_t in_message, WPARAM in_wParam, LPARAM in_lParam, LRESULT& out_lResult) +{ + using namespace {{name}}_Private; + + switch (in_message) { + case WM_INITDIALOG: { + if (in_eDialog == ContentsEditorDialog) { + m_hwndObjPane = in_hWnd; + } + else if (in_eDialog == SettingsDialog) { + m_hwndPropView = in_hWnd; + + {% if (parameters|length + sends|length + tables|length) > 10 -%} + RECT rect; + if (GetClientRect(in_hWnd, &rect)) { + // Create Scrollbar + CreateWindowEx(0, + L"SCROLLBAR", + (PTSTR) NULL, + WS_CHILD | WS_VISIBLE | SBS_VERT | SBS_RIGHTALIGN, + rect.left, + rect.top, + rect.right, + rect.bottom - GetSystemMetrics(SM_CYVTHUMB), // thumbwidth + in_hWnd, + (HMENU) NULL, + GetResourceHandle(), + (PVOID) NULL); + + SCROLLINFO si = {0}; + si.cbSize = sizeof(SCROLLINFO); + si.fMask = SIF_ALL; + si.nMin = 0; + si.nMax = 2500; + si.nPage = (rect.bottom - rect.top); + si.nPos = 0; + si.nTrackPos = 0; + SetScrollInfo(in_hWnd, SB_VERT, &si, true); + + m_iScrollPos = 0; + } + {%- endif %} + } + break; + } + + {% if (parameters|length + sends|length + tables|length) > 10 -%} + case WM_SIZE: { + break; + } + + case WM_VSCROLL: { + auto action = LOWORD(in_wParam); + HWND hScroll = (HWND) in_lParam; + int pos = -1; + if (action == SB_THUMBPOSITION || action == SB_THUMBTRACK) { + pos = HIWORD(in_wParam); + } + else if (action == SB_LINEDOWN) { + pos = m_iScrollPos + 30; + } + else if (action == SB_LINEUP) { + pos = m_iScrollPos - 30; + } + if (pos == -1) { + break; + } + + SCROLLINFO si = {0}; + si.cbSize = sizeof(SCROLLINFO); + si.fMask = SIF_POS; + si.nPos = pos; + si.nTrackPos = 0; + SetScrollInfo(in_hWnd, SB_VERT, &si, true); + GetScrollInfo(in_hWnd, SB_VERT, &si); + pos = si.nPos; + POINT pt; + pt.x = 0; + pt.y = pos - m_iScrollPos; + auto hdc = GetDC(in_hWnd); + LPtoDP(hdc, &pt, 1); + ReleaseDC(in_hWnd, hdc); + ScrollWindow(in_hWnd, 0, -pt.y, NULL, NULL); + m_iScrollPos = pos; + + break; + } + {%- endif %} + + case WM_DESTROY: { + if (in_eDialog == SettingsDialog) { + m_hwndPropView = nullptr; + } else if ( in_eDialog == ContentsEditorDialog ) { + m_hwndObjPane = nullptr; + } + break; + } + + // Catch window command actions (regardless if it is object pane or property + // view) to enable/disable controls + case WM_COMMAND: { + {%- if tables|length > 0 %} + // catch button clicks + switch (HIWORD(in_wParam)) { + case BN_CLICKED: { + switch (LOWORD(in_wParam)) { + {%- for k, v in tables %} + case IDC_BUTTON_HV_TABLE_{{k|upper}}: return SaveAudioFileToTableId(m_objectMedia, {{loop.index-1}}); // {{v.display}} + {%- endfor %} + default: break; + } + } + default: break; + } + {%- endif %} + break; + } + + case WM_ENABLE: { + // Enable/Disable all child controls + HWND hWnd = ::GetWindow(in_hWnd, GW_CHILD); + while(hWnd) { + ::EnableWindow(hWnd, in_wParam == TRUE); + hWnd = ::GetWindow(hWnd, GW_HWNDNEXT); + } + return true; + } + } + out_lResult = 0; + return false; +} + +ADD_AUDIOPLUGIN_CLASS_TO_CONTAINER( + {{name}}, + {{name}}PluginGUI, + {{name}}{{plugin_type}} +); diff --git a/hvcc/generators/c2wwise/templates/WwisePlugin/Win32/{{name}}PluginGUI.h b/hvcc/generators/c2wwise/templates/WwisePlugin/Win32/{{name}}PluginGUI.h new file mode 100644 index 00000000..9eba1c8a --- /dev/null +++ b/hvcc/generators/c2wwise/templates/WwisePlugin/Win32/{{name}}PluginGUI.h @@ -0,0 +1,29 @@ +{{copyright}} + +#pragma once + +#include "../{{name}}Plugin.h" + +class {{name}}PluginGUI final + : public AK::Wwise::Plugin::PluginMFCWindows<> + , public AK::Wwise::Plugin::GUIWindows + , public AK::Wwise::Plugin::RequestObjectMedia +{ +public: + {{name}}PluginGUI(); + + bool GetDialog(AK::Wwise::Plugin::eDialog in_eDialog, uint32_t& out_uiDialogID, + AK::Wwise::Plugin::PopulateTableItem*& out_pTable) const override; + bool WindowProc(AK::Wwise::Plugin::eDialog in_eDialog, HWND in_hWnd, uint32_t in_message, + WPARAM in_wParam, LPARAM in_lParam, LRESULT& out_lResult ) override; + + private: + HWND m_hwndPropView; + HWND m_hwndObjPane; + const uint32_t m_uiBigDialogID; + const uint32_t m_uiSmallDialogID; + + {% if (parameters|length + sends|length + tables|length) > 10 -%} + int32_t m_iScrollPos; + {% endif -%} +}; diff --git a/hvcc/generators/c2wwise/templates/source/libnyquist/AudioDecoder.cpp b/hvcc/generators/c2wwise/templates/WwisePlugin/libnyquist/AudioDecoder.cpp similarity index 100% rename from hvcc/generators/c2wwise/templates/source/libnyquist/AudioDecoder.cpp rename to hvcc/generators/c2wwise/templates/WwisePlugin/libnyquist/AudioDecoder.cpp diff --git a/hvcc/generators/c2wwise/templates/source/libnyquist/Common.cpp b/hvcc/generators/c2wwise/templates/WwisePlugin/libnyquist/Common.cpp similarity index 100% rename from hvcc/generators/c2wwise/templates/source/libnyquist/Common.cpp rename to hvcc/generators/c2wwise/templates/WwisePlugin/libnyquist/Common.cpp diff --git a/hvcc/generators/c2wwise/templates/source/libnyquist/RiffUtils.cpp b/hvcc/generators/c2wwise/templates/WwisePlugin/libnyquist/RiffUtils.cpp similarity index 100% rename from hvcc/generators/c2wwise/templates/source/libnyquist/RiffUtils.cpp rename to hvcc/generators/c2wwise/templates/WwisePlugin/libnyquist/RiffUtils.cpp diff --git a/hvcc/generators/c2wwise/templates/source/libnyquist/WavDecoder.cpp b/hvcc/generators/c2wwise/templates/WwisePlugin/libnyquist/WavDecoder.cpp similarity index 100% rename from hvcc/generators/c2wwise/templates/source/libnyquist/WavDecoder.cpp rename to hvcc/generators/c2wwise/templates/WwisePlugin/libnyquist/WavDecoder.cpp diff --git a/hvcc/generators/c2wwise/templates/source/libnyquist/WavEncoder.cpp b/hvcc/generators/c2wwise/templates/WwisePlugin/libnyquist/WavEncoder.cpp similarity index 100% rename from hvcc/generators/c2wwise/templates/source/libnyquist/WavEncoder.cpp rename to hvcc/generators/c2wwise/templates/WwisePlugin/libnyquist/WavEncoder.cpp diff --git a/hvcc/generators/c2wwise/templates/source/authoring/Hv_{{name}}_WwiseResource.h b/hvcc/generators/c2wwise/templates/WwisePlugin/resource.h similarity index 100% rename from hvcc/generators/c2wwise/templates/source/authoring/Hv_{{name}}_WwiseResource.h rename to hvcc/generators/c2wwise/templates/WwisePlugin/resource.h diff --git a/hvcc/generators/c2wwise/templates/WwisePlugin/{{name}}.def b/hvcc/generators/c2wwise/templates/WwisePlugin/{{name}}.def new file mode 100644 index 00000000..7f668134 --- /dev/null +++ b/hvcc/generators/c2wwise/templates/WwisePlugin/{{name}}.def @@ -0,0 +1,3 @@ +LIBRARY "" + +EXPORTS diff --git a/hvcc/generators/c2wwise/templates/source/authoring/Hv_{{name}}_WwiseAuthoringPlugin.rc b/hvcc/generators/c2wwise/templates/WwisePlugin/{{name}}.rc similarity index 94% rename from hvcc/generators/c2wwise/templates/source/authoring/Hv_{{name}}_WwiseAuthoringPlugin.rc rename to hvcc/generators/c2wwise/templates/WwisePlugin/{{name}}.rc index d9d06b47..ec18980a 100644 --- a/hvcc/generators/c2wwise/templates/source/authoring/Hv_{{name}}_WwiseAuthoringPlugin.rc +++ b/hvcc/generators/c2wwise/templates/WwisePlugin/{{name}}.rc @@ -1,6 +1,6 @@ // Microsoft Visual C++ generated resource script. // -#include "Hv_{{name}}_WwiseResource.h" +#include "resource.h" #define APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// @@ -52,7 +52,7 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_CAN 1 TEXTINCLUDE BEGIN - "Hv_{{name}}_WwiseResource.h\0" + "resource.h\0" END 2 TEXTINCLUDE @@ -64,8 +64,8 @@ END 3 TEXTINCLUDE BEGIN "#define AK_WWISESDK_SAMPLE_FILEDESC ""{{name}} Wwise plug-in generated by Heavy""\r\n" - "#define AK_WWISESDK_SAMPLE_INTERNALNAME ""Hv_{{name}}.dll""\r\n" - "#define AK_WWISESDK_SAMPLE_ORIGINALFILE ""Hv_{{name}}.dll""\r\n" + "#define AK_WWISESDK_SAMPLE_INTERNALNAME ""{{name}}.dll""\r\n" + "#define AK_WWISESDK_SAMPLE_ORIGINALFILE ""{{name}}.dll""\r\n" "#include ""AkWwiseSDKVersion.rc""\r\n" "#define _AFX_NO_SPLITTER_RESOURCES\r\n" "#define _AFX_NO_OLE_RESOURCES\r\n" @@ -170,8 +170,8 @@ END // Generated from the TEXTINCLUDE 3 resource. // #define AK_WWISESDK_SAMPLE_FILEDESC "{{name}} Wwise plug-in generated by Heavy" -#define AK_WWISESDK_SAMPLE_INTERNALNAME "Hv_{{name}}.dll" -#define AK_WWISESDK_SAMPLE_ORIGINALFILE "Hv_{{name}}.dll" +#define AK_WWISESDK_SAMPLE_INTERNALNAME "{{name}}.dll" +#define AK_WWISESDK_SAMPLE_ORIGINALFILE "{{name}}.dll" #include "AkWwiseSDKVersion.rc" #define _AFX_NO_SPLITTER_RESOURCES #define _AFX_NO_OLE_RESOURCES diff --git a/hvcc/generators/c2wwise/templates/resources/Hv_{{name}}_Wwise{{type}}AuthPlugin.xml b/hvcc/generators/c2wwise/templates/WwisePlugin/{{name}}.xml similarity index 97% rename from hvcc/generators/c2wwise/templates/resources/Hv_{{name}}_Wwise{{type}}AuthPlugin.xml rename to hvcc/generators/c2wwise/templates/WwisePlugin/{{name}}.xml index 325813e5..2172bb96 100644 --- a/hvcc/generators/c2wwise/templates/resources/Hv_{{name}}_Wwise{{type}}AuthPlugin.xml +++ b/hvcc/generators/c2wwise/templates/WwisePlugin/{{name}}.xml @@ -2,7 +2,7 @@ {{copyright}} {%- if plugin_type == "Source" %} - + {% if tables|length > 0 -%} @@ -59,7 +59,7 @@ {%- endif %} {%- elif plugin_type == "FX" %} - + diff --git a/hvcc/generators/c2wwise/templates/WwisePlugin/{{name}}Plugin.cpp b/hvcc/generators/c2wwise/templates/WwisePlugin/{{name}}Plugin.cpp new file mode 100644 index 00000000..1b64f4ce --- /dev/null +++ b/hvcc/generators/c2wwise/templates/WwisePlugin/{{name}}Plugin.cpp @@ -0,0 +1,89 @@ +{{copyright}} + +#include "{{name}}Plugin.h" +#include "../SoundEnginePlugin/{{name}}{{plugin_type}}Factory.h" + +#include "libnyquist/WavDecoder.h" +#include "libnyquist/WavEncoder.h" + +#include +#include +#include +#include + +bool {{name}}Plugin::GetBankParameters(const GUID & in_guidPlatform, AK::Wwise::Plugin::DataWriter& in_dataWriter) const +{ + {%- for k, v in parameters %} + in_dataWriter.WriteReal32(m_propertySet.GetReal32(in_guidPlatform, "{{k}}")); + {%- endfor %} + + return true; +} + +void {{name}}Plugin::NotifyPluginMediaChanged() +{ + m_host.NotifyInternalDataChanged(AK::IAkPluginParam::ALL_PLUGIN_DATA_ID, true); +} + +AK::Wwise::Plugin::ConversionResult {{name}}Plugin::ConvertFile( + const GUID& in_guidPlatform, + const BasePlatformID& in_basePlatform, + const AkOSChar* in_szSourceFile, + const AkOSChar* in_szDestFile, + AkUInt32 in_uSampleRate, + AkUInt32 in_uBlockLength, + AK::Wwise::Plugin::IProgress* in_pProgress, + AK::Wwise::Plugin::IWriteString* io_pError) const +{ + if (wcslen(in_szSourceFile) > 0) + { + // convert input file to 32bit floating point wav + nqr::NyquistIO loader; + std::shared_ptr fileData = std::make_shared(); + std::string inPath = std::wstring_convert>().to_bytes(in_szSourceFile); + loader.Load(fileData.get(), inPath); + + std::string outPath = std::wstring_convert>().to_bytes(in_szDestFile); + nqr::WavEncoder::WriteFile({ 1, nqr::PCM_FLT, nqr::DITHER_NONE }, fileData.get(), outPath); + } + else + { + // Note(joe): because we create dummy media sources for the patch tables the input file here doesn't exist + // but we still need to create a dummy output file to avoid errors + std::ofstream outFile(in_szDestFile); + outFile.close(); + } + return AK::Wwise::Plugin::ConversionSuccess; +} + +uint32_t {{name}}Plugin::GetCurrentConversionSettingsHash( + const GUID& in_guidPlatform, + AkUInt32 in_uSampleRate, + AkUInt32 in_uBlockLength) const +{ + const auto numMedia = m_objectMedia.GetMediaSourceCount(); + uint32_t hash = in_uSampleRate ^ in_uBlockLength; + AK::FNVHash32 hashFunc; + AkOSChar szMediaFileName[_MAX_PATH]; + + for (int32_t mediaIdx = 0; mediaIdx < numMedia; ++mediaIdx) + { + const uint32_t fileNameSize = m_objectMedia.GetMediaSourceFileName(szMediaFileName, _MAX_PATH, mediaIdx); + if (fileNameSize > 0) + { + for (int i = 0; i < fileNameSize; ++i) + { + szMediaFileName[i] = tolower(szMediaFileName[i]); + } + hash = hash * 31 + static_cast(hashFunc.Compute(szMediaFileName, fileNameSize)); + } + } + + return hash; +} + +DEFINE_AUDIOPLUGIN_CONTAINER({{name}}); +EXPORT_AUDIOPLUGIN_CONTAINER({{name}}); +ADD_AUDIOPLUGIN_CLASS_TO_CONTAINER({{name}}, {{name}}Plugin, {{name}}{{plugin_type}}); +DEFINE_PLUGIN_REGISTER_HOOK +DEFINEDUMMYASSERTHOOK; diff --git a/hvcc/generators/c2wwise/templates/WwisePlugin/{{name}}Plugin.h b/hvcc/generators/c2wwise/templates/WwisePlugin/{{name}}Plugin.h new file mode 100644 index 00000000..7abb17e6 --- /dev/null +++ b/hvcc/generators/c2wwise/templates/WwisePlugin/{{name}}Plugin.h @@ -0,0 +1,38 @@ +{{copyright}} + +#pragma once + +#include + +class {{name}}Plugin final + : public AK::Wwise::Plugin::AudioPlugin + , public AK::Wwise::Plugin::RequestHost + , public AK::Wwise::Plugin::RequestObjectMedia + , public AK::Wwise::Plugin::MediaConverter +{ +public: + {{name}}Plugin() = default; + ~{{name}}Plugin() = default; + + bool GetBankParameters(const GUID & in_guidPlatform, AK::Wwise::Plugin::DataWriter& in_dataWriter) const override; + void NotifyPluginMediaChanged() override; + + AK::Wwise::Plugin::ConversionResult ConvertFile( + const GUID& in_guidPlatform, + const BasePlatformID& in_basePlatform, + const AkOSChar* in_szSourceFile, + const AkOSChar* in_szDestFile, + AkUInt32 in_uSampleRate, + AkUInt32 in_uBlockLength, + AK::Wwise::Plugin::IProgress* in_pProgress, + AK::Wwise::Plugin::IWriteString* io_pError + ) const override; + + uint32_t GetCurrentConversionSettingsHash( + const GUID& in_guidPlatform, + AkUInt32 in_uSampleRate = 0, + AkUInt32 in_uBlockLength = 0 + ) const override; +}; + +DECLARE_AUDIOPLUGIN_CONTAINER({{name}}); // Exposes our PluginContainer structure that contains the info for our plugin diff --git a/hvcc/generators/c2wwise/templates/bundle_template.json b/hvcc/generators/c2wwise/templates/bundle_template.json new file mode 100644 index 00000000..5096fcb9 --- /dev/null +++ b/hvcc/generators/c2wwise/templates/bundle_template.json @@ -0,0 +1,25 @@ +{ + "id": "Heavy.{{name}}.${year}_${major}_${minor}_${build}", + "name": "{{name}}", + "tag": "{{name}}", + "description": "", + "vendor": "Heavy", + "image": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=", + "type": "plugin", + "productDependentData": { + "targetWwiseVersion": { + "year": ${year}, + "major": ${major} + } + }, + "version": { + "year": ${year}, + "major": ${major}, + "minor": ${minor}, + "build": ${build} + }, + "eulas": [], + "labels": [], + "links": [], + "documentation": [] +} diff --git a/hvcc/generators/c2wwise/templates/linux/Makefile b/hvcc/generators/c2wwise/templates/linux/Makefile deleted file mode 100644 index 72913fc9..00000000 --- a/hvcc/generators/c2wwise/templates/linux/Makefile +++ /dev/null @@ -1,52 +0,0 @@ -CC = clang -CXX = clang++ -MKDIR = mkdir -p -SRC_DIR = ../source -WWISE_SDK_DIR = ../sdks/wwise_{{wwise_version}}/SDK/include/ -PATCH_NAME = {{name}} -OUT_DIR = ../build/linux/x64/release -BASEFLAGS = -I$(WWISE_SDK_DIR) -I$(SRC_DIR) -I$(SRC_DIR)/include -I$(SRC_DIR)/heavy -DNDEBUG -msse4.1 -O3 -ffast-math -fPIC -Werror -Wno-unused-function -Wno-\#warnings -CFLAGS = $(BASEFLAGS) -std=c11 -CXXFLAGS = $(BASEFLAGS) -std=c++11 -fno-exceptions -fno-rtti - -HEADERS = $(wildcard $(SRC_DIR)/include/*.h) -HEADERS += $(wildcard $(SRC_DIR)/heavy/*.h) -HEADERS += $(wildcard $(SRC_DIR)/engine/*.h) - -CFILES = $(wildcard $(SRC_DIR)/heavy/*.c) -OBJC = $(CFILES:%.c=%.o) - -CXXFILES = $(wildcard $(SRC_DIR)/engine/*.cpp) -CXXFILES += $(wildcard $(SRC_DIR)/heavy/*.cpp) -OBJCXX = $(CXXFILES:%.cpp=%.o) - -RUNTIME_CXXFILES = $(CXXFILES) -RUNTIME_CXXFILES += $(wildcard $(SRC_DIR)/runtime/*.cpp) -RUNTIME_OBJCXX = $(RUNTIME_CXXFILES:%.cpp=%.o) - -%.o: %.c $(HEADERS) - $(CC) -c -o $@ $< $(CFLAGS) - -%.o: %.cpp $(HEADERS) - $(CXX) -c -o $@ $< $(CXXFLAGS) - -all: directories engine runtime - -directories: $(OUT_DIR) - -$(OUT_DIR): - $(MKDIR) $(OUT_DIR) - -engine: $(OBJC) $(OBJCXX) - ar -cvq $(OUT_DIR)/libHv_$(PATCH_NAME)_Wwise{{plugin_type}}Engine.a $^ - cp $(SRC_DIR)/include/Hv_$(PATCH_NAME)_Wwise{{plugin_type}}PluginFactory.h $(OUT_DIR) - cp ../resources/Hv_$(PATCH_NAME)_Wwise{{plugin_type}}AuthPlugin.xml $(OUT_DIR) - -runtime: $(OBJC) $(RUNTIME_OBJCXX) - $(CXX) -o $(OUT_DIR)/Hv_$(PATCH_NAME)_Wwise{{plugin_type}}Plugin.so $^ $(CXXFLAGS) -shared - -.PHONY: clean - -clean: - rm -rf $(SRC_DIR)/**/*.o $(OUT_DIR)/*.* -{# force new line #} diff --git a/hvcc/generators/c2wwise/templates/source/authoring/Hv_{{name}}_WwiseAuthoringPlugin.cpp b/hvcc/generators/c2wwise/templates/source/authoring/Hv_{{name}}_WwiseAuthoringPlugin.cpp deleted file mode 100644 index 27a39216..00000000 --- a/hvcc/generators/c2wwise/templates/source/authoring/Hv_{{name}}_WwiseAuthoringPlugin.cpp +++ /dev/null @@ -1,300 +0,0 @@ -{{copyright}} - -#include -#include -#include -#include - -#include "stdafx.h" -#include -#include -#include -#include - -#include "Hv_{{name}}_WwiseAuthoringPlugin.h" -#include "Hv_{{name}}_WwiseResource.h" -#include "Hv_{{name}}_WwisePluginIDs.h" - -DEFINE_PLUGIN_REGISTER_HOOK - -/** Table of display name resources (one for each property). */ -struct DisplayNameInfo { - LPCWSTR wszPropName; - UINT uiDisplayName; -}; - -static DisplayNameInfo g_DisplayNames[] = { - {%- for k, v in parameters %} - { L"{{v.display}}", IDS_HV_PARAM_{{k|upper}} }, - {%- endfor %} - { NULL, NULL } -}; - -// These IDs must be the same as those specified in the plug-in's XML definition file. -// Note that there are restrictions on the values you can use for CompanyID, and PluginID -// must be unique for the specified CompanyID. Furthermore, these IDs are persisted -// in project files. NEVER CHANGE THEM or existing projects will not recognize this Plug-in. -// Be sure to read the SDK documentation regarding Plug-ins XML definition files. -const short Hv_{{name}}_WwiseAuthoringPlugin::CompanyID = HV_COMPANY_ID; -const short Hv_{{name}}_WwiseAuthoringPlugin::PluginID = HV_{{name|upper}}_PLUGIN_ID; - -Hv_{{name}}_WwiseAuthoringPlugin::Hv_{{name}}_WwiseAuthoringPlugin(AkUInt16 in_idPlugin) { - m_pObjectMedia = nullptr; - m_pPSet = nullptr; - m_hwndPropView = nullptr; - m_hwndObjPane = nullptr; - m_idDialogBig = IDD_HV_{{name|upper}}_PLUGIN_BIG; - m_idDialogSmall = IDD_HV_{{name|upper}}_PLUGIN_SMALL; -} - -void Hv_{{name}}_WwiseAuthoringPlugin::Destroy() { - delete this; -} - -AK::Wwise::IPluginMediaConverter* Hv_{{name}}_WwiseAuthoringPlugin::GetPluginMediaConverterInterface() { - return this; -} - -AK::Wwise::ConversionResult Hv_{{name}}_WwiseAuthoringPlugin::ConvertFile(const GUID & in_guidPlatform, - const BasePlatformID &in_basePlatform, LPCWSTR in_szSourceFile, LPCWSTR in_szDestFile, - AkUInt32 in_uSampleRate, AkUInt32 in_uBlockLength, AK::Wwise::IProgress* in_pProgress, - AK::Wwise::IWriteString* io_pError) { - - if (wcslen(in_szSourceFile) > 0) { - // convert input file to 32bit floating point wav - nqr::NyquistIO loader; - std::shared_ptr fileData = std::make_shared(); - std::string inPath = std::wstring_convert>().to_bytes(in_szSourceFile); - loader.Load(fileData.get(), inPath); - - std::string outPath = std::wstring_convert>().to_bytes(in_szDestFile); - nqr::WavEncoder::WriteFile({ 1, nqr::PCM_FLT, nqr::DITHER_NONE }, fileData.get(), outPath); - } else { - // Note(joe): because we create dummy media sources for the patch tables the input file here doesn't exist - // but we still need to create a dummy output file to avoid errors - std::ofstream outfile(in_szDestFile); - outfile.close(); - } - return AK::Wwise::ConversionSuccess; -} - -ULONG Hv_{{name}}_WwiseAuthoringPlugin::GetCurrentConversionSettingsHash(const GUID & in_guidPlatform, - AkUInt32 in_uSampleRate, AkUInt32 in_uBlockLength) { - AK::FNVHash32 hashFunc; - - // Generate a Hash from effect parameters that have an influence on the conversion - // Take the source file name - CString szInputFileName; - m_pObjectMedia->GetMediaSourceFileName(szInputFileName.GetBuffer(_MAX_PATH), _MAX_PATH); - szInputFileName.ReleaseBuffer(); - szInputFileName.MakeLower(); - return hashFunc.Compute((unsigned char *) (LPCTSTR) szInputFileName, szInputFileName.GetLength()*sizeof(TCHAR)); -} - -void Hv_{{name}}_WwiseAuthoringPlugin::SetPluginPropertySet(AK::Wwise::IPluginPropertySet *in_pPSet) { - m_pPSet = in_pPSet; -} - -void Hv_{{name}}_WwiseAuthoringPlugin::InitToDefault() { - {% if tables|length > 0 -%} - // initialise plugin with dummy media files for each table on load - {%- for k, v in tables %} - m_pObjectMedia->SetMediaSource(nullptr, {{loop.index-1}}, false); // '{{v.display}}' - {%- endfor %} - {%- endif %} -} - -void Hv_{{name}}_WwiseAuthoringPlugin::SetPluginObjectMedia(AK::Wwise::IPluginObjectMedia *in_pObjectMedia) { - m_pObjectMedia = in_pObjectMedia; -} - -void Hv_{{name}}_WwiseAuthoringPlugin::NotifyPluginMediaChanged() { - m_pPSet->NotifyInternalDataChanged(AK::IAkPluginParam::ALL_PLUGIN_DATA_ID); -} - -HINSTANCE Hv_{{name}}_WwiseAuthoringPlugin::GetResourceHandle() const { - return AfxGetStaticModuleState()->m_hCurrentResourceHandle; -} - -bool Hv_{{name}}_WwiseAuthoringPlugin::GetDialog(eDialog in_eDialog, - UINT &out_uiDialogID, AK::Wwise::PopulateTableItem *&out_pTable) const { - // Determine what dialog just get called and set the property names to - // UI control binding populated table. - CComVariant varProp; - - switch (in_eDialog) { - case SettingsDialog: { - out_uiDialogID = m_idDialogBig; - out_pTable = nullptr; - return true; - } - case ContentsEditorDialog: { - out_uiDialogID = m_idDialogSmall; - out_pTable = nullptr; - return true; - } - default: return false; - } -} - -bool Hv_{{name}}_WwiseAuthoringPlugin::WindowProc(eDialog in_eDialog, - HWND in_hWnd, UINT in_message, WPARAM in_wParam, LPARAM in_lParam, - LRESULT &out_lResult) { - // Standard window function, user can intercept what ever message that is - // of interest to him to implement UI behavior. - switch (in_message) { - case WM_INITDIALOG: { - if (in_eDialog == ContentsEditorDialog) { - m_hwndObjPane = in_hWnd; - } - else if (in_eDialog == SettingsDialog) { - m_hwndPropView = in_hWnd; - - {% if (parameters|length + sends|length + tables|length) > 10 -%} - RECT rect; - if (GetClientRect(in_hWnd, &rect)) { - // Create Scrollbar - CreateWindowEx(0, - L"SCROLLBAR", - (PTSTR) NULL, - WS_CHILD | WS_VISIBLE | SBS_VERT | SBS_RIGHTALIGN, - rect.left, - rect.top, - rect.right, - rect.bottom - GetSystemMetrics(SM_CYVTHUMB), // thumbwidth - in_hWnd, - (HMENU) NULL, - GetResourceHandle(), - (PVOID) NULL); - - SCROLLINFO si = {0}; - si.cbSize = sizeof(SCROLLINFO); - si.fMask = SIF_ALL; - si.nMin = 0; - si.nMax = 2500; - si.nPage = (rect.bottom - rect.top); - si.nPos = 0; - si.nTrackPos = 0; - SetScrollInfo(in_hWnd, SB_VERT, &si, true); - - m_scrollPos = 0; - } - {%- endif %} - } - break; - } - - {% if (parameters|length + sends|length + tables|length) > 10 -%} - case WM_SIZE: { - break; - } - - case WM_VSCROLL: { - auto action = LOWORD(in_wParam); - HWND hScroll = (HWND) in_lParam; - int pos = -1; - if (action == SB_THUMBPOSITION || action == SB_THUMBTRACK) { - pos = HIWORD(in_wParam); - } - else if (action == SB_LINEDOWN) { - pos = m_scrollPos + 30; - } - else if (action == SB_LINEUP) { - pos = m_scrollPos - 30; - } - if (pos == -1) { - break; - } - - SCROLLINFO si = {0}; - si.cbSize = sizeof(SCROLLINFO); - si.fMask = SIF_POS; - si.nPos = pos; - si.nTrackPos = 0; - SetScrollInfo(in_hWnd, SB_VERT, &si, true); - GetScrollInfo(in_hWnd, SB_VERT, &si); - pos = si.nPos; - POINT pt; - pt.x = 0; - pt.y = pos - m_scrollPos; - auto hdc = GetDC(in_hWnd); - LPtoDP(hdc, &pt, 1); - ReleaseDC(in_hWnd, hdc); - ScrollWindow(in_hWnd, 0, -pt.y, NULL, NULL); - m_scrollPos = pos; - - break; - } - {%- endif %} - - case WM_DESTROY: { - if (in_eDialog == SettingsDialog) { - m_hwndPropView = nullptr; - } else if ( in_eDialog == ContentsEditorDialog ) { - m_hwndObjPane = nullptr; - } - break; - } - - // Catch window command actions (regardless if it is object pane or property - // view) to enable/disable controls - case WM_COMMAND: { - {%- if tables|length > 0 %} - // catch button clicks - switch (HIWORD(in_wParam)) { - case BN_CLICKED: { - switch (LOWORD(in_wParam)) { - {%- for k, v in tables %} - case IDC_BUTTON_HV_TABLE_{{k|upper}}: return SaveAudioFileToTableId({{loop.index-1}}); // {{v.display}} - {%- endfor %} - default: break; - } - } - default: break; - } - {%- endif %} - break; - } - - case WM_ENABLE: { - // Enable/Disable all child controls - HWND hWnd = ::GetWindow(in_hWnd, GW_CHILD); - while(hWnd) { - ::EnableWindow(hWnd, in_wParam == TRUE); - hWnd = ::GetWindow(hWnd, GW_HWNDNEXT); - } - return true; - } - } - out_lResult = 0; - return false; -} - -// Store current plugin settings into banks when asked to. -bool Hv_{{name}}_WwiseAuthoringPlugin::GetBankParameters(const GUID &in_guidPlatform, - AK::Wwise::IWriteData *in_pDataWriter) const { - CComVariant varProp; - - {%- for k, v in parameters %} - m_pPSet->GetValue(in_guidPlatform, szHv_{{name}}_Param_{{k}}, varProp); - in_pDataWriter->WriteReal32(varProp.fltVal); - {%- endfor %} - - return true; -} - -bool Hv_{{name}}_WwiseAuthoringPlugin::Help( - HWND in_hWnd, eDialog in_eDialog, LPCWSTR in_szLanguageCode) const { - return false; -}; - -bool Hv_{{name}}_WwiseAuthoringPlugin::SaveAudioFileToTableId(unsigned int tableId) { - static TCHAR BASED_CODE szFilter[] = _T("Audio Files (*.wav)|*.wav|"); - CFileDialog dialog(TRUE, NULL, NULL, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, szFilter); - if (dialog.DoModal() == IDOK) { - m_pObjectMedia->SetMediaSource(dialog.GetPathName(), tableId, true); - return true; - } - return false; -}; -{# force new line #} diff --git a/hvcc/generators/c2wwise/templates/source/authoring/Hv_{{name}}_WwiseAuthoringPlugin.def b/hvcc/generators/c2wwise/templates/source/authoring/Hv_{{name}}_WwiseAuthoringPlugin.def deleted file mode 100644 index c619ce5e..00000000 --- a/hvcc/generators/c2wwise/templates/source/authoring/Hv_{{name}}_WwiseAuthoringPlugin.def +++ /dev/null @@ -1,6 +0,0 @@ -; Hv_{{name}}_Wwise{{plugin_type}}AuthPlugin.def : Declares the module parameters for the DLL. - -LIBRARY "Hv_{{name}}_Wwise{{plugin_type}}AuthPlugin" - -EXPORTS - AkCreatePlugin diff --git a/hvcc/generators/c2wwise/templates/source/authoring/Hv_{{name}}_WwiseAuthoringPlugin.h b/hvcc/generators/c2wwise/templates/source/authoring/Hv_{{name}}_WwiseAuthoringPlugin.h deleted file mode 100644 index fd42afa9..00000000 --- a/hvcc/generators/c2wwise/templates/source/authoring/Hv_{{name}}_WwiseAuthoringPlugin.h +++ /dev/null @@ -1,82 +0,0 @@ -{{copyright}} - -#ifndef _HV_{{name|upper}}_WWISE_PLUGIN_H_ -#define _HV_{{name|upper}}_WWISE_PLUGIN_H_ - -#include - -/** - * Plugin property names - * NOTE: These should be named the same as the respective Property Name value - * in the plugin xml definition - */ -{%- for k, v in parameters %} -static LPCWSTR szHv_{{name}}_Param_{{k}} = L"{{k}}"; -{%- endfor %} - -class Hv_{{name}}_WwiseAuthoringPlugin : public AK::Wwise::DefaultAudioPluginImplementation, - public AK::Wwise::IPluginMediaConverter { -public: - Hv_{{name}}_WwiseAuthoringPlugin(AkUInt16 in_idPlugin); - - ~Hv_{{name}}_WwiseAuthoringPlugin() {}; - - /** AK::Wwise::IPluginBase Overrides */ - virtual void Destroy(); // Implement the destruction of the Wwise source plugin. - - /** AK:WWise::IPluginMediaConverter Overrides */ - virtual AK::Wwise::IPluginMediaConverter* GetPluginMediaConverterInterface() override; - - virtual AK::Wwise::ConversionResult ConvertFile(const GUID &in_guidPlatform, const BasePlatformID &in_basePlatform, - LPCWSTR in_szSourceFile, LPCWSTR in_szDestFile, AkUInt32 in_uSampleRate, AkUInt32 in_uBlockLength, - AK::Wwise::IProgress *in_pProgress, AK::Wwise::IWriteString *io_pError) override; - - virtual ULONG GetCurrentConversionSettingsHash(const GUID & in_guidPlatform, - AkUInt32 in_uSampleRate, AkUInt32 in_uBlockLength) override; - - /** DefaultAudioPluginImplementation */ - virtual void InitToDefault() override; - - /** AK::Wwise::IAudioPlugin Overrides */ - virtual void SetPluginPropertySet(AK::Wwise::IPluginPropertySet * in_pPSet); - - virtual void SetPluginObjectMedia(AK::Wwise::IPluginObjectMedia *in_pObjectMedia) override; - - virtual void NotifyPluginMediaChanged() override; - - virtual void NotifyPropertyChanged(const GUID & in_guidPlatform, - LPCWSTR in_szPropertyName) {}; - - virtual HINSTANCE GetResourceHandle() const; - - virtual bool GetDialog(eDialog in_eDialog, UINT & out_uiDialogID, - AK::Wwise::PopulateTableItem *& out_pTable) const; - - virtual bool WindowProc(eDialog in_eDialog, HWND in_hWnd, UINT in_message, - WPARAM in_wParam, LPARAM in_lParam, LRESULT & out_lResult); - - virtual bool GetBankParameters(const GUID & in_guidPlatform, - AK::Wwise::IWriteData* in_pDataWriter) const; - - virtual bool Help(HWND in_hWnd, eDialog in_eDialog, - LPCWSTR in_szLanguageCode) const; - - static const short CompanyID; - static const short PluginID; - -private: - bool SaveAudioFileToTableId(unsigned int tableId); - - AK::Wwise::IPluginPropertySet *m_pPSet; - AK::Wwise::IPluginObjectMedia *m_pObjectMedia; - HWND m_hwndPropView; - HWND m_hwndObjPane; - AkUInt16 m_idDialogBig; - AkUInt16 m_idDialogSmall; - {% if (parameters|length + sends|length + tables|length) > 10 -%} - int m_scrollPos; - {% endif -%} -}; - -#endif // _HV_{{name|upper}}_WWISE_PLUGIN_H_ -{# force new line #} diff --git a/hvcc/generators/c2wwise/templates/source/authoring/Hv_{{name}}_WwiseAuthoringPluginApp.cpp b/hvcc/generators/c2wwise/templates/source/authoring/Hv_{{name}}_WwiseAuthoringPluginApp.cpp deleted file mode 100644 index aaff13da..00000000 --- a/hvcc/generators/c2wwise/templates/source/authoring/Hv_{{name}}_WwiseAuthoringPluginApp.cpp +++ /dev/null @@ -1,34 +0,0 @@ -{{copyright}} - -#include "stdafx.h" -#include -#include -#include "Hv_{{name}}_Wwise{{plugin_type}}PluginFactory.h" -#include "Hv_{{name}}_WwiseAuthoringPlugin.h" -#include "Hv_{{name}}_WwiseAuthoringPluginApp.h" - -BEGIN_MESSAGE_MAP(Hv_{{name}}_WwiseAuthoringPluginApp, CWinApp) -END_MESSAGE_MAP() - -/** Only one PluginApp should exist */ -Hv_{{name}}_WwiseAuthoringPluginApp {{name}}App; - -BOOL Hv_{{name}}_WwiseAuthoringPluginApp::InitInstance() { - __super::InitInstance(); - AK::Wwise::RegisterWwisePlugin(); - return TRUE; -} - -/** Plugin Creation DLL export. */ -AK::Wwise::IPluginBase* __stdcall AkCreatePlugin( - unsigned short in_usCompanyID, unsigned short in_usPluginID) { - if (in_usCompanyID == Hv_{{name}}_WwiseAuthoringPlugin::CompanyID && - in_usPluginID == Hv_{{name}}_WwiseAuthoringPlugin::PluginID) { - return new Hv_{{name}}_WwiseAuthoringPlugin(in_usPluginID); - } - return NULL; -} - -/** Dummy assert hook for Wwise plug-ins using AKASSERT (cassert used by default). */ -DEFINEDUMMYASSERTHOOK; -{# force new line #} diff --git a/hvcc/generators/c2wwise/templates/source/authoring/Hv_{{name}}_WwiseAuthoringPluginApp.h b/hvcc/generators/c2wwise/templates/source/authoring/Hv_{{name}}_WwiseAuthoringPluginApp.h deleted file mode 100644 index 5fa1f06b..00000000 --- a/hvcc/generators/c2wwise/templates/source/authoring/Hv_{{name}}_WwiseAuthoringPluginApp.h +++ /dev/null @@ -1,22 +0,0 @@ -{{copyright}} - -#ifndef _HV_{{name|upper}}_WWISE_APP_H_ -#define _HV_{{name|upper}}_WWISE_APP_H_ - -#ifndef __AFXWIN_H__ -#error include 'stdafx.h' before including this file for PCH -#endif - -#include "Hv_{{name}}_WwiseResource.h" // main symbols - -class Hv_{{name}}_WwiseAuthoringPluginApp : public CWinApp { -public: - Hv_{{name}}_WwiseAuthoringPluginApp() {}; - - virtual BOOL InitInstance(); - - DECLARE_MESSAGE_MAP() -}; - -#endif // _HV_{{name|upper}}_WWISE_APP_H_ -{# force new line #} diff --git a/hvcc/generators/c2wwise/templates/source/engine/Hv_{{name}}_WwisePluginEngineParams.cpp b/hvcc/generators/c2wwise/templates/source/engine/Hv_{{name}}_WwisePluginEngineParams.cpp deleted file mode 100644 index 2b68dcc6..00000000 --- a/hvcc/generators/c2wwise/templates/source/engine/Hv_{{name}}_WwisePluginEngineParams.cpp +++ /dev/null @@ -1,77 +0,0 @@ -{{copyright}} - -#include "Hv_{{name}}_WwisePluginEngineParams.h" -#include - -Hv_{{name}}_EngineParams::Hv_{{name}}_EngineParams() { - -} - -Hv_{{name}}_EngineParams::Hv_{{name}}_EngineParams(const Hv_{{name}}_EngineParams & in_rCopy) { - m_Params = in_rCopy.m_Params; -} - -Hv_{{name}}_EngineParams::~Hv_{{name}}_EngineParams() { - -} - -AK::IAkPluginParam * Hv_{{name}}_EngineParams::Clone(AK::IAkPluginMemAlloc *in_pAllocator) { - return AK_PLUGIN_NEW(in_pAllocator, Hv_{{name}}_EngineParams(*this)); -} - -AKRESULT Hv_{{name}}_EngineParams::Init( - AK::IAkPluginMemAlloc *in_pAllocator, const void *in_pParamsBlock, AkUInt32 in_uBlockSize) { - if (in_uBlockSize == 0) { - // Init with default values if we got invalid parameter block. - // Generated RTPCs - {%- for k, v in parameters %} - m_Params.fHVParam_{{k}} = {{v.attributes.default}}f; - {%- endfor %} - - return AK_Success; - } - - return SetParamsBlock(in_pParamsBlock, in_uBlockSize); -} - -AKRESULT Hv_{{name}}_EngineParams::Term( - AK::IAkPluginMemAlloc *in_pAllocator) { - AK_PLUGIN_DELETE(in_pAllocator, this); - return AK_Success; -} - -AKRESULT Hv_{{name}}_EngineParams::SetParamsBlock( - const void *in_pParamsBlock, AkUInt32 in_ulBlockSize) { - - AKRESULT eResult = AK_Success; - AkUInt8 *pParamsBlock = (AkUInt8 *) in_pParamsBlock; - - // Retrieve generated Heavy parameters - {%- for k, v in parameters %} - m_Params.fHVParam_{{k}} = READBANKDATA(AkReal32, pParamsBlock, in_ulBlockSize); - {%- endfor %} - - CHECKBANKDATASIZE(in_ulBlockSize, eResult); - - return eResult; -} - -AKRESULT Hv_{{name}}_EngineParams::SetParam(AkPluginParamID in_ParamID, - const void *in_pValue, AkUInt32 in_uParamSize) { - if (in_pValue == NULL) return AK_InvalidParameter; // Consistency check - - // Set parameter value. - switch (in_ParamID) { - {%- for k, v in parameters %} - case HV_{{name|upper}}_PARAM_IN_{{k|upper}}_ID: { - // This parameter is RTPCed - m_Params.fHVParam_{{k}} = *reinterpret_cast(in_pValue); - break; - } - {%- endfor %} - default: AKASSERT(!"Unknown parameter"); break; - } - - return AK_Success; -} -{# force new line #} diff --git a/hvcc/generators/c2wwise/templates/source/engine/Hv_{{name}}_WwisePluginEngineParams.h b/hvcc/generators/c2wwise/templates/source/engine/Hv_{{name}}_WwisePluginEngineParams.h deleted file mode 100644 index 721d8210..00000000 --- a/hvcc/generators/c2wwise/templates/source/engine/Hv_{{name}}_WwisePluginEngineParams.h +++ /dev/null @@ -1,83 +0,0 @@ -{{copyright}} - -#ifndef _HV_{{name|upper}}_WWISE_PLUGIN_ENGINE_PARAMS_H_ -#define _HV_{{name|upper}}_WWISE_PLUGIN_ENGINE_PARAMS_H_ - -#include -#include - -/** Generated RTPC IDs */ - -// Input Parameters -{%- for k, v in parameters %} -static const AkPluginParamID HV_{{name|upper}}_PARAM_IN_{{k|upper}}_ID = {{loop.index-1}}; -{%- endfor %} - -/** Parameters structure for this effect. */ -struct Hv_{{name}}_RTPCParams { - /** Generated Heavy Parameters */ - {%- for k, v in parameters %} - AkReal32 fHVParam_{{k}}; - {%- endfor %} -}; - -/** - * class Hv_{{name}}_EngineParams - * Implementation of Heavy Wwise plugin shared parameters. - */ -class Hv_{{name}}_EngineParams : public AK::IAkPluginParam { - public: - /** Allow effect to call accessor functions for retrieving parameter values. */ - friend class Hv_{{name}}_WwisePluginEngine; - - /** Default Constructor. */ - Hv_{{name}}_EngineParams(); - - /** Destructor. */ - virtual ~Hv_{{name}}_EngineParams(); - - /** Copy constructor. */ - Hv_{{name}}_EngineParams(const Hv_{{name}}_EngineParams &in_rCopy); - - /** Create duplicate. */ - virtual IAkPluginParam *Clone(AK::IAkPluginMemAlloc *in_pAllocator); - - /** Parameters node initialization. */ - virtual AKRESULT Init(AK::IAkPluginMemAlloc *in_pAllocator, const void *in_pParamsBlock, - AkUInt32 in_uBlockSize); - - /** Terminate. */ - virtual AKRESULT Term(AK::IAkPluginMemAlloc *in_pAllocator); - - /** Set all parameters at once. */ - virtual AKRESULT SetParamsBlock(const void * in_pParamsBlock, - AkUInt32 in_uBlockSize); - - /** Update one parameter. */ - virtual AKRESULT SetParam(AkPluginParamID in_ParamID, const void *in_pValue, - AkUInt32 in_uParamSize); - -private: - /** Hide assignment operator. */ - Hv_{{name}}_EngineParams &operator=(const Hv_{{name}}_EngineParams &in_rCopy) = default; - - /** RTPC'd Heavy Parameter Getter Methods */ - {%- for k, v in parameters %} - AkReal32 GetParam_{{k}}(); - {%- endfor %} - - /** RTPC Parameter structure. */ - Hv_{{name}}_RTPCParams m_Params; -}; - -/** Getter methods for generated Heavy parameters */ -{%- for k, v in parameters %} -inline AkReal32 Hv_{{name}}_EngineParams::GetParam_{{k}}() { - AkReal32 fParam_{{k}} = m_Params.fHVParam_{{k}}; - AKASSERT(fParam_{{k}} >= {{v.attributes.min}} && fParam_{{k}} <= {{v.attributes.max}}); - return fParam_{{k}}; -} -{% endfor %} - -#endif // _HV_{{name|upper}}_WWISE_PLUGIN_ENGINE_PARAMS_H_ -{# force new line #} diff --git a/hvcc/generators/c2wwise/templates/source/engine/Hv_{{name}}_Wwise{{type}}PluginEngine.cpp b/hvcc/generators/c2wwise/templates/source/engine/Hv_{{name}}_Wwise{{type}}PluginEngine.cpp deleted file mode 100644 index 1693d691..00000000 --- a/hvcc/generators/c2wwise/templates/source/engine/Hv_{{name}}_Wwise{{type}}PluginEngine.cpp +++ /dev/null @@ -1,247 +0,0 @@ -{%- set isSource = true if plugin_type == "Source" -%} -{{copyright}} - -#include "Hv_{{name}}_Wwise{{plugin_type}}PluginEngine.h" -#include "Hv_{{name}}_WwisePluginIDs.h" -#include "Heavy_{{name}}.hpp" -#include -#include -#include - -typedef struct WavHeader { - uint32_t ChunkID; // 0 - uint32_t ChunkSize; // 4 - uint32_t Format; // 8 - uint32_t Subchunk1ID; // 12 - uint32_t Subchunk1Size; // 16 - uint16_t AudioFormat; // 20 - uint16_t NumChannels; // 22 - uint32_t SampleRate; // 24 - uint32_t ByteRate; // 28 - uint16_t BlockAlign; // 32 - uint16_t BitsPerSample; // 34 - uint32_t Subchunk2ID; // 36 - uint32_t Subchunk2Size; // 40 - uint32_t Subchunk2Data; // 44 - uint32_t Subchunk3ID; // 48 - uint32_t Subchunk3Size; // 52 - // data -> 56 -} WavHeader; - - -AK::IAkPlugin* CreateHv_{{name}}_WwisePluginEngine(AK::IAkPluginMemAlloc *in_pAllocator) { - return AK_PLUGIN_NEW( in_pAllocator, Hv_{{name}}_WwisePluginEngine() ); -} - -/** Plugin mechanism. Parameters node creation function to be registered to the FX manager. */ -AK::IAkPluginParam *CreateHv_{{name}}_WwisePluginEngineParams(AK::IAkPluginMemAlloc *in_pAllocator) { - return AK_PLUGIN_NEW(in_pAllocator, Hv_{{name}}_EngineParams()); -} - - -static void OnHeavyPrint(HeavyContextInterface *context, const char *printName, const char *str, - const HvMessage *msg) { - Hv_{{name}}_WwisePluginEngine *engine = reinterpret_cast(context->getUserData()); - if (engine != nullptr) { - engine->PostDebugMessage(str); - } -} -{% if sends|length > 0 %} -static void OnSendMessageCallback(HeavyContextInterface *context, const char *sendName, - hv_uint32_t sendHash, const HvMessage *msg) { - Hv_{{name}}_WwisePluginEngine *engine = reinterpret_cast(context->getUserData()); - if (engine != nullptr && hv_msg_isFloat(msg, 0)) { - switch (sendHash) { - {%- for k, v in sends %} - case {{v.hash}}: engine->SetOutRTPC("{{k|lower}}", {{k|length}}, hv_msg_getFloat(msg, 0)); break; - {%- endfor %} - default: return; - } - } -} -{%- endif %} -/** Static initializer object to register automatically the plugin into the sound engine */ -AK::PluginRegistration Hv_{{name}}_Wwise{{plugin_type}}PluginRegistration( - {{ "AkPluginTypeSource" if isSource else "AkPluginTypeEffect" }}, - HV_COMPANY_ID, HV_{{name|upper}}_PLUGIN_ID, - CreateHv_{{name}}_WwisePluginEngine, - CreateHv_{{name}}_WwisePluginEngineParams); - -Hv_{{name}}_WwisePluginEngine::Hv_{{name}}_WwisePluginEngine() { - /** Initialize members. */ - m_pPluginContext = NULL; - m_pEngineParams = NULL; - m_pHeavyContext = NULL; - m_uSampleRate = 0; - - {%- for k, v in parameters %} - m_fPrevParam_{{k}} = {{v.attributes.default}}f; - {%- endfor %} -} - -Hv_{{name}}_WwisePluginEngine::~Hv_{{name}}_WwisePluginEngine() { - -} - -AKRESULT Hv_{{name}}_WwisePluginEngine::Init(AK::IAkPluginMemAlloc *in_pAllocator, - AK::{{ "IAkSourcePluginContext" if isSource else "IAkEffectPluginContext" }} *in_pPluginContext, AK::IAkPluginParam *in_pParams, - AkAudioFormat &io_rFormat) { - - m_pPluginContext = in_pPluginContext; - - AKASSERT(in_pParams != NULL); - - // Initialise Heavy context - m_uSampleRate = io_rFormat.uSampleRate; - m_pHeavyContext = new Heavy_{{name}}((double) m_uSampleRate, {{pool_sizes_kb.internal}}, {{pool_sizes_kb.inputQueue}}, {{pool_sizes_kb.outputQueue}}); - m_pHeavyContext->setUserData(this); - {% if sends|length > 0 -%} - m_pHeavyContext->setSendHook(&OnSendMessageCallback); - {%- endif %} -#ifndef AK_OPTIMIZED - m_pHeavyContext->setPrintHook(&OnHeavyPrint); -#endif - {% if isSource %} - // Notify pipeline of chosen output format change. - AkChannelMask channelMask = (hv_getNumOutputChannels(m_pHeavyContext) > 1) - ? AK_SPEAKER_SETUP_2_0 : AK_SPEAKER_SETUP_MONO; - io_rFormat.channelConfig.SetStandard(channelMask); - {% endif %} - // Initialise Parameters - m_pEngineParams = reinterpret_cast(in_pParams); - {%- for k, v in parameters %} - hv_sendFloatToReceiver(m_pHeavyContext, Heavy_{{name}}::Parameter::In::{{k|upper}}, m_pEngineParams->GetParam_{{k}}()); - {%- endfor %} - {% if tables|length > 0 %} - // Initialise tables with media - {%- for k, v in tables %} - LoadPluginMediaToHeavyTable({{loop.index-1}}, {{v.hash}}, hv_stringToHash("setTableSize-{{v.display}}")); // table '{{v.display}}' - {%- endfor %} - {% endif %} - AK_PERF_RECORDING_RESET(); - - return AK_Success; -} - -AKRESULT Hv_{{name}}_WwisePluginEngine::Term(AK::IAkPluginMemAlloc *in_pAllocator) { - delete m_pHeavyContext; - AK_PLUGIN_DELETE(in_pAllocator, this); - return AK_Success; -} - -AKRESULT Hv_{{name}}_WwisePluginEngine::GetPluginInfo(AkPluginInfo & out_rPluginInfo) { - out_rPluginInfo.eType = {{ "AkPluginTypeSource" if isSource else "AkPluginTypeEffect" }}; - out_rPluginInfo.bIsInPlace = true; - out_rPluginInfo.uBuildVersion = AK_WWISESDK_VERSION_COMBINED; - return AK_Success; -} - -void Hv_{{name}}_WwisePluginEngine::Execute(AkAudioBuffer *io_pBufferOut) { - AK_PERF_RECORDING_START( "Hv_{{name}}_Wwise{{type}}PluginEngine", 25, 30); - - // Retrieve RTPC values and send in as a message to context - {%- for k, v in parameters %} - AkReal32 param_{{k}} = m_pEngineParams->GetParam_{{k}}(); - if (param_{{k}} != m_fPrevParam_{{k}}) { - hv_sendFloatToReceiver(m_pHeavyContext, Heavy_{{name}}::Parameter::In::{{k|upper}}, param_{{k}}); - m_fPrevParam_{{k}} = param_{{k}}; - } - {%- endfor %} - - {% if not isSource -%} - // zero-pad the rest of the buffer in case the numFrames is not a multiple of 4 - io_pBufferOut->ZeroPadToMaxFrames(); - {%- endif %} - - // Calculate num frames to process and retrieve buffer - AkUInt16 numFramesToProcess = io_pBufferOut->MaxFrames(); - float *buffer = (float *) io_pBufferOut->GetChannel(0); - {% if isSource %} - m_pHeavyContext->processInline(nullptr, buffer, numFramesToProcess); - {% else %} - // Check for channel configuration mismatch - if (io_pBufferOut->NumChannels() == 1 && - ((m_pHeavyContext->getNumInputChannels() == 2) || (m_pHeavyContext->getNumOutputChannels() == 2))) { - float *tempBuffer[2] = { buffer, buffer }; - m_pHeavyContext->process(tempBuffer, tempBuffer, numFramesToProcess); - } else { - m_pHeavyContext->processInline(buffer, buffer, numFramesToProcess); - } - {% endif %} - io_pBufferOut->uValidFrames = numFramesToProcess; - {% if isSource -%}io_pBufferOut->eState = AK_DataReady;{%- endif %} - - AK_PERF_RECORDING_STOP("Hv_{{name}}_Wwise{{type}}PluginEngine", 25, 30); -} -{% if isSource %} -AkReal32 Hv_{{name}}_WwisePluginEngine::GetDuration() const { - return 0.0f; // Infinite duration. -} - -AkReal32 Hv_{{name}}_WwisePluginEngine::GetEnvelope() const { - return 1.0f; // Normalized envelope. -} - -AKRESULT Hv_{{name}}_WwisePluginEngine::StopLooping() { - return AK_Success; -} -{% endif %} -void Hv_{{name}}_WwisePluginEngine::PostDebugMessage(const char *message) { - m_pPluginContext->PostMonitorMessage(message, AK::Monitor::ErrorLevel::ErrorLevel_Message); -} - -void Hv_{{name}}_WwisePluginEngine::LoadPluginMediaToHeavyTable(unsigned int mediaIndex, - unsigned int tableHash, unsigned int tableSizeReceiverHash) { - AkUInt8 *pPluginData = NULL; - AkUInt32 uPluginDataSize; - m_pPluginContext->GetPluginMedia(mediaIndex, pPluginData, uPluginDataSize); // retrieve stored plugin data - - if (pPluginData != NULL) { - // determine wav header format - WavHeader h; - hv_memcpy(&h, pPluginData, sizeof(WavHeader)); - uint32_t offsetBytes = 0; - const uint32_t dataID = 0x61746164; // 'data' - const uint32_t factID = 0x74636166; // 'fact' - if (h.Subchunk2ID == dataID) { - offsetBytes = 44; - } - else if (h.Subchunk2ID == factID && h.Subchunk3ID == dataID) { - offsetBytes = 56; - } - - uint32_t newSizeBytes = uPluginDataSize - offsetBytes; - if (offsetBytes > 0 && newSizeBytes > 0) { - // adjust table size - const uint32_t numSamples = newSizeBytes * 8 / h.BitsPerSample; - m_pHeavyContext->setLengthForTable(tableHash, numSamples); - - float *buffer = m_pHeavyContext->getBufferForTable(tableHash); - if (buffer != NULL && newSizeBytes > 0) { - // copy contents and notify respective receiver - hv_memcpy(buffer, (float *) (pPluginData + offsetBytes), newSizeBytes); - m_pHeavyContext->sendFloatToReceiver(tableSizeReceiverHash, (float) numSamples); - } - } - } -} - -void Hv_{{name}}_WwisePluginEngine::SetOutRTPC(const char *rtpcName, - unsigned int nameLength, float value) { - AK::FNVHash32 hashFunc; - // Set the RTPC value for the plugin's associated gameobject. - // Note(joe): if the plugin is on a bus the gameobject will be null and thus - // set the global RTPC. - m_pPluginContext->GlobalContext()->SetRTPCValue( - hashFunc.Compute((unsigned char *) rtpcName, nameLength*sizeof(char)), - value, -#if AK_WWISESDK_VERSION_MAJOR <= 2019 - m_pPluginContext->GetVoiceInfo()->GetGameObjectID(), -#else - m_pPluginContext->GetGameObjectInfo()->GetGameObjectID(), -#endif - 0, - AkCurveInterpolation_Linear, - true); // disable interpolation, let the plugin handle it internally -} -{# force new line #} diff --git a/hvcc/generators/c2wwise/templates/source/engine/Hv_{{name}}_Wwise{{type}}PluginEngine.h b/hvcc/generators/c2wwise/templates/source/engine/Hv_{{name}}_Wwise{{type}}PluginEngine.h deleted file mode 100644 index 36f25398..00000000 --- a/hvcc/generators/c2wwise/templates/source/engine/Hv_{{name}}_Wwise{{type}}PluginEngine.h +++ /dev/null @@ -1,65 +0,0 @@ -{%- set isSource = true if plugin_type == "Source" -%} -{{copyright}} - -#ifndef _HV_{{name|upper}}_WWISE_PLUGIN_ENGINE_H_ -#define _HV_{{name|upper}}_WWISE_PLUGIN_ENGINE_H_ - -#include "Hv_{{name}}_WwisePluginEngineParams.h" - -class HeavyContextInterface; - -/** - * class Hv_{{name}}_WwisePluginEngine - * Heavy context wrapper (source effect). - */ -class Hv_{{name}}_WwisePluginEngine : public AK::{{ "IAkSourcePlugin" if isSource else "IAkInPlaceEffectPlugin" }} -{ -public: - Hv_{{name}}_WwisePluginEngine(); - virtual ~Hv_{{name}}_WwisePluginEngine(); - - // Plugin initialization - virtual AKRESULT Init(AK::IAkPluginMemAlloc *in_pAllocator, - AK::{{ "IAkSourcePluginContext" if isSource else "IAkEffectPluginContext" }} *in_pPluginContext, - AK::IAkPluginParam *in_pParams, - AkAudioFormat &io_rFormat) override; - - virtual AKRESULT Term(AK::IAkPluginMemAlloc *in_pAllocator) override; - - virtual AKRESULT Reset() override { return AK_Success; } - - virtual AKRESULT GetPluginInfo(AkPluginInfo & out_rPluginInfo) override; - - // Main processing loop - virtual void Execute(AkAudioBuffer *io_pBuffer) override; -{% if isSource %} - virtual AkReal32 GetDuration() const override; - - virtual AkReal32 GetEnvelope() const override; - - virtual AKRESULT StopLooping() override; -{% else %} - // Return AK_DataReady or AK_NoMoreData, depending if there would be audio output or not at that point. - virtual AKRESULT TimeSkip(AkUInt32 in_uFrames) override { return AK_DataReady; } -{% endif %} - void PostDebugMessage(const char *str); - - void SetOutRTPC(const char *rtpcName, unsigned int nameLength, float value); - -private: - void LoadPluginMediaToHeavyTable(unsigned int mediaIndex, unsigned int tableHash, - unsigned int tableSizeReceiverHash); - - AK::{{ "IAkSourcePluginContext" if isSource else "IAkEffectPluginContext" }} *m_pPluginContext; // Plugin context interface. - Hv_{{name}}_EngineParams *m_pEngineParams; // Modified by Wwise/RTPC. - HeavyContextInterface *m_pHeavyContext; // Main Heavy patch context - AkUInt32 m_uSampleRate; - - // Store previous RTPC values - {%- for k, v in parameters %} - AkReal32 m_fPrevParam_{{k}}; - {%- endfor %} -}; - -#endif // _HV_{{name|upper}}_WWISE_PLUGIN_ENGINE_H_ -{# force new line #} diff --git a/hvcc/generators/c2wwise/templates/source/include/Hv_{{name}}_WwisePluginIDs.h b/hvcc/generators/c2wwise/templates/source/include/Hv_{{name}}_WwisePluginIDs.h deleted file mode 100644 index f9e30070..00000000 --- a/hvcc/generators/c2wwise/templates/source/include/Hv_{{name}}_WwisePluginIDs.h +++ /dev/null @@ -1,15 +0,0 @@ -{{copyright}} - -#ifndef _HV_{{name|upper}}_WWISE_PLUGIN_IDS_H_ -#define _HV_{{name|upper}}_WWISE_PLUGIN_IDS_H_ - -#include - -// This ID must be the same as the PluginID in the Plug-in's XML definition file -// and is persisted in project files. -// Note: Don't change the ID or existing projects will not recognize this plug-in anymore. -const AkUInt32 HV_COMPANY_ID = 64; -const AkUInt32 HV_{{name|upper}}_PLUGIN_ID = {{plugin_id}}; - -#endif // _HV_{{name|upper}}_WWISE_PLUGIN_IDS_H_ -{# force new line #} diff --git a/hvcc/generators/c2wwise/templates/source/include/Hv_{{name}}_Wwise{{type}}PluginFactory.h b/hvcc/generators/c2wwise/templates/source/include/Hv_{{name}}_Wwise{{type}}PluginFactory.h deleted file mode 100644 index 7e42e890..00000000 --- a/hvcc/generators/c2wwise/templates/source/include/Hv_{{name}}_Wwise{{type}}PluginFactory.h +++ /dev/null @@ -1,13 +0,0 @@ -{{copyright}} - -#ifndef _HV_{{name|upper}}_WWISE_SOURCE_PLUGIN_FACTORY_H_ -#define _HV_{{name|upper}}_WWISE_SOURCE_PLUGIN_FACTORY_H_ - -#ifndef AK_IOS -#include -#endif - -AK_STATIC_LINK_PLUGIN(Hv_{{name}}_Wwise{{plugin_type}}Plugin); - -#endif // _HV_{{name|upper}}_WWISE_SOURCE_PLUGIN_FACTORY_H_ -{# force new line #} diff --git a/hvcc/generators/c2wwise/templates/source/runtime/Hv_{{name}}_WwisePluginRegister.cpp b/hvcc/generators/c2wwise/templates/source/runtime/Hv_{{name}}_WwisePluginRegister.cpp deleted file mode 100644 index da508c92..00000000 --- a/hvcc/generators/c2wwise/templates/source/runtime/Hv_{{name}}_WwisePluginRegister.cpp +++ /dev/null @@ -1,13 +0,0 @@ -{{copyright}} - -#include /// Dummy assert hook definition. -#include -#include "Hv_{{name}}_Wwise{{plugin_type}}PluginFactory.h" -#include "Hv_{{name}}_WwisePluginIDs.h" - -DEFINE_PLUGIN_REGISTER_HOOK - -// Manually define the assert hook for now as the definition of DEFINEDUMMYASSERTHOOK -// is in a file that shouldn't be linked against for console builds -AkAssertHook g_pAssertHook = NULL; -{# force new line #} diff --git a/hvcc/generators/c2wwise/templates/vs2015/Hv_{{name}}_Wwise{{type}}AuthPlugin.vcxproj b/hvcc/generators/c2wwise/templates/vs2015/Hv_{{name}}_Wwise{{type}}AuthPlugin.vcxproj deleted file mode 100644 index d144a60f..00000000 --- a/hvcc/generators/c2wwise/templates/vs2015/Hv_{{name}}_Wwise{{type}}AuthPlugin.vcxproj +++ /dev/null @@ -1,469 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Profile - Win32 - - - Profile - x64 - - - Release - Win32 - - - Release - x64 - - - - Hv_{{name}}_Wwise{{plugin_type}}AuthPlugin - {8257454F-51E6-4481-948B-034FD37C0FBF} - Heavy - 8.1 - - - C:\Program Files (x86)\Audiokinetic\Wwise {{wwise_version}}\SDK - - - - DynamicLibrary - v{{msbuild_version}} - Static - false - Unicode - - - DynamicLibrary - v{{msbuild_version}} - Static - false - Unicode - - - DynamicLibrary - v{{msbuild_version}} - Static - false - Unicode - - - DynamicLibrary - v{{msbuild_version}} - Static - false - Unicode - - - DynamicLibrary - v{{msbuild_version}} - Static - false - Unicode - - - DynamicLibrary - v{{msbuild_version}} - Static - false - Unicode - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>12.0.30501.0 - - - $(SolutionDir)..\build\win\x86\release\ - $(SolutionDir)intermediate\win\x86\release\$(ProjectName)\ - false - - - $(SolutionDir)..\build\win\x86\profile\ - $(SolutionDir)intermediate\win\x86\profile\$(ProjectName)\ - false - - - $(SolutionDir)..\build\win\x86\debug\ - $(SolutionDir)intermediate\win\x86\debug\$(ProjectName)\ - false - - - $(SolutionDir)..\build\win\$(Platform)\release\ - $(SolutionDir)intermediate\win\$(Platform)\release\$(ProjectName)\ - false - - - $(SolutionDir)..\build\win\$(Platform)\profile\ - $(SolutionDir)intermediate\win\$(Platform)\profile\$(ProjectName)\ - false - - - $(SolutionDir)..\build\win\$(Platform)\debug\ - $(SolutionDir)intermediate\win\$(Platform)\debug\$(ProjectName)\ - false - - - - _DEBUG;_XKEYCHECK_H;%(PreprocessorDefinitions) - false - - - Disabled - $(WwiseSDKPath)\include;$(SolutionDir)..\source\include;$(SolutionDir)..\source\{{plugin_type|lower}}_engine;%(AdditionalIncludeDirectories) - WIN32;_XKEYCHECK_H;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebug - - $(IntDir) - $(IntDir)vc70.pdb - Level3 - Sync - - - _DEBUG;_XKEYCHECK_H;%(PreprocessorDefinitions) - 0x0409 - $(IntDir);$(WwiseSDKPath)\include;$(WwiseSDKPath)\samples\Common;%(AdditionalIncludeDirectories) - - - false - - - Hv_{{name}}_Wwise{{plugin_type}}Engine.lib;HtmlHelp.lib;%(AdditionalDependencies) - $(OutDir)$(ProjectName).dll - $(OutDir);%(AdditionalLibraryDirectories) - false - $(SolutionDir)..\source\authoring\Hv_{{name}}_WwiseAuthoringPlugin.def - true - $(IntDir)$(ProjectName).pdb - $(IntDir)$(TargetName).lib - Windows - false - - MachineX86 - - - - - - _DEBUG;_XKEYCHECK_H;%(PreprocessorDefinitions) - false - X64 - - - Disabled - $(WwiseSDKPath)\include;$(SolutionDir)..\source\include;$(SolutionDir)..\source\{{plugin_type|lower}}_engine;%(AdditionalIncludeDirectories) - WIN64;HV_SIMD_SSE;_XKEYCHECK_H;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebug - - $(IntDir) - $(IntDir)vc70.pdb - Level3 - ProgramDatabase - Sync - - - _DEBUG;_XKEYCHECK_H;%(PreprocessorDefinitions) - 0x0409 - $(IntDir);$(WwiseSDKPath)\include;$(WwiseSDKPath)\samples\Common;%(AdditionalIncludeDirectories) - - - false - - - Hv_{{name}}_Wwise{{plugin_type}}Engine.lib;HtmlHelp.lib;%(AdditionalDependencies) - $(OutDir)$(ProjectName).dll - $(OutDir);%(AdditionalLibraryDirectories) - false - $(SolutionDir)..\source\authoring\Hv_{{name}}_WwiseAuthoringPlugin.def - true - $(IntDir)$(ProjectName).pdb - $(IntDir)$(TargetName).lib - Windows - false - - MachineX64 - - - - - - _DEBUG;_XKEYCHECK_H;%(PreprocessorDefinitions) - false - - - MaxSpeed - true - $(WwiseSDKPath)\include;$(SolutionDir)..\source\include;$(SolutionDir)..\source\{{plugin_type|lower}}_engine;%(AdditionalIncludeDirectories) - WIN32;_XKEYCHECK_H;%(PreprocessorDefinitions) - true - MultiThreaded - false - StreamingSIMDExtensions2 - - $(IntDir)vc70.pdb - Level3 - ProgramDatabase - Sync - - - NDEBUG;_XKEYCHECK_H;%(PreprocessorDefinitions) - 0x0409 - $(IntDir);$(WwiseSDKPath)\include;$(WwiseSDKPath)\samples\Common;%(AdditionalIncludeDirectories) - - - false - - - Hv_{{name}}_Wwise{{plugin_type}}Engine.lib;HtmlHelp.lib;%(AdditionalDependencies) - $(OutDir)$(ProjectName).dll - $(OutDir);%(AdditionalLibraryDirectories) - $(SolutionDir)..\source\authoring\Hv_{{name}}_WwiseAuthoringPlugin.def - true - $(IntDir)$(ProjectName).pdb - $(IntDir)$(TargetName).lib - Windows - true - true - false - - MachineX86 - - - - - - false - NDEBUG;_XKEYCHECK_H;%(PreprocessorDefinitions) - X64 - - - MaxSpeed - true - $(WwiseSDKPath)\include;$(SolutionDir)..\source\include;$(SolutionDir)..\source\{{plugin_type|lower}}_engine;%(AdditionalIncludeDirectories) - WIN64;_XKEYCHECK_H;HV_SIMD_SSE;%(PreprocessorDefinitions) - true - MultiThreaded - false - StreamingSIMDExtensions2 - - $(IntDir)vc70.pdb - Level3 - ProgramDatabase - Sync - - - NDEBUG;_XKEYCHECK_H;%(PreprocessorDefinitions) - 0x0409 - $(IntDir);$(WwiseSDKPath)\include;$(WwiseSDKPath)\samples\Common;%(AdditionalIncludeDirectories) - - - false - - - Hv_{{name}}_Wwise{{plugin_type}}Engine.lib;HtmlHelp.lib;%(AdditionalDependencies) - $(OutDir)$(ProjectName).dll - $(OutDir);%(AdditionalLibraryDirectories) - $(SolutionDir)..\source\authoring\Hv_{{name}}_WwiseAuthoringPlugin.def - No - false - $(IntDir)$(ProjectName).pdb - $(IntDir)$(TargetName).lib - Windows - true - true - false - - MachineX64 - - - - - - NDEBUG;_XKEYCHECK_H;%(PreprocessorDefinitions) - false - - - Full - true - $(WwiseSDKPath)\include;$(SolutionDir)..\source\include;$(SolutionDir)..\source\{{plugin_type|lower}}_engine;%(AdditionalIncludeDirectories) - WIN32;_XKEYCHECK_H;%(PreprocessorDefinitions) - true - MultiThreaded - false - StreamingSIMDExtensions2 - - $(IntDir)vc70.pdb - Level3 - ProgramDatabase - Sync - - - NDEBUG;_XKEYCHECK_H;%(PreprocessorDefinitions) - 0x0409 - $(IntDir);$(WwiseSDKPath)\include;$(WwiseSDKPath)\samples\Common;%(AdditionalIncludeDirectories) - - - false - - - Hv_{{name}}_Wwise{{plugin_type}}Engine.lib;HtmlHelp.lib;%(AdditionalDependencies) - $(OutDir)$(ProjectName).dll - $(OutDir);%(AdditionalLibraryDirectories) - $(SolutionDir)..\source\authoring\Hv_{{name}}_WwiseAuthoringPlugin.def - No - false - $(IntDir)$(ProjectName).pdb - $(IntDir)$(TargetName).lib - Windows - true - true - false - - MachineX86 - - - - - - NDEBUG;_XKEYCHECK_H;%(PreprocessorDefinitions) - false - X64 - - - Full - true - $(WwiseSDKPath)\include;$(SolutionDir)..\source\include;$(SolutionDir)..\source\{{plugin_type|lower}}_engine;%(AdditionalIncludeDirectories) - WIN64;HV_SIMD_SSE;_XKEYCHECK_H;%(PreprocessorDefinitions) - true - MultiThreaded - false - - $(IntDir)vc70.pdb - Level3 - ProgramDatabase - Sync - - - NDEBUG;_XKEYCHECK_H;%(PreprocessorDefinitions) - 0x0409 - $(IntDir);$(WwiseSDKPath)\include;$(WwiseSDKPath)\samples\Common;%(AdditionalIncludeDirectories) - - - false - - - Hv_{{name}}_Wwise{{plugin_type}}Engine.lib;HtmlHelp.lib;%(AdditionalDependencies) - $(OutDir)$(ProjectName).dll - $(OutDir);%(AdditionalLibraryDirectories) - $(SolutionDir)..\source\authoring\Hv_{{name}}_WwiseAuthoringPlugin.def - No - false - $(IntDir)$(ProjectName).pdb - $(IntDir)$(TargetName).lib - Windows - true - true - false - - MachineX64 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Copying "%(Filename)%(Extension)..." - if exist "$(OutDir)%(Filename)%(Extension)" attrib -r "$(OutDir)%(Filename)%(Extension)" - copy /Y "%(FullPath)" "$(Outdir)" - - $(OutDir)%(Filename)%(Extension);%(Outputs) - Designer - - - - - - \ No newline at end of file diff --git a/hvcc/generators/c2wwise/templates/vs2015/Hv_{{name}}_Wwise{{type}}Engine.vcxproj b/hvcc/generators/c2wwise/templates/vs2015/Hv_{{name}}_Wwise{{type}}Engine.vcxproj deleted file mode 100644 index 6ad1e4b1..00000000 --- a/hvcc/generators/c2wwise/templates/vs2015/Hv_{{name}}_Wwise{{type}}Engine.vcxproj +++ /dev/null @@ -1,299 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Profile - Win32 - - - Profile - x64 - - - Release - Win32 - - - Release - x64 - - - - Hv_{{name}}_Wwise{{plugin_type}}Engine - {9A8B43A1-383C-4C50-AC02-559B5775AAD9} - Heavy - 8.1 - - - C:\Program Files (x86)\Audiokinetic\Wwise {{wwise_version}}\SDK - - - - StaticLibrary - v{{msbuild_version}} - Unicode - - - StaticLibrary - v{{msbuild_version}} - Unicode - - - StaticLibrary - v{{msbuild_version}} - Unicode - - - StaticLibrary - v{{msbuild_version}} - Unicode - - - StaticLibrary - v{{msbuild_version}} - Unicode - - - StaticLibrary - v{{msbuild_version}} - Unicode - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>12.0.30501.0 - - - $(SolutionDir)..\build\win\x86\release\ - $(SolutionDir)intermediate\win\x86\release\$(ProjectName)\ - false - - - $(SolutionDir)..\build\win\x86\profile\ - $(SolutionDir)intermediate\win\x86\profile\$(ProjectName)\ - false - - - $(SolutionDir)..\build\win\x86\debug\ - $(SolutionDir)intermediate\win\x86\debug\$(ProjectName)\ - false - - - $(SolutionDir)..\build\win\$(Platform)\release\ - $(SolutionDir)intermediate\win\$(Platform)\release\$(ProjectName)\ - false - - - $(SolutionDir)..\build\win\$(Platform)\profile\ - $(SolutionDir)intermediate\win\$(Platform)\profile\$(ProjectName)\ - false - - - $(SolutionDir)..\build\win\$(Platform)\debug\ - $(SolutionDir)intermediate\win\$(Platform)\debug\$(ProjectName)\ - false - - - - Disabled - .;$(WwiseSDKPath)\include;$(SolutionDir)..\source\include;$(SolutionDir)..\source\heavy - _DEBUG;WIN32;AUDIOKINETIC;_XKEYCHECK_H;%(PreprocessorDefinitions) - StreamingSIMDExtensions - - MultiThreadedDebug - - - _DEBUG;WIN32;AUDIOKINETIC;_XKEYCHECK_H;%(PreprocessorDefinitions) - .;..;$(WwiseSDKPath)\include;$(SolutionDir)..\source\heavy;%(AdditionalIncludeDirectories) - - - $(OutDir)$(ProjectName).lib - $(DXSDK_DIR)\lib\x86;%(AdditionalLibraryDirectories) - - - if exist "$(OutDir)Hv_{{name}}_Wwise{{plugin_type}}PluginFactory.h" attrib -r "$(OutDir)Hv_{{name}}_Wwise{{plugin_type}}PluginFactory.h" - copy /Y "$(SolutionDir)..\source\include\Hv_{{name}}_Wwise{{plugin_type}}PluginFactory.h" "$(Outdir)" - - - - - - X64 - - - Disabled - .;$(WwiseSDKPath)\include;$(SolutionDir)..\source\include;$(SolutionDir)..\source\heavy - _DEBUG;WIN64;HV_SIMD_SSE;AUDIOKINETIC;_XKEYCHECK_H;%(PreprocessorDefinitions) - - MultiThreadedDebug - - - _DEBUG;WIN64;HV_SIMD_SSE;AUDIOKINETIC;_XKEYCHECK_H;%(PreprocessorDefinitions) - .;..;$(WwiseSDKPath)\include;$(SolutionDir)..\source\heavy;%(AdditionalIncludeDirectories) - - - $(OutDir)$(ProjectName).lib - $(DXSDK_DIR)\lib\x64;%(AdditionalLibraryDirectories) - - - if exist "$(OutDir)Hv_{{name}}_Wwise{{plugin_type}}PluginFactory.h" attrib -r "$(OutDir)Hv_{{name}}_Wwise{{plugin_type}}PluginFactory.h" - copy /Y "$(SolutionDir)..\source\include\Hv_{{name}}_Wwise{{plugin_type}}PluginFactory.h" "$(Outdir)" - - - - - - MaxSpeed - .;$(WwiseSDKPath)\include;$(SolutionDir)..\source\include;$(SolutionDir)..\source\heavy - NDEBUG;WIN32;AUDIOKINETIC;_XKEYCHECK_H;%(PreprocessorDefinitions) - StreamingSIMDExtensions - - MultiThreaded - - - NDEBUG;WIN32;AUDIOKINETIC;_XKEYCHECK_H;%(PreprocessorDefinitions) - .;..;$(WwiseSDKPath)\include;$(SolutionDir)..\source\heavy;%(AdditionalIncludeDirectories) - - - $(OutDir)$(ProjectName).lib - $(DXSDK_DIR)\lib\x86;%(AdditionalLibraryDirectories) - - - if exist "$(OutDir)Hv_{{name}}_Wwise{{plugin_type}}PluginFactory.h" attrib -r "$(OutDir)Hv_{{name}}_Wwise{{plugin_type}}PluginFactory.h" - copy /Y "$(SolutionDir)..\source\include\Hv_{{name}}_Wwise{{plugin_type}}PluginFactory.h" "$(Outdir)" - - - - - - X64 - - - MaxSpeed - .;$(WwiseSDKPath)\include;$(SolutionDir)..\source\include;$(SolutionDir)..\source\heavy - NDEBUG;WIN64;HV_SIMD_SSE;AUDIOKINETIC;_XKEYCHECK_H;%(PreprocessorDefinitions) - - MultiThreaded - - - NDEBUG;WIN64;HV_SIMD_SSE;AUDIOKINETIC;_XKEYCHECK_H;%(PreprocessorDefinitions) - .;..;$(WwiseSDKPath)\include;$(SolutionDir)..\source\heavy;%(AdditionalIncludeDirectories) - - - $(OutDir)$(ProjectName).lib - $(DXSDK_DIR)\lib\x64;%(AdditionalLibraryDirectories) - - - if exist "$(OutDir)Hv_{{name}}_Wwise{{plugin_type}}PluginFactory.h" attrib -r "$(OutDir)Hv_{{name}}_Wwise{{plugin_type}}PluginFactory.h" - copy /Y "$(SolutionDir)..\source\include\Hv_{{name}}_Wwise{{plugin_type}}PluginFactory.h" "$(Outdir)" - - - - - - MaxSpeed - .;$(WwiseSDKPath)\include;$(SolutionDir)..\source\include;$(SolutionDir)..\source\heavy - NDEBUG;AK_OPTIMIZED;WIN32;AUDIOKINETIC;_XKEYCHECK_H;%(PreprocessorDefinitions) - StreamingSIMDExtensions - - MultiThreaded - None - - - NDEBUG;AK_OPTIMIZED;WIN32;AUDIOKINETIC;_XKEYCHECK_H;%(PreprocessorDefinitions) - .;..;$(WwiseSDKPath)\include;$(SolutionDir)..\source\heavy;%(AdditionalIncludeDirectories) - - - $(OutDir)$(ProjectName).lib - $(DXSDK_DIR)\lib\x86;%(AdditionalLibraryDirectories) - - - if exist "$(OutDir)Hv_{{name}}_Wwise{{plugin_type}}PluginFactory.h" attrib -r "$(OutDir)Hv_{{name}}_Wwise{{plugin_type}}PluginFactory.h" - copy /Y "$(SolutionDir)..\source\include\Hv_{{name}}_Wwise{{plugin_type}}PluginFactory.h" "$(Outdir)" - - - - - - X64 - - - MaxSpeed - .;$(WwiseSDKPath)\include;$(SolutionDir)..\source\include;$(SolutionDir)..\source\heavy - NDEBUG;AK_OPTIMIZED;WIN64;HV_SIMD_SSE;AUDIOKINETIC;_XKEYCHECK_H;%(PreprocessorDefinitions) - - MultiThreaded - None - - - NDEBUG;AK_OPTIMIZED;WIN64;HV_SIMD_SSE;AUDIOKINETIC;_XKEYCHECK_H;%(PreprocessorDefinitions) - .;..;$(WwiseSDKPath)\include;$(SolutionDir)..\source\heavy;%(AdditionalIncludeDirectories) - - - $(OutDir)$(ProjectName).lib - $(DXSDK_DIR)\lib\x64;%(AdditionalLibraryDirectories) - - - if exist "$(OutDir)Hv_{{name}}_Wwise{{plugin_type}}PluginFactory.h" attrib -r "$(OutDir)Hv_{{name}}_Wwise{{plugin_type}}PluginFactory.h" - copy /Y "$(SolutionDir)..\source\include\Hv_{{name}}_Wwise{{plugin_type}}PluginFactory.h" "$(Outdir)" - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/hvcc/generators/c2wwise/templates/vs2015/Hv_{{name}}_Wwise{{type}}Plugin.sln b/hvcc/generators/c2wwise/templates/vs2015/Hv_{{name}}_Wwise{{type}}Plugin.sln deleted file mode 100644 index baba117c..00000000 --- a/hvcc/generators/c2wwise/templates/vs2015/Hv_{{name}}_Wwise{{type}}Plugin.sln +++ /dev/null @@ -1,68 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 14 -VisualStudioVersion = 14.0.24720.0 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Hv_{{name}}_Wwise{{plugin_type}}Engine", "Hv_{{name}}_Wwise{{plugin_type}}Engine.vcxproj", "{9A8B43A1-383C-4C50-AC02-559B5775AAD9}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Hv_{{name}}_Wwise{{plugin_type}}AuthPlugin", "Hv_{{name}}_Wwise{{plugin_type}}AuthPlugin.vcxproj", "{8257454F-51E6-4481-948B-034FD37C0FBF}" - ProjectSection(ProjectDependencies) = postProject - {9A8B43A1-383C-4C50-AC02-559B5775AAD9} = {9A8B43A1-383C-4C50-AC02-559B5775AAD9} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Hv_{{name}}_Wwise{{plugin_type}}RuntimePlugin", "Hv_{{name}}_Wwise{{plugin_type}}RuntimePlugin.vcxproj", "{0C075463-49AE-41A9-97E7-A63FA62821A2}" - ProjectSection(ProjectDependencies) = postProject - {9A8B43A1-383C-4C50-AC02-559B5775AAD9} = {9A8B43A1-383C-4C50-AC02-559B5775AAD9} - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|x86 = Debug|x86 - Debug|x64 = Debug|x64 - Profile|x86 = Profile|x86 - Profile|x64 = Profile|x64 - Release|x86 = Release|x86 - Release|x64 = Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {9A8B43A1-383C-4C50-AC02-559B5775AAD9}.Debug|x86.ActiveCfg = Debug|x86 - {9A8B43A1-383C-4C50-AC02-559B5775AAD9}.Debug|x86.Build.0 = Debug|x86 - {9A8B43A1-383C-4C50-AC02-559B5775AAD9}.Debug|x64.ActiveCfg = Debug|x64 - {9A8B43A1-383C-4C50-AC02-559B5775AAD9}.Debug|x64.Build.0 = Debug|x64 - {9A8B43A1-383C-4C50-AC02-559B5775AAD9}.Profile|x86.ActiveCfg = Profile|x86 - {9A8B43A1-383C-4C50-AC02-559B5775AAD9}.Profile|x86.Build.0 = Profile|x86 - {9A8B43A1-383C-4C50-AC02-559B5775AAD9}.Profile|x64.ActiveCfg = Profile|x64 - {9A8B43A1-383C-4C50-AC02-559B5775AAD9}.Profile|x64.Build.0 = Profile|x64 - {9A8B43A1-383C-4C50-AC02-559B5775AAD9}.Release|x86.ActiveCfg = Release|x86 - {9A8B43A1-383C-4C50-AC02-559B5775AAD9}.Release|x86.Build.0 = Release|x86 - {9A8B43A1-383C-4C50-AC02-559B5775AAD9}.Release|x64.ActiveCfg = Release|x64 - {9A8B43A1-383C-4C50-AC02-559B5775AAD9}.Release|x64.Build.0 = Release|x64 - {8257454F-51E6-4481-948B-034FD37C0FBF}.Debug|x86.ActiveCfg = Debug|x86 - {8257454F-51E6-4481-948B-034FD37C0FBF}.Debug|x86.Build.0 = Debug|x86 - {8257454F-51E6-4481-948B-034FD37C0FBF}.Debug|x64.ActiveCfg = Debug|x64 - {8257454F-51E6-4481-948B-034FD37C0FBF}.Debug|x64.Build.0 = Debug|x64 - {8257454F-51E6-4481-948B-034FD37C0FBF}.Profile|x86.ActiveCfg = Profile|x86 - {8257454F-51E6-4481-948B-034FD37C0FBF}.Profile|x86.Build.0 = Profile|x86 - {8257454F-51E6-4481-948B-034FD37C0FBF}.Profile|x64.ActiveCfg = Profile|x64 - {8257454F-51E6-4481-948B-034FD37C0FBF}.Profile|x64.Build.0 = Profile|x64 - {8257454F-51E6-4481-948B-034FD37C0FBF}.Release|x86.ActiveCfg = Release|x86 - {8257454F-51E6-4481-948B-034FD37C0FBF}.Release|x86.Build.0 = Release|x86 - {8257454F-51E6-4481-948B-034FD37C0FBF}.Release|x64.ActiveCfg = Release|x64 - {8257454F-51E6-4481-948B-034FD37C0FBF}.Release|x64.Build.0 = Release|x64 - {0C075463-49AE-41A9-97E7-A63FA62821A2}.Debug|x86.ActiveCfg = Debug|x86 - {0C075463-49AE-41A9-97E7-A63FA62821A2}.Debug|x86.Build.0 = Debug|x86 - {0C075463-49AE-41A9-97E7-A63FA62821A2}.Debug|x64.ActiveCfg = Debug|x64 - {0C075463-49AE-41A9-97E7-A63FA62821A2}.Debug|x64.Build.0 = Debug|x64 - {0C075463-49AE-41A9-97E7-A63FA62821A2}.Profile|x86.ActiveCfg = Profile|x86 - {0C075463-49AE-41A9-97E7-A63FA62821A2}.Profile|x86.Build.0 = Profile|x86 - {0C075463-49AE-41A9-97E7-A63FA62821A2}.Profile|x64.ActiveCfg = Profile|x64 - {0C075463-49AE-41A9-97E7-A63FA62821A2}.Profile|x64.Build.0 = Profile|x64 - {0C075463-49AE-41A9-97E7-A63FA62821A2}.Release|x86.ActiveCfg = Release|x86 - {0C075463-49AE-41A9-97E7-A63FA62821A2}.Release|x86.Build.0 = Release|x86 - {0C075463-49AE-41A9-97E7-A63FA62821A2}.Release|x64.ActiveCfg = Release|x64 - {0C075463-49AE-41A9-97E7-A63FA62821A2}.Release|x64.Build.0 = Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal -{# force new line #} diff --git a/hvcc/generators/c2wwise/templates/vs2015/Hv_{{name}}_Wwise{{type}}RuntimePlugin.vcxproj b/hvcc/generators/c2wwise/templates/vs2015/Hv_{{name}}_Wwise{{type}}RuntimePlugin.vcxproj deleted file mode 100644 index c30b08b6..00000000 --- a/hvcc/generators/c2wwise/templates/vs2015/Hv_{{name}}_Wwise{{type}}RuntimePlugin.vcxproj +++ /dev/null @@ -1,435 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Profile - Win32 - - - Profile - x64 - - - Release - Win32 - - - Release - x64 - - - - Hv_{{name}}_Wwise{{plugin_type}}Plugin - {0C075463-49AE-41A9-97E7-A63FA62821A2} - Heavy - 8.1 - - - C:\Program Files (x86)\Audiokinetic\Wwise {{wwise_version}}\SDK - - - - DynamicLibrary - v{{msbuild_version}} - false - false - Unicode - - - DynamicLibrary - v{{msbuild_version}} - false - false - Unicode - - - DynamicLibrary - v{{msbuild_version}} - false - false - Unicode - - - DynamicLibrary - v{{msbuild_version}} - false - false - Unicode - - - DynamicLibrary - v{{msbuild_version}} - false - false - Unicode - - - DynamicLibrary - v{{msbuild_version}} - false - false - Unicode - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>12.0.30501.0 - - - $(SolutionDir)..\build\win\x86\release\ - $(SolutionDir)\intermediate\win\x86\release\$(ProjectName)\ - false - - - $(SolutionDir)..\build\win\x86\profile\ - $(SolutionDir)intermediate\win\x86\profile\$(ProjectName)\ - false - - - $(SolutionDir)..\build\win\x86\debug\ - $(SolutionDir)intermediate\win\x86\debug\$(ProjectName)\ - false - - - $(SolutionDir)..\build\win\$(Platform)\release\ - $(SolutionDir)intermediate\win\$(Platform)\release\$(ProjectName)\ - false - - - $(SolutionDir)..\build\win\$(Platform)\profile\ - $(SolutionDir)intermediate\win\$(Platform)\profile\$(ProjectName)\ - false - - - $(SolutionDir)..\build\win\$(Platform)\debug\ - $(SolutionDir)intermediate\win\$(Platform)\debug\$(ProjectName)\ - false - - - - _DEBUG;_XKEYCHECK_H;%(PreprocessorDefinitions) - false - - - Disabled - $(WwiseSDKPath)\include;$(SolutionDir)..\source\include;%(AdditionalIncludeDirectories) - WIN32;_XKEYCHECK_H;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebug - - $(IntDir) - $(IntDir)vc70.pdb - Level3 - - - _DEBUG;_XKEYCHECK_H;%(PreprocessorDefinitions) - 0x0409 - $(IntDir);$(WwiseSDKPath)\include;$(WwiseSDKPath)\samples\Common;%(AdditionalIncludeDirectories) - - - false - - - Hv_{{name}}_Wwise{{plugin_type}}Engine.lib;HtmlHelp.lib;%(AdditionalDependencies) - $(OutDir)$(ProjectName).dll - $(OutDir);%(AdditionalLibraryDirectories) - - - - true - $(IntDir)$(ProjectName).pdb - $(IntDir)$(TargetName).lib - Windows - false - - MachineX86 - - - - - - _DEBUG;_XKEYCHECK_H;%(PreprocessorDefinitions) - false - X64 - - - Disabled - $(WwiseSDKPath)\include;$(SolutionDir)..\source\include;%(AdditionalIncludeDirectories) - WIN64;HV_SIMD_SSE;_XKEYCHECK_H;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebug - - $(IntDir) - $(IntDir)vc70.pdb - Level3 - ProgramDatabase - - - _DEBUG;_XKEYCHECK_H;%(PreprocessorDefinitions) - 0x0409 - $(IntDir);$(WwiseSDKPath)\include;$(WwiseSDKPath)\samples\Common;%(AdditionalIncludeDirectories) - - - false - - - Hv_{{name}}_Wwise{{plugin_type}}Engine.lib;HtmlHelp.lib;%(AdditionalDependencies) - $(OutDir)$(ProjectName).dll - $(OutDir);%(AdditionalLibraryDirectories) - - - - true - $(IntDir)$(ProjectName).pdb - $(IntDir)$(TargetName).lib - Windows - false - - MachineX64 - - - - - - _DEBUG;_XKEYCHECK_H;%(PreprocessorDefinitions) - false - - - MaxSpeed - true - $(WwiseSDKPath)\include;$(SolutionDir)..\source\include;%(AdditionalIncludeDirectories) - WIN32;_XKEYCHECK_H;%(PreprocessorDefinitions) - true - MultiThreaded - false - StreamingSIMDExtensions2 - - $(IntDir)vc70.pdb - Level3 - ProgramDatabase - Sync - - - NDEBUG;_XKEYCHECK_H;%(PreprocessorDefinitions) - 0x0409 - $(IntDir);$(WwiseSDKPath)\include;$(WwiseSDKPath)\samples\Common;%(AdditionalIncludeDirectories) - - - false - - - Hv_{{name}}_Wwise{{plugin_type}}Engine.lib;%(AdditionalDependencies) - $(OutDir)$(ProjectName).dll - $(OutDir);%(AdditionalLibraryDirectories) - - - true - $(IntDir)$(ProjectName).pdb - $(IntDir)$(TargetName).lib - Windows - true - true - false - - MachineX86 - - - - - - false - NDEBUG;_XKEYCHECK_H;%(PreprocessorDefinitions) - X64 - - - MaxSpeed - true - $(WwiseSDKPath)\include;$(SolutionDir)..\source\include;%(AdditionalIncludeDirectories) - WIN64;_XKEYCHECK_H;HV_SIMD_SSE;%(PreprocessorDefinitions) - true - MultiThreaded - false - StreamingSIMDExtensions2 - - $(IntDir)vc70.pdb - Level3 - ProgramDatabase - Sync - - - NDEBUG;_XKEYCHECK_H;%(PreprocessorDefinitions) - 0x0409 - $(IntDir);$(WwiseSDKPath)\include;$(WwiseSDKPath)\samples\Common;%(AdditionalIncludeDirectories) - - - false - - - Hv_{{name}}_Wwise{{plugin_type}}Engine.lib;%(AdditionalDependencies) - $(OutDir)$(ProjectName).dll - $(OutDir);%(AdditionalLibraryDirectories) - - true - $(IntDir)$(ProjectName).pdb - $(IntDir)$(TargetName).lib - Windows - true - true - false - - MachineX64 - - - - - - NDEBUG;_XKEYCHECK_H;%(PreprocessorDefinitions) - false - - - Full - true - $(WwiseSDKPath)\include;$(SolutionDir)..\source\include;%(AdditionalIncludeDirectories) - WIN32;_XKEYCHECK_H;%(PreprocessorDefinitions) - true - MultiThreaded - false - StreamingSIMDExtensions2 - - $(IntDir)vc70.pdb - Level3 - ProgramDatabase - Sync - - - NDEBUG;_XKEYCHECK_H;%(PreprocessorDefinitions) - 0x0409 - $(IntDir);$(WwiseSDKPath)\include;$(WwiseSDKPath)\samples\Common;%(AdditionalIncludeDirectories) - - - false - - - Hv_{{name}}_Wwise{{plugin_type}}Engine.lib;%(AdditionalDependencies) - $(OutDir)$(ProjectName).dll - $(OutDir);%(AdditionalLibraryDirectories) - - No - false - $(IntDir)$(ProjectName).pdb - $(IntDir)$(TargetName).lib - Windows - true - true - false - - MachineX86 - - - - - - NDEBUG;_XKEYCHECK_H;%(PreprocessorDefinitions) - false - X64 - - - Full - true - $(WwiseSDKPath)\include;$(SolutionDir)..\source\include;%(AdditionalIncludeDirectories) - WIN64;HV_SIMD_SSE;_XKEYCHECK_H;%(PreprocessorDefinitions) - true - MultiThreaded - false - - $(IntDir)vc70.pdb - Level3 - ProgramDatabase - Sync - - - NDEBUG;_XKEYCHECK_H;%(PreprocessorDefinitions) - 0x0409 - $(IntDir);$(WwiseSDKPath)\include;$(WwiseSDKPath)\samples\Common;%(AdditionalIncludeDirectories) - - - false - - - Hv_{{name}}_Wwise{{plugin_type}}Engine.lib;%(AdditionalDependencies) - $(OutDir)$(ProjectName).dll - $(OutDir);%(AdditionalLibraryDirectories) - - No - false - $(IntDir)$(ProjectName).pdb - $(IntDir)$(TargetName).lib - Windows - true - true - false - - MachineX64 - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/hvcc/generators/c2wwise/templates/xcode/Info.plist b/hvcc/generators/c2wwise/templates/xcode/Info.plist deleted file mode 100644 index d9be5b5b..00000000 --- a/hvcc/generators/c2wwise/templates/xcode/Info.plist +++ /dev/null @@ -1,28 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - BNDL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - NSHumanReadableCopyright - Copyright © 2016 Enzien Audio. All rights reserved. - NSPrincipalClass - - - diff --git a/hvcc/generators/c2wwise/templates/xcode/Plugin.xcodeproj/project.pbxproj b/hvcc/generators/c2wwise/templates/xcode/Plugin.xcodeproj/project.pbxproj deleted file mode 100644 index 3fbd8360..00000000 --- a/hvcc/generators/c2wwise/templates/xcode/Plugin.xcodeproj/project.pbxproj +++ /dev/null @@ -1,617 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - {%- for f in files if f.endswith((".h", ".hpp")) %} - {{f|xcode_build}} /* {{f}} in Headers */ = {isa = PBXBuildFile; fileRef = {{f|xcode_fileref}} /* {{f}} */; }; - {%- endfor %} - {%- for f in files if f.endswith((".c", ".cpp")) %} - {{f|xcode_build}} /* {{f}} in Sources */ = {isa = PBXBuildFile; fileRef = {{f|xcode_fileref}} /* {{f}} */; }; - {%- endfor %} - D8331EF81CE128BD003BFBA7 /* Hv_{{name}}_Wwise{{plugin_type}}PluginFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = D8331ED01CE128BD003BFBA7 /* Hv_{{name}}_Wwise{{plugin_type}}PluginFactory.h */; }; - D8331EF91CE128BD003BFBA7 /* Hv_{{name}}_WwisePluginIDs.h in Headers */ = {isa = PBXBuildFile; fileRef = D8331ED11CE128BD003BFBA7 /* Hv_{{name}}_WwisePluginIDs.h */; }; - D8331F1C1CE128BD003BFBA7 /* Hv_{{name}}_Wwise{{plugin_type}}PluginEngine.h in Headers */ = {isa = PBXBuildFile; fileRef = D8331EEC1CE128BD003BFBA7 /* Hv_{{name}}_Wwise{{plugin_type}}PluginEngine.h */; }; - D8331F201CE1295C003BFBA7 /* Hv_{{name}}_Wwise{{plugin_type}}PluginEngine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D8331EEB1CE128BD003BFBA7 /* Hv_{{name}}_Wwise{{plugin_type}}PluginEngine.cpp */; }; - D8331F1F1CE128BD003BFBA7 /* Hv_{{name}}_WwisePluginEngineParams.h in Headers */ = {isa = PBXBuildFile; fileRef = D8331EEE1CE128BD003BFBA7 /* Hv_{{name}}_WwisePluginEngineParams.h */; }; - D8331F1E1CE128BD003BFBA7 /* Hv_{{name}}_WwisePluginEngineParams.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D8331EED1CE128BD003BFBA7 /* Hv_{{name}}_WwisePluginEngineParams.cpp */; }; - D8857DFD1CE1576C00A7B30F /* Hv_{{name}}_WwisePluginRegister.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D8331EE91CE128BD003BFBA7 /* Hv_{{name}}_WwisePluginRegister.cpp */; }; - D8857DF31CE1525C00A7B30F /* Hv_{{name}}_Wwise{{plugin_type}}PluginFactory.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = D8331ED01CE128BD003BFBA7 /* Hv_{{name}}_Wwise{{plugin_type}}PluginFactory.h */; }; - D8857DFE1CE1578D00A7B30F /* libHv_{{name}}_Wwise{{plugin_type}}Engine.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D8C486EF1CDCD6B9000B3BCC /* libHv_{{name}}_Wwise{{plugin_type}}Engine.a */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - D8857DFF1CE1595E00A7B30F /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = D8C486DA1CDCD5C1000B3BCC /* Project object */; - proxyType = 1; - remoteGlobalIDString = D8C486EE1CDCD6B9000B3BCC; - remoteInfo = Hv_{{name}}_Wwise{{plugin_type}}Engine; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXCopyFilesBuildPhase section */ - D8857DF21CE1524800A7B30F /* CopyFiles */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 12; - dstPath = ""; - dstSubfolderSpec = 16; - files = ( - D8857DF31CE1525C00A7B30F /* Hv_{{name}}_Wwise{{plugin_type}}PluginFactory.h in CopyFiles */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - D8857E071CE15D4900A7B30F /* CopyFiles */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 16; - files = ( - D8857DF31CE1525C00A7B30F /* Hv_{{name}}_Wwise{{plugin_type}}PluginFactory.h in CopyFiles */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - {%- for f in files if f.endswith((".h", ".hpp")) %} - {{f|xcode_fileref}} /* {{f}} */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = {{f}}; path = ../source/heavy/{{f}}; sourceTree = SOURCE_ROOT; }; - {%- endfor %} - {%- for f in files if f.endswith(".c") %} - {{f|xcode_fileref}} /* {{f}} */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = {{f}}; path = ../source/heavy/{{f}}; sourceTree = SOURCE_ROOT; }; - {%- endfor %} - {%- for f in files if f.endswith(".cpp") %} - {{f|xcode_fileref}} /* {{f}} */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = {{f}}; path = ../source/heavy/{{f}}; sourceTree = SOURCE_ROOT; }; - {%- endfor %} - D8331ED01CE128BD003BFBA7 /* Hv_{{name}}_Wwise{{plugin_type}}PluginFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Hv_{{name}}_Wwise{{plugin_type}}PluginFactory.h; path = ../source/include/Hv_{{name}}_Wwise{{plugin_type}}PluginFactory.h; sourceTree = SOURCE_ROOT; }; - D8331ED11CE128BD003BFBA7 /* Hv_{{name}}_WwisePluginIDs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Hv_{{name}}_WwisePluginIDs.h; path = ../source/include/Hv_{{name}}_WwisePluginIDs.h; sourceTree = SOURCE_ROOT; }; - D8331EEC1CE128BD003BFBA7 /* Hv_{{name}}_Wwise{{plugin_type}}PluginEngine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Hv_{{name}}_Wwise{{plugin_type}}PluginEngine.h; sourceTree = ""; }; - D8331EEE1CE128BD003BFBA7 /* Hv_{{name}}_WwisePluginEngineParams.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Hv_{{name}}_WwisePluginEngineParams.h; sourceTree = ""; }; - D8331EED1CE128BD003BFBA7 /* Hv_{{name}}_WwisePluginEngineParams.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Hv_{{name}}_WwisePluginEngineParams.cpp; sourceTree = ""; }; - D8331EEB1CE128BD003BFBA7 /* Hv_{{name}}_Wwise{{plugin_type}}PluginEngine.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Hv_{{name}}_Wwise{{plugin_type}}PluginEngine.cpp; sourceTree = ""; }; - D8331EE91CE128BD003BFBA7 /* Hv_{{name}}_WwisePluginRegister.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Hv_{{name}}_WwisePluginRegister.cpp; sourceTree = ""; }; - D8857DF91CE1554F00A7B30F /* Hv_{{name}}_Wwise{{plugin_type}}Plugin.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = Hv_{{name}}_Wwise{{plugin_type}}Plugin.dylib; sourceTree = BUILT_PRODUCTS_DIR; }; - D8857E091CE15D4900A7B30F /* libHv_{{name}}_Wwise{{plugin_type}}Plugin.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libHv_{{name}}_Wwise{{plugin_type}}Plugin.a; sourceTree = BUILT_PRODUCTS_DIR; }; - D8C486EF1CDCD6B9000B3BCC /* libHv_{{name}}_Wwise{{plugin_type}}Engine.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libHv_{{name}}_Wwise{{plugin_type}}Engine.a; sourceTree = BUILT_PRODUCTS_DIR; }; - D8C486E51CDCD5C1000B3BCC /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - D8851B631CE1271600D6BE37 /* wwise.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = wwise.xcconfig; sourceTree = SOURCE_ROOT; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - D8857DF61CE1554F00A7B30F /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - D8857DFE1CE1578D00A7B30F /* libHv_{{name}}{{name}}_Wwise{{plugin_type}}Engine.a in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - D8857E061CE15D4900A7B30F /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - D8C486EC1CDCD6B9000B3BCC /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - D8331EC61CE128BD003BFBA7 /* source */ = { - isa = PBXGroup; - children = ( - D8331ECF1CE128BD003BFBA7 /* include */, - D8331ED31CE128BD003BFBA7 /* heavy */, - D8331EE81CE128BD003BFBA7 /* runtime */, - D8331EEA1CE128BD003BFBA7 /* source_engine */, - ); - name = source; - path = ../source; - sourceTree = SOURCE_ROOT; - }; - D8331ECF1CE128BD003BFBA7 /* include */ = { - isa = PBXGroup; - children = ( - D8331ED01CE128BD003BFBA7 /* Hv_{{name}}_Wwise{{plugin_type}}PluginFactory.h */, - D8331ED11CE128BD003BFBA7 /* Hv_{{name}}_WwisePluginIDs.h */, - ); - name = include; - path = ../source/include; - sourceTree = SOURCE_ROOT; - }; - D8331ED31CE128BD003BFBA7 /* heavy */ = { - isa = PBXGroup; - children = ( - {%- for f in files %} - {{f|xcode_fileref}} /* {{f}} */, - {%- endfor %} - ); - name = heavy; - path = ../source/heavy; - sourceTree = SOURCE_ROOT; - }; - D8331EE81CE128BD003BFBA7 /* runtime */ = { - isa = PBXGroup; - children = ( - D8331EE91CE128BD003BFBA7 /* Hv_{{name}}_WwisePluginRegister.cpp */, - ); - path = runtime; - sourceTree = ""; - }; - D8331EEA1CE128BD003BFBA7 /* source_engine */ = { - isa = PBXGroup; - children = ( - D8331EEB1CE128BD003BFBA7 /* Hv_{{name}}_Wwise{{plugin_type}}PluginEngine.cpp */, - D8331EEC1CE128BD003BFBA7 /* Hv_{{name}}_Wwise{{plugin_type}}PluginEngine.h */, - D8331EED1CE128BD003BFBA7 /* Hv_{{name}}_WwisePluginEngineParams.cpp */, - D8331EEE1CE128BD003BFBA7 /* Hv_{{name}}_WwisePluginEngineParams.h */, - ); - path = engine; - sourceTree = ""; - }; - D8C486D91CDCD5C1000B3BCC = { - isa = PBXGroup; - children = ( - D8331EC61CE128BD003BFBA7 /* source */, - D8C486E51CDCD5C1000B3BCC /* Info.plist */, - D8851B631CE1271600D6BE37 /* wwise.xcconfig */, - D8C486E31CDCD5C1000B3BCC /* Products */, - ); - sourceTree = ""; - }; - D8C486E31CDCD5C1000B3BCC /* Products */ = { - isa = PBXGroup; - children = ( - D8C486EF1CDCD6B9000B3BCC /* libHv_{{name}}_Wwise{{plugin_type}}Engine.a */, - D8857DF91CE1554F00A7B30F /* Hv_{{name}}_Wwise{{plugin_type}}Plugin.dylib */, - D8857E091CE15D4900A7B30F /* libHv_{{name}}_Wwise{{plugin_type}}Plugin.a */, - ); - name = Products; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXHeadersBuildPhase section */ - D8857DF71CE1554F00A7B30F /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - D8C486ED1CDCD6B9000B3BCC /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - {%- for f in files if f.endswith((".h", ".hpp")) %} - {{f|xcode_build}} /* {{f}} in Headers */, - {%- endfor %} - D8331EF81CE128BD003BFBA7 /* Hv_{{name}}_Wwise{{plugin_type}}PluginFactory.h in Headers */, - D8331EF91CE128BD003BFBA7 /* Hv_{{name}}_WwisePluginIDs.h in Headers */, - D8331F1C1CE128BD003BFBA7 /* Hv_{{name}}_Wwise{{plugin_type}}PluginEngine.h in Headers */, - D8331F1F1CE128BD003BFBA7 /* Hv_{{name}}_WwisePluginEngineParams.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXHeadersBuildPhase section */ - -/* Begin PBXNativeTarget section */ - D8857DF81CE1554F00A7B30F /* Hv_{{name}}_Wwise{{plugin_type}}Plugin */ = { - isa = PBXNativeTarget; - buildConfigurationList = D8857DFC1CE1554F00A7B30F /* Build configuration list for PBXNativeTarget "Hv_{{name}}_Wwise{{plugin_type}}Plugin" */; - buildPhases = ( - D8857DF51CE1554F00A7B30F /* Sources */, - D8857DF61CE1554F00A7B30F /* Frameworks */, - D8857DF71CE1554F00A7B30F /* Headers */, - D8857E041CE15A3400A7B30F /* ShellScript */, - ); - buildRules = ( - ); - dependencies = ( - D8857E001CE1595E00A7B30F /* PBXTargetDependency */, - ); - name = Hv_{{name}}_Wwise{{plugin_type}}Plugin; - productName = Hv_{{name}}_Wwise{{plugin_type}}Plugin; - productReference = D8857DF91CE1554F00A7B30F /* Hv_{{name}}_Wwise{{plugin_type}}Plugin.dylib */; - productType = "com.apple.product-type.library.dynamic"; - }; - D8857E081CE15D4900A7B30F /* Hv_{{name}}_Wwise{{plugin_type}}Plugin_iOS */ = { - isa = PBXNativeTarget; - buildConfigurationList = D8857E0F1CE15D4A00A7B30F /* Build configuration list for PBXNativeTarget "Hv_{{name}}_Wwise{{plugin_type}}Plugin_iOS" */; - buildPhases = ( - D8857E051CE15D4900A7B30F /* Sources */, - D8857E061CE15D4900A7B30F /* Frameworks */, - D8857E071CE15D4900A7B30F /* CopyFiles */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = Hv_{{name}}_Wwise{{plugin_type}}Plugin_iOS; - productName = Hv_{{name}}_Wwise{{plugin_type}}Plugin_iOS; - productReference = D8857E091CE15D4900A7B30F /* libHv_{{name}}_Wwise{{plugin_type}}Plugin.a */; - productType = "com.apple.product-type.library.static"; - }; - D8C486EE1CDCD6B9000B3BCC /* Hv_{{name}}_Wwise{{plugin_type}}Engine */ = { - isa = PBXNativeTarget; - buildConfigurationList = D8C486F21CDCD6B9000B3BCC /* Build configuration list for PBXNativeTarget "Hv_{{name}}_Wwise{{plugin_type}}Engine" */; - buildPhases = ( - D8C486EB1CDCD6B9000B3BCC /* Sources */, - D8C486EC1CDCD6B9000B3BCC /* Frameworks */, - D8C486ED1CDCD6B9000B3BCC /* Headers */, - D8857DF21CE1524800A7B30F /* CopyFiles */, - D8857DF41CE152A100A7B30F /* ShellScript */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = Hv_{{name}}_Wwise{{plugin_type}}Engine; - productName = Hv_{{name}}_Wwise{{plugin_type}}Engine; - productReference = D8C486EF1CDCD6B9000B3BCC /* libHv_{{name}}_Wwise{{plugin_type}}Engine.a */; - productType = "com.apple.product-type.library.static"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - D8C486DA1CDCD5C1000B3BCC /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0730; - ORGANIZATIONNAME = "Enzien Audio"; - TargetAttributes = { - D8857DF81CE1554F00A7B30F = { - CreatedOnToolsVersion = 7.3; - }; - D8857E081CE15D4900A7B30F = { - CreatedOnToolsVersion = 7.3; - }; - D8C486EE1CDCD6B9000B3BCC = { - CreatedOnToolsVersion = 7.3; - }; - }; - }; - buildConfigurationList = D8C486DD1CDCD5C1000B3BCC /* Build configuration list for PBXProject "Hv_{{name}}_WwisePlugin" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - ); - mainGroup = D8C486D91CDCD5C1000B3BCC; - productRefGroup = D8C486E31CDCD5C1000B3BCC /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - D8C486EE1CDCD6B9000B3BCC /* Hv_{{name}}_Wwise{{plugin_type}}Engine */, - D8857DF81CE1554F00A7B30F /* Hv_{{name}}_Wwise{{plugin_type}}Plugin */, - D8857E081CE15D4900A7B30F /* Hv_{{name}}_Wwise{{plugin_type}}Plugin_iOS */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXShellScriptBuildPhase section */ - D8857DF41CE152A100A7B30F /* ShellScript */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = ""; - }; - D8857E041CE15A3400A7B30F /* ShellScript */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "$(CONFIGURATION_BUILD_DIR)/libHv_{{name}}_Wwise{{plugin_type}}Plugin.dylib", - ); - outputPaths = ( - "$(CONFIGURATION_BUILD_DIR)/libHv_{{name}}_Wwise{{plugin_type}}Plugin.bundle", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "echo \"Copying ${SCRIPT_INPUT_FILE_0} to ${SCRIPT_OUTPUT_FILE_0}\"\ncp ${SCRIPT_INPUT_FILE_0} ${SCRIPT_OUTPUT_FILE_0}"; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - D8857DF51CE1554F00A7B30F /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - D8857DFD1CE1576C00A7B30F /* Hv_{{name}}_WwisePluginRegister.cpp in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - D8857E051CE15D4900A7B30F /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - {%- for f in files if f.endswith((".c", ".cpp")) %} - {{f|xcode_build}} /* {{f}} in Sources */, - {%- endfor %} - D8331F1E1CE128BD003BFBA7 /* Hv_{{name}}_Wwise{{plugin_type}}PluginEngine.cpp in Sources */, - D8331F201CE1295C003BFBA7 /* Hv_{{name}}_WwisePluginEngineParams.cpp in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - D8C486EB1CDCD6B9000B3BCC /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - {%- for f in files if f.endswith((".c", ".cpp")) %} - {{f|xcode_build}} /* {{f}} in Sources */, - {%- endfor %} - D8331F1E1CE128BD003BFBA7 /* Hv_{{name}}_WwisePluginEngineParams.cpp in Sources */, - D8331F201CE1295C003BFBA7 /* Hv_{{name}}_Wwise{{plugin_type}}PluginEngine.cpp in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - D8857E001CE1595E00A7B30F /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = D8C486EE1CDCD6B9000B3BCC /* Hv_{{name}}_Wwise{{plugin_type}}Engine */; - targetProxy = D8857DFF1CE1595E00A7B30F /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin XCBuildConfiguration section */ - D8857DFA1CE1554F00A7B30F /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - CONFIGURATION_BUILD_DIR = "$(PROJECT_DIR)/../build/macos/$(ARCHS)/$(CONFIGURATION)"; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - EXECUTABLE_PREFIX = "lib"; - HEADER_SEARCH_PATHS = "$(WWISE_SDK_PATH)"; - LIBRARY_SEARCH_PATHS = "$(CONFIGURATION_BUILD_DIR)/"; - OTHER_CFLAGS = ( - "-msse4.1", - "-ffast-math", - ); - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Debug; - }; - D8857DFB1CE1554F00A7B30F /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - CONFIGURATION_BUILD_DIR = "$(PROJECT_DIR)/../build/macos/$(ARCHS)/$(CONFIGURATION)"; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - EXECUTABLE_PREFIX = "lib"; - GCC_GENERATE_DEBUGGING_SYMBOLS = NO; - HEADER_SEARCH_PATHS = "$(WWISE_SDK_PATH)"; - LIBRARY_SEARCH_PATHS = "$(CONFIGURATION_BUILD_DIR)/"; - OTHER_CFLAGS = ( - "-DNDEBUG", - "-msse4.1", - "-ffast-math", - ); - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Release; - }; - D8857E101CE15D4A00A7B30F /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = ( - "$(ARCHS_STANDARD)", - armv7s, - ); - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - CONFIGURATION_BUILD_DIR = "$(PROJECT_DIR)/../build/ios/$(ARCHS)/$(CONFIGURATION)"; - ENABLE_BITCODE = YES; - HEADER_SEARCH_PATHS = "$(WWISE_SDK_PATH)"; - IPHONEOS_DEPLOYMENT_TARGET = 9.3; - OTHER_LDFLAGS = "-ObjC"; - PRODUCT_NAME = Hv_{{name}}_Wwise{{plugin_type}}Plugin; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - }; - name = Debug; - }; - D8857E111CE15D4A00A7B30F /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = ( - "$(ARCHS_STANDARD)", - armv7s, - ); - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - CONFIGURATION_BUILD_DIR = "$(PROJECT_DIR)/../build/ios/$(ARCHS)/$(CONFIGURATION)"; - ENABLE_BITCODE = YES; - HEADER_SEARCH_PATHS = "$(WWISE_SDK_PATH)"; - IPHONEOS_DEPLOYMENT_TARGET = 9.3; - OTHER_LDFLAGS = "-ObjC"; - PRODUCT_NAME = Hv_{{name}}_Wwise{{plugin_type}}Plugin; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - D8C486E61CDCD5C1000B3BCC /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = D8851B631CE1271600D6BE37 /* wwise.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGN_IDENTITY = "-"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = c11; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.11; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = macosx; - }; - name = Debug; - }; - D8C486E71CDCD5C1000B3BCC /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = D8851B631CE1271600D6BE37 /* wwise.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGN_IDENTITY = "-"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = c11; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.11; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = macosx; - }; - name = Release; - }; - D8C486F01CDCD6B9000B3BCC /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = D8851B631CE1271600D6BE37 /* wwise.xcconfig */; - buildSettings = { - CONFIGURATION_BUILD_DIR = "$(PROJECT_DIR)/../build/macos/$(ARCHS)/$(CONFIGURATION)"; - CONFIGURATION_TEMP_DIR = "$(PROJECT_TEMP_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)"; - EXECUTABLE_PREFIX = lib; - GCC_PREPROCESSOR_DEFINITIONS = ""; - HEADER_SEARCH_PATHS = "$(WWISE_SDK_PATH)"; - OBJROOT = "$(SYMROOT)"; - OTHER_CFLAGS = ( - "-msse4.1", - "-ffast-math", - ); - PRODUCT_NAME = "$(TARGET_NAME)"; - SYMROOT = build; - }; - name = Debug; - }; - D8C486F11CDCD6B9000B3BCC /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = D8851B631CE1271600D6BE37 /* wwise.xcconfig */; - buildSettings = { - CONFIGURATION_BUILD_DIR = "$(PROJECT_DIR)/../build/macos/$(ARCHS)/$(CONFIGURATION)"; - CONFIGURATION_TEMP_DIR = "$(PROJECT_TEMP_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)"; - EXECUTABLE_PREFIX = lib; - GCC_PREPROCESSOR_DEFINITIONS = ""; - HEADER_SEARCH_PATHS = "$(WWISE_SDK_PATH)"; - OBJROOT = "$(SYMROOT)"; - OTHER_CFLAGS = ( - "-DNDEBUG", - "-msse4.1", - "-ffast-math", - ); - PRODUCT_NAME = "$(TARGET_NAME)"; - SYMROOT = build; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - D8857DFC1CE1554F00A7B30F /* Build configuration list for PBXNativeTarget "Hv_{{name}}_Wwise{{plugin_type}}Plugin" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - D8857DFA1CE1554F00A7B30F /* Debug */, - D8857DFB1CE1554F00A7B30F /* Release */, - ); - defaultConfigurationIsVisible = 0; - }; - D8857E0F1CE15D4A00A7B30F /* Build configuration list for PBXNativeTarget "Hv_{{name}}_Wwise{{plugin_type}}Plugin_iOS" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - D8857E101CE15D4A00A7B30F /* Debug */, - D8857E111CE15D4A00A7B30F /* Release */, - ); - defaultConfigurationIsVisible = 0; - }; - D8C486DD1CDCD5C1000B3BCC /* Build configuration list for PBXProject "Hv_{{name}}_WwisePlugin" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - D8C486E61CDCD5C1000B3BCC /* Debug */, - D8C486E71CDCD5C1000B3BCC /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - D8C486F21CDCD6B9000B3BCC /* Build configuration list for PBXNativeTarget "Hv_{{name}}_Wwise{{plugin_type}}Engine" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - D8C486F01CDCD6B9000B3BCC /* Debug */, - D8C486F11CDCD6B9000B3BCC /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = D8C486DA1CDCD5C1000B3BCC /* Project object */; -} diff --git a/hvcc/generators/c2wwise/templates/xcode/wwise.xcconfig b/hvcc/generators/c2wwise/templates/xcode/wwise.xcconfig deleted file mode 100644 index 8043b4e6..00000000 --- a/hvcc/generators/c2wwise/templates/xcode/wwise.xcconfig +++ /dev/null @@ -1 +0,0 @@ -WWISE_SDK_PATH = "/Applications/Audiokinetic/Wwise {{wwise_version}}/SDK/include" diff --git a/hvcc/generators/c2wwise/templates/{{name}}Config.h b/hvcc/generators/c2wwise/templates/{{name}}Config.h new file mode 100644 index 00000000..682a9467 --- /dev/null +++ b/hvcc/generators/c2wwise/templates/{{name}}Config.h @@ -0,0 +1,12 @@ +{{copyright}} + +#ifndef {{name}}Config_H +#define {{name}}Config_H + +namespace {{name}}Config +{ + static const unsigned short CompanyID = 64; + static const unsigned short PluginID = {{plugin_id}}; +} + +#endif // {{name}}Config_H diff --git a/hvcc/generators/ir2c/static/HvMath.h b/hvcc/generators/ir2c/static/HvMath.h index 2beee798..d25de2df 100644 --- a/hvcc/generators/ir2c/static/HvMath.h +++ b/hvcc/generators/ir2c/static/HvMath.h @@ -539,14 +539,14 @@ static inline void __hv_pow_f(hv_bInf_t bIn0, hv_bInf_t bIn1, hv_bOutf_t bOut) { _mm256_store_ps(b, bIn0); _mm256_store_ps(b+8, bIn1); *bOut = _mm256_set_ps( - hv_pow_f(b[7], b[7]), - hv_pow_f(b[6], b[6]), - hv_pow_f(b[5], b[5]), - hv_pow_f(b[4], b[4]), - hv_pow_f(b[3], b[3]), - hv_pow_f(b[2], b[2]), - hv_pow_f(b[1], b[1]), - hv_pow_f(b[0], b[0])); + hv_pow_f(b[7], b[15]), + hv_pow_f(b[6], b[14]), + hv_pow_f(b[5], b[13]), + hv_pow_f(b[4], b[12]), + hv_pow_f(b[3], b[11]), + hv_pow_f(b[2], b[10]), + hv_pow_f(b[1], b[9]), + hv_pow_f(b[0], b[8])); #elif HV_SIMD_SSE float *b = (float *) hv_alloca(8*sizeof(float)); _mm_store_ps(b, bIn0); diff --git a/hvcc/generators/ir2c/static/HvSignalTabwrite.c b/hvcc/generators/ir2c/static/HvSignalTabwrite.c index f3d984a4..453b2290 100644 --- a/hvcc/generators/ir2c/static/HvSignalTabwrite.c +++ b/hvcc/generators/ir2c/static/HvSignalTabwrite.c @@ -36,6 +36,9 @@ void sTabwrite_onMessage(HeavyContextInterface *_c, SignalTabwrite *o, int letIn case HV_MSG_SYMBOL: { if (msg_compareSymbol(m, 0, "stop")) { o->head = HV_TABWRITE_STOPPED; + } else if (msg_compareSymbol(m, 0, "clear")) { + hv_size_t numBytes = o->table->allocated * sizeof(float); + hv_memclear(o->table->buffer, numBytes); } break; } diff --git a/hvcc/generators/ir2c/static/HvUtils.h b/hvcc/generators/ir2c/static/HvUtils.h index 3be2432e..2186f547 100644 --- a/hvcc/generators/ir2c/static/HvUtils.h +++ b/hvcc/generators/ir2c/static/HvUtils.h @@ -201,7 +201,9 @@ // Export and Inline #if HV_WIN #define HV_EXPORT __declspec(dllexport) +#ifndef __cplusplus // MSVC doesn't like redefining "inline" keyword #define inline __inline +#endif #define HV_FORCE_INLINE __forceinline #else #define HV_EXPORT diff --git a/hvcc/generators/ir2c/templates/Heavy_NAME.cpp b/hvcc/generators/ir2c/templates/Heavy_NAME.cpp index c984c5d7..a9e0a33c 100644 --- a/hvcc/generators/ir2c/templates/Heavy_NAME.cpp +++ b/hvcc/generators/ir2c/templates/Heavy_NAME.cpp @@ -169,6 +169,8 @@ int Heavy_{{name}}::process(float **inputBuffers, float **outputBuffers, int n) hLp_consume(&inQueue); } + sendBangToReceiver(0xDD21C0EB); // send to __hv_bang~ on next cycle + {%- if signal.numInputBuffers > 0 or signal.numOutputBuffers > 0 %} const int n4 = n & ~HV_N_SIMD_MASK; // ensure that the block size is a multiple of HV_N_SIMD @@ -246,6 +248,7 @@ int Heavy_{{name}}::process(float **inputBuffers, float **outputBuffers, int n) blockStartTimestamp = nextBlock; return n; {%- endif %} + } int Heavy_{{name}}::processInline(float *inputBuffers, float *outputBuffers, int n4) { diff --git a/hvcc/interpreters/pd2hv/libs/pd/bang~.pd b/hvcc/interpreters/pd2hv/libs/pd/bang~.pd new file mode 100644 index 00000000..23fae332 --- /dev/null +++ b/hvcc/interpreters/pd2hv/libs/pd/bang~.pd @@ -0,0 +1,9 @@ +#N canvas 320 37 549 254 12; +#X obj 99 102 r __hv_bang~; +#X obj 99 173 outlet; +#X obj 99 71 inlet; +#X text 151 69 inlet is inactive; +#X text 255 111 because we only receive the first bang at the end of the first process() loop we first send a loadbang; +#X obj 128 132 loadbang; +#X connect 0 0 1 0; +#X connect 5 0 1 0; diff --git a/hvcc/interpreters/pd2hv/libs/pd/delwrite~.pd b/hvcc/interpreters/pd2hv/libs/pd/delwrite~.pd index 8d290327..6f5be8e2 100644 --- a/hvcc/interpreters/pd2hv/libs/pd/delwrite~.pd +++ b/hvcc/interpreters/pd2hv/libs/pd/delwrite~.pd @@ -1,51 +1,61 @@ -#N canvas 538 250 585 275 10; -#X obj 10 181 inlet~; +#N canvas 973 266 457 387 10; #N canvas 0 22 450 300 @hv_obj 0; #X obj 48 70 inlet~; #X obj 147 72 inlet; -#X restore 10 206 pd @hv_obj __tabwrite~f del-\$1; -#X text 9 253 @hv_arg \$2 delay float 0 true; -#X obj 187 31 samplerate~; -#X obj 187 71 * \$2; +#X restore 10 309 pd @hv_obj __tabwrite~f del-\$1; +#X text 9 356 @hv_arg \$2 delay float 0 true; +#X obj 187 134 samplerate~; +#X obj 187 174 * \$2; #N canvas 0 22 450 300 @hv_obj 0; #X obj 142 60 inlet; #X obj 135 103 outlet; -#X restore 187 111 pd @hv_obj table del-\$1; -#X msg 187 91 resize \$1; -#X text 9 234 @hv_arg \$1 table string "" true; -#X obj 187 51 / 1000; +#X restore 187 214 pd @hv_obj table del-\$1; +#X msg 187 194 resize \$1; +#X text 9 337 @hv_arg \$1 table string "" true; +#X obj 187 154 / 1000; #N canvas 0 22 450 300 @hv_obj 0; #X obj 215 71 inlet; #X obj 165 71 inlet; #X obj 120 72 inlet; #X obj 129 122 outlet; -#X restore 187 159 pd @hv_obj __delay; -#X obj 187 8 loadbang; -#X obj 187 182 t a a a; -#X msg 226 228 mirror; +#X restore 187 262 pd @hv_obj __delay; +#X obj 187 111 loadbang; +#X obj 187 285 t a a a; +#X msg 226 331 mirror; #N canvas 0 22 450 300 @hv_obj 0; #X obj 215 71 inlet; #X obj 165 71 inlet; #X obj 120 72 inlet; #X obj 129 122 outlet; -#X restore 226 206 pd @hv_obj __delay; -#X obj 187 134 t b a a, f 25; -#X text 254 90 returns the size of the table; -#X msg 331 159 @HV_N_SIMD; -#X connect 0 0 1 0; -#X connect 3 0 8 0; -#X connect 4 0 6 0; -#X connect 5 0 14 0; -#X connect 6 0 5 0; -#X connect 8 0 4 0; -#X connect 9 0 11 0; -#X connect 10 0 3 0; -#X connect 11 0 1 1; -#X connect 11 1 9 0; -#X connect 11 2 13 0; -#X connect 12 0 5 0; -#X connect 13 0 12 0; -#X connect 14 0 9 0; -#X connect 14 1 9 2; -#X connect 14 2 16 0; -#X connect 16 0 13 2; +#X restore 226 309 pd @hv_obj __delay; +#X obj 187 237 t b a a, f 25; +#X text 254 193 returns the size of the table; +#X msg 331 262 @HV_N_SIMD; +#N canvas 1401 0 450 300 @hv_obj 0; +#X obj 48 57 inlet; +#X obj 48 114 outlet; +#X restore 83 52 pd @hv_obj __switchcase clear; +#X msg 83 75 clear; +#X text 80 32 connection from the left inlet to the switchcase; +#X text 81 21 NOTE(dreamer): there is supposed to be a control; +#X obj 10 26 inlet~ -~>; +#X connect 2 0 7 0; +#X connect 3 0 5 0; +#X connect 4 0 13 0; +#X connect 5 0 4 0; +#X connect 7 0 3 0; +#X connect 8 0 10 0; +#X connect 9 0 2 0; +#X connect 10 0 0 1; +#X connect 10 1 8 0; +#X connect 10 2 12 0; +#X connect 11 0 4 0; +#X connect 12 0 11 0; +#X connect 13 0 8 0; +#X connect 13 1 8 2; +#X connect 13 2 15 0; +#X connect 15 0 12 2; +#X connect 16 0 17 0; +#X connect 17 0 0 1; +#X connect 20 0 0 0; +#X connect 20 0 16 0; diff --git a/setup.cfg b/setup.cfg index 1d7d6106..d8cef533 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,30 +1,30 @@ [metadata] name = hvcc -version = 0.9.0 +version = 0.10.0 license = GPLv3 author = Enzien Audio, Wasted Audio description = `hvcc` is a python-based dataflow audio programming language compiler that generates C/C++ code and a variety of specific framework wrappers. url = https://github.com/Wasted-Audio/hvcc -download_url = https://github.com/Wasted-Audio/hvcc/archive/refs/tags/v0.9.0.tar.gz +download_url = https://github.com/Wasted-Audio/hvcc/archive/refs/tags/v0.10.0.tar.gz classifiers = Development Status :: 4 - Beta Intended Audience :: Developers Topic :: Software Development :: Compilers License :: OSI Approved :: GNU General Public License v3 (GPLv3) - Programming Language :: Python :: 3.7 Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9 Programming Language :: Python :: 3.10 Programming Language :: Python :: 3.11 + Programming Language :: Python :: 3.12 [options] include_package_data = True packages = find: -python_requires = >= 3.7 +python_requires = >= 3.8 install_requires = Jinja2>=2.11 importlib_resources>=5.1 - wstd2daisy>=0.5.0 + wstd2daisy>=0.5.1 [options.entry_points] console_scripts = diff --git a/tests/src/midifile b/tests/src/midifile index 0015eada..78a85f51 160000 --- a/tests/src/midifile +++ b/tests/src/midifile @@ -1 +1 @@ -Subproject commit 0015eada0a315fbd663e728e7b1088acd9877f19 +Subproject commit 78a85f51f92b7f57904c2d14f1813f5a6f7e7318 diff --git a/tox.ini b/tox.ini index 674d11fa..812a253b 100644 --- a/tox.ini +++ b/tox.ini @@ -1,15 +1,15 @@ ; Tox config [tox] -envlist = flake8, mypy, py37, py38, py39, py310, py311 +envlist = flake8, mypy, py38, py39, py310, py311, py312 skipsdist = true [gh-actions] python = - 3.7: py37 3.8: py38 3.9: py39 3.10: py310 3.11: flake8, mypy, py311 + 3.12: py312 ; Test config [testenv]