On Mon, Mar 12, 2007 at 08:14:23PM +0100, Pascal Schirrmann wrote:
> 
> I at last am interested by the two ! could you send your diff here ? 
> 
A bit late but here they are attached.

<?xml version="1.0" ?>
<freevo>

  <skin include="info" geometry="800x600">
    <iconset theme="bluestar"/>
    <setvar name="anamorphic" val="1" />

<main>
      <item label="tv" name="Television" icon="tv_on.png" outicon="tv_off.png" 
image="watermarks/bluestar_tv.png"/>
      <item label="video" name="Movies" icon="movie_on.png" 
outicon="movie_off.png" image="watermarks/bluestar_movie.png"/>
      <item label="audio" name="Music" icon="music_on.png" 
outicon="music_off.png" image="watermarks/bluestar_music.png"/>
      <item label="mail" name="Email" icon="email_on.png" 
outicon="email_off.png" image="watermarks/bluestar_email.png"/>
      <item label="image" name="Pictures" icon="image_on.png" 
outicon="image_off.png" image="watermarks/bluestar_image.png"/>
      <item label="weather" name="Weather" icon="weather_on.png" 
outicon="weather_off.png" image="watermarks/bluestar_weather.png"/>
      <item label="games" name="Games" icon="games_on.png" 
outicon="games_off.png" image="watermarks/bluestar_games.png"/>
      <item label="headlines" name="Headlines" icon="headlines_on.png" 
outicon="headlines_off.png" image="watermarks/bluestar_headlines.png"/>
      <item label="shutdown" name="Shutdown" icon="shutdown_on.png" 
outicon="shutdown_off.png" image="watermarks/bluestar_shutdown.png"/>
</main>

    <image label="background" filename="bluestar_back.jpg"/>
    <image label="logo" filename="bluestar_logo.png"/>
    <image label="scheduledtv" filename="bluestar_scheduledtv.png"/> 
    
    <menuset label="main menu">
      <screen layout="screen watermark"/>
      <listing layout="main listing" x="110" y="160" width="460" height="400"/> 
    </menuset>

    <layout label="screen watermark">
      <background>
        <image image="background" x="0" y="0" label="background"/>
        <image x="435" y="230" width="370" height="380" label="watermark"/>
      </background>
    </layout>
    
    <layout label="main listing">
      <content type="text" spacing="10">
        <item type="default" font="main" align="left"/>
        <item type="selected" font="main selected" align="center">
          <rectangle bgcolor="0xaa000000" size="0" x="-3" y="-3" width="max+6" 
height="max+6" radius="10"/>
        </item>
      </content>
    </layout>

    <!-- font used in this layouts -->
    <font label="title area" name="DejaVuSansCondensedBold.ttf" size="24" 
color="0xffffff"/>
    <font label="subtitle" name="DejaVuSansCondensedBold.ttf" size="18" 
color="0xffffff"/>

    <font label="item" name="DejaVuSansCondensedBold.ttf" size="16" 
color="0xdddddd"/>
    <font label="selected" name="DejaVuSansCondensedBold.ttf" size="16" 
color="0xffffff"/>

    <font label="main" name="DejaVuSansCondensedBold.ttf" size="24" 
color="0xdddddd"/>
    <font label="main selected" name="DejaVuSansCondensedBold.ttf" size="24" 
color="0xffffff"/>

    <font label="info font" name="DejaVuSansCondensedBold.ttf" size="16" 
color="0xffffff"/>

    <layout label="list0">
      <content type="text" spacing="2">
        <item type="default" font="item"/>
        <item type="selected" font="selected">
          <rectangle bgcolor="selection" size="0" x="-5" y="-3" width="max+10" 
height="max+6" radius="10"/>
        </item>
      </content>
    </layout>

    <layout label="list_main">
      <content type="text" spacing="10">
        <item type="default" font="main"/>
        <item type="selected" font="main selected">
          <rectangle bgcolor="selection" size="0" y="-5" x="-10" width="max+20" 
height="max+10" radius="10"/>
        </item>
      </content>
    </layout>

   <layout label="title">
      <background>
        <image visible="not idlebar" filename="bluestar_logo.png" x="0" y="0"
          width="238" height="80"/>
      </background>
      <content x="170" y="0" type="menu" font="title area" align="center"
        valign="center"/>
    </layout>

    <font label="title" name="DejaVuSansCondensedBold.ttf" size="29" 
color="0xffffff">
      <shadow visible="yes" color="0x80000000" x="3" y="3"/>
    </font>

    <font label="item" color="0xffffff"/>

    <font label="main" name="DejaVuSansCondensedBold.ttf" size="20" 
color="0xdddddd">
      <shadow x="1" y="1" color="0x000000" visible="yes"/>
    </font>
    <font label="main selected" name="DejaVuSansCondensedBold.ttf" size="20" 
color="0xffffff">
      <shadow x="1" y="1" color="0x000000" visible="yes"/>
    </font>

    <font label="info value" color="0xffdc71">
      <shadow x="1" y="1" color="0x000000" visible="yes"/>
    </font>
    
    <font label="info label">
      <shadow x="1" y="1" color="0x000000" visible="yes"/>
    </font>
    
    <font label="info tagline" name="DejaVuSansCondensedBold.ttf" size="16" 
color="0xffffff">
      <shadow x="1" y="1" color="0x000000" visible="yes"/>
    </font>
    
    <font label="info plot" name="DejaVuSansCondensedBold.ttf" size="16" 
color="0xffffff">
      <shadow x="1" y="1" color="0x000000" visible="yes"/>
    </font>
    
    <color label="tv selection" value="0xa0000000"/>
    <font label="tv selected" color="0xffdc71"/>
    <font label="tv time" color="0xffdc71">
      <shadow x="1" y="1" color="0x000000" visible="yes"/>
    </font>

    <color label="widget background" value="0xefb744"/>
    <font label="widget" name="DejaVuSansCondensedBold.ttf" size="16" 
color="0x000000"/>
    <color label="widget text" value="0x000000"/>
    <color label="widget item background" value="0xefb744"/>
    <color label="widget selected background" value="0xfffe8d"/>

    <font label="default" name="DejaVuSansCondensedBold.ttf" size="18" 
color="0xffffff"/>

        <!-- 
        *******************************************************
        ** SPLASH SCREEN
        ******************************************************* -->
        
        <splashscreen>
            <screen layout="screen"/>
            <content layout="splashscreen" x="0" y="0" width="800" 
height="600"/>
        </splashscreen>
        
        <layout label="splashscreen">
            <background>
                <image filename="bluestar_splash.jpg"/>
            </background>
            <content x="30" y="400" width="740" font="splashscreen font" 
spacing="10"/>
        </layout>
        
        <font label="splashscreen font" name="DejaVuSansCondensedBold.ttf" 
size="20" color="0xffffff"/>
        
        
    <!-- 
    *******************************************************
    ** MENU
    ******************************************************* -->

    <!-- default description: make listing area smaller, show info area -->
    <menuset label="default description">
      <listing height="340"/>
      <info x="40" y="460" width="750" height="120" />
    </menuset>

    <!-- default description no image: mix between the two above -->
    <menuset label="default description no image">
      <listing height="340"/>
      <info x="40" y="460" width="750" height="120" />
    </menuset>
    
    <!-- special settings for audio. The default style is an image based style 
-->
    <!-- with an info area. By pressing DISPLAY this can be toggled to the 
default view -->
    <menu type="audio">
      <style image="audio menu with info" text="default description"/>
      <style text="default description"/>
    </menu>

    <menu type="video">
      <style image="video menu with info" text="default description"/>
      <style text="default description"/>
      <style image="video details" text="default description"/>
    </menu>

    <menu type="image">
      <style image="image menu with info" text="default description"/>
      <style text="default description"/>
    </menu>


    <!-- The "video menu with info", it's like "default description" only with 
-->
    <!-- different listing area and a subtitle -->
    <menuset label="video menu with info" inherits="default description">
      <screen layout="video screen" visible="yes"/>
      <subtitle layout="subtitle" x="45" y="100" width="470" height="40"/>
      <listing layout="video list" y="140" height="290">
        <image label="uparrow" y="140"/>
        <image label="downarrow" y="max-32"/>
      </listing>
    </menuset>


    <!-- Now the "video details" (DISPLAY 3 for video)-->
    <menuset label="video details" inherits="normal text style">
      <subtitle layout="subtitle" x="10" y="100" width="780" height="60"/>

      <listing layout="video list" x="500" y="450" width="290" height="140">
        <image label="uparrow" filename=""/>
        <image label="downarrow" filename=""/>
      </listing>

      <view x="545" y="150"/>
      <info layout="video info" x="10" y="160" width="480" height="430"/>
    </menuset>


    <!-- Now the "audio menu with info" used by audio-->
    <menuset label="audio menu with info" inherits="video menu with info">
      <screen layout="audio screen" visible="yes"/>
      <listing layout="audio list"/>
      <view y="145"/>
    </menuset>


    <!-- Now the "image menu with info" used by image-->
    <menuset label="image menu with info" inherits="video menu with info">
      <listing width="745" layout="image list"/>
      <screen layout="image screen" visible="yes"/>
      <view visible="no"/>
    </menuset>


<!-- ################### END MENU ########################### -->

    <layout label="audio screen">
      <background>
        <image image="background" x="0" y="0" label="background"/>
        <image filename="watermarks/bluestar_music.png" x="435" y="230" 
width="370" height="380"/>
      </background>
    </layout>

    <layout label="audio list">
      <content type="image">
        <item type="default">
          <rectangle bgcolor="0xd0000000" size="0" x="0" y="0" width="max"
            height="max"/>
        </item>
      </content>
    </layout>

    <layout label="video screen">
      <background>
        <image image="background" x="0" y="0" label="background"/>
        <image filename="watermarks/bluestar_movie.png" x="435" y="230" 
width="370" height="380"/>
      </background>
    </layout>

    <layout label="video list">
      <content type="image">
        <item type="default">
          <rectangle bgcolor="0xd0000000" size="0" x="0" y="0" width="max"
            height="max"/>
        </item>
      </content>
    </layout>

    <layout label="image screen">
      <background>
        <image image="background" x="0" y="0" label="background"/>
        <image filename="watermarks/bluestar_image.png" x="435" y="230" 
width="370" height="380"/>
      </background>
    </layout>

    <layout label="image list">
      <content type="image">
        <item type="default">
          <rectangle bgcolor="0xd0000000" size="0" x="0" y="0" width="max"
            height="max"/>
        </item>
      </content>
    </layout>

    <menuset label="tv menu">
      <subtitle layout="title" x="10" y="90" width="780" height="30"/>
      <listing y="140">
        <image y="140" label="uparrow"/>
      </listing>
      <info layout="tv info" y="440" height="150"/>
    </menuset>

    <layout label="tv screen">
      <background>
        <image image="background" x="0" y="0" label="background"/>
        <image filename="watermarks/bluestar_tv.png" x="435" y="230" 
width="370" height="380"/>
      </background>
    </layout>

    <menuset label="tv menu more info">
      <screen layout="tv screen" visible="yes"/>
      <subtitle layout="title" x="10" y="90" width="780" height="30"/>
      <listing y="140">
        <image y="140" label="uparrow"/>
      </listing>
      <info layout="tv info" y="290" height="290"/>
    </menuset>

    <!-- tv info area -->
    <layout label="tv info">
      <content>
        <item type="default">
          <text font="tv time" valign="center">Date: </text>
          <text font="tv time" valign="center" expression="date"/>
          <goto_pos x="50" mode="relative"/>
          <text font="tv time" valign="center">Time: </text>
          <text font="tv time" valign="center" expression="start"/>
          <text font="tv time" valign="center">-</text>
          <text font="tv time" valign="center" expression="stop"/>
          <newline/>
          <goto_pos y="10" mode="relative"/>
          <if expression="sub_title">
            <text font="info tagline" expression="sub_title"/>
            <newline/>
          </if>
          <if expression="desc">
            <text font="info plot" height="max" mode="soft" expression="desc"/>
            <newline/>
          </if>
        </item>
      </content>
    </layout>

    <menu type="mail">
      <style text="mail"/>
    </menu>

    <layout label="mail screen">
      <background>
        <image image="background" x="0" y="0" label="background"/>
        <rectangle size="0" bgcolor="0x80000000" radius="10" x="10" y="90"
                 width="750" height="150"/>
        <image filename="watermarks/bluestar_email.png" x="435" y="230" 
width="370" height="380"/>
      </background>
    </layout>

    <menuset label="mail" inherits="normal text style">
      <screen layout="mail screen" visible="yes"/>
      <view layout="view" x="10" y="90" width="280" height="250" align="left"/>
      <listing x="30" y="250" width="700" height="280">
        <image filename="up.png" label="uparrow" x="730" y="250"/>
        <image filename="down.png" label="downarrow" x="730" y="max-32"/>
      </listing>
      <info layout="mail info" x="40" y="100" width="520" height="140"/>
    </menuset>
  
  <layout label="mail info">
 <content x="0" y="0" type="text" spacing="25">
  <item type="mailbox">
   <if expression="newmails">
    <text align="left" width="200" font="info label">Unread messages</text>
     <goto_pos x="10" mode="relative"/>
     <text font="info value" expression="newmails"/>
     <newline/>
   </if>
   <if expression="mails">
    <text align="left" width="200" font="info label">Total messages</text>
    <goto_pos x="10" mode="relative"/>
    <text font="info value" expression="mails"/>
   </if>
  </item>
  <item type="default">
   <if expression="subject">
    <text font="info tagline" expression="subject"/>
    <newline />
   </if>
   <if expression="fromname">
    <goto_pos x="20" mode="relative"/>
    <text font="info value" expression="fromname"/>
   </if>
   <if expression="fromaddr">
    <text font="info value"> - </text>
    <text font="info value" expression="fromaddr"/>
   </if>
   <newline/>
   <if expression="date">
    <goto_pos x="20" mode="relative"/>
    <text font="info value" expression="date"/>
   </if>
  </item>
  <item type="newemail">
   <if expression="subject">
    <text font="info tagline" expression="subject"/>
    <newline />
   </if>
   <if expression="fromname">
    <goto_pos x="20" mode="relative"/>
    <text font="info value" expression="fromname"/>
   </if>
   <if expression="fromaddr">
    <text font="info value"> - </text>
    <text font="info value" expression="fromaddr"/>
   </if>
   <newline/>
   <if expression="date">
    <goto_pos x="20" mode="relative"/>
    <text font="info value" expression="date"/>
    <newline/>
   </if>
   <newline/>
   <goto_pos y="30" x="20" mode="relative"/>
   <text font="small1">Message has not been read</text>
  </item>
 </content>
</layout>

        <!-- 
        *******************************************************
        ** AUDIO PLAYER DEFINITIONS
        ******************************************************* -->

        <player>
            <screen layout="player screen" x="0" y="0" width="800" 
height="600"/>
            <view layout="player view" x="470" y="200" width="400" 
height="360"/>
            <info layout="player info" x="-50" y="80" width="700" height="340"/>
            <title visible="no"/>
        </player>

        <layout label="player screen">
            <background>
                <image image="background" x="0" y="0" label="background"/>
            </background>
        </layout>

        <layout label="player view">
            <content type="text" spacing="10">
                <item type="default">
                    <rectangle size="0" bgcolor="player mask" radius="10" 
x="-15" y="-15"
                        width="max+30" height="max+30"/>
                </item>
            </content>
        </layout>

        <layout label="player info">
            <background>
                <rectangle size="0" bgcolor="player mask" radius="10" 
