Commit graph

80 commits

Author SHA1 Message Date
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
efe73e143a Fix database tool.
It was also broken functionally, probably since a while.So restore the
functionality. Run it on the dap, the tcd files will be placed into .rockbox folder.

Change-Id: Id7a6ce4389dfaf99799258902be80d630af0601c
2012-07-31 10:33:27 +02:00
Thomas Martitz
63d27626e4 Database: Support for multiple search roots.
Support multiple roots (i.e. scan folders) using the new folder_select()
function.

Amaximum of 12 dirs can be selected, however the setting (i.e. the entire
folder list) cannot be longer than 80 chars.

The setting works similar to the autoresume dirs: Directories are seperated
by colons, e.g. "/Music:/Podcasts". Default is "/sdcard" on android, "/" on
all other targets.

Changes are made to the multiple-root logic in tagcache.c. This is to
a) provide the logic at all on native targets and b) support more than
one root before the scan even starts (until now it was used to add roots
during scan due to symlinks).

Change-Id: I64992c0678324536e8e64cd4427c8abbd8e8b39e
2012-07-30 21:20:51 +02: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
Thomas Martitz
baa070cca6 GSoC/Buflib: Enable compaction in buflib.
This enables the ability to allocate (and free) memory dynamically
without fragmentation, through compaction. This means allocations can move
and fragmentation be reduced. Most changes are preparing Rockbox for this,
which many times means adding a move callback which can temporarily disable
movement when the corresponding code is in a critical section.

For now, the audio buffer allocation has a central role, because it's the one
having allocated most. This buffer is able to shrink itself, for which it
needs to stop playback for a very short moment. For this,
audio_buffer_available() returns the size of the audio buffer which can
possibly be used by other allocations because the audio buffer can shrink.

lastfm scrobbling and timestretch can now be toggled at runtime without
requiring a reboot.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30381 a1c6a512-1295-4272-9138-f99709370657
2011-08-30 14:01:45 +00:00
Michael Hohmuth
eab7e74778 FS#12132 patch 6, part 2: tagnavi.config: Add support for "basename"
in formats and conditions.  The basename is the non-directory part of
a file's pathname.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30230 a1c6a512-1295-4272-9138-f99709370657
2011-07-31 16:26:35 +00:00
Miika Pekkarinen
337e922685 Allocate indices directly in ramcache header. Add version code to
tagcache state dump header. Debug: hdr-structure corruption might
happen after rebuilding of dircache.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30109 a1c6a512-1295-4272-9138-f99709370657
2011-07-01 13:48:28 +00:00
Michael Hohmuth
b3a7f39c66 FS#12132 patch 4: Added a comment for the tagcache_search.type field.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29980 a1c6a512-1295-4272-9138-f99709370657
2011-06-06 22:49:02 +00:00
Michael Hohmuth
6a24a7a903 tagnavi.config: Add a logical-OR operator ("|") for tagnavi conditionals.
Logical-AND ("&") always takes precedence over logical-OR.
(Parentheses are not supported.)

Fight binsize increase by storing some common expressions in local
variables. This avoids repeated reevaluations involving memory
accesses.

check_clauses: Fail clause (return false) in case of errors (tag too
long, DB entry deleted).

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29851 a1c6a512-1295-4272-9138-f99709370657
2011-05-10 10:25:41 +00:00
Michael Hohmuth
1a23e0ca19 Fix database import and export
Correct an omission that happened when the DB schema was changed last
time.  Add a comment to enum tag_type to prevent this from happening
in the future.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29435 a1c6a512-1295-4272-9138-f99709370657
2011-02-27 20:25:11 +00:00
Dominik Riebeling
d2cc5ce58e Fix player becoming unresponsive on Stop / Pause in some cases.
Fix for FS#11856: In tagtree_buffer_event, do not wait for database to
come online as that may never happen.  Rather, wait until it either
has come online or has decided that this will never happen.  Added a
new function to tagcache.c to export this information.

