Adding custom UI elements to your projects
This example project demonstrates how to define custom components in C++ and use it in your project. They can either be used as additional UI element within the scripted UI, or like in this example, completely replace the interface leaving you with all options that JUCE / C++ offers. This will be the first step in many in order to open up HISE to the C++ side (next on the list is building the module architecture using a C++ API).
How to test this project
- Load this project in HISE and open Test.xml. You'll see that there is nothing going on on the interface preview except for a placeholder component.
- However if you compile the project, you should see a UI which is defined completely in C++.
Steps required for custom UI elements
You can either use this project as starting point or follow these steps to add this feature to your existing projects.
- Add a floating tile to your main interface and give it a ID that starts with
External(like in our case,
ExternalTestComponent). From the prefix
External, HISE will know that it will be added later and will show a placeholder.
- Activate custom panels by adding the compiler flag
HI_ENABLE_EXTERNAL_CUSTOM_TILES=1to all targets in the Project Settings menu
- Write your custom UI in C++ and put the files in the subfolder
AdditionalSourceCode. Take a look at the example file for detailed instructions.
- Export your plugin. Since you will be working with C++ a lot, I'd recommend cancelling the batch script launched by HISE and open the project file in your C++ IDE for editing. Be aware that it will not copy the files to the
Buildsdirectory - this directory is meant to be autogenerated and HISE will wipe it when cleaning up so you definitely don't want to write code in there.