Closed burkholderm closed 6 years ago
UPDATED
It'll work if you add the line at the end in def __init__
s = self.song()
self._on_metronome_changed.subject = s
self._on_signature_numerator_changed.subject = s
self._on_signature_denominator_changed.subject = s
self._on_tempo_changed.subject = s
self._on_playing_changed.subject = s
I think the API needs to be reworked a bit. For example, what if I want to manually fetch the is_playing
status? If you add that line, the status is pushed when it changes under /live/play
but this is a conflict with actually calling /live/play
which is akin to hitting the play button. It'll easily cause confusion when two operations share the same call path. There should be some /live/play/status
or /live/status/[play, record, etc]
calls instead to avoid confusion.
I'm open to input on how the API should be reorganized, but I'm not sure if @stufisher will accept it in the end.
This should probably live in TransportComponent, where the listener is :) I am reading, just not had a lot of time to respond yet, sorry!
Urgh the subject slot is not assigned a target. TransportComponet needs:
self. _on_playing_changed.subject = s
at the top
Ah, so that's how it works!
I've updated my comment, thanks!
Is there a listener or something that can tell us if Live is playing or stopped? In LO2TransportComponent.py, I see this:
@subject_slot('is_playing') def _on_playing_changed(self): self.send('/live/play', self.song().is_playing)
But I am not getting any message from it.