Commit graph

179 commits

Author SHA1 Message Date
Rafaël Carré
961b5dd4c1 tagcache open_files(): open the correct file (missed in r27656)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28114 a1c6a512-1295-4272-9138-f99709370657
2010-09-19 08:17:15 +00:00
Thomas Martitz
6eaab4d004 Ged rid of uisimulator/common/io.c for android builds.
Use host's functions for file i/o directly (open(), close() ,etc.), not the sim_* variants.
Some dir functions need to be wrapped still because we need to cache the parents dir's path (host's dirent doesn't let us know).
For the same reason (incompatibility) with host's dirent) detach some members from Rockbox' dirent struct and put it into an extra one,
the values can be retrieved via the new dir_get_info().

Get rid of the sim_ prefix for sleep as well and change the signature to unix sleep().

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27968 a1c6a512-1295-4272-9138-f99709370657
2010-09-01 21:29:34 +00:00
Thomas Martitz
90b48cd721 Fix last red.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27658 a1c6a512-1295-4272-9138-f99709370657
2010-08-01 16:26:35 +00:00
Thomas Martitz
9c0b2479f7 Rockbox as an application: add get_user_file_path().
For RaaA it evaluates user paths at runtime. For everything but codecs/plugins it will give the path under $HOME/.config/rockbox.org if write access is needed or if the file/folder in question exists there (otherwise it gives /usr/local/share/rockbox).
This allows for installing themes under $HOME as well as having config.cfg and other important files there while installing the application (and default themes) under /usr/local.

On the DAPs it's a no-op, returing /.rockbox directly.

Not converted to use get_user_file_path() are plugins themselves, because RaaA doesn't build plugins yet.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27656 a1c6a512-1295-4272-9138-f99709370657
2010-08-01 16:15:27 +00:00
Miika Pekkarinen
17d2edf1d2 Properly initialize tagcache headers when doing commit() during
boot-up. Should fix "Recently added" entries remaining empty when
dircache is not used nor database is loaded to ram. Also, don't load
load hibernated statefile on H1xx targets when database loading to ram has
been disabled explicitly.



git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27484 a1c6a512-1295-4272-9138-f99709370657
2010-07-18 18:17:47 +00:00
Thomas Martitz
35e8b1429a Rockbox as an application: Replace many occurences of #ifdef SIMULATOR with #if (CONFIG_PLATFORM & PLATFORM_HOSTED) (or equivalently).
The simulator defines PLATFORM_HOSTED, as RaaA will do (RaaA will not define SIMULATOR).
The new define is to (de-)select code to compile on hosted platforms generally.

