A starting point for a Trunk Recorder Pro plugin in Rust: a working example plugin, tests, CI, and a release workflow that builds for every platform the recorder runs on.
A plugin is a small program of its own. The recorder starts it, tells it what happens (a call starts, a recorded call lands on disk, a radio registers, …), and stops it. Plugins watch; they don't change what gets recorded. Uploaders (OpenMHz, Broadcastify), streamers, loggers and notifiers are all plugins.
The example here, call-log, writes a line of JSON for every recorded call. For complete plugins built from this template, see the OpenMHz, Broadcastify and Rdio Scanner uploaders, simplestream (live audio) and upload-script.
- Use this template on GitHub (or copy it) to make your plugin's repository.
- In
Cargo.toml, setname(your plugin's id),description,repositoryandauthors. Insrc/main.rs, set the displaynameinmanifest(). Deletedocs/(it stays here, up to date) and rewrite this README for your plugin's users. Getting started has the full list. - Build and look at what the recorder will see:
cargo build ./target/debug/call-log --describe
- Run it against calls you've already recorded:
trunk-pro plugin run ./target/debug/call-log ~/TrunkRecorderPro --limit 5 - Replace the example with your plugin, and keep the tests passing:
cargo test. - Tag a release (
git tag v0.1.0 && git push --tags); the workflow builds it for Linux, macOS and Windows. Then submit it to the registry.
| Getting started | From this template to a plugin running in your recorder |
| How plugins work | The process, its lifecycle, threads, failures |
| Settings | Config structs and the settings form drawn from them |
| Events | Everything a plugin can subscribe to, field by field |
| Audio | WAV and M4A, and what to do when M4A isn't there |
| Writing an uploader | Keys, retries, requests: a plugin that sends calls to a service |
| Testing | Unit tests, and running against real calls |
| Releasing | Versions, the release workflow, platforms |
| The plugin registry | How plugins get listed, installed and updated |
| Protocol | The wire format, for plugins in other languages |
The SDK's API reference is on docs.rs/trunk-recorder-plugin.
The template is MIT-licensed; your plugin can use any license you like.