Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions midimaster.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,14 @@
from prompt_toolkit.key_binding import KeyBindings

# --- OSC Imports ---
from pythonosc import dispatcher, osc_server, udp_client
try:
from pythonosc import dispatcher, osc_server, udp_client
_hasOSC = True
except ImportError:
_hasOSC = False
'''
_hasOSC = False
'''

# --- Global Configuration ---
RULES_DIR_NAME = "rules_midimaster"
Expand Down Expand Up @@ -664,7 +671,7 @@ def main():
# Iniciar cliente y servidor OSC si está habilitado
osc_config = main_config.get("osc_configuration", {})
osc_server_object = None
if osc_config.get("enabled"):
if _hasOSC and osc_config.get("enabled"):
send_ip = osc_config.get("send_ip", "127.0.0.1")
send_port = osc_config.get("send_port", 9000)
osc_client = udp_client.SimpleUDPClient(send_ip, send_port)
Expand Down Expand Up @@ -768,4 +775,4 @@ def main():

if __name__ == "__main__":
signal.signal(signal.SIGINT, signal_handler)
main()
main()