Should be no functional change to targets or the simulator.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27019 a1c6a512-1295-4272-9138-f99709370657
2010-06-21 16:53:00 +00:00
Amaury Pouly
e24dd5ff98 tagcache: fix queue operation, it should be queue_peek.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26233 a1c6a512-1295-4272-9138-f99709370657
2010-05-21 15:12:07 +00:00
Jonathan Gordon
0e263d5b77 accept FS#10992 by Rui Araújo to fix FS#10976 - make the <Untagged> string translatable
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26192 a1c6a512-1295-4272-9138-f99709370657
2010-05-20 13:24:50 +00:00
Thomas Martitz
50a6ca39ad Move c/h files implementing/defining standard library stuff into a new libc directory, also standard'ify some parts of the code base (almost entirely #include fixes).
This is to a) to cleanup firmware/common and firmware/include a bit, but also b) for Rockbox as an application which should use the host system's c library and headers, separating makes it easy to exclude our files from the build.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25850 a1c6a512-1295-4272-9138-f99709370657
2010-05-06 21:04:40 +00:00
Thomas Martitz
0a1d7c28b7 Make open() posix compliant api-wise. A few calls (those with O_CREAT) need the additional optional mode parameter so add it. Impact for the core is almost zero, as open() is a wrapper macro for the real open function which doesn't take the variable parameter.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25844 a1c6a512-1295-4272-9138-f99709370657
2010-05-06 17:35:13 +00:00
Jonathan Gordon
49f2709a01 If dircache and database "load to ram" is enabled then get the id3 info from the database in the WPS playlist viewer for non buffered tracks
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25841 a1c6a512-1295-4272-9138-f99709370657
2010-05-06 09:22:55 +00:00
Jens Arnold
41ef1d512c Make helper functions static.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25231 a1c6a512-1295-4272-9138-f99709370657
2010-03-17 08:23:50 +00:00
Amaury Pouly
1bff4b32d1 tagcache: Factor ecread of tagfile_entry/index_entry, and ecwrite of index_entry. This should save some binsize and avoid this stupidly repetitive sequence.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25217 a1c6a512-1295-4272-9138-f99709370657
2010-03-16 12:15:56 +00:00
Amaury Pouly
7430bb02a1 tagcache: fix once for all those stupid warnings.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25216 a1c6a512-1295-4272-9138-f99709370657
2010-03-16 12:15:44 +00:00
Amaury Pouly
f82c021b8b Fix several misused of 'struct dirent' instead of 'struct dircache_entry' in tagcache.c.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24707 a1c6a512-1295-4272-9138-f99709370657
2010-02-16 22:30:55 +00:00
Amaury Pouly
bb13650d66 Have tagcache_fill_tags also fill the length entry of the mp3entry structure.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24647 a1c6a512-1295-4272-9138-f99709370657
2010-02-14 12:45:59 +00:00
Andree Buschmann
4d5e88245a Remove more tabs
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24550 a1c6a512-1295-4272-9138-f99709370657
2010-02-07 18:38:47 +00:00
Amaury Pouly
75fc9ee84b FS#8967: Fix autoscore computation overflow when the playtime is huge.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24471 a1c6a512-1295-4272-9138-f99709370657
2010-02-02 20:49:35 +00:00
Jeffrey Goode
9d842683eb Comment out LOGF_ENABLE defines everywhere, replace evil comments
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23497 a1c6a512-1295-4272-9138-f99709370657
2009-11-03 16:25:03 +00:00
Thomas Martitz
774bacc692 Correct wrong usage of event callbacks all over the place. It's not supposed to return anything, and should take a data parameter.
Fixing it because correcting the event api prototypes causes many warnings.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23301 a1c6a512-1295-4272-9138-f99709370657
2009-10-20 21:54:44 +00:00
Bertrik Sikken
d24d885aa4 Use wrap-safe TIME_BEFORE/TIME_AFTER macros to compare times with current_time, instead of comparing them directly.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23246 a1c6a512-1295-4272-9138-f99709370657
2009-10-18 15:50:30 +00:00
Nils Wallménius
3d4701a6e4 FS#10080
* Move strncpy() from core to the pluginlib
* Introduce strlcpy() and use that instead in most places (use memcpy in a few) in core and some plugins
* Drop strncpy() from the codec api as no codec used it
* Bump codec and plugin api versions


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21863 a1c6a512-1295-4272-9138-f99709370657
2009-07-14 13:57:45 +00:00
Thomas Martitz
ff8f681f03 Do not delete tagcache entries on bootup with dircache enabled but auto-update disabled.
This fixes for example disappearing database if you happen to boot without µSD.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21644 a1c6a512-1295-4272-9138-f99709370657
2009-07-04 23:20:51 +00:00
Jonas Häggqvist
54929e8871 Crude logging for the sim in database creation/updating - to aid in debugging
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21638 a1c6a512-1295-4272-9138-f99709370657
2009-07-04 19:28:47 +00:00
Magnus Holmgren
a538b89060 Second attempt at fixing FS#10396. Turns out that gcc for coldfire choose to inline a function with a big appetite for stack. The previous fix improved things a bit, but not nearly enough.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21580 a1c6a512-1295-4272-9138-f99709370657
2009-06-30 21:32:38 +00:00
Magnus Holmgren
8c22a60290 Small change to significantly reduce stack usage during database scanning. This should fix FS#10396.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21576 a1c6a512-1295-4272-9138-f99709370657
2009-06-30 17:39:03 +00:00
Miika Pekkarinen
8e2bdcaab6 A bunch of stability fixes into tagcache engine and database browser. Mainly data retrieval problems, races, data corruption of sorted index files at the end with junk data, access to unitialized memory and so on. Should fix FS#8710 and may fix FS#8414.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21402 a1c6a512-1295-4272-9138-f99709370657
2009-06-20 16:17:54 +00:00
Miika Pekkarinen
5c2413165c Fixed searches from tagcache when there is a sudden need to open a tag file on the fly. Thanks to Andrew Mahoney for pointing out the issue.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21351 a1c6a512-1295-4272-9138-f99709370657
2009-06-19 14:30:59 +00:00
Andrew Mahone
de7c5711c5 Add a system-wide BIT_N macro, implemented via an LUT on SH, and use it in the TAGCACHE_IS_* macros in place of per-set LUTs, removing duplication of data between those LUTs and the mask values used on other targets.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21195 a1c6a512-1295-4272-9138-f99709370657
2009-06-06 00:00:58 +00:00
Andrew Mahone
52a8e38806 Replace bitfield for tagcache tag sets with array of char on SH.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21176 a1c6a512-1295-4272-9138-f99709370657
2009-06-03 09:38:06 +00:00
Andrew Mahone
1248a0dc1f Replace arrays of tags that are numeric/sorted/uniqued with bitfields flagging each tag that is a member of the set, and replace the membership tests with a shift and bitwise and. The test is still done inside a function on SH, as this saves some space vs the macro used on other targets.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21175 a1c6a512-1295-4272-9138-f99709370657
2009-06-03 08:19:32 +00:00
Bertrik Sikken
0023943439 Fix duplicate #includes
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20977 a1c6a512-1295-4272-9138-f99709370657
2009-05-17 14:50:19 +00:00
Miika Pekkarinen
a161450822 Handle the DB dirty flag correctly. Now a broken DB should stay disabled. Also don't remove broken files automatically. Should improve (or even fix) the duplicate entry issue seen in FS#8414 when the problem is caused by the player shutting down in the middle of a DB commit.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20710 a1c6a512-1295-4272-9138-f99709370657
2009-04-15 06:46:25 +00:00
Bertrik Sikken
30a2713b6e Clean up some more #includes
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20243 a1c6a512-1295-4272-9138-f99709370657
2009-03-08 18:37:32 +00:00
Thomas Martitz
2b6e4adbd2 Fix FS#9977 - Thanks to Brian Sutherland for intensive testing and effort
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20214 a1c6a512-1295-4272-9138-f99709370657
2009-03-06 15:21:58 +00:00
Björn Stenberg
ee46a3d88e Moved database builder into a separate directory, and gave it its' own Makefile. Now it compiles cleanly and builds a database if ran in root of music tree.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19448 a1c6a512-1295-4272-9138-f99709370657
2008-12-15 23:42:19 +00:00
Frank Gevaerts
2f8a0081c6 Apply FS#9500. This adds a storage_*() abstraction to replace ata_*(). To do that, it also introduces sd_*, nand_*, and mmc_*.
This should be a good first step to allow multi-driver targets, like the Elio (ATA/SD), or the D2 (NAND/SD).


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18960 a1c6a512-1295-4272-9138-f99709370657
2008-11-01 16:14:28 +00:00
Björn Stenberg
51b45d5602 Split id3.c/h into metadata.c/h and metadata/mp3.c. Updated all references. Moved mp3data.c/h from firmware to apps.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18814 a1c6a512-1295-4272-9138-f99709370657
2008-10-15 06:38:51 +00:00
Miika Pekkarinen
d8bb6701e7 Fixed a possible index id destruction and temporary problems with the DB when DB has been loaded to ram, dircache enabled and statistics gathering ON. Fixed serial (affecting last played song order) being one too low after importing the changelog. A bit of code cleanup and comments also.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18363 a1c6a512-1295-4272-9138-f99709370657
2008-08-29 21:14:58 +00:00
Daniel Stenberg
2acc0ac542 Updated our source code header to explicitly mention that we are GPL v2 or
later. We still need to hunt down snippets used that are not. 1324 modified
files...
http://www.rockbox.org/mail/archive/rockbox-dev-archive-2008-06/0060.shtml


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17847 a1c6a512-1295-4272-9138-f99709370657
2008-06-28 18:10:04 +00:00
Miika Pekkarinen
dd7103ae2e Make sure a temporary file does not exists preventing the database re-initialization.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17689 a1c6a512-1295-4272-9138-f99709370657
2008-06-04 19:27:11 +00:00
Bertrik Sikken
f8a641d6f8 Renamed build_tagcache to tagcache_build to make it consistent with the function naming of the other functions in tagcache.c
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17331 a1c6a512-1295-4272-9138-f99709370657
2008-05-03 16:23:37 +00:00
Bertrik Sikken
e15f8a21a9 Made source files #include the header file that they implement to make sure they are in sync. Made some local functions static.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17312 a1c6a512-1295-4272-9138-f99709370657
2008-05-03 08:35:14 +00:00
Bertrik Sikken
2843469876 Moved atoi declaration to stdlib.h. Deleted atoi.h
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17280 a1c6a512-1295-4272-9138-f99709370657
2008-04-28 16:18:04 +00:00
Jonathan Gordon
5f3356b942 fix 64bit sim warning
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17235 a1c6a512-1295-4272-9138-f99709370657
2008-04-24 08:51:54 +00:00
Jonathan Gordon
7c0a8e1d4c structec makes a poor assumption that all targets use 1 byte chars, 2 byte shorts and 4 byte longs which is wrong on 64bit sims which causes database to not be commited.
The proper fix should be to remove those assumtopns but probably not nescacery untill a target comes along which breaks the assumption.
This _shouldnt_ change anything on target.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17234 a1c6a512-1295-4272-9138-f99709370657
2008-04-24 07:54:32 +00:00
Miika Pekkarinen
984278b10a FS#8795 - Fixed fault of the escape processing in Changelog (by Kenjiro Arai).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17178 a1c6a512-1295-4272-9138-f99709370657
2008-04-19 23:48:13 +00:00
Bertrik Sikken
b3c44deaf6 Made strictly local functions static (command_queue_sync_callback and run_command_queue) in tagcache.c
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17176 a1c6a512-1295-4272-9138-f99709370657
2008-04-19 23:22:40 +00:00
Miika Pekkarinen
6ab1c90513 FS#8707 - Enable "Load to RAM" (HAS_TC_RAMCACHE) compilation without Directory Cache (HAS_DIRCACHE).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16594 a1c6a512-1295-4272-9138-f99709370657
2008-03-09 20:33:19 +00:00
Miika Pekkarinen
9eec03faa5 FS#8565 - fix for runtime data causing extra spin ups. Included a debug menu update also.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16330 a1c6a512-1295-4272-9138-f99709370657
2008-02-17 18:35:27 +00:00