Commit Graph

596 Commits

Author SHA1 Message Date
Nico 4c679e8ac5 initial work on varvara plugin 2021-10-28 18:21:27 +01:00
William Wilgus 789b2e089e plugin.h change plugin_open() path and parameter to const
it doesn't modify the args..

Change-Id: Ie8e1e36a060231c0137292c770e4f77da3b8203a
2021-10-22 23:17:33 -04:00
William Wilgus b56372bbcb Plugin Api add core bitmaps
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
2021-08-26 12:55:34 +00:00
William Wilgus 24e8fa317e plugins trade talk_value for talk_value_decimal
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
2021-08-19 01:17:29 +00:00
James Buren fc92081080 rockbox: add a crc32 reverse polynomial function
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
2021-06-21 03:37:17 +00:00
Solomon Peachy b912ad5088 plugin: Un-export find_next_frame()
No in-tree users

Change-Id: I898623253e43507e9fb9df965be45568ff33880d
2020-11-12 16:23:27 +00:00
Solomon Peachy 388adff3cc pcm: Further cleanup of unused bits of the PCM ACPI:
* 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
2020-11-12 15:59:09 +00:00
Solomon Peachy 8e5c57a822 plugins: bump api version (missed it in fe2d52c)
Change-Id: Ia6c89ede0bc9b3e2599aee97177f3cce94e70bd2
2020-10-31 14:10:34 +00:00
Solomon Peachy fe2d52cc7d pcm: Get rid of pcm_play_pause() and associated APIs
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
2020-10-31 01:18:27 +00:00
William Wilgus 3237ae4a4f LCD core move buf ptr and address look up function viewport struct
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
2020-10-26 12:28:48 -04:00
Moshe Piekarski 12f3ed1699 make the plugin API frambuffer agnostic
Change-Id: I5abdc231093054c517ff53b9a456997e440e3f6e
2020-10-26 12:28:48 -04:00
James Buren f7e0ce8fb9 h300: expose the firmware functions in the plugin API
Change-Id: Ieff0aa0a4134e347b2ee690d60b25fdac5958a6b
2020-10-26 01:07:14 +00:00
Solomon Peachy 5d40d97585 voice: rename mp3_play_* functions to voice_play_*
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
2020-09-20 14:52:30 +00:00
William Wilgus 3550283442 Add open_plugin to core
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
2020-08-17 10:15:14 -04:00
William Wilgus d553bb1149 root_menu move tag cache init check to pictureflow plugin
let pictureflow decide if the tag cache is ready instead of core

Change-Id: I2ab9b375d773dbbc28ea41fbf7bb6fb361ace8fd
2020-08-16 10:35:57 -04:00
William Wilgus 7824b1dcb5 Plugin Api update with added functions
Change-Id: I3c48c999da240f68f4960d2e137c613b224beb5c
2020-07-24 20:07:45 -04:00
Solomon Peachy 503bb791b0 plugins: Remove six API functions with no users
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
2020-07-24 21:26:15 +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 0c4f89370d [2/4] get rid of HAVE_LCD_CHARCELLS
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
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
Franklin Wei a65a341a00 button: allow disabling software poweroff
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
2020-06-27 13:27:40 -04:00
Frank Gevaerts 859f762814 Move get_codepage_name() back out of #ifdef HAVE_LCD_BITMAP
55eb1c54 accidentally put it there.

Change-Id: I25d1984f7d4a1e6d65d23aafab5eefea4f92322e
2019-07-20 22:06:30 +02:00
Frank Gevaerts 4d2874fd3d Don't have the inclusion of lang_enum.h depend on PLUGIN
This #ifdef apparcntly confuses dependency generation, and since lang_enum.h
just declares an enum, including it unconditionally is harmless.

Change-Id: I8feaff7657080962f1ae6305492075c8a5bca673
2019-07-20 21:32:23 +02:00
William Wilgus 6392e05476 Plugin API
Reorganize Plugin functions in prep for API bump

Stub in sound_current

add sleep_timer

Change-Id: I74b3a433c86bd6cec43a7c45ae0d2db95c97bb60
2019-07-20 04:50:57 -05:00
Solomon Peachy 55eb1c54eb FS#7704 - Talk support for plugins
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
2019-07-20 08:48:35 +02:00
Michael Sevakis 95ec1f7a6f Remove buffering functions from plugin API.
They aren't used by anything. Must bump min API version.

Change-Id: I9851ab255fc779fff13cb778517f554e5dd20e28
2017-12-17 18:43:23 -05:00
Michael Sevakis dfff938dff Get rid of useless playlist probing and fix up some data types.
Playback checked the files' presence before attempting to buffer
the track. Just get rid of that and save an extra open/close call.
It will find out if the path is bad when the metadata fails.

Fix some size_t/off_t conflation. No need to update plugin version
because no plugin actually uses bufopen().

Change-Id: I3db112449dc0b2eeb91c546f308880ac82494fc7
2017-12-17 16:33:50 -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
Amaury Pouly dc127f213c Clarify usb_powered() and fix some code.
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>
2015-01-08 16:45:32 +01: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
Michael Sevakis 528715a672 Fix warnings from 6ed0087
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
2014-08-16 06:00:36 -04:00
Thomas Martitz a1842c04f9 lcd-24bit: Introduce a 24-bit mid-level LCD driver
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
2014-06-21 00:15:53 +02:00
Michael Sevakis 355b5406fa Make errno a thread-local variable.
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>
2014-05-09 23:14:58 +02:00
Thomas Martitz 957613420e plugins: Add plugin_release_audio_buffer().
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
2014-04-09 09:04:10 +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
Jonathan Gordon 4b1221d556 fix red, strtok_r being annoying on sim builds
Change-Id: Ifb884a53d801db9534dd0c5ab5921800e971963e
2014-02-13 22:24:29 +11:00
Jonathan Gordon 6dbfd44b6e main_menu_config: New plugin to configur the main menu order
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
2014-02-13 22:11:23 +11:00
Marcin Bukat 7ab237b025 buflib: Add crc field protecting buflib cookie integrity
This should catch the case of buffer misuse which results
in corrupted cookie of next allocation. The check is performed
on move_block() so it may be a bit late.

There is buflib_check_valid() provided which checks the
integrity of all cookies for given context.
On DEBUG build with --sdl-thread this check is carried out
for core_ctx on every context switch to catch problems earlier.

Change-Id: I999d4576084592394e3dbd3bdf0f32935ff5f601
Reviewed-on: http://gerrit.rockbox.org/711
Reviewed-by: Thomas Martitz <kugel@rockbox.org>
2014-01-16 10:17:39 +01:00
Thomas Martitz 0a0d61e777 Fix remote warnings and charcell reds, and remove minor left-over tuff.
Change-Id: I10987ea9fcad94d502afd4ae4a80ab9022c75d2e
2014-01-12 01:50:21 +01:00
Thomas Martitz 488a1b983e put_line/scrolling: Make the scroll engine inform custom scrollers about start/stop of scrolling.
With the new lcd_putsxy_scroll_func() code can register custom scroll functions
(put_line() makes use of that). In order for the custom scroller to be able
to properly manage its userdata pointer (set via struct scrollinfo::userdata)
the scroll engine must inform the scroller about start and stop of scrolling.

To inform about start the lcd_scroll_* functions now return true when
the line will scroll. To inform about stop the scroll engine calls into the
scroller one last time, with the text set to NULL.

put_line() can use this to release the userdata registered per scrolling line
so that it can be recycled.

This fixes that some scrolling lines became glitchy after some time because
the userdata was recycled too early.

Change-Id: Iff0a6ce2a4f9ae2bada1b8e62f4f5950224942a9
2014-01-12 01:34:06 +01:00
Thomas Martitz 4f5894de52 Bump plugin API and ABI for put_line and struct viewport related changes.
Change-Id: I891e3c612ec0fb27e393561dababfc5ef7eb6e46
2014-01-07 23:02:52 +01:00
Thomas Martitz 775ebe4ff6 lcd-common/scroll_engine: Remove unused functions lcd_puts_scroll_style().
Change-Id: Ia4f943b3738ab6e66b0e3f1507c629b36d7eba94
2014-01-07 14:13:48 +01:00
Thomas Martitz 1e324aac36 lcd-common: Remove unused function lcd_puts_style().
Change-Id: Id2c64c116f79b8e61a7af49b9072b3e884ffb455
2014-01-07 14:13:48 +01:00
Thomas Martitz 5d6974641b Introduce put_line().
This function is a fully-fletched, high-level pixel-based line printer, that
combines functionality of several firmware and list functions. It can
draw spacing, icons and text in a single call, in any order and each multiple
times. It can also apply line decorations at the same time.

It features printf-like semantics by accepting a format string that contain
format tags as well as inline text.

It's accessible directly, but also through the multi-screen api for plugins.

Change-Id: I70f5a77bbf4b0252521f2e47ead377b9d6d29b54
2014-01-07 14:13:17 +01:00
Thomas Martitz 22e802e800 playback,talk: Share audiobuffer via core_alloc_maximum().
This fixes the radioart crash that was the result of buffering.c working
on a freed buffer at the same time as buflib (radioart uses buffering.c for the
images). With this change the buffer is owned by buflib exclusively so this
cannot happen.

As a result, audio_get_buffer() doesn't exist anymore. Callers should call
core_alloc_maximum() directly. This buffer needs to be protected as usual
against movement if necessary (previously it was not protected at all which
cased the radioart crash), To get most of it they can adjust the willingness of
the talk engine to give its buffer away (at the expense of disabling voice
interface) with the new talk_buffer_set_policy() function.

Change-Id: I52123012208d04967876a304451d634e2bef3a33
2013-12-23 12:17:38 +01:00
Thomas Martitz 1fc19042f7 Bump plugin api and sort.
Change-Id: I8b8ab58abbd40726326b8b47bd6bbb07580b5ce4
2013-12-14 23:15:45 +01:00
Thomas Martitz 1c5d0b41ee scroll_engine: Rename scroll_stop* functions to be more consistent with the lcd api.
Change-Id: I8ada10b96bfb628cca0331689e8b936ae47c7e1c
2013-12-14 23:11:30 +01:00