summaryrefslogtreecommitdiff
path: root/ext/bg/js/settings/audio.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-03-07 14:10:43 -0500
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-03-07 21:43:51 -0500
commita8eb50d96f50ae20033ccc05094caaedbae81936 (patch)
tree21e603c0a8986301dab7d3ad0522153de232ed0a /ext/bg/js/settings/audio.js
parent75eac153d625c54892a6f7194d0cfa4160ffe722 (diff)
Use dependency injection for getAudioUri implementation
Diffstat (limited to 'ext/bg/js/settings/audio.js')
-rw-r--r--ext/bg/js/settings/audio.js9
1 files changed, 7 insertions, 2 deletions
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 <https://www.gnu.org/licenses/>.
*/
-/*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);