Advertisement
Guest User

Untitled

a guest
Jun 13th, 2009
263
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 4.31 KB | None | 0 0
  1. First Off:
  2. 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.
  3.  
  4. [...] 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:
  5.  
  6. %V|55|24|68|11|0|000000|-|
  7. %ac%fc %fb
  8.  
  9. %V|55|24|68|11|0|000000|-|
  10. %ac%fc %fb
  11.  
  12. To change this into a hold indicator you use the %mh tag.
  13. for example like this:
  14.  
  15. %V|55|24|68|11|0|000000|-|
  16. %ac%?mh<hold on|hold off>
  17.  
  18. %V|55|24|68|11|0|000000|-|
  19. %ac%?mh<hold on|hold off>
  20.  
  21. 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.
  22.  
  23. 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.
  24. Images are loaded with the %xl tag and displayed with the %xd tag.
  25. Version with one .bmp containing two Parts:
  26.  
  27. %xl|H|Hold.bmp|28|0|2|
  28. %V|55|24|68|11|0|000000|-|
  29. %ac%?mh<%xdHa|%xdHb>
  30.  
  31. %xl|a|HoldOn.bmp|28|0|
  32. %xl|b|HoldOff.bmp|28|0|
  33. %V|55|24|68|11|0|000000|-|
  34. %ac%?mh<%xda|%xdb>
  35. The two tags to load images are very similar:
  36. 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.
  37.  
  38. Say, for example, you have preloaded an image like in the following case and a view port defined like this:
  39. %xl|p|bitmap.bmp|12|15|
  40. %V|170|214|6|6|-|-|-|
  41. %xdp
  42.  
  43. 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
  44. (170+12)px=182px on the x-axis
  45. (214+15)px=229px on the y-axis.
  46. 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.
  47. 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.
  48.  
  49. 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.
  50.  
  51. If you use bitmap strips
  52. %xl|H|Hold.bmp|28|0|2|
  53. %V|55|24|68|11|0|000000|-|
  54. %?mh<%xdHa|%xdHb>
  55. 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.
  56. 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.
  57. 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,
  58. %?mh<%xdHa|%xdHb>
  59. 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:
  60. %?mh<%xdHb|%xdHa>
  61. That's pretty much everything you need to know about Bitmap strips, and the Hold display.
  62.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement