Files
mkcontrol-app/config.py
T
2026-10-05 11:33:37 +02:00

36 lines
1.5 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# config.py – zentral, im Projekt-Root
import os
class Config:
SECRET_KEY = os.environ.get('SECRET_KEY') or 'dev-key-change-me'
# Basisverzeichnis des Projekts (absolut, robust gegen anderes CWD)
BASE_DIR = os.path.abspath(os.path.dirname(__file__))
# Alle Pfade absolut auf Basis des Projekt-Roots
CONFIG_DIR = os.path.join(BASE_DIR, 'configs')
LOG_DIR = os.path.join(BASE_DIR, 'logs')
SOUNDS_DIR = os.path.join(BASE_DIR, 'sounds')
SOUNDBOARD_CONFIG_DIR = os.path.join(BASE_DIR, 'soundboards')
DEFAULT_THEME_FILE = os.path.join(SOUNDBOARD_CONFIG_DIR, 'default_theme.txt')
# Audio-Parameter (für pygame.mixer)
AUDIO_FREQ = 44100
AUDIO_SIZE = -16
AUDIO_CHANNELS = 2
AUDIO_BUFFER = 2048 # größerer Buffer reduziert Knacksen
AUDIO_NUM_CHANNELS = 16
# ALSA/SDL-Gerät, z. B. "default", "plughw:CARD=PCM5102,DEV=0"
# oder ein in /etc/asound.conf definiertes Gerät. Leer = SDL-Standard.
AUDIO_DEVICE = os.environ.get('MKCONTROL_AUDIO_DEVICE') or None
AUDIO_REQUIRED = os.environ.get('MKCONTROL_AUDIO_REQUIRED', 'false').lower() in ('1', 'true', 'yes')
# Optional: absolute Pfade, falls du später Docker o.ä. nutzt
# CONFIG_DIR = os.path.join(os.path.dirname(__file__), 'configs')
APP_NAME = "Mini-World Control Center"
APP_NAME_SHORT = "MWCC" # für Tab-Titel, wenns kurz sein soll
APP_VERSION = "0.9.β"
APP_DESCRIPTION = "Websteuerung für MouldKing MK4/MK6-Hubs mit Soundboard und Aktorensteuerung"