TiVo Community
TiVo Community
TiVo Community
Go Back   TiVo Community > Underground Playground > Developers Corner
TiVo Community
Reply
Forum Jump
 
Thread Tools
Old 04-03-2011, 06:35 PM   #151
orangeboy
yes, I AM orangeboy!
 
Join Date: Apr 2004
Location: Moline, IL
Posts: 4,075
I added this to __init__.py close to the beginning (at line 25):

Code:
p = os.path.dirname(__file__)
and altered the Images class:
Code:
class Images:
	def __init__(self, app):
		self.Background = Image(app, os.path.join(p, 'background.png'))
		self.CueUp      = Image(app, os.path.join(p, 'cueup.png'))
		self.CueDown    = Image(app, os.path.join(p, 'cuedown.png'))
		self.CueLeft    = Image(app, os.path.join(p, 'cueleft.png'))
		self.HiLite     = Image(app, os.path.join(p, 'hilite.png'))
		self.MenuBkg    = Image(app, os.path.join(p, 'menubkg.png'))
		self.IconFolder = Image(app, os.path.join(p, 'folder.png'))
		self.IconVideo  = Image(app, os.path.join(p, 'video.png'))
This alleviated this problem in Windows:
Code:
IOError: [Errno 2] No such file or directory: 'vidmgr/background.png'
I like what I see so far!

I ended up hard-coding the *full path* to my config.ini in Start.py to get ConfigParser to work.
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
orangeboy is offline   Reply With Quote
Old 04-03-2011, 07:19 PM   #152
jbernardis
Registered User
 
Join Date: Oct 2003
Location: Princeton NJ
Posts: 1,064
I didn't have any such problems on my system. Did you organize your files differently than what wmcbrine was expectiing? On my system, vidmgr was a subdirectory of the main pyhme directory.

In any event, I felt that the changes you suggested make the code more defensive and so they have already been added to the repository.
__________________
2 Series 3
1 HDTivo
1 Series 1 (Lifetime)
1 Win7 HTPC with Ceton Quad Tuner


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
jbernardis is offline   Reply With Quote
Old 04-03-2011, 07:36 PM   #153
orangeboy
yes, I AM orangeboy!
 
Join Date: Apr 2004
Location: Moline, IL
Posts: 4,075
Quote:
Originally Posted by jbernardis View Post
I didn't have any such problems on my system. Did you organize your files differently than what wmcbrine was expectiing? On my system, vidmgr was a subdirectory of the main pyhme directory.

In any event, I felt that the changes you suggested make the code more defensive and so they have already been added to the repository.
I put vidmgr as a subdirectory, too. It may be an issue with embedded spaces in the path. I had problems with HME for Python's start.py finding config.ini as well. Here's the result of a Window's "Tree" command:
Code:
Sun 04/03
19:30:00=>Tree /A /F "D:\Program Files\HME for Python .19"
Folder PATH listing for volume Recovery
Volume serial number is 006E006F 7887:9D2E
D:\PROGRAM FILES\HME FOR PYTHON .19
|   config.ini
|   hme.py
|   hme.pyc
|   metadata.py
|   metadata.pyc
|   README.txt
|   start.py
|   Zeroconf.py
|   Zeroconf.pyc
|
+---animate
|       icon.png
|       __init__.py
|       __init__.pyc
|
+---clock
|       icon.png
|       __init__.py
|       __init__.pyc
|
+---effects
|       icon.png
|       __init__.py
|       __init__.pyc
|
+---fontinfo
|       icon.png
|       __init__.py
|       __init__.pyc
|
+---hello
|       icon.png
|       __init__.py
|       __init__.pyc
|
+---picture
|       icon.png
|       __init__.py
|       __init__.pyc
|
+---test
|       back1.jpg
|       icon.png
|       __init__.py
|       __init__.pyc
|
+---tictactoe
|       bg.jpg
|       grid.png
|       icon.png
|       __init__.py
|       __init__.pyc
|
+---transition
|       icon.png
|       __init__.py
|       __init__.pyc
|
\---vidmgr
        background.png
        cuedown.png
        cueleft.png
        cueup.png
        folder.png
        hilite.png
        icon.png
        menubkg.png
        pushmsgbkg.png
        video.png
        __init__.py
        __init__.pyc
