diff options
Diffstat (limited to 'tools/mq_editor/viewer.js')
| -rw-r--r-- | tools/mq_editor/viewer.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tools/mq_editor/viewer.js b/tools/mq_editor/viewer.js index 5065498..e8780e7 100644 --- a/tools/mq_editor/viewer.js +++ b/tools/mq_editor/viewer.js @@ -30,6 +30,9 @@ class SpectrogramViewer { // Tooltip this.tooltip = document.getElementById('tooltip'); + // Partial keep count (Infinity = all kept) + this.keepCount = Infinity; + // Playhead this.playheadTime = -1; // -1 = not playing @@ -59,6 +62,11 @@ class SpectrogramViewer { this.render(); } + setKeepCount(n) { + this.keepCount = n; + this.render(); + } + setFrames(frames) { this.frames = frames; } @@ -216,6 +224,7 @@ class SpectrogramViewer { for (let p = 0; p < partials.length; ++p) { const partial = partials[p]; const color = colors[p % colors.length]; + ctx.globalAlpha = p < this.keepCount ? 1.0 : 0.5; // Draw raw trajectory ctx.strokeStyle = color + '44'; @@ -281,6 +290,8 @@ class SpectrogramViewer { this.drawControlPoint(curve.t3, curve.v3); } } + + ctx.globalAlpha = 1.0; } // Render raw peaks from mq_extract (before partial tracking) |
