3 # This file is part of DisOrder
4 # Copyright (C) 2005 Richard Kettlewell
6 # This program is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation, either version 3 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program. If not, see <http://www.gnu.org/licenses/>.
20 # Example use of disorder.monitor class
24 class mymonitor(disorder
.monitor
):
25 def completed(self
, track
):
26 print "completed %s" % track
29 def failed(self
, track
, error
):
30 print "failed %s (%s)" %
(track
, error
)
33 def moved(self
, id, offset
, user
):
34 print "%s moved by %s (%s)" %
(id, offset
, user
)
37 def playing(self
, track
, user
):
38 print "%s playing" % track
42 print "queued %s" % str
(q
)
45 def recent_added(self
, q
):
46 print "recent_added %s" % str
(q
)
49 def recent_removed(self
, id):
50 print "recent_removed %s" % id
53 def removed(self
, id, user
):
54 print "removed %s" % id
57 def scratched(self
, track
, user
):
58 print "%s scratched %s" %
(track
, user
)
61 def invalid(self
, line
):
62 print "invalid line: %s" % line