mirror of
https://github.com/zarzet/SpotiFLAC-Mobile.git
synced 2026-10-04 15:16:58 +02:00
fix(lyrics): lift timed words together
This commit is contained in:
1 parent
fe88048db2
commit
1d3f7a0d44
4 files changed
+32
-74
No files matched your search
@@ -3551,15 +3551,11 @@ void main() {
|
||||
final bounds = tester.getRect(paintFinder);
|
||||
await seek(1300);
|
||||
final letters = await paintedHeights(firstWordLetters: true);
|
||||
if (reducedMotion) {
|
||||
expect(letters.$1, letters.$2);
|
||||
} else {
|
||||
expect(
|
||||
letters.$1,
|
||||
lessThan(letters.$2),
|
||||
reason: 'Letters in one timed word must not rise as a block',
|
||||
);
|
||||
}
|
||||
expect(
|
||||
letters.$1,
|
||||
letters.$2,
|
||||
reason: 'Letters in one timed word must rise together',
|
||||
);
|
||||
final firstEnded = await seek(1900);
|
||||
expect(firstEnded.$2, pending.$2);
|
||||
if (reducedMotion) {
|
||||
|
||||
@@ -99,31 +99,6 @@ void main() {
|
||||
expect(liftAt(1200, end: 500), 0);
|
||||
});
|
||||
|
||||
test('graphemes rise in sweep order and converge after the word', () {
|
||||
double glyph(int time, double offset) => syncedLyricSegmentLift(
|
||||
position: Duration(milliseconds: time),
|
||||
start: const Duration(seconds: 1),
|
||||
end: const Duration(milliseconds: 1500),
|
||||
progressOffset: offset,
|
||||
);
|
||||
expect(glyph(1300, 0), greaterThan(glyph(1300, 0.33)));
|
||||
expect(glyph(1300, 0.33), greaterThan(glyph(1300, 0.66)));
|
||||
expect(glyph(1500, 0.75), lessThan(1));
|
||||
expect(glyph(2100, 0), 1);
|
||||
expect(glyph(2100, 0.75), 1);
|
||||
for (var time = 800; time < 2100; time += 16) {
|
||||
final change = glyph(time + 16, 0.75) - glyph(time, 0.75);
|
||||
expect(change, inInclusiveRange(0, 0.034));
|
||||
}
|
||||
final held = syncedLyricSegmentLift(
|
||||
position: const Duration(milliseconds: 5500),
|
||||
start: const Duration(seconds: 3),
|
||||
end: const Duration(seconds: 6),
|
||||
progressOffset: 0.75,
|
||||
);
|
||||
expect(held, greaterThan(1));
|
||||
});
|
||||
|
||||
test('interpolates position only while playback is advancing', () {
|
||||
expect(
|
||||
interpolatedSyncedLyricsPosition(
|
||||
|
||||
Reference in new issue
Block a user