Commit graph

143 commits

Author SHA1 Message Date
Solomon Peachy
04cbb3c7e4 misc: Add 'mpga' as a valid file extension
Some podcasts use this, apparently.

Change-Id: I24f372ed760f15e204dba3a99552ad3b6a051515
2022-02-01 13:23:39 -05:00
William Wilgus
cf96a4d386 file tree filetype_list_viewers exit from list before execution
no need to do a callback just to exit the list right after
executing a viewer plugin

Change-Id: I4598ab189bd7d1f350156af75480cbe7103e9e4c
2021-10-21 03:16:54 -04:00
William Wilgus
af573708ed extend filetype_get_plugin() search for viewer by fileext
I noticed the way filetree switch was modified
for the lua (and then) opx and  open plugin viewers
since builtin files are assumed to be handled in the filetree switch
what if instead filetype_get_plugin() could search the available viewers

this could probably be extended further with selectable defaults

Change-Id: I40f74cd698f4b788a0adcbebf32c08a970df29a5
2021-10-21 01:45:47 -04:00
William Wilgus
9878226e4d filetree.c move static and stack allocated buffers around
it makes more sense to make the main buffer static and make the
second (infrequently needed) buffer as stack allocated

Change-Id: Ide7c1a7a312124e47a23ed0ab75a90d7b8be982e
2021-10-20 16:05:21 -04:00
Aidan MacDonald
a59a629514 filetypes: handle missing or empty viewers.config
We want to load builtin filetypes and other config files even if
there is a problem loading viewers.config. A lot of menus expect
the builtin types to be there and don't work if they're missing.

Change-Id: Ie39c8b9ef184fe0d638bacbe18e5f2d22900bd81
2021-08-22 15:24:51 +01:00
William Wilgus
382b52b120 filetypes.c filesize() guard against negative error values
buffer size is copied to an unsigned int for core_alloc

Change-Id: I7b9ccab79554e55b22d39501ccb779036913258a
2021-08-02 22:32:15 -04:00
Christian Soffke
7d78958f9d Reset unknown file color when resetting filetype colors
The unknown file color is handled as a special case and also needs to be reset here

Change-Id: I0446b7f6586c265dee37fef303f8564f22f06dd4
2021-03-02 18:33:19 +00: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
4231c2c83f codecs: Add support for the 'VTX' ZX Spectrum chiptunes format.
This codec requires floating point.

Original author:  Peter Sovietov
Ported to Rockbox:  Roman Skylarov
Further integration and bugfixes:  Solomon Peachy

Change-Id: I781ecd3592dfcdbbc694063334350342534f1d6c
2020-10-09 11:39:25 -04: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
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
928557bb17 AAC bitstream format files support
Files with extension "aac" in ADTS or ADIF format are now playable.

Full credit goes to Igor Poretsky.

Change-Id: I413b34e15e5242fea60d3461966ae0984080f530
2018-12-22 20:12:10 -05:00
Solomon Peachy
4adad0bc1f FS#6323: Speech for ID3 viewer, playlist catalog and playlist viewer
Modified from original ticket, Taken from Igor Poretsky's tree, and
further modified by myself to incorporate feedback.

Change-Id: Ibc2180e52af76890b1448d23f79386fd0f88f709
2018-12-15 18:00:23 +01:00
Boris Gjenero
15fa7f866f Fix color of files with no extension.
Based on all other references, unknown_file.color is a color, not an
index into custom_colors[]. Previously, custom_colors[-1] was returned
for files without an extension, accessing outside array boundaries
and making files without an extension black, which is hard to see.

Change-Id: Ia0883aba929582324b767df7828a36a84c0b36b9
2013-06-05 18:35:09 -04:00
Jonathan Gordon
0c87e02631 And use the unknown file colour if there is no extension
Change-Id: I35e16643fa655b7d1e006ea85be5c351427bca14
2013-01-21 09:38:19 +11:00
Jonathan Gordon
3b6b5130c9 fix yellow
Change-Id: I269c1c3caa57ba3f0368f58da9501fc29be3dc0c
2013-01-21 09:07:04 +11:00
Jonathan Gordon
70595a278a filetree: Support ??? in viewers.config for unsupported filetypes
This will allow the user to set the file colour and icon for all
unknown files in the file browser.

Change-Id: I4e601f9d2ea31ac972d8066252bf80b6c0d22268
2013-01-20 22:44:03 +11:00
Frederik M J Vestre
1b8e3801b2 Initial opus codec support
Synchronised with opus repo on github (https://github.com/freqmod/rockbox-opus)

Status:
* Seeking ported from speex, but fails on some cases (e.g. seek to granule 0)
* ReplayGain parsing needs to be reworked, we do vorbis-style replaygain now.
  http://wiki.xiph.org/OggOpus#Comment_Header explicitly forbids these in
  favour of R128_TRACK_GAIN tag.
* No optimisation yet, source files still nearly identical to opus upstream
* Multi-stream opus files may not be parsed correctly

Change-Id: Ia66f1027dc1d288083e3c57b2816700078376f9a
Reviewed-on: http://gerrit.rockbox.org/300
Reviewed-by: Bertrik Sikken <bertrik@sikken.nl>
Tested-by: Bertrik Sikken <bertrik@sikken.nl>
2012-09-20 20:47:44 +02:00
Bertrik Sikken
d023bf0f5d Fix checks on buflib allocated handles (0 is not a valid handle value)
Change-Id: I8fdc5a59a5062f40a431cd49971390e21631b8ec
2012-06-10 17:15:47 +02:00
Nils Wallménius
a0377bd500 Sprinkle around some static and const.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31153 a1c6a512-1295-4272-9138-f99709370657
2011-12-05 19:23:46 +00:00
Thomas Jarosch
96afbb3778 Fix file descriptor double close():
read_config() also closed the file descriptor.

Credit goes to cppcheck.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30699 a1c6a512-1295-4272-9138-f99709370657
2011-10-02 20:04:44 +00:00
Jonathan Gordon
ccaf55a8ae fix FIX_PTR macro so it actually fixes every pointer (was skipping x == current case)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30577 a1c6a512-1295-4272-9138-f99709370657
2011-09-21 13:32:37 +00:00
Thomas Martitz
5296af838c Buflib: Clarification about invalid handles
* Enhance allocation function comments to better state the return value and what an invalid value is
* Change clients to check for "< 0" instead of "<= 0" or "== 0"
* Return -1 or -2 depending on the exact failure in buflib_alloc_ex.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30469 a1c6a512-1295-4272-9138-f99709370657
2011-09-07 23:16:29 +00:00
Thomas Martitz
baa070cca6 GSoC/Buflib: Enable compaction in buflib.
This enables the ability to allocate (and free) memory dynamically
without fragmentation, through compaction. This means allocations can move
and fragmentation be reduced. Most changes are preparing Rockbox for this,
which many times means adding a move callback which can temporarily disable
movement when the corresponding code is in a critical section.

For now, the audio buffer allocation has a central role, because it's the one
having allocated most. This buffer is able to shrink itself, for which it
needs to stop playback for a very short moment. For this,
audio_buffer_available() returns the size of the audio buffer which can
possibly be used by other allocations because the audio buffer can shrink.

lastfm scrobbling and timestretch can now be toggled at runtime without
requiring a reboot.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30381 a1c6a512-1295-4272-9138-f99709370657
2011-08-30 14:01:45 +00:00
Thomas Martitz
d0b72e2590 GSoC/Buflib: Add buflib memory alocator to the core.
The buflib memory allocator is handle based and can free and
compact, move or resize memory on demand. This allows to effeciently
allocate memory dynamically without an MMU, by avoiding fragmentation
through memory compaction.

This patch adds the buflib library to the core, along with
convinience wrappers to omit the context parameter. Compaction is
not yet enabled, but will be in a later patch. Therefore, this acts as a
replacement for buffer_alloc/buffer_get_buffer() with the benifit of a debug
menu.

See buflib.h for some API documentation.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30380 a1c6a512-1295-4272-9138-f99709370657
2011-08-30 14:01:33 +00:00
Andree Buschmann
acb0917556 Submit initial patch from FS#12176. Adds support for several new game music formats (AY, GBS, HES, KSS, SGC, VGM and VGZ) and replaces the current NSF and NSFE with a new implementation based on a port of the Game Music Emu library 'GME'. This first submit does not cover the full functionality provided by the author's original patch: Coleco-SGV is not supported, some GME-specific m3u-support has been removed and IRAM is not used yet. Further changes are very likely to follow this submit. Thanks to Mauricio Garrido.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30264 a1c6a512-1295-4272-9138-f99709370657
2011-08-07 20:01:04 +00:00
Thomas Martitz
7b374b43b5 Use enum themable_icons in struct file_type and struct filetype (who made those names?).
It's the correct type and should save some memory due to struct padding (on eabi).

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30027 a1c6a512-1295-4272-9138-f99709370657
2011-06-20 19:32:48 +00:00
Thomas Martitz
2c2416094f Get rid of get_user_file_path and do the path handling in wrappers for open() and friends.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28752 a1c6a512-1295-4272-9138-f99709370657
2010-12-06 22:26:31 +00:00
Teruaki Kawashima
194bc8660d Add helper function to get index from file extension.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28684 a1c6a512-1295-4272-9138-f99709370657
2010-11-27 12:57:19 +00:00
Teruaki Kawashima
7d3f8c0921 Create index array to filetypes used in the open with list while loading viewers.config.
Reduced stack usage of filetype_list_viewers().
Additionally, do not allocate buffer twice for same plugin name.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28538 a1c6a512-1295-4272-9138-f99709370657
2010-11-09 14:35:19 +00:00
Thomas Martitz
850efead04 A few post-fixes to the get_user_file_path() commit.
Remove unneeded restriction from set_file that prevented filename settings to
work if they were outside of ROCKBOX_DIR.
Add the get_user_file_path() call to a few further places where it was
forgotten.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27667 a1c6a512-1295-4272-9138-f99709370657
2010-08-02 19:13:22 +00:00
Thomas Martitz
9c0b2479f7 Rockbox as an application: add get_user_file_path().
For RaaA it evaluates user paths at runtime. For everything but codecs/plugins it will give the path under $HOME/.config/rockbox.org if write access is needed or if the file/folder in question exists there (otherwise it gives /usr/local/share/rockbox).
This allows for installing themes under $HOME as well as having config.cfg and other important files there while installing the application (and default themes) under /usr/local.

On the DAPs it's a no-op, returing /.rockbox directly.

Not converted to use get_user_file_path() are plugins themselves, because RaaA doesn't build plugins yet.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27656 a1c6a512-1295-4272-9138-f99709370657
2010-08-01 16:15:27 +00:00
Jonathan Gordon
ec7937b2f8 close the viewers.config file fd
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27014 a1c6a512-1295-4272-9138-f99709370657
2010-06-21 14:24:38 +00:00
Yoshihisa Uchida
0f5c6d47d4 add True Audio (TTA) codec
decoding speed iPod video ~153%
But in some players, the decoding speed is not enough.
(e.g., H180 52.4% (thanks amiconn), H300 55.09% (thanks n1s))

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25994 a1c6a512-1295-4272-9138-f99709370657
2010-05-13 12:40:09 +00:00
Yoshihisa Uchida
f2df42ee91 fix: the problem to which new filetypes cannot be registered.
64 types can be registered more.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25969 a1c6a512-1295-4272-9138-f99709370657
2010-05-12 12:41:31 +00:00
Jonathan Gordon
1bd072c92d FS#10853 - Skin support in the radio screen! Check CustomWPS for the new tags
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25964 a1c6a512-1295-4272-9138-f99709370657
2010-05-12 10:38:00 +00:00
Thomas Martitz
50a6ca39ad Move c/h files implementing/defining standard library stuff into a new libc directory, also standard'ify some parts of the code base (almost entirely #include fixes).
This is to a) to cleanup firmware/common and firmware/include a bit, but also b) for Rockbox as an application which should use the host system's c library and headers, separating makes it easy to exclude our files from the build.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25850 a1c6a512-1295-4272-9138-f99709370657
2010-05-06 21:04:40 +00:00
Yoshihisa Uchida
561cb2c401 Add wave64(.w64) codec (FS#11022)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24959 a1c6a512-1295-4272-9138-f99709370657
2010-02-28 08:48:07 +00:00
Yoshihisa Uchida
8c5eaa35ec Add vox (Dialogic telephony formats) codec add. (FS#11021)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24956 a1c6a512-1295-4272-9138-f99709370657
2010-02-28 08:13:30 +00:00
Yoshihisa Uchida
4e3c807466 Add Sun Audio codec. (FS#10433)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24955 a1c6a512-1295-4272-9138-f99709370657
2010-02-28 07:22:20 +00:00
Yoshihisa Uchida
45e009a364 add SMAF codec (.mmf extension)(FS#10432)
This codec supports only wave data (ADPCM and PCM).
It does not support MIDI, picture, and movie.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24878 a1c6a512-1295-4272-9138-f99709370657
2010-02-24 11:46:29 +00:00
Teruaki Kawashima
c4eea8f11f FS#10535: bmp viewer plugin.
* changed bmp.c so that it loads bitmap larger than LCD correctly.
* removed bmp entry form inbuilt_filetypes in filetypes.c so that bmp files will be opened with bmp viewer when selected in browser.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24754 a1c6a512-1295-4272-9138-f99709370657
2010-02-18 15:10:31 +00:00
Mohamed Tarek
82f05895af Initial support for ATRAC3 streams in wav containers.
Current state :
- Playback and seeking are possible.
- We now support ATRAC3 in any of its possible containers (wav/at3, oma/aa3, and rm/ra).

TODO :
- Fix joint-stereo decoding for ATRAC3 - the decoder currently produces lots of glitches.
- Rename atrac3_oma.c since it works for both oma and wav containers.



git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24689 a1c6a512-1295-4272-9138-f99709370657
2010-02-16 03:34:39 +00:00
Mohamed Tarek
23ac6ffaa1 Add support for Sony OMA file format. Currently only supports ATRAC3 (without DRM), and seeks. Tested on sansa
e200.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24615 a1c6a512-1295-4272-9138-f99709370657
2010-02-12 03:21:37 +00:00
Dominik Wenger
e96d139b4a Enable 12 other 8bit Atari file formats which the asap codec already supports. No metadata available for them.
New formats: .cmc / .cm3 / .cmr / .cms / .dmc / .dlt / .mpd / .mpt / .rmt / .tmc / .tm8 /.tm2

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24529 a1c6a512-1295-4272-9138-f99709370657
2010-02-06 12:49:03 +00:00
Jens Arnold
608aeee435 Several filetypes were added (more or less) recently so the array became full on HWCODEC.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24412 a1c6a512-1295-4272-9138-f99709370657
2010-01-31 13:38:59 +00:00
Jonathan Gordon
e425371e10 Fix FS#10289 - screens showing a list need to check the show_icons setting before setting the callback. the List will now always draw icons if a callback is set (like its always done for voice)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24022 a1c6a512-1295-4272-9138-f99709370657
2009-12-16 08:36:46 +00:00
Maurus Cuelenaere
db8d79db7e Remove unused #define and correct comment.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23391 a1c6a512-1295-4272-9138-f99709370657
2009-10-28 23:31:45 +00:00