PlatformServices
#include "crosspad/platform/PlatformServices.hpp"Generated from crosspad/platform/PlatformServices.hpp in crosspad-core. Edit the header’s doxygen comments to change this page.
Centralized service registry for all CrossPad platform services.
Recipes that use it: Play a sample
Functions
Section titled “Functions”getPlatformServices
Section titled “getPlatformServices”PlatformServices & getPlatformServices()Access the singleton PlatformServices registry.
Declared in crosspad/platform/PlatformServices.hpp:153.
getKitManager
Section titled “getKitManager”IKitManager * getKitManager()Get the kit manager (may be nullptr if no kit system is available).
Used in Play a sample.
Declared in crosspad/platform/PlatformServices.hpp:156.
crosspad::PlatformServices
Section titled “crosspad::PlatformServices”Central registry of all platform service pointers.
Core services are populated by crosspad_platform_init(). Optional services default to null-object stubs (NullVibration, NullImu, NullMidiOutput, NullAudioOutput) so getters never return null.
Use typed setters for runtime swaps — they auto-update capability flags.
| Field | Type | Description |
|---|---|---|
eventBus | IEventBus * | |
clock | IClock * | |
ledStrip | ILedStrip * | |
midiOutput | IMidiOutput * | |
padManager | PadManager * | |
padLedController | PadLedController * | |
padAnimator | PadAnimator * | |
kvStore | IKeyValueStore * | |
settings | CrosspadSettings * | |
status | CrosspadStatus * | |
audioOutput | IAudioOutput * | |
audioInput | IAudioInput * | |
audioModule | IAudioModule * | |
synthEngine | ISynthEngine * | |
vibration | IVibration * | |
imu | IImu * | |
httpClient | IHttpClient * | |
settingsUI | ISettingsUI * | |
kitManager | IKitManager * | |
sequencer | SequencerController * | |
sequencerEngine | ISequencerEngine * | |
songEngine | ISongEngine * | The audio song: projects on the card, bouncing a scene, playing the four tracks back. |
sampleTools | ISampleTools * | recording, previewing and slicing samples |
inputGain | IInputGain * | the inputs’ preamp gain (mics, line-in) |
inputPairs | IInputPairs * | which inputs the ADCs hear; null when all always do |
outputLevels | IOutputLevels * | the speakers’ and jacks’ analog levels; null where the board has none |
padMix | IPadMix * | Per-pad level and pan of whichever engine plays the pads now; the engine that takes over the pads registers itself here. |
bleMidi | IBleMidi * | |
pitchedInstrument | PitchedInstrument * | The varispeed sample engine, when the platform runs one. |
instrumentHost | IInstrumentHost * | Lends that engine to an app with an instrument of its own, and keeps the app’s instrument library. |
stm32MessageHandler | Stm32MessageHandler * | Decoder of the CrossPad SysEx catalog (STM32 frames and host frames alike). |
Members
| Member | Description |
|---|---|
setMidiOutput | Set MIDI output + toggle Capability::Midi. |
setAudioOutput | Set audio output + toggle Capability::AudioOut. |
setAudioInput | Set audio input + toggle Capability::AudioIn. |
setAudioModule | Set audio module (DSP pipeline) + toggle Capability::AudioOut. |
setSynthEngine | Set synth engine + toggle Capability::Synth. |
setVibration | Set vibration driver + toggle Capability::Vibration. |
setImu | Set IMU driver + toggle Capability::Imu. |
setHttpClient | Set HTTP client + toggle Capability::Http. |
setPitchedInstrument | Publish the pitched sample engine. |
setBleMidi | Set BLE MIDI interface + toggle Capability::Bluetooth. |
Methods
setMidiOutput
Section titled “setMidiOutput”void setMidiOutput(IMidiOutput *midi)Set MIDI output + toggle Capability::Midi.
Special: also re-inits PadManager with the new output.
setAudioOutput
Section titled “setAudioOutput”void setAudioOutput(IAudioOutput *audio)Set audio output + toggle Capability::AudioOut.
setAudioInput
Section titled “setAudioInput”void setAudioInput(IAudioInput *input)Set audio input + toggle Capability::AudioIn.
setAudioModule
Section titled “setAudioModule”void setAudioModule(IAudioModule *module)Set audio module (DSP pipeline) + toggle Capability::AudioOut.
This is the canonical audio API; setAudioOutput is low-level PCM only.
setSynthEngine
Section titled “setSynthEngine”void setSynthEngine(ISynthEngine *synth)Set synth engine + toggle Capability::Synth.
setVibration
Section titled “setVibration”void setVibration(IVibration *vib)Set vibration driver + toggle Capability::Vibration.
setImu
Section titled “setImu”void setImu(IImu *imu)Set IMU driver + toggle Capability::Imu.
setHttpClient
Section titled “setHttpClient”void setHttpClient(IHttpClient *http)Set HTTP client + toggle Capability::Http.
setPitchedInstrument
Section titled “setPitchedInstrument”void setPitchedInstrument(PitchedInstrument *instrument)Publish the pitched sample engine.
No capability flag: the engine is a concrete object a port owns, not an interface a port may or may not have.
setBleMidi
Section titled “setBleMidi”void setBleMidi(IBleMidi *ble)Set BLE MIDI interface + toggle Capability::Bluetooth.
Also wires into MidiInputHandler::setBleOutput().
Declared in crosspad/platform/PlatformServices.hpp:64.