summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJose Dapena Paz <jdapena@igalia.com>2022-05-31 17:35:36 +0200
committerJose Dapena Paz <jdapena@igalia.com>2022-05-31 17:39:32 +0200
commit21f1f146d83cec898ef87c7ecc94abd96a9a36ac (patch)
treeac05f5f9169097fabb5a094f3078a6cf4fb4def5
parent24e793a36f1e868761b44ecd43262f671772ff65 (diff)
Adapt to new application framework
Drop usage of agl-js-api, and just provide a mock for audio mixer calls. Bug-AGL: SPEC-4248 Signed-off-by: Jose Dapena Paz <jdapena@igalia.com> Change-Id: Ibf00a11338fe2226b3dc0b53037bb6801675e6c1
-rw-r--r--src/js/agl_stubs_audiomixer.js13
-rw-r--r--src/js/app.js3
-rw-r--r--src/js/sliders.js2
3 files changed, 15 insertions, 3 deletions
diff --git a/src/js/agl_stubs_audiomixer.js b/src/js/agl_stubs_audiomixer.js
new file mode 100644
index 0000000..c5f8d2e
--- /dev/null
+++ b/src/js/agl_stubs_audiomixer.js
@@ -0,0 +1,13 @@
+export function on_volume_changed() {
+}
+
+export function list_controls() {
+ return new Promise((result, reject) => {
+ result([
+ { control: "MAIN", volume: 0.5 }
+ ]);
+ });
+}
+
+export function set_volume() {
+}
diff --git a/src/js/app.js b/src/js/app.js
index a26f137..bfebf1c 100644
--- a/src/js/app.js
+++ b/src/js/app.js
@@ -1,5 +1,5 @@
import Mustache from 'mustache';
-import { audiomixer, api } from 'agl-js-api';
+import * as audiomixer from './agl_stubs_audiomixer';
import { setValue } from './sliders';
var template;
@@ -13,7 +13,6 @@ function render_sliders(sliders) {
}
export function init() {
- api.init();
template = document.getElementById('slider-template').innerHTML;
Mustache.parse(template);
diff --git a/src/js/sliders.js b/src/js/sliders.js
index 7208a85..5b9191c 100644
--- a/src/js/sliders.js
+++ b/src/js/sliders.js
@@ -1,4 +1,4 @@
-import { audiomixer } from 'agl-js-api';
+import * as audiomixer from './agl_stubs_audiomixer';
function getRootNode(node) {
while(!node.hasAttribute('slider-id') && node.parentNode) {