1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
//! Placement of a [`crate::core::daw::track::Track`] on a sub-song's
//! timeline. Clips never overlap on the same `(song,
//! target_channel)`: the player's state machine assumes one voice
//! per physical channel at a time.
use ;
use crateTrack;
use crateModule;
/// One placement of a [`Track`] on the timeline of a sub-song.
///
/// A `Clip` says "play `Module.tracks[track]` on physical channel
/// `target_channel` of sub-song `song`, starting at absolute tick
/// `position_tick`, until `end_tick`". The same Track can appear
/// in multiple clips — the runtime resolves the cell to play at
/// each tick by looking up the active clip via
/// [`crate::core::daw::sorted_clips::SortedClips::active_at`].
///
/// Clips on the same `(song, target_channel)` never overlap: the
/// player's state machine assumes one voice per physical channel
/// at a time. The DAW build pipeline + edit API maintain this
/// invariant (see `verify_layers_consistent`).
///
/// `position_tick`, `track_row_offset` and `source_start_row`
/// together encode the mid-pattern entry that a `PatternBreak` can
/// produce: when an `Fxx` jumps into a pattern at row `R`, the
/// matching segment of the source pattern may have started earlier
/// (at row `source_start_row < R`), and the clip enters that
/// segment at offset `R - source_start_row` (= `track_row_offset`).