Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # /***************************************************************************
- # * __________ __ ___.
- # * Open \______ \ ____ ____ | | _\_ |__ _______ ___
- # * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
- # * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
- # * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
- # * \/ \/ \/ \/ \/
- # *
- # *
- # * Copyright (C) 2014 Hayden Pearce - [Saint]
- # *
- # * This program is free software; you can redistribute it and/or
- # * modify it under the terms of the GNU General Public License
- # * as published by the Free Software Foundation; either version 2
- # * of the License, or (at your option) any later version.
- # *
- # * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
- # * KIND, either express or implied.
- # *
- # ****************************************************************************/
- # Disable built-in status bar
- # /* This is practically useless to us on devices of this resolution, assume the
- # * host has alternative means of conveying this information to the user for
- # * now. */
- %wd
- # Draw a fullscreen viewport
- # /* This is necessary to facillitate drawing into the backdrop buffer at a
- # * later stage. */
- %V(0,0,-,-,-)
- # Preload our bitmap assets
- # /* Nothing particularly special here. */
- %xl(OVERFLOW_MENU_HANDLE,40x240px-Overflow-Menu-Handle.bmp,0,0,4)
- %xl(SCRUBBER_FOCUSED,52x52px-Scrubber-Focused.bmp,0,0)
- #%xl(SCRUBBER_UNFOCUSED,52x52px-Scrubber-Unfocused.bmp,0,0)
- %xl(ROCKBOX_LOGO,60x60px-Rockbox-Logo.bmp,0,0)
- %xl(FASTFORWARD,96x96px-Fastforward.bmp,32,0)
- %xl(NEXT,96x96px-Next.bmp,32,0)
- %xl(PAUSE,96x96px-Pause.bmp,32,0)
- %xl(PREVIOUS,96x96px-Previous.bmp,32,0)
- %xl(REWIND,96x96px-Rewind.bmp,32,0)
- %xl(STOP,96x96px-Stop.bmp,32,0)
- %xl(PLAY,96x192px-Play.bmp,32,0,2)
- %xl(BUTTON_OFF,140x40px-Button-Off.bmp,0,0)
- %xl(BUTTON_ON,140x40px-Button-On.bmp,0,0)
- %xl(GENERIC_BAR,460x52px-Generic-Bar.bmp,0,0)
- %xl(GENERIC_BAR_BACKDROP,460x52px-Generic-Bar-Backdrop.bmp,0,0)
- %xl(SCRUBBER_BAR,480x6px-Scrubber-Bar.bmp,0,0)
- %xl(SCRUBBER_BAR_BACKDROP,480x6px-Scrubber-Bar-Backdrop.bmp,0,0)
- %xl(MENU_DIVIDER,480x60px-Menu-Divider.bmp,0,0)
- # Preload additional fonts
- # /* Nothing particularly special here. */
- %Fl(2,20 Ubuntu [Bold].fnt)
- # Conditional elements
- # /* This could easily be a single conditional statement, but lets split it up
- # * instead to make it easier for the folks playing along at home.
- # *
- # * Overflow Menu. */
- %?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)>
- # /* Album Art and Metadata. */
- %?vg(OVERFLOW_MENU_STATE)<%?C<%Vd(ALBUM_ART)%Vd(TRACK_METADATA)|%Vd(TRACK_METADATA_NO_ALBUM_ART)>|%Vd(TRACK_METADATA)>
- # /* Scrubber. */
- %?Sr<%Vd(SCRUBBER_RTL)|%Vd(SCRUBBER)>
- # Header
- # /* Header backdrop colour drawn directly into the backdrop buffer. */
- %V(0,0,-,60,-)%Vb(ffc000)%VB
- # /* Header title text. */
- %ax%V(60,10,380,40,-)%Vf(000000)
- %alRockbox
- # Overflow Menu Handle
- # /* Here we define a pair of OVERFLOW_MENU_* sister viewports that we will use
- # * to toggle the OVERFLOW_MENU_STATE variable. While it is possible to achieve
- # * the same effect with a single viewport and a more complex switching
- # * statement experimentation has proven this method to be very reliable. */
- %ax%Vl(OVERFLOW_MENU_TRUE,-40,0,40,60,-)
- %T(OVERFLOW_HANDLE_FOCUSED,0,0,-,-,none)
- %?Tl(OVERFLOW_HANDLE_FOCUSED,0.1)<%vs(OVERFLOW_MENU_STATE,set,1)>
- %?Sr<%xd(OVERFLOW_MENU_HANDLE,3)|%xd(OVERFLOW_MENU_HANDLE,1)>
- %ax%Vl(OVERFLOW_MENU_FALSE,-40,0,40,60,-)
- %T(OVERFLOW_HANDLE_UNFOCUSED,0,0,-,-,none)
- %?Tl(OVERFLOW_HANDLE_UNFOCUSED,0.1)<%vs(OVERFLOW_MENU_STATE,set,2)>
- %?Sr<%xd(OVERFLOW_MENU_HANDLE,4)|%xd(OVERFLOW_MENU_HANDLE,2)>
- # Rockbox Logo
- # /* Use this as a means to jump back to the main menu from the .wps
- # *
- # * ...and, it looks pretty. */
- %ax%V(0,0,60,60,-)
- %T(0,0,-,-,menu)
- %xd(ROCKBOX_LOGO)
- # Album Art
- # /* Nothing particularly special here. */
- %Vl(ALBUM_ART,0,62,480,480,-)
- %Cl(0,0,480,480,c,c)
- %Cd
- # Overflow Menu
- # /* Build a stacked set of viewports to form our overflow menu. Use a separate
- # * viewport for the menu divider/backdrop so that we can draw directly into
- # * the backdrop buffer.
- # *
- # * Playback Settings. */
- %Vl(OVERFLOW_MENU,-480,62,-,60,-)%VB
- %T(PLAYBACK_SETTINGS,0,0,-,-,none)
- %?Tl(PLAYBACK_SETTINGS,0.1)<%vs(OVERFLOW_MENU_STATE,set,3)>
- %xd(MENU_DIVIDER)
- %Vl(OVERFLOW_MENU,-480,72,-,40,-)
- %al %Sx(Playback Settings)
- # /* Sound Settings. */
- %Vl(OVERFLOW_MENU,-480,122,-,60,-)%VB
- %T(SOUND_SETTINGS,0,0,-,-,none)
- %?Tl(SOUND_SETTINGS,0.1)<%vs(OVERFLOW_MENU_STATE,set,5)>
- %xd(MENU_DIVIDER)
- %Vl(OVERFLOW_MENU,-480,132,-,40,-)
- %al %Sx(Sound Settings)
- # /* Playlist. */
- %Vl(OVERFLOW_MENU,-480,182,-,60,-)%VB
- %T(0,0,-,-,playlist)
- %xd(MENU_DIVIDER)
- %Vl(OVERFLOW_MENU,-480,192,-,40,-)
- %al %Sx(Playlist)
- # /* WPS Context Menu */
- %Vl(OVERFLOW_MENU,-480,242,-,60,-)%VB
- %T(0,0,-,-,contextmenu)
- %xd(MENU_DIVIDER)
- %Vl(OVERFLOW_MENU,-480,252,-,40,-)
- %al %Sx(Context Menu)
- # /* Playlist. */
- %Vl(OVERFLOW_MENU,-480,302,-,60,-)%VB
- %T(0,0,-,-,quickscreen)
- %xd(MENU_DIVIDER)
- %Vl(OVERFLOW_MENU,-480,312,-,40,-)
- %al Quick Screen
- # /* Volume.
- # *
- # * Volume Header. */
- %Vl(OVERFLOW_MENU,-480,362,-,60,-)%VB
- %xd(MENU_DIVIDER)
- %Vl(OVERFLOW_MENU,-480,372,-,40,-)
- %ac%?Sr<dB%pv: %Sx(Volume)|%Sx(Volume): %pvdB>
- # /* Volume Bar. */
- %Vl(OVERFLOW_MENU,-480,422,-,60,-)%VB
- %T(0,0,-,-,volume)
- %xd(MENU_DIVIDER)
- %Vl(OVERFLOW_MENU,-480,422,-,60,-)
- %pv(10,4,460,52,GENERIC_BAR,backdrop,GENERIC_BAR_BACKDROP,slider,SCRUBBER_FOCUSED)
- # Playback Settings Sub-Menu
- # * Playback Settings Header */
- %Vl(PLAYBACK_SUBMENU,-480,62,-,60,-)%VB
- %T(PLAYBACK_SUBMENU_HEADER,0,0,-,-,none)
- %?Tl(PLAYBACK_SUBMENU_HEADER,0.1)<%vs(OVERFLOW_MENU_STATE,set,2)>
- %xd(MENU_DIVIDER)
- %Vl(PLAYBACK_SUBMENU,-480,72,-,40,-)
- %ac%Sx(Playback Settings)
- # /* Shuffle */
- %Vl(PLAYBACK_SUBMENU,-480,122,-,60,-)%VB
- %xd(MENU_DIVIDER)
- %ax%Vl(PLAYBACK_SUBMENU,-480,132,320,40,-)
- %al %Sx(Shuffle)
- %ax%Vl(PLAYBACK_SUBMENU,-160,132,140,40,-)
- %T(0,0,-,-,shuffle)
- %?ps<%xd(BUTTON_ON)|%xd(BUTTON_OFF)>
- # /* Repeat */
- %Vl(PLAYBACK_SUBMENU,-480,182,-,60,-)%VB
- %xd(MENU_DIVIDER)
- %ax%Vl(PLAYBACK_SUBMENU,-480,192,-,40,-)
- %al %Sx(Repeat)
- %ax%Vl(PLAYBACK_SUBMENU,-160,192,140,40,-)
- %T(REPEAT,0,0,-,-,none)
- %?Tl(REPEAT,0.1)<%vs(OVERFLOW_MENU_STATE,set,4)>
- %?if(%mm,=,1)<%xd(BUTTON_OFF)|%xd(BUTTON_ON)>
- # Repeat Sub-Menu
- # /* Header. */
- %Vl(REPEAT_SUBMENU,-480,62,-,60,-)%VB
- %T(REPEAT_SUBMENU_HEADER,0,0,-,-,none)
- %?Tl(REPEAT_SUBMENU_HEADER)<%vs(OVERFLOW_MENU_STATE,set,3)>
- %xd(MENU_DIVIDER)
- %Vl(REPEAT_SUBMENU,-480,72,480,40,-)
- %ac%Sx(Repeat)
- # /* Repeat Off. */
- %Vl(REPEAT_SUBMENU,-480,122,-,60,-)%VB
- %xd(MENU_DIVIDER)
- %ax%Vl(REPEAT_SUBMENU,-480,132,320,40,-)
- %al %Sx(Off)
- %ax%Vl(REPEAT_SUBMENU,-160,132,140,40,-)
- %T(0,0,-,-,setting_set,repeat,off)
- %?if(%mm,=,1)<%xd(BUTTON_ON)|%xd(BUTTON_OFF)>
- # /* Repeat All. */
- %Vl(REPEAT_SUBMENU,-480,182,-,60,-)%VB
- %xd(MENU_DIVIDER)
- %ax%Vl(REPEAT_SUBMENU,-480,192,320,40,-)
- %al %Sx(All)
- %ax%Vl(REPEAT_SUBMENU,-160,192,140,40,-)
- %T(0,0,-,-,setting_set,repeat,all)
- %?if(%mm,=,2)<%xd(BUTTON_ON)|%xd(BUTTON_OFF)>
- # /* Repeat One. */
- %Vl(REPEAT_SUBMENU,-480,242,-,60,-)%VB
- %xd(MENU_DIVIDER)
- %ax%Vl(REPEAT_SUBMENU,-480,252,320,40,-)
- %al %Sx(One)
- %ax%Vl(REPEAT_SUBMENU,-160,252,140,40,-)
- %T(0,0,-,-,setting_set,repeat,one)
- %?if(%mm,=,3)<%xd(BUTTON_ON)|%xd(BUTTON_OFF)>
- # /* Repeat Shuffle. */
- %Vl(REPEAT_SUBMENU,-480,302,-,60,-)%VB
- %xd(MENU_DIVIDER)
- %ax%Vl(REPEAT_SUBMENU,-480,312,320,40,-)
- %al %Sx(Shuffle)
- %ax%Vl(REPEAT_SUBMENU,-160,312,140,40,-)
- %T(0,0,-,-,setting_set,repeat,shuffle)
- %?if(%mm,=,4)<%xd(BUTTON_ON)|%xd(BUTTON_OFF)>
- # Sound Settings Sub-Menu
- # * Sound Settings Header */
- %Vl(SOUND_SUBMENU,-480,62,-,60,-)%VB
- %T(SOUND_SETTINGS_HEADER,0,0,-,-,none)
- %?Tl(SOUND_SETTINGS_HEADER,0.1)<%vs(OVERFLOW_MENU_STATE,set,2)>
- %xd(MENU_DIVIDER)
- %Vl(SOUND_SUBMENU,-480,72,-,40,-)
- %ac%Sx(Sound Settings)
- # /* Balance.
- # *
- # * Balance Header. */
- %Vl(SOUND_SUBMENU,-480,122,-,60,-)%VB
- %xd(MENU_DIVIDER)
- %Vl(SOUND_SUBMENU,-480,132,-,40,-)
- %ac%?Sr<%St(balance) :%Sx(Balance)|%Sx(Balance): %St(balance)>
- # /* Balance Bar. */
- %Vl(SOUND_SUBMENU,-480,182,-,60,-)%VB
- %xd(MENU_DIVIDER)
- %Vl(SOUND_SUBMENU,-480,182,-,60,-)
- %St(10,4,460,52,GENERIC_BAR,backdrop,GENERIC_BAR_BACKDROP,slider,SCRUBBER_FOCUSED,setting,balance)
- # /* Bass.
- # *
- # * Bass Header. */
- %Vl(SOUND_SUBMENU,-480,242,-,60,-)%VB
- %xd(MENU_DIVIDER)
- %Vl(SOUND_SUBMENU,-480,252,-,40,-)
- %ac%?Sr<%St(bass) :%Sx(Bass)|%Sx(Bass): %St(bass)>
- # /* Bass Bar. */
- %Vl(SOUND_SUBMENU,-480,302,-,60,-)%VB
- %xd(MENU_DIVIDER)
- %Vl(SOUND_SUBMENU,-480,302,-,60,-)
- %St(10,4,460,52,GENERIC_BAR,backdrop,GENERIC_BAR_BACKDROP,slider,SCRUBBER_FOCUSED,setting,bass)
- # /* Treble.
- # *
- # * Treble Header. */
- %Vl(SOUND_SUBMENU,-480,362,-,60,-)%VB
- %xd(MENU_DIVIDER)
- %Vl(SOUND_SUBMENU,-480,372,-,40,-)
- %ac%?Sr<%St(treble) :%Sx(Treble)|%Sx(Treble): %St(treble)>
- # /* Treble Bar. */
- %Vl(SOUND_SUBMENU,-480,422,-,60,-)%VB
- %xd(MENU_DIVIDER)
- %Vl(SOUND_SUBMENU,-480,422,-,60,-)
- %St(10,4,460,52,GENERIC_BAR,backdrop,GENERIC_BAR_BACKDROP,slider,SCRUBBER_FOCUSED,setting,treble)
- # Scrubber
- # /* Separate viewport for scrubber touch element drawn into the backdrop buffer
- # * so we don't destroy part of the album art. Do this so we can draw our own
- # * much larger touch area for scrubbing and leave the option of conditional
- # * placement open. */
- %Vl(SCRUBBER,0,517,-,60,-)%VB
- %T(0,0,-,-,progressbar)
- %Vl(SCRUBBER,0,544,480,6,-)
- # /* We have to remember to disable the progress bar's own touch area with the
- # * 'notouch' parameter to avoid it conflicting with the one we set earlier. */
- %pb(0,0,480,6,SCRUBBER_BAR,backdrop,SCRUBBER_BAR_BACKDROP,notouch)
- # /* Invert scrubber fill and touch area direction to suit RTL locales. */
- %Vl(SCRUBBER_RTL,0,517,-,60,-)%VB
- %T(0,0,-,-,progressbar,reverse_bar)
- %Vl(SCRUBBER_RTL,0,544,480,6,-)
- %pb(0,0,480,6,SCRUBBER_BAR,backdrop,SCRUBBER_BAR_BACKDROP,invert,notouch)
- # Time Elapsed/Remaining
- # /* Display the elapsed and remaining track times, as well as an 'N / N'
- # * playlist position counter. */
- %V(0,552,-,20,2)
- %al%?Sr< %pr | %pc >%ac%pp / %pe%ar%?Sr< %pc | %pr >
- # Track Metadata
- # * We have space for 3 lines of text at 40pt font. */
- %Vl(TRACK_METADATA,0,582,-,120,-)
- %s%ac%?it<%it|%fn>
- %s%ac%?ia<%ia|%?d(2)<%d(2)|%(root%)>>
- %s%ac%?id<%id|%?d(1)<%d(1)|%(root%)>>
- # Track Metadata without Album Art
- # /* Split current and next track metadata into separate viewports while we can
- # * to make use of the available screen real estate.
- # *
- # * Current track.
- # * We have space for 12 lines of text at 40pt font. */
- %Vl(TRACK_METADATA_NO_ALBUM_ART,0,62,-,480,-)
- %s%ac%?it<%it|%fn>
- %s%ac%?ia<%ia|%?d(2)<%d(2)|%?d(1)<%d(1)>>>
- %s%ac%?id<%id|%?d(2)<%d(1)>>
- %ac%?iy<%iy>
- %ac%?ig<%ig>
- %al %fbkbps %fc%ar%fkKhz
- # */ Next track.
- # * We have space for 3 lines of text at 40pt font. */
- %Vl(TRACK_METADATA_NO_ALBUM_ART,0,582,-,120,-)
- %ac%?Fn<%Sx(Next Track:)>
- %s%ac%?It<%It|%Fn>
- %s%ac%?Ia<%Ia|%?D(2)<%D(2)|%?D(1)<%D(1)|%Fp>>>
- # Rewind/Previous
- # /* (Ab)use viewport flipping with %ax so that we can still keep this as a
- # * static viewport and re-use the touch areas for the RTL case. */
- %ax%V(0%,-96,33%,96,-)
- %T(0,0,-,-,wps_prev)
- %T(0,0,-,-,rwd,repeat_press)
- # /* Make sure we display the right icons for the RTL case. */
- %?if(%mp,=,5)<%?Sr<%xd(FASTFORWARD)|%xd(REWIND)>|%?Sr<%xd(NEXT)|%xd(PREVIOUS)>>
- # Pause/Play
- # /* Set and check for a PLAY_STATE variable to allow us to always display the
- # * correct PAUSE/PLAY state icon when seeking. This is a touch driven
- # * interface so display the state the user will enter instead of the current
- # * playback state for the PLAY and PAUSE cases. */
- %V(33%,-96,33%,96,-)
- %T(0,0,-,-,play)
- %T(0,0,-,-,stop,repeat_press)
- %?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)>>>
- # Fastforward/Next
- # /* (Ab)use viewport flipping with %ax so that we can still keep this as a
- # * static viewport and re-use the touch areas for the RTL case. */
- %ax%V(66%,-96,33%,96,-)
- %T(0,0,-,-,wps_next)
- %T(0,0,-,-,ffwd,repeat_press)
- # /* Make sure we display the right icons for the RTL case. */
- %?if(%mp,=,4)<%?Sr<%xd(REWIND)|%xd(FASTFORWARD)>|%?Sr<%xd(PREVIOUS)|%xd(NEXT)>>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement