Skip to content

Commit

Permalink
Merge branch 'bug-fixes'
Browse files Browse the repository at this point in the history
* bug-fixes:
  ui/b/trackview.js: fix scale rounding that caused extra UI flicker
  README.md: link to Roadmap Discussions Feedback & Ideas: #52
  ase/combo.cc: fix combo insertion order for devices inserted at end
	Fixes #24.

Signed-off-by: Tim Janik <[email protected]>
  • Loading branch information
tim-janik committed Feb 21, 2024
2 parents 82fad16 + 0bf5c79 commit 7ebcb3e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ and run it.

<!-- ROADMAP -->
## Roadmap
Roadmap Discussions: Feedback & Ideas: [#52](https://github.com/tim-janik/anklang/issues/52)

☑ Implement the application core in C++20 and the GUI as a web front-end, utilizing web browsers or Electron

Expand Down
2 changes: 2 additions & 0 deletions ase/combo.cc
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ void
AudioCombo::insert (AudioProcessorP proc, ssize_t pos)
{
assert_return (proc != nullptr);
if (pos == -1)
pos = processors_.size(); // insert at the end of the chain
const size_t index = CLAMP (pos, 0, processors_.size());
processors_.insert (processors_.begin() + index, proc);
// fixup following connections
Expand Down
5 changes: 2 additions & 3 deletions ui/b/trackview.js
Original file line number Diff line number Diff line change
Expand Up @@ -308,21 +308,20 @@ class BTrackView extends LitComponent {
return;
}
const tw = 2; // tip thickness in pixels
const pxrs_round = (fraction) => Math.round (fraction / pxrs) * pxrs; // scale up, round to pixel, scale down
// handle multiple channels
const per_channel = (dbspl, dbtip, covertip, covermid) => {
// map dB SPL to a 0..1 paint range
const tip = (dbtip - MINDB) * DIV_DBRANGE;
const lev = (dbspl - MINDB) * DIV_DBRANGE;
// scale covertip from 100% down to just the amount above the tip
let transform = 'scaleX(' + pxrs_round (1 - tip) + ')';
let transform = 'scaleX(' + (1 - tip) + ')';
if (transform !== covertip.style.getPropertyValue ('transform')) // reduce style recalculations
covertip.style.setProperty ('transform', transform);
// scale and translate middle cover
if (lev + pxrs + tw * pxrs <= tip) {
const width = (tip - lev) - tw * pxrs;
const trnlx = level_width - level_width * tip + tw; // translate left in pixels
transform = 'translateX(-' + Math.round (trnlx) + 'px) scaleX(' + pxrs_round (width) + ')';
transform = 'translateX(-' + trnlx + 'px) scaleX(' + width + ')';
} else {
// hide covermid if level and tip are aligned
transform = 'scaleX(0)';
Expand Down

0 comments on commit 7ebcb3e

Please sign in to comment.