Exemplo n.º 1
0
 def __init__(self):
     plugin.ItemPlugin.__init__(self)
     skin.register('video_details', ('screen', 'title', 'view',
                                     'listing', 'info', 'plugin'))
     print
     print 'Activated plugin video.details'
     print 'This plugin may cause some problems because it changes the'
     print 'item menu and not all parts of Freevo may like this. If'
     print 'Freevo crashes inside the item menu, please remove this plugin.'
     print
Exemplo n.º 2
0
                width=self.content.width, height=-1, align_h='left')
        elif self.parent.weather.mapFile:
            self.draw_image(self.parent.weather.mapFile,
                (self.content.x-self.xscale(2), self.content.y+self.xscale(10),
                self.content.width, self.content.height))

    def update_content(self):
        """ update the contents of the skin """
        logger.log( 9, 'update_content()')
        self.parent = self.menu
        self.content = self.calc_geometry(self.layout.content, copy_object=True)
        self.update_functions[self.menu.skin_num]()


# create one instance of the WeatherType class
skin.register ('oneclick', ('screen', 'subtitle', 'title', 'plugin', WeatherBaseScreen()))

TRANLATIONS = [
    _('Mostly Cloudy'),
    _('Partly Cloudy'),
    _('Light Rain'),
    _('Showers'),
    _('Rain'),
    _('Fog'),
    _('Few Showers'),
    _('Mostly Sunny'),
    _('Sunny'),
    _('Scattered Flurries'),
    _('Isolated T-Storms'),
    _('Scattered Thunderstorms'),
    _('Snow Showers'),
Exemplo n.º 3
0
                        align_h='left')

        # draw current condition image
        x_start = self.content.x + (450 * self.xmult)
        y_start = self.content.y + (40 * self.ymult)

        y_start = self.content.y + (200 * self.ymult)
        y_start = self.content.y + (250 * self.ymult)
        y_start = self.content.y + (250 * self.ymult)
        y_start = y_start + 100
        value = mpdstatus()
        self.write_text(value,
                        self.big_font,
                        self.content,
                        x=x_start,
                        y=y_start,
                        width=200 * self.xmult,
                        height=-1,
                        align_h='center')

    def update_content(self):
        self.parent = self.menu
        self.content = self.calc_geometry(self.layout.content,
                                          copy_object=True)
        self.update_functions[self.menu.curSkin]()


# create one instance of the MpdType class
skin.register('mpd',
              ('screen', 'subtitle', 'title', 'plugin', MpdBaseScreen()))
Exemplo n.º 4
0
        # Create the list of main selection items (menu_items)
        menu_items           = []
        first                = menu.page_start
        self.rows, self.cols = menu.items_per_page()

        for choice in menu.choices[first : first+(self.rows*self.cols)]:
            menu_items.append(choice)

        self.rows, self.cols = menu.items_per_page()

        self.menu_items = menu_items

        if len(menu_items) == 0:
            self.all_items = menu_items + [ MenuItem('Back', self.back_one_menu) ]
        else:
            self.all_items = menu_items

        if not menu.selected in self.all_items:
            menu.selected = self.all_items[0]

        if not menu.choices:
            menu.selected = self.all_items[0]

        rc.post_event(MENU_PROCESS_END)




# register menu to the skin
skin.register('menu', ('screen', 'title', 'subtitle', 'view', 'listing', 'info', 'plugin'))
Exemplo n.º 5
0
Reminders for Saturday, 26th May, 2007 (today):
Uncle Bob birthday
"""

#python modules
import os, time, stat, re, copy

#freevo modules
import config, menu, rc, plugin, skin, osd, util
from item import Item

#get the singletons so we get skin info and access the osd
skin = skin.get_singleton()
osd = osd.get_singleton()

skin.register('reminder', ('screen', 'title', 'info', 'plugin'))


class PluginInterface(plugin.MainMenuPlugin):
    """
    A plugin to list reminders, but can be used to
    show the output of a user command.

    To activate, put the following lines in local_conf.py:
    | plugin.activate('reminders', level=45)
    | REMINDERS = [ ("cmd", "name", <wrap 0|N>, "string") ]

    wrap should be the maximum number of columns, and string if defined would be used to
    indent the output. ("/usr/bin/remind -h", "Today", 47, "Reminders for") should output something like::

        Reminders for Saturday, 26th May, 2007 (today):
Exemplo n.º 6
0
from event import *
from util.dbutil import *
db = MetaDatabase()

import playlist
from audio import audioitem
from gui import ProgressBox
from menu import MenuItem
from item import Item

#get the singletons so we get skin info and access the osd
skin = skin.get_singleton()
osd  = osd.get_singleton()

skin.register('album_tree', ('screen', 'title', 'info', 'plugin'))

class PluginInterface(plugin.MainMenuPlugin):
    """
    Plugin to browse songs in a tree-like way.

    Requires: pysqlite U{http://oss.itsystementwicklung.de/trac/pysqlite/}

    B{Pre-Installation}

    The sqlite-meta-database should be available.

    The audio.rating and audio.logger plugin allso use this database,
    you can skip the rest of the pre-install if those plugins
    are already succesfully installed.
Exemplo n.º 7
0
Uncle Bob birthday
"""

#python modules
import os, time, stat, re, copy

#freevo modules
import config, menu, rc, plugin, skin, osd, util
from item import Item


#get the singletons so we get skin info and access the osd
skin = skin.get_singleton()
osd  = osd.get_singleton()

skin.register('reminder', ('screen', 'title', 'info', 'plugin'))


class PluginInterface(plugin.MainMenuPlugin):
    """
    A plugin to list reminders, but can be used to
    show the output of a user command.

    To activate, put the following lines in local_conf.py:
    | plugin.activate('reminders', level=45)
    | REMINDERS = [ ("cmd", "name", <wrap 0|N>, "string") ]

    wrap should be the maximum number of columns, and string if defined would be used to
    indent the output. ("/usr/bin/remind -h", "Today", 47, "Reminders for") should output something like::

        Reminders for Saturday, 26th May, 2007 (today):
Exemplo n.º 8
0
        text      = _("Status - ")
        value     = execMPC("mpc status","")
        y_start   += y_inc
        self.write_text(text,   self.key_font,   self.content,
        x=x_col1,  y=y_start+y_inc, height=-1, width=x_col2-x_col1 ,align_h='right')
        self.write_text(value,  self.val_font,   self.content,
        x=x_col2,  y=y_start+y_inc, height=100, align_h='left')

        # draw current condition image
        x_start = self.content.x + (450*self.xmult)
        y_start = self.content.y + (40*self.ymult)

        y_start = self.content.y + (200*self.ymult)
        y_start = self.content.y + (250*self.ymult)
        y_start = self.content.y + (250*self.ymult)
        y_start = y_start + 100
        value = mpdstatus()
        self.write_text(value, self.big_font,   self.content,
        x=x_start, y=y_start,
        width=200*self.xmult, height=-1, align_h='center')

    def update_content(self):
        self.parent   = self.menu
        self.content  = self.calc_geometry(self.layout.content,  copy_object=True)
        self.update_functions[self.menu.curSkin]()


# create one instance of the MpdType class
skin.register ( 'mpd', ('screen', 'subtitle', 'title', 'plugin', MpdBaseScreen()) )
Exemplo n.º 9
0
    kaa.main.signals['shutdown'].connect(signal_handler)
    kaa.main.signals['exception'].connect(exception_handler)

    # load the fxditem to make sure it's the first in the
    # mimetypes list
    import fxditem

    # load all plugins
    import plugin

    # prepare the skin
    skin.prepare()

    # Fire up splashscreen and load the plugins
    splash = Splashscreen(_('Starting Freevo-%s, please wait ...') % version.version)
    skin.register('splashscreen', ('screen', splash))
    plugin.init(splash.progress)
    dialog.init()
    skin.delete('splashscreen')

    # Fire up splashscreen and load the cache
    if config.MEDIAINFO_USE_MEMORY == 2:
        import util.mediainfo

        splash = Splashscreen(_('Reading cache, please wait ...'))
        skin.register('splashscreen', ('screen', splash))

        cachefiles = []
        for type in ('video', 'audio', 'image', 'games'):
            if plugin.is_active(type):
                n = 'config.%s_ITEMS' % type.upper()
Exemplo n.º 10
0
        if self.mode == PlayListSuccession.LAST:  return 'LAST'
        if self.mode == PlayListSuccession.ONLY:  return 'ONLY'
        return 'UNKNOWN'

    def __cmp__(self, other):
        if isinstance(other, PlayListSuccession):
            if self.mode > other.mode: return 1
            if self.mode < other.mode: return -1
        else:
            if self.mode > other: return 1
            if self.mode < other: return -1
        return 0

    def __index__(self):
        return self.mode

    def __int__(self):
        return self.mode

    def __add__(self, other):
        self.mode = (self.mode + int(other)) % 3
        return self

    def __sub__(self, other):
        self.mode = (self.mode - int(other)) % 3
        return self


# register player to the skin
skin.register('player', ('screen', 'title', 'plugin'))
Exemplo n.º 11
0
    def update_doplar(self):
        if self.parent.weather.weatherMapData is None:
            x_start = self.content.x + (10 * self.xmult)
            y_start = self.content.y + (10 * self.xmult)
            self.write_text(
                _("Error encountered while trying to download Radar map"),
                self.key_font,
                self.content,
                x=x_start,
                y=y_start,
                width=self.content.width,
                height=-1,
                align_h='left')
        else:
            self.draw_image(self.parent.weather.mapFile,
                            (self.content.x, self.content.y,
                             self.content.width, self.content.height))

    def update_content(self):
        self.parent = self.menu
        self.content = self.calc_geometry(self.layout.content,
                                          copy_object=True)
        self.update_functions[self.menu.curSkin]()


# create one instance of the WeatherType class
weatherTypes = WeatherTypesClass()
skin.register('weather',
              ('screen', 'subtitle', 'title', 'plugin', WeatherBaseScreen()))
Exemplo n.º 12
0
import plugin
import skin
import osd
import event
import rc

from tv.tvguide import TVGuide
from item import Item
from menu import MenuItem, Menu
from pygame import image, transform, Surface

DEBUG = config.DEBUG

# Create the skin object
skin = skin.get_singleton()
skin.register('tvguideinfo', ('screen', 'title', 'info', 'plugin'))

# Create the events and assign them to the menus.
BUTTONBAR_RED = event.Event('BUTTONBAR_RED')
BUTTONBAR_GREEN = event.Event('BUTTONBAR_GREEN')
BUTTONBAR_YELLOW = event.Event('BUTTONBAR_YELLOW')
BUTTONBAR_BLUE = event.Event('BUTTONBAR_BLUE')

event.MENU_EVENTS['RED'] = BUTTONBAR_RED
event.MENU_EVENTS['GREEN'] = BUTTONBAR_GREEN
event.MENU_EVENTS['YELLOW'] = BUTTONBAR_YELLOW
event.MENU_EVENTS['BLUE'] = BUTTONBAR_BLUE

event.TVMENU_EVENTS['RED'] = BUTTONBAR_RED
event.TVMENU_EVENTS['GREEN'] = BUTTONBAR_GREEN
event.TVMENU_EVENTS['YELLOW'] = BUTTONBAR_YELLOW
Exemplo n.º 13
0
    def __cmp__(self, other):
        if isinstance(other, PlayListSuccession):
            if self.mode > other.mode:
                return 1
            if self.mode < other.mode:
                return -1
        else:
            if self.mode > other:
                return 1
            if self.mode < other:
                return -1
        return 0

    def __index__(self):
        return self.mode

    def __int__(self):
        return self.mode

    def __add__(self, other):
        self.mode = (self.mode + int(other)) % 3
        return self

    def __sub__(self, other):
        self.mode = (self.mode - int(other)) % 3
        return self


# register player to the skin
skin.register("player", ("screen", "title", "view", "info", "plugin"))
Exemplo n.º 14
0
    _version = ''
    try:
        try:
            import freevo.version as version
            import freevo.revision as revision
        except ImportError:
            import version
            import revision
        _version = '%s' % version.__version__
        _version = _version.replace('-svn', ' r%s' % revision.__revision__)
    except ImportError:
        pass
    # Fire up splashscreen and load the plugins
    splash = Splashscreen(_('Starting Freevo-%s, please wait ...') % _version)
    skin.register('splashscreen', ('screen', splash))
    plugin.init(splash.progress)
    skin.delete('splashscreen')

    # Fire up splashscreen and load the cache
    if config.MEDIAINFO_USE_MEMORY == 2:
        import util.mediainfo

        splash = Splashscreen(_('Reading cache, please wait ...'))
        skin.register('splashscreen', ('screen', splash))

        cachefiles = []
        for type in ('video', 'audio', 'image', 'games'):
            if plugin.is_active(type):
                n = 'config.%s_ITEMS' % type.upper()
                x = eval(n)
Exemplo n.º 15
0
                    self.content.y + self.xscale(10),
                    self.content.width,
                    self.content.height,
                ),
            )

    def update_content(self):
        """ update the contents of the skin """
        logger.log(9, "update_content()")
        self.parent = self.menu
        self.content = self.calc_geometry(self.layout.content, copy_object=True)
        self.update_functions[self.menu.skin_num]()


# create one instance of the WeatherType class
skin.register("oneclick", ("screen", "subtitle", "title", "plugin", WeatherBaseScreen()))

TRANLATIONS = [
    _("Mostly Cloudy"),
    _("Partly Cloudy"),
    _("Light Rain"),
    _("Showers"),
    _("Rain"),
    _("Fog"),
    _("Few Showers"),
    _("Mostly Sunny"),
    _("Sunny"),
    _("Scattered Flurries"),
    _("Isolated T-Storms"),
    _("Scattered Thunderstorms"),
    _("Snow Showers"),
Exemplo n.º 16
0
            self.refresh()
            rc.app(self.player)

    def hide(self):
        if self.visible:
            self.visible = 0
            skin.clear()
            rc.app(None)

    def refresh(self):
        """
        Give information to the skin..
        """
        if not self.visible:
            return

        if not self.running:
            return

        # Calculate some new values
        if not self.item.length:
            self.item.remain = 0
        else:
            self.item.remain = self.item.length - self.item.elapsed
        skin.draw('player', self.item)
        return


# register player to the skin
skin.register('player', ('screen', 'title', 'view', 'info', 'plugin'))
Exemplo n.º 17
0
from event import *
from util.dbutil import *
db = MetaDatabase()

import playlist
from audio import audioitem
from gui import ProgressBox
from menu import MenuItem
from item import Item

#get the singletons so we get skin info and access the osd
skin = skin.get_singleton()
osd = osd.get_singleton()

skin.register('album_tree', ('screen', 'title', 'info', 'plugin'))


class PluginInterface(plugin.MainMenuPlugin):
    """
    Plugin to browse songs in a tree-like way.

    Requires: pysqlite U{http://oss.itsystementwicklung.de/trac/pysqlite/}

    B{Pre-Installation}

    The sqlite-meta-database should be available.

    The audio.rating and audio.logger plugin allso use this database,
    you can skip the rest of the pre-install if those plugins
    are already succesfully installed.
Exemplo n.º 18
0
from gui.AlertBox import AlertBox

from event import *
from item import Item
from programitem import ProgramItem

from util.benchmark import benchmark
benchmarking = False

import tv.epg_xmltv
from tv.epg_types import TvProgram
from tv.record_client import RecordClient

skin = skin.get_singleton()
skin.register(
    'tv',
    ('screen', 'title', 'subtitle', 'view', 'tvlisting', 'info', 'plugin'))

CHAN_NO_DATA = _('This channel has no data loaded')


class TVGuide(Item):
    """
    Class for TVGuide
    """
    def __init__(self, start_time, player, menuw):
        _debug_(
            'TVGuide.__init__(start_time=%r, player=%r, menuw=%r)' %
            (start_time, player, menuw), 2)
        Item.__init__(self)
Exemplo n.º 19
0
import os, time, stat, re, copy

# rdf modules
from xml.dom.ext.reader import Sax2
import urllib

#freevo modules
import config, menu, rc, plugin, skin, osd, util
from gui.PopupBox import PopupBox
from item import Item

#get the singletons so we get skin info and access the osd
skin = skin.get_singleton()
osd = osd.get_singleton()

skin.register('headlines', ('screen', 'title', 'info', 'plugin'))

#check every 30 minutes
MAX_HEADLINE_AGE = 1800


class PluginInterface(plugin.MainMenuPlugin):
    """
    A plugin to list headlines from an XML (RSS) feed.

    To activate, put the following lines in local_conf.py:

    plugin.activate('headlines', level=45) 
    HEADLINES_LOCATIONS = [
          ('Advogato', 'http://advogato.org/rss/articles.xml'), 
          ('DVD Review', 'http://www.dvdreview.com/rss/newschannel.rss') ]