Skip to content

Expand OSC remote control (testable parser, layer/vertex commands)#623

Merged
aalex merged 3 commits into
devfrom
new-adventures
Jun 26, 2026
Merged

Expand OSC remote control (testable parser, layer/vertex commands)#623
aalex merged 3 commits into
devfrom
new-adventures

Conversation

@aalex

@aalex aalex commented Jun 26, 2026

Copy link
Copy Markdown
Member

Summary

Expands MapMap's OSC remote-control interface and refactors it for testability.

  • Testable parser: split OSC address parsing from its side effects. parseOscAction() is a pure function (QtCore only) turning an address + arguments into a structured command; OscInterface::applyAction() resolves the target source/layer against the MappingManager and mutates the model. This makes OSC unit-testable without a running GUI.
  • New commands: per-source play/pause/rewind; per-layer move/xy (absolute), translate/xy (relative), and vertex/source|destination/xy (the two headline items from the TODO wishlist); color via hex string; plus the generic property setters (opacity, visible, solo, locked, depth, name, uri, rate, volume). Targets are selected by integer id or by name pattern. mapping is accepted as an alias for layer.
  • Bug fixes found while refactoring: a latent null-pointer deref when an unknown source id was targeted, and MappingManager::getSourceById() inserting null map entries for unknown ids.
  • Docs + tooling: rewrote the OSC reference (the old one documented /mapmap/paint/media/load, which no longer exists), added scripts/mapmap-osc.py (a dependency-free OSC client), and updated the TODO wishlist with accurate status (DONE / TODO / WONTDO).

Project file load/save over OSC is deliberately not exposed (security: no auth on the OSC port).

Test plan

  • App builds cleanly (qmake && make)
  • New TestOsc suite passes (15 cases covering valid + malformed addresses)
  • Full test suite green (44 tests total)
  • Verified the render loop (processFrame -> updateCanvases) repaints every frame, so OSC-driven vertex/move/opacity changes appear live
  • Manual smoke test against a running instance: python3 scripts/mapmap-osc.py /mapmap/layer/move/xy 0 640 360

aalex added 3 commits June 26, 2026 01:06
Split OSC address parsing from its side effects so it can be unit-tested
without a running GUI:

- Add OscAction + parseOscAction(): a pure function turning an OSC address
  and its arguments into a structured, fully-resolved command.
- Rewrite OscInterface to call the parser and a new applyAction() that
  resolves the target source/layer against the MappingManager and mutates
  the model.

Behaviour is preserved for the existing addresses; new commands are added
in the parser (per-source play/pause, layer move/translate/vertex). Also
fixes a latent null-pointer deref when an unknown source id was targeted,
and stops MappingManager::getSourceById() from inserting null entries.
Cover parseOscAction() across global transport, per-source transport and
properties (by id and by name pattern), layer properties, the "mapping"
alias, layer move/translate, vertex edits on the source/destination shapes,
and malformed input (missing target, missing value, bad vertex role).

Wires src/control/OscAction.cpp into the test target, which links only
against QtCore so it needs none of the GUI/multimedia back-ends.
- Rewrite the OSC file: the old reference described addresses that no longer
  exist (/mapmap/paint/media/load). Document the actual address scheme —
  global transport, per-source and per-layer commands, the id/name selector
  convention, the coordinate space, and the security stance (no project file
  I/O over OSC).
- Add scripts/mapmap-osc.py, a small dependency-free OSC client with
  automatic argument typing, for testing MapMap over OSC.
- Update TODO: mark the implemented OSC callbacks as DONE, the ones still
  open as TODO, and the project load/save callbacks as WONTDO (security).
@aalex aalex self-assigned this Jun 26, 2026
@aalex aalex merged commit 7a47ada into dev Jun 26, 2026
3 checks passed
@aalex aalex deleted the new-adventures branch June 26, 2026 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant