FYI, this is a patch to freevo-1.x source to add an "ASPECT" event to cycle
through 4/3, 16/9, 2:35, 0 (original) aspect ratios. It works for
mplayer video player
only.

To assign it to a remote button, define something like this in your lircrc file:

begin
    prog   = freevo
    button = Aspect
    repeat = 0
    config = ASPECT
end

Best regards
Toan




Index: freevo/src/video/plugins/mplayer.py
===================================================================
--- freevo/src/video/plugins/mplayer.py (revision 11675)
+++ freevo/src/video/plugins/mplayer.py (working copy)
@@ -76,6 +76,8 @@
         self.plugins    = []
         self.paused     = False
         self.stored_time_info = None
+       self.aspect     = 0
+       self.aspectlist = ["0", "1.3333", "1.7778", "2.35"]


     def rate(self, item):
@@ -124,6 +126,7 @@
         self.item_info    = None
         self.item_length  = -1
         self.item.elapsed = 0
+        self.aspect = 0

         if mode == 'file':
             url = item.url[6:]
@@ -525,6 +543,11 @@
             self.show_message(event.arg)
             return True

+        if event == VIDEO_ASPECT:
+            self.aspect = (self.aspect + 1) % 4
+            self.app.write('switch_ratio %s\n' % self.aspectlist[self.aspect])
+            return True
+
         # nothing found? Try the eventhandler of the object who called us
         return self.item.eventhandler(event)

Index: freevo/src/event.py
===================================================================
--- freevo/src/event.py (revision 11675)
+++ freevo/src/event.py (working copy)
@@ -191,6 +191,7 @@
 VIDEO_TOGGLE_INTERLACE = Event('VIDEO_TOGGLE_INTERLACE')
 VIDEO_NEXT_ANGLE       = Event('VIDEO_NEXT_ANGLE')
 VIDEO_AVSYNC           = Event('VIDEO_AVSYNC')
+VIDEO_ASPECT           = Event('VIDEO_ASPECT')
 STORE_BOOKMARK         = Event('STORE_BOOKMARK')
 MENU                   = Event('MENU')

@@ -390,6 +391,7 @@
     'SUBTITLE'  : VIDEO_NEXT_SUBTITLE,
     'AVSYNC+'   : Event(VIDEO_AVSYNC, arg=0.100),
     'AVSYNC-'   : Event(VIDEO_AVSYNC, arg=-0.100),
+    'ASPECT'    : VIDEO_ASPECT,
     }

 DVD_EVENTS = {

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
Freevo-users mailing list
Freevo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freevo-users

Reply via email to