]> kaliko git repositories - mpd-sima.git/blob - sima/plugins/crop.py
8467ba45c750cba363cbdc6e89545b1a42e4921f
[mpd-sima.git] / sima / plugins / crop.py
1 # -*- coding: utf-8 -*-
2 """Crops playlist
3 """
4
5 # standart library import
6 #from select import select
7
8 # third parties componants
9
10 # local import
11 from ..lib.plugin import Plugin
12
13 class Crop(Plugin):
14     """
15     Crop playlist on next track
16     """
17
18     def callback_playlist(self):
19         player = self._Plugin__daemon.player
20         target_lengh = 10
21         while player.currentsong().pos > target_lengh:
22             self.log.debug('cropping playlist')
23             player.remove()
24
25
26 # VIM MODLINE
27 # vim: ai ts=4 sw=4 sts=4 expandtab