move music temporarily back to tcp thread, need to find a way to keep bass from locking up the gui thread

This commit is contained in:
cidoku 2026-02-09 03:46:02 -03:00
parent 8a235c26d4
commit 62a614e435
2 changed files with 3 additions and 2 deletions

View File

@ -4295,8 +4295,8 @@ class GUI(QtGui.QWidget):
elif ini.read_ini_bool("AO2XP.ini", "General", "download music", True):
if musl.startswith("http"):
self.music = audio.loadURLHandle(mus, 0, BASS_SAMPLE_LOOP)
print "[audio] Trying to play", mus
self.music = audio.loadURLHandle(mus, 0, BASS_SAMPLE_LOOP)
else:
global bucket
mus = musl = bucket + 'base/sounds/music/' + musl.replace(" ", "%20")
@ -4819,7 +4819,6 @@ class GUI(QtGui.QWidget):
self.ICLog.append(timestamp + '%s changed the music to %s' % (name, music))
else:
self.ICLog.append(timestamp + 'The music was changed to %s' % music)
self.playMusic(music)
def onModCallReceived(self, reason):
if self.sndModCall:

View File

@ -120,6 +120,8 @@ def handlePackets(caller, total, record=True):
charid = int(network[1])
showname = decodeAOString(network[2].decode("utf-8")) if len(network) > 2 else None
caller.playMusicRequested.emit(music, charid, showname)
# TODO: TEMPORARY, TRYING TO FIND A WAY TO GET THIS OUT OF HERE WITHOUT FREEZING THE GUI THREAD
caller.parent.playMusic(music)
elif header == 'BN':
caller.newBackground.emit(network[1].lower(), True)