Gst-controller queues
From Buzztard
Currently we have the timeline object that walks over the sequence and keeps the current pattern for each track. With each tick it pushes the control changes in the machines that are associated with the track.
Now we switch to the gst-ontroller api, where we have to prebuild queues with control changes. That means that whenever pattern-data changes the respective part of the queue needs to be changed.
The question is where does this methods needs to go to?
Contents |
[edit] Version 1
- The pattern can emit a 'pattern-changed' signal
- The the timelinetrack listens to it and likewise emits a timeline-changed signal
- the timeline does that too
- The sequence just listens to it and updates all the controller queues for the machines that are affected.
The disadvantage is that each signal handler needs to enclose the received data.
[edit] Version 2
- The pattern emits 'global-event-changed' and 'voice-event-changed' messages
- The sequence needs a way to subscribe to these signals
- ...
[edit] Version 3
Think of the sequence as a bitmap; y is the ticks, x is the machines with their parameters. That is each machine param has a pixel. Whenever something changes the region gets invalidated. The damage manager needs to check if there was something 'below' and if that was covered by pixels in the changed region to restore it.
The operation can be subdivided into two steps:
- 1 determining the damage
- 2 repairing the damage
[edit] determining the damage
What changes can happen?
- pattern events
- A new value is endered in the pattern
- A value changes
- A value get cleared
- A series of values changes (pasting a copy in)
- resolv that into trivial pattern changes?
- sequence events
- A pattern is added to a sequence position
- A pattern is removed from a sequence position
- machine events
- A pattern is deleted (all occurences in the sequence are to be removed)
If a sequence event occurs, the whole area of the pattern is damaged. If the pattern is interrupted by another pattern, then only the part before gets damaged.
If a pattern event occurs this produces a local damage that needs to be converted into a global damage by the sequence. This conversion includes finding all positions the pattern is used and marking the regions as damaged it would play. One need to take into accound here that other pattern can shadow that pattern that signal the change. So for each occurance that damage region can have a different length.
When the calculation of the global damage region is done, patterns that are meant to be removed should be removed before doing the repair step. In-fact they can be removed after we know the positions. Unfortunately we can't remove them, but we can mark them as invalid.
[edit] repairing the damage
To repair a damaged region for each tick line we need to determine which pattern play there. Here we need to skip patterns marked for deletion and take into accound that patterns can shadow each other. For each parameter we need to evaluate all tracks that to the machine of the pattern from left-to-right. The rightmost change goes into the controller queue.
[edit] implementing the changes
[edit] remove timelinetracktype
The pattern-commands can be simulated in 1-tick patterns, which every machine would have. Therefore we need to add the (internal) feature to change the machine state from patterns.
- Stop (break): an empty one tick pattern (which also sets machine-state to normal)
- Mute: setting the machine state to mute
- Thru: setting the machine state to bypass
Further we have a three pattern_factory methods that generate us those patterns.
These pattern need to be protected from the pattern editor (unselectable and therefore undeletable, unrenameable, ...).
[edit] Data layout
The sequence is a grid of n timelines and m tracks. Each Pattern knows to which machine it belongs.
It might make sense to change that collaboration of the data-model classes.
[edit] Current data layout
Sequence
n Timelines
m TimelineTracks
Pattern or Event (Stop, Mute, ...)
Here we have to go over all timelines and check the tracks that are associated with the machine the changed pattern belongs to.
[edit] (New) data layout
Sequence
m Tracks
n Timelines
Pattern or Event (Stop, Mute, ...)
With the new layout each Track could update itself. Or better all tracks that are associated with the machine the changed pattern belongs to.