Flyspray: FS#11865
Author: Michael Hohmuth


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29081 a1c6a512-1295-4272-9138-f99709370657
2011-01-17 22:28:36 +00:00
Michael Giacomelli
66e8fc0f0d Commit part of FS#11748 by Michael Hohmuth. Adds support for automatically resuming any song that is not played to completion at any point later in time, regardless of how many intermediate tracks are played. This is accomplished by expanding the database to record incompletely played tracks. Currently, the feature is simply on or off, in which case all tracks automatically resume, or they do not. The remainder of patches in the task expand this feature by allowing only certain file to automatically resume, only resuming in certain circumstances, etc but are not included until we reach agreement on what should be included. Additionally, the manual will need to be updated once we agree on the available settings.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28942 a1c6a512-1295-4272-9138-f99709370657
2011-01-02 02:49:13 +00:00
Teruaki Kawashima
55a63609ef use correct condition for #if for tagcache_fill_tags().
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28188 a1c6a512-1295-4272-9138-f99709370657
2010-09-30 13:09:50 +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
f8edc32589 FS#10756 - Free unused init code
Introduce a new .init section for initialisation code, so that it can be copied to an area which is later overwritten before calling. The stack/bss can then overwrite that code, effectively freeing the code size that the initialisation routines need. Gives a few kB ram usage back.
Only implemented for PP and as3525 so far. More targets could be added, as well as more functions.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25013 a1c6a512-1295-4272-9138-f99709370657
2010-03-03 23:20:32 +00:00
Miika Pekkarinen
e4cb136ab1 Keep simulators happy.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21403 a1c6a512-1295-4272-9138-f99709370657
2009-06-20 16:48:56 +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
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
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
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
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
Steve Bavin
565de61222 Tiny fix of spelling in comment.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16800 a1c6a512-1295-4272-9138-f99709370657
2008-03-25 15:47:31 +00:00
Miika Pekkarinen
025d1e291a Fixed red, forgot to commit header changes.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16332 a1c6a512-1295-4272-9138-f99709370657
2008-02-17 19:11:16 +00:00
Miika Pekkarinen
21735eb91b Preserve song statistics when moving files or altering metadata. Conditions required to apply: song length must not change AND either filenames (with path) must match or two of the following tags matches: artist, album, title. IMPORTANT: Currently dircache enabled and DB loaded to RAM is required for reliable operation of this feature.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15955 a1c6a512-1295-4272-9138-f99709370657
2007-12-18 21:50:29 +00:00
Miika Pekkarinen
f6039466fb Added file modify time field to the DB. Now metadata changes should be detected with database autoupdate enabled. Runtime statistics are not yet preserved. Preserving statistics over moving of files and altering metadata is going to be implemented next. IMPORTANT: Export database before upgrading.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15946 a1c6a512-1295-4272-9138-f99709370657
2007-12-16 21:10:26 +00:00
Robert Kukla
c436657571 some improvements to FS#8008 - see tracker entry for details
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15371 a1c6a512-1295-4272-9138-f99709370657
2007-10-30 10:02:57 +00:00
Jonathan Gordon
75eff7af5e rework my previous commit (FS#8008) to be able to work for any of the strings in the id3 info struct, new ones need to be added to tagtree.c and tagnavi.config
*currently available tags are* #title# #artist# #album# #genre# #composer# #albumartist# and #directory# 


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15358 a1c6a512-1295-4272-9138-f99709370657
2007-10-29 14:10:24 +00:00
Jonathan Gordon
4d18aa3546 Accept FS#8008 - allows the current artist or album to be used in databse searches (use the #artist# or #album# keywords in tagnavi.config)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15354 a1c6a512-1295-4272-9138-f99709370657
2007-10-29 12:02:55 +00:00
Miika Pekkarinen
caff835d78 Fixed debug menu crashing. Show last file processed by tagcache engine in debug menu. Enabled autoupdating of deleted files for flash storage devices.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15244 a1c6a512-1295-4272-9138-f99709370657
2007-10-21 11:06:30 +00:00
Dan Everton
eecfe9f1cb Add support for grouping tags. From FS#7362.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14242 a1c6a512-1295-4272-9138-f99709370657
2007-08-08 10:19:56 +00:00
Dan Everton
f4a61f0c4a Add support for parsing the disc number tag from metadata and use of it in the database. Patch originally from FS#4961 with some minor tweaks by me.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14154 a1c6a512-1295-4272-9138-f99709370657
2007-08-03 10:00:42 +00:00
Miika Pekkarinen
9d756e2760 Queue song statistical data to the tagcache system and update entirely in background. Fixes ratings disappearing or not saving in the DB at all. Fixes also UI delay when stopping playback and new statistics are committed to DB.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13955 a1c6a512-1295-4272-9138-f99709370657
2007-07-21 17:35:19 +00:00
Miika Pekkarinen
5e47daa944 Now track total playtime should be accessible as well by using Pm and Ps virtual tags.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13133 a1c6a512-1295-4272-9138-f99709370657
2007-04-12 20:21:56 +00:00
Miika Pekkarinen
9d9937a0ad Added virtual tags in database to break track length to minutes and seconds.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13132 a1c6a512-1295-4272-9138-f99709370657
2007-04-12 20:14:05 +00:00
Robert Kukla
226cb7b0b8 Rating support for database and WPS (based on FS# 6301). A value between 0 and 10 can be assigned to the currently playing track using the WPS context menu. This value is displayed in the WPS using the %rr tag (replacing autoscore) and can be used as "rating" in tagnavi.config (examples provided).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12922 a1c6a512-1295-4272-9138-f99709370657
2007-03-26 15:08:59 +00:00
Steve Bavin
149bc03d86 Really don't try to initialise while the database status is unknown
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12684 a1c6a512-1295-4272-9138-f99709370657
2007-03-08 08:20:30 +00:00
Steve Bavin
8137489e2b Lead user through database initialisation
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12678 a1c6a512-1295-4272-9138-f99709370657
2007-03-07 19:56:15 +00:00
Jonathan Gordon
91cb68a1fb Introducing the root menu!
Blind users: get a new voice file as there are lots of lang changes and new strings.
FS#6630 or RootMenu on the wiki for more info. complaints to /dev/null :)



git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12528 a1c6a512-1295-4272-9138-f99709370657
2007-03-01 11:14:46 +00:00
Miika Pekkarinen
f5184f34bf Cleaned up code a bit, fixed possible bug during committing numeric indices and made code more fault tolerant. Added a new numeric tag making it possible to list recently added tracks. Export your DB.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12482 a1c6a512-1295-4272-9138-f99709370657
2007-02-25 20:41:51 +00:00
Linus Nielsen Feltzing
aa8761fccc Shave a few bytes off the binary size, especially on hwcodec targets
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12323 a1c6a512-1295-4272-9138-f99709370657
2007-02-15 22:55:22 +00:00
Miika Pekkarinen
9b9539c8d3 Make database endianess independent.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12297 a1c6a512-1295-4272-9138-f99709370657
2007-02-13 21:51:18 +00:00
Miika Pekkarinen
4e9766477b FS#6638 - Album artist and comment patch for WPS and tagcache. Export
your database before updating because initialization is needed.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12255 a1c6a512-1295-4272-9138-f99709370657
2007-02-10 12:09:28 +00:00
Jonas Häggqvist
6b1d2cbd82 Tag cache renamed to the less cryptic "Database" throughout the UI and manual. No functional changes.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11588 a1c6a512-1295-4272-9138-f99709370657
2006-11-25 09:42:06 +00:00
Miika Pekkarinen
f752a5aa90 Check if file has already been removed from DB when manually invoking
reverse scan.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11556 a1c6a512-1295-4272-9138-f99709370657
2006-11-19 19:11:30 +00:00