Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Listen to and print JACK client/port meta-data changes.
#!/usr/bin/env python3
"""Listen to and print JACK client/port meta-data changes."""
import jack
PROPERTY_CHANGE_MAP = {
jack.PROPERTY_CREATED: 'created',
jack.PROPERTY_CHANGED: 'changed',
jack.PROPERTY_DELETED: 'deleted'
}
def callback(subject, key, type_):
print("Property '%s' on subject %s %s." % (key, subject, PROPERTY_CHANGE_MAP[type_]))
client = jack.Client('Metadata-Client')
client.set_property_change_callback(callback)
with client:
try:
input("Press enter to quit...\n")
except (EOFError, KeyboardInterrupt):
print('')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.