width="max"/>
            </background>
            <content x="70" y="10" height="max-20" width="max-80" type="text" 
spacing="10">
                <item type="default">
                    <if expression="title">
                        <text font="player title" expression="title"/>
                        <newline/>
                    </if>
                    <if expression="not title">
                        <text font="player title" expression="name"/>
                        <newline/>
                    </if>
                    <if expression="description">
                        <text font="player info" expression="description"/>
                        <newline/>
                    </if>
                    <if expression="artist">
                        <text font="player artist" expression="artist"/>
                        <newline/>
                    </if>
                    <goto_pos y="15" mode="relative"/>
                    <if expression="album">
                        <text width="140" align="right" font="player 
info">Album:</text>
                        <goto_pos x="10" mode="relative"/>
                        <text font="player info" expression="album"/>
                        <if expression="date">
                            <text font="player info"> (</text>
                            <text font="player info" expression="date"/>
                            <text font="player info">)</text>
                        </if>
                        <newline/>
                    </if>
                    <if expression="stream_name">
                        <text width="140" align="right" font="player 
info">Name:</text>
                        <goto_pos x="10" mode="relative"/>
                        <text font="player info" expression="stream_name"/>
                        <newline/>
                    </if>
                    <if expression="genre">
                        <text width="140" align="right" font="player 
info">Genre:</text>
                        <goto_pos x="10" mode="relative"/>
                        <text font="player info" expression="genre"/>
                        <newline/>
                    </if>
                    <if expression="trackno">
                        <text width="140" align="right" font="player 
info">Track:</text>
                        <goto_pos x="10" mode="relative"/>
                        <text font="player info" expression="trackno"/>
                        <if expression="trackof">
                            <text font="player info">/</text>
                            <text font="player info" expression="trackof"/>
                        </if>
                        <newline/>
                    </if>
                    <if expression="bitrate">
                        <text width="140" align="right" font="player 
info">Bitrate:</text>
                        <goto_pos x="10" mode="relative"/>
                        <text font="player info" expression="bitrate"/>
                        <text width="130" font="player info">kb/s</text>

                        <newline/>
                    </if>
                    <goto_pos y="15" mode="relative"/>
                    <if expression="length">
                        <text width="140" align="right" font="player 
info">Length:</text>
                        <goto_pos x="10" mode="relative"/>
                        <text font="player info" expression="length"/>
                        <newline/>
                    </if>
                    <if expression="elapsed">
                        <text width="140" align="right" font="player 
info">Elapsed:</text>
                        <goto_pos x="10" mode="relative"/>
                        <text font="player info" expression="elapsed"/>
                        <newline/>
                    </if>
                    <if expression="cache_percentage">
                        <text width="140" align="right" font="player 
info">Cache:</text>
                        <goto_pos x="10" mode="relative"/>
                        <text font="player info" expression="cache_percentage"/>
                        <newline/>
                    </if>
                </item>
            </content>
        </layout>

        <color label="player mask" value="0x80000000"/>

        <font label="player title" name="DejaVuSansCondensedBold.ttf" size="24" 
color="0xffffff">
            <shadow x="2" y="2" color="0x000000" visible="yes"/>
        </font>
        <font label="player artist" name="DejaVuSansCondensedBold.ttf" 
size="18" color="0xffffff"/>
        <font label="player info"   name="DejaVuSansCondensedBold.ttf" 
size="14" color="0xffffaa"/>

        <font label="presskey text" name="DejaVuSansCondensedBold.ttf" 
size="14" color="0xffffff"/>

        <!-- 
        *******************************************************
        ** MISC FONTS/COLORS
        ******************************************************* -->

        <font label="default" name="DejaVuSansCondensedBold.ttf" size="16" 
color="0xffffff"/>

        <font label="small0"  name="DejaVuSansCondensedBold.ttf" size="12" 
color="default0"/>
        <font label="small1"  name="DejaVuSansCondensedBold.ttf" size="12" 
