Wildcard or list matching for source/sink #13
No reviewers
Labels
No labels
Agent
Ignore
Agent
In Progress
Agent
Planned
Agent
Planning
Agent
Ready
Agent
Triage
Compat
Breaking
Kind
Bug
Kind
Documentation
Kind
Enhancement
Kind
Feature
Kind
Security
Kind
Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
lucas/nanoKontroller2!13
Loading…
Reference in a new issue
No description provided.
Delete branch "agent/issue-3-node-pattern-matching"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Implements the plan in #3.
Closes: #3
What changed
NodeMatcher(includes/NodeMatcher.h,src/NodeMatcher.cpp): compiles each configured entry as^(?:entry)$(ECMAScript, case-sensitive). Entries stay individually addressable (FirstMatchingEntry) because the representative rule ranks by entry. An invalid entry warns on stderr and is dropped; the rest of the list keeps working.std::vector<std::string>, so a scalar is a one-element list. Parsing moved from glaze reflection to aglz::genericDOM walk, since the accepted shape is polymorphic per key. BothactionsandActionsare accepted.FriendlyNamesvalues may be lists, and expansion splices them in place, single-level.AudioService: listeners are subscriptions (matcher + pointer) instead of name-keyed maps;GetMatchingNodesdefines the representative order (configured entry index, then ascending PipeWire bound id); the node cache only admits nodes whosemedia.classcontainsAudio.connectionmanages the full cross product and no longer re-enforcesdefault-stateon link events, so manually created links survive.Decisions worth flagging
set-defaultwas not in the plan (it sharesIActionBase::m_Node, which becamem_Target). There is exactly one default per media class, so the action cannot fan out: it acts on the representative node — the same node whose state the LED reads. Documented in the README.connectionregisters one combined node subscription instead of two. The duplicate-registration guard is keyed on the listener pointer, so registeringm_Leftand thenm_Rightwould have silently dropped the right-hand subscription and starved that side of node events. The action therefore subscribes with a matcher built from the union of both sides' patterns, and keepsm_Left/m_Rightseparate for the ranked queries.glz::json_tis deprecated in glaze v9.1.0 (the version CI installs) in favour ofglz::generic; the code usesglz::generic, with the accessors verified against that release.-DNANOKONTROLLER2_BUILD_TESTS=ONplus acteststep). The option still defaults toOFF, so the packaging and default build are unchanged.on_node_params_changed/on_node_ports_changedgained a null-node.nameguard; the old code passed a possibly-nullconst char*into a map lookup.Verification
nanoKontroller2_testspasses locally (built with gcc-14 against glaze v9.1.0 headers): anchoring, thefirefox|chromiumcase that^a|b$would get wrong, entry ranking with overlapping patterns, dropped-invalid-entry reindexing, alias splicing order and single-level expansion,GetScalarParam.Actionskey, and malformed values (non-string list entries, non-string parameter, missingtype); each warns and degrades as designed.config-example.jsonparses to the expected lists.AudioService, the actions) is compiled by CI only — no PipeWire/WirePlumber headers or session are available in this environment, so the live checks of the issue's Verification section (steps 3, 4 and 6: fan-out, representative promotion, sticky volume, cross-product links, video nodes untouched) have not been run and need a real session.WIP: Wildcard or list matching for source/sinkto Wildcard or list matching for source/sink