Regardless, I'm "pushing" from the TiVo interface! I like it!
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
orangeboy is offline   Reply With Quote
Old 04-03-2011, 08:29 PM   #154
jbernardis
Registered User
 
Join Date: Oct 2003
Location: Princeton NJ
Posts: 1,064
Quote:
Originally Posted by orangeboy View Post
Regardless, I'm "pushing" from the TiVo interface! I like it!
Glad you like it. I know it still has a few rough edges, but I thought I'd get it out there.
__________________
2 Series 3
1 HDTivo
1 Series 1 (Lifetime)
1 Win7 HTPC with Ceton Quad Tuner


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
jbernardis is offline   Reply With Quote
Old 04-04-2011, 06:20 AM   #155
Allanon
Registered User
 
Join Date: Nov 2005
Posts: 531
Jbernardis, worked fine for me and I didn't have to modify the code, good work. I really have no use for this program since I usually just push from my computer once I download a video or use pyTivo's interface from the Tivo. I don't think I ever was at my Tivo thinking I really need to send a video to the other Tivo right now. What I really could use is a program that allows me to transfer a show from the Tivo I'm watching to another Tivo on the network. I know this could probably be done by downloading the show then pushing it to the other Tivo but that would probably take a lot longer than a MRV transfer. Is there anyway to fake a Tivo MRV file request?
Allanon is offline   Reply With Quote
Old 04-04-2011, 02:18 PM   #156
jbernardis
Registered User
 
Join Date: Oct 2003
Location: Princeton NJ
Posts: 1,064
Thanks for the kind words!

Regarding your request, I can't imagine how you would fake out the receiving tivo. The sending tivo - yes - but the receiving tivo is the one usually initiating the request, so to have it suddenly be presented with an inbound MRV request? I don't know how that would be done.

OTOH, you could as you suggest, write an HME app to initiate a pull to the HME server and then a push to the recipient tivo. This sounds pretty complicated, and it would take a while since the transfers would have to take place successively.

Regarding code modifications, I THINK orangeboy's issue was that the pyhme directory was not the current directory. After thinking about it, I think that would cause the symptoms he describes.
__________________
2 Series 3
1 HDTivo
1 Series 1 (Lifetime)
1 Win7 HTPC with Ceton Quad Tuner


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
jbernardis is offline   Reply With Quote
Old 04-04-2011, 02:43 PM   #157
orangeboy
yes, I AM orangeboy!
 
Join Date: Apr 2004
Location: Moline, IL
Posts: 4,075
Quote:
Originally Posted by jbernardis View Post
Regarding code modifications, I THINK orangeboy's issue was that the pyhme directory was not the current directory. After thinking about it, I think that would cause the symptoms he describes.
That makes sense. I was invoking start.py from a command line:

Code:
Sun 04/03
19:43:08=>"D:\Program Files\HME for Python .19\start.py"
HME Server for Python 0.19
Sun Apr 03 19:43:10 2011 Server Starts
Registering: vidmgr

__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
orangeboy is offline   Reply With Quote
Old 04-04-2011, 04:13 PM   #158
jbernardis
Registered User
 
Join Date: Oct 2003
Location: Princeton NJ
Posts: 1,064
I created an init.d startup script that changes into the installation directory before trying to start up hme. Basically it's the same script I use to start up pytivo - I just changed the directory and all occurrences of pytivo.py to start.py. I can post it when I get home if you're interested.

All that remains is to hook it into the actual system startup - I just wanted to be sure it was somewhat stable before I did that.
__________________
2 Series 3
1 HDTivo
1 Series 1 (Lifetime)
1 Win7 HTPC with Ceton Quad Tuner


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
jbernardis is offline   Reply With Quote
Old 04-19-2011, 08:38 AM   #159
jcthorne
Registered User
 
Join Date: Jan 2002
Location: Houston
Posts: 1,959
WOW. Finally got around to installing this and getting it working. THANKS!

Any chance you could enhance the app to display thumbnails and moviesheets for selection of items rather than a simple list? Tools for the creation of the moviesheets etc already exist, the app would need to display them. Let me know if this is something you could or would like to do, I am quite willing to help where I can.
__________________
Current : Roamio Base with 2TB drive and 2 Premieres and a mini. OTA. kmttg, pyTivo, running with a 78TB Synology 1511 NAS....serving up the world.

Setup help for pytivo under windows:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
jcthorne is online now   Reply With Quote
Old 04-19-2011, 02:55 PM   #160
jbernardis
Registered User
 
Join Date: Oct 2003
Location: Princeton NJ
Posts: 1,064
If you could give me some more information on moviesheets, I'll let you know. I'm not sure what they are or what would be involved in doing what you ask.

As far as thumbnails are concerned, I'm not sure I want to get into that. I am already leery of how long it takes to process each directory as they are traversed. Adding something like this (real-time processing of a video file) could be too expensive.

Of course I guess we could generate the thumbnails separately and just display them. I can experiment with something over the next few days to see what might be possible. I'm thinking that we need to define the image size, but if I find a file in the current directory with the same basename as the video file, but with an extension of say .jpg, then I could display it, perhaps instead of the ubiquitous dot. If no such file, just the dot gets displayed.
__________________
2 Series 3
1 HDTivo
1 Series 1 (Lifetime)
1 Win7 HTPC with Ceton Quad Tuner


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
jbernardis is offline   Reply With Quote
Old 04-19-2011, 06:36 PM   #161
jcthorne
Registered User
 
Join Date: Jan 2002
Location: Houston
Posts: 1,959
Crazy.2008.720p.mp4_sheet.jpg

Crazy.2008.720p.jpg

Check out a tool called Thumbgen. Its popular for use in generating thumbnails and moviesheets for the WDTV Live media player and others. It auto gathers the information and graphics from various web sites and assembles the sheet and thumbnail files. The player just associates the media file name with the two jpg files using the name convention shown in the two examples attached.

The files all have to be generated before hand, not on the fly so there is little overhead. By example the processer in the WDTV Live is much less powerful than the tivo.

On the WDTV live, the thumbnails are displayed in a row across the bottom and the movie sheet is displayed for the thumbnail currently selected and changes as the arrow keys are pressed to move to a different thumbnail.

This is what I had in mind but realize its a big step. Perhaps just the thumbnail to start?
__________________
Current : Roamio Base with 2TB drive and 2 Premieres and a mini. OTA. kmttg, pyTivo, running with a 78TB Synology 1511 NAS....serving up the world.

Setup help for pytivo under windows:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
jcthorne is online now   Reply With Quote
Old 04-19-2011, 09:49 PM   #162
jbernardis
Registered User
 
Join Date: Oct 2003
Location: Princeton NJ
Posts: 1,064
I played around with a simple thumbnail - I generated a 57x32 png file from a video snapsnot. (57x32 maintains the 16x9 aspect ratio and is as tall as I could get in the existing 32 pixel height of the current screen design).

It actually wasn't that good. First of all, the HME as I understand it only gives you an SD resolution of 640x480. This has two issues: 1) limited resolution and real estate, amd 2) the image is actually stretched to fit onto a true 16x9 display. I am not at this time interested in making such massive changes to the interface I presently have.

I might consider adding a screenshot to the video details page where I have more real estate to play with. This is more in line with your example anyway.
__________________
2 Series 3
1 HDTivo
1 Series 1 (Lifetime)
1 Win7 HTPC with Ceton Quad Tuner


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
jbernardis is offline   Reply With Quote
Old 04-20-2011, 03:28 AM   #163
wmcbrine
Resistance Useless
 
