pyblock/pybitblock/clock/sound.py
GaltRanch 8e2737251d Add enhanced block clock with 12 new features for Menu A
New clock/ package replaces the old design() polling loop with a
flicker-free ANSI cursor-positioned renderer. Features include:
countdown timer, epoch/halving progress bar, fee rate indicator,
hashrate sparkline, matrix mining animation, odometer digit transition,
heartbeat pulse, zen mode, UTC time display, fireworks on milestone
blocks, generative hash art, and configurable sound modes.

All features are toggleable via Settings → D (Clock Display Settings).

Also fixes hardcoded config paths in menuSelection(), menuSelectionLN(),
and TUI startup to use the cfg singleton instead.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 08:35:59 -03:00

23 lines
556 B
Python

"""Configurable sound notifications for new blocks."""
import sys
import time
def play_sound(mode):
"""Play sound notification based on mode setting.
mode: 'bell' (single beep), 'pattern' (rhythmic), 'silent' (nothing)
"""
if mode == 'silent':
return
elif mode == 'pattern':
# Three short beeps
for _ in range(3):
sys.stdout.write('\a')
sys.stdout.flush()
time.sleep(0.15)
else:
# Default: single bell
sys.stdout.write('\a')
sys.stdout.flush()