Skip to content

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

PlatformServices & getPlatformServices()

Access the singleton PlatformServices registry.

Declared in crosspad/platform/PlatformServices.hpp:153.

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.

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.

FieldTypeDescription
eventBusIEventBus *
clockIClock *
ledStripILedStrip *
midiOutputIMidiOutput *
padManagerPadManager *
padLedControllerPadLedController *
padAnimatorPadAnimator *
kvStoreIKeyValueStore *
settingsCrosspadSettings *
statusCrosspadStatus *
audioOutputIAudioOutput *
audioInputIAudioInput *
audioModuleIAudioModule *
synthEngineISynthEngine *
vibrationIVibration *
imuIImu *
httpClientIHttpClient *
settingsUIISettingsUI *
kitManagerIKitManager *
sequencerSequencerController *
sequencerEngineISequencerEngine *
songEngineISongEngine *The audio song: projects on the card, bouncing a scene, playing the four tracks back.
sampleToolsISampleTools *recording, previewing and slicing samples
inputGainIInputGain *the inputs’ preamp gain (mics, line-in)
inputPairsIInputPairs *which inputs the ADCs hear; null when all always do
outputLevelsIOutputLevels *the speakers’ and jacks’ analog levels; null where the board has none
padMixIPadMix *Per-pad level and pan of whichever engine plays the pads now; the engine that takes over the pads registers itself here.
bleMidiIBleMidi *
pitchedInstrumentPitchedInstrument *The varispeed sample engine, when the platform runs one.
instrumentHostIInstrumentHost *Lends that engine to an app with an instrument of its own, and keeps the app’s instrument library.
stm32MessageHandlerStm32MessageHandler *Decoder of the CrossPad SysEx catalog (STM32 frames and host frames alike).

Members

MemberDescription
setMidiOutputSet MIDI output + toggle Capability::Midi.
setAudioOutputSet audio output + toggle Capability::AudioOut.
setAudioInputSet audio input + toggle Capability::AudioIn.
setAudioModuleSet audio module (DSP pipeline) + toggle Capability::AudioOut.
setSynthEngineSet synth engine + toggle Capability::Synth.
setVibrationSet vibration driver + toggle Capability::Vibration.
setImuSet IMU driver + toggle Capability::Imu.
setHttpClientSet HTTP client + toggle Capability::Http.
setPitchedInstrumentPublish the pitched sample engine.
setBleMidiSet BLE MIDI interface + toggle Capability::Bluetooth.

Methods

void setMidiOutput(IMidiOutput *midi)

Set MIDI output + toggle Capability::Midi.

Special: also re-inits PadManager with the new output.

void setAudioOutput(IAudioOutput *audio)

Set audio output + toggle Capability::AudioOut.

void setAudioInput(IAudioInput *input)

Set audio input + toggle Capability::AudioIn.

void setAudioModule(IAudioModule *module)

Set audio module (DSP pipeline) + toggle Capability::AudioOut.

This is the canonical audio API; setAudioOutput is low-level PCM only.

void setSynthEngine(ISynthEngine *synth)

Set synth engine + toggle Capability::Synth.

void setVibration(IVibration *vib)

Set vibration driver + toggle Capability::Vibration.

void setImu(IImu *imu)

Set IMU driver + toggle Capability::Imu.

void setHttpClient(IHttpClient *http)

Set HTTP client + toggle Capability::Http.

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.

void setBleMidi(IBleMidi *ble)

Set BLE MIDI interface + toggle Capability::Bluetooth.

Also wires into MidiInputHandler::setBleOutput().

Declared in crosspad/platform/PlatformServices.hpp:64.