Expand OSC remote control (testable parser, layer/vertex commands)#623
Merged
Conversation
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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Expands MapMap's OSC remote-control interface and refactors it for testability.
parseOscAction()is a pure function (QtCore only) turning an address + arguments into a structured command;OscInterface::applyAction()resolves the target source/layer against theMappingManagerand mutates the model. This makes OSC unit-testable without a running GUI.play/pause/rewind; per-layermove/xy(absolute),translate/xy(relative), andvertex/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.mappingis accepted as an alias forlayer.MappingManager::getSourceById()inserting null map entries for unknown ids.OSCreference (the old one documented/mapmap/paint/media/load, which no longer exists), addedscripts/mapmap-osc.py(a dependency-free OSC client), and updated theTODOwishlist 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
qmake && make)TestOscsuite passes (15 cases covering valid + malformed addresses)processFrame->updateCanvases) repaints every frame, so OSC-driven vertex/move/opacity changes appear livepython3 scripts/mapmap-osc.py /mapmap/layer/move/xy 0 640 360