A display class is used to show content on the screen. This content can be either Freevo itself (menu, etc.) or usefull informations while an application is running. For the later, it is necessary that the application itself provides a way to draw on top of it. Right now only mplayer supports this with bmovl or bmovl2.
Primary Display
The primary display is the display that is used on startup. The module itself is located in src/gui/displays and can be set with the config variable OSD_DISPLAY. Setting OSD_DISPLAY='foo' will use src/gui/displays/foo.py as primary display. While Freevo is running, it is possible to change the current display in case an application starts.
# code from src/video/plugins/mplayer.py:
# select bmovl display engine with the width and height of the video
self.screen = gui.set_display('Bmovl', (self.width, self.height))
# on video stop, restore the display by removing the new one
gui.remove_display(self.screen)When Bmovl is set, the gui system will move everything from the current display to the display in bmovl.py (Note: the case for set_display doesn't matter, the module name must always be lower case).
Status
All displays are based on Mevas displays and by adding a new display to Mevas it is possible to create a new display engine for Freevo. The bmovl and bmovl2 displays can't be used as primary display engines right now. This will be fixed soon. But even then, it is not possible to reuse the mplayer showing the menu for watching the video. If you want this to be possible, send patches.
See HelpNeeded for more informations what needs to be done.
Writing a Display
PleaseUpdate: add documentation
class Display(PygameCanvas):
"""
Display class for SDL output
"""
def __init__(self, size, default=False):
PygameCanvas.__init__(self, size)
self.animation_possible = True
plugin.activate('input.sdl')
def hide(self):
"""
Hide the output display. In most cases this does nothing since
a simple window doesn't matter. If OSD_STOP_WHEN_PLAYING the
pygame display will be shut down.
"""
pass
def show(self):
"""
Show the output window again if it is not visible
"""
pass
def stop(self):
"""
Stop the display
"""
pass
def restart(self):
"""
Restart the display if it is currently stopped
"""
pass