mirror of
https://github.com/brmlab/ledbar.git
synced 2025-06-09 13:24:01 +02:00
equalizer.py: Rename slow (-s) to lazy (-l)
This commit is contained in:
parent
f09d69a6b3
commit
5daf750786
1 changed files with 8 additions and 8 deletions
|
@ -19,7 +19,7 @@ RATE = 44100
|
||||||
|
|
||||||
PIXELS = 20
|
PIXELS = 20
|
||||||
|
|
||||||
SLOW = 0
|
LAZY = 0
|
||||||
HISTORY_SIZE = 4
|
HISTORY_SIZE = 4
|
||||||
MIN_FREQ = 50
|
MIN_FREQ = 50
|
||||||
MAX_FREQ = 12000
|
MAX_FREQ = 12000
|
||||||
|
@ -28,15 +28,15 @@ MAX_FREQ = 12000
|
||||||
def print_usage():
|
def print_usage():
|
||||||
print '''\
|
print '''\
|
||||||
USAGE:
|
USAGE:
|
||||||
%s [-n number] [-h]
|
%s [-l] [-n number] [-h]
|
||||||
OPTIONS:
|
OPTIONS:
|
||||||
|
-l lazy mode
|
||||||
-n number number of controlled boxes
|
-n number number of controlled boxes
|
||||||
-s slow mode
|
|
||||||
-h --help show this help
|
-h --help show this help
|
||||||
''' % sys.argv[0]
|
''' % sys.argv[0]
|
||||||
|
|
||||||
try:
|
try:
|
||||||
opts, args = getopt.getopt(sys.argv[1:], 'n:sh', ['help'])
|
opts, args = getopt.getopt(sys.argv[1:], 'n:lh', ['help'])
|
||||||
except getopt.GetOptError:
|
except getopt.GetOptError:
|
||||||
print_usage()
|
print_usage()
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
@ -49,13 +49,13 @@ for k, v in opts:
|
||||||
print_usage()
|
print_usage()
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
PIXELS = int(v)
|
PIXELS = int(v)
|
||||||
elif k == '-s':
|
elif k == '-l':
|
||||||
SLOW = 1
|
LAZY = 1
|
||||||
elif k == '-h' or k == '--help':
|
elif k == '-h' or k == '--help':
|
||||||
print_usage()
|
print_usage()
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
if SLOW == 1:
|
if LAZY == 1:
|
||||||
HISTORY_SIZE = 12
|
HISTORY_SIZE = 12
|
||||||
|
|
||||||
SAMPLE_SIZE = CHUNK_SIZE*HISTORY_SIZE
|
SAMPLE_SIZE = CHUNK_SIZE*HISTORY_SIZE
|
||||||
|
@ -77,7 +77,7 @@ def get_color(volume):
|
||||||
# Monochromatic mode:
|
# Monochromatic mode:
|
||||||
# p = p * p * p * p * p * p * p
|
# p = p * p * p * p * p * p * p
|
||||||
# return (0, p/4, p) # or any other combination
|
# return (0, p/4, p) # or any other combination
|
||||||
if SLOW == 1:
|
if LAZY == 1:
|
||||||
p *= p
|
p *= p
|
||||||
else:
|
else:
|
||||||
p *= p * p
|
p *= p * p
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue