Skip to content

Fix python event routing sender mismatch for playhead events#270

Closed
richardssam wants to merge 1 commit into
AcademySoftwareFoundation:developfrom
richardssam:playhead_events
Closed

Fix python event routing sender mismatch for playhead events#270
richardssam wants to merge 1 commit into
AcademySoftwareFoundation:developfrom
richardssam:playhead_events

Conversation

@richardssam

Copy link
Copy Markdown
Contributor
  • Resolve issue where playhead events (position_atom, etc.) were silently dropped in the Python API. When C++ event groups broadcast messages, the sender is set to the owner actor (e.g. Playhead) rather than the event group address.
  • Add support for mapping callback IDs to an optional owner actor address in EventToPythonThreadLockerActor.
  • Update subscribe_to_playhead_events in plugin_base.py and subscribe_to_event_group in module.py to pass the owner actor as the third argument to add_message_callback.

I have to be honest, this is code from gemini, I was trying to use the event system as much as I could, so tried using the playhead, but ran into problems getting the information from it, so if there is a better way to get playhead events to python let me know.

- Resolve issue where playhead events (position_atom, etc.) were silently dropped
  in the Python API. When C++ event groups broadcast messages, the sender is
  set to the owner actor (e.g. Playhead) rather than the event group address.
- Add support for mapping callback IDs to an optional owner actor address in
  EventToPythonThreadLockerActor.
- Update subscribe_to_playhead_events in plugin_base.py and
  subscribe_to_event_group in module.py to pass the owner actor as the third
  argument to add_message_callback.

Signed-off-by: Sam.Richards@taurich.org <Sam.Richards@taurich.org>
(cherry picked from commit 30c92c49afc21d4b3ff4ddf6c69f751db646fca4)
@tedwaine

Copy link
Copy Markdown
Collaborator

Hi @richardssam

Thanks for this. I tried it out but there were still problems as the events emitted by a playhead contain data types that aren't compatible with python. Nice try Gemini.

I have instead modified the python PluginBase class (in my recent commit). You can simply call 'self.subscribe_to_playhead_events()' in your plugin code. You also need to override playhead_attribute_changed and onscreen_media_changed methods in your plugin - you will then get pretty granular updates on the playhead state via those methods.

@tedwaine tedwaine closed this Jun 19, 2026
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.

2 participants