summaryrefslogtreecommitdiffstats
path: root/apps/recorder
AgeCommit message (Collapse)AuthorFilesLines
2022-05-03add const to const * strings iriver Fix RedWilliam Wilgus1-1/+2
the iriver devices overwrite the pointer Change-Id: I20ae6db2aec0f957824b61db349c7c45a95e58d9
2022-05-03add const to const * stringsWilliam Wilgus2-2/+2
I don't think this will amke any difference except maybe for hosted ports Change-Id: I84f898aea92a6963901a6d889dd18b63f24c9a41
2022-05-02Fix some non-portable alignment valuesAidan MacDonald1-2/+2
UBSan reports an avalanche of unaligned pointer bugs stemming from hardcoded 4-byte alignments used in certain places. Use sizeof(long) instead to align to the machine word size. Change-Id: I28e505212462c5268afa24e95df3a103ac3e2213
2022-04-27keyboard.c change math for editline above pickerWilliam Wilgus1-1/+17
Change-Id: I59e7f7face07f3f97fc6e016ee333cd3139ad5fd
2022-04-16apps: Add ability to do a clean rebootAidan MacDonald1-1/+2
Allow a clean shutdown to end in either power off or reboot. Add a new event SYS_REBOOT to signal it and sys_reboot() to trigger the event. SYS_REBOOT signals a reboot request and should be listened for alongside SYS_POWEROFF events. Change-Id: I99ba7fb5feed2bb5a0a40a274e8466ad74fe3a43
2022-04-09jpeg: provide a rough estimate of decoder memory overheadAidan MacDonald2-0/+18
JPEG decoding requires additional space in the bitmap buffer beyond what is needed for the decoded pixel data. Provide a way to estimate how much overhead is needed. The actual overhead is sizeof(struct jpeg) + decode_buf_size, where the latter depends on the image size and JPEG encoding used. From my testing decode_buf_size is normally pretty small (under 5 KiB) but looking at the code it could be large in some cases, primarily with large images, so 32 KiB seems to be a decent compromise. Someone who knows better about JPEG should pick a better value if that's too big. Using a constant is obviously not the most accurate but it seems to be the simplest option for retrofitting to existing code. Change-Id: I573b0abb8ca2d79e43f185010487f07226edb793
2022-04-08BUGFIX keyboard.c make vp alloc staticWilliam Wilgus1-23/+5
don't stop playback to alloc viewports for the keyboard For the moment it doesn't make much difference each vp takes about 40 bytes (double that in the sim?) so not the end of the world 120 extra bytes Change-Id: I482d7e3061cf9fb8065dc28bf62a6f830770f3c7
2022-04-07keyboard.c Use viewports, move text box posWilliam Wilgus1-27/+156
allows items to be moved around with less code changes remove scrolling I was not overly impressed with it add test_kbd plugin Change-Id: Ic183c7221bda9405891632704f3a7bbfd79bfe83
2022-02-12buflib: add a common dummy callbacks struct & use itAidan MacDonald1-5/+2
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
2022-01-29FiiO M3K: remove volume setting on rec. screenAidan MacDonald1-0/+12
This controls the playback volume, which is not useful for the M3K because it's impossible to play back and record at the same time. Change-Id: I5b0931c22b484f3ff6441d6c88079f18ec70f7f8
2022-01-17recording: fix mono mode mixdown functionsAidan MacDonald1-32/+16
Rewrite copy_buffer_mono_* functions for correctness. Bad pointer arithmetic in copy_buffer_mono_l produced wrong results, or panics on archs which can't handle the unaligned pointer. None of the functions handled zero size copies properly though this probably wasn't an issue in practice. Change-Id: I81c894e1b8a3440cb409092bec07fe3778a78959
2022-01-17recscreen: clean up menu building codeAidan MacDonald1-61/+31
Remove the use of constants and ifdefs in favor of a single enum and build the menu with a counter. This simplifies the source and optimizes to the same code. Change-Id: Ib07f0634ac8f663452c3e6e3c3d92fb6da1a1b4c
2022-01-17Fix some hardcoded assumptions in recording.cAidan MacDonald2-56/+99
There were some hardcoded branches handling left/right gain for line-in or FM radio inputs. If the target only has a microphone, these bits are useless and cause compile errors due to missing audiohw settings, etc. This patch #ifdef's them out. Change-Id: If6a6918b2fabb256261c84651803bbf44deacb1a
2021-11-21touchscreen: force 3x3 mode in the keyboardAidan MacDonald1-0/+11
In absolute pointing mode the keyboard is virtually unusable since the keys are too tiny (just 8x6). There are other issues too: for example putting the keys on top doesn't make sense on touchscreens and there is a lot of empty space in between keys that serves no real purpose. Until these issues can be addressed properly simply force 3x3 mode when in the keyboard. Change-Id: I3ea95ae479372f5b5f86ffcc2dbde10a03663820
2021-11-11Add setting for disabling wrap-around listsChristian Soffke1-2/+30
Allows user to decide whether scrolling lists will wrap around to the opposite end after the first or last item has been reached. Change-Id: I22156812cf4c857ddc4b6c48c1cef013b1985260
2021-08-26Plugin Api add core bitmapsWilliam Wilgus2-0/+32
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-19peakmeter: re-enable on hosted platformsUlrich Hecht1-13/+0
Has been disabled since HW codec support was dropped, but works fine. Tested on Surfans F20. Change-Id: I97f06a009048e8135ca21118467c491e7077fa4f
2021-08-10pcm_record.c iAudioM5 FixRedWilliam Wilgus1-6/+14
Share a bit of code in order to free up iRam for the iAudio M5 Change-Id: Ief05d2614a203df17821ed32b04f5c75a53ca08b
2021-08-10recorder/pcm_record.c cleanup copy functionWilliam Wilgus1-14/+18
re: coverity write_write_order: In long(*s++) + *s++, s is written in *s++ and written in long(*s++) but the order in which the side effects take place is undefined because there is no intervening sequence point. Change-Id: I2911c240f3e85fcfbf77297e8579e02e217c5af5
2021-08-05Simplify clamp_componentAidan MacDonald1-2/+2
Surprise surprise: the compiler generates shorter, branch-free code if we don't try to be clever with signed/unsigned casting tricks. Change-Id: I93d2020b6127e7d43feee394b06a52aaeddf3b79
2021-07-07RFC: Fix a couple more dangling stack-allocated viewportsSolomon Peachy1-2/+4
They could end up getting referenced after the stack has been popped. Change-Id: I12abbf3f436ecfde76a37f2623a044915800d2b2
2021-03-02Remove execute bit from file permissions from recent commitWilliam Wilgus1-0/+0
Change-Id: I415cf235d2b179ae8c58b0427308103be3e00130
2020-12-14Do not resize images greater than 32767 pixels in either dimensionMichael Giacomelli1-0/+9
Internally, the resizing code uses the rockbox dim structure, which uses signed shorts. Change-Id: Ic8850e8563a9d8c0cb3cf8269e2576be9e42b45b
2020-10-26statusbar: Make statusbar height equal SYSFONT_HEIGHTSolomon Peachy2-4/+9
And size elements horizaontally based on SYSFONT_WIDTH Unfortunately we need 16px icons to make 16px statusbar look right but at least it _works_ properly now. Also: all targets currently use 8-px SYSFONT, except some hosted bootloaders Change-Id: I0cdf97e6ef47ec49693ef79667b200595b4fe075
2020-10-26LCD core move buf ptr and address look up function viewport structWilliam Wilgus1-2/+2
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-07-24peakmeter: Fix warning on some hosted targetsSolomon Peachy1-3/+8
Change-Id: Ieae0b08a2f747955ad3e392fbff90884dc4265ef
2020-07-24peakmeter: Fix simulator build breakage introduced in 8cb55546Solomon Peachy1-2/+0
Change-Id: I86c327cf7053e71df7550b6d0673262035f95978
2020-07-24[4/4] Remove HAVE_LCD_BITMAP, as it's now the only choice.Solomon Peachy1-3/+0
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[3/4] Completely remove HWCODEC supportSolomon Peachy6-164/+11
'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[1/4] Remove SH support and all archos targetsSolomon Peachy5-493/+6
This removes all code specific to SH targets Change-Id: I7980523785d2596e65c06430f4638eec74a06061
2020-07-22keyboard add ability to specify temporary custom layoutsWilliam Wilgus1-5/+12
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-04-05jpeg: Fix an overflow when decoding images for non-color targets.Solomon Peachy1-1/+8
(Warning raised by GCC 4.9.4 -Os) Change-Id: I1d2f491c8bdb11fe89ffb119e248ca0f4eb69de2
2019-08-04fix recording.c file split time in seconds not minutesWilliam Wilgus1-1/+1
FS#13173 Change-Id: Icae45bf21c3470e04e7d99355a09d016d204d574
2019-07-09Fix possible truncation albumart.cWilliam Wilgus1-2/+2
Change-Id: Ie0e576f26c0507cc12fbdc12093d6fe924377e1d
2018-12-23Handle SYS_POWEROFF event in recorder and chessbox pluginsSolomon Peachy1-0/+5
Credit to Igor Poretsky Change-Id: I151d3511b9cee269190d87df7fa7dd355aaafc9b
2018-12-22Auto-Ranging Time Formatting For Menus (hh:mm:ss:mss)William Wilgus3-68/+18
Unifies time formatting in settings_list.c allows time format to display as HH:MM:SS.MSS or any consecutive combination thereof (hh:mm:ss, mm:ss, mm:ss.mss, ss.mss, hh, mm, ss ,mss) works in INT and TABLE settings with the addition of flag 'F_TIME_SETTING' Time is auto-ranged dependent on value Adds talk_time_intervals to allow time values to be spoken similar to display format: x Hours, x Minutes, x Seconds, x Milliseconds Table lookups merged or removed from recording, clip meter and lcd timeout -String_Choice replaced with TABLE_SETTING or INT_SETTING for these functions as well, cleaned-up cfg_vals that get saved to cfgfile RTL Languages ARE supported Negative values ARE supported Backlight on/off are now Always and Never to share formatter with LCD Timeout Added flag to allow ranged units to be locked to a minimum index Added flag to allow leading zero to be supressed from the largest unit merged talk_time_unit() and talk_time_intervals() optimized time_split() optimized format_time_auto() Backlight time-out list same as original Change-Id: I59027c62d3f2956bd16fdcc1a48b2ac32c084abd
2018-12-09Fix possible truncation misc.c->output_dyn_value + use KibytesWilliam Wilgus1-1/+1
output_dyn_value now requires the count for number of units Binary scale now shows Kibibytes instead of kilobytes (g#1742) Fixes output for negative values as well Change-Id: I8aa896860e97d2453fa35069e2dfe1caac60109f
2018-12-08Decrease static code size recording.cWilliam Wilgus1-42/+48
Forgot static for recording_step_levels() There is no need to re-calculate split_time or split_bytes each loop you can't change them within recording screen -- these become constants We don't need longs to store the conversion of minutes to seconds or MB to bytes these are now shorts and the conversion takes place within rec_timesplit_seconds() and rec_sizesplit_bytes() respectively Change-Id: Ie1514085e92e00e67eb1942c0f4f8820714587e9
2018-12-08Fix truncation warning recording.c->recording_screenWilliam Wilgus1-36/+37
Limit buf2 to enough characters(16) to display signed int & label consolidate gain/volume settings Change-Id: I9ef6aa1e16ea2a17acc311a9b7e1c0556f58eff7
2018-06-12Agptek Rocker: Initial commitMarcin Bukat1-1/+1
Change-Id: I26b51106c7b1c36a603fba6d521e917d79b5a95b
2017-11-21Undo hacks to meant to get around string formatting limitationsMichael Sevakis1-31/+1
The new vuprintf makes unnecessary workarounds due to formatting limitations. I checked grep output for whatever appeared to fit but it's possible I missed some instances because they weren't so obvious. Also, this means sound settings can dynamically work with any number of decimals rather than the current assumption of one or two. Add an ipow() function to help and take advantage of dynamic field width and precision. Consolidate string formatting of sound settings. Change-Id: I46caf534859dfd1916cd440cd25e5206b192fcd8
2017-02-04Fix dangerous castsAmaury Pouly1-1/+1
On Windows 64-bit, the size of long is 32-bit, thus any pointer to long cast is not valid. In any case, one should use intptr_t and ptrdiff_t when casting to integers. This commit attempts to fix all instances reported by GCC. When relevant, I replaced code by the macros PTR_ADD, ALIGN_UP from system.h Change-Id: I2273b0e8465d3c4689824717ed5afa5ed238a2dc
2017-02-04Implement speaker enable/disable on jack (un)plugAmaury Pouly1-2/+2
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
2016-04-01Fix FS#12981 JPEG decoding problem when entropy data starts with FFBoris Gjenero2-8/+8
This changes JPEG fill and invalid byte handling to be like mozjpeg, and bases entropy data start on SOS marker location. Thanks to Stefan Waldmann and Dean Tersigni for reporting. Change-Id: I3c79cc6ac8d714fdc75c12b57ba427d611c99519 Chaange-Id: Ibc7c17d38d5be63642bdaf6adfd6acc2a6cf4450
2016-01-25Replace SAMSUNG_YH920_PAD with YH92XSebastian Leonhardt1-1/+1
seems more logical to me, and is more consistent, since "SAMSUNG_YH92X_PAD" is already used in the tex files. Change-Id: Ie9a9d850ea86155a7dcf86c88a22a420a10a3837
2014-10-08YH820: Add a forgotten define in aa8ba60.Szymon Dziok1-0/+1
Change-Id: I89a0c21f2ca09f65a4d0b3e06b4b8fed3c07bef6
2014-10-08YH820/YH92X: Properly enable morse input.Szymon Dziok1-1/+3
Change-Id: I6a35d64d0859b7ef429919c260a69974d6fdfafb
2014-08-30Rewrite filesystem code (WIP)Michael Sevakis2-2/+2
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-06-21Fix some build errors and warnings.Thomas Martitz1-4/+0
Change-Id: I149c00fc6ba47d5134ad4f74c364bffd24079824
2014-06-21lcd-24bit: Introduce a 24-bit mid-level LCD driverThomas Martitz2-8/+21
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