From: Juho Vähä-Herttua Date: Wed, 28 Mar 2012 20:49:52 +0000 (+0300) Subject: Update python bindings to include is_running. X-Git-Tag: upstream/0.9.0~4^2~83 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=2528f9b052f25e89171307ab3e0b9503b8905ae6;p=deb_shairplay.git Update python bindings to include is_running. --- 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))