mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 10:21:11 +00:00
Fix doublejuke songs (#26802)
* Maybe fix double juke songs? * Comment out debug * Fix soundsystems
This commit is contained in:
@@ -14,9 +14,10 @@ var/global/media_receivers=list()
|
|||||||
..()
|
..()
|
||||||
connect_frequency()
|
connect_frequency()
|
||||||
|
|
||||||
/obj/machinery/media/receiver/proc/receive_broadcast(var/url="", var/start_time=0)
|
/obj/machinery/media/receiver/proc/receive_broadcast(var/url="", var/start_time=0, var/finish_time=0)
|
||||||
media_url = url
|
media_url = url
|
||||||
media_start_time = start_time
|
media_start_time = start_time
|
||||||
|
media_finish_time = finish_time
|
||||||
update_music()
|
update_music()
|
||||||
|
|
||||||
/obj/machinery/media/receiver/proc/connect_frequency()
|
/obj/machinery/media/receiver/proc/connect_frequency()
|
||||||
|
|||||||
@@ -12,9 +12,10 @@ var/global/media_transmitters=list()
|
|||||||
..()
|
..()
|
||||||
connect_frequency()
|
connect_frequency()
|
||||||
|
|
||||||
/obj/machinery/media/transmitter/proc/broadcast(var/url="", var/start_time=0)
|
/obj/machinery/media/transmitter/proc/broadcast(var/url="", var/start_time=0,var/finish_time=0)
|
||||||
media_url = url
|
media_url = url
|
||||||
media_start_time = start_time
|
media_start_time = start_time
|
||||||
|
media_finish_time = finish_time
|
||||||
update_music()
|
update_music()
|
||||||
|
|
||||||
/obj/machinery/media/transmitter/proc/connect_frequency()
|
/obj/machinery/media/transmitter/proc/connect_frequency()
|
||||||
@@ -32,11 +33,11 @@ var/global/media_transmitters=list()
|
|||||||
if(freq in media_receivers)
|
if(freq in media_receivers)
|
||||||
for(var/obj/machinery/media/receiver/R in media_receivers[freq])
|
for(var/obj/machinery/media/receiver/R in media_receivers[freq])
|
||||||
if(R.media_crypto == media_crypto)
|
if(R.media_crypto == media_crypto)
|
||||||
R.receive_broadcast(media_url,media_start_time)
|
R.receive_broadcast(media_url,media_start_time,media_finish_time)
|
||||||
//testing("[src]: Sending music to [R]")
|
//testing("[src]: Sending music to [R]")
|
||||||
for(var/mob/living/carbon/complex/gondola/radio/G in media_receivers[freq])
|
for(var/mob/living/carbon/complex/gondola/radio/G in media_receivers[freq])
|
||||||
if(G.media_crypto == media_crypto)
|
if(G.media_crypto == media_crypto)
|
||||||
G.receive_broadcast(media_url,media_start_time)
|
G.receive_broadcast(media_url,media_start_time,media_finish_time)
|
||||||
|
|
||||||
/obj/machinery/media/transmitter/proc/disconnect_frequency()
|
/obj/machinery/media/transmitter/proc/disconnect_frequency()
|
||||||
var/list/transmitters=list()
|
var/list/transmitters=list()
|
||||||
|
|||||||
@@ -32,7 +32,7 @@
|
|||||||
// Broadcasting shit
|
// Broadcasting shit
|
||||||
for(var/obj/machinery/media/transmitter/T in hooked)
|
for(var/obj/machinery/media/transmitter/T in hooked)
|
||||||
// testing("[src] Writing media to [T].")
|
// testing("[src] Writing media to [T].")
|
||||||
T.broadcast(media_url,media_start_time)
|
T.broadcast(media_url,media_start_time, media_finish_time)
|
||||||
|
|
||||||
if(exclusive_hook)
|
if(exclusive_hook)
|
||||||
disconnect_media_source() // Just to be sure.
|
disconnect_media_source() // Just to be sure.
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
***********************/
|
***********************/
|
||||||
|
|
||||||
// Uncomment to test the mediaplayer
|
// Uncomment to test the mediaplayer
|
||||||
|
|
||||||
//#define DEBUG_MEDIAPLAYER
|
//#define DEBUG_MEDIAPLAYER
|
||||||
|
|
||||||
// Open up VLC and play musique.
|
// Open up VLC and play musique.
|
||||||
@@ -262,7 +263,9 @@ function SetMusic(url, time, volume) {
|
|||||||
targetURL = M.media_url
|
targetURL = M.media_url
|
||||||
targetStartTime = M.media_start_time
|
targetStartTime = M.media_start_time
|
||||||
targetVolume = M.volume
|
targetVolume = M.volume
|
||||||
if ((targetURL != current_url) && (finish_time > 0) && ((world.time - finish_time) < -10 SECONDS)) // We caught a music. Let's see if we can make a graceful fadeout for the music currently playing. If not, the other music is killed.
|
var/check_samesong = ((targetURL == current_url) && (finish_time != M.media_finish_time))
|
||||||
|
var/check_harsh_skip = ((targetURL != current_url) && (finish_time > 0) && ((world.time - finish_time) < - 10 SECONDS))
|
||||||
|
if (check_samesong || check_harsh_skip) // We caught a music. Let's see if we can make a graceful fadeout for the music currently playing. If not, the other music is killed.
|
||||||
MP_DEBUG("<span class='good'>Should be cutting off music.<span>")
|
MP_DEBUG("<span class='good'>Should be cutting off music.<span>")
|
||||||
stop_music()
|
stop_music()
|
||||||
sleep(0.1 SECONDS) // Have to wait for the media player response.
|
sleep(0.1 SECONDS) // Have to wait for the media player response.
|
||||||
|
|||||||
Reference in New Issue
Block a user