busy channel count
This commit is contained in:
parent
1fcfbb3211
commit
3a937ddc96
|
@ -2,6 +2,7 @@ from random import randint
|
|||
from math import sin, cos, atan2, radians, sqrt
|
||||
|
||||
from pygame import Surface, PixelArray
|
||||
from pygame.mixer import get_num_channels, Channel
|
||||
from pygame.locals import *
|
||||
|
||||
def get_step(start, end, speed):
|
||||
|
@ -135,3 +136,9 @@ def get_color_swapped_surface(surface, current, replacement):
|
|||
pixels.replace(current, replacement)
|
||||
del pixels
|
||||
return swapped
|
||||
|
||||
def get_busy_channel_count():
|
||||
count = 0
|
||||
for index in xrange(get_num_channels()):
|
||||
count += Channel(index).get_busy()
|
||||
return count
|
||||
|
|
Loading…
Reference in New Issue