]> kaliko git repositories - mpd-sima.git/blobdiff - sima/lib/plugin.py
Move fuzzy_find method in the player.
[mpd-sima.git] / sima / lib / plugin.py
index e2764f96c849825a9d56a183b679aa51f86f7860..cea4448346749c582e91944623712978ff5f595b 100644 (file)
@@ -15,13 +15,17 @@ class Plugin():
     def info(cls):
         """self documenting class method
         """
+        doc = 'Undocumented plugin! Fill "{}" docstring'.format(cls.__name__)
+        if cls.__doc__:
+            doc = cls.__doc__.strip(' \n').splitlines()[0]
         return {'name': cls.__name__,
-                'doc': cls.__doc__.strip(' \n').splitlines()[0]
+                'doc': doc,
                 }
 
     def __init__(self, daemon):
         self.log = daemon.log
         self.__daemon = daemon
+        self.player = daemon.player
         self.plugin_conf = None
         self.__get_config()
 
@@ -35,13 +39,19 @@ class Plugin():
         for sec in conf.sections():
             if sec.lower() == self.__class__.__name__.lower():
                 self.plugin_conf = dict(conf.items(sec))
-        if self.plugin_conf:
-            self.log.debug('Got config for {0}: {1}'.format(self,
-                                                            self.plugin_conf))
+        #if self.plugin_conf:
+        #    self.log.debug('Got config for {0}: {1}'.format(self,
+        #                                                    self.plugin_conf))
 
     def callback_player(self):
         """
-        Called on player changes
+        Called on player changes, stopped, paused, skipped
+        """
+        pass
+
+    def callback_player_database(self):
+        """
+        Called on player music library changes
         """
         pass
 
@@ -59,11 +69,17 @@ class Plugin():
         """
         pass
 
-    def callback_need_song(self):
+    def callback_need_track(self):
         """Returns a list of Track objects to add
         """
         pass
 
+    def callback_need_track_fb(self):
+        """Called when callback_next_song failled to find tracks to queue
+        Returns a list of Track objects to add
+        """
+        pass
+
     def shutdown(self):
         pass