Repository navigation
Conversation
The name used to be fixed parameter 0 of every shared client, and the shared instance adaptor keyed its lookup tables on it, so it could not change after construction. The adaptor now owns the name: ParamAliasAdaptor gains name(), setName() (create-or-join, formerly done in setFixedParameterValues) and rename(), which re-keys both lookup tables while leaving the shared client and its parameters untouched. The name parameter and kName are removed from all shared clients, so remaining parameter indices shift down by one. Clients that print their name inherit the new NamedObject mixin, which the adaptor keeps up to date across renames. Host wrappers need to pass the name through setName() and read it with name() instead of using parameter 0. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J2M1cHdyiJWcPaKy2FRnMe
Both lookup tables hold weak pointers, so an entry can outlive what it names. Several paths assumed it couldn't: - ParamAliasAdaptor::refer() left the old data's entry behind when it was the data's last user: lookup() then reported the dead name as found, and setName() on that name crashed. - NRTSharedInstanceAdaptor::lookup() and its constructor crashed on an entry whose client had gone. That happens when something other than an object (e.g. a query) holds a client while its last object goes away. - rename() onto a name whose client was still held that way succeeded, and rekey() then dropped the renamed object's client from the table. It dropped it onto a dead entry too. - The client table's destructor removed whatever entry had its name, not only its own (the data table's destructor already checked). Lookups now treat dead entries as absent without modifying the tables, since lookup() also runs on audio threads (e.g. FluidKDTreeQuery in SuperCollider). Dead entries are replaced when their name is registered again, refer() unregisters data it was the last user of, rename() refuses a name whose client is still alive, and the client table's destructor only removes its own entry. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J2M1cHo8cpczLoz3ztCv8Q
Each host wrapper implemented these itself, which kept them out of the generated documentation and out of reach of tests. NRTSharedInstanceAdaptor now declares them once, after the client's own messages (NumClientMessages says where they start), and they act on the adaptor. To work from inside core, refer must reach every copy of the host object's parameters: the host's own, and those the threading and sharing adaptors hold. Copies of a ParamAliasAdaptor therefore now share one Binding, so re-pointing one re-points them all; mParams-> still reaches the shared data. refer() also moves the parameter listeners the object added over to the new data, and fires them so hosts can refresh the values they display. The client is switched in place, instead of hosts rebuilding theirs. Behaviour changes for hosts that implemented these themselves: - refer to an unknown name is an error, always printed, rather than a warning printed only when verbose - refer to the object's own name succeeds (so hosts reply) rather than doing nothing - an object's listeners fire after refer Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J2M1cHo8cpczLoz3ztCv8Q
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.
This is a refactor of #358. It adds 2 interface options for getname and setname and refactors refer:
I prefer the latter. More personal questions in an email. Its tip compiles and works with all CCEs following PRS:
flucoma/flucoma-docs#230
flucoma/flucoma-max#474
flucoma/flucoma-pd#129
flucoma/flucoma-sc#207