- freevo-games-interface-array-index-self.patch

    Changes freevo/ui/games/interface.py to remove the parameter "ind"
    that conflicts in the suffix() method.
    This fixes the "games and emulators" listing of roms and makes it
    work.

- games-add-exit-event.patch

   Maps the EXIT key to the STOP event in a game.
   This way pressing the STOP button in Freevused works with games too.

- freevo-python2.4-xinitrc.patch

   Changes the string 'python' in the freevo script to sys.executable.
   That way Python uses the interpreter that has invoked the freevo
   script fixing the problem I had with mixed python 2.4 and Python 2.3
   invocations.
   It also has the xinitrc changes that I sent before.

- freevused-1.2-freevo2.0.tar.gz

   Another version with corrected bugs of my input plugin for
   controlling Freevo 2.0 with a Bluetooth phone.

- mplayer_select_aspectratio.py

  A plugin that adds an option in the submenu of a movie for changing
  the aspect ratio.
  It's useful when a movie (normally an AVI) has bad headers that say
  the aspect ratio of the movie is 2.35:1 when it is 16:9 and mplayer
  displays the movie stretched or compressed.

-- 
--- 
/home/freevo2/freevo2/lib/python2.4/site-packages/freevo/ui/games/interface.py  
    2006-06-14 21:22:14.000000000 +0200
+++ freevo/ui/games/interface.py        2006-06-13 15:17:47.000000000 +0200
@@ -45,21 +45,22 @@
     def __init__(self):
         plugin.MimetypePlugin.__init__(self)
         self.display_type = [ 'games' ]
+       self.index = 0
 
         # activate the mediamenu for video
         plugin.activate('mediamenu', level=plugin.is_active('games')[2],
                         args='games')
 
 
-    def suffix(self, ind):
+    def suffix(self):
         """
         the suffixes are specified in the config file.
         """
 
-        if config.GAMES_ITEMS[ind][0] is 'USER':
-          suf = config.GAMES_ITEMS[ind][5]
+        if config.GAMES_ITEMS[self.index][0] is 'USER':
+          suf = config.GAMES_ITEMS[self.index][5]
         else:
-          suf = machine.ext(config.GAMES_ITEMS[ind][0])
+          suf = machine.ext(config.GAMES_ITEMS[self.index][0])
 
         log.debug('The supported suffixes are %s' % suf)
         return suf
@@ -68,6 +69,8 @@
     def get(self, parent, listing):
         items = []
 
+        log.info('PARENT %s' % parent)
+
         try:
             file = listing.visible[0]
         except:
@@ -78,7 +81,7 @@
 
         systemmarker = imgpath = None
         dirname = file.dirname
-        ind, done = 0, 0
+        self.index, done = 0, 0
 
         for item in config.GAMES_ITEMS:
             for dir in item[2]:
@@ -89,14 +92,14 @@
                     break
             if done:
                 break
-            ind = ind + 1
+            self.index = self.index + 1
 
-        all_files = listing.match_suffix(self.suffix(ind))
+        all_files = listing.match_suffix(self.suffix())
         all_files.sort(lambda l, o: cmp(l.basename.upper(),
                                         o.basename.upper()))
 
         for file in all_files:
             # TODO: Build snapshots of roms.
-            items.append(GameItem(parent, file, ind, imgpath))
+            items.append(GameItem(parent, file, self.index, imgpath))
             
         return items
--- ../freevo2/bin/freevo       2006-06-14 21:20:51.000000000 +0200
+++ freevo      2006-06-16 19:21:17.000000000 +0200
@@ -224,7 +224,7 @@
     
 if arg == 'stop':
     # stop running freevo
-    if not stop(name, [ 'python' ] + proc):
+    if not stop(name, [ sys.executable ] + proc):
         print 'freevo not running'
     sys.exit(0)
     
@@ -242,7 +242,11 @@
             break
         server_num += 1
     sys.stdin.close()
-    os.execvp('xinit', [ 'xinit', sys.argv[0], '-force-fs',  '--', 
':'+str(server_num) ])
+
+    if os.path.exists(os.environ['HOME'] + '/.xinitrc'):
+        os.execvp('xinit', [ 'xinit',  '--', ':'+str(server_num), '-br' ] )
+    else:
+        os.execvp('xinit', [ 'xinit', sys.argv[0], '-force-fs',  '--', 
':'+str(server_num), '-br' ] )
 
     
 elif arg == 'execute':
@@ -268,7 +272,7 @@
     proc     = [ os.path.join(__site__, 'helpers', name + '.py') ]
     if len(sys.argv) >= 2:
         if len(sys.argv) > 2 and sys.argv[2] == 'stop':