wmcbrine's Avatar
 
Join Date: Aug 2003
Posts: 9,115
Quote:
Originally Posted by jbernardis View Post
First of all, the HME as I understand it only gives you an SD resolution of 640x480.
That's the default, but it's not limited to that. See the "picture" example app, Reversi, and HME/VLC for programs that do HD using HME for Python. For most cases you can use the handle_resolution() function from the picture app. (1280x720 is the highest HME resolution for Series 3 and 4... this is the resolution for the text and graphics overlay, not to be confused with the background video, which is independent of the overlay's resolution.)

BTW, you also need to be aware of the "safe areas", which currently your app is not -- text should be within the title-safe area. (On my TV, your title is partly off-screen.)

Re: thumbnail images, we added the "image" keyword to the pyTivo metadata spec for the benefit of Streambaby, so you could use that. I've never heard of this "moviesheet" thing, and would be curious to know more.

If you're going to continue developing this app, maybe it should have its own thread?
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Last edited by wmcbrine : 04-20-2011 at 03:51 AM.
wmcbrine is offline   Reply With Quote
Old 04-20-2011, 05:18 AM   #164
jcthorne
Registered User
 
Join Date: Jan 2002
Location: Houston
Posts: 1,959
Quote:
Originally Posted by wmcbrine View Post
I've never heard of this "moviesheet" thing, and would be curious to know more.
Here is a forum topic that discusses moviesheets as relates to the WDTV series of media players. Includes templates for many user generated formats, how to's etc. If I can help in any way, I'd be glad to.

http://forum.wdlxtv.com/viewforum.php?f=18

I mostly got involved with the WDTV Live as it was one of the few hardware media players that could play HD mp4 files with ac3 audio in the same format as Tivo. As all video is stored on our server in this format, this becomes a tivo extender box of sorts. it has a bunch of additional capability for other things as well that I really have not made use of. It does a great job of presenting and playing tivo compatible video files in our motorhome though.
__________________
Current : Roamio Base with 2TB drive and 2 Premieres and a mini. OTA. kmttg, pyTivo, running with a 78TB Synology 1511 NAS....serving up the world.

Setup help for pytivo under windows:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
jcthorne is online now   Reply With Quote
Old 04-20-2011, 04:49 PM   #165
jbernardis
Registered User
 
Join Date: Oct 2003
Location: Princeton NJ
Posts: 1,064
Quote:
Originally Posted by wmcbrine View Post
If you're going to continue developing this app...
It was never my intent to continue to develop this app. This is exactly what I feared when orangeboy convinced me to post it. The source code is there - people can take it and do what they want with it. It does what I want it to do and I'm not interested in making it everything for everyone.

I WILL look into the HD resolutions, because that is what my TV's are - so thanks for that. But, for example, I will not be interested in making the app "sense" its environment and operate in SD mode for some or HD mode for others. It is what it is.

I will also investigate the use of safe areas. I noticed the safe areas on the simulator, but frankly didn't pay them much attention (again - it was working fine on MY tv's).

If I post an update to the app, I will do so in a separate thread. I had thought that all along.
__________________
2 Series 3
1 HDTivo
1 Series 1 (Lifetime)
1 Win7 HTPC with Ceton Quad Tuner


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
jbernardis is offline   Reply With Quote
Old 04-20-2011, 06:45 PM   #166
jcthorne
Registered User
 
Join Date: Jan 2002
Location: Houston
Posts: 1,959
No problem. I really appreciate what you have contributed so far as do others. I can full well understand not wanting to take on someone ELSES project when it was just something you needed and decided to share. Please let us know if you implement the HD interface as that would greatly enhance the look of the menus.
__________________
Current : Roamio Base with 2TB drive and 2 Premieres and a mini. OTA. kmttg, pyTivo, running with a 78TB Synology 1511 NAS....serving up the world.

Setup help for pytivo under windows:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
jcthorne is online now   Reply With Quote
Old 05-26-2011, 11:29 AM   #167
jbernardis
Registered User
 
