Skip to content

Commit

Permalink
Merge pull request #104 from bang-olufsen/development
Browse files Browse the repository at this point in the history
June 2020 Update
  • Loading branch information
tuomashamalainen authored Jul 7, 2020
2 parents e89cf36 + b8232ab commit 9cbc466
Show file tree
Hide file tree
Showing 48 changed files with 4,028 additions and 2,508 deletions.
2 changes: 1 addition & 1 deletion Beocreate2/beo-extensions/channels/menu.html
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ <h2 class="show-when-daisy-chained">Master speaker</h2>
</div>
</div>

<div class="show-when-daisy-chained" id="channels-daisy-chained-container">
<div class="show-when-daisy-chained hidden" id="channels-daisy-chained-container">
<h2>Slave speaker</h2>
<p>Only speaker role can be updated to the slave speaker.</p>
<div class="channels-slave-channel-item">
Expand Down
2 changes: 1 addition & 1 deletion Beocreate2/beo-extensions/daisy-chain/menu.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="menu-screen" id="daisy-chain" data-icon="speaker-pair.svg" data-context="sound/advanced" data-menu-class="advanced-adjustment" data-menu-value-class="daisy-chain-status-text" data-stylesheet="daisy-chain.css" data-menu-title="Chaining" data-built-in="1" data-enable-with="Beocreate 4-Channel Amplifier">
<div class="menu-screen" id="daisy-chain" data-icon="speaker-pair.svg" data-context="sound/advanced" data-menu-class="advanced-adjustment" data-menu-value-class="daisy-chain-status-text" data-stylesheet="daisy-chain.css" data-menu-title="Chaining" data-built-in="1">

<header>
<div class="back-button master"></div>
Expand Down
3 changes: 3 additions & 0 deletions Beocreate2/beo-extensions/daisy-chain/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,8 @@
"url": "https://github.com/bang-olufsen/create/issues"
},
"homepage": "https://github.com/bang-olufsen/create#readme",
"beocreate": {
"enableWith": ["Beocreate 4-Channel Amplifier"]
},
"dependencies": {}
}
42 changes: 30 additions & 12 deletions Beocreate2/beo-extensions/dsp-programs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -705,20 +705,38 @@ var _ = require('underscore');
}

function amplifierMute(mute) {

if (mute) {
if (!settings.noGPIOMute) {
execSync("gpio mode 2 out");
execSync("gpio write 2 1");
if (debug) console.log("Muted amplifier through GPIO.");
beo.bus.emit("dsp", {header: "amplifierMuted"});
if (!settings.noGPIOMute) {
try {
pigpioRunning = !isNaN(execSync("pigs t", {encoding: "utf8"}).trim());
} catch (error) {
console.error("PiGPIO is not running.");
pigpioRunning = false;
}
} else {
if (!settings.noGPIOMute) {
execSync("gpio write 2 0");
execSync("gpio mode 2 in");
if (debug) console.log("Unmuted amplifier through GPIO.");
if (pigpioRunning) {
if (mute) {

try {
//execSync("gpio mode 2 out");
//execSync("gpio write 2 1");
execSync("pigs m 27 w w 27 1");
if (debug) console.log("Muted amplifier through GPIO.");
beo.bus.emit("dsp", {header: "amplifierMuted"});
} catch (error) {
console.error("Could not mute amplifier:", error);
}
} else {
try {
//execSync("gpio write 2 0");
//execSync("gpio mode 2 in");
execSync("pigs w 27 0 m 27 r");
if (debug) console.log("Unmuted amplifier through GPIO.");
} catch (error) {
console.error("Could not unmute amplifier:", error);
}
beo.bus.emit("dsp", {header: "amplifierUnmuted"});
}
}
} else if (!mute) {
beo.bus.emit("dsp", {header: "amplifierUnmuted"});
}
}
Expand Down
2 changes: 1 addition & 1 deletion Beocreate2/beo-extensions/dsp-programs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@beocreate/dsp-programs",
"version": "0.6.2",
"version": "0.6.3",
"description": "DSP program manager for Beocreate sound systems",
"main": "index.js",
"scripts": {
Expand Down
12 changes: 11 additions & 1 deletion Beocreate2/beo-extensions/equaliser/equaliser-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ const mathPI = Math.PI;
$(document).on("equaliser", function(event, data) {

if (data.header == "previews" && data.content.filterResponses) {
if (data.content.Fs) {
Fs = data.content.Fs;
eqPreviewGraphSpeaker.setOptions({Fs: Fs});
eqPreviewGraphSoundDesign.setOptions({Fs: Fs});
eqGraph.setOptions({Fs: Fs});
}
eqPreviewGraphSpeaker.store([0], {data: data.content.filterResponses.a.master, colour: 0});
eqPreviewGraphSpeaker.store([1], {data: data.content.filterResponses.b.master, colour: 1});
eqPreviewGraphSpeaker.store([2], {data: data.content.filterResponses.c.master, colour: 2});
Expand All @@ -86,7 +92,11 @@ $(document).on("equaliser", function(event, data) {

if (data.header == "settings") {

if (data.content.Fs) Fs = data.content.Fs;
if (data.content.Fs) {
Fs = data.content.Fs;
eqGraph.setOptions({Fs: Fs});
}


if (data.content.canControl) canControlEqualiser = data.content.canControl;

Expand Down
3 changes: 2 additions & 1 deletion Beocreate2/beo-extensions/equaliser/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ var _ = beo.underscore;
}

if (event.header == "getPreviews") {
beo.sendToUI("equaliser", {header: "previews", content: {filterResponses: filterResponses}});
beo.sendToUI("equaliser", {header: "previews", content: {filterResponses: filterResponses, Fs: Fs}});
}

if (event.header == "getSettings") {
Expand Down Expand Up @@ -354,6 +354,7 @@ var _ = beo.underscore;
metadata = event.content.metadata;
if (metadata.sampleRate) {
Fs = parseInt(metadata.sampleRate.value[0]);
console.log("Sampling rate of "+Fs+" Hz specified in the DSP program.");
for (var c = 0; c < 4; c++) {
channel = "abcd".charAt(c);
applyAllFiltersFromSettings(channel, true);
Expand Down
Loading

0 comments on commit 9cbc466

Please sign in to comment.