Commit graph

43 commits

Author SHA1 Message Date
Christian Soffke
faa2cb9942 plugins: Improve usability of iPod keymaps
- Reduce need to press multiple buttons at
the same time to quit a plugin

- Have "Menu" be default way to quit plugins or
to access plugin menu

- Fall back to (Long) "Select" or Long "Menu"
in cases where Menu button isn't available
(e.g. in ImageViewer and many games)

out of scope:
boomshine, lua_scripts, Rockpaint,
Doom, Duke3D, Pacbox, Quake,
Sgt-Puzzles, Wolf3D, XWorld,
Minesweeper, Pixel Painter, Spacerocks

Change-Id: I6d4dc7174695fe4b8ee9cbaccb21bdbfe6af5c48
2022-12-29 04:39:22 +01:00
Michael Sevakis
286a4c5caa Revise the PCM callback system after adding multichannel audio.
Additional status callback is added to pcm_play/rec_data instead of
using a special function to set it. Status includes DMA error
reporting to the status callback. Playback and recording callback
become more alike except playback uses "const void **addr" (because
the data should not be altered) and recording  uses "void **addr".
"const" is put in place throughout where appropriate.

Most changes are fairly trivial. One that should be checked in
particular because it isn't so much is telechips, if anyone cares to
bother. PP5002 is not so trivial either but that tested as working.

Change-Id: I4928d69b3b3be7fb93e259f81635232df9bd1df2
Reviewed-on: http://gerrit.rockbox.org/166
Reviewed-by: Michael Sevakis <jethead71@rockbox.org>
Tested-by: Michael Sevakis <jethead71@rockbox.org>
2012-03-03 07:23:38 +01:00
Michael Sevakis
e42a3194de AS3525v1/v2:
Fix problems with volume of recorded material by converting 14-bit samples to
16-bit. Remove duplicate samples from recorded data and support proper
samplerate since ADC runs 1/2 the codec clock. Support monitoring mono on both
output channels by feeding data manually to I2SOUT under the right conditions.

DMA is no longer used for recording since frames must be processed as described
above but it does allow full-duplex audio.

Miscellaneous change includes a proper constant (HW_SAMPR_DEFAULT) to reset the
hardware samplerate when recording is closed. PP5024 and AS3525 have different
default recording rates (22kHz and 44kHz respectively) but both have half-speed
ADC.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31180 a1c6a512-1295-4272-9138-f99709370657
2011-12-08 19:20:00 +00:00
Andree Buschmann
f7c4594134 Fix further 'variable set but not used' warnings reported from GCC 4.6.0.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29809 a1c6a512-1295-4272-9138-f99709370657
2011-05-01 13:48:28 +00:00
Thomas Jarosch
f9f89cf5cb RaaA: Fix write locations of plugins
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29506 a1c6a512-1295-4272-9138-f99709370657
2011-03-02 23:43:54 +00:00
Teruaki Kawashima
01313d5039 * Rename backlight_force_on to backlight_ignore_timeout to make it clear what the function does.
* Add backlight_force_on() which forces to turn on backlight even when the setting is set to Off. use this in lamp.
No functional change except lamp.
See aslo FS#9883.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29128 a1c6a512-1295-4272-9138-f99709370657
2011-01-24 12:29:16 +00:00
Alexander Levin
53db95417d pitch_detector: add the key transposition feature which makes the plugin better usable with/for transposing instruments (FS#11752 by Robert Horn)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29052 a1c6a512-1295-4272-9138-f99709370657
2011-01-14 21:41:05 +00:00
Alexander Levin
fd240ab240 pitch_detector: bring the name of the settings file in line with the plugin name
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29031 a1c6a512-1295-4272-9138-f99709370657
2011-01-11 21:29:36 +00:00
Mustapha Senhaji
1c06d83c15 Revert r29004 putting the original comment back (sorry to fml for this :)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29006 a1c6a512-1295-4272-9138-f99709370657
2011-01-08 14:26:16 +00:00
Mustapha Senhaji
958b638def pitch detector: Fix a typo in a comment.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29004 a1c6a512-1295-4272-9138-f99709370657
2011-01-08 00:14:21 +00:00
Alexander Levin
2093bb021f pitch_detector: remove a double 'break'
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28995 a1c6a512-1295-4272-9138-f99709370657
2011-01-07 20:23:35 +00:00
Alexander Levin
41e5933877 pitch_detector: the menu function already returns a bool, so use the return value directly
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28994 a1c6a512-1295-4272-9138-f99709370657
2011-01-07 20:21:37 +00:00
Andree Buschmann
28ecf9b6d1 Use MEM_ALIGN_ATTR in pitch detector plugin.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28636 a1c6a512-1295-4272-9138-f99709370657
2010-11-21 22:02:06 +00:00
Nils Wallménius
53308bf44e Pitch detector: do not break profiling builds.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28283 a1c6a512-1295-4272-9138-f99709370657
2010-10-15 15:01:59 +00:00
Rafaël Carré
0928cdf074 pitch_detector: don't use a struct with only one member
use fixed point type (fixed == int32_t) directly

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28072 a1c6a512-1295-4272-9138-f99709370657
2010-09-14 06:34:01 +00:00
Rafaël Carré
bd737477bf pitch_detector: build with -std=gnu99
casts in const tables declaration seesm to confuse gcc into thinking the
initializers are not constant

Also merge struct declaration and typedef

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28020 a1c6a512-1295-4272-9138-f99709370657
2010-09-07 14:09:16 +00:00
Rafaël Carré
da16248e47 Plugins: modify IRAM copying code
Move to plugin_crt0.c, plugins don't need PLUGIN_IRAM_* macros anymore
IRAM is no longered zeroed before copying (as it is at the same address
than BSS) -> Fix FS#11581
Use cpucache_invalidate() (and not cpucache_flush), needed for self-modifying code on cached IRAM

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27948 a1c6a512-1295-4272-9138-f99709370657
2010-08-30 20:47:53 +00:00
Rafaël Carré
cf2ce17d09 pitch_detector: use lcd_putsxyf(), not lcd_putsf()
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27922 a1c6a512-1295-4272-9138-f99709370657
2010-08-28 21:46:22 +00:00
Rafaël Carré
e78a12bca7 pitch detector: remove more unused functions for sim builds
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27920 a1c6a512-1295-4272-9138-f99709370657
2010-08-28 19:15:07 +00:00
Rafaël Carré
0bdd362ab9 pitch detector: remove unused functions for sim builds
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27919 a1c6a512-1295-4272-9138-f99709370657
2010-08-28 19:07:38 +00:00
Rafaël Carré
e09ebc4213 pitch_detector: cleanup
- cosmetics: remove trailing white space
- mark all functions and variables as static
- merge struct definition and declaration when possible
- rename tuner_settings -> settings (because it's shorter)
- remove unused enums
- don't give pointer to settings struct as argument since there is only
  one struct, same for the settings filename
- fix error cases in settings load:
    reset settings when loading failed
    close file when it hasn't the right size
- inline small load/save functions only used once
- remove unused print_char_xy
- inline print_str and print_int_xy, and use lcd_putsf (added to the
  plugin API)

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27918 a1c6a512-1295-4272-9138-f99709370657
2010-08-28 17:52:31 +00:00
Rafaël Carré
5628096e51 pitch_detector: avoid a division by zero when changing 'lowest frequency' setting
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27917 a1c6a512-1295-4272-9138-f99709370657
2010-08-28 17:52:27 +00:00
Thomas Martitz
cae4ae2c71 Second try: Introduce plugin_crt0.c that every plugin links.
It handles exit() properly, calling the handler also when the plugin returns
normally (also make exit() more standard compliant while at it).
It also holds PLUGIN_HEADER, so that it doesn't need to be in each plugin anymore.

To work better together with callbacks passed to rb->default_event_handler_ex() introduce exit_on_usb() which will call the exit handler before showing the usb screen and exit() after it.
In most cases rb->default_event_handler_ex() was passed a callback which was manually called at all other return points. This can now be done via atexit().

In future plugin_crt0.c could also handle clearing bss, initializing iram and more.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27873 a1c6a512-1295-4272-9138-f99709370657
2010-08-24 14:30:46 +00:00
Thomas Martitz
93cb949372 Revert "Introduce plugin_crt0.c that every plugin links."
Too much errors and no time to fix them now.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27863 a1c6a512-1295-4272-9138-f99709370657
2010-08-23 17:12:26 +00:00
Thomas Martitz
abdc5935be Introduce plugin_crt0.c that every plugin links.
It handles exit() properly, calling the handler also when the plugin returns
normally (also it makes exit() more standard compliant while at it).
It also holds PLUGIN_HEADER, so that it doesn't need to be in each plugin anymore.

To work better together with callbacks passed to rb->default_event_handler_ex introduce exit_on_usb() which will call the exit handler before showing the usb screen and exit() after it.
In most cases it was passed a callback which was manually called at all other return points. This can now be done via atexit().

In future plugin_crt0.c could also handle clearing bss, initializing iram and more.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27862 a1c6a512-1295-4272-9138-f99709370657
2010-08-23 16:56:49 +00:00
Michael Sevakis
b15a523870 e200v1/c200v1: Implement limited samplerate switching. Rates 24kHz and below are being a bear as far as minor crackling at higher amplitude-- leave them out for the time being since no solution is currently evident. 48, 44, 32 (rec rates 24, 22, 16) seem perfectly fine. I'm betting c200 is ok to include because it uses the same setup as e200.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27139 a1c6a512-1295-4272-9138-f99709370657
2010-06-26 10:07:17 +00:00
Michael Sevakis
d56999890f Make PCM->driver interface about as simple as it will get. Registered callback, zero data, alignment and stops are handled entirely inside pcm.c; driver merely calls fixed pcm.c callback. Remove pcm_record_more and do it just like playback; the original reason behind it isn't very practical in general. Everything checks out on supported targets. There wer some compat changes I can't check out on many unsupoorted but if there's a problem it will be a minor oops. Plugins become incompatible due to recording tweak-- full update. Sorted API.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26253 a1c6a512-1295-4272-9138-f99709370657
2010-05-24 16:42:32 +00:00
Thomas Martitz
20e9d56ba5 S#10387 - Rework pluginlib actions
It changes pluginlib actions to contain only a single and simple context (and
other one for remote directional buttons),
consisting of 7(9) buttons: up/down/left/right, select OR short select and long
select, exit and cancel (plus 2 for scrollwheel targets).
This ensures contexts don't clash with other contexts and simplifies them, at
the expense of reduced versatility. However, the versatility made it largely unusable
due to the great number of targets.
This should allow for using pluginlib actions safely for the most simple plugins (e.g. almost all demos).

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26202 a1c6a512-1295-4272-9138-f99709370657
2010-05-20 17:41:28 +00:00
Michael Sevakis
3d1a85695b Give pitch_detector the IRAMming it deserves.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26018 a1c6a512-1295-4272-9138-f99709370657
2010-05-14 12:35:05 +00:00
Michael Sevakis
d665c92652 Cache align the pitch detector audiobuffer where needed. Some other misc. changes to try to make sure everything builds.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26011 a1c6a512-1295-4272-9138-f99709370657
2010-05-14 08:44:07 +00:00
Michael Sevakis
ef0b8caac0 Fix some sim warnings.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26006 a1c6a512-1295-4272-9138-f99709370657
2010-05-14 06:41:40 +00:00
Michael Sevakis
7250405c70 pitch_detector: Use continuous recording, even if the algorithm is too slow for that and record a whole buffer even if the min frequency is higher. Use the minimum samplerate that allows C-4186 to be detected (usually 11.025kHz, which can reduce computational load to 1/16 compared to 44.1kHz). Get rid of 64-bit multiplies when calculating input RMS value. Stop audio playback when entering plugin. Better backlight and CPU frequency handling. audio_sample_type->int16_t. simpler buffer size rounding.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26005 a1c6a512-1295-4272-9138-f99709370657
2010-05-14 06:25:40 +00:00
Rafaël Carré
289b6bdb69 fix pitch_detector: recording will stop itself if the callback returns <0
stopping recording 2 times might have harmful effects

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26002 a1c6a512-1295-4272-9138-f99709370657
2010-05-13 21:32:06 +00:00
Thomas Martitz
c61e89c0ed Make creat() posix compliant API-wise. Shouldn't affect the core as it's wrapped via a static inline.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25843 a1c6a512-1295-4272-9138-f99709370657
2010-05-06 17:35:04 +00:00
Rafaël Carré
4fd9038d35 pitch_detector: fix builds on monochrome targets, remove an unused variable
Add icons for Clip, copied from c200 icons

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25397 a1c6a512-1295-4272-9138-f99709370657
2010-03-29 23:50:07 +00:00
Nils Wallménius
f76b5d5490 Fix division by 0 by clamping freq value a little higher, some minor style and whitespace changes
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23850 a1c6a512-1295-4272-9138-f99709370657
2009-12-05 01:00:47 +00:00
Dave Chapman
0d81702f52 Don't assume AUDIO_SRC_MIC always exists.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22907 a1c6a512-1295-4272-9138-f99709370657
2009-10-04 02:31:27 +00:00
Alexander Levin
72578ef558 Clarify the unit of note frequency
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22760 a1c6a512-1295-4272-9138-f99709370657
2009-09-20 17:10:16 +00:00
Alexander Levin
8163ddeb7e Pitch Detector: group note related data together
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22758 a1c6a512-1295-4272-9138-f99709370657
2009-09-20 17:03:30 +00:00
Alexander Levin
16cb628eb7 Pitch Detector: use special functions for choosing bool values
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22755 a1c6a512-1295-4272-9138-f99709370657
2009-09-20 16:33:24 +00:00
Alexander Levin
46bb567ec4 Pitch Detector: add the possibility to set the reference frequency of A (last part of FS#8768)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22753 a1c6a512-1295-4272-9138-f99709370657
2009-09-20 16:16:32 +00:00
Alexander Levin
c38f6072cc UI improvements for the pitch detector (ongoing work by David Johnston from FS#8768)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22685 a1c6a512-1295-4272-9138-f99709370657
2009-09-12 21:19:17 +00:00
Alexander Levin
af23b06b7c New plugin: pitch detector (FS#8768) by Michael Lechner and David Johnston
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22663 a1c6a512-1295-4272-9138-f99709370657
2009-09-08 16:45:05 +00:00