Add clip_slot properties and proposal for new properties organization.#182
Open
PhotonicVelocity wants to merge 6 commits intoideoforms:masterfrom
Open
Add clip_slot properties and proposal for new properties organization.#182PhotonicVelocity wants to merge 6 commits intoideoforms:masterfrom
PhotonicVelocity wants to merge 6 commits intoideoforms:masterfrom
Conversation
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.
Proposed Update to Module Definitions
Summary
I would like to propose replacing the old
methods/properties_r/properties_rwlist setup with a dictionary‑based registry inclip_slot.py. The new structure keeps all available enpoints in a single place to easilly parse and update. It makes behavior explicit per endpoint and allows fine‑grained control over methods, getters, setters, and listeners - allowing custom callers where needed or simple aliases for endpoint consistency. It aligns the API with a consistent verb naming scheme (e.g.,create/midi_clip,delete/clip,set/fire_button).Why move to a dictionary
The previous design relied on separate lists and implicit behavior (e.g., every property got listeners, even when the Live API doesn’t support them). And every method that wasn't a direct call needed a custom handler, even if it was just to make a nicer endpoint name. The new dictionary setup:
alias,caller,get,set,listen).Dictionary Structures
Methods
alias:1/Truewhen the endpoint is just an alternate name for another internal method.caller:1/True→ use the endpoint name as the internal method name"method_name"→ call a custom helper (or alias target)None/0→ disabled - but good to have in list with a comment to know what's still to be doneProperties
get/set/listen:1→ standard handler (_get_property,_set_property,_start_listen)"func_name"→ custom handler function0/None→ disabled"bang"tells the listen handler to just return a boolean when fired for properties with no getter.Naming scheme
Endpoints now follow a verb/object pattern where possible:
create/midi_clip,create/audio_clipdelete/clipBack‑compat endpoints are retained for existing clients (
create_clip,delete_clip).Handler Registration
Adding handlers can now be done with a single block at the end of the module. The block reads the dictionaires and adds handlers based on the definitions there.
Updates to Clip Slot
Methods added / changed
Added (new endpoints)
/live/clip_slot/create/midi_clip(alias →create_clip)/live/clip_slot/create/audio_clip(alias →create_audio_clip)/live/clip_slot/delete/clip(alias →delete_clip)/live/clip_slot/duplicate_to(custom caller →duplicate_clip_to)/live/clip_slot/set/fire_button(alias →set_fire_button_state)Back‑compat retained
/live/clip_slot/create_clip/live/clip_slot/delete_clipProperties and listeners
Properties included
All non‑object properties from the Live API are exposed with the correct getter/setter/listener flags:
has_clip,has_stop_button,is_group_slot,is_playing,is_recording,is_triggered,will_record_on_startcolor,color_index,controls_other_clips,playing_status(group‑track slots only)Skipped (for now)
canonical_parentclipThese return parent/child objects and are not very useful at the moment. We always target a clip slot with a track index, and we always target a clip with a track and slot index.
Tests and fixtures
New test support
A
silent_audio_filefixture was added intests/__init__.pyto generate a silent WAV file in the tests directory. It works on macOS and Windows and both the.wavand.wav.asdfiles can be removed by a test afterward.Endpoint coverage
Tests now exercise the entire clip slot surface area:
ClipSlot API coverage summary
canonical_parent,clip) are intentionally skipped, with rationale documented above.Checklist