Skin by [cer] (cer@home.tula.net) Our community
Welcome to WDTV Forum. Learn how to play any file on your WDTV Media Player
Pages: [1]
  Print  
Author Topic: OSD Development: XML Preview v0.4  (Read 2107 times)
Hero Member
*****
Posts: 643
« on: June 16, 2009, 01:27:34 AM »

This is for developers only. It is PHP/Javascript code that can load up DMA OSD XML files and create a quick preview so developers can us their favorite editors and quickly see what the OSD will look like.

REQUIREMENTS:

- Webserver with PHP

SETUP:

- Just extract the files on your webserver and open in your favorite browser

FEATURES:

- Handles following tags: PAGE, TEXT, IMAGE and INCLUDE, TABLE
- Handles following properties: x, y, w, h, fontsize, textcolor, alignment, lineheight and numlines
- Replaces number of default UI images
- Hide non-working images or use default_img if available
- Zoom factor to fit smaller screens
- Auto-zoom to fit window

Simple, yet useful to make simple layouts.

DOWNLOAD:

http://www.regeert.nl/wdtv/preview-v0.4.zip

These are actual screenshots of the preview running on my laptop:







« Last Edit: June 22, 2009, 03:37:43 AM by redindian » Logged

Full Member
***
Posts: 137
« Reply #1 on: June 16, 2009, 02:13:08 AM »

Wow! Thank you!

Good idea and great job!


Logged

Full Member
***
Posts: 135
« Reply #2 on: June 16, 2009, 02:34:27 AM »

Thanks.
Logged
Full Member
***
Posts: 175
« Reply #3 on: June 16, 2009, 10:08:09 AM »

Not yet tested but good idea Cool
Logged
Full Member
***
Posts: 135
« Reply #4 on: June 16, 2009, 01:30:48 PM »

I'm trying to replace @@ variables in XML with right picture in HTML generated page.
For example
'@@moreprev' becomes 'osd/image/browser_list_arrow_up.png'
'@@morenext' becomes 'osd/image/browser_list_arrow_down.png'

Is there any way to know all associations between variable names and pictures ?
This way, we can render more xml files.
Logged
Hero Member
*****
Posts: 500
« Reply #5 on: June 16, 2009, 02:55:54 PM »

Hi,

nice idea.
There seem to be some problems with Firefox. Also when using the default files some images are not displayed. See the attached screenshot.

ciao,
elm
Logged
Hero Member
*****
Posts: 643
« Reply #6 on: June 16, 2009, 11:01:11 PM »

@BMD_Online: I haven't gotten around replacing all @@ variables yet. You could easily define an array and do str_replace. Please share any modifications you're making.

@elmarweber: My bad, I made some last minute modifications, but didn't test it in Firefox. The first version was left aligned and then I thought it would be nice to have everything in the middle. The pictures should be within the zip file. Let me check again and post an update later.
Logged

Hero Member
*****
Posts: 643
« Reply #7 on: June 16, 2009, 11:22:29 PM »

Ok updated the download link. Fixed both alignment in Firefox and the images. In my dev setup I had the images also in /tmp/, but I changed that later to a relative path so you can keep alle OSD images and tmp files together.
Logged

Full Member
***
Posts: 135
« Reply #8 on: June 17, 2009, 12:38:40 AM »

@BMD_Online: I haven't gotten around replacing all @@ variables yet. You could easily define an array and do str_replace. Please share any modifications you're making.

@elmarweber: My bad, I made some last minute modifications, but didn't test it in Firefox. The first version was left aligned and then I thought it would be nice to have everything in the middle. The pictures should be within the zip file. Let me check again and post an update later.

Yes, I've added a replace step with @@ images.
But, I don't know which images link to which variables.

I've also disabled your osdImages replacement, and used directly to "osd/images".
In fact, I've disabled all your $Path replacements. Wink

It would be interesting to handle "table" tag. Do you think you can do it easily ?
That does not seem obvious. Huh

Logged
Hero Member
*****
Posts: 643
« Reply #9 on: June 17, 2009, 01:17:23 AM »

Updated to version 0.2!

I thought the audio_run.xml would be nice to show when you play a file using the upcoming webplay I'm working on. Then it looked horrible!

So moved some code around, added support for default_img, and made some little adjustments. Now it shows the audio_run.xml pretty nicely, see orginal post for screenshot and new download link.

@BMD_Online:

There is no quick fix for this I think. We'll have to built this array our selves. If you do let me know! ;-)
Tables shouldn't be too hard I think since they are basic HTML too. Would be good for browse pages.
Logged

Hero Member
*****
Posts: 643
« Reply #10 on: June 22, 2009, 03:08:22 AM »

Update to version 0.3!

Now handles tables and has auto-zoom to fit the window. Also added a couple of default image replacements. Not sure if they are supposed to be replaced like this, but it works for browse preview.

See new attached preview image for tables and default image replacement.
Logged

Hero Member
*****
Posts: 643
« Reply #11 on: June 22, 2009, 03:39:58 AM »

Ok, and version 0.4 Smiley

Thought I remove the images, but now I've added them again. All paths are first normalized to '/osd/image/' by the function and then you can replace that path to suit your specific need. Same for /tmp/ dir.
Logged

Hero Member
*****
Posts: 643
« Reply #12 on: June 22, 2009, 04:04:50 AM »

The Javascript supports tables with scale and scale_type attributes, but I couldn't get real good results, so I've disabled that for now. Then I later had to move some code to the PHP part, so maybe it works now. Go find out! Smiley
Logged

Newbie
*
Posts: 26
« Reply #13 on: June 22, 2009, 07:24:18 AM »

I'm getting an error:

Notice: Undefined variable: back in C:\wamp\www\wdtv\index.php on line 145
Logged
Hero Member
*****
Posts: 643
« Reply #14 on: June 22, 2009, 07:47:24 AM »

Fixed notice, just redownload.
Logged

Pages: [1]
  Print  
 
Jump to:  


MySql PHP XHTML CSS
MegaPolis theme by [cer]
Powered by SMF 1.1.8 | SMF © 2006-2009, Simple Machines LLC
Page created in 0.083 seconds with 20 queries.