mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 02:15:43 -04:00
reset midi before playing new song
This commit is contained in:
parent
da7257d5a1
commit
bc1b8e9e2a
@ -512,6 +512,7 @@ class ShowBase:
|
|||||||
self.musicManagerIsValid=self.musicManager!=None \
|
self.musicManagerIsValid=self.musicManager!=None \
|
||||||
and self.musicManager.isValid()
|
and self.musicManager.isValid()
|
||||||
if self.musicManagerIsValid:
|
if self.musicManagerIsValid:
|
||||||
|
self.musicManager.setMutuallyExclusive(1) # ensure only 1 midi song is playing at a time
|
||||||
self.musicManager.setActive(self.musicActive)
|
self.musicManager.setActive(self.musicActive)
|
||||||
|
|
||||||
# enableMusic/enableSoundEffects are meant to be called in response to a user request
|
# enableMusic/enableSoundEffects are meant to be called in response to a user request
|
||||||
@ -914,13 +915,14 @@ class ShowBase:
|
|||||||
def screenshot(self, namePrefix='screenshot'):
|
def screenshot(self, namePrefix='screenshot'):
|
||||||
# Get the current date and time to uniquify the image (down to the second)
|
# Get the current date and time to uniquify the image (down to the second)
|
||||||
date = time.ctime(time.time())
|
date = time.ctime(time.time())
|
||||||
# Get the current frame count to uniqify it even more
|
# Get the current frame count to uniquify it even more
|
||||||
frameCount = globalClock.getFrameCount()
|
frameCount = globalClock.getFrameCount()
|
||||||
# Replace spaces with dashes because unix does not like spaces in the filename
|
# Replace spaces with dashes because unix does not like spaces in the filename
|
||||||
date = date.replace(' ', '-')
|
date = date.replace(' ', '-')
|
||||||
date = date.replace(':', '-')
|
date = date.replace(':', '-')
|
||||||
imageName = ('%s-%s-%d.%s' % (namePrefix, date, frameCount, self.screenshotExtension))
|
imageName = ('%s-%s-%d.%s' % (namePrefix, date, frameCount, self.screenshotExtension))
|
||||||
self.notify.info("Taking screenshot: " + imageName)
|
self.notify.info("Taking screenshot: " + imageName)
|
||||||
|
|
||||||
takeSnapshot(self.win, imageName)
|
takeSnapshot(self.win, imageName)
|
||||||
# Announce to anybody that a screenshot has been taken
|
# Announce to anybody that a screenshot has been taken
|
||||||
messenger.send('screenshot')
|
messenger.send('screenshot')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user