From 2528f9b052f25e89171307ab3e0b9503b8905ae6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Juho=20V=C3=A4h=C3=A4-Herttua?= Date: Wed, 28 Mar 2012 23:49:52 +0300 Subject: [PATCH] Update python bindings to include is_running. --- src/bindings/python/Shairplay.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/bindings/python/Shairplay.py b/src/bindings/python/Shairplay.py index 15afc54..04dbb37 100644 --- a/src/bindings/python/Shairplay.py +++ b/src/bindings/python/Shairplay.py @@ -60,6 +60,8 @@ def InitShairplay(libshairplay): # Initialize raop related functions libshairplay.raop_init.restype = c_void_p libshairplay.raop_init.argtypes = [POINTER(RaopNativeCallbacks), c_char_p] + libshairplay.raop_is_running.restype = c_int + libshairplay.raop_is_running.argtypes = [c_void_p] libshairplay.raop_start.restype = c_int libshairplay.raop_start.argtypes = [c_void_p, POINTER(c_ushort), POINTER(c_char), c_int, c_char_p] libshairplay.raop_stop.restype = None @@ -181,6 +183,12 @@ class RaopService: self.libshairplay.raop_destroy(self.instance) self.instance = None + def is_running(self): + if self.libshairplay.raop_is_running(self.instance): + return True + else: + return False + def start(self, port, hwaddrstr, password=None): port = c_ushort(port) hwaddr = create_string_buffer(hwaddrstr, len(hwaddrstr)) -- 2.34.1