|
- __del__(self)
- Shut down and clean up.
Note that init() will automatically do this step if necessary.
- __init__(self, font='-adobe-helvetica-medium-r-normal-*-*-400-*-*-p-*-iso8859-1', colour='#FFFFFF', timeout=3, pos=0, offset=0, shadow=0, lines=2)
- Initialise the OSD library.
This must be done before display() will work. It will automatically
deinit if necessary.
font(pyosd.default_font): standard string-style X font description
colour('#FFFFFF'): standard string-style X colour description
timeout(3): number of seconds to remain on screen (-1 for infinite)
pos(POS_TOP): position, one of POS_TOP or POS_BOT
offset(0): vertical offset from pos
shadow(0): black shadow size
lines(2): the max number of lines available to display at once
Unfortunately due to constraints with the underlying library, lines has
to be hard coded on init() at the moment.
- display(self, arg, type=0, line=0)
- Display a string/bargraph/percentage using information from init()
arg: a string or integer from 1-100, depending on the type
-- defaults --
type(TYPE_STRING): one of TYPE_STRING, TYPE_PERCENT, or TYPE_SLIDER
line(0): the line to display text on
The underlying library currently doesn't zero out previous lines that
aren't being used, so if you wish to display something on, say, line 1,
make sure you simultaneously display "" on line 0.
- set_colour(self, c)
- Change the colour.
This will update when display() is next called.
- set_font(self, font)
- Change the font.
This takes effect immediately.
- set_offset(self, o)
- Change the vertical offset from the top or bottom.
This change is immediate.
- set_pos(self, p)
- Change the position to the top or bottom.
This change is immediate.
- set_shadow_offset(self, o)
- Set the offset of the shadow.
This change will take effect on the next display()
- set_timeout(self, t)
- Change the timeout.
This takes effect immediately; anything that is currently displayed
will wait the new timeout time before clearing.
|