color="default1"/>
        <font label="small2"  name="DejaVuSansCondensedBold.ttf" size="12" 
color="default2"/>

        <font label="medium0" name="DejaVuSansCondensedBold.ttf" size="16" 
color="default0"/>
        <font label="medium1" name="DejaVuSansCondensedBold.ttf" size="16" 
color="default1"/>
        <font label="medium2" name="DejaVuSansCondensedBold.ttf" size="16" 
color="default2"/>

        <font label="large0"  name="DejaVuSansCondensedBold.ttf" size="20" 
color="default0"/>
        <font label="large1"  name="DejaVuSansCondensedBold.ttf" size="20" 
color="default1"/>
        <font label="large2"  name="DejaVuSansCondensedBold.ttf" size="20" 
color="default2"/>

        <font label="huge0"  name="DejaVuSansCondensedBold.ttf" size="28" 
color="default0"/>
        <font label="huge1"  name="DejaVuSansCondensedBold.ttf" size="28" 
color="default1"/>
        <font label="huge2"  name="DejaVuSansCondensedBold.ttf" size="28" 
color="default2"/>

        <color label="default0" value="0xffffff"/>
        <color label="default1" value="0xffffaa"/>
        <color label="default2" value="0xcccccc"/>

        <!-- plugin fonts -->
        <font label="osd" name="DejaVuSansCondensedBold.ttf" size="24" 
color="0xffffff">
            <shadow visible="yes" color="0x000000" border="yes"/>
        </font>
        <font label="detachbar" name="DejaVuSansCondensed.ttf" size="10" 
color="0xffffff"/>

        <!-- 
        *******************************************************
        ** POPUP DEFINITIONS
        ******************************************************* -->

        <font label="widget" name="DejaVuSansCondensedBold.ttf" size="16" 
color="0xffffff"/>
        <font label="selected widget" name="DejaVuSansCondensedBold.ttf" 
size="16" color="0x164668"/>

        <!-- 
        *******************************************************
        ** TV DEFINITIONS
        ******************************************************* -->

        <font label="tv" name="DejaVuSansCondensedBold.ttf" size="16" 
color="0xffffff"/>
        <font label="tv selected" name="DejaVuSansCondensedBold.ttf" size="16" 
color="0xffff66">
            <shadow visible="yes" color="0x000000" x="1" y="1"/>
        </font>
        <font label="tv time" name="DejaVuSansCondensedBold.ttf" size="14" 
color="0xffffaa"/>
        <font label="tv title" name="DejaVuSansCondensedBold.ttf" size="24" 
color="0xffffff">
            <shadow x="2" y="2" color="0x000000" visible="yes"/>
        </font>
        <font label="tv subtitle" name="DejaVuSansCondensed-Oblique.ttf" 
size="18" color="0xffffff"/>
        <font label="tv description"    name="DejaVuSansCondensedBold.ttf" 
size="16" color="0xffffff"/>

  </skin>
</freevo>
# -*- coding: iso-8859-1 -*-
# -----------------------------------------------------------------------
# mplayer_ppmenu.py - Choose mplayer aspect ratio and postprocessing
# -----------------------------------------------------------------------
# $Id: mplayer_ppmenu.py,v 1.6 2006/02/11 16:37:00 gorka Exp $
#
# This plugin allows to override the aspect ratio and postprocessing options
# of a movie
#
# The item plugin activates automatically a DaemonPlugin that watches for
# MENU_BACK events to default the aspect option variable if the user has exited
# the submenu of the movie
#
# Activate: 
#
#   plugin.activate('video.mplayer_ppmenu.item')
#
#   The first element selects the default option of the movie
#   you can add the aspect options you find useful
#   MPLAYER_ASPECT_RATIOS =  ('Def', '16:9', '2.35:1', '4:3')
#
# -----------------------------------------------------------------------
# $Log: mplayer_ppmenu.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
#
# ----------------------------------------------------------------------- */

