Allow setting and removing keyremap on the fly
It was pretty annoying trying to work out a keyremap with a restart
required to set the remap and was quite annoying when I was no
longer able to navigate to the plugin or filebrowser due to setting
the wrong remap
now you can try out a keymap and if it doesn't work a restart will
sort things out
Change-Id: I848fb3bd759f9684ac2497324a371f92b7464f7b
There are various allocations that can't be moved or shrunk.
Provide a global callback struct for this use case instead of
making each caller declare its own dummy struct.
Also fixed ROLO and x1000 installer code which incorrectly
used movable allocations.
Change-Id: I00088396b9826e02e69a4a33477fe1a7816374f1
Prev/next buttons on iPods or Fiio M3k can now
be used to select another album without having to
return to the albums view first. Scroll wheel/strip
handles scrolling up and down in the track list
as before.
Other targets probably have the necessary
buttons for this, so the keymap can be extended
in the future (same goes for alphabetic browsing)
Also prevents queue overflow and handles
failure case for track list tagcache retrieval.
Change-Id: Ic8ff4471e1583d1ab1f7d16911b15705a7f60aca
When appending tracks, they were always inserted last.
You can now choose from the usual options offered by
the "Current Playlst" context menu to queue or to insert
tracks at the requested position.
The splash after appending that forced you to wait for
2s has been eliminated.
Also fixes crashes on targets that use the grey_core lib
if a splash showed up when playback was started,
e.g. LANG_PLAYLIST_CONTROL_ACCESS_ERROR, or
when PictureFlow quit.
Change-Id: I661c59057b5315ba793ee1674f7a2ea1ffd7968d
handles the folder selection for autoresume paths and database paths
folder_select uses the pluginbuf to build the directory tree
hopefully having it as a plugin will make it stop corrupting
TSR plugins like battery_bench and announce_status
I left the original include and source in the gui directory for now
there are currently no other users..
Change-Id: If40ccb5a2bec4286a0616c10dfa7e1479a592808
share all the core icons with plugins
these are all small mono icons like usb plug icon or
play, fast forward, rewind icons
--include the icon_helper function
Change-Id: I385028815a4dd368515f491a9e19dee3d500252d
talk_value is just talk_value_decimal with 0 decimals
lets add the extended function instead
static inline int talk_val(long n, int unit, bool enqueue)
{
#define NODECIMALS 0
return rb->talk_value_decimal(n, unit, NODECIMALS, enqueue);
}
Change-Id: Iaba3d2f95785f2e1855e294ccf099a977bb6cb20
This uses the reverse of the polynomial used by the current crc_32
function. The code for this was derived from the implementation used
by tinf. This version is space optimized and should be a good way to
reduce code duplication in other parts of rockbox that use the same
crc32 algorithm. This is mainly of use in areas where DEFLATE is in
use.
Change-Id: I918da5b4ea4dc441c0e7e6b5007abcc2da463bcb
* pcm_get_bytes_remaining()
* pcm_calculate_peaks()
* pcm_get_peak_buffer()
Nothing in-tree uses these at all (except for the lua plugin wrapper)
Change-Id: I971b7beed6760250c8b1ce58f401a601e1e2d585
Nothing in the core has used it for some time. It's exported to the
plugin API but the last plugins to use it were switched to the mixer API
back in 2011.
This allows us to get rid of pcm_play_dma_pause() from all audio drivers
Change-Id: Ic3fa02592316f84963e41d792d1cabb436d1ff6b
I'm currently running up against the limitations of the lcd_draw functions
I want these functions to be able to be used on any size buffer not
just buffers with a stride matching the underlying device
[DONE] allow the framebuffer to be decoupled from the device framebuffer
[DONE need examples] allow for some simple blit like transformations
[DONE] remove the device framebuffer from the plugin api
[DONE}ditto remote framebuffer
[DONE] remove _viewport_get_framebuffer you can call struct *vp = lcd_set_viewport(NULL) and vp->buffer->fb_ptr
while remote lcds may compile (and work in the sim) its not been tested on targets
[FIXED] backdrops need work to be screen agnostic
[FIXED] screen statusbar is not being combined into the main viewport correctly yet
[FIXED] screen elements are displayed incorrectly after switch to void*
[FIXED] core didn't restore proper viewport on splash etc.
[NEEDS TESTING] remote lcd garbled data
[FIXED] osd lib garbled screen on bmp_part
[FIXED] grey_set_vp needs to return old viewport like lcd_set_viewport
[FIXED] Viewport update now handles viewports with differing buffers/strides by copying to the main buffer
[FIXED] splash on top of WPS leaves old framebuffer data (doesn't redraw)
[UPDATE] refined this a bit more to have clear_viewport set the clean bit and have skin_render do its own screen clear
scrolling viewports no longer trigger wps refresh
also fixed a bug where guisyncyesno was displaying and then disappearing
[ADDED!] New LCD macros that allow you to create properly size frame buffers in you desired size without wasting bytes
(LCD_ and LCD_REMOTE_)
LCD_STRIDE(w, h) same as STRIDE_MAIN
LCD_FBSTRIDE(w, h) returns target specific stride for a buffer W x H
LCD_NBELEMS(w, h) returns the number of fb_data sized elemenst needed for a buffer W x H
LCD_NATIVE_STRIDE(s) conversion between rockbox native vertical and lcd native stride (2bitH)
test_viewports.c has an example of usage
[FIXED!!] 2bit targets don't respect non-native strides
[FIXED] Few define snags
Change-Id: I0d04c3834e464eca84a5a715743a297a0cefd0af
Remove mp3_is_playing() entirely, in favor of pcm_is_playing()
Remove mp3_play_pause() entirely, as it's a dummy/no-op call
Remoce some archos-specific comments
Change-Id: I4e9ff323490a93add00809efd19e0d4e3f198b2d
open_plugin allows arbitrary plugins to be called
in hotkey and start screen
replaces PictureFlow Integration
shortcuts menu plays plugins now too
rather than store paths and parameters in the settings
that reside in memory instead entries in a file are searched by hash.
after all, the plugin has to be loaded from disk anyways
----------------------------------------------------------------------------
shortcut_viewer.rock-- can now call plugins rather than taking you to them
in the browser
-----------------------------------------------------------------------------
Added a new option to menus:
F_CB_ON_SELECT_ONLY
instead of option callback every time a item is accessed
F_CB_ON_SELECT_ONLY fires callback only when item is selected
-----------------------------------------------------------------------------
Added manual entries
-----------------------------------------------------------------------------
Change-Id: I078b57b1d2b4dd633c89212c1082fcbc1b516e6a
statusbars, gui_syncstatusbar_draw(), and set_time()
mp3_play_data(), mp3_play_pause(), mp3_play_stop()
[mp3_is_playing() is still used by imageviewer]
(followup to the sh/archos exorcism..)
Change-Id: I06a1d981ffc86b8073fcfa2380a393a07347ab3b
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
'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
HAVE_LCD_BITMAP is now redundant.
lcd_bitmap is always-on in features.txt so manual and lang strings
don't have to change
Change-Id: I08eeb20de48099ffc2dc23782711af368c2ec794
On some devices, the button driver allows a "software poweroff" by long-
pressing a certain key. This behavior is inconvnient when that button needs
to be held down for other purposes, such as moving the cursor in rockpaint
or sgt-untangle.
This patch allows selectively disabling the software poweroff (enabled by
default) from both core and plugin code.
Change-Id: I7580752888ae5c7c7c5eb1be5966e3d67f17d4b4
When the starting address of the plugin buffer
is not aligned to 8 bytes crashes occur in tlsf
(on ARM atleast)
Change-Id: I655500c25e1c8f84b4a2418e9ec5c5948e4bea82
Adds:
sound_current(int setting)
returns the current sound setting from global_settings
complements sound_max, sound_min and sound_default
Change-Id: I35bd893753c958f808492906fe533edc51d5d57c
Original patch by Mario Lang
Heavily updated by Igor Poretsky
Further updated by myself
This patch breaks binary API compatibility by placing the new
functions where they make the most logical sense. IMO this is
the better approach to take given the scope of the changes needed
for talk support.
Since binary API is changing, the patch also moves some other
functions around to more logical locations.
As well as voice support in plugins, this patch voice-enables several
simple plugins. There will be follow-up patches for many plugins that
build on this one.
Change-Id: I18070c06e77e8a3c016c2eb6b6c5dbe6633b9b54
One mustn't assume a plugin will only call plugin_get_audio_buffer one
time or that the buffer_size pointer is always non-NULL. At least one
plugin, pacbox, will call it each time it (re)starts audio, with a NULL
param (which is intentional because it only wants to kill audio
playback), and leak away all the RAM because the handle gets clobbered
by further calls and the memory can't be released.
Change-Id: Ic5b94dbc0277c42964ea85b4e9d0302a7c6f1fe4
Either by mistake or because its meaning changed, usb_powered() doesn't mean
what the name suggest, so clarify its meaning by renaming it to usb_powered_only.
So use of usb_powered() are replaced by usb_inserted() when it makes more sense.
Change-Id: I112887e2d8560e84587bee5f55c826dde8c806d8
Reviewed-on: http://gerrit.rockbox.org/1097
Reviewed-by: Amaury Pouly <amaury.pouly@gmail.com>
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>
Forgot to (void) an unused parameter when priorityless.
usb-drv-rl27xx.c was using a compound init to initialize a semaphore
but the structure changed so that it is no longer correct. Use
designated initializers to avoid having to complete all fields.
Forgot to break compatibility on all plugins and codecs since the
kernel objects are now different. Take care of that too and do the
sort thing.
Change-Id: Ie2ab8da152d40be0c69dc573ced8d697d94b0674
With LCD driver all calculation will be performed on RGB888 and the hardware/OS
can display from our 24bit framebuffer.
It is not yet as performance optimized as the existing drivers but should be
good enough.The vast number of small changes is due to the fact that
fb_data can be a struct type now, while most of the code expected a scalar type.
lcd-as-memframe ASM code does not work with 24bit currently so the with 24bit
it enforces the generic C code.
All plugins are ported over. Except for rockpaint. It uses so much memory that
it wouldnt fit into the 512k plugin buffer anymore (patches welcome).
Change-Id: Ibb1964545028ce0d8ff9833ccc3ab66be3ee0754
errno is supposed to be thread local and we do that here in a rather
makeshift way by implementing a function that returns a pointer to
the __errno variable in the thread block.
If more serious TLS is required, perhaps it would be worthwhile
implementing it using the linker and the "__thread" storage attribute.
That's a bit overkill just for this. I'm also not liking what I saw
the compiler producing.
Change-Id: I03bc0bd6a89f6e3d6bae7653284ee01054614f9a
Reviewed-on: http://gerrit.rockbox.org/803
Reviewed-by: Michael Sevakis <jethead71@rockbox.org>
Tested: Michael Sevakis <jethead71@rockbox.org>
Some plugins grab the whole audio buffer and still want to start playback
somehow (e.g. random_folder_advance_config). Since 22e802e the plugin buffer
is allocated via buflib and has to be released explicitely. For these plugins
the automatic free on exit is not sufficient and they need an API function for
that.
Fixes OOM panic on random_folder_advance_config when using start
shuffled playback.
Change-Id: I0d351daa782cb829f4ff80d34c05f40a2e0c142f
Plugins/Applications/main_menu_config allows you to edit the
main menu order without having to manually edit config.cfg.
Press the standard OK button to access the internal menu
which allows you to move items up/down in the order and toggle
their visibility. Exit via this menu to have the order saved.
(Suggestions welcome to improve this UI)
Change-Id: I59715ef1ca265aeb6f9666ef27026bc1093f2579