summaryrefslogtreecommitdiff
path: root/tools/timeline_editor/timeline-playback.js
diff options
context:
space:
mode:
authorskal <pascal.massimino@gmail.com>2026-02-15 15:18:42 +0100
committerskal <pascal.massimino@gmail.com>2026-02-15 15:18:42 +0100
commit8f520cea6c561fdb067a224b552875de0d7d7ef4 (patch)
treef41ae4aba1838e3a182636224588bf8aff36e0db /tools/timeline_editor/timeline-playback.js
parent5a70c496b8cc635735a95961aeacb6d82937dc63 (diff)
refactor(timeline-editor): complete variable unit renames in modules
- newPixelsPerSecond → newPixelsPerBeat - maxTime → maxTimeBeats (in waveform render) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Diffstat (limited to 'tools/timeline_editor/timeline-playback.js')
-rw-r--r--tools/timeline_editor/timeline-playback.js14
1 files changed, 7 insertions, 7 deletions
diff --git a/tools/timeline_editor/timeline-playback.js b/tools/timeline_editor/timeline-playback.js
index 5427499..8c84877 100644
--- a/tools/timeline_editor/timeline-playback.js
+++ b/tools/timeline_editor/timeline-playback.js
@@ -108,19 +108,19 @@ export class PlaybackController {
const canvas = this.dom.waveformCanvas;
const ctx = canvas.getContext('2d');
- // Calculate maxTime same as timeline
- let maxTime = 60;
+ // Calculate maxTimeBeats same as timeline
+ let maxTimeBeats = 60;
for (const seq of this.state.sequences) {
- maxTime = Math.max(maxTime, seq.startTime + this.SEQUENCE_DEFAULT_DURATION);
+ maxTimeBeats = Math.max(maxTimeBeats, seq.startTime + this.SEQUENCE_DEFAULT_DURATION);
for (const effect of seq.effects) {
- maxTime = Math.max(maxTime, seq.startTime + effect.endTime);
+ maxTimeBeats = Math.max(maxTimeBeats, seq.startTime + effect.endTime);
}
}
if (this.state.audioDurationSeconds > 0) {
- maxTime = Math.max(maxTime, this.state.audioDurationSeconds * this.state.beatsPerSecond);
+ maxTimeBeats = Math.max(maxTimeBeats, this.state.audioDurationSeconds * this.state.beatsPerSecond);
}
- const w = maxTime * this.state.pixelsPerBeat;
+ const w = maxTimeBeats * this.state.pixelsPerBeat;
const h = 80;
canvas.width = w;
canvas.height = h;
@@ -170,7 +170,7 @@ export class PlaybackController {
// Beat markers
ctx.strokeStyle = 'rgba(255, 255, 255, 0.15)';
ctx.lineWidth = 1;
- for (let beat = 0; beat <= maxTime; beat++) {
+ for (let beat = 0; beat <= maxTimeBeats; beat++) {
const x = beat * this.state.pixelsPerBeat;
ctx.beginPath();
ctx.moveTo(x, 0);