Moved printlist command from hooke_cli -> hooke.plugin.playlist.CurveListCommand.
[hooke.git] / hooke / plugin / playlist.py
index 6b16a9448aeafc58a97c2a6c59990d3fa969fd18..a374e0885c96986a44fc4590fb0c2dca2250370a 100644 (file)
@@ -16,6 +16,7 @@ class PlaylistPlugin (Builtin):
 
     def commands(self):
         return [NextCommand(), PreviousCommand(), JumpCommand(),
+                IndexCommand(), CurveListCommand(),
                 SaveCommand(), LoadCommand(),
                 AddCommand(), AddGlobCommand(),
                 RemoveCommand(), FilterCommand(), NoteFilterCommand()]
@@ -107,6 +108,20 @@ class IndexCommand (Command):
     def _run(self, hooke, inqueue, outqueue, params):
        outqueue.put(params['playlist']._index)
 
+class CurveListCommand (Command):
+    """Get the curves in a playlist.
+    """
+    def __init__(self):
+        super(CurveListCommand, self).__init__(
+            name='playlist curves',
+            arguments=[
+                PlaylistArgument,
+                ],
+            help=self.__doc__)
+
+    def _run(self, hooke, inqueue, outqueue, params):
+       outqueue.put([c for c in params['playlist']])
+
 class SaveCommand (Command):
     """Save a playlist.
     """