Skip to content

Commit deb22cc

Browse files
committed
Add Client.uuid property
1 parent c9af2df commit deb22cc

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

jack_build.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,10 @@
240240
jack_midi_data_t* jack_midi_event_reserve(void* port_buffer, jack_nframes_t time, size_t data_size);
241241
int jack_midi_event_write(void* port_buffer, jack_nframes_t time, const jack_midi_data_t* data, size_t data_size);
242242
uint32_t jack_midi_get_lost_event_count(void* port_buffer);
243+
244+
/* session.h */
245+
246+
char* jack_client_get_uuid(jack_client_t* client);
243247
""")
244248

245249
# Packed structure

src/jack.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,14 @@ def name(self):
148148
"""The name of the JACK client (read-only)."""
149149
return _decode(_lib.jack_get_client_name(self._ptr))
150150

151+
@property
152+
def uuid(self):
153+
"""The UUID of the JACK client (read-only)."""
154+
uuid = _ffi.gc(_lib.jack_client_get_uuid(self._ptr), _lib.jack_free)
155+
if not uuid:
156+
raise JackError('Unable to get UUID')
157+
return _ffi.string(uuid).decode()
158+
151159
@property
152160
def samplerate(self):
153161
"""The sample rate of the JACK system (read-only)."""

0 commit comments

Comments
 (0)