Skip to content

Commit

Permalink
IDE: settings: for stereo boards show left and right instead of 0 and 1
Browse files Browse the repository at this point in the history
  • Loading branch information
giuliomoro committed Nov 3, 2021
1 parent 0d8e8aa commit b97516f
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 4 deletions.
20 changes: 18 additions & 2 deletions IDE/frontend-dev/src/Views/SettingsView.js
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,9 @@ class SettingsView extends View {
excLabel = 'Bela';
}
exceptions['sections'] = settingExceptions[excLabel]['sections'];
var ioSubsecExcepts = excludeInputSubsecs(settingExceptions[excLabel].inputsWithGain).concat(excludeHpSubsecs(settingExceptions[excLabel].headphones));
var inputsWithGain = settingExceptions[excLabel].inputsWithGain;
var headphones = settingExceptions[excLabel].headphones;
var ioSubsecExcepts = excludeInputSubsecs(inputsWithGain).concat(excludeHpSubsecs(headphones));
exceptions['subsections'] = settingExceptions[excLabel]['subsections'].concat(ioSubsecExcepts);
exceptions['options'] = settingExceptions[excLabel]['options'];

Expand All @@ -447,7 +449,21 @@ class SettingsView extends View {
}
}
}

function replaceDataSettings(value, find, replace) {
var tags = $('[data-settings="' + value + '"]>td.left-choice');
if (tags.length) {
var tag = tags[0];
tag.innerHTML = tag.innerHTML.replace(find, replace);
}
}
if (2 === settingExceptions[excLabel].inputsWithGain) {
replaceDataSettings('input-level0', '0', 'Left');
replaceDataSettings('input-level1', '1', 'Right');
}
if (2 === settingExceptions[excLabel].headphones) {
replaceDataSettings('headphone-level0', '0', 'Left');
replaceDataSettings('headphone-level1', '1', 'Right');
}
for(var e in exceptions['options']) {
var opts = $('#'+exceptions['options'][e].selector).children("option");
var exceptOpts = exceptions['options'][e].optVal;
Expand Down
20 changes: 18 additions & 2 deletions IDE/public/js/bundle.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b97516f

Please sign in to comment.