Files
VOREStation/code/modules/tgui_panel/audio.dm
Drathek 7c8bb85de3 Whitespace Standardization [MDB IGNORE] (#15748)
* Update settings

* Whitespace changes

* Comment out merger hooks in gitattributes

Corrupt maps would have to be resolved in repo before hooks could be updated

* Revert "Whitespace changes"

This reverts commit afbdd1d844.

* Whitespace again minus example

* Gitignore example changelog

* Restore changelog merge setting

* Keep older dmi hook attribute until hooks can be updated

* update vscode settings too

* Renormalize remaining

* Revert "Gitignore example changelog"

This reverts commit de22ad375d.

* Attempt to normalize example.yml (and another file I guess)

* Try again
2024-02-20 11:28:51 +01:00

43 lines
925 B
Plaintext

/*!
* Copyright (c) 2020 Aleksej Komarov
* SPDX-License-Identifier: MIT
*/
/// Admin music volume, from 0 to 1.
/client/var/admin_music_volume = 1
/**
* public
*
* Sends music data to the browser.
*
* Optional settings:
* - pitch: the playback rate
* - start: the start time of the sound
* - end: when the musics stops playing
*
* required url string Must be an https URL.
* optional extra_data list Optional settings.
*/
/datum/tgui_panel/proc/play_music(url, extra_data)
if(!is_ready())
return
if(!findtext(url, GLOB.is_http_protocol))
return
var/list/payload = list()
if(length(extra_data) > 0)
for(var/key in extra_data)
payload[key] = extra_data[key]
payload["url"] = url
window.send_message("audio/playMusic", payload)
/**
* public
*
* Stops playing music through the browser.
*/
/datum/tgui_panel/proc/stop_music()
if(!is_ready())
return
window.send_message("audio/stopMusic")