-from lib.mpdutils import mconnect
-
-USAGE = """Usage:
-
-mfade [time [min|max]]
-
- * time in seconds
- * min|max in percentage of volume
-
-when MPD is:
-- not playing: fade in from 0% to max over time
- default 10 minutes / 50%
-- playing: fade out from current volume to min over time
- default 10 minutes / 1/10 of current vol
-
-Manual or any external volume change will abort the script.
-"""
-
-
-class Sleep(object):
- """
- """
-
- def __init__(self):
+from lib.mpdclass import MPDClass
+from lib.startop import StartOpt
+
+NAME = 'mfade'
+VERSION = '0.1'
+USAGE = 'USAGE: %prog [--help] [options] [<time> [<final volume level>]'
+DESC = """Fade in/out to <final volume level> over <time>. From 0% to 50% when
+paused or stopped and from current volume to 10th of it if playing, both over 10
+minutes."""
+
+
+class Sleep(StartOpt, MPDClass):
+ """"""
+ script_info = dict({
+ 'version': VERSION,
+ 'prog_name': NAME,
+ 'description': DESC,
+ 'usage': USAGE,
+ })
+
+ def __init__(self):#{{{