busy channel count

This commit is contained in:
Frank DeMarco 2015-08-15 03:36:56 -04:00
parent 1fcfbb3211
commit 3a937ddc96
1 changed files with 7 additions and 0 deletions

View File

@ -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