import plugin
import config
import rc
import event as em
import skin
import menu

from plugins.idlebar import IdleBarPlugin


class item(plugin.ItemPlugin):
    """
    Changes the aspect option of a Movie

    plugin.activate('video.mplayer_ppmenu.item')

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

        self.skin = skin.get_singleton()

        self.item = None
        self.plugin_name = 'video.mplayer_ppmenu.item'

        self.default_str = _('Default')

        if hasattr(config, 'MPLAYER_VF_PROGRESSIVE_OPTS'):
            self.vfp_opts = config.MPLAYER_VF_PROGRESSIVE_OPTS
        else:

             self.vfp_opts = [
                (self.default_str, ''),
                ('LQ', 'pp=de'),
                ('HQ', 'pp=ac/al'),
                ('HQ denoise3d', 'pp=ac/al,hqdn3d=2:2:4'),
                ('HQ denoise3d+unsharp', 'pp=ac/al,hqdn3d=2:2:4,unsharp=l3x3:0.5'),
                ('HQ denoise3d+unsharp+noise', 'pp=ac/al,hqdn3d=2:2:4,unsharp=l3x3:0.5,noise=12uah:5uah')
             ]

        self.vfp_opt = None

        self.vfp_args_def = config.MPLAYER_VF_PROGRESSIVE
        self.vfp_title_def = _('Video PP - %s')

        self.vfp_title = self.vfp_title_def % self.default_str


        if hasattr(config, 'MPLAYER_VF_INTERLACED_OPTS'):
            self.vfi_opts = config.MPLAYER_VF_INTERLACED_OPTS
        else:

             self.vfi_opts = [
                (self.default_str, ''),
                ('LQ', 'pp=de'),
                ('HQ', 'pp=ac/al'),
                ('HQ denoise3d', 'pp=ac/al,hqdn3d=2:2:4'),
                ('HQ denoise3d+unsharp', 'pp=ac/al,hqdn3d=2:2:4,unsharp=l3x3:0.5'),
                ('HQ denoise3d+unsharp+noise', 'pp=ac/al,hqdn3d=2:2:4,unsharp=l3x3:0.5,noise=12uah:5uah')
             ]

        self.vfi_opt = None

        self.vfi_args_def = config.MPLAYER_VF_PROGRESSIVE
        self.vfi_title_def = _('Video PP - %s')

        self.vfi_title = self.vfi_title_def % self.default_str


        # Aspect ratio properties
        #
        self.cnt  = 0
       
        if hasattr(config, 'MPLAYER_ARGS_DEF'):
            self.args_def = config.MPLAYER_ARGS_DEF
        else:
            self.args_def = ''

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

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

        
        plugin.activate('video.mplayer_ppmenu.daemon')


    def vfp_opts_menu(self, menuw=None, arg=None):
        _debug_('vfp_opts_menu(self, menuw=%r, arg=%r)' % (menuw, arg), 1)

        menu_items = []
        for item in self.vfp_opts:
            menu_items += [ menu.MenuItem(item[0], action=self.select_vfp) ] 

        vfp_opts_menu = menu.Menu(_('Select Postprocessing Profile'), menu_items, item_types = 'video postprocessing menu')

        vfp_opts_menu.infoitem = self
        menuw.pushmenu(vfp_opts_menu)
        menuw.refresh()


    def vfi_opts_menu(self, menuw=None, arg=None):
        _debug_('vfi_opts_menu(self, menuw=%r, arg=%r)' % (menuw, arg), 1)

        menu_items = []
        for item in self.vfi_opts:
            menu_items += [ menu.MenuItem(item[0], action=self.select_vfi) ] 

        vfi_opts_menu = menu.Menu(_('Select Postprocessing Profile'), menu_items, item_types = 'video postprocessing menu')

        vfi_opts_menu.infoitem = self
        menuw.pushmenu(vfi_opts_menu)
        menuw.refresh()


    def select_vfp(self, arg=None, menuw=None):
        if menuw:
            item = menuw.all_items.index(menuw.menustack[-1].selected)
            self.vfp_opt = self.vfp_opts[item]

            if self.vfp_opt[0] == self.default_str:
                config.MPLAYER_VF_PROGRESSIVE = self.vfp_args_def
            else:
                config.MPLAYER_VF_PROGRESSIVE = self.vfp_opt[1]

            str = self.vfp_opt[0]

            _debug_('VF_PROGRESSIVE command string for mplayer:  %s' % config.MPLAYER_VF_PROGRESSIVE)

            self.vfp_title = self.vfp_title_def % str
            menuw.menustack[-2].selected.name = self.vfp_title

            menuw.back_one_menu(arg='reload')


    def select_vfi(self, arg=None, menuw=None):
        if menuw:
            item = menuw.all_items.index(menuw.menustack[-1].selected)
            self.vfi_opt = self.vfi_opts[item]

            if self.vfi_opt[0] == self.default_str:
                config.MPLAYER_VF_INTERLACED = self.vfi_args_def
            else:
                config.MPLAYER_VF_INTERLACED = self.vfi_opt[1]

            str = self.vfi_opt[0]

            _debug_('VF_INTERLACED command string for mplayer:  %s' % config.MPLAYER_VF_PROGRESSIVE)

            self.vfi_title = self.vfi_title_def % str
            menuw.menustack[-2].selected.name = self.vfi_title

            menuw.back_one_menu(arg='reload')

    
    def set_default_vfp_options(self):
        self.vfp_opt = None
        self.vfp_title = self.vfp_title_def % self.default_str
        config.MPLAYER_VF_PROGRESSIVE = self.vfp_args_def


    def set_default_vfi_options(self):
        self.vfi_opt = None
        self.vfi_title = self.vfi_title_def % self.default_str
        config.MPLAYER_VF_INTERLACED = self.vfi_args_def


    def aspect(self, arg=None, menuw=None):
        
        self.cnt += 1
        self.ratio = self.ratios[self.cnt % len(self.ratios)]

        if self.ratio == self.ratios[0]:
            config.MPLAYER_ARGS_DEF = self.args_def
        else:
            config.MPLAYER_ARGS_DEF = (self.args_def + ' -aspect ' + self.ratio)
        _debug_('Aspect command string for mplayer:  %s' % config.MPLAYER_ARGS_DEF)
        if self.ratio == self.ratios[0]:
            str = self.default_str
        else:
            str = self.ratio

        self.title = self.title_def % str
        
        menuw.menustack[-1].selected.name = self.title
        self.skin.force_redraw = True
        self.skin.draw('menu', menuw)


    def set_default_ratio(self):
        self.cnt = 0
        self.ratio = self.ratios[0]
        self.title = self.title_def % self.default_str
        config.MPLAYER_ARGS_DEF = self.args_def


    def actions(self, item):
        self.item = item
        myactions = []

        if item.type == 'video':
            myactions.append((self.aspect, self.title))
            if item['deinterlace']:
                myactions.append((self.vfi_opts_menu, self.vfi_title))
            else:
                myactions.append((self.vfp_opts_menu, self.vfp_title))

        return myactions


class daemon(plugin.DaemonPlugin):
    """
    Defaults the post processing string if going back on the menu
    """

    def __init__(self):
        plugin.DaemonPlugin.__init__(self)
        self.plugin_name = 'video.mplayer_ppmenu.daemon'
        self.event_listener = True


    def eventhandler(self, event, menuw=None):
        _debug_("Saw %s" % event)
        if event in (em.MENU_GOTO_MAINMENU, em.MENU_BACK_ONE_MENU):
            plug = plugin.getbyname('video.mplayer_ppmenu.item')
            if plug:
                _debug_('Changing to default post-processing and ratio options')
                plug.set_default_vfp_options()
                plug.set_default_vfi_options()
                plug.set_default_ratio()

        return False

Attachment: signature.asc
Description: Digital signature

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Freevo-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-users

Reply via email to