summaryrefslogtreecommitdiffstats
path: root/apps/tagtree.c
AgeCommit message (Collapse)AuthorFilesLines
2024-03-24[BugFix] Database Track>Filename returned Directory AttributeWilliam Wilgus1-1/+2
Navigating to track listing by Filename in the database passed the whole directory to the playlist and track info plugin insead of the track filename this was due to 'tag_virt_basename' not being recognized as a valid audio file Change-Id: I3d1cd0b6998a2e55d4f7d70711af9ced46cf2c44
2023-10-17Properties/Tagcache Track Info Retrieval: Skip files with errorsChristian Soffke1-4/+4
File names exceeding the max length will not be retrievable from the database. Skip such files, instead of cancelling the operation at that point. Change-Id: Ia6bc8a53be9ec181eb836956cc3d8b059b2d024f
2023-10-03tagcache/tagtree remove static buffer from tagcache_get_nextWilliam Wilgus1-2/+4
callers can supply their own buffer Change-Id: I8996ecfb88e30926296a0cb0563cf6c46977323e
2023-10-01playlist: Rework playlist modified detection and dirplayAidan MacDonald1-1/+0
The modified state is now an explicit flag that has to be set whenever a user-triggered modification occurs. This is recorded in the control file to ensure it doesn't get lost after resume. There may be some places I missed where the modified flag should be set/cleared, but it seems to work well enough right now. Change-Id: I3bdba358fc495b4ca84e389ac6e7bcbef820c219
2023-03-23playlist: Simplify playlist modified detectionAidan MacDonald1-1/+1
Any modifications to the playlist (insert, delete, shuffle, etc) will cause the modified flag to be set. The flag is cleared when the playlist is saved. Code that generates playlists can manually clear the modified flag if appropriate; there is now a proper API for this so the tagcache and pictureflow don't need to resort to hacks. Change-Id: I8d3c723265a41db07a13de3f1d2abb0444528d57
2023-02-09tagtree.c optimize get_tag()William Wilgus1-59/+74
store tag length to shortcut strcmp this is nearly as fast as making a hash table using gperf its not the hottest path but its even slightly faster to shortcut based on string length if (tagstr_len > match->len) continue; else if (tagstr_len < match->len) break; but I found no measurable difference I don't think its worth the extra constraint of keeping tags sorted Change-Id: I4bb47cc6c5b8266d5f13c4ac78ae11d55ecb2d67
2023-02-07tagnavi make track submenuWilliam Wilgus1-23/+42
add some faster options to the track menu add a shortcut for basename formatting sort basename results filename - by sorted filename title - just title no formatting untagged items are unsorted as well title mm:ss - title and duration Change-Id: I90aea95051f6231580ef7f1fc08cd2d0d69601fb
2023-02-05Revert "tagtree remove unneeded strlen"William Wilgus1-1/+1
This reverts commit 8379c6eb07e7daf26ca74aac7f46c4e331743d84. Reason for revert: tcs.result_len is not the same as strlen(dptr->name) + 1 since it gets filled with filename Change-Id: I1264afc0a43ffe75adf1de00d27ab98e3adbca19
2023-01-27Tagcache - Ramcache Move ref checks, speed up disk searchesWilliam Wilgus1-6/+3
move loading file reference to a separate function some optimization of the disk search function check tag length before reading the actual entry & reduce number of lseek calls this affects startup resume as well before tagcache is done loading Change-Id: I2bd2fc53c4870416ecd1a4034b34cb6984d8ad51
2023-01-19database: make parent tables work with pluginChristian Soffke1-43/+95
Enables the use of PictureFlow and the Properties plugin with parent tables of ALLSUBENTRIES, such as an album or album artist, instead of individual tracks. Change-Id: I18c4779ed116a48c732ae32b9629e7e0d93ce7c8
2023-01-14Database: Add ability to insert multiple files into playlistsChristian Soffke1-10/+51
You could only add single files to playlists from the database browser before. This enables adding any database selection to a new or existing playlist. Change-Id: I811c7167641c589944bb2afc18dcc1d299a7b979
2023-01-13buflib_shrink use NULL to signal start isn't changingWilliam Wilgus1-1/+1
Change-Id: Id3e86d3860b8ed860dc6dcbc394b1b8f9f3274b5
2023-01-13Remove buflib allocation names, part twoAidan MacDonald1-1/+1
Remove allocation names from the buflib API and fix up all callers. Change-Id: I3df922e258d5f0d711d70e72b56b4ed634fb0f5a
2022-12-30tagtree: Discard item history when selection changes in both directionsChristian Soffke1-1/+5
A changed selection only caused the item history for deeper levels to be discarded in tagtree_enter, when you were descending, but not in tagtree_exit when you were ascending the menu hierarchy again. Change-Id: Ia40fa47980a05c2569e8af04e928b06130aa1f33
2022-12-03RFC BugFix tagtree.c reload data abortWilliam Wilgus1-3/+10
TagNav.lua adds Reload to the Custom View menu of tagnav to allow users to make new search queries on the fly previously you had to reboot the device to do this I was getting a data abort prior to calling tagnav_init now but it worked fine if I copy pasted the contents of the init function I'm not sure how this fixed it but making a static init function makes it work as intended is it a race some weird thing with the compiler?? Ideas?? Change-Id: I7fd6c50f929d3ac2d9ecec5336942288e9213ad5
2022-11-23tagtree remove unneeded strlenWilliam Wilgus1-1/+1
unfortunately most of the overhead in searching for <Untagged> occurs in reading of entries so changing searching the resulting string faster doesn't do much good but any we don't need this strlen call since its already been computed Change-Id: Ia2815a6e7d75237366977632f9b0bc7999254096
2022-11-22tagtree.c move sort_inverse out of compare functionWilliam Wilgus1-18/+25
Change-Id: I9c91a96a45fe98d51d27974bc2d6d79eaa5039d3
2022-11-14replace strlcpy with strmemccpyWilliam Wilgus1-9/+9
replace applicable calls to strlcpy with calls to strmemccpy which null terminates on truncation in theory the strmemccpy calls should be slightly faster since they don't traverse the rest of the source string on truncation but I seriously doubt there is too much of that going on in the code base Change-Id: Ia0251514e36a6242bbf3f03c5e0df123aba60ed2
2022-11-14Remove some shadowed variables identified by -WshadowWilliam Wilgus1-4/+4
there are plenty more but these are the low hanging fruit Change-Id: I86d9f4f56e8cd9b381d1bf6a6679cd58c6a4004d
2022-11-14Database: Restore selection in lower menu levelsChristian Soffke1-16/+55
The database only remembered what you'd selected when ascending the menu hierarchy again from a lower level. Now it restores a previous selection going in the other direction as well, when you enter a new menu, as long as the selection at the current level hasn't changed. Change-Id: I5068287ff758a7cfebf1428e9b0ffd30e6ef541e
2022-11-14Database: Eliminate redundant list item selectionChristian Soffke1-2/+0
- gui_synclist_select_item will be called in the update_dir function by dirbrowse() - it is unnecessary to call when the tables opened by tagtree_enter are not being displayed but are only being used for inserting table contents into the current playlist. Change-Id: Ib768b457b2baa7eb85cf73c6339fd4f603d03d90
2022-11-14Database: Fix problematic dirlevel resetChristian Soffke1-1/+3
Dirlevel is restored in this error case without exiting the previously entered tables. Change-Id: I516c3ed635bc5c49dcf551223258215f79bff046
2022-11-11TagTree Show file name for tag_title [UNTAGGED] BugFixWilliam Wilgus1-2/+2
limit result to tags that only show <UNTAGGED> Change-Id: I56ff4ea8c5a17df806d69d58599a9a88f8acc4b0
2022-11-02Database: Remove firstpos/pos_historyChristian Soffke1-2/+0
From what I can tell, this is unused historical baggage that has no effect whatsoever these days. Change-Id: I1b6fed64e7bf5cc4db4ec028617c818c59d81324
2022-11-02Database: Fix FS#13368 – use separate selected item historyChristian Soffke1-6/+10
Database and File Browser were sharing each other’s selected item history before. Since the database isn’t browsed recursively, it’s probably unnecessary to include its own history in the tree context and its backups, saving.a little bit of memory. Change-Id: I87c9aed6f7056bc481b8b7299089851ef28f9bc5
2022-10-22PictureFlow: Minor fixes & changed defaultsChristian Soffke1-5/+1
- Fix FPS counter overlapping the artist string when "Show album title" was set to "Show album and artist at the top" - Fix disappearance of center album if certain Settings menus had been accessed while list of tracks was showing and you then returned to the list of albums - Fix disappearing album artwork after cache had been created until you started scrolling - Enable context menu even if WPS integration is disabled - Make splash screen appear only on first launch and for database updates, when it is actually on screen for long enough - Eliminate 'Loading' splash if tagcache is in RAM - Show both album and artist by default on displays whose height > 100px Change-Id: Ie70c0d9093789294d288a4f88338ee4a588bf4a5
2022-10-21Database: Adjust "Play Selected First"&"Shuffle" behaviorChristian Soffke1-5/+8
- With "Play Selected First" and "Shuffle" enabled, another item was randomly selected when returning to the list. This appears to be a bug - With "Play Selected First" disabled, the first item was selected. This appeared to be intentional, since, at least with "Shuffle" disabled, that is the item that was played back. This may not be helpful either, since it makes you lose your place in what can be a long list. It is also not consistent with the behavior of the File Browser. The current selection should probably be maintained in all cases. - At least according to the manual and the behavior of the File Browser, "Play Selected First" should only apply when "Shuffle" is enabled. Change-Id: Ic1205477d5bf8b22f8f32dd6d31d3b9ceb5a2d24
2022-10-16Convert a number of allocations to use buflib pinningAidan MacDonald1-42/+24
Several places in the codebase implemented an ad-hoc form of pinning; they can be converted to use buflib pinning instead. Change-Id: I4450be007e80f6c9cc9f56c2929fa4b9b85ebff3
2022-10-13splash_progress add delay functionWilliam Wilgus1-9/+7
I figure this is a better way to allow a delay before showing the progress meter Change-Id: I909902a52619023b0b87635d2eb94ed00cb4bcec
2022-10-10Use splash_progress in database when inserting into dynamic playlistChristian Soffke1-10/+15
Change-Id: Iaef66cc00a1be0ce3cf869f0e6137a2e9efa2713
2022-08-19tagtree: Delay showing search progress when ramcache is enabledChristian Soffke1-0/+7
The disk doesn't need to spin up when the database is in RAM. Results are usually returned without any noticeable delay, so the splash only creates distraction. Change-Id: I04e5b7d2e00f045143dd86e0561091be3d8f9724
2022-05-02apps: fix tagtree arithmetic on null pointersAidan MacDonald1-2/+3
It was possible for the tag tree's buflib move callback to turn a null pointer non-null. The tagcache_search_clause->str can be null for OR clauses. Also ensure that clauses are zeroed on allocation to ensure garbage pointers don't creep in. Change-Id: Ic823a8eecc501eeaa75798066521e427a9a89190
2022-03-19tagtree/tagcache add new clause operators begins/ends _oneofWilliam Wilgus1-0/+2
new operators @^, @$ begins_oneof and ends_oneof albumartist @^ "L|The L" Led Zeppelin, The look albumartist @$ "girls|Boys" spice girls, beasty boys Change-Id: I26ce3d8155d970a55e003f74e2f9478db76204f1
2022-03-02tagcache compress uniqbuf 2 16-bit indices occupy a single 32 bit slotWilliam Wilgus1-1/+1
a lot of space is wasted when file indices less than 65535 entries should be more than 1 byte apart so use the LSB as a flag when indices are > 65535 set flag to 0 and proceed as before explicitly mark uniqbuf as 32bit Change-Id: I54e06c152c369eb6c0322186fe2c1e9a1e6d940d
2022-02-28tagtree.c optmize clause operator parsingWilliam Wilgus1-29/+31
makes WS after a clause conditional optional Change-Id: I335b5381fb788c19130aa8d57dfb18bb43a07c18
2022-02-25TagTree Show file name for tag_title [UNTAGGED]William Wilgus1-0/+14
fallback to filename as [UNTAGGED] is a terrible way to browse titles Change-Id: Ifcdc4c27562339b8a916313fb946c88c4eba3b5a
2021-12-28Database: Fix selection being resetChristian Soffke1-2/+9
Consistent with (preferable) behavior of file browser after selecting an item for playback Change-Id: I45a72f6d743fd70c301f9d5de0f8a2a02157b2c6
2021-12-24tagtree: Support user override config fileAidan MacDonald1-2/+10
Allow users to create an alternative tagnavi config file named "tagnavi_user.config" in the .rockbox directory. If present, it will be used instead of the default tagnavi.config, allowing the default menu to be completely redefined. This makes it much easier to maintain customizations which remove or modify parts of the default config -- since the default config is shipped in the Rockbox zips, a customized tagnavi.config would have to be saved with manual intervention on each & every update. Change-Id: I509177fab0e01fc0db0bc4407a3a92bbff5fa481
2021-09-17Database: Fix tag_albumartist; new tag_virt_canonicalartist.James D. Smith1-0/+1
Change-Id: I1d887f8a9d6690b8286407d2502432b0497cfeb9
2021-03-04Check core max allocations for valid handleWilliam Wilgus1-0/+3
fix rolo warnings Change-Id: Ia2c669a5517aec54e5b2c0dc5934c88a4f49f2a9
2021-02-17Fix playback queue bug when "Insert Next" is used with multiple songs at onceChristian Soffke1-12/+8
After using “Insert Next” to insert multiple songs at once (e.g. an album from the database browser or folder from the file browser), subsequent Insert operations will incorrectly insert items after the first song of all items that were previously inserted, instead of after the last song of the previously inserted items. A bug fix was originally written by Costas Calamvokis for the file browser only. I adopted the original fix and added code analogous to it so that it works from the database browser as well. See FS#7898, FS#7363 or this forum post for more info: https://forums.rockbox.org/index.php/topic,53741.0.html Change-Id: Ie2718e136df0b340000f7a171e9e806cf23a27b4
2020-07-24[3/4] Completely remove HWCODEC supportSolomon Peachy1-10/+0
'swcodec' is now always set (and recording_swcodec for recording-capable units) in feature.txt so the manual and language strings don't need to all be fixed up. Change-Id: Ib2c9d5d157af8d33653e2d4b4a12881b9aa6ddb0
2020-07-22keyboard add ability to specify temporary custom layoutsWilliam Wilgus1-1/+1
rb core allows you to load custom keyboard layouts this patch adds the ability to load a keyboard layout in a buffer the custom layout is temporary and does not overwrite the current layout use like so: unsigned short kbd[64]; unsigned short *kbd_p = kbd; if (!kbd_create_layout("ABCD1234\n", kbd, sizeof(kbd))) kbd_p = NULL; rb->kbd_input(buf,sizeof(buf), kbd_p); Change-Id: I7be2bd4a1b4797a147fa70228a9749dc56ac052a
2019-08-02tagtree add %reload to allow hot reloading of tagnavi configWilliam Wilgus1-18/+124
adds (static) function tagtree_unload frees all buflib allocations for tagtree adds command %reload that allows a new tagnavi file to be loaded without device restart use it like so.. "Reload..." -> %reload Allocations are now checked for validity (probably a good idea anyway) Change-Id: I2b4b9b7e253f97f3e6575e0ea7a92905e004d47f
2019-07-10tagtree.c->loadroot() guard against overflowWilliam Wilgus1-0/+3
forum user chris_s noted an possible unhandled cache overflow Change-Id: Ia79399d6581ef6b635578896519fda8126c731d7
2018-10-18Fix menu warningsWilliam Wilgus1-4/+4
change offending bool return to int warning: cast between incompatible function types from '_Bool (*)(void)' to 'int (*)(void)' [-Wcast-function-type] forgot to remove -- typedef int (*menu_function)(void); Change-Id: Ie4c8d3ddb0fb7843c4ec584203350d658d6bee3e
2017-02-10Fix tagtree from blowing up when its buffer movesMichael Sevakis1-1/+6
I noticed that after booting with the external storage removed, playing from tagtree, inserting the card, forcing dircache to reallocate from the debug screen, and trying to reenter tagtree, it would data abort because the dircache reallaction to a larger size caused the tagtree buffer to move. Adjustment to at least one pointer (csi) was missed. Since it's non-trivial there to determine when things should be NULL and when they shouldn't, add check for menu too before moving it. As for the rest, who knows. Change-Id: Iea6538a2091b4b47083f39296555efc47edf8ba8
2014-03-14events: Rework event subsystem (add_event, send_event) to be more versatile.Thomas Martitz1-6/+8
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-10Implement time-based resume and playback start.Michael Sevakis1-5/+15
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-01-15tagtree: Use strnatcasecmp() for the database browser too.Thomas Martitz1-1/+14
Even though you can insert leading zeros that makes ascii sort work for numbers, sometimes the leading zeros don't suffice. In order to always sort numerically strnatcasecmp() is needed. With the default tagnavi.config this affects albums with discnum > 9 or tracnums > 99. This FS#12888. Change-Id: Ie265c86eaf6dd07b6beda9e5eef25eb81eef8fd4