Commit graph

730 commits

Author SHA1 Message Date
William Wilgus
91c8633e8c [BugFix] font.c filename was movable
stupid bug on my part font_filename was pointing to a movable
alloc therefore that data could be moved out from under the returned pointer

instead pin the internal calls to core_get_data and
remove font_filename in favor of a function that checks if a
filename matches the loaded font as this was all it was used for anyway

Change-Id: Iebb47ffe3f81aa9d5e3968975f26d64283633ffc
2023-02-15 01:15:59 -05:00
Aidan MacDonald
701e262d3d settings: Remove setting ID return from find_setting()
Now that all users have replaced setting IDs with direct pointers,
find_setting() and friends don't need to return an ID value.

Change-Id: I8c5c31bb68d3bca5350d43538335265a55fd5517
2022-12-17 13:36:38 +00:00
William Wilgus
5903cd4bc8 [Bug Fix] setting.c fail to check F_TABLE_SETTING w/o arbitrary values
table settings have a list of valid values when
they do not have F_ALLOW_ARBITRARY_VALS flag

they were not being treated as such

Change-Id: Ib02643a65ee4fc2abb1be8563a1849076de2f708
2022-12-16 08:30:54 -05:00
William Wilgus
0747415277 Settings.c add logf debugging to verify settings
decodes saved settings and available settings & flags

Change-Id: I46bea15e7cef23fe9e41778455564f38bf00eeb1
2022-12-12 23:12:31 -05:00
Aidan MacDonald
90d1ac0448 settings: Rewrite cfg_int_to_string() and cfg_string_to_int()
It's easier to do the parsing manually.

Change-Id: Ief8b71942d3ab9313dd6927bd7f4bb254d0c12db
2022-12-10 14:21:42 +00:00
Aidan MacDonald
a89f279fd4 settings: Clean up NVRAM code
Code style fixes, tighten error checking, replace a static buffer
with a stack allocated one.

Change-Id: I48392fa187057cc4a07847d45147f0db9f43f509
2022-12-05 14:18:06 -05:00
Aidan MacDonald
4ff97ae07c settings: More settings ID to pointer conversions
Convert cfg_int_to_string(), cfg_to_string(), settings_write_config().

Change-Id: Icb72d2ff874cf90ffe5fe14878aece0a53f6bd18
2022-12-04 10:46:02 -05:00
Aidan MacDonald
bbe3942039 settings: Settings ID to pointer for cfg_string_to_int()
Accept a pointer to struct settings_list instead of an index in the
settings array. Refactor the skin engine's touchregion_setup_setting()
to avoid the use of indices.

Change-Id: I784a5e49205da6874b8b419dd5413f722ad45b67
2022-12-04 05:25:50 -05:00
Aidan MacDonald
8aa3b22160 settings: Update int fallback check for settings with cfg_vals
This atoi() was added long ago in commit d490f441, and it looks
like it's intended to allow arbitrary values in table settings.
These table settings have some symbolic values (eg. off, on) but
are otherwise int-valued.

As far as I can see the only settings that can take this branch
are all table settings with F_ALLOW_ARBITRARY_VALS. It doesn't
make a lot of sense to accept random integers without that flag,
so make the atoi() conversion dependent on it.

Change-Id: I7bb1bc4997601b73ad8dcbf2f3ddf434d16adf23
2022-12-01 13:59:49 -05:00
Aidan MacDonald
6346be51a3 settings: Clean up and simplify settings_load_config()
Use find_setting_by_cfgname() instead of doing it manually.
Reduce the excessive level of indentation.

Change-Id: I410fd7e0c26d065bc479dad3b6facfb5368cd091
2022-12-01 13:36:54 -05:00
Aidan MacDonald
5b1dd64f50 settings: Add helper function for handling filename settings
The old inline implementation was buggy -- it didn't check the
suffix was actually at the end of the string before stripping
it, and didn't check for truncation. This version also avoids
using an extra buffer.

Change-Id: I33abfefc508675d3079cc64a9ad2b11d646baa0d
2022-12-01 13:07:24 -05:00
William Wilgus
0661784469 make int_setting step & unit int16_t
since int_setting is the largest struct in the union of settings
saving 32 bytes adds up over every setting

frees ~200 bytes

Change-Id: Id4722262e40db3021c740e138fe7352be10e2c70
2022-11-20 13:57:09 -05:00
William Wilgus
f6c719d7ec replace strlcpy with strmemccpy
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-14 23:56:16 -05:00
Aidan MacDonald
ead172c05d gui: Remove redundant copies of list scrolling settings
gui_list_screen_scroll_step() and gui_list_screen_scroll_out_of_view()
just copy the global setting into a local static variable.
Since they don't do anything special when the setting changes
it's simpler to use the global setting directly.

Change-Id: Ib6a7bf4e09b6dabbc1597cf28ddbafc0bc857526
2022-10-05 10:22:55 -04:00
Christian Soffke
bc5a638594 Option to switch off album art or to prefer file over embedded
Large embedded album art can cause pauses during
playback or when skipping between tracks, especially
on older devices, but embedded art is currently loaded
even when separately stored smaller image files would be
available.

A workaround is to remove large album art from the
metadata of files.

This now adds a setting to either turn off loading of
album art completely, or to prefer loading the album art
from a separate image file and thus ignore the embedded
versions.

Change-Id: I22fb581abf56072e35e6c29d72e553747ec1a96a
2022-01-22 08:29:40 -05:00
Aidan MacDonald
e3ee1908dd powermgmt: Small cleanups to battery capacity code
- Don't include the 'battery capacity' setting unless the
  target allows changing it.
- Clean up the preprocessor conditionals used to check for
  variable battery capacity support.
- Don't use a variable for battery capacity unless it is
  actually needed.

Change-Id: I3d8a338f107014f2c5098bc0a44ef0cfb4df9356
2021-12-05 13:37:25 -05:00
William Wilgus
aed113042d RFC settings & nvram.bin save setting to tmp file save old
save to a .tmp file on save and rename on next load

I think this should pretty minimally invasive as the same file
still gets overwritten in subsequent attempts until it is loaded again

the save path is still static
so it won't cause issues holding up shutdown.

load might be a bit slower with the searching for tmp+current file
and renaming them

Plus there is now a backup of your last settings file

Change-Id: If95618b93a0ba7954d5d8cab1d6ea3f07e658509
2021-11-08 16:15:47 -05:00
Aidan MacDonald
5a4cc8da3f Drop HAVE_RTC_RAM
Only Archos players ever used this feature and it isn't implemented
on any current targets.

Change-Id: I39c8455480a3fe33cd25b667e8d4d6ff3a092d3e
2021-08-15 20:41:58 +01:00
Dana Conrad
14f7a958af Softlock Improvements
Add a check to see if the keys are currently locked and allow
them to be unlocked to ensure we don't get stuck when the current
playlist ends while the WPS is locked.
(Original by Aidan MacDonald)

Adding initialization for unlock_combo and to arm the autolock
(if enabled) without the user needing to press the lock button
at least once every boot (which is the prior behavior).

Removing screen_has_lock check from is_keys_locked()

Change-Id: I0fbf9b9746b011a7086ec8505a7ecc4b84f2d332
2021-06-04 00:00:57 +00:00
Aidan MacDonald
55805e13a4 Add new audiohw capability: POWER_MODE_CAP
This allows the user to make use of the DAC's power-saving abilities.
The two modes are "high performance" and "battery saver". This feature
is supported by the AK4376 DAC in the upcoming FiiO M3K port.

The setting is only a manual toggle right now, but in the future it
could be hooked up to the battery level (via another setting) so it
can be toggled automatically when the battery gets too low.

Change-Id: I482af6e2f969fcbdeb3411bd3ff91f866b12d027
2021-03-22 13:00:11 +00:00
Solomon Peachy
c9e8d96e77 ibasso: Fix the dx50/dx90 build (and usb_mode selection)
(The usb_mode selection setting was actually broken even though
 it had been previously compiling...)

Change-Id: I0cac31d24c0ef684b934e40ab14f683cc4a31738
2021-03-07 19:42:54 -05:00
Christian Soffke
640b14c08c Fix inability to reset filetype colors without restarting
0ce42df prevented read_color_theme_file() from being
executed when applying settings (from a cfg file)
if the filetype colors setting was set to "-". Resetting
custom filetype colors happens in that function though and
thus wouldn't work. You had to restart Rockbox for the
setting to be applied (at which point read_color_theme_file()
is called from filetype_init() which is called by the init()
function in main.c)

The safety check has been moved from settings.c directly into
read_color_theme_file(). This has the added
advantage that it will also apply during the init process
where there existed no check before (prevents the problem
mentioned in 2e3a8c7).

Change-Id: I547fe180f0bac79889bf2c44778bb1cc4f9d4307
2021-03-01 13:33:43 +01:00
Solomon Peachy
63691ad106 Fix the fix, which managed to make things _worse_
Change-Id: I91b6bc71cf1d5c4cf06d839dfa783cb799756b77
2020-11-16 12:55:33 -05:00
Solomon Peachy
3e32521be5 Fix the red introduced in 9c68c69
Change-Id: I5f3e3ddd5bc11b8d58e5c05ec3bf7171537c016d
2020-11-16 12:35:47 -05:00
Solomon Peachy
9c68c69cf0 FS13257: Fix inconsistent defaults in the USB mode selection
Change-Id: I44894d13f070313ad326ce68018556573e35aad9
2020-11-16 17:11:38 +00:00
Solomon Peachy
3f828e9244 FS#13220: Allow sound settings to be saved again
(Basically this reverts bf546fbfcb and its successors)

Change-Id: I044cfb797d306412837e7509cb85b65bc6ffacca
2020-07-27 22:42:34 +00:00
Solomon Peachy
658026e626 [4/4] Remove HAVE_LCD_BITMAP, as it's now the only choice.
Note:  I left behind lcd_bitmap in features.txt, because removing it
would require considerable work in the manual and the translations.

Change-Id: Ia8ca7761f610d9332a0d22a7d189775fb15ec88a
2020-07-24 21:20:13 +00:00
Solomon Peachy
8cb555460f [3/4] Completely remove HWCODEC support
'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-24 21:20:13 +00:00
Solomon Peachy
092c340a20 [1/4] Remove SH support and all archos targets
This removes all code specific to SH targets

Change-Id: I7980523785d2596e65c06430f4638eec74a06061
2020-07-24 21:20:13 +00:00
William Wilgus
cb94b3ae2e keyboard add ability to specify temporary custom layouts
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
2020-07-22 06:48:28 -04:00
Solomon Peachy
25f9601d7b Fix the sea of red introduced in bf546fb
Change-Id: Ic158771d8dae6b587e0f567e7a6bb005b5e2ac50
2020-07-20 22:39:01 -04:00
Solomon Peachy
bf546fbfcb Run-time validation of INT settings.
Check against min/max/step parameters

Many places this value is used as an index into an array; this will
help prevent array overflows and undefined/undesireable behavior.

Some fields accept arbitary values, continue to accept those.

Change-Id: Idbb5a17b7ceae5500660987703e2d6c16e920c92
2020-07-21 02:20:26 +00:00
Igor B. Poretsky
f26cf6a3ec Fixed system state information loss when it is saved in file
Change-Id: If2aca712af4152e144ec919cfc4b4d9cb23bf4f2
2020-06-30 14:20:37 +00:00
William Wilgus
3f6fed8eca Fix potential buffer overflow in settings.c
Change-Id: Ie8953e3ffc5188685f1ea056863bfbdb817080a7
2019-01-08 03:44:32 +01:00
William Wilgus
dd40c46d50 Fix menu warnings
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
2018-10-18 00:06:31 +02:00
Michael Sevakis
abef236081 Do playback restarts the proper way
It isn't necessary to explicitly stop and restart playback to
force it to update something that must cause rebuffering.

Change-Id: I6ff5394fcafc7374af67ef9fbf9022bb4a79b773
2017-11-24 08:55:49 -05:00
Amaury Pouly
1245c5fe61 Implement speaker enable/disable on jack (un)plug
The implementation is not very complicated but there are a few things worth
noting. There was a previous "speaker enable" setting but it was a boolean.
I decided to replace it with a choice setting that has 2 options (on, off)
if headphones cannot be detect on this target, or 3 options (on, off, auto)
if we can detect headphones. This will break the old setting on target that
cannot detect jack but it makes the code more uniform and avoid maintaining
two settings with more #ifdef. The third option (auto) uses the LANG_AUTO
text, which I think is clear enough (disable speaker on jack plug).
In order to avoid code duplication (both in apps and firmware), I decided to
keep the audiohw_enable_speaker function as-is: it takes a boolean and doesn't
care about the speaker policy. I introduced a new audio_enable_speaker that
takes directly the mode (which follows the setting encoding): 0=off, 1=on
and 2=auto. This way one calls audio_enable_speaker and it changes the speaker
once to reflect the request mode. The apps code then uses this function in the
places where it makes sense: on setting load, setting change and jack (un)plug
event.

Change-Id: I027873f698eb4bc365d7c02b515297806355d9e2
2017-02-04 17:22:08 +01:00
William Wilgus
dc87e9e9f3 Selective Backlight/Advanced Softlock - Selective actions based on context
Selective backlight allows the user to choose actions that will not
enable the backlight when pressed.

Advanced softlock allows user to choose actions that  will not be
blocked by screenlock on devices without a hold button.

Both only occur in FM and WPS Contexts.

Update:
Back from the dead
-Cleaned up code, removed unnecessary calls, re-arranged last filter action
  timeout conditional to work in case last_filtered_action_tick was never set
-Added entries to the manual
-Fixed back button on some menus not activating backlight
-Made menus more intuitive, no actions selected now changes menu item to off.
-Added talk fuctionality.
-Added option to disable selective backlight while on external power.
-Rewrote backlight and softlock handling code to fix issue with scrollwheels
-Menu changed to have toggle(yes/no) and settings
-Optimized selective actions lookup
-Added option to disable notification of 'buttons locked' while softlocked
-Removed uneeded code, consolidated action lookup to single function
-Fixed incorrect name on selective softlock menu
-Added option to disable touch on touchscreen devices
-Fixed backlight on original screenlock without selective screenlock active
-Added text selection in mask_select for when show_icons is off
-Fixed voice in mask_select to speak if voice is defined instead of spelling
-Added more lang defines (play skip seek)
-Added option to disable unknown keys turning on backlight
-Fixed Conditional argument In wrong place causing players without
	backlight to fail to build
-Fixed Disable Unknown blocking detection of context change
-Fixed canceling menu didn't update new settings
-Added Autolock on backlight off
-Removed backlight_on_force from backlight.c, Now sets ignore next to false
	and uses backlight_on
-Cleaned up autolock code added strings to lang file
-Fixed issue where rapid presses would bypass softlock
-Removed old softlock code, Cleaned selective actions code
-Changed menu to match existing RB menus
-Fixed Backlight_on_Hold blocked by backlight_ignore_next
-Fixed ignore_next for ipod
-Fixed bug allowing context with softlock to bypass selective backlight
-Changed mask_select to no longer prompt for changes to be saved
-Changed menu names
-Added ignore timeout to allow ipod scroll wheel to work properly and other
 players to still work properly, removed some previous code including
 ignore_event
-Increased ignore timeout to prevent sd card accesses from interrupting action
 code and turning on backlight
-Changed Unknown action to unmapped action in menu, changed handling code
-Removed unneeded logic and variables for handling unfiltered actions
-Reverted unmapped action code to previous functionality
-Added manual entries (thanks JohnB)
-Removed elusive unhandled unicode character from manual, changed formatting slightly

Actions:
Volume,Play,Seek,Skip

Extras:
Disable unmapped actions
Disable selective backlight on external power
Disable touch during softlock on touchscreen devices
Disable softlock notifications (power button still notifies)
Autolock on backlight off

Method:
Adds a function to ignore backlight on next call
 If selected action occurs backlight is forced on,
 Filter_first_keypress stays intact.

Selective softlock allows selected actions through, bypasses the normal
 softlock routine.

ToDo:
DONE

previous commit (#1) has attribution for folder_select.c which mask_select
is based from.

Change-Id: I08132ddcfd64c81751ef23b720f3ec6d68695fe4
2017-01-17 23:06:17 +01:00
Mihail Zenkov
6228c8da18 Fix reset runtime
Change-Id: Ic1ba0c7c7883aae43100c67235dbc2db83056fe7
2016-04-04 11:05:43 +02:00
Udo Schläpfer
95fdad5e28 iBasso DX50/DX90: User selectable USB mode.
Depends on http://gerrit.rockbox.org/r/#/c/1043/.

This patch adds a new setting in Settings -> General -> System: USB Mode.

Usable in Quickscreen and Shortcuts.

Possible settings are:
- Mass Storage: The default, on USB connect export the internal and external
drives as usual. Rockbox will exit gracefully in this case, since the internal
drive (/mnt/sdcard) is exported as mass storage device and Android prevents
Rockbox from continued execution.
- Charge Only: USB charge only, do not export the internal and external drives.
This will not close Rockbox.
- ADB: Enable the Android Debug Bridge. This will not close Rockbox.

Charge only and ADB are actually the same, since it is not yet established if
charge only is doable without adb and major hooks into Android.

German translation provided.

This may be genric for Android based devices but is only enabled
for iBasso Devices. Other maintainers may choose do adopt this.

Change-Id: I616247c29946c6595ebcf8f0c14b2410c9f0498b
2015-02-02 22:43:46 +01:00
Udo Schläpfer
040306a716 iBasso DX50/DX90: User selectable freq scaling governor.
Depends on http://gerrit.rockbox.org/r/#/c/1043/.

This patch adds a new setting in Settings -> General
-> System: Freq Scaling Governor

Usable in Quickscreen and Shortcuts.

Possible settings are:
- Conservative: Slow frequency switching.
- Ondemand or Interactive: Fast frequency switching.
- Powersave: Allways lowest frequency.
- Performance: Allways highest frequency.

German translation provided.

This may be genric for Android kernel based devices but is only enabled
for iBasso Devices. Other maintainers may choose do adopt this.

Change-Id: I10296f5be9586ad3a409105db0cd03682a30e9c1
2015-02-02 21:58:25 +01:00
Chiwen Chang
3ae0f32ac3 three new DSPs
perceptual bass enhancement
- a bbe-ish group delay corrction with Biophonic EQ boost.
- precut

auditory fatigue reduction
-reduce signal in frequency that may trigger temporary threshold shift

haas surround
-frequency between f(x1) and f(x2) is always bypassed.
-can apply to side only.

Change-Id: Icb6355ce9b1c99bf2c58c9385c3c411c0ae209d3
2015-01-19 19:34:01 +01:00
Thomas Jarosch
5d3aa1bce1 Fix red (pass pointer of 'item')
Change-Id: I2d04251519623b2531948615c35e61203f9a9940
2014-12-22 21:30:30 +01:00
Thomas Jarosch
06eeab0242 Always initialize "item"
Otherwise item.cfg_name and item.default_val
will contain garbage. It doesn't seem to have
an effect right now, but who knows what
a future refactoring might do.

cppcheck reported:
[rockbox/apps/settings.c:1268]: (error) Uninitialized variable: item

Change-Id: Ic4d0c302929613de8f291cd2d69cd39db8711107
2014-12-22 21:12:11 +01:00
Amaury Pouly
8146b40e73 Fuze+: add a configurable deadzone area for touchpad buttons
To stop erroneous button presses, allow users to add a deadzone between
the button via the Settings > General > System menu > Touch Dead Zone.

The configuration was chosen this way: the touchpad has the same DPI
in both direction so the setting applies the same on both the X and Y
axis. The setting ranges from 0 to 100 and is internally multiplied by 2
giving a maximum deadzone of 2*100 = 200 around each button, which
account for 400 total (once around each button), effectively reducing
each virtual button from 1000x600 to 600x200 when using the maximum value.

Change-Id: I8683c63d2950200eb32d1dda0a00bbd92d83d5be
Reviewed-on: http://gerrit.rockbox.org/677
Reviewed-by: Benjamin Brown <foolshperson@gmail.com>
Tested: Benjamin Brown <foolshperson@gmail.com>
Reviewed-by: Amaury Pouly <amaury.pouly@gmail.com>
2014-09-08 11:21:54 +02:00
Michael Sevakis
7d1a47cf13 Rewrite filesystem code (WIP)
This patch redoes the filesystem code from the FAT driver up to the
clipboard code in onplay.c.

Not every aspect of this is finished therefore it is still "WIP". I
don't wish to do too much at once (haha!). What is left to do is get
dircache back in the sim and find an implementation for the dircache
indicies in the tagcache and playlist code or do something else that
has the same benefit. Leaving these out for now does not make anything
unusable. All the basics are done.

Phone app code should probably get vetted (and app path handling
just plain rewritten as environment expansions); the SDL app and
Android run well.

Main things addressed:
1) Thread safety: There is none right now in the trunk code. Most of
what currently works is luck when multiple threads are involved or
multiple descriptors to the same file are open.

2) POSIX compliance: Many of the functions behave nothing like their
counterparts on a host system. This leads to inconsistent code or very
different behavior from native to hosted. One huge offender was
rename(). Going point by point would fill a book.

3) Actual running RAM usage: Many targets will use less RAM and less
stack space (some more RAM because I upped the number of cache buffers
for large memory). There's very little memory lying fallow in rarely-used
areas (see 'Key core changes' below). Also, all targets may open the same
number of directory streams whereas before those with less than 8MB RAM
were limited to 8, not 12 implying those targets will save slightly
less.

4) Performance: The test_disk plugin shows markedly improved performance,
particularly in the area of (uncached) directory scanning, due partly to
more optimal directory reading and to a better sector cache algorithm.
Uncached times tend to be better while there is a bit of a slowdown in
dircache due to it being a bit heavier of an implementation. It's not
noticeable by a human as far as I can say.

Key core changes:
1) Files and directories share core code and data structures.

2) The filesystem code knows which descriptors refer to same file.
This ensures that changes from one stream are appropriately reflected
in every open descriptor for that file (fileobj_mgr.c).

3) File and directory cache buffers are borrowed from the main sector
cache. This means that when they are not in use by a file, they are not
wasted, but used for the cache. Most of the time, only a few of them
are needed. It also means that adding more file and directory handles
is less expensive. All one must do in ensure a large enough cache to
borrow from.

4) Relative path components are supported and the namespace is unified.
It does not support full relative paths to an implied current directory;
what is does support is use of "." and "..". Adding the former would
not be very difficult. The namespace is unified in the sense that
volumes may be specified several times along with relative parts, e.g.:
"/<0>/foo/../../<1>/bar" :<=> "/<1>/bar".

5) Stack usage is down due to sharing of data, static allocation and
less duplication of strings on the stack. This requires more
serialization than I would like but since the number of threads is
limited to a low number, the tradoff in favor of the stack seems
reasonable.

6) Separates and heirarchicalizes (sic) the SIM and APP filesystem
code. SIM path and volume handling is just like the target. Some
aspects of the APP file code get more straightforward (e.g. no path
hashing is needed).

Dircache:
Deserves its own section. Dircache is new but pays homage to the old.
The old one was not compatible and so it, since it got redone, does
all the stuff it always should have done such as:

1) It may be update and used at any time during the build process.
No longer has one to wait for it to finish building to do basic file
management (create, remove, rename, etc.).

2) It does not need to be either fully scanned or completely disabled;
it can be incomplete (i.e. overfilled, missing paths), still be
of benefit and be correct.

3) Handles mounting and dismounting of individual volumes which means
a full rebuild is not needed just because you pop a new SD card in the
slot. Now, because it reuses its freed entry data, may rebuild only
that volume.

4) Much more fundamental to the file code. When it is built, it is
the keeper of the master file list whether enabled or not ("disabled"
is just a state of the cache). Its must always to ready to be started
and bind all streams opened prior to being enabled.

5) Maintains any short filenames in OEM format which means that it does
not need to be rebuilt when changing the default codepage.

Miscellaneous Compatibility:
1) Update any other code that would otherwise not work such as the
hotswap mounting code in various card drivers.

2) File management: Clipboard needed updating because of the behavioral
changes. Still needs a little more work on some finer points.

3) Remove now-obsolete functionality such as the mutex's "no preempt"
flag (which was only for the prior FAT driver).

4) struct dirinfo uses time_t rather than raw FAT directory entry
time fields. I plan to follow up on genericizing everything there
(i.e. no FAT attributes).

5) unicode.c needed some redoing so that the file code does not try
try to load codepages during a scan, which is actually a problem with
the current code. The default codepage, if any is required, is now
kept in RAM separarately (bufalloced) from codepages specified to
iso_decode() (which must not be bufalloced because the conversion
may be done by playback threads).

Brings with it some additional reusable core code:
1) Revised file functions: Reusable code that does things such as
safe path concatenation and parsing without buffer limitations or
data duplication. Variants that copy or alter the input path may be
based off these.

To do:
1) Put dircache functionality back in the sim. Treating it internally
as a different kind of file system seems the best approach at this
time.

2) Restore use of dircache indexes in the playlist and database or
something effectively the same. Since the cache doesn't have to be
complete in order to be used, not getting a hit on the cache doesn't
unambiguously say if the path exists or not.

Change-Id: Ia30f3082a136253e3a0eae0784e3091d138915c8
Reviewed-on: http://gerrit.rockbox.org/566
Reviewed-by: Michael Sevakis <jethead71@rockbox.org>
Tested: Michael Sevakis <jethead71@rockbox.org>
2014-08-30 03:48:23 +02:00
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
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
428f069a1f talk: Remove superflous call to talk_init().
talk_init() is called by settings_apply() already which is called on boot.
Doing it again means loading the voicefile a second time which isn't necessary.

Change-Id: I4decd16401e63bf87338d3163c99d06d69fe3a3c
2014-02-02 19:40:38 +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