Added the get_playlist method
authorAndre L. V. Loureiro <loureiro.andrew@gmail.com>
Wed, 20 May 2009 06:33:43 +0000 (02:33 -0400)
committerAndre L. V. Loureiro <loureiro.andrew@gmail.com>
Wed, 20 May 2009 06:33:43 +0000 (02:33 -0400)
zukebox_server/src/playlist/zukebox_playlist.py

index 0f3887e..bd83960 100644 (file)
@@ -26,11 +26,15 @@ class PlayList(Service):
     def __init__(self, positions=10, xml_path):
         scpd_path = pjoin(xml_path, "zukebox-playlist-scpd.xml")
         Service.__init__(self, service_name, service_type, '', scpd_path,
-                PlayListControl(positions))
+                PlayListControl(positions, service_type))
+
+    def get_playlist(self):
+        return self.control_controller.get_playlist()
 
 class PlayListControl(ServiceController):
 
-    def __init__(self, positions):
+    def __init__(self, positions, serv_type):
+        ServiceController.__init__(self, serv_type)
         self.positions = positions
         self.list = []
         self.current = 0
@@ -94,3 +98,6 @@ class PlayListControl(ServiceController):
         if self.is_availble():
             self.list = []
 
+    def get_playlist(self):
+        return self.list
+