From a8eb50d96f50ae20033ccc05094caaedbae81936 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Sat, 7 Mar 2020 14:10:43 -0500 Subject: Use dependency injection for getAudioUri implementation --- ext/bg/js/settings/audio.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'ext/bg/js/settings') diff --git a/ext/bg/js/settings/audio.js b/ext/bg/js/settings/audio.js index 87ce1ffb..6f581d9b 100644 --- a/ext/bg/js/settings/audio.js +++ b/ext/bg/js/settings/audio.js @@ -16,14 +16,19 @@ * along with this program. If not, see . */ -/*global getOptionsContext, getOptionsMutable, settingsSaveOptions +/*global getOptionsContext, getOptionsMutable, settingsSaveOptions, apiAudioGetUrl AudioSystem, AudioSourceUI*/ let audioSourceUI = null; let audioSystem = null; async function audioSettingsInitialize() { - audioSystem = new AudioSystem(); + audioSystem = new AudioSystem({ + getAudioUri: async (definition, source) => { + const optionsContext = getOptionsContext(); + return await apiAudioGetUrl(definition, source, optionsContext); + } + }); const optionsContext = getOptionsContext(); const options = await getOptionsMutable(optionsContext); -- cgit v1.2.3