EyeTV plugin

15 views
Skip to first unread message

Jon Christopher

unread,
Jan 8, 2008, 11:37:02 AM1/8/08
to frontpyth...@googlegroups.com
I've attached (yes, really this time) the current version of my plugin
for EyeTV.

John, it has several changes relative to the last version I sent you.
In particular, the AppPlugin class now has facilities for setting a user
timeout callback function so that code that needs to run *after* the app
has launched can be run. (In my case this is some applescript which
only works when the program is the frontmost application).

Also, instead of AppPlugin only returning when the launched application quits,
the user can install their own, additional, exit condition test. (In my case
more appscript which determines that the full-screen menu of EyeTV is
no longer visible).


My biggest question at this point is why we return to the top level of
Front Row when
an app launched from AppPlugin exits. The app was launched from a submenu and
I'd expect (and prefer) that that's where we return. Any idea why
that's not happening?
When I create the AppPlugin instance, I'm pushing it onto the stack
(in MainApp.py's
ShowGuide_MenuHandler function, for instance). Is seems that there
might be some
more work that AppPlugin needs to do to properly maintain the controller stack.

Cheers,
Jon

PyeTV.tar.gz

John Sutherland

unread,
Jan 8, 2008, 12:31:57 PM1/8/08
to frontpyth...@googlegroups.com
I haven;t had a chance to look at your code yet.. I will later
tonight... But I suspect its a product of the hide/unhide stuff with
FrontRow.. That is going to be a pain, but I can't think of any way
around it right now. Maybe if we remember the controller stack or
something, and somehow repush it when we unhide..

(consolidating emails here)...

Hrm.. I didn;t notice the BRTextEntryControl... There's even an IP
address one.. Neato.. I'll have to play with it. If it does what I
think its does, it'll certainly make life easier..

--John

> <PyeTV.tar.gz>

--John


Jon Christopher

unread,
Jan 9, 2008, 1:38:14 PM1/9/08
to frontpyth...@googlegroups.com
BRRenderScene has a setBackgroundRemoved function. I wonder if if
this might be useful...set a controller with no text or graphics
and then remove the background to allow what's underneath to show through.

Nah, probably not, since I'll bet remote commands would still be
handled by FR, not the underlying app.

Polar Bear

unread,
Jan 21, 2008, 8:18:00 PM1/21/08
to frontpython-discuss.
Hi Jon and John,

For quite a while I was annoyed by eyeTV's lack of integration with
FrontRow. Having TV access in FrontRow is kind of a building block for
a decent and usable media center.

Actually I even specifically bought the elgato Tuner because
somewehere in a review it mentioned "FrontRow integration", so I
expected an EyeTV menu item in FrontRow. I was then very disappointed
to experience that this is not the case anymore with newer releases of
EyeTV (2.5 and 3).

I finally researched the web and came about FrontPython which looked
like a good building block. A few days later EyeTV3 was released and
now finally the PyeTV system.

I understand that Jon's eyeTV frappliance is more targeting EyeTV2
rather the new version 3. With EyeTV3 I think a simple launch menu
item in FrontRow would do the job quite nice as all EyeTV related
functions can then be accessed from EyeTV3's new menu system.

I played around with both FrontPython, PyFR 2.7 and PyeTV 0.2 on my
Leopard iMac (latest FrontRow and latest EyeTV3).

Launching EyeTV using either PyeTV or PyFR 2.7's launcher works
somehow but not yet smoothly and satisfactory. I am Python developer
myself, so I am happy to contribute and help finding a better
solution. However the Backrow API is still a big mystery to me, so I
have to learn.

My goal would be only to have one simple Menu entry to launch and quit
EyeTV from FrontRow without to many delays and screen flickering. I
know that Jon is aiming at a more thorough integration, but with
EyeTV3 I don't see the point why to repeat the EyeTV3 menu
functionality. Maybe one can have it both ways: Simple and Advanced?

Launching EyeTV3 works with lots of screen flickering while the EyeTV
windows are opened and resized to full screen. Return to FrontRow
works but EyeTV is not properly terminated or hidden.

Q: Is there any chance to have FrontRow still keep the screen dimmed
black while EyeTV is starting up and going through the window resize
procedure so that there is a smooth transition between FrontRow's full
screen and EyeTV's full screen display?
Q: What would be the best way to terminate or hide EyeTV when going
back to FrontRow?

Jon Christopher

unread,
Jan 21, 2008, 11:16:46 PM1/21/08
to frontpyth...@googlegroups.com
This is probably more a question for me than John, so I'll respond in detail below.

I understand that Jon's eyeTV frappliance is more targeting EyeTV2
rather the new version 3. With EyeTV3 I think a simple launch menu
item in FrontRow would do the job quite nice as all EyeTV related
functions can then be accessed from EyeTV3's new menu system.

This is not strictly true. The interface I have will work equally well with EyeTV2
or EyeTV3.  EyeTV3's menu system, while nice, does have several serious flaws
in my opinion.

First, it's very difficult to delete a recording using the menu system (and impossible
to delete more than one at a time).  There are several threads on the Elgato forums
about this, but essentially the issue is pressing "menu" while watching a recording should
pull up a menu which has, at a minimum,  "Play, Restart, Delete" so that you can delete a
a recording seamlessly from watching it.  Currently, in order to delete using the EyeTV
menu system, you have to find the recording all over again in the menu tree, which could be a pain
if you have multiple recordings per series.

Also, many people prefer to have recordings grouped by series rather than all in one list.  Playlists may
help with this somewhat, but it's still a notable lack of EyeTV2/3's menu system.

There's no "Restart" item in the EyeTV 3 menu, and that's nice to have, too.
 
Finally, I'd like to seamlessly integrate the ability to turn on and off commercial skipping using my
etv-comskip project, also on google code, which means that the "play a recording screen" will have:

Play
Restart
Delete
Comskip [ On | Off ] options

I played around with both FrontPython, PyFR 2.7 and PyeTV 0.2 on my
Leopard iMac (latest FrontRow and latest EyeTV3).

Launching EyeTV using either PyeTV or PyFR 2.7's launcher works
somehow but not yet smoothly and satisfactory. I am Python developer
myself, so I am happy to contribute and help finding a better
solution. However the Backrow API is still a big mystery to me, so I
have to learn.

It would be nice to have a smoother transition between EyeTV and FR, I agree.  We're
working on this, in particular being able to return to the same place you left when you leave FR.
I welcome any assistance with EyeTV.  The best I can do is point you to the resources I've been using
to try to figure out what's going on:

The backrow developer's kit (really only for apple tv, but some concepts still apply): http://alanquatermain.net/brdevkit/
Awkward TV's wiki: http://wiki.awkwardtv.org/wiki/Main_Page
class-dump: http://www.codethecode.com/projects/class-dump/ for dumping your own copy of Back Row's headers

And there's always using EnableObjcLogger and inspecting the output in /tmp/msgSends-<PID> from a running Front Row.

The place to begin experimenting with this is in PyFR/Utilities.py, trying to replace _HideFrontRow with something which
works more like what you want.  One problem I've had is that (I could be wrong) some of the Apple Events I need to send EyeTV
seem to only be interpreted properly when EyeTV is the frontmost application, and that means that I can't send the commands
until after FR is hidden.  You might want to experiment with trying to send the applescript commands to play a recording in full-screen mode
(or just go to full-screen mode) before hiding FR.



My goal would be only to have one simple Menu entry to launch and quit
EyeTV from FrontRow without to many delays and screen flickering. I
know that Jon is aiming at a more thorough integration, but with
EyeTV3 I don't see the point why to repeat the EyeTV3 menu
functionality. Maybe one can have it both ways: Simple and Advanced?
 
This is exactly what the "Start EyeTV" option does in the current interface; you don't
have to use the "Recordings" menu if you don't want to.   Personally, I find it useful
to have shortcuts to pull up the program guide and to navigate recordings.

If you like, I could move Start EyeTV to the default option.

Launching EyeTV3 works with lots of screen flickering while the EyeTV
windows are opened and resized to full screen. Return to FrontRow
works but EyeTV is not properly terminated or hidden.

I'm not sure you want to actually quit EyeTV, as that brings in all sorts of other issues,
like what if you quit watching a recording while EyeTV is recording another show, or
exporting, or updating the guide, or any of a number of other cases.  I just don't think it's
appropriate to quit EyeTV when showing FR; after all, neither iTunes nor iPhoto  is
terminated when FR launches.

Q: Is there any chance to have FrontRow still keep the screen dimmed
black while EyeTV is starting up and going through the window resize
procedure so that there is a smooth transition between FrontRow's full
screen and EyeTV's full screen display?

I'd like this;  I think it's probably a bit more feasable to keep the screen dimmed while EyeTV is
spinning up than when spinning down.  It seems that EyeTV itself has code which jumps out
of full screen mode when FR is shown.  After all, if you show EyeTV in FS mode without PyeTV,
and then enter FR you get the same behavior as now.  I'd love to improve it but the aesthetics are
secondary to getting it working.
 

Jon Christopher

unread,
Jan 22, 2008, 1:07:28 AM1/22/08
to frontpyth...@googlegroups.com
The place to begin experimenting with this is in PyFR/Utilities.py, trying to replace _HideFrontRow with something which
works more like what you want.  One problem I've had is that (I could be wrong) some of the Apple Events I need to send EyeTV
seem to only be interpreted properly when EyeTV is the frontmost application, and that means that I can't send the commands
until after FR is hidden.  You might want to experiment with trying to send the applescript commands to play a recording in full-screen mode
(or just go to full-screen mode) before hiding FR.

Ah yes, on further investigation, the problem seems to be that EyeTV's "enter full screen"  apple event app("EyeTV").enter_full_screen() via appscript,
only works when there is a player window or a menu window already open; it doesn't trigger creation of a window.  The only way I know of to actually
open a window (the menu window) short of playing a recording, is to use UI scripting and send System Events the name of the menu item to invoke (or alternately the name of the keystroke to invoke).  I can only get UI scripting like this to work when EyeTV is the frontmost application, which seems impossible while Front Row is still up.   Sigh.

Please, please, prove me wrong!

heiko

unread,
Jan 22, 2008, 6:41:11 PM1/22/08
to frontpython-discuss.
Hi John, Hi Jon, Hi everybody!
i cant tell you guys how much i love the thing you are doing here and
how much i want you to make this projekt great (& comskip) !
unfortunately python is just a big mysthic to me so i cant help on
this side.
but quite a lot of my mediacenter (Mini G4) is based on Apllescript.
so i try to do my best here.

according opening a player_window in eyetv i have those scripts:

-- check if there is already a player_window
tell application "EyeTV"
if exists player_window 1 then
set is_visible to true
else
set is_visible to false
end if
end tell


-- open new player_window

tell application "EyeTV"
set full screen menu to true
-- enter full screen
end tell

maybe that helps.
Heiko

Jon Christopher

unread,
Jan 22, 2008, 7:43:18 PM1/22/08
to frontpyth...@googlegroups.com

Heiko,
Hey, thanks!

That's actually helpful.  My reading of the EyeTV dictionary had mislead me here; and your method works just fine.

Thanks,
Jon

Polar Bear

unread,
Jan 23, 2008, 8:49:06 AM1/23/08
to frontpython-discuss.
I also explored "best practice" solutions of launching EyeTV full
screen with the least amount of flickering and window opening.

My applescript for that is:

tell application "EyeTV"
activate # Required so remote control works
if not playing then
play
end if
enter full screen
hide mouse # Hide mouse on first screen which is blocked out,
requires XTool 2.0 OSAX
end tell

Using "play" to bring up the player window instead of "set full screen
menu to true" is preferred as play does not show the menu.
Reply all
Reply to author
Forward
0 new messages