Advertisement
Guest User

touch_theme-480x800-20140822.wps

a guest
Aug 21st, 2014
275
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.64 KB | None | 0 0
  1. # /***************************************************************************
  2. # * __________ __ ___.
  3. # * Open \______ \ ____ ____ | | _\_ |__ _______ ___
  4. # * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
  5. # * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
  6. # * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
  7. # * \/ \/ \/ \/ \/
  8. # *
  9. # *
  10. # * Copyright (C) 2014 Hayden Pearce - [Saint]
  11. # *
  12. # * This program is free software; you can redistribute it and/or
  13. # * modify it under the terms of the GNU General Public License
  14. # * as published by the Free Software Foundation; either version 2
  15. # * of the License, or (at your option) any later version.
  16. # *
  17. # * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
  18. # * KIND, either express or implied.
  19. # *
  20. # ****************************************************************************/
  21.  
  22. # Disable built-in status bar
  23. # /* This is practically useless to us on devices of this resolution, assume the
  24. # * host has alternative means of conveying this information to the user for
  25. # * now. */
  26. %wd
  27.  
  28. # Draw a fullscreen viewport
  29. # /* This is necessary to facillitate drawing into the backdrop buffer at a
  30. # * later stage. */
  31. %V(0,0,-,-,-)
  32.  
  33. # Preload our bitmap assets
  34. # /* Nothing particularly special here. */
  35. %xl(OVERFLOW_MENU_HANDLE,40x240px-Overflow-Menu-Handle.bmp,0,0,4)
  36. %xl(SCRUBBER_FOCUSED,52x52px-Scrubber-Focused.bmp,0,0)
  37. #%xl(SCRUBBER_UNFOCUSED,52x52px-Scrubber-Unfocused.bmp,0,0)
  38. %xl(ROCKBOX_LOGO,60x60px-Rockbox-Logo.bmp,0,0)
  39. %xl(FASTFORWARD,96x96px-Fastforward.bmp,32,0)
  40. %xl(NEXT,96x96px-Next.bmp,32,0)
  41. %xl(PAUSE,96x96px-Pause.bmp,32,0)
  42. %xl(PREVIOUS,96x96px-Previous.bmp,32,0)
  43. %xl(REWIND,96x96px-Rewind.bmp,32,0)
  44. %xl(STOP,96x96px-Stop.bmp,32,0)
  45. %xl(PLAY,96x192px-Play.bmp,32,0,2)
  46. %xl(BUTTON_OFF,140x40px-Button-Off.bmp,0,0)
  47. %xl(BUTTON_ON,140x40px-Button-On.bmp,0,0)
  48. %xl(GENERIC_BAR,460x52px-Generic-Bar.bmp,0,0)
  49. %xl(GENERIC_BAR_BACKDROP,460x52px-Generic-Bar-Backdrop.bmp,0,0)
  50. %xl(SCRUBBER_BAR,480x6px-Scrubber-Bar.bmp,0,0)
  51. %xl(SCRUBBER_BAR_BACKDROP,480x6px-Scrubber-Bar-Backdrop.bmp,0,0)
  52. %xl(MENU_DIVIDER,480x60px-Menu-Divider.bmp,0,0)
  53.  
  54. # Preload additional fonts
  55. # /* Nothing particularly special here. */
  56. %Fl(2,20 Ubuntu [Bold].fnt)
  57.  
  58. # Conditional elements
  59. # /* This could easily be a single conditional statement, but lets split it up
  60. # * instead to make it easier for the folks playing along at home.
  61. # *
  62. # * Overflow Menu. */
  63. %?vg(OVERFLOW_MENU_STATE)<%Vd(OVERFLOW_MENU_FALSE)|%Vd(OVERFLOW_MENU)%Vd(OVERFLOW_MENU_TRUE)|%Vd(OVERFLOW_MENU_TRUE)%Vd(PLAYBACK_SUBMENU)|%Vd(OVERFLOW_MENU_TRUE)%Vd(REPEAT_SUBMENU)|%Vd(OVERFLOW_MENU_TRUE)%Vd(SOUND_SUBMENU)>
  64. # /* Album Art and Metadata. */
  65. %?vg(OVERFLOW_MENU_STATE)<%?C<%Vd(ALBUM_ART)%Vd(TRACK_METADATA)|%Vd(TRACK_METADATA_NO_ALBUM_ART)>|%Vd(TRACK_METADATA)>
  66. # /* Scrubber. */
  67. %?Sr<%Vd(SCRUBBER_RTL)|%Vd(SCRUBBER)>
  68.  
  69. # Header
  70. # /* Header backdrop colour drawn directly into the backdrop buffer. */
  71. %V(0,0,-,60,-)%Vb(ffc000)%VB
  72. # /* Header title text. */
  73. %ax%V(60,10,380,40,-)%Vf(000000)
  74. %alRockbox
  75.  
  76. # Overflow Menu Handle
  77. # /* Here we define a pair of OVERFLOW_MENU_* sister viewports that we will use
  78. # * to toggle the OVERFLOW_MENU_STATE variable. While it is possible to achieve
  79. # * the same effect with a single viewport and a more complex switching
  80. # * statement experimentation has proven this method to be very reliable. */
  81. %ax%Vl(OVERFLOW_MENU_TRUE,-40,0,40,60,-)
  82. %T(OVERFLOW_HANDLE_FOCUSED,0,0,-,-,none)
  83. %?Tl(OVERFLOW_HANDLE_FOCUSED,0.1)<%vs(OVERFLOW_MENU_STATE,set,1)>
  84. %?Sr<%xd(OVERFLOW_MENU_HANDLE,3)|%xd(OVERFLOW_MENU_HANDLE,1)>
  85.  
  86. %ax%Vl(OVERFLOW_MENU_FALSE,-40,0,40,60,-)
  87. %T(OVERFLOW_HANDLE_UNFOCUSED,0,0,-,-,none)
  88. %?Tl(OVERFLOW_HANDLE_UNFOCUSED,0.1)<%vs(OVERFLOW_MENU_STATE,set,2)>
  89. %?Sr<%xd(OVERFLOW_MENU_HANDLE,4)|%xd(OVERFLOW_MENU_HANDLE,2)>
  90.  
  91. # Rockbox Logo
  92. # /* Use this as a means to jump back to the main menu from the .wps
  93. # *
  94. # * ...and, it looks pretty. */
  95. %ax%V(0,0,60,60,-)
  96. %T(0,0,-,-,menu)
  97. %xd(ROCKBOX_LOGO)
  98.  
  99. # Album Art
  100. # /* Nothing particularly special here. */
  101. %Vl(ALBUM_ART,0,62,480,480,-)
  102. %Cl(0,0,480,480,c,c)
  103. %Cd
  104.  
  105. # Overflow Menu
  106. # /* Build a stacked set of viewports to form our overflow menu. Use a separate
  107. # * viewport for the menu divider/backdrop so that we can draw directly into
  108. # * the backdrop buffer.
  109. # *
  110. # * Playback Settings. */
  111. %Vl(OVERFLOW_MENU,-480,62,-,60,-)%VB
  112. %T(PLAYBACK_SETTINGS,0,0,-,-,none)
  113. %?Tl(PLAYBACK_SETTINGS,0.1)<%vs(OVERFLOW_MENU_STATE,set,3)>
  114. %xd(MENU_DIVIDER)
  115. %Vl(OVERFLOW_MENU,-480,72,-,40,-)
  116. %al %Sx(Playback Settings)
  117.  
  118. # /* Sound Settings. */
  119. %Vl(OVERFLOW_MENU,-480,122,-,60,-)%VB
  120. %T(SOUND_SETTINGS,0,0,-,-,none)
  121. %?Tl(SOUND_SETTINGS,0.1)<%vs(OVERFLOW_MENU_STATE,set,5)>
  122. %xd(MENU_DIVIDER)
  123. %Vl(OVERFLOW_MENU,-480,132,-,40,-)
  124. %al %Sx(Sound Settings)
  125.  
  126. # /* Playlist. */
  127. %Vl(OVERFLOW_MENU,-480,182,-,60,-)%VB
  128. %T(0,0,-,-,playlist)
  129. %xd(MENU_DIVIDER)
  130. %Vl(OVERFLOW_MENU,-480,192,-,40,-)
  131. %al %Sx(Playlist)
  132.  
  133. # /* WPS Context Menu */
  134. %Vl(OVERFLOW_MENU,-480,242,-,60,-)%VB
  135. %T(0,0,-,-,contextmenu)
  136. %xd(MENU_DIVIDER)
  137. %Vl(OVERFLOW_MENU,-480,252,-,40,-)
  138. %al %Sx(Context Menu)
  139.  
  140. # /* Playlist. */
  141. %Vl(OVERFLOW_MENU,-480,302,-,60,-)%VB
  142. %T(0,0,-,-,quickscreen)
  143. %xd(MENU_DIVIDER)
  144. %Vl(OVERFLOW_MENU,-480,312,-,40,-)
  145. %al Quick Screen
  146.  
  147. # /* Volume.
  148. # *
  149. # * Volume Header. */
  150. %Vl(OVERFLOW_MENU,-480,362,-,60,-)%VB
  151. %xd(MENU_DIVIDER)
  152. %Vl(OVERFLOW_MENU,-480,372,-,40,-)
  153. %ac%?Sr<dB%pv: %Sx(Volume)|%Sx(Volume): %pvdB>
  154.  
  155. # /* Volume Bar. */
  156. %Vl(OVERFLOW_MENU,-480,422,-,60,-)%VB
  157. %T(0,0,-,-,volume)
  158. %xd(MENU_DIVIDER)
  159. %Vl(OVERFLOW_MENU,-480,422,-,60,-)
  160. %pv(10,4,460,52,GENERIC_BAR,backdrop,GENERIC_BAR_BACKDROP,slider,SCRUBBER_FOCUSED)
  161.  
  162. # Playback Settings Sub-Menu
  163. # * Playback Settings Header */
  164. %Vl(PLAYBACK_SUBMENU,-480,62,-,60,-)%VB
  165. %T(PLAYBACK_SUBMENU_HEADER,0,0,-,-,none)
  166. %?Tl(PLAYBACK_SUBMENU_HEADER,0.1)<%vs(OVERFLOW_MENU_STATE,set,2)>
  167. %xd(MENU_DIVIDER)
  168. %Vl(PLAYBACK_SUBMENU,-480,72,-,40,-)
  169. %ac%Sx(Playback Settings)
  170.  
  171. # /* Shuffle */
  172. %Vl(PLAYBACK_SUBMENU,-480,122,-,60,-)%VB
  173. %xd(MENU_DIVIDER)
  174. %ax%Vl(PLAYBACK_SUBMENU,-480,132,320,40,-)
  175. %al %Sx(Shuffle)
  176. %ax%Vl(PLAYBACK_SUBMENU,-160,132,140,40,-)
  177. %T(0,0,-,-,shuffle)
  178. %?ps<%xd(BUTTON_ON)|%xd(BUTTON_OFF)>
  179.  
  180. # /* Repeat */
  181. %Vl(PLAYBACK_SUBMENU,-480,182,-,60,-)%VB
  182. %xd(MENU_DIVIDER)
  183. %ax%Vl(PLAYBACK_SUBMENU,-480,192,-,40,-)
  184. %al %Sx(Repeat)
  185. %ax%Vl(PLAYBACK_SUBMENU,-160,192,140,40,-)
  186. %T(REPEAT,0,0,-,-,none)
  187. %?Tl(REPEAT,0.1)<%vs(OVERFLOW_MENU_STATE,set,4)>
  188. %?if(%mm,=,1)<%xd(BUTTON_OFF)|%xd(BUTTON_ON)>
  189.  
  190. # Repeat Sub-Menu
  191. # /* Header. */
  192. %Vl(REPEAT_SUBMENU,-480,62,-,60,-)%VB
  193. %T(REPEAT_SUBMENU_HEADER,0,0,-,-,none)
  194. %?Tl(REPEAT_SUBMENU_HEADER)<%vs(OVERFLOW_MENU_STATE,set,3)>
  195. %xd(MENU_DIVIDER)
  196. %Vl(REPEAT_SUBMENU,-480,72,480,40,-)
  197. %ac%Sx(Repeat)
  198.  
  199. # /* Repeat Off. */
  200. %Vl(REPEAT_SUBMENU,-480,122,-,60,-)%VB
  201. %xd(MENU_DIVIDER)
  202. %ax%Vl(REPEAT_SUBMENU,-480,132,320,40,-)
  203. %al %Sx(Off)
  204. %ax%Vl(REPEAT_SUBMENU,-160,132,140,40,-)
  205. %T(0,0,-,-,setting_set,repeat,off)
  206. %?if(%mm,=,1)<%xd(BUTTON_ON)|%xd(BUTTON_OFF)>
  207.  
  208. # /* Repeat All. */
  209. %Vl(REPEAT_SUBMENU,-480,182,-,60,-)%VB
  210. %xd(MENU_DIVIDER)
  211. %ax%Vl(REPEAT_SUBMENU,-480,192,320,40,-)
  212. %al %Sx(All)
  213. %ax%Vl(REPEAT_SUBMENU,-160,192,140,40,-)
  214. %T(0,0,-,-,setting_set,repeat,all)
  215. %?if(%mm,=,2)<%xd(BUTTON_ON)|%xd(BUTTON_OFF)>
  216.  
  217. # /* Repeat One. */
  218. %Vl(REPEAT_SUBMENU,-480,242,-,60,-)%VB
  219. %xd(MENU_DIVIDER)
  220. %ax%Vl(REPEAT_SUBMENU,-480,252,320,40,-)
  221. %al %Sx(One)
  222. %ax%Vl(REPEAT_SUBMENU,-160,252,140,40,-)
  223. %T(0,0,-,-,setting_set,repeat,one)
  224. %?if(%mm,=,3)<%xd(BUTTON_ON)|%xd(BUTTON_OFF)>
  225.  
  226. # /* Repeat Shuffle. */
  227. %Vl(REPEAT_SUBMENU,-480,302,-,60,-)%VB
  228. %xd(MENU_DIVIDER)
  229. %ax%Vl(REPEAT_SUBMENU,-480,312,320,40,-)
  230. %al %Sx(Shuffle)
  231. %ax%Vl(REPEAT_SUBMENU,-160,312,140,40,-)
  232. %T(0,0,-,-,setting_set,repeat,shuffle)
  233. %?if(%mm,=,4)<%xd(BUTTON_ON)|%xd(BUTTON_OFF)>
  234.  
  235. # Sound Settings Sub-Menu
  236. # * Sound Settings Header */
  237. %Vl(SOUND_SUBMENU,-480,62,-,60,-)%VB
  238. %T(SOUND_SETTINGS_HEADER,0,0,-,-,none)
  239. %?Tl(SOUND_SETTINGS_HEADER,0.1)<%vs(OVERFLOW_MENU_STATE,set,2)>
  240. %xd(MENU_DIVIDER)
  241. %Vl(SOUND_SUBMENU,-480,72,-,40,-)
  242. %ac%Sx(Sound Settings)
  243.  
  244. # /* Balance.
  245. # *
  246. # * Balance Header. */
  247. %Vl(SOUND_SUBMENU,-480,122,-,60,-)%VB
  248. %xd(MENU_DIVIDER)
  249. %Vl(SOUND_SUBMENU,-480,132,-,40,-)
  250. %ac%?Sr<%St(balance) :%Sx(Balance)|%Sx(Balance): %St(balance)>
  251.  
  252. # /* Balance Bar. */
  253. %Vl(SOUND_SUBMENU,-480,182,-,60,-)%VB
  254. %xd(MENU_DIVIDER)
  255. %Vl(SOUND_SUBMENU,-480,182,-,60,-)
  256. %St(10,4,460,52,GENERIC_BAR,backdrop,GENERIC_BAR_BACKDROP,slider,SCRUBBER_FOCUSED,setting,balance)
  257.  
  258. # /* Bass.
  259. # *
  260. # * Bass Header. */
  261. %Vl(SOUND_SUBMENU,-480,242,-,60,-)%VB
  262. %xd(MENU_DIVIDER)
  263. %Vl(SOUND_SUBMENU,-480,252,-,40,-)
  264. %ac%?Sr<%St(bass) :%Sx(Bass)|%Sx(Bass): %St(bass)>
  265.  
  266. # /* Bass Bar. */
  267. %Vl(SOUND_SUBMENU,-480,302,-,60,-)%VB
  268. %xd(MENU_DIVIDER)
  269. %Vl(SOUND_SUBMENU,-480,302,-,60,-)
  270. %St(10,4,460,52,GENERIC_BAR,backdrop,GENERIC_BAR_BACKDROP,slider,SCRUBBER_FOCUSED,setting,bass)
  271.  
  272. # /* Treble.
  273. # *
  274. # * Treble Header. */
  275. %Vl(SOUND_SUBMENU,-480,362,-,60,-)%VB
  276. %xd(MENU_DIVIDER)
  277. %Vl(SOUND_SUBMENU,-480,372,-,40,-)
  278. %ac%?Sr<%St(treble) :%Sx(Treble)|%Sx(Treble): %St(treble)>
  279.  
  280. # /* Treble Bar. */
  281. %Vl(SOUND_SUBMENU,-480,422,-,60,-)%VB
  282. %xd(MENU_DIVIDER)
  283. %Vl(SOUND_SUBMENU,-480,422,-,60,-)
  284. %St(10,4,460,52,GENERIC_BAR,backdrop,GENERIC_BAR_BACKDROP,slider,SCRUBBER_FOCUSED,setting,treble)
  285.  
  286. # Scrubber
  287. # /* Separate viewport for scrubber touch element drawn into the backdrop buffer
  288. # * so we don't destroy part of the album art. Do this so we can draw our own
  289. # * much larger touch area for scrubbing and leave the option of conditional
  290. # * placement open. */
  291. %Vl(SCRUBBER,0,517,-,60,-)%VB
  292. %T(0,0,-,-,progressbar)
  293. %Vl(SCRUBBER,0,544,480,6,-)
  294. # /* We have to remember to disable the progress bar's own touch area with the
  295. # * 'notouch' parameter to avoid it conflicting with the one we set earlier. */
  296. %pb(0,0,480,6,SCRUBBER_BAR,backdrop,SCRUBBER_BAR_BACKDROP,notouch)
  297.  
  298. # /* Invert scrubber fill and touch area direction to suit RTL locales. */
  299. %Vl(SCRUBBER_RTL,0,517,-,60,-)%VB
  300. %T(0,0,-,-,progressbar,reverse_bar)
  301. %Vl(SCRUBBER_RTL,0,544,480,6,-)
  302. %pb(0,0,480,6,SCRUBBER_BAR,backdrop,SCRUBBER_BAR_BACKDROP,invert,notouch)
  303.  
  304. # Time Elapsed/Remaining
  305. # /* Display the elapsed and remaining track times, as well as an 'N / N'
  306. # * playlist position counter. */
  307. %V(0,552,-,20,2)
  308. %al%?Sr< %pr | %pc >%ac%pp / %pe%ar%?Sr< %pc | %pr >
  309.  
  310. # Track Metadata
  311. # * We have space for 3 lines of text at 40pt font. */
  312. %Vl(TRACK_METADATA,0,582,-,120,-)
  313. %s%ac%?it<%it|%fn>
  314. %s%ac%?ia<%ia|%?d(2)<%d(2)|%(root%)>>
  315. %s%ac%?id<%id|%?d(1)<%d(1)|%(root%)>>
  316.  
  317. # Track Metadata without Album Art
  318. # /* Split current and next track metadata into separate viewports while we can
  319. # * to make use of the available screen real estate.
  320. # *
  321. # * Current track.
  322. # * We have space for 12 lines of text at 40pt font. */
  323. %Vl(TRACK_METADATA_NO_ALBUM_ART,0,62,-,480,-)
  324.  
  325. %s%ac%?it<%it|%fn>
  326. %s%ac%?ia<%ia|%?d(2)<%d(2)|%?d(1)<%d(1)>>>
  327. %s%ac%?id<%id|%?d(2)<%d(1)>>
  328. %ac%?iy<%iy>
  329. %ac%?ig<%ig>
  330.  
  331.  
  332.  
  333. %al %fbkbps %fc%ar%fkKhz
  334.  
  335. # */ Next track.
  336. # * We have space for 3 lines of text at 40pt font. */
  337. %Vl(TRACK_METADATA_NO_ALBUM_ART,0,582,-,120,-)
  338. %ac%?Fn<%Sx(Next Track:)>
  339. %s%ac%?It<%It|%Fn>
  340. %s%ac%?Ia<%Ia|%?D(2)<%D(2)|%?D(1)<%D(1)|%Fp>>>
  341.  
  342. # Rewind/Previous
  343. # /* (Ab)use viewport flipping with %ax so that we can still keep this as a
  344. # * static viewport and re-use the touch areas for the RTL case. */
  345. %ax%V(0%,-96,33%,96,-)
  346. %T(0,0,-,-,wps_prev)
  347. %T(0,0,-,-,rwd,repeat_press)
  348. # /* Make sure we display the right icons for the RTL case. */
  349. %?if(%mp,=,5)<%?Sr<%xd(FASTFORWARD)|%xd(REWIND)>|%?Sr<%xd(NEXT)|%xd(PREVIOUS)>>
  350.  
  351. # Pause/Play
  352. # /* Set and check for a PLAY_STATE variable to allow us to always display the
  353. # * correct PAUSE/PLAY state icon when seeking. This is a touch driven
  354. # * interface so display the state the user will enter instead of the current
  355. # * playback state for the PLAY and PAUSE cases. */
  356. %V(33%,-96,33%,96,-)
  357. %T(0,0,-,-,play)
  358. %T(0,0,-,-,stop,repeat_press)
  359. %?mp<%xd(STOP)|%xd(PAUSE)%vs(PLAY_STATE,set,1)|%?Sr<%xd(PLAY,2)|%xd(PLAY,1)>%vs(PLAY_STATE,set,2)|%?vg(PLAY_STATE)<%xd(PAUSE)|%?Sr<%xd(PLAY,2)|%xd(PLAY,1)>>|%?vg(PLAY_STATE)<%xd(PAUSE)|%?Sr<%xd(PLAY,2)|%xd(PLAY,1)>>>
  360.  
  361. # Fastforward/Next
  362. # /* (Ab)use viewport flipping with %ax so that we can still keep this as a
  363. # * static viewport and re-use the touch areas for the RTL case. */
  364. %ax%V(66%,-96,33%,96,-)
  365. %T(0,0,-,-,wps_next)
  366. %T(0,0,-,-,ffwd,repeat_press)
  367. # /* Make sure we display the right icons for the RTL case. */
  368. %?if(%mp,=,4)<%?Sr<%xd(REWIND)|%xd(FASTFORWARD)>|%?Sr<%xd(PREVIOUS)|%xd(NEXT)>>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement