Update python bindings to include is_running.
authorJuho Vähä-Herttua <juhovh@iki.fi>
Wed, 28 Mar 2012 20:49:52 +0000 (23:49 +0300)
committerJuho Vähä-Herttua <juhovh@iki.fi>
Wed, 16 May 2012 21:33:32 +0000 (00:33 +0300)
src/bindings/python/Shairplay.py

index 15afc540c49917351c35924bb1bed94cfaec9cda..04dbb37c4952046e5b978d44810e86cffdaab84a 100644 (file)
@@ -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))