Commit graph

207 commits

Author SHA1 Message Date
Nils Wallménius
2202ed3535 TDSpeed: Fix crackling on some systems
Use memmove instead of memcpy for overlapping copy, fixes
crackling in sims and warble on my system. Native targets
seem to have been unaffected.

Change-Id: I265d4ce373e224581bd2f5ba15c75b473ec231f2
2012-05-12 08:47:10 +02:00
Michael Sevakis
fbe9ccc85c TDSpeed settings to setup call need to be recorded, always.
If the settings, like samplerate, were to go out of range where
timestretch drops out of processing and then go back to the same as
when they were valid, it would fail to switch back on by itelf.

Change-Id: Ic5bcb268540b0db8e0483117b8a5a0ce5c5a9db0
2012-05-11 06:56:16 -04:00
Michael Sevakis
dd59e1d789 TDSpeed: Minor assembly optimization to frame fade on Coldfire.
Makes quite a huge difference to get rid of 64-bit math in a hot
area. Cuts about 12 MHz. Generic routine generates good code on
ARM and asm cuts no instructions there.

Change-Id: I4ac647406006c42004f9f5ab396cbf4e85688854
2012-05-11 03:31:29 -04:00
Michael Sevakis
0e5dd0a9cf TDSpeed: Fix up samples consumed return (FS#12666) + other stuff like...
Wrap up the the stereo case into loops and remove unused calculations
hanging out in tdspeed_update().

A wee little bit of code style and column policing.

Change-Id: I8dd3ab4b3e7e56b55dc00c00f3e32996228cc457
2012-05-10 21:41:26 -04: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
Michael Sevakis
d26a35d10b Tweak dsp_format_change_process (default format handler).
Just stop searching if the entry is found (as it should have been).

Change-Id: Id968694e825282d58c8ca4a7789c236f98643a5f
2012-05-08 22:47:51 -04:00
Michael Sevakis
87a9951cf8 Consolidate some sample input code.
Input functions have common setup sequences that can be placed
into an inline function instead of repeating it all repeatedly.

Change-Id: I9e62904ff0948651c64ddf160ed4400ed6dc81ff
2012-05-08 21:27:43 -04:00
Nils Wallménius
2dda258f99 Remove STATICIRAM hack
It was only needed by the old arm toolchain that we no longer use or support.

Change-Id: Id0e6c67477f8834a637079b03cde5fbf9da68b1c
Reviewed-on: http://gerrit.rockbox.org/233
Reviewed-by: Nils Wallménius <nils@rockbox.org>
2012-05-08 22:46:12 +02:00
Nils Wallménius
3f61caa0cd rbcodec: abstract tdspeed buffer allocation
Move code dealing with rockbox specific buflib allocations into a
rockbox specific file and implement buffer allocation with
malloc/free for warble/stand alone lib.
Based on patch by Sean Bartell.

Change-Id: I8cb85dad5890fbd34c1bb26abbb89c0b0f6b55cf
Reviewed-on: http://gerrit.rockbox.org/144
Tested-by: Nils Wallménius <nils@rockbox.org>
Reviewed-by: Michael Sevakis <jethead71@rockbox.org>
Reviewed-by: Nils Wallménius <nils@rockbox.org>
2012-05-07 10:29:07 +02:00
Rafaël Carré
dfeab527e0 remove extraneous parens 2012-05-06 23:41:37 -04:00
Rafaël Carré
5aadf87e98 asap codec: remove invalid memset
This would zero the first 4 or 8 bytes of the array because it is declared as a pointer

rockbox/lib/rbcodec/codecs/libasap/asap.c:1229:44: warning: argument to 'sizeof' in 'memset' call is the same expression as the destination; did you mean to provide an explicit length? [-Wsizeof-pointer-memaccess]
    memset(ast -> memory, 0, sizeof(ast -> memory));
           ~~~~~~~~~~~~~            ~~~~~~~^~~~~~
2012-05-06 23:38:15 -04:00
Rafaël Carré
06c8ab852b Don't use function in a function
It is not supported by clang
2012-05-06 23:34:56 -04:00
Michael Sevakis
6fd4780ac4 Correct comments in lin_resample re: what is actually used by asm.
Change-Id: Idd457f3c645c5d469ebc6fab0bfc85e7b8dd56da
2012-05-06 18:20:11 -04:00
Michael Sevakis
88aeef9127 Remove pointless IRAM allocation from voice DSP.
It's always used in MONO mode and doesn't need the IRAM sample/
resample buffers and 1280 bytes can be freed.

M5 can now have its PCM mixer downmix buffer in IRAM.

Change-Id: I0af08be5b212b7dfe382bba588a6585eb328a038
2012-05-04 22:00:44 -04:00
Michael Sevakis
dbe5e5f2df rbcodec: Hooks for target specific functions in dsp_process loop
Use them to move tick counting, yielding and coldfire macsr handling
code to a rockbox specific file.

Change-Id: Id7417dc98c08a342eba45ba56b044a276e50564b
Reviewed-on: http://gerrit.rockbox.org/229
Tested-by: Nils Wallménius <nils@rockbox.org>
Reviewed-by: Nils Wallménius <nils@rockbox.org>
2012-05-03 23:47:46 +02:00
Sean Bartell
cadb3627fc Add rbcodecplatform.h and rbcodecconfig.h.
librbcodec users must provide these two files when the library is built.
rbcodecconfig.h provides configuration #defines and basic types, and
will be included by public librbcodec headers, so it must not conflict
with the user's code. rbcodecplatform.h provides various OS functions,
and will only be included by source files and private headers. This
system is intended to provide maximum flexibility for use on embedded
systems, where no operating system headers are included. Unix systems
can just copy rbcodecconfig-example.h and rbcodecplatform-unix.h with
minimal changes.

Change-Id: I350a2274d173da391fd1ca00c4202e9760d91def
Reviewed-on: http://gerrit.rockbox.org/143
Reviewed-by: Nils Wallménius <nils@rockbox.org>
Tested-by: Nils Wallménius <nils@rockbox.org>
2012-05-03 14:49:35 +02:00
Nils Wallménius
26e5e605d2 Delete unused stub functions.
Change-Id: I886d65b60364699845475e2ea1a741aece506a8f
2012-05-02 10:42:21 +02:00
Nils Wallménius
45c5b1fe17 Delete autoconf.h file in the warble source, one less headache.
Change-Id: I83c1b523de453c45aa4df3340b9a1aa63bf321ed
2012-05-01 19:10:00 +02:00
Sean Bartell
4bef502d4d rbcodec refactoring: autoresumable
Moved to playback.c, since it doesn't use metadata from the music file.

Change-Id: I5c3ad7750d94b36754f64eb302f96ec163785cb9
Reviewed-on: http://gerrit.rockbox.org/142
Reviewed-by: Nils Wallménius <nils@rockbox.org>
2012-05-01 11:28:38 +02:00
Michael Giacomelli
0dd200b33a Fix audio corruption when sequentially playing low bitrate WMA files
for real this time.  Also, use English grammar.

Change-Id: I1f2156afa313280deb02b58a191511699671a761
2012-05-01 02:01:06 -04:00
Michael Sevakis
b4eec0dd42 Make INITDATA_ATTR work on everything that has INIT_ATTR enabled for code.
Change-Id: If9936bfbbd3bc3eb2a3e3e290701b8517eabfb13
2012-05-01 01:28:50 -04:00
Michael Giacomelli
87d3dde15a Fix corrupt when repeatidly playing very low bitrate WMA files.
The LSP feature in WMA requires that the noise table values be
doubled verses when it is not used.  Unfortunately, the previous
code would double the same values every time a LSP file was
decoded without first resetting them to their original values.
Change the code to check if the values are already doubled, and
then double/halve them as needed.  This is still a bit ugly,
in the future consider using the built in rockbox dither instead
of a lookup table.

Fixes playback when skipping back and forth between low and high
bitrate WMA.

Change-Id: I4c393092e4a789bc8f98d74274fe207400b9550e
Reviewed-on: http://gerrit.rockbox.org/226
Reviewed-by: Michael Giacomelli <giac2000@hotmail.com>
Tested-by: Michael Giacomelli <giac2000@hotmail.com>
2012-05-01 05:42:38 +02:00
Michael Sevakis
f5d9a45e3f Should've had dsp_replaygain_set_gains as static for now...
...because currently gains are only set through dsp_configure.

Change-Id: I2866473a82fdd5f41de4705b45928daa7e43f8eb
2012-04-30 17:51:05 -04:00
Michael Sevakis
8f9e3b10a5 Still need settings.h in dsp_misc.c for now for software volume.
Change-Id: I824e8f9935013f6e2a1db6ccd2db4bd406257057
2012-04-30 17:18:26 -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
5f37840e31 Warble must have a call to dsp_init before setting options or using it.
Change-Id: If5cabba99baffe87002d07f11641175f539315a1
2012-04-30 01:55:32 -04:00
Michael Sevakis
ae5656a142 Put the <string.h> channel_mode.c for memcpy.
Hmmm, how'd I miss that?

Change-Id: I30d9a1b5f053aad069687aa0a01ebdf40a6b2d76
2012-04-29 17:44:57 -04:00
Michael Sevakis
56f17c4164 Make rbcodec/dsp includes more specific.
Change-Id: Idb6af40df26f5b8499a40e8b98602261ef227044
2012-04-29 17:31:30 -04:00
Michael Sevakis
23b5f3e5e1 Make compressor_update static.
Change-Id: Ic29242b4c397e82c2bee3808492a2d0a9ffebbe6
2012-04-29 14:47:01 -04:00
Michael Sevakis
230f6f4326 Lower IRAM footprint on ARM.
Move a few functions to .text that probably don't see a huge benefit
from being .icode. Will scrutinize later.

Change-Id: I7bdffc326076c5cd7e6a1c57d25d31e653920327
2012-04-29 14:10:14 -04:00
Michael Sevakis
3b578f018c Fix 3g warning in dsp_arm.S (which showed as an error).
Change-Id: Iccbeca66e809413dda90fec36439b4a180b8a879
2012-04-29 04:57:57 -04:00
Michael Sevakis
d8f3e3d0d1 Get warble building again.
Change-Id: Ibdb2d9064d0e948cfb745c10a7b23de1a750d55b
2012-04-29 04:41:02 -04:00
Michael Sevakis
7cc8bbdaaf Fix no newline at end warning.
Change-Id: I9edb1ebb34f91893b6290d7640fcdaede3434b40
2012-04-29 04:14:11 -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
Sean Bartell
fe3d58004c rbcodec refactoring: get_audio_base_data_type
This function has been changed to rbcodec_format_is_atomic, which
doesn't require an enum from the kernel.

Change-Id: I1d537605087fe130a9b545509d7b8a340806dbf2
Reviewed-on: http://gerrit.rockbox.org/141
Reviewed-by: Nils Wallménius <nils@rockbox.org>
Tested-by: Nils Wallménius <nils@rockbox.org>
2012-04-28 09:07:40 +02:00
Michael Sevakis
0048e5b8ce Some whitespace correction in dsp_*.S
Change-Id: I6ee14c0adc9dd456c8a2d171952cbaedb3752428
2012-04-27 16:55:16 -04:00
Sean Bartell
a6dea9e13d rbcodec refactoring: dsp_set_eq_coefs
dsp_set_eq_coefs now has parameters for the band settings, so it doesn't
need to access global_settings.

Change-Id: I29ac19fc353b15a79cb25f0e45132aef0881e4c9
Reviewed-on: http://gerrit.rockbox.org/138
Reviewed-by: Nils Wallménius <nils@rockbox.org>
2012-04-27 16:33:27 +02:00
Michael Sevakis
0842d7f7e1 Consolidate compressor settings into a struct.
Doing that makes things cleaner for later on.

Change-Id: I4e279aa57ace16a348acc0fc09059592325ec95f
2012-04-26 17:19:16 -04:00
Michael Sevakis
e5c3327cef Add a more correct absolute difference function to dsp-util.
Differences between signed samples cover the entire unsigned 32-bit
range. "abs" will think any difference exceeding INT32_MAX is negative
which is not corrent. Test which argument is greater and subtract the
lesser from it, outputting unsigned difference.

Change-Id: I73a8e5e418d49ff73d1a7c98eeb4731946dcfe84
2012-04-26 16:04:43 -04:00
Sean Bartell
f40bfc9267 Add codecs to librbcodec.
Change-Id: Id7f4717d51ed02d67cb9f9cb3c0ada4a81843f97
Reviewed-on: http://gerrit.rockbox.org/137
Reviewed-by: Nils Wallménius <nils@rockbox.org>
Tested-by: Nils Wallménius <nils@rockbox.org>
2012-04-25 22:13:20 +02:00
Jonathan Gordon
2d3c43dffe skin_engine: rework the parser to be closer to the langauge grammar.
The parser was unconditionally scanning things which it thought
were conditional/enum lists (or tag arg lists) when they couldn't
possibly be (i.e < inside a param which should be valid).

This change fixes it (i.e %?and(%if(%pv, <, -50), %if(%mp, >i, 1))
is perfectly valid now.

This *may* break your exsiting skins if you were using %if with < or >

Change-Id: Ia24dbdf0b11fc7d8a735c1111d648c3bebd68ac6
2012-04-22 00:24:16 +10:00
Thomas Martitz
728db21502 Revert "skin_engine: rework the parser to be closer to the langauge grammar."
This reverts commit ec8b21eef8 which was pushed by accident.

Change-Id: I1aaedf6876d0448a100dc582b79f1293d021bac1
Reviewed-on: http://gerrit.rockbox.org/216
Reviewed-by: Thomas Martitz <kugel@rockbox.org>
2012-04-17 17:07:43 +02:00
Jonathan Gordon
e43b856ed0 skin_engine: rework the parser to be closer to the langauge grammar.
The parser was unconditionally scanning things which it thought
were conditional/enum lists (or tag arg lists) when they couldn't
possibly be (i.e < inside a param which should be valid).

This change fixes it (i.e %?and(%if(%pv, <, -50), %if(%mp, > 1))
is perfectly valid now.

This *may* break your exsiting skins if you were using %if with < or >

Change-Id: Ibcb42bc6bb78908f79de024b61276b91b1ce02a0
Reviewed-on: http://gerrit.rockbox.org/214
Reviewed-by: Thomas Martitz <kugel@rockbox.org>
2012-04-17 17:05:20 +02:00
Amaury Pouly
d4674ed3b7 arm: implement safe reads by intercepting the data abort handler.
Implement functions to read from a memory location and indicate
failure in case this is not possible. Since we do not have a MMU,
intercept the data abort handler and simply return when the abort
comes from the safe read routines.

Change-Id: I08f2e59898dcac893319a8150d4cf626f3adabbd
Reviewed-on: http://gerrit.rockbox.org/207
Reviewed-by: Marcin Bukat <marcin.bukat@gmail.com>
2012-04-06 13:48:09 +02:00
Amaury Pouly
a54072e299 arm: fix get_sp (missing return)
__get_sp is missing a return! I don't know how it ever worked.
Use "bx lr" since it works in all cases (armp and thumb).

Change-Id: I26011db333a8a5f96276be83e18da7507c501c38
Reviewed-on: http://gerrit.rockbox.org/206
Reviewed-by: Marcin Bukat <marcin.bukat@gmail.com>
2012-04-04 09:21:02 +02:00
Thomas Martitz
c56950ea3a tlsf: move to /lib (it's also used by plugins).
Change-Id: I5e37b28c1ce4608d60b036343f280af3311ad490
2012-03-28 23:02:39 +02:00
Thomas Martitz
83cb2e5dae Fix warble and clean up/refactor Makefile.
Change-Id: I8754ad8724e22147b98a156fecea599bdda72292
2012-03-27 00:16:09 +02:00
Thomas Martitz
f269aa0060 build system: unify/simplify library handling a bit.
libs in $ROOT/lib now add to $(CORE_LIBS) and $(EXTRA_LIBS) and are
automatically linked by the core and codecs/plugins respectively.

Change-Id: Iff482c792a8c8142718f6a16a450c6e2f1497c9a
2012-03-26 22:27:40 +02:00
Sean Bartell
b5716df4cb Build librbcodec with DSP and metadata.
All associated files are moved to /lib/rbcodec.

Change-Id: I572ddd2b8a996aae1e98c081d06b1ed356dce222
2012-03-18 12:00:39 +01: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
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
Frank Gevaerts
534117d1e0 Re-add -DDEBUG to the warble makefile
Change-Id: I515d2299b0de39092fbae3b070bd2d6d19a43ec5
2012-03-04 16:35:43 +01:00
Frank Gevaerts
0cc6ba018e Remove standalone makefile. Use configure to build
Change-Id: Ifa4fac02100da17b16199ac63cad1f6fe569667f
2012-03-03 20:45:49 +01:00
Frank Gevaerts
8d41b23ce2 Move includes of other makefiles around to make GCCFLAGS work properly.
Change-Id: Ic6aed06298dcb668a2c0f2c09d25612437893d1b
2012-03-03 20:35:48 +01:00
Frank Gevaerts
466a7c6a40 Integrate the warble tool in the regular build system.
Only sdl app builds work properly for now.

Change-Id: I7807d42f69b8577b401e48cdc63de71e54f49217
2012-03-03 20:19:08 +01:00
Sean Bartell
26fc31ae93 Add the warble test program.
Warble uses Rockbox's codecs to play files with SDL or convert them to
WAV or raw formats. It also prints metadata and supports some of the DSP
effects. In the future, warble could be used to implement an automated
test suite for codecs, metadata, and DSP.

Change-Id: Ife1a63d2354496016277bfcbae4a9c23423ebd86
Reviewed-on: http://gerrit.rockbox.org/135
Reviewed-by: Nils Wallménius <nils@rockbox.org>
Tested-by: Nils Wallménius <nils@rockbox.org>
2012-03-03 16:41:49 +01:00
Thomas Jarosch
9476883d2d Fix sanity check in UnwStartThumb() using the wrong register
cppcheck reported:
[lib/unwarminder/unwarm_thumb.c:399] -> [lib/unwarminder/unwarm_thumb.c:399]: (style) Same expression on both sides of '&&'.

Patch will also be sent to the upstream project.

Change-Id: I57033f290135f4dc09ac7e9b07c31461bc5b471a
Reviewed-on: http://gerrit.rockbox.org/157
Reviewed-by: Thomas Jarosch <tomj@simonv.com>
2012-03-02 18:29:09 +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
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
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
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
Marcin Bukat
b4eab59951 Arm stack unwinder
Simplified stack unwinder for ARM. This is port of
http://www.mcternan.me.uk/ArmStackUnwinding/
backtrace() is called from UIE() on native targets
and from panicf() on both native and ARM RaaA.

Change-Id: I8e4b3c02490dd60b30aa372fe842d193b8929ce0
2012-02-22 08:33:26 +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
Jonathan Gordon
9acd70288d Fix FS#12585 - bar tags stopped working
Change-Id: I9e466bcc407a3fda06d8a9f9c6f39afef592824e
2012-02-14 19:53:29 +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
Jonathan Gordon
f417312a71 skin parser: Allow the first character after conditional seperators to be \n
This hopefully makes difficult conditionals more easy to read: i.e
OLD: %?bp<%?bc<%xd(Ba)|%xd(Bb)>|%?bl<|%xd(Bc)|%xd(Bd)|%xd(Be)|%xd(Bf)|%xd(Bg)|%xd(Bh)|%xd(Bi)|%xd(Bj)>>
NEW:
%?bp<
	%?bc<
		%xd(Ba)|%xd(Bb)
	>|
	%?bl<|%xd(Bc)|%xd(Bd)|
		%xd(Be)|%xd(Bf)|
		%xd(Bg)|%xd(Bh)|
		%xd(Bi)|%xd(Bj)
	>
>

Change-Id: Ic89d2c95562b27e7427c3a5d528340f9aec55cf2
2012-02-01 22:05:06 +11:00
Jonathan Gordon
5f387c28ce skin parser: skip \t characters at the begining of lines to allow for more readable skins
Change-Id: I8f3154d17807ad202fc65d462e85da2195ce605c
2012-02-01 21:27:18 +11:00
Thomas Martitz
3520d7f855 Fix native arm builds. arm_support couldn't build properly.
Change-Id: I34526a015357e36ffd612bf2fabf78a0354066ca
2012-01-22 19:24:48 +01:00
Thomas Martitz
cf333a61c7 Move supprt-arm.S to separate library.
Core, codecs and plugins link it separately so this gets rid of SOURCES trickery.
Don't build it for hosted targets.

Change-Id: If15ef90e93cd218a4352ae8e89eea95d3122452f
2012-01-21 18:39:19 +01: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
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
Nils Wallménius
e52600eb67 de-tabify
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30734 a1c6a512-1295-4272-9138-f99709370657
2011-10-08 13:54:55 +00:00
Jonathan Gordon
7e44438936 Add a simple perl script to display info about what is allocating skin buffer.
To use it enable DEBUG_SKIN_ALLOCATIONS in skin_buffer.h and pipe the rockboxui output to the script

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30597 a1c6a512-1295-4272-9138-f99709370657
2011-09-25 12:05:03 +00:00
Jonathan Gordon
d7372533d0 Partial fix for FS#12289 - comment lines would waste lots of buffer space. Still not perfect but should get 90+% of comments completly ignored now.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30596 a1c6a512-1295-4272-9138-f99709370657
2011-09-25 07:43:36 +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
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
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
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
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
Andree Buschmann
f7c4594134 Fix further 'variable set but not used' warnings reported from GCC 4.6.0.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29809 a1c6a512-1295-4272-9138-f99709370657
2011-05-01 13:48:28 +00:00
Bertrik Sikken
837b8ccce0 Remove duplicate #include in skin_parser.c
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29736 a1c6a512-1295-4272-9138-f99709370657
2011-04-17 06:58:28 +00:00
Jonathan Gordon
87aa86cedd Skin variables for touchscreen targets (origional implementation by Jens Theeß)
%vs(name, [set|inc|dec], value [,max]) - name is the id, set sets the value, inc increments by value, dec decrements by value
%vg(name) - get the current value
%vl(name [,timeout]) - 'has it changed in [timeout]'?

values start at 1 and are all reset to 1 on skin load

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29655 a1c6a512-1295-4272-9138-f99709370657
2011-03-27 08:01:58 +00:00
Dominik Riebeling
8c6b8e6cd5 Theme Editor: make cross compiling on OS X work.
The attempt to detect if building a fat library is necessary for libskin_parser
makes cross compiling fail on OS X. Allow overriding the target platform for
libskin_parser to fix that.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29515 a1c6a512-1295-4272-9138-f99709370657
2011-03-05 12:50:46 +00:00
Jonathan Gordon
485ff79584 Add an ability to set a setting to a specific value with a touchscreen action.
example: %T(0,0,20,12, setting_set, repeat, off)
That will set the repeat mode to "off" when it is pressed.
"setting_set" is the action name
"repeat" is the name of the setting in the config files
"off" is the value to set it to (same values as the legal values in the config files)

Not all settings are supported, outright unsupported settings will fail to parse. Some settings might not work too well if they don't apply instantly (Any that work well int he quickscreen should work well here)

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29483 a1c6a512-1295-4272-9138-f99709370657
2011-03-01 12:31:03 +00:00
Jonathan Gordon
fb3616368f Remove code duplication in some generic skin touch action handling.
fix a bug which stopped the setting_inc/dec touch actions from parsing


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29477 a1c6a512-1295-4272-9138-f99709370657
2011-03-01 07:26:11 +00:00
Jonathan Gordon
156b0bc614 Add the option of linking the %Tl (last touch) tag to a specific touchregion. Both tags now accept an optional label param as the first param.
%Tl([label,][timeout])
%T([label,] x, y, width, height, action)


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29459 a1c6a512-1295-4272-9138-f99709370657
2011-02-28 11:19:59 +00:00
Jonathan Gordon
cb56c46c5a fix build
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29145 a1c6a512-1295-4272-9138-f99709370657
2011-01-27 11:33:33 +00:00
Jonathan Gordon
21e89e8786 Add some better debug info for when checkwps erros out because of full skin buffer
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29144 a1c6a512-1295-4272-9138-f99709370657
2011-01-27 11:27:53 +00:00
Jonathan Gordon
261c56ba59 FS#11867 - Add 2 new tags to allow skins to display themed peakmeters
%pL for the left channel, %pR for the right channel... usable as a value, conditional or bar (exactly the same as %pv/%bl/etc)


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29043 a1c6a512-1295-4272-9138-f99709370657
2011-01-13 06:48:39 +00:00
Jonathan Gordon
78a11cf648 Fix FS#11829 - %?xx<....> Crashes on targets where the %xx feature tag isnt avilable. rather hacky fix though better than crashing.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28890 a1c6a512-1295-4272-9138-f99709370657
2010-12-24 07:58:26 +00:00
Jonathan Gordon
1ce7ba4931 Make the %tr (radio RSSI) tag work as a bar tag or as a conditional.
As a conditional it scales its value to the number of options you give it (like volume)

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28613 a1c6a512-1295-4272-9138-f99709370657
2010-11-18 11:47:42 +00:00
Bertrik Sikken
de870b3ee0 Signal strength meter for FM radio - FS#8151 by Przemysław Hołubowski
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28559 a1c6a512-1295-4272-9138-f99709370657
2010-11-11 21:13:29 +00:00
Jonathan Gordon
4d8430ffe3 clean up checkwps' verbose output a bit
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28556 a1c6a512-1295-4272-9138-f99709370657
2010-11-11 12:05:34 +00:00
Jonathan Gordon
f74a1aab64 Add a bit more debug output to checkwps
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28552 a1c6a512-1295-4272-9138-f99709370657
2010-11-11 09:57:37 +00:00
Jonathan Gordon
c98e525f29 Half the number of malloc() calls on APPLICATION builds in skin_buffer_alloc(). these are still presumably wasteing alot of RAM and could be merged further
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28520 a1c6a512-1295-4272-9138-f99709370657
2010-11-06 14:18:33 +00:00
Alexander Levin
de56a2284a More concrete names for the head and the tail of the linked list (no functional changes)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28501 a1c6a512-1295-4272-9138-f99709370657
2010-11-05 22:10:42 +00:00
Thomas Martitz
5411e14c57 Undo the part of r28480 that caused the simulator to also use host malloc.
We want simulators to simulate target code where possible, that includes memory constraints and memory allocation schemes. It also removed the sim's ability to show the theme's ram usage.
Use malloc only in application builds.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28498 a1c6a512-1295-4272-9138-f99709370657
2010-11-05 19:12:23 +00:00