Join Date: Oct 2003
Location: Princeton NJ
Posts: 1,064
Question: just playing around with the HME, I was trying to play an mp3 file. The interface to the Stream class wants a URI though - not a simple file name. I tried every variant of the 'file;' URI that I could think of. I took a look at the examples, but there is no example of playing an MP3. I looked at the Tivo Java HME documentation and sample code, and tried changing the URI to the base URI of the app followed by a file path, but nothing I did seemed to work.

How do I provide a file to the Stream class???

If I am able to implement what I am thinking, this will ultimately run on my NAS in a linux environment. Right now, however, I am developing/debugging in Windows 7.
__________________
2 Series 3
1 HDTivo
1 Series 1 (Lifetime)
1 Win7 HTPC with Ceton Quad Tuner


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
jbernardis is offline   Reply With Quote
Old 05-26-2011, 03:26 PM   #168
wmcbrine
Resistance Useless
 
wmcbrine's Avatar
 
Join Date: Aug 2003
Posts: 9,115
Take a look at HME/VLC to see how it's done. (I get the feeling, based on some of the other things you did with your app, that you've never looked at it. You really should.)

The key is to define "datapath" (a command-line or config.ini option for start.py). As it says in start.py, "The default is to not allow any access outside of the app directories." I designed this as a security feature, so that one could put up an HME app without unintentionally exposing one's whole drive to the Internet. HME/VLC sets the datapath to "/" by default instead, with the idea that it will only ever be run on a LAN, and this will make configuration easier. But the whole system doesn't play well with Windows and its stupid drive letters -- basically, you can only expose one drive at a time with start.py. (However, you can have apps on one drive, and data on another.)

Here's the core part where a file path is converted to a URL by HME/VLC (in hmevlc/__init__.py):

Code:
url = url.replace(self.context.server.datapath, '', 1)
url = 'http://%s/%s' % (self.context.headers['host'],
                        urllib.quote(url.encode('utf-8')))
The conversion back (on receiving a request) is handled by start.py.

P.S. Oh, but when you said you "tried changing the URI to the base URI of the app followed by a file path" -- that should have worked, even without setting the datapath. I guess I'd have to see exactly what you were sending to know why it didn't work, but if you can see the "icon.png" requests in your log, those are the right form (and if you're seeing an icon, then it's working).
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Last edited by wmcbrine : 05-26-2011 at 03:36 PM.
wmcbrine is offline   Reply With Quote
Old 05-29-2011, 03:29 PM   #169
lrhorer
Registered User
 
Join Date: Aug 2003
Location: San Antonio, Texas, USA
Posts: 6,885
Quote:
Originally Posted by jbernardis View Post
It was never my intent to continue to develop this app. This is exactly what I feared when orangeboy convinced me to post it. The source code is there - people can take it and do what they want with it. It does what I want it to do and I'm not interested in making it everything for everyone.
Fair enough, but the app could definitely use a little development. So far, the one thing I see that the app really needs is a "Please wait" splash when it receives a valid command. Often it takes quite a while - 30 seconds or more - to implement the received command. During that time, the user is unsure if the system is processing the command, or if the command was just lost. Lost commands are extremely common with IR control systems, so even in the very short time I have been testing this app, I have several times inadvertently entered several commands into the command buffer, not knowing whether the unit had recognized the button press, or not.

I'm also having a problem with the system locking up whenever I try to go into a particular one of the shares. I need to investigate.

Is there anyone out there who would like to pick up development of this app and maybe start a development thread?
lrhorer is offline   Reply With Quote
Old 05-30-2011, 12:09 PM   #170
lrhorer
Registered User
 
Join Date: Aug 2003
Location: San Antonio, Texas, USA
Posts: 6,885
Restart pyhme?

Question: If I hard restart pyTivo - that is to say completely kill the python process and start it again, should I re-start pyhme?
lrhorer is offline   Reply With Quote
Old 05-30-2011, 01:08 PM   #171
wmcbrine
Resistance Useless
 
