mirror of
https://github.com/zarzet/SpotiFLAC-Mobile.git
synced 2026-09-30 21:29:36 +02:00
fix(lyrics): smooth highlight lift and keep romanization still
Ease the lift before each highlight and let it settle more gradually for held words. Keep timed pronunciation and translation lines stationary while preserving their color sweep.
This commit is contained in:
1 parent
dbbefdd75d
commit
863d1536dd
5 files changed
+49
-16
No files matched your search
@@ -2572,11 +2572,19 @@ void main() {
|
||||
|
||||
for (final text in ['First second', 'Firsu secondu']) {
|
||||
final singingFirst = await pixelsAt(1100, text);
|
||||
final firstEnded = await pixelsAt(1307, text);
|
||||
final moves = mornye && text == 'First second';
|
||||
final firstEnded = await pixelsAt(moves ? 1600 : 1307, text);
|
||||
expect(firstEnded, isNot(orderedEquals(singingFirst)));
|
||||
if (moves) {
|
||||
expect(
|
||||
await pixelsAt(1307, text),
|
||||
isNot(orderedEquals(firstEnded)),
|
||||
reason: 'Movement trails the finished color sweep',
|
||||
);
|
||||
}
|
||||
expect(await pixelsAt(1800, text), orderedEquals(firstEnded));
|
||||
final singingLast = await pixelsAt(2150, text);
|
||||
final lastEnded = await pixelsAt(2497, text);
|
||||
final lastEnded = await pixelsAt(moves ? 2600 : 2497, text);
|
||||
expect(lastEnded, isNot(orderedEquals(singingLast)));
|
||||
expect(await pixelsAt(2900, text), orderedEquals(lastEnded));
|
||||
expect(await pixelsAt(1100, text), orderedEquals(singingFirst));
|
||||
|
||||
@@ -65,14 +65,16 @@ void main() {
|
||||
expect(liftAt(800), 0);
|
||||
expect(liftAt(950), inExclusiveRange(0, 1));
|
||||
expect(liftAt(1000), greaterThan(liftAt(950)));
|
||||
expect(liftAt(1200), 1);
|
||||
expect(liftAt(1500), 1);
|
||||
expect(liftAt(1000), lessThan(0.2));
|
||||
expect(liftAt(1200), inExclusiveRange(0.4, 0.7));
|
||||
expect(liftAt(1500), lessThan(1));
|
||||
expect(liftAt(1540), 1);
|
||||
expect(liftAt(3000), 1);
|
||||
});
|
||||
|
||||
test('held words rise further then settle to the normal highlight', () {
|
||||
final peak = liftAt(2300, end: 4000);
|
||||
expect(liftAt(1200, end: 4000), 1);
|
||||
expect(liftAt(1200, end: 4000), inExclusiveRange(0.4, 0.7));
|
||||
expect(peak, greaterThan(1));
|
||||
expect(liftAt(3900, end: 4000), inExclusiveRange(1, peak));
|
||||
expect(liftAt(4000, end: 4000), 1);
|
||||
@@ -81,6 +83,17 @@ void main() {
|
||||
expect(liftAt(800, end: 4000), 0);
|
||||
});
|
||||
|
||||
test('short syllables keep the slow rise and trail their color sweep', () {
|
||||
expect(liftAt(1100, end: 1100), lessThan(0.4));
|
||||
expect(liftAt(1200, end: 1100), lessThan(0.7));
|
||||
expect(liftAt(1540, end: 1100), 1);
|
||||
for (var position = 820; position < 1540; position += 16) {
|
||||
final before = liftAt(position, end: 1100);
|
||||
final after = liftAt(position + 16, end: 1100);
|
||||
expect(after - before, inInclusiveRange(0, 0.034));
|
||||
}
|
||||
});
|
||||
|
||||
test('invalid or zero-length timing does not move the text', () {
|
||||
expect(liftAt(1200, end: 1000), 0);
|
||||
expect(liftAt(1200, end: 500), 0);
|
||||
|
||||
Reference in new issue
Block a user