a guest Jun 13th, 2009 143 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- First Off:
- I'll post the parts of the WPS you're referring to, then i'll reference every item of each part to the corresponding wiki page section.
- [...] remove [...] MP3 [...] add [...] hold [...]. That's a pretty basic task. The file type tag and the bit rate tag are both two simple string tags, found in this part of the WPS:
- %ac%fc %fb
- %ac%fc %fb
- To change this into a hold indicator you use the %mh tag.
- for example like this:
- %ac%?mh<hold on|hold off>
- %ac%?mh<hold on|hold off>
- This checks the Hold button, displays "hold on" when enabled (you figure the rest) The Sansa doesn't have a remote, so you don't need to include the %mr tag.
- if you want this hold display to be shown as an icon, you'll have to create either one .bmp file containing two parts, one for on, one for off, or two separate .bmp files.
- Images are loaded with the %xl tag and displayed with the %xd tag.
- Version with one .bmp containing two Parts:
- The two tags to load images are very similar:
- First you define a descriptor letter to the image, so you can reference it. Any letter will do, but it's used case sensitive. I always try to make descriptors descriptive: i use H for Hold, B for battery, P for play etc. i also use CAPITAL LETTERS, when i'm dealing with an image containing bitmap strips and small letters for single images, but that's totally up to you, too. Then you specify the filename of the image. Next you define where the images are loaded on the screen. I chose the coordinates 28|0, because we use a view port to display the images. If you do that, the loading coordinates of the images become relative to the coordinates of the View port.
- Say, for example, you have preloaded an image like in the following case and a view port defined like this:
- This code will not produce an error, but you will not see bitmap.bmp on the screen either, because it's out of bounds. See the view port would be situated at the right bottom on the screen, it has the dimensions (6x6)px. The image you're trying to display is loaded at
- (170+12)px=182px on the x-axis
- (214+15)px=229px on the y-axis.
- You always have to know the specific size of the target screen, you are creating a theme for, as in our example it is (176x220)px.
- That means, we're trying to display bitmap.bmp 6px off the right side of the screen and 9px beyond the physical bottom border of the screen.
- You also have to consider the size if the view port, you're trying to display the image in. The VP must at least have the same dimensions as the image you're trying to load. At least if you're using one VP per single image.
- If you use bitmap strips
- you'll notice, a third indicator has appeared in the loading tag. This indicator tells the WPS parser, in how many pieces it should cut an image (in our case Hold.bmp into two pieces). The picture is cut from top to bottom. Using bitmap strips and displaying them in VPs makes it crucial, that you set the VP height to the same height as one chunk of the strip, otherwise it'll be displayed in a disorderly manner.
- So you now see we have a VP that is 11 px high. This means each chunk of the bmp for the hold animation must be 11px high, if you choose to display it in this VP. Of course you can define a VP that has the matching dimensions to your image file (you'll usually go this route). Say we now want to use the given VP to a max, we'll create a bitmap which has the dimensions (12x22)px.
- 12 is rather arbitrary, but this will suit our needs, because it will be displayed in the exact center of the VP. 22px in height=(11x2)px, the first 11 px have to represent "Hold on" in our example. If you accidentally place "Hold off" at the top of the two images,
- will display the hold just the opposite way. To correct this, you either change the picture order in the bmp file or you exchange the descriptors like this:
- That's pretty much everything you need to know about Bitmap strips, and the Hold display.
RAW Paste Data