wmcbrine's Avatar
 
Join Date: Aug 2003
Posts: 9,115
lrhorer, I think you want this thread.
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
wmcbrine is offline   Reply With Quote
Old 06-03-2011, 02:33 AM   #172
Allanon
Registered User
 
Join Date: Nov 2005
Posts: 531
Wmcbrine, I am using your Apples and Oranges ListView code from HME/VLC Video Streamer. It works fine except when trying to change icons from one menu to another. The only modification I made was to go fetch the icon from a web server, save it to disk, and then assign the image as a icon. Here is the code I changed:

Code:
  def redraw(self):
        hme.Color(self.app, 0xcfcfcf)
        count = 0
        for i, item in enumerate(self.items[self.startpos:self.startpos +
                                            self.pagesize]):
            self.page[i][0].remove_resource()
            self.page[i][0].set_text(item['title'], flags=hme.RSRC_HALIGN_LEFT)
            if 'icon' in item:
                name = 'tempicon'+str(count)+'.png'
                urllib.urlretrieve(item['icon'],name)
                im = Image.open(name)
                newim = im.resize((self.icon_width, self.bar_height))
                newim.save(name, "png")
                self.page[i][1].set_image(name)
                count = count + 1
            else:
                self.page[i][1].clear_resource()
        hme.Color(self.app)
        self.upwin.set_visible(self.startpos > 0)
        self.downwin.set_visible(len(self.items) >
                                 self.startpos + self.pagesize)
This works fine on the first menu but when I select a menu item and go to the next menu then the icons are the same as the first menu. If there are more menu items in the second menu then it displays icons from the first menu for however many menu items were in the first menu and displays the correct icons for the remaining menu items. If I page down then page back up in the menu then the icons are shown correctly.

I tried removing and clearing the resource before setting the image but that didn't help. The only thing that seems to work is to call redraw twice then the menu icons are correct. Is there a better way to update the icon images?

Also, do you think it would be advantageous to do all the menu, text, and icon drawing to one or two large bitmaps then write them to the Tivo opposed to writing a lot of small bitmaps to the Tivo and have it position them and the text? I could just move a semi-transparent view over the bitmaps to act as a menu selection bar. The program I'm working on can have a lot of menu items with a lot of different icons.

Another question: Do you know of a way to download a bitmap from the web and send it to the Tivo without writing it to a local hard drive? It would be great if I didn't have to save the icon images to disk before sending them to the Tivo.
Allanon is offline   Reply With Quote
Old 06-03-2011, 01:41 PM   #173
jbernardis
Registered User
 
Join Date: Oct 2003
Location: Princeton NJ
Posts: 1,064
I looked at the sample animation applet that comes with the python HME, and it appears to be reliant of the main app processing its message loop. Am I right in saying that if I am doing a busy task, I would need to periodically yield control so that the waiting internal "send_keys" can be processed. If I don't yield control, only the initial animation would occur, and the send key event would not be processed until my task was completed.

If this is true, one thing that occurs to me would be to have a long-running animation - one that would cover the longest duration I would reasonably expect. But if my task completes before that animation completes, would I be able to stop the animation by just making its view invisible (or something along those lines)?

Otherwise, I can just use a static view for my purpose.
__________________
2 Series 3
1 HDTivo
1 Series 1 (Lifetime)
1 Win7 HTPC with Ceton Quad Tuner


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
jbernardis is offline   Reply With Quote
Old 06-03-2011, 03:23 PM   #174
wmcbrine
Resistance Useless
 
wmcbrine's Avatar
 
Join Date: Aug 2003
Posts: 9,115
Quote:
Originally Posted by Allanon View Post
This works fine on the first menu but when I select a menu item and go to the next menu then the icons are the same as the first menu.
I'd prefer to leave redraw() (and the rest of ListView) alone, and build the list of icons beforehand. Anyway, I believe what's happening is that you're reusing cached names, so the HME module sees them as the same, and doesn't resend them to the TiVo.

Quote:
Also, do you think it would be advantageous to do all the menu, text, and icon drawing to one or two large bitmaps then write them to the Tivo opposed to writing a lot of small bitmaps to the Tivo and have it position them and the text?
In case it wasn't clear from what I said here, I thought that the all-in-one background image "solution" that TiVo used for keyboards in Bananas was goofy. So no, I wouldn't think that was better. But it all depends... There are limits on the number of resources you can use, including views, but that's mainly an issue for the Series 2.

Quote:
Another question: Do you know of a way to download a bitmap from the web and send it to the Tivo without writing it to a local hard drive?
Sure. The hme.Image resource will take three kinds of initializers: name, file object, or actual image data. Incidentally, only the named images are cached, so using one of the other methods would solve your original problem as a side effect.

urllib will of course also allow you to pull an image directly into memory, without saving it to disk. The sticking point then might be PIL. What I did in pyTivo, to generate thumbnails in the photo plugin, was to work around that by using StringIO():

Code:
out = StringIO()
pic.save(out, 'JPEG')
encoded = out.getvalue()
out.close()

__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
wmcbrine is offline   Reply With Quote
Old 06-03-2011, 03:42 PM   #175
wmcbrine
Resistance Useless
 
wmcbrine's Avatar
 
Join Date: Aug 2003
Posts: 9,115
Quote:
Originally Posted by jbernardis View Post
Am I right in saying that if I am doing a busy task, I would need to periodically yield control so that the waiting internal "send_keys" can be processed.
Yes. But that's what threads are for.

The "Loading..." screen in HME/VLC gives a nice example of an animation running while waiting on something else to happen, although it doesn't depend on threads, because both processes are asynchronous. Note in particular loadbar_anim() in hmevid.py. What happens is that it first checks if the animation is active, and if so, it updates it and schedules another callback. Meanwhile, the main event (loading the stream) sends its own event when it's done, which causes HME/VLC to remove the animation, setting loadbar = None. loadbar_anim() is then invoked again, as expected, at its next scheduled time, but it sees that the loadbar is inactive, so it does nothing, and no more calls to it are scheduled.
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
wmcbrine is offline   Reply With Quote
Old 06-04-2011, 12:18 AM   #176
Allanon
Registered User
 
Join Date: Nov 2005
Posts: 531
Wmcbrine thanks for the reply, you were correct when suggesting the problem was due to reusing cached names. I also used your advice and now the icon images are read from the web to memory and then to the Tivo without writing to local storage. Thanks again.
Allanon is offline   Reply With Quote
Old 06-16-2011, 11:14 AM   #177
jcthorne
Registered User
 
Join Date: Jan 2002
Location: Houston
Posts: 1,959
I could use some help getting HME for Python running correctly under linux on my Synology NAS. If it matters, the shell is BusyBox v1.16.1 and its an x86 Intel Atom based NAS.

If I start HME from a command line using these two commands:

Code:
cd /usr/local/pythonHME/
nohup /opt/bin/python /usr/local/pythonHME/start.py
It starts and runs fine.

If I create a startHME.sh script file and run it at boot up by placing it in the /usr/syno/etc/rc.d/ directory;

Code:
`sleep 60`
cd /usr/local/pythonHME
/opt/bin/python /usr/local/pythonHME/start.py > /usr/local/pyhme.log 2>&1 &
HME for python starts but it ignores the config file. running the script from a command line yields the errors:

Code:
: not foundtc/rc.d/startHME.sh: line 1: 
/usr/syno/etc/rc.d/startHME.sh: cd: line 2: can't cd to /usr/local/pythonHME
: not foundtc/rc.d/startHME.sh: line 3:
Suggestions and help?
__________________
Current : Roamio Base with 2TB drive and 2 Premieres and a mini. OTA. kmttg, pyTivo, running with a 78TB Synology 1511 NAS....serving up the world.

Setup help for pytivo under windows:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
jcthorne is online now   Reply With Quote
Old 06-16-2011, 11:42 AM   #178
windracer
joined the 10k club
 
windracer's Avatar
 
Join Date: Jan 2003
Location: St. Pete, FL
Posts: 11,261
Do you need to invoke a shell in Busybox like in Linux? In other words, do you need something like
Code:
#!/bin/sh
on the first line of your script so it invokes the interpreter?
__________________
840~Roamio Pro (TA, MoCA) + two A92~Minis, 758~Premiere XL4 (TA, MoCA)
S/old: 746~S4, 658~HDXL, 648~OLED S3, 565~TX20, 230~S2, 140~S2

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
windracer is offline   Reply With Quote
Old 06-16-2011, 12:01 PM   #179
jbernardis
Registered User
 
Join Date: Oct 2003
Location: Princeton NJ
Posts: 1,064
The other question is what are the permissions on the directroies and what user ID is being user interactively versus at boot-up.

If you cd to /usr/local and do 'ls -ld pythonHME' what do you see

incidentally - did you make a mistake when you copied the sleep error message - your posting just says 'leep' not 'sleep'. Did you edit the file correctly when you removed the ticks?

One other thing - are you editing this file on windows and transferring to Linux, or are you editing on Linux. I have seen situations where a file transferred from a PC to Linux has CR/LF at the end of every line - and thtis has thrown off various shell interpreters.

DO you have the od command available? If you try 'od -c startHME.sh' what do you see'?
__________________
2 Series 3
1 HDTivo
1 Series 1 (Lifetime)
1 Win7 HTPC with Ceton Quad Tuner


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
jbernardis is offline   Reply With Quote
Old 06-16-2011, 12:33 PM   #180
jcthorne
Registered User
 
Join Date: Jan 2002
Location: Houston
Posts: 1,959
Quote:
Originally Posted by jbernardis View Post
The other question is what are the permissions on the directroies and what user ID is being user interactively versus at boot-up.

If you cd to /usr/local and do 'ls -ld pythonHME' what do you see
This is the result of that query:

drwxr-xr-x 12 root root 4096 Jun 16 09:20 pythonHME

Quote:
Originally Posted by jbernardis View Post
incidentally - did you make a mistake when you copied the sleep error message - your posting just says 'leep' not 'sleep'. Did you edit the file correctly when you removed the ticks?
No, that is what is so strange, without the ticks, it gives that error message with the missing s. With the tick marks the sleep command actually runs, executed in the script either at boot up or in the command line.

Quote:
Originally Posted by jbernardis View Post
One other thing - are you editing this file on windows and transferring to Linux, or are you editing on Linux. I have seen situations where a file transferred from a PC to Linux has CR/LF at the end of every line - and thtis has thrown off various shell interpreters.
This may be the problem. Yes I am using notepad in windows to edit the scripts and then cp them into place on the NAS. I do not know how to edit the file from the NAS side command prompt. Any suggestions for editor on either side that I can use/install?

Quote:
Originally Posted by jbernardis View Post
DO you have the od command available? If you try 'od -c startHME.sh' what do you see'?
-ash: od: not found
__________________
Current : Roamio Base with 2TB drive and 2 Premieres and a mini. OTA. kmttg, pyTivo, running with a 78TB Synology 1511 NAS....serving up the world.

Setup help for pytivo under windows:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Last edited by jcthorne : 06-16-2011 at 12:51 PM.
jcthorne is online now   Reply With Quote
Reply
Forum Jump




Thread Tools


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Advertisements

TiVo Community
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
vBulletin Skins by: Relivo Media

(C) 2013 Magenium Solutions - All Rights Reserved. No information may be posted elsewhere without written permission.
TiVoŽ is a registered trademark of TiVo Inc. This site is not owned or operated by TiVo Inc.
All times are GMT -5. The time now is 08:29 AM.
OUR NETWORK: MyOpenRouter | TechLore | SansaCommunity | RoboCommunity | MediaSmart Home | Explore3DTV | Dijit Community | DVR Playground |