|
|
@@ -3,8 +3,21 @@
|
|
|
|
|
|
import re
|
|
|
import jack
|
|
|
+import datetime
|
|
|
+import ioex.shell
|
|
|
from gi.repository import GLib
|
|
|
|
|
|
+def log(message, color = ioex.shell.TextColor.default):
|
|
|
+ print(''.join([
|
|
|
+ color,
|
|
|
+ ioex.shell.Formatting.dim,
|
|
|
+ str(datetime.datetime.now()),
|
|
|
+ ': ',
|
|
|
+ ioex.shell.Formatting.reset_dim,
|
|
|
+ message,
|
|
|
+ ioex.shell.TextColor.default,
|
|
|
+ ]))
|
|
|
+
|
|
|
class PortEventType:
|
|
|
preexisting = 'preexisting'
|
|
|
registered = 'registered'
|
|
|
@@ -49,6 +62,7 @@ class PortConnectInstruction(Instruction):
|
|
|
pass
|
|
|
|
|
|
def check_port(client, port, event, instructions, rename = True):
|
|
|
+ log("port '%s' %s" % (port.get_name(), event))
|
|
|
for client_pattern in instructions:
|
|
|
if re.match(client_pattern, port.get_client_name()):
|
|
|
for port_pattern in instructions[client_pattern]:
|