Last active
November 8, 2019 01:33
-
-
Save SpotlightKid/dc70dac006337c99bf65bcdc98e43ddc to your computer and use it in GitHub Desktop.
Listen to and print JACK client/port meta-data changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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