From bc8627254c0cc82fed309064114a6f30a01bea6d Mon Sep 17 00:00:00 2001 From: Tastyfish Date: Mon, 9 Nov 2015 21:57:24 -0500 Subject: [PATCH] Fixed Setting volume for media machines, as well as them updating for mobs in room --- code/__HELPERS/game.dm | 2 ++ code/modules/media/mediamanager.dm | 19 +++---------------- 2 files changed, 5 insertions(+), 16 deletions(-) diff --git a/code/__HELPERS/game.dm b/code/__HELPERS/game.dm index cb1f986b69d..0d51ed39ec1 100644 --- a/code/__HELPERS/game.dm +++ b/code/__HELPERS/game.dm @@ -16,6 +16,8 @@ return A /proc/get_area(O) + if(isarea(O)) + return O var/turf/loc = get_turf(O) if(loc) var/area/res = loc.loc diff --git a/code/modules/media/mediamanager.dm b/code/modules/media/mediamanager.dm index 9e5aa79fbbe..bf9d6a58c52 100644 --- a/code/modules/media/mediamanager.dm +++ b/code/modules/media/mediamanager.dm @@ -30,26 +30,13 @@ function SetMusic(url, time, volume) { vlc.playlist.playItem(id); vlc.input.time = time*1000; // VLC takes milliseconds. - vlc.audio.volume = volume*100; // \[0-200] + // for whatever reason, VLC plugin requires a delay between playing and setting volume + // also scaling it log-wise so that it's a more useful range + setTimeout(function() { vlc.audio.volume = Math.log(volume) / Math.LN10 * 50 }, 100); // volume ranges from 0-200 } "} -/* OLD, DO NOT USE. CONTROLS.CURRENTPOSITION IS BROKEN. -var/const/PLAYER_HTML={" - - "} -*/ - // Hook into the events we desire. /hook_handler/soundmanager // Set up player on login