Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐞Arrangement doesn't pass playlist items to Track properly #49

Closed
demberto opened this issue Sep 18, 2022 · 0 comments
Closed

🐞Arrangement doesn't pass playlist items to Track properly #49

demberto opened this issue Sep 18, 2022 · 0 comments
Assignees
Labels
arrangement-playlist Channel and Pattern playlist items arrangement-track bug Something isn't working
Milestone

Comments

@demberto
Copy link
Owner

This issue might be related to #48. But unlike IterProp properties, Track instances are passed the playlist items they contain from their parent Arrangement.

  1. Arrangement.tracks gathers items from the singular playlist event (there's only one such event per arrangement)

    PyFLP/pyflp/arrangement.py

    Lines 428 to 438 in f2bd7a0

    if ArrangementID.Playlist in self._events:
    pl_event = cast(PlaylistEvent, self._events[ArrangementID.Playlist][0])
    for events in self._collect_events(TrackID):
    items: list[_PlaylistItemStruct] = []
    if pl_event is not None:
    for item in pl_event.items:
    idx = item["track_index"]
    if max_idx - idx == count:
    items.append(cast(_PlaylistItemStruct, item))
    yield Track(*events, items=items)

  2. Track receives it:

    PyFLP/pyflp/arrangement.py

    Lines 295 to 302 in f2bd7a0

    class Track(MultiEventModel, Iterable[PlaylistItemBase], SupportsIndex):
    """Represents a track in an arrangement on which playlist items are arranged.
    ![](https://bit.ly/3de6R8y)
    """
    def __init__(self, *events: AnyEvent, **kw: Unpack[_TrackKW]):
    super().__init__(*events, **kw)

    PyFLP/pyflp/arrangement.py

    Lines 280 to 281 in f2bd7a0

    class _TrackKW(TypedDict):
    items: list[_PlaylistItemStruct]

  3. There goes Track.items:

    PyFLP/pyflp/arrangement.py

    Lines 352 to 353 in f2bd7a0

    items = KWProp[List[PlaylistItemBase]]()
    """Playlist items present on the track."""

@demberto demberto added the bug Something isn't working label Sep 18, 2022
@demberto demberto added this to the PyFLP 2.0.0 milestone Sep 18, 2022
@demberto demberto self-assigned this Sep 18, 2022
@demberto demberto added arrangement-track arrangement-playlist Channel and Pattern playlist items labels Oct 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arrangement-playlist Channel and Pattern playlist items arrangement-track bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant