Commit graph

1893 commits

Author SHA1 Message Date
Thomas Martitz
470989bd70 events: Rework event subsystem (add_event, send_event) to be more versatile.
add_event_ex is added that takes an extra user_data pointer. This pointer is
passed to the callback (add_event and add_event_ex have slightly different
callbacks types). All callbacks also get the event id passed. Events added
with add_event_ex must be removed with remove_event_ex because the user_data
pointer must match in addition to the callback pointer.

On the other add_event is simplified to omit the oneshort parameter which
was almost always false (still there with add_event_ex).

As a side effect the ata_idle_notify callbacks are changed as well, they
do not take a data parameter anymore which was always NULL anyway.

This commit also adds some documentation to events.h

Change-Id: I13e29a0f88ef908f175b376d83550f9e0231f772
2014-03-14 23:36:30 +01:00
Thomas Martitz
50f0dd80d6 ab_repeat: Move GUI bits to the skin engine. This allows ab_repeat to be compiled headless.
Change-Id: I4fa3b8ef7139313891ca70df11f7f17c5df38cb7
2014-03-10 22:55:26 +01:00
Michael Sevakis
31b7122867 Implement time-based resume and playback start.
This complements offset-based resume and playback start funcionality.
The implementation is global on both HWCODEC and SWCODEC.

Basically, if either the specified elapsed or offset are non-zero,
it indicates a mid-track resume.

To resume by time only, set elapsed to nonzero and offset to zero.
To resume by offset only, set offset to nonzero and elapsed to zero.

Which one the codec uses and which has priority is up to the codec;
however, using an elapsed time covers more cases:

* Codecs not able to use an offset such as VGM or other atomic
formats

* Starting playback at a nonzero elapsed time from a source that
contains no offset, such as a cuesheet

The change re-versions pretty much everything from tagcache to nvram.

Change-Id: Ic7aebb24e99a03ae99585c5e236eba960d163f38
Reviewed-on: http://gerrit.rockbox.org/516
Reviewed-by: Michael Sevakis <jethead71@rockbox.org>
Tested: Michael Sevakis <jethead71@rockbox.org>
2014-03-10 04:12:30 +01:00
Thomas Martitz
00434be0f1 Fix greyscale and mono builds.
Change-Id: I511376eb42d1109dbe10d4fc5aa849b21d9f7582
2014-03-03 16:34:36 +01:00
Thomas Martitz
05a67d021c Touchscreen: Show a line separator in lists.
This patch adds a configurable line separator between list items, very
similar to lists in Android. Additionally, below the list item there is a
thicker line. It can be disabled in the settings. Its color can
be configured as well.

Remote and monochrome displays are explicitly unsupported. If there is desire
this can be changed but it doesn't seem useful to me.

Change-Id: I005313b0d8f5ecd15864bf20e66ea4e3390d8b7d
2014-03-03 15:14:16 +01:00
Thomas Martitz
ee28a706d4 Fix regression introduced by eec89a9.
The icon pixel position must be calculated before y is modified.

Change-Id: I16947dd8862683530dd7c5f00cfa7cf8d9636e61
2014-03-03 15:14:07 +01:00
Thomas Martitz
3ae07d48a2 Fix FS#12951: The icons could be a pixel to far down.
Since eec89a9 icons have been centered using same calculation as for fonts.
In edge cases this is visually different from before and didn't align
well to the font's baseline. Revert to the old calculation just for centering
icons to fix.

A proper aligorithm would take the baseline into account but this has
worked sufficiently well for us (fix this if needed)

Change-Id: I86593529b16cd28ae4552641e216e73795f2450c
2014-03-03 11:20:13 +01:00
Thomas Martitz
8142c68bd2 Fix red on monochrome.
Change-Id: Ice40c81d0d07f7ec2014697e4de446dcb956afe8
2014-01-22 17:31:24 +01:00
Thomas Martitz
6cb11764e0 skin_engine/backdrops: Have to reload default backdrops from setting when it changed.
When skins use the default backdrop (via %X(-) or no %X at all) and the setting
changes it needs to be reloaded, otherwise when changing themes the new theme
could show the backdrop from the previous theme. The same needs to be
done when re-selecting the same theme after USB because the backdrop file was
potentially overwritten.

Fixes FS#12892 and FS#12942.

Change-Id: Ic2d20740cc385fa99667ce8a71507dbda2efceaf
2014-01-22 16:58:58 +01:00
Thomas Martitz
47f648fd92 Fix Player warning.
Change-Id: I43989c92935710b36b68891a637db2e2cafb0401
2014-01-16 00:44:06 +01:00
Thomas Martitz
aa4c2a53f3 usb screen: Crop logo to the UI viewport dimensions.
If the UI viewport is too small only the most top/left parts of the logo will
be displayed. This goes one step further than bac85f2.

Change-Id: I832b0e787e57e3b102a9c097cf1cccd7d4ad92d9
2014-01-16 00:28:18 +01:00
Thomas Martitz
a6483344f6 usb screen: Push the usb screen onto the activity stack. This enables %cs tag support for it.
Change-Id: Icecb72007aa3aba501c702e1aa65c801fcbc3857
2014-01-16 00:26:45 +01:00
Thomas Martitz
a969e1f456 usb: Do not disable themes in the USB screen.
Fonts can now be assumed (by the code) to be available during USB. Make
use of this fact in the USB screen and don't disable the skins.

Change-Id: I525359aae16660604e8fe89addc0bdf97a3fafc1
2014-01-15 23:37:39 +01:00
Thomas Martitz
2eb873cea6 skins: Update SBS when changing activities.
When changing activities (those that are indicated via %cs skin tag), the sbs
needs to be updated, so that the UI viewport can be applied before that
activity draws its UI.

Fixes FS#12804. I hope this commit doesn't have bad side effects.

Change-Id: If45654e356749f5f27991430dbd1da6f23e6f802
2014-01-15 18:57:46 +01:00
Szymon Dziok
bac85f2cb4 Always check, if the USB logo for remotes overrides their physical size.
This fixes displaying of the main USB screen on m:robe 100. A remote for
this particular target has no native remote USB logo and it uses a larger
one. However it's a good idea to perform this check always IMHO.

Change-Id: I56ceb2316c551269be011b60271d8da11cb8b073
2014-01-13 21:46:57 +01:00
PurlingNayuki
f0bec023d9 Implement volume limiter feature
Add a "volume limit" parameter to the configuration file. The maximum
value of volume setting in sound menu will be limited to the same as
volume limit. Also each time when setvol() is excuted, Rockbox will
check if the global_settings.volume value larger than
global_settings.volume_limit. If larger, take the value of volume_limit
instead. The volume_limit argument shares the same maximum and minimum values
with volume argument, while taking the maximum volume as its default value.

Change-Id: I8ca9bc6ea6e617b48fc346aae5f2a0a1d259ae36
Reviewed-on: http://gerrit.rockbox.org/697
Reviewed-by: Jonathan Gordon <rockbox@jdgordon.info>
2014-01-13 11:32:03 +01:00
Thomas Martitz
4e1c690ea7 skin_engine: Stricter checking for x, y, width, height for bar tags.
Every theme that doesn't parse anymore now has broken values. I hope it's not
too many of them.

Change-Id: I6f52e55dc9197d0919f854240723a88f99c0b7da
2014-01-12 23:13:45 +01:00
Thomas Martitz
09e655f89d put_line(): Add another check against possible buffer overflow (see 193911a).
Change-Id: Idc6637cc42afe612375dab3acac8495278f68f0a
2014-01-12 19:19:05 +01:00
Thomas Martitz
193911af76 put_line(): Fix buffer overflow.
At the end of the format string it wrote a last byte (or inline string) past
the end of the lcd boundaries, potentially overwriting unrelated memory. It
now makes sure it won't exceed the viewport's width.

Change-Id: Id4cfce918e8b070b7fc3c7d33f389f7a171963ff
2014-01-12 17:37:16 +01:00
Thomas Martitz
3ae73433ab skin_engine: New param "noborder" for the bar tags.
By specifying this param the bar will not have a border/box. Instead
the inner part that fills up is maximized on the bar area.

Note that this only affects bars using foreground and background colors,
not those constructed with images.

Change-Id: Ib8dd49ecbaf9e16b96de840f5f365871b73d4fa4
2014-01-12 15:22:29 +01:00
Thomas Martitz
6e882b43b6 put_line(): Do not lock up if the scroll engine runs out of lines.
Allocate MAX_LINES+1 because at the time get_line_desc() is called
the scroll engine did not yet determine that it ran out of lines
(because puts_scroll_func() wasn't called yet. Therefore we can
run out of lines before setting the used field. By allocating
one item more we can survive that point and set used to false
if the scroll engine runs out of lines.

Change-Id: I7a9af1bce256c6e07d254f096bd5865fa7cf2cee
2014-01-12 12:12:13 +01:00
Thomas Martitz
c0a02c98c1 touchscreen/skin_engine: The touchregion handler didn't handle that vertical bars are bottom-up by default
Change-Id: I4e7fc451c7ba318acb110c587bff4306c393e09f
2014-01-12 11:02:02 +01:00
Thomas Martitz
0a0d61e777 Fix remote warnings and charcell reds, and remove minor left-over tuff.
Change-Id: I10987ea9fcad94d502afd4ae4a80ab9022c75d2e
2014-01-12 01:50:21 +01:00
Thomas Martitz
488a1b983e put_line/scrolling: Make the scroll engine inform custom scrollers about start/stop of scrolling.
With the new lcd_putsxy_scroll_func() code can register custom scroll functions
(put_line() makes use of that). In order for the custom scroller to be able
to properly manage its userdata pointer (set via struct scrollinfo::userdata)
the scroll engine must inform the scroller about start and stop of scrolling.

To inform about start the lcd_scroll_* functions now return true when
the line will scroll. To inform about stop the scroll engine calls into the
scroller one last time, with the text set to NULL.

put_line() can use this to release the userdata registered per scrolling line
so that it can be recycled.

This fixes that some scrolling lines became glitchy after some time because
the userdata was recycled too early.

Change-Id: Iff0a6ce2a4f9ae2bada1b8e62f4f5950224942a9
2014-01-12 01:34:06 +01:00
Thomas Martitz
5d37d2579a icons: When loading mono icons keep them in mono format.
This enables monochrome icons them to work with the invert line selector.

Change-Id: Ic3e9219e93b4879166a10180e6067446a84a62bf
2014-01-11 14:19:43 +01:00
Thomas Martitz
d4d3f3c494 skin engine: Fix FS#12884.
The %Vf and %Vb tags change the colors for the rest of the viewport. This
requires the rest of the vp to be redrawn when they change due to a conditional.
The previous code did this redraw in all cases (conditional or not) which
led to visible blinking.

Change-Id: Ie59dfc6fe8ed76485a2a2bd7caf1315f1944c227
2014-01-10 21:54:06 +01:00
Thomas Martitz
99f3f77ee8 skin_engine: Pass string to put_line() via $t because they can be very large.
Change-Id: I02d6bf492bb42e173a7b436427e3cc3560d80183
2014-01-09 23:28:33 +01:00
Thomas Martitz
7ba2d0160b put_line(): Limit and truncate inline strings to MAX_PATH+32.
Because inline strings have to be copied (to escape '$') the local buffer
can be exhaused. The code didn't check for this. The buffer is increased
to handle filenames plus some extra chars but truncates to avoid overflow.

If you have longer strings please pass them via $t tag, in which case
put_line() imposes no additional length-limitation.

Change-Id: I0ca20adbe72f6d44cb442f34d665c16b12cbbaeb
2014-01-09 23:17:38 +01:00
Thomas Martitz
3be3a40138 put_line: Be more careful with changing fg and bg colors.
put_line() needs to change fore- and background colors if required by
the line style. This should really only be done if required, and be undone
as to not compromise subsequent lines. This fixes %Vf and %Vb skin tags.

Change-Id: I85e5a0d1d64aa9eb76a891d9ce1de1320274a69a
2014-01-09 17:42:47 +01:00
Thomas Martitz
81be2016bb Fix Player red and icons on mono displays.
Change-Id: Ib8adcb4c70f2dd3ddd25da8f0606f48926dfd89e
2014-01-07 23:39:37 +01:00
Thomas Martitz
10a2e6738d Oops, pasted to the wrong place.
Change-Id: Icb07ddd04171699e997eca171bf8756b5fd9f024
2014-01-07 22:46:45 +01:00
Thomas Martitz
0e6d86e4fe Fix a few reds and yellows.
Change-Id: I9ad2aca494f2ea3ca5453082ec5491ec031f9ae5
2014-01-07 22:41:00 +01:00
Thomas Martitz
e1c7b3b8f7 lcd-16bit: Remove {lss,lse,lst}_pattern fields from struct viewport.
These where used for line styling during scrolling, which is now done in apps/,
The  viewport struct doesn't need to record these anymore.

Change-Id: I810d9dcb2644b00a798c6e75acab69c74a78e77f
2014-01-07 14:13:48 +01:00
Thomas Martitz
36e469db8b lcd-common: Remove direct style (line decorations) from lcd-puts* functions.
This logic is moved into apps (put_line()) which can better handle line
decorations with respect to scrolling, mulitline and other complications.

Firmware doesn't need this. The remaining drawing function know only one style,
that is foreground on background/backdrop (changing drawmode is still supported).

Change-Id: I707060edc388a7d723a7d09b0cf5cbda6ec56708
2014-01-07 14:13:48 +01:00
Thomas Martitz
4978094480 lcd-common: Remove support for custom line heights from viewport.
Since scrolling is now pixel-based this is not necessary anymore. custom line
height is handled by put_line() but can also possible to implement with
lcd_puts_scroll_func().

Change-Id: Iee9b12bf99afac93d95d2a1a6f5d5b4db237b21c
2014-01-07 14:13:48 +01:00
Thomas Martitz
91ef65306b skin_engine: Adapt put_line().
This allows for code unification and removal of a workaround (STYLE_XY_PIXELS).

Change-Id: Ie92d377414cad943cdb06976af10b4f315f32710
2014-01-07 14:13:40 +01:00
Thomas Martitz
eec89a90ff lists: Adapt put_line().
This enables removing large portions of code, simplifiyng the drawing routine.
All of the removed code is functionaltiy now available through put_line().

Change-Id: Ib8e61772134189a8c3c6d22345c0b45e912bea76
2014-01-07 14:13:40 +01:00
Thomas Martitz
5d6974641b Introduce put_line().
This function is a fully-fletched, high-level pixel-based line printer, that
combines functionality of several firmware and list functions. It can
draw spacing, icons and text in a single call, in any order and each multiple
times. It can also apply line decorations at the same time.

It features printf-like semantics by accepting a format string that contain
format tags as well as inline text.

It's accessible directly, but also through the multi-screen api for plugins.

Change-Id: I70f5a77bbf4b0252521f2e47ead377b9d6d29b54
2014-01-07 14:13:17 +01:00
Thomas Martitz
5752d029fd icons: Provide accessors to the icon format (mono or native).
This is needed by the upcoming put_line() api to apply different drawmodes
depending on the format.

Change-Id: I626a7369a6e75c9c46af1ca5e4f1a9d401899b68
2014-01-07 11:49:53 +01:00
Thomas Martitz
bc9a45b05f icons: Remove automatic left padding if x == 0.
Since x is viewport-relative the icon isn't necessarily placed at the physical
display boundaries so that the padding isn't always useful. In fact it does
more harm if one wants to place an icon exactly at 0 of a (non-default)
viewport.

Calling code looks still mostly fine. I've only modified list drawer to include
the padding in the call-site.

Change-Id: I6b16b3d4377c3553234667b79837adde10e0edf2
2014-01-07 11:36:00 +01:00
Thomas Martitz
76476751d7 lcd-charcell: Correct get_icon_width() stub, everything is 1 char wide.
Change-Id: I2a76c306be8f11827cb8d1f12641d710f49274aa
2014-01-07 11:36:00 +01:00
Jonathan Gordon
124c969f49 Fix build error
Change-Id: I32e06cc41c70e225622c87539feaca5f92131065
2013-12-30 23:35:23 +11:00
Jonathan Gordon
00b3fd2a66 skin_engine: unload skin backdrops when the skins are reset
Hopefully this will fix various skin related bugs which happen
on usb plug/unplug!

Change-Id: Ie1d8378fca38dae02e42ed02a68bdb3663651b4d
2013-12-29 18:00:38 +11:00
Thomas Martitz
ec6258f936 fix some reds.
Change-Id: Iecb1305dbd1519434e0f476d2199e728b96091f9
2013-12-23 12:35:52 +01:00
Thomas Martitz
22e802e800 playback,talk: Share audiobuffer via core_alloc_maximum().
This fixes the radioart crash that was the result of buffering.c working
on a freed buffer at the same time as buflib (radioart uses buffering.c for the
images). With this change the buffer is owned by buflib exclusively so this
cannot happen.

As a result, audio_get_buffer() doesn't exist anymore. Callers should call
core_alloc_maximum() directly. This buffer needs to be protected as usual
against movement if necessary (previously it was not protected at all which
cased the radioart crash), To get most of it they can adjust the willingness of
the talk engine to give its buffer away (at the expense of disabling voice
interface) with the new talk_buffer_set_policy() function.

Change-Id: I52123012208d04967876a304451d634e2bef3a33
2013-12-23 12:17:38 +01:00
Thomas Martitz
50eb528bc1 scroll_engine: Major rework to support pixel-based scrolling and scroll callbacks.
Much of the scrolling work is moved from lcd-bitmap-common to lcd-scroll.c,
a small scroll callback routine remains. This callback can potentially be
overridden by more extensive scrollers.

The callback also gets fed with pixel-based scrolling information, which
finally removes the strict line-based nature of the scroll engine. Along with
this is the change from scroll_stop_viewport_line() to scroll_stop_viewport_rect()
which works on a pixel-based rectangle instead of lines.

The ultimate goal is to move most of the scroll work to apps, which can
much better decide which line decorations to apply etc. This work is laying
the ground work.

Change-Id: I3b2885cf7d8696ddd9253d5a9a73318d3d42831a
2013-12-14 23:11:31 +01:00
Thomas Martitz
1c5d0b41ee scroll_engine: Rename scroll_stop* functions to be more consistent with the lcd api.
Change-Id: I8ada10b96bfb628cca0331689e8b936ae47c7e1c
2013-12-14 23:11:30 +01:00
Michael Sevakis
023f6b6efd Get rid of some superfluous single-purpose functions in playback.
* Remove explicit tracking of elapsed time of previous track.
* Remove function to obtain auto skip flag.
* Most playback events now carry the extra information instead and
  pass 'struct track_event *' for data.
* Tweak scrobbler to use PLAYBACK_EVENT_TRACK_FINISH, which makes
  it cleaner and removes the struct mp3entry.

Change-Id: I500d2abb4056a32646496efc3617406e36811ec5
2013-07-13 00:08:51 -04:00
Michael Sevakis
ffa8626b0c Fix whitespace in files for following commit.
Change-Id: I4adb8a152e9b99fcd26d95da7334d7d0cbe2a036
2013-07-12 21:39:06 -04:00
Thomas Martitz
be5fadff94 skin_engine: Fix crash on skin_reset (e.g. on language change).
Change-Id: Ie2da1a1ba9d2dad76e2f1c45abd907c3ede4f56c
2013-06-23 20:55:46 +02:00
Thomas Martitz
4263f67e4b Fix warning (move variable into #ifdef section).
Change-Id: Ic6ba4b786eef00eab7f20abd5fbf2bcb8977993a
2013-06-09 21:08:49 +02:00
Thomas Martitz
770fadddd6 Fix reds (this code needs #ifdef HAVE_ALBUMART)
Change-Id: Ia50cd846d5451b0cb5cf3a6f8097ea9fe3b3c60a
2013-06-09 21:01:47 +02:00
Thomas Martitz
58b4e71d32 skin_engine: Fix albumart logic on skin reloading.
This logic checks whether the skin's albumart dimensions differ from the
previous skin to force rebuffering if necessary. This was broken since
a while as the necessary information was reset.

Change-Id: I3b9f3a819c6af202af8ad66c13742f704ce45ab1
Reviewed-on: http://gerrit.rockbox.org/476
Tested-by: Thomas Martitz <kugel@rockbox.org>
Reviewed-by: Thomas Martitz <kugel@rockbox.org>
2013-06-09 17:39:08 +02:00
Jonathan Gordon
83d3f1d3f6 simplelist: Fix simplelist_set_line_count() so it actually sets the count
(hopefully) Fixes FS#12838

Change-Id: I932184afaf7b65121a0c459cd03c8482e3bad22b
2013-03-28 22:32:57 +11:00
Jonathan Gordon
3a13150a81 Revert "skin tags: fix the id3 track/disc numbers in conditionals"
This reverts commit a395a34671.
And fixes FS#12836 - need to rethink how to do this later.
2013-02-28 16:53:41 +11:00
Jonathan Gordon
d76dca165b checkwps: show a helpful error if the parser callback errors out
Change-Id: Ie3e35292ba8d74f0ff3d1bb3483a5e83aae0e6b6
2013-02-26 21:18:16 +11:00
Jonathan Gordon
657b91acfa skin engine: Relax the AA load width/height checks
d6c6c07 changed the AA load tag to make sure the image width/heights
fit in the viewport, Revert this because it doesn't actually make
sense to check it here.

Change-Id: I3fe4b074ef8fe88560f2f894ec651027ea3642f4
2013-02-26 20:47:46 +11:00
Jonathan Gordon
a395a34671 skin tags: fix the id3 track/disc numbers in conditionals
Fix the %in tag so %xd(a, %in) works as expected

Change-Id: I33dd3ae092a66b1363c9cf3afa08075e4534af7c
2013-02-21 21:14:58 +11:00
Alex Mayer
ee758c5a97 Theme Engine: Fix progress bar slider (FS#12823)
Fix the need to resize progress bar when using a slider.
Slider stays in bounds. Progress bar is not resized.
Works well with square sliders that should not overlap
edge of progress bar. also works with rounded sliders.

You can also make progress bar the full width of screen
while using a slider. Before if you would make the
progress bar the full width of the screen and add a slider
the progress bar would look like it was padded on both ends.

This fixes FS#12823

Change-Id: I60345efc5cd0f46286f2591ed032f0d9320d1c3e
Reviewed-on: http://gerrit.rockbox.org/402
Reviewed-by: Hayden Pearce <saint.lascivious@gmail.com>
Tested-by: Hayden Pearce <saint.lascivious@gmail.com>
Reviewed-by: Jonathan Gordon <rockbox@jdgordon.info>
2013-02-19 07:27:54 +01:00
Jonathan Gordon
1cc0809ca2 list widget: undo part of aaf3065
It fixed a simulator warning in the skin debug screen but broke
the icons in the database folder chooser. Proper fix shortly.

Change-Id: If366daacc440f937c40960112477b8f6136b72b9
2013-02-13 09:22:24 +11:00
Jonathan Gordon
aaf30651df skin_engine: Add a debug screen to display skin ram usage
Change-Id: Ida9c33211d9360ac88e30a2cf8df9f191bee8b45
2013-02-12 21:01:13 +11:00
Jonathan Gordon
69228f92db simplelist: Make better use of the static buffer and simplify API
Change-Id: I1327fcd01d6f817be6c7018d30d33446c9b57287
2013-02-12 21:01:13 +11:00
Jonathan Gordon
e41aed633f Fix (c) notice which was apparently copy/pasted from a completly unrelated file
Change-Id: I465bd6a70e911c7a56213af82b4db64c25c294f7
2013-02-12 21:01:13 +11:00
Jonathan Gordon
948dbed0af remove unused members
Change-Id: Ic0a0d300c9b7701c9173121d9d36a4dd4a28d8bd
2013-02-11 00:11:25 +11:00
Jonathan Gordon
d06779d987 gui: Fix \t indenting for RTL langs in the lists (DB folder chooser)
Change-Id: If033547ad979a2ebdd463723a31eb15e718e6f8b
2013-02-06 19:57:21 +11:00
Thomas Martitz
48bc762db1 lists: Fix item indentation in RTL to match LTR behavior (which is no indentation when the scrollbar isn't shown, apparently).
Change-Id: I5c36d34638fa7a9cba9468b7ee07a07a836fadec
2013-01-18 18:02:47 +01:00
Thomas Martitz
2ffde90c69 touchscreen: Fix kinetic and swipe scrolling outside of the list viewport.
There were some bugs, especially when the user scrolled above the
list viewport. One bug made Rockbox completely unusable once triggered.

Change-Id: I9bb4722ff4381db189058e9a19ea30b2c69e87d9
2013-01-17 23:29:35 +01:00
Jonathan Gordon
d6c6c0767c album art display: Fix RTL handling for the album art skin tag
AA was broken when an RTL language is used, causing it to not
be displayed.

Also fix th out of bounds handling when width/height > viewport

Change-Id: I4899cd32ec58107c987e3cc0e8df582963bdcf62
2013-01-15 23:10:37 +11:00
Jonathan Gordon
c500f4efe5 radio screen: Disable displaying radio art, FS#12797
With radioart enabled there appears to be buffer corruption when
the image is loaded causing the player to data abort in skin_render_line()

So, disable the code untill someone can fix it.

Change-Id: I6acf3f76ce38aa2784b1b24ed6da29a9c5bee479
2013-01-03 23:09:01 +11:00
Jonathan Gordon
685cf59008 9 segment bitmap drawing:
Use %x9(id) to draw an image in the whole current viewport using the
9 segment drawer (which draws the corners as normal and *tiles*
the middle segments to the needed width/height).

Future work is to make it scale instead of tile

Change-Id: Ic3ed1cad93f96091694801eb442e0da5a2401203
2012-12-09 17:11:19 +11:00
Frank Gevaerts
e6fd7d2d1f Make the recorder build with HAVE_LCD_FLIP disabled.
Change-Id: I5875dc5c59606867299cc0e30d869b817e879ade
2012-08-28 21:36:23 +02:00
Thomas Martitz
85a6715afa yesno/touchscreen: Only accept on touch release.
Keeping the touchscreen pressed during a screen transition can lead
to accidental actions. action_wait_for_release() currently doesn't work
properly for touchscreen, so it's better to not transition before release.

Change-Id: I37bd67945b05fff1b4a5452313f6415a247e3af9
2012-08-15 23:10:28 +02:00
Thomas Martitz
5d9b26f6a2 folder_select: fix problem when selecting / as folder.
Change-Id: Id4880267e8478cebe073b958a58fef1ac22dd336
2012-08-15 23:10:28 +02:00
Thomas Martitz
54e6bafada Fix missed buttons in action.c if action_wait_for_release() was called
with no button pressed.

If e.g. two yesno screens directly follow each other the button release of the
first one was incorrectly accepted in the second one. The fix exposed another
problem in action.c if action_wait_for_release() is called when no button is
actually pressed. The next press was silently eaten.

This time re-introducing FS#12723 is avoided by leaving the offending hunk
out in yesno.c.

Change-Id: Icfe57375067f51f5c8177f3585cd47ceec9dcf0d
2012-08-15 23:08:26 +02:00
Fred W. Bauer
53c6bab75b We should reload the playlist control file when leaving
USB mode to make sure the filedescriptor is correct.

Change-Id: I2905eaf27533d935a0458b630372584e353c7160
Reviewed-on: http://gerrit.rockbox.org/294
Reviewed-by: Michael Giacomelli <mgiacomelli@gmail.com>
Reviewed-by: Jonathan Gordon <rockbox@jdgordon.info>
2012-08-14 06:23:24 +02:00
Jonathan Gordon
70eb3e6a56 Revert "fix erroneous button read in yesno screen and missed buttons in action.c."
This reverts commit 15775c8bad.
2012-08-14 12:12:15 +10:00
Jonathan Gordon
bd6e6ed403 folder selector: handle long press to invert selection/select all.
Doing a LONG PRESS on a:
- unopened folder will select all its sub-folders
- opened folder will invert the selection of its sub-folders

Change-Id: Ia7fd8dc3b940f60adee3f0314bf6bba5eb2c7b3b
2012-08-13 15:03:12 +10:00
Jonathan Gordon
7c31ff2fb0 Fix skin engine error message
Change-Id: I2250be6d4e82cd5d91ed1a2c080e263dd7543129
2012-08-06 10:35:22 +10:00
Thomas Martitz
8c655cfdc0 New GUI browser to select one (or more) folders.
The browser lets the user pick one or more directories in a convinient
GUI browser. The initial directory list is read from a string
(separated by colons) and the resulting list is written back to the same
string (again separated by colons).

Note: The work was initially done by Jonathan Gordon, however I changed
it substantially so I claim autorship.

This selector is going to be used for autoresume and database scan folders.

Change-Id: Id1d3186dad783411eb5c6056ce93f5b6123c7aa0
2012-07-30 21:20:51 +02:00
Jonathan Gordon
9dd2eb49be skin_engine: Support percentages for viewport positioning
%V(0,50%,75%,50%,-) - make a viewport at x=0, y=half the lcd height,
75% lcd width and the remaining height (the other half) of the lcd.

Change-Id: If26ccb65e8dc52c9225f3fd6d7b222d770add0f0
Reviewed-on: http://gerrit.rockbox.org/184
Reviewed-by: Thomas Martitz <kugel@rockbox.org>
Tested-by: Thomas Martitz <kugel@rockbox.org>
Reviewed-by: Jonathan Gordon <rockbox@jdgordon.info>
2012-07-29 04:24:38 +02:00
Jonathan Gordon
08238178d3 lists: Support '\t' in list item text to indent the line containing it.
Change-Id: I1583371228ed477b504c135f81cb59a0c3c931e6
Reviewed-on: http://gerrit.rockbox.org/296
Reviewed-by: Jonathan Gordon <rockbox@jdgordon.info>
Tested-by: Jonathan Gordon <rockbox@jdgordon.info>
2012-07-19 01:21:10 +02:00
Thomas Martitz
15775c8bad fix erroneous button read in yesno screen and missed buttons in action.c.
If two yesno screens directly follow each other the button release of the
first one was incorrectly accepted in the second one. The fix exposed another
problem in action.c if action_wait_for_release() is called when no button is
actually pressed. The next press was silently eaten.

Change-Id: Iaa5f246f7ea1fd775606620a989cdaec74a9305e
2012-07-18 10:28:08 +02:00
Jonathan Gordon
68ee7aac6e skin_engine: Make pressing the setting bar touch region work
might need some tweaking, but works.

Change-Id: I0784cd4fe9996531da6cc275491ff3b4e83cdbcf
2012-07-06 14:28:34 +10:00
Jonathan Gordon
65f9df3083 skin_engine: Allow the %St() (setting) skin tag be used as a bar
%St(<setting name>) or %St(<bar tags>, setting, <setting name>)

Change-Id: I71396d683634d4d1ad2357018c4029ecb4229677
2012-07-05 23:30:06 +10:00
Jonathan Gordon
c413591e7e fix build warnings
Change-Id: Id5f0e84834f1cb74a317bb5653fdb6f665233345
2012-07-05 11:24:08 +10:00
Jonathan Gordon
d336eb30f8 skin_engine: Automatically create touch regions for skin bars
skin bars now automatically create the touch region the same size
as the bar on touchscreen targets. This means touches will
magically "just work" for reveresed bars (rtl or otherwise).

~5% padding is added on all 4 sides of the region rectangle but
this may need to be tweaked.

Please consider the 'progressbar' and 'volume' touchregion actions
to be deprecated.

Kudos to my new wife for figuring out the bleedingly obvious way to
do this!

Change-Id: I997a7bcaa70fce9885808aae27953c7676e9c2ff
2012-07-05 11:15:16 +10:00
Frank Gevaerts
7151111228 Make touchscreen handling work with skinned lists.
Change-Id: I7df93319c8f16f05e840d74b022aab4803bb8f80
2012-06-19 22:02:59 +02:00
Frank Gevaerts
21ddcbec66 CHARCELL doesn't have sbs support, so disable it properly.
This actually fixes a nullpointer dereference.

Change-Id: Ie3e153d72bcacdce46bfe5a514ff77aebdfd7225
2012-06-19 21:53:29 +02:00
Thomas Martitz
2760d578ca touchscreen: Don't hide selection by default. Fixes FS#12675.
Change-Id: Ic7e22ce6280d4105c38f7588717f4cf34c1bb5a3
2012-06-15 13:00:20 +02:00
Bertrik Sikken
d023bf0f5d Fix checks on buflib allocated handles (0 is not a valid handle value)
Change-Id: I8fdc5a59a5062f40a431cd49971390e21631b8ec
2012-06-10 17:15:47 +02:00
Jonathan Gordon
7a009276bc Fix FS#12674 - %ax() doesnt mirror viewport correctly
Change-Id: I10c933542037eeedc9c4be74b3d43a1430ec05b2
2012-05-30 21:17:40 +10:00
Bertrik Sikken
f340768ad5 _lists_uiviewport_update_callback can be made static
Change-Id: I25dfaa1636811a0340d1730a5a8f44caa85b1771
2012-05-20 01:57:49 +02:00
Frank Gevaerts
053722a573 Don't trigger a skin refresh from skinlist_draw()
Thiskin refresh trigger apparently causes the skin and list to continuously
refresh, with the side effect that buttons no longer work.

Change-Id: I4439406176890ac46a3f217bfff43c6935a03a7c
Reviewed-on: http://gerrit.rockbox.org/240
Reviewed-by: Jonathan Gordon <rockbox@jdgordon.info>
2012-05-18 09:48:31 +02:00
Jonathan Gordon
7909bf039f (hopefully) Fix FS#12639 and other skin related buflib corruption issues.
Kudos to funman for figuring out the problem - skin_find_item() rather
stupidly uses the global skin_buffer variable in skin_parser.c which is
fine in the parser EXCEPT it gets changed in skin_render when the sbs
is being redrawn while another skin is loading, so fix this by makeing
skin_find_item() use a local data pointer so a skin_render() during
parsing won't break anything.

Change-Id: I80e1c0efe569c18225e5772159c18ebb21e07332
2012-05-16 22:33:40 +10:00
Thomas Martitz
8689bcc186 Touchscreen: Check if click is outside of list. Fixes FS#12669
Change-Id: Ic036f4c399b89c65bdc43bfdf7111bf4a13be484
2012-05-13 19:15:19 +02:00
Nils Wallménius
d29a11b7a8 Rename HAVE_PITCHSCREEN to HAVE_PITCHCONTROL
Also move the definition to config.h

Change-Id: I36bb5020c5e06b2344292bc05e8c13ccc7a6a1ff
Reviewed-on: http://gerrit.rockbox.org/234
Reviewed-by: Nils Wallménius <nils@rockbox.org>
2012-05-09 14:32:38 +02:00
Rafaël Carré
65bb8e4452 Remove extraneous parens 2012-05-06 23:13:34 -04:00
Rafaël Carré
aaf9a1be49 get_image_filename() return value is never used 2012-05-06 23:00:52 -04:00
Rafaël Carré
675f171cf1 skin_parser: simplify skin_buffer_alloc
- no need to cast void * return value (it is not C++)
- use sizeof(*var) instead of sizeof(struct foobar), it is shorter and will
  stay correct if the type is changed but forgotten in the sizeof()
2012-05-06 22:43:21 -04:00
Michael Sevakis
da6cebb6b0 Use buflib for the allocation of voice PCM resources.
Buffers are not allocated and thread is not created until the first
call where voice is required.

Adds a different callback (sync_callback) to buflib so that other
sorts of synchonization are possible, such as briefly locking-out the
PCM callback for a buffer move. It's sort of a messy addition but it
is needed so voice decoding won't have to be stopped when its buffer
is moved.

Change-Id: I4d4d8c35eed5dd15fb7ee7df9323af3d036e92b3
2012-05-02 17:22:28 -04:00
Michael Sevakis
57a20d2d63 Make DSP's replaygain independent of global_settings.
Moves replaygain definitions to lib/rbcodec/dsp/dsp_misc.h.
Intermediate functions in misc.c handle any adjustment and calling
the rbcodec APIs.

Change-Id: I9f03561bca9aedd13760cf19c4e19aa3c68e7024
Reviewed-on: http://gerrit.rockbox.org/140
Reviewed-by: Michael Sevakis <jethead71@rockbox.org>
2012-04-30 22:47:37 +02:00
Michael Sevakis
56f17c4164 Make rbcodec/dsp includes more specific.
Change-Id: Idb6af40df26f5b8499a40e8b98602261ef227044
2012-04-29 17:31:30 -04:00
Michael Sevakis
c9bcbe202d Fundamentally rewrite much of the audio DSP.
Creates a standard buffer passing, local data passing and messaging
system for processing stages. Stages can be moved to their own source
files to reduce clutter and ease assimilation of new ones. dsp.c
becomes dsp_core.c which supports an engine and framework for effects.

Formats and change notifications are passed along with the buffer so
that they arrive at the correct time at each stage in the chain
regardless of the internal delays of a particular one.

Removes restrictions on the number of samples that can be processed at
a time and it pays attention to destination buffer size restrictions
without having to limit input count, which also allows pcmbuf to
remain fuller and safely set its own buffer limits as it sees fit.
There is no longer a need to query input/output counts given a certain
number of input samples; just give it the sizes of the source and
destination buffers.

Works in harmony with stages that are not deterministic in terms of
sample input/output ratio (like both resamplers but most notably
the timestretch). As a result it fixes quirks with timestretch hanging
up with certain settings and it now operates properly throughout its
full settings range.
Change-Id: Ib206ec78f6f6c79259c5af9009fe021d68be9734
Reviewed-on: http://gerrit.rockbox.org/200
Reviewed-by: Michael Sevakis <jethead71@rockbox.org>
Tested-by: Michael Sevakis <jethead71@rockbox.org>
2012-04-29 10:00:56 +02:00
Thomas Martitz
4269934588 touchscreen/lists: fix two regressions
* fix potential stack overflow through recursion
* fix using using the scrollbar during active kinetic scrolling animation

Change-Id: Iaf124970a60d3f0c2ee7919ac278f2d6ac329e47
2012-04-17 17:19:31 +02:00
Thomas Martitz
d3ead233a8 touchscreen: fix some issues/crashes with clicking the list title.
Change-Id: I31adb012ac39f9b27f6b91f5077ed4195ba1dc02
2012-04-10 10:09:39 +02:00
Thomas Martitz
48c248d02b touchscreen: fix swipe scrolling (jumped back to previous item).
Change-Id: I055a5b19dec1db3ad31212dadc11b0f5056be832
2012-04-08 13:28:21 +02:00
Thomas Martitz
688302a3b3 touchscreen: Rewrite kinetic scrolling using a state machine.
The old code was very confusing. The scrolling modes need to be handled
differently, thus a state machine makes sense. Should fix numerious
glitches and be easier to maintain.

NOTE: Behavior is still a bit glitchy with an SBS in use, because the skin
engine sees the touch events earlier than the list code.

Change-Id: I4ccead359c81de0d0fc3dea636fe2cb3a28d1bc6
2012-04-08 13:16:54 +02:00
Thomas Martitz
bb0e4cc543 touchscreen: Fix kinetic scrolling when the statusbar is off.
The scrolling code cannot differentiate between the BUTTON_TOUCHSCREEN post
from normal touches and the one posted in the timeout callback.

To fix introduce a global special button (BUTTON_REDRAW) that results
in the desired redraw. This existed already as a local kludge for android
and is now generalized.

Change-Id: I6bfa6c66431c48f5042fcd8fce2ea72cd3457f58
2012-04-05 15:01:59 +02:00
Jonathan Gordon
6f62226294 quickscreen: optionally display the shortcuts menu instead of the QS
Adds an option under settings > general settings > system to allow
the user to have the shortcuts menu displayed instead of the
quick screen. (option is "shortcuts instead of quickscreen" in the .cfg)

Change-Id: Id679b461c40ac617629422736d1509384364084d
Reviewed-on: http://gerrit.rockbox.org/199
Reviewed-by: Marek Salaba <marek.salaba@gmail.com>
Reviewed-by: Jonathan Gordon <rockbox@jdgordon.info>
2012-03-28 10:56:12 +02:00
Jonathan Gordon
b2202a3d7c skin_engine: Allow negative numbers for the start offset in %ss
i.e %ss(-1, -, %ia) will get the last letter in the %ia tag

Change-Id: I6b2764d30c072b549e7424fc6e847ec48850b46a
2012-03-27 23:42:00 +11:00
Jonathan Gordon
9445d4625a skin_engine: fix scrolling lines with dynamic content
Change-Id: If85220c8b59123814e0e6b1a3b8e00c981271021
2012-03-26 22:24:43 +11:00
Thomas Martitz
6e6f0c6ef3 Redraw simplelist if/when necessary-
Change-Id: I14a1cce8967af60a52d2d13e0b035b71fece8a63
2012-03-22 21:05:30 +01:00
Jonathan Gordon
94139ac0bd Fix FS#12606 - next track can cause the screen to be cleared
This is a bit of a hack. We now trigger an event when the skin engine
is doing a full redraw (which means fullscreen clear) before the
lcd_update() to give the current screen a chance to redraw to avoid the
screen flicker.

This commit fixes the issue for screens which are entirely the list
widget (i.e browser and menus), other screens will need aditional fixes
(i.e quickscreen, time&date screen)

Change-Id: I3725c51518be724ce7aacee9877663c2de6866fa
2012-03-20 22:10:19 +11:00
Jonathan Gordon
5edae54e0d skin_engine: Reenable skin debugging in the sim (use --debugwps)
Change-Id: I2881edda45cd3ea69f5284d93bc93c47bb63b3f2
2012-03-15 23:26:07 +11:00
Jonathan Gordon
182a6c80ba Fix compile errors
Change-Id: Ic985bf57da04847bff716ee41db8f107100ff95b
2012-03-15 23:03:33 +11:00
Jonathan Gordon
014a08cabb skin_engine: New tag to draw a rectangle (optionally with a gradient)
%dr(x, y, width, height, [colour1[, colour2]]):
x,y - viewport relative pixel coordinates to start the rectangle.
width, height - obvious. can be '-' to fill the viewport
if both colours are left out the viewports foreground colour will be used
if one colour is specified it will fill the rectangle that colour.
if both colours are specified it will gradient fill the rectangle.

Change-Id: Iad451e99ded663bc7c5d182443659db7d909b388
2012-03-15 22:52:53 +11:00
Jonathan Gordon
f31e7a1225 Revert "Fix FS#12606 - next track can cause the screen to be cleared"
This reverts commit cb9bc3bbc8.
2012-03-15 11:31:18 +11:00
Jonathan Gordon
cb9bc3bbc8 Fix FS#12606 - next track can cause the screen to be cleared
This is a bit of a hack. We now trigger an event when the skin engine
is doing a full redraw (which means fullscreen clear) before the
lcd_update() to give the current screen a chance to redraw to avoid the
screen flicker.

This commit fixes the issue for screens which are entirely the list
widget (i.e browser and menus), other screens will need aditional fixes
(i.e quickscreen, time&date screen)

Change-Id: I3ffdcd8ccad2c663732f8d5983049c837de00fe5
2012-03-14 22:52:24 +11:00
Osborne Jacobs
595427c095 Add new actions to %Tp (Touchscreen areas)
Add the following actions to %Tp:
createbookmark   create a new bookmark from the wps
listbookmarks    list bookmarks from the wps
trackinfo        show track info from the wps

My main motivation was to allow bookmarking and jumping around audio books
from the wps on touch enabled targets.  You can do it now through the context
menu but it requires 4 screen presses instead of 1.

Change-Id: I1fa1bf0064dfd22b897eca7c56acc1ce8956f14c
Reviewed-on: http://gerrit.rockbox.org/171
Reviewed-by: Jonathan Gordon <rockbox@jdgordon.info>
2012-03-13 03:17:12 +01:00
Frank Gevaerts
4fbbbf1360 Make %LC and %LR always have predictable and usable values.
%LC is now 1 for non-tiled list items (instead of undefined)
%LC and %LR are now -1 in non-list contexts.

Change-Id: Ib7090429fa95528bd141d3d7ca95fd917b25b96e
2012-03-01 18:40:59 +01:00
Frank Gevaerts
b9bf6cdb2c Call skinlist_set_cfg() unconditionally, i.e. also if do_refresh==false
This call is cheap (except if the list config changes, but then it should
be called anyway), and do_refresh isn't always set appropriately, e.g.
when the screen has just changed, which could cause the list config to be
null at bad times, which caused the standard list to be shown instead of
the desired skinned list.

Change-Id: I47dd2552d6d1062456ede4529c4891e80a8159ea
Reviewed-on: http://gerrit.rockbox.org/113
Reviewed-by: Frank Gevaerts <frank@gevaerts.be>
2012-02-29 14:11:33 +01:00
Jonathan Gordon
d96a32d01a fix warning
Change-Id: Iccadc7558b9ffb2d87e5bc7697080dd567f4775f
2012-02-29 00:18:56 +11:00
Jonathan Gordon
1c1e1c070c skin_engine: ease the restrictions on %x/%xl
%x and %xl only require the id and filename now.
If you leave off the x,y it will default to 0,0.
If you want to use the default x,y you can still put in the
num_subimages param on the end (e.g %xl(a, file, 3) )

Change-Id: I8eff793dfdd037e302ace8deec9dc16dcea264a7
2012-02-29 00:14:06 +11:00
Jonathan Gordon
34031cba5b skin_engine: Clean up %x() handling - beware theme issues
Internally remove some hacks around how %x() is handled.
%x() inside the default viewport will no longer work if
other viewports are used, so if you are using viewports and
%x() make sure it is in a viewport!

Change-Id: I8ecab805d55fc0f8476ff0516cba38e23400aa20
2012-02-28 23:51:01 +11:00
Jonathan Gordon
0807fe8d36 Fix build errors
Change-Id: Ie46e807799034af2a025c607a76e17c50c5b613e
2012-02-28 23:16:06 +11:00
Jonathan Gordon
2c71aa9feb lcd/skin_engine: Add the ability to draw onto the backdrop layer
The framebuffer the lcd driver uses can now be changed on the fly
which means that regular lcd_* drawing functions can draw onto the
"backdrop" buffer. The skin engine can use this to create layered
effects.

Add the tag %VB to a viewport to draw that viewport onto the
backdrop layer. If you want to draw an image onto the backdrop
framebuffer use %x(backdrop filename) instead of %X() inside
a viewport with %VB.

Change-Id: I741498e2af6d4f2d78932cabe8942317893e7cfc
2012-02-28 23:03:04 +11:00
Frank Gevaerts
077e8b61a0 Clean up some variables.
Renames origional_* variables to original_*
Removes original_(width,height) variables that weren't actually used

Change-Id: I604c2ef9ce9d806551e8c52080a5c895415e088c
2012-02-25 22:04:20 +01:00
Frank Gevaerts
b5cd5ce8a1 Add %LR and %LC to get at the current row and columm in skinned lists.
This allows list items to be rendered differently depending on their
on-screen position, allowing things like gradients or nonlinear alignment

Change-Id: I1d9c080f97e83707f0e80f57abc762cb2b94f6ed
2012-02-25 16:43:27 +01:00
Jonathan Gordon
31a05953e1 FS#12586 - Modify %ss to be able to use numbers for conditionals
i.e %?ss(1,1,%cM)<|one|two|three|...|> or %xd(numbers, %ss(1,1%cM)

Change-Id: I74ecb3f253f3be1fd270f75c0ef79addd364a7de
2012-02-26 00:50:14 +11:00
Frank Gevaerts
680c6fcde1 Store listitem_viewport_cfg->label as skinoffset instead of raw pointer
This fixes the case where some blocks got relocated and the skin render
code couldn't find the matching viewports any more.

Change-Id: I4394444fb139ee5bc986f374dba82a104013e354
Reviewed-on: http://gerrit.rockbox.org/112
Reviewed-by: Frank Gevaerts <frank@gevaerts.be>
2012-02-22 01:15:42 +01:00
Frank Gevaerts
1a4da5961e Make skinned lists handle the "0 items" case without crashing
Change-Id: Iaf69c93727e0f0e2a48b44c330883f7a620c4d99
2012-02-21 01:29:12 +01:00
Jonathan Gordon
9c21258e2c skin engine: Add 'touch' command to the %vs() tag
%vs(label, touch, -) will reset the timeout for the variable without
changing the variables value.

Change-Id: Idba03f454a82ac7460bb53a4de3aa6903656c585
2012-02-21 00:34:58 +11:00
Jonathan Gordon
43fc2a51d9 skin engine: Make %vs() dynamic so it updated every screen update
This makes it easier to use %?vl() (variable last changed) in a sensible manner.

Change-Id: I0bf9ae24bc4516d2fd5691af236cc4439a0863c8
2012-02-21 00:17:49 +11:00
Frank Gevaerts
9c3ce33d4e Fix another skinned list buflib issue
Change-Id: Ib0eebf56b1bf4f4119ebfd21679f6cd9c8986ea4
2012-02-19 21:06:03 +01:00
Frank Gevaerts
46285e7c2f Fix a nullpointer dereference in skinned lists.
Unfortunately this doesn't seem to be the only problem with skinned
lists. Fixing this still doesn't make them work right.

Change-Id: Ibf80eb2a4fa4eb392e2f3ea9744aec68c6181961
2012-02-19 20:52:06 +01:00
Bertrik Sikken
f81100efd2 make local variable current_list static
Change-Id: Ibe3536a4865c12160e933d3696af4b5507713ffe
2012-02-19 12:12:40 +01:00
Jonathan Gordon
a2f28452e1 Fix FS#9391 - playback engine gets confused by multiple simultaneous button presses
Change-Id: Ie08f9dabc814adfe92c382d2e770808839cd6dd2
2012-02-07 22:06:09 +11:00
Jonathan Gordon
40ecdf6811 skin engine: New logical 'and' and 'or' tags to evaluate multiple tags in a single conditional.
Use these tags to stop having multiple conditionals.. e.g:
OLD: %?C<%?Ia<something>>
NEW: %?and(%C, %Ia)<something>

Change-Id: Ia3bbe4611cf808e87dcd1b1147181461fa08294a
2012-02-07 21:41:18 +11:00
Thomas Martitz
54044fd6e9 Apply "Skip to outro" and specific skip lengths to individual tracks in a cuesheet.
Previously it applied to the whole file and you couldn't skip betweenn the
subtracks. Now it behaves consistently with real seperated tracks.

Change-Id: Ic1730ace142a05d9726b8c9afd67e94823651b60
2012-01-30 21:25:31 +01:00
Jonathan Gordon
a65d241dd0 skin touchregions: change the rwd/ffwd region actions to make it less buggy in the sbs
Change-Id: Ib823860e65909ac227910a16f6caac207b7e22c3
2012-01-28 23:38:16 +11:00
Jonathan Gordon
8a3af26364 skin touchregions: fix the 'none' region firing when it shouldnt.
Change the none action return value so the various action layers don't get confused by ACTION_TOUCHSCREEN return codes which shouldn't be happening (i.e when a long press region overlaps a short press region whihc has the none action)

Change-Id: I63db2c0b49597ada2c5ebd0ef98e99aeef4f522a
2012-01-23 07:42:28 +11:00
Jonathan Gordon
eb2ea7f9ad keyclick: Add a callback so screens can cancel a click. Add a generic list callback to stop clicks when we are at the end of the list
Change-Id: Iabb44a861dd7506cd883c1bdb0241303fa646746
2012-01-12 22:28:36 +11:00
Rafaël Carré
b612263b1e apps: lcd-remote.h is not needed if HAVE_REMOTE_LCD is not defined
Fix a comment

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31608 a1c6a512-1295-4272-9138-f99709370657
2012-01-07 19:35:46 +00:00
Thomas Martitz
c1bd9b0361 Rework powermgmt to enable code re-use on appliation and sims.
* Introduce CONFIG_BATTERY_MEASURE define, to allow targets (application)
to break powermgmt.c's assumption about the ability to read battery voltage.
There's now additionally percentage (android) and remaining time measure
(maemo). No measure at all also works (sdl app). If voltage can't be measured,
then battery_level() is king and it'll be used for power_history and runtime
estimation.

* Implement target's API in the simulator, i.e. _battery_voltage(), so it
doesn't need to implement it's own powermgmt.c and other stubs. Now
the sim behaves much more like a native target, although it still
changes the simulated battery voltage quickly,

* Other changes include include renaming battery_adc_voltage() to
_battery_voltage(), for consistency with the new target functions and
making some of the apps code aware that voltage and runtime estimation
is not always available.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31548 a1c6a512-1295-4272-9138-f99709370657
2012-01-03 23:44:38 +00:00
Jonathan Gordon
7949dd4dae protect the yes/no screen from extra keypresses (which can happen if you display 2 yes/no screens too quickly)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31452 a1c6a512-1295-4272-9138-f99709370657
2011-12-28 05:55:05 +00:00
Bertrik Sikken
e6c85a6735 local variable app/gui/icon.c/iconsets can be made static
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31386 a1c6a512-1295-4272-9138-f99709370657
2011-12-20 21:05:56 +00:00
Bertrik Sikken
cb972abc48 Another round of making local functions static
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31384 a1c6a512-1295-4272-9138-f99709370657
2011-12-20 20:35:28 +00:00
Boris Gjenero
fdc29d0ea4 Add more INIT_ATTR and add config.h includes to header files with INIT_ATTR.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31370 a1c6a512-1295-4272-9138-f99709370657
2011-12-19 20:12:52 +00:00
Boris Gjenero
8e6030c822 FS#12378 : Remove various unused code, and comment out some unused code and data for reference or future use.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31256 a1c6a512-1295-4272-9138-f99709370657
2011-12-14 21:45:25 +00:00
Jonathan Gordon
13f1b08388 Allow scrolling lines to have their content changed without restarting the scroll line. This means skin lines with dynamic tags can be updated in realtime instead of delayed
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31247 a1c6a512-1295-4272-9138-f99709370657
2011-12-14 12:53:19 +00:00
Jonathan Gordon
b3caa01062 Fix FS#12237 (caused by r30302) where centered skin text isnt eqactly centered
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31246 a1c6a512-1295-4272-9138-f99709370657
2011-12-14 09:48:52 +00:00
Jonathan Gordon
a55982d130 Fix touchscreens so entering the WPS with a skin with no touchregions reverts to grid mode (caused by r30991)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31156 a1c6a512-1295-4272-9138-f99709370657
2011-12-06 10:30:13 +00:00
Boris Gjenero
694502a965 Fix FS#12423 : Rockbox access to /.rockbox/fonts after usb_enable(true). This fixes entry into USB mode on the Archos Recorder V2 and possibly also other targets using a USB to IDE bridge chip. Fred Bauer found this removes the need for a workaround in glyph_cache_save(). I'm including his patch which removes the workaround.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31155 a1c6a512-1295-4272-9138-f99709370657
2011-12-06 00:58:01 +00:00
Boris Gjenero
d51e598335 FS#12412 : Delete old buffer allocation code which has been replaced by core_alloc, and move buffer setup code to core_alloc.c
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31088 a1c6a512-1295-4272-9138-f99709370657
2011-11-29 00:42:27 +00:00
Jonathan Gordon
8ed7ba1d7b Fix fs#12005 - have %pc,%pl and %pr return the number of seconds when used with %if() instead of a formatted time string
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31082 a1c6a512-1295-4272-9138-f99709370657
2011-11-28 11:16:01 +00:00
Jonathan Gordon
d66592bad1 Be less smart about when to reload skins as it caused more problems than it was worth. If any theme setting is loading from a .cfg reload all skins. Fixes FS#12410
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31081 a1c6a512-1295-4272-9138-f99709370657
2011-11-28 10:58:15 +00:00
Jonathan Gordon
25bce232f2 Fix FS#12408 - don't load skins too early causing buflib handles to leak
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31080 a1c6a512-1295-4272-9138-f99709370657
2011-11-28 10:44:16 +00:00
Jonathan Gordon
fc5cdacafd slightly reaarange code to make fml happy :)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31071 a1c6a512-1295-4272-9138-f99709370657
2011-11-27 13:57:18 +00:00
Jonathan Gordon
494860cfd4 Free a handle when we try to load a backdrop file which doesnt exist or cant be loaded
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31070 a1c6a512-1295-4272-9138-f99709370657
2011-11-27 11:50:07 +00:00
Jonathan Gordon
6cf7cb9822 Don't load the icons unless show_icons is actually enabled. And respect that setting in the shortcuts menu
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31069 a1c6a512-1295-4272-9138-f99709370657
2011-11-27 10:10:26 +00:00
Jonathan Gordon
080a746ce3 Fix the charcell compile error and rmeove an unused #define
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31039 a1c6a512-1295-4272-9138-f99709370657
2011-11-21 10:08:34 +00:00
Jonathan Gordon
f78bcb165f skinengine: Load the fms the first time the fm screen is entered instead of on boot to save some ram
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31038 a1c6a512-1295-4272-9138-f99709370657
2011-11-21 10:03:36 +00:00
Jonathan Gordon
0ca4b38b1b skinengine: Rework skin loading so skins can be un/loaded individually. This also means that loading a .cfg which doesnt change themes shouldnt have them reloaded
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31037 a1c6a512-1295-4272-9138-f99709370657
2011-11-21 10:02:23 +00:00
Fred Bauer
fdfc88f38b Rename global_settings member glyphs to glyphs_to_cache and add descriptive comment.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31032 a1c6a512-1295-4272-9138-f99709370657
2011-11-20 15:41:17 +00:00
Fred Bauer
ea7a89606c FS#12293 Global default glyph setting in System > Limits > Glyphs To Cache. Defaults to 250. This saves a lot of RAM while still allowing non-English users to have adequate glyph coverage.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31031 a1c6a512-1295-4272-9138-f99709370657
2011-11-19 23:34:26 +00:00
Jonathan Gordon
1252d0d540 Get rid of a really annoying #ifdef line to check if backdrop support should be enabled
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31027 a1c6a512-1295-4272-9138-f99709370657
2011-11-19 13:46:25 +00:00
Thomas Martitz
1645c148e3 Simulate usb plugging on the sim better using sim_tasks.
Now all threads need to ack the connection like on real target, dircache is unloaded and playback stops accordingly.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31009 a1c6a512-1295-4272-9138-f99709370657
2011-11-17 18:40:00 +00:00
Jonathan Gordon
9c8e2c8e1e skin engine: Fix %if() when comparing against a number.
If the tag being checked returns a number as a string (i.e %pv) but doesnt set the intval try to convert the string to a number so the comparisson operators work

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31003 a1c6a512-1295-4272-9138-f99709370657
2011-11-17 12:00:58 +00:00
Jonathan Gordon
b048c91eb3 OOPS! Don't overwrite the trailing \0 from the skin text with the first alloc (should fix FS#12388)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30998 a1c6a512-1295-4272-9138-f99709370657
2011-11-16 13:43:28 +00:00
Jonathan Gordon
ea2a3ee7a8 Fix the gpl notice in the previous commits new files, and fix the yelow gevearts naughtily ignored
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30996 a1c6a512-1295-4272-9138-f99709370657
2011-11-16 10:37:48 +00:00
Jonathan Gordon
9e07ef2b0a Use buflib for all skin engine allocations.
Massive thanks to Michael Chicoine and other testers for finding the early bugs.

This removes all skin memory limitations

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30991 a1c6a512-1295-4272-9138-f99709370657
2011-11-15 14:11:08 +00:00
Thomas Martitz
86e8f6ad23 Fix another typo. sorry.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30973 a1c6a512-1295-4272-9138-f99709370657
2011-11-13 15:51:25 +00:00
Thomas Martitz
0602dbce4e Fix typos in usb_screen.c and use lcd_remote_bmp() for showing the rockbox logo on remotes as well.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30972 a1c6a512-1295-4272-9138-f99709370657
2011-11-13 15:44:27 +00:00
Thomas Martitz
9a70c42241 Add the ability to create a prefilled struct bitmap along with generated images.
This allows to directly draw generated and builtin images using lcd_bmp(bm_xxx);
Also fixes builtin list icons on non-mono targets, as they didn't have the
format field set.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30971 a1c6a512-1295-4272-9138-f99709370657
2011-11-13 15:37:16 +00:00
Thomas Jarosch
e5ea0b3418 Fix copy'n'paste bug in skin engine
cppcheckout reported:
[apps/gui/skin_engine/skin_tokens.c:1553] -> [apps/gui/skin_engine/skin_tokens.c:1553]: (style) Same expression on both sides of '||'.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30964 a1c6a512-1295-4272-9138-f99709370657
2011-11-11 16:54:21 +00:00
Fred Bauer
7c6acd4783 close file descriptor
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30962 a1c6a512-1295-4272-9138-f99709370657
2011-11-11 01:19:09 +00:00
Thomas Martitz
b02c82e105 Adapt icon and skin engine to make use of the new 32bit bitmap capabilities.
You can now use 32bit icons in lists and skins
(except album art, but can be added if wanted). The code also shows how
to free the unused alpha channel data if the bitmap doesn't actually contain
such information.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30939 a1c6a512-1295-4272-9138-f99709370657
2011-11-08 21:39:28 +00:00
Thomas Martitz
13209604c1 Add new lcd_bmp and lcd_bmp_part APIs.
This new APIs wrap around lcd_[mono|transparent]_bitmap/_part calls and
handle all kinds bitmaps. The intended use is to draw bitmaps that
come from read_bmp_fd/_file.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30936 a1c6a512-1295-4272-9138-f99709370657
2011-11-08 21:34:46 +00:00
Thomas Martitz
1afcd74fdd Simplify icon.c a bit.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30934 a1c6a512-1295-4272-9138-f99709370657
2011-11-08 21:23:02 +00:00
Jonathan Gordon
f19f3efb07 Redo r30826 (and hopefully not reintroduce font issues) which cleans up the font API. FONT_UI is deprecated, use screens[screen].getuifont() instead (and .setuifont() to set it after a font has been loaded)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30932 a1c6a512-1295-4272-9138-f99709370657
2011-11-08 10:09:33 +00:00
Jonathan Gordon
452a3ce274 Put icons on buflib:
Removes the max icon size limitation and doesnt waste RAM

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30931 a1c6a512-1295-4272-9138-f99709370657
2011-11-08 09:36:35 +00:00
Thomas Martitz
93c6c79e8d Better fix for FS#12337. Use 0 to make the line height calculated from the font height, as before r30773.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30850 a1c6a512-1295-4272-9138-f99709370657
2011-10-29 15:16:02 +00:00
Thomas Martitz
e126153687 Fix FS#12357 - New backdrop not displayed after set backdrop from context menu
The loaded flag wasn't set and skin_backdrop_show() call was missing.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30846 a1c6a512-1295-4272-9138-f99709370657
2011-10-28 17:09:38 +00:00
Thomas Martitz
7352e72cb9 Fix charcell build
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30828 a1c6a512-1295-4272-9138-f99709370657
2011-10-23 11:12:52 +00:00
Thomas Martitz
155a9f8abd Fix FS#12337 properly. Also fixes FS#12345 which the previous commit introduced.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30827 a1c6a512-1295-4272-9138-f99709370657
2011-10-23 11:05:27 +00:00
Fred Bauer
e299eb3ea3 Add functions font_set_ui() and font_get_ui(). The font returned by FONT_UI used to be fixed at zero but since buflib-fonts (r30589) can be different, depending on the order of loads and unloads. Fixes broken behavoir in virtual keyboard (FS#12336), lyrics player (FS#12306), and hopefully, FS#12337
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30826 a1c6a512-1295-4272-9138-f99709370657
2011-10-22 17:13:33 +00:00
Thomas Martitz
5c509d17db Fix buttonbar and line padding in time&date screen.
The time&date screen uses a custom parent for do_menu(), and doesn't
account for the buttonbar and list line height. Introduce
gui_synclist_set_viewport_defaults() to set those for viewports that are
going to be list parents and use that so that time&date screen doesn't need
to know about buttonbar/line padding.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30824 a1c6a512-1295-4272-9138-f99709370657
2011-10-22 10:09:23 +00:00
Thomas Martitz
09d0b6fec4 Fix backwardly named variable.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30823 a1c6a512-1295-4272-9138-f99709370657
2011-10-22 10:06:48 +00:00
Fred Bauer
8d74458744 Revert skin font allocation size to the behavior prior to r30589. i.e. Default to 256 glyphs rather than trying to load MAX_FONT_SIZE. This matches the manual and saves a lot of ram if a theme uses multiple fonts.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30804 a1c6a512-1295-4272-9138-f99709370657
2011-10-19 16:33:33 +00:00
Thomas Martitz
ed99b6eaff Fix FS#12337. Skin viewports' line height was initialized with the UI font height.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30786 a1c6a512-1295-4272-9138-f99709370657
2011-10-18 19:04:45 +00:00
Thomas Martitz
3b12634e6b Commit FS#12321 - Touchscreen: List line padding, to more easily select lines
This adds line padding to lists on touchscreens,
in order to make lists reasonably useful without huge fonts.

It's configurable:
* Automatic (default, line height calculated using a lcd dpi aware function)
* Off (status quo, line height = font height)
* X pixels (from 2 to 50 in even steps)

The automatic setting should/aims to Just Work Out Of The Box on all targets

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30773 a1c6a512-1295-4272-9138-f99709370657
2011-10-17 17:38:10 +00:00
Thomas Martitz
4f3e1d6b48 Fix FS#12320 - need substitute to /.rockbox/skin_buffer_size.txt
Since recent skin engine related commits images aren't stored on the skin
buffer anymore. The buffer was decreased accordingly. Now some themes used that
buffer more for tokens than images and are now broken.

To fix, increase the max token count, while optimizing the two most often
allocated structs for size (so no net ram usage increase).

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30762 a1c6a512-1295-4272-9138-f99709370657
2011-10-16 15:55:12 +00:00
Björn Stenberg
2176fb38b6 Missed two spots.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30757 a1c6a512-1295-4272-9138-f99709370657
2011-10-15 19:47:59 +00:00
Björn Stenberg
0942e2a0f7 Changed the FOR_NB_SCREENS macro to always be a for loop that declares its own loop variable. This removes the need to declare this variable in the outer scope.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30756 a1c6a512-1295-4272-9138-f99709370657
2011-10-15 19:35:02 +00:00
Thomas Martitz
2a04202ffa Fix touchscreen behavior in time&date screen.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30725 a1c6a512-1295-4272-9138-f99709370657
2011-10-07 22:30:09 +00:00
Thomas Martitz
42a33a7f70 Correct left-over assignment.
Also remove unnecessary NULL guard.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30723 a1c6a512-1295-4272-9138-f99709370657
2011-10-07 17:31:15 +00:00
Thomas Martitz
f86506675e Re-order things to fix red.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30722 a1c6a512-1295-4272-9138-f99709370657
2011-10-07 17:28:27 +00:00
Thomas Martitz
0acdc87df4 lists: Detect dirtyness (need to reinit) for each list, instead of once globally.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30721 a1c6a512-1295-4272-9138-f99709370657
2011-10-07 17:22:49 +00:00
Thomas Martitz
6efb3f0760 Revert r30599 "Check for the magic file "/.rockbox/skin_buffer_size.txt" [...]"
It's not clear whether a user setting is the right/accepted fix for the skin buffer.
But even if it is, this implementation of it is considered bad, even by the author.

See http://www.rockbox.org/mail/archive/rockbox-dev-archive-2011-09/0054.shtml

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30718 a1c6a512-1295-4272-9138-f99709370657
2011-10-05 17:43:51 +00:00
Fred Bauer
b683874e98 Do not font_unload() failed fonts when aborting a skin load
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30714 a1c6a512-1295-4272-9138-f99709370657
2011-10-05 04:19:00 +00:00
Bertrik Sikken
2e58d5935d Make function calc_db in peakmeter.c static
Remove some unneeded #include "peakmeter.h"

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30713 a1c6a512-1295-4272-9138-f99709370657
2011-10-04 21:25:26 +00:00
Bertrik Sikken
9bddc48b32 Remove unused function display_keylock_text
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30712 a1c6a512-1295-4272-9138-f99709370657
2011-10-04 20:34:15 +00:00
Andree Buschmann
99257101f2 Fix a 'set but not used' warning.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30615 a1c6a512-1295-4272-9138-f99709370657
2011-09-28 17:03:45 +00:00
Jonathan Gordon
4f7a73aad8 fix FS#12295
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30614 a1c6a512-1295-4272-9138-f99709370657
2011-09-28 01:02:48 +00:00
Jonathan Gordon
aca6b9e91a fix APPLICATION build errors
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30601 a1c6a512-1295-4272-9138-f99709370657
2011-09-25 13:01:52 +00:00
Jonathan Gordon
c89f9d9060 fix warnings
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30600 a1c6a512-1295-4272-9138-f99709370657
2011-09-25 12:57:00 +00:00
Jonathan Gordon
f7c2978cc4 Check for the magic file "/.rockbox/skin_buffer_size.txt" on bootup which can have a number which is the amount of kilobytes to allocate for the skin buffer. This is only checked on boot so if you need to change it you must reboot to enable.
Currently the default size is 80KB on colour targets which can be way too much or not enough for users.
The format of the /.rockbox/skin_buffer_size.txt file is simply a number (so 120 if you want 120 kilobytes), NO trainling spaces or text of any kind

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30599 a1c6a512-1295-4272-9138-f99709370657
2011-09-25 12:55:40 +00:00
Frank Gevaerts
40f05b6ca1 Fix silly mistake
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30595 a1c6a512-1295-4272-9138-f99709370657
2011-09-24 19:12:37 +00:00
Frank Gevaerts
5903c07ad7 Make %LT 1-based. This tag will likely only be used to print the item number (as opposed to e.g. using it as an index to a bitmap strip, which has the obvious problem of not knowing how many items there are), and most people prefer 1-based numbering systems.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30594 a1c6a512-1295-4272-9138-f99709370657
2011-09-24 19:09:33 +00:00
Jonathan Gordon
32791608fc fix checkwps
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30593 a1c6a512-1295-4272-9138-f99709370657
2011-09-24 14:57:30 +00:00
Jonathan Gordon
83cfbf4e51 Allow fonts to use smaller buffers than the default size. use font_load_ex() to speficiy the buffer size. If the font is already loaded with a smaller buffer it will be reloaded to use the new size. Also fix an issue where handles would get lost if fonts fail to load in skins
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30592 a1c6a512-1295-4272-9138-f99709370657
2011-09-24 14:52:16 +00:00
Jonathan Gordon
aa0f4a4bbe FS#12273 - use buflib for font storage. thanks to the testers :)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30589 a1c6a512-1295-4272-9138-f99709370657
2011-09-24 13:19:34 +00:00
Frank Gevaerts
28d5f2aa57 Add "%LN" tag to retrieve the list item number of the current item. This allows e.g. putting item numbers in skinned lists.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30568 a1c6a512-1295-4272-9138-f99709370657
2011-09-18 12:35:32 +00:00
Andree Buschmann
e14bda521d Fix some 'set but not used' warnings.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30565 a1c6a512-1295-4272-9138-f99709370657
2011-09-17 20:53:28 +00:00
Jonathan Gordon
782708e494 fix warning
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30555 a1c6a512-1295-4272-9138-f99709370657
2011-09-15 13:55:20 +00:00
Jonathan Gordon
81343bae5d skin_engine: make sure to free all buflib allocations so we dont leak handles/memory
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30554 a1c6a512-1295-4272-9138-f99709370657
2011-09-15 13:48:17 +00:00
Jonathan Gordon
454272cabf skin-touchscreen: make %T(..., setting_set, ...) apply sound settings
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30551 a1c6a512-1295-4272-9138-f99709370657
2011-09-15 06:51:47 +00:00
Jonathan Gordon
b6271900b0 Make sure to set the current lcd backdrop id so the buflib move callback can reset the correct backdrop
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30515 a1c6a512-1295-4272-9138-f99709370657
2011-09-13 13:20:17 +00:00
Jonathan Gordon
edf06b7324 if font_glyphs_to_bufsize() returns 0 it means the font couldnt be loaded, so allocating the buffer size is pointless
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30512 a1c6a512-1295-4272-9138-f99709370657
2011-09-12 10:26:23 +00:00
Frank Gevaerts
78a0d49bdb Second attempt at making %ss utf8-clean
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30509 a1c6a512-1295-4272-9138-f99709370657
2011-09-11 15:54:56 +00:00
Frank Gevaerts
bce46a755d Make %ss utf8-aware
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30508 a1c6a512-1295-4272-9138-f99709370657
2011-09-11 15:29:56 +00:00
Jonathan Gordon
6c1de04a63 fix red
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30503 a1c6a512-1295-4272-9138-f99709370657
2011-09-11 10:48:19 +00:00
Jonathan Gordon
3d0317a273 Rework how the skin gets the list item text to save some ram. Also allow the %LI and %LT tags to take 2 optional parameters to get a different items text/icon:
%LT(offset, nowrap) - get the text for the "being drawn"+offset item (offset being + or -). if the second param is "nowrap" (Without quotes) the text will be blank if the item would need to wrap. Same for the icon
e.g:
%LT(-1)
%LT <<
%LT(1, nowrap)

will display:
Four
Five <<
Six (or nothing if Five is the last item)

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30502 a1c6a512-1295-4272-9138-f99709370657
2011-09-11 10:44:17 +00:00
Jonathan Gordon
93a600fdab Fix albumart which r30500 broke (FS#12271)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30501 a1c6a512-1295-4272-9138-f99709370657
2011-09-11 09:07:20 +00:00
Jonathan Gordon
3b9ffd28da New tag %ss() which lets you get a substring of another tag.
%ss(start, length, tag) - i.e %ss(0,1,%TL) will get the first letter of the current lines text.
use - for the length to get the rest of the tag (e.g %ss(1,-,%TL) will get everything after the first letter).

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30500 a1c6a512-1295-4272-9138-f99709370657
2011-09-11 01:50:06 +00:00
Jonathan Gordon
86c543216f Fix FS#12270 - properly initialiase the wps_data struct so skin_data_reset() doesnt crash later
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30499 a1c6a512-1295-4272-9138-f99709370657
2011-09-11 01:28:36 +00:00
Frank Gevaerts
559e0e10f8 Remove a stray include that managed to slip into the previous commit
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30492 a1c6a512-1295-4272-9138-f99709370657
2011-09-09 18:10:01 +00:00
Frank Gevaerts
bd292b28c6 Extend $if() to also allow lt, gt, lte, and gte for strings.
The usefulness of this is arguable, but this improves consistency at only a very small cost


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30491 a1c6a512-1295-4272-9138-f99709370657
2011-09-09 18:06:07 +00:00
Jonathan Gordon
a483c9c6f1 Use buflib for skin images. Allows much more images to be loaded
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30478 a1c6a512-1295-4272-9138-f99709370657
2011-09-08 12:38:21 +00:00
Jonathan Gordon
4f4e91e341 make some stuff static
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30477 a1c6a512-1295-4272-9138-f99709370657
2011-09-08 12:38:14 +00:00
Jonathan Gordon
a91fa97cd8 fix checkwps
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30476 a1c6a512-1295-4272-9138-f99709370657
2011-09-08 11:34:05 +00:00
Jonathan Gordon
070f6e1397 Use buflib for the skin backdrop images potentially allowing multiple images per skin in the future
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30475 a1c6a512-1295-4272-9138-f99709370657
2011-09-08 11:24:29 +00:00
Jonathan Gordon
c1a14863f5 Fix FS#12262 - Volume (and all sound settings and anything using the "table" setting type) don't get applied correctly when being changed from the quickscreen or by using the %T(..., setting_inc/dec) skin tag
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30466 a1c6a512-1295-4272-9138-f99709370657
2011-09-07 13:33:05 +00:00
Jonathan Gordon
d43b85c7ed fix the last of the error
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30464 a1c6a512-1295-4272-9138-f99709370657
2011-09-06 14:07:27 +00:00
Jonathan Gordon
d2ab44e3f6 fix checkwps
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30463 a1c6a512-1295-4272-9138-f99709370657
2011-09-06 13:58:19 +00:00
Jonathan Gordon
63a379c64c Add the new file and fix the compile error
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30462 a1c6a512-1295-4272-9138-f99709370657
2011-09-06 13:53:46 +00:00
Jonathan Gordon
9b6ac01c7b Lists can now be completly draw using the skin engine!
due to lack of user feedback the actual tags may change, hopefully not though.

The way it works is the skin specifies a rectangle and a viewport label. For each item in the list that is being displayed all viewports with the specified label are drawn. However, instead of the viewport x/y position being offset from the top left corner like normal they are offset from the rectangle position in the list (so think of them as child-viewports of the rectangle which moves).
Normally the rectangle will move down the screen to show a normal list, this can be changed to move across the screen in a grid pattern.
The UI viewport is used to bound the items (i.e %Vi() )
Scrolling is completly disabled in all items except the currently selected item.

This works well in combination with the %cs tag to show differently styled lists based on the current screen :)

New tags:
%LT - Get the current items text
%LI - Get the current items icon number
%Lc - Use as a conditional to determine if the current item is the selected item
%LB - BAR TAG to show the scroll bar, params/options like other bar types. It still needs a bit of work though. Use as a conditional to find out if the bar is actually needed
%Lb(viewport, width, height [,tile]) - specify the viewport label to draw for each item and the size of each item. if the last param is 'tile' it will form a grid instead of a list

example.sbs:
%?cs<%Lb(a,100,20)|>
%V(0,0,10,-,1)%Vf(aabbcc)
%?LB<%LB(0,0,10,185, invert)>
%Vi(-,10,0,-,-35,1)
%Vl(a,5,5,160,12,1)
%s%?Lc<%Vg(00ffaa, ff0000, 000000)%Vs(gradient)%>%>%>%ac>zzzzzzz            %LT         zzzzz%s%?Lc<%ar%<%<%<>
%V(0,185,-,-,1)
%s%LT

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30461 a1c6a512-1295-4272-9138-f99709370657
2011-09-06 13:49:41 +00:00
Jonathan Gordon
642736f53b fix error, none of this code is needed or would work in the checkwps program anyway
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30429 a1c6a512-1295-4272-9138-f99709370657
2011-09-04 13:23:40 +00:00
Jonathan Gordon
8997321777 Remove duplicated code to search for a setting by its cfg name
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30428 a1c6a512-1295-4272-9138-f99709370657
2011-09-04 13:17:09 +00:00
Jonathan Gordon
573f2206c1 Add the list colour callback and a proper title icon to the simplelist api
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30419 a1c6a512-1295-4272-9138-f99709370657
2011-09-03 13:24:56 +00:00
Thomas Martitz
d0b72e2590 GSoC/Buflib: Add buflib memory alocator to the core.
The buflib memory allocator is handle based and can free and
compact, move or resize memory on demand. This allows to effeciently
allocate memory dynamically without an MMU, by avoiding fragmentation
through memory compaction.

This patch adds the buflib library to the core, along with
convinience wrappers to omit the context parameter. Compaction is
not yet enabled, but will be in a later patch. Therefore, this acts as a
replacement for buffer_alloc/buffer_get_buffer() with the benifit of a debug
menu.

See buflib.h for some API documentation.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30380 a1c6a512-1295-4272-9138-f99709370657
2011-08-30 14:01:33 +00:00
Michael Sevakis
5078d460c6 Fix FS#12238 - WPS delay on pause introduced by r30097 which was the excuse I wanted anyway to do a better PCM fade on stop/pause implementation. New fade is asynchronous tick-based. Restores skin update points in the WPS that were removed when fading mechanism was changed.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30340 a1c6a512-1295-4272-9138-f99709370657
2011-08-23 01:37:59 +00:00
Frank Gevaerts
9b9bd73dfb Fix last charcell warning
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30307 a1c6a512-1295-4272-9138-f99709370657
2011-08-14 14:13:16 +00:00
Jonathan Gordon
c3fe7b0f88 need... sleep... try again to fix red
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30306 a1c6a512-1295-4272-9138-f99709370657
2011-08-14 14:12:21 +00:00
Jonathan Gordon
810e9c4dcb fix charcell again.... wouldnt it be nice to remove charcell support all together? :)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30305 a1c6a512-1295-4272-9138-f99709370657
2011-08-14 14:04:46 +00:00
Jonathan Gordon
4ed1340a7c Fix player errors
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30303 a1c6a512-1295-4272-9138-f99709370657
2011-08-14 13:56:10 +00:00
Jonathan Gordon
281f1a1ed6 New skin tags: %Vs() to set the text style and %Vg() to get the viewports gradient colours
%Vs(mode[, param]) : mode can be "invert", "color" (where param is the colour to use", "clear" to disable the current style, "gradient" where param is the number of lines the gradient should draw over.
%Vg(start colour, end colour, [text colour]), if this tag isnt used the list selection colours from the settings will set the gradient colours

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30302 a1c6a512-1295-4272-9138-f99709370657
2011-08-14 13:50:07 +00:00
Jonathan Gordon
969903b5fe Change the way the %Tl() (touch region) tag is done to remove dodgey 1-char settings.
check the manual...
%Tl(..., &action) -> %Tl(..., action, repeat_press)
%Tl(..., *action) -> %Tl(..., action, long_press)
%Tl(..., !action) -> %Tl(..., action, reverse_bar)
and a new allow_while_lock to make the region fire when softlocked

these options must all be after the action name, but otherwise the order doesnt matter. And for the setting_inc/dec/set action the setting name must follow the action name, *then* the options

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30219 a1c6a512-1295-4272-9138-f99709370657
2011-07-28 12:53:22 +00:00
Jonathan Gordon
bb618dbd84 skin engine softlock support for touchscreens:
Modify the %Tl() tag to add a new region 'lock' which will lock/unlock the wps/sbs from touches (hardware buttons still work)
You can also specify a region to work when locked by prepending ^ to the action name (this is probably about to change though)

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30218 a1c6a512-1295-4272-9138-f99709370657
2011-07-28 11:26:01 +00:00
Jonathan Gordon
a7c37ea2d0 Pull yesno_pop out of the radio code as it is a nice simple resuasble yesno api worth reusing
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30183 a1c6a512-1295-4272-9138-f99709370657
2011-07-21 06:40:01 +00:00