-            if not stop(name, [ 'python' ] + proc):
+            if not stop(name, [ sys.executable ] + proc):
                 print '%s not running' % name
             sys.exit(0)
         if len(sys.argv) > 2 and sys.argv[2] == 'start':
@@ -304,7 +308,7 @@
 if arg and name == 'freevo' and arg == '-daemon':
     name = 'daemon'
 
-# if getpid(name, [ 'python' ] + proc)[1] and check:
+# if getpid(name, [ sys.executable ] + proc)[1] and check:
 #     if name != 'freevo':
 #         print '%s still running, run \'freevo %s stop\' to stop' % (name, 
name)
 #     else:
@@ -316,4 +320,4 @@
     print 'Either the helper does not exist or you need to run \'make\' first'
     sys.exit(0)
 
-start(name, [ 'python' , '-OO' ] + proc , bg, check)
+start(name, [ sys.executable , '-OO' ] + proc , bg, check)
--- 
/home/freevo2/freevo2/lib/python2.4/site-packages/freevo/ui/input/eventmap.py   
    2006-06-14 21:22:08.000000000 +0200
+++ freevo/ui/input/eventmap.py 2006-06-14 23:11:18.000000000 +0200
@@ -226,6 +226,7 @@
     }
 
 GAMES_EVENTS = {
+    'EXIT'      : STOP,
     'STOP'      : STOP,
     'SELECT'    : STOP,
     'MENU'      : MENU,

Attachment: freevused-1.2-freevo2.0.tar.gz
Description: Binary data

# -*- coding: iso-8859-1 -*-
# -----------------------------------------------------------------------
# mplayer_select_aspectratio.py - Choose mplayer aspect ratio
# -----------------------------------------------------------------------
# $Id: mplayer_aspectratio.py,v 1.6 2006/06/11 13:58:00 gorka Exp $
#
# Notes: Changes the aspect ratio of a movie
#
# This plugin allows to override the aspect ratio of a movie
#
# Activate: 
#
#   plugin.activate('mplayer_select_aspectratio')
#
#   The first element selects the default ratio of the movie
#   you can add the aspect ratios you find useful
#   MPLAYER_ASPECT_RATIOS =  ('Def', '16:9', '2.35:1', '4:3')
#
# -----------------------------------------------------------------------
# $Log: mplayer_aspectratio.py,v $
# -----------------------------------------------------------------------
# Freevo - A Home Theater PC framework
# Copyright (C) 2002 Krister Lagerstrom, et al. 
# Please see the file freevo/Docs/CREDITS for a complete list of authors.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of MER-
# CHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# ----------------------------------------------------------------------- */

# python imports
import logging

# kaa imports
from kaa.notifier import Callback

from menu import Action, ActionItem

import config
import plugin

# get logging object
log = logging.getLogger()

class PluginInterface(plugin.ItemPlugin):
    """
    Changes the aspect ratio of a Movie

    plugin.activate('mplayer_aspectratio')

    """

    def __init__(self):
        plugin.ItemPlugin.__init__(self)

        self.plugin_name = 'mplayer_aspectratio.item'

        if hasattr(config, 'MPLAYER_ASPECT_RATIOS'):
            self.ratios = config.MPLAYER_ASPECT_RATIOS
        else:
            self.ratios = ('Def', '16:9', '2.35:1', '4:3')

        self.ratio = self.ratios[0]

        self.title_def = _('Aspect Ratio - %s')

        self.default_str = _('Default')


    def change_aspect(self, item):
        
        item['cnt'] = (item['cnt'] + 1) % len(self.ratios)
        self.ratio = self.ratios[ item['cnt'] ]

        if self.ratio == self.ratios[0]:
            item.mplayer_options = ''
        else:
            item.mplayer_options = ' -aspect ' + self.ratio
        log.debug('Aspect command string for mplayer:  %s' % item.mplayer_options)
        if self.ratio == self.ratios[0]:
            str = self.default_str
        else:
            str = self.ratio

        item['item_title'] = self.title_def % str

        menustack = item.get_menustack()

        newaction = ActionItem(item['item_title'], item, self.change_aspect)
        menuitem = menustack.get_selected()
        menuitem.replace( newaction )

        menustack.refresh()


    def actions(self, item):
        
        myactions = []
        desc = _("Changes the movie aspect ratio. It's useful for movies that have incorrect aspect ratio in the headers.")

        if item.type == 'video':

            setattr(item, 'cnt', 0)
            setattr(item, 'item_title', self.title_def % self.default_str)

            a = Action(item['item_title'], self.change_aspect, 'mplayer_aspect_change', desc)

            myactions.append(a)

        return myactions

    

Attachment: signature.asc
Description: Digital signature

_______________________________________________
Freevo-devel mailing list
Freevo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freevo-devel

Reply via email to