diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2006-11-06 18:07:30 +0000 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2006-11-06 18:07:30 +0000 |
commit | 0f5cb94aa4a334366a746fcbb22f3335ca413265 (patch) | |
tree | 8f89a96628c1810d51ee9816daf78edb8c76fcd4 /apps/metadata.c | |
parent | 0b22795e26ee09de14f6ac23219adeda12f2fd5b (diff) | |
download | rockbox-0f5cb94aa4a334366a746fcbb22f3335ca413265.tar.gz rockbox-0f5cb94aa4a334366a746fcbb22f3335ca413265.zip |
Big Patch adds primarily: Samplerate and format selection to recording for SWCODEC. Supprort for samplerates changing in playback (just goes with the recording part inseparably). Samplerates to all encoders. Encoders can be configured individually on a menu specific to the encoder in the recording menu. File creation is delayed until flush time to reduce spinups when splitting. Misc: statusbar icons for numbers are individual digits to display any number. Audio buffer was rearranged to maximize memory available to recording and properly reinitialized when trashed. ColdFire PCM stuff moved to target tree to avoid a complicated mess when adding samplerate switching. Some needed API changes and to neaten up growing gap between hardware and software codecs.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11452 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/metadata.c')
-rw-r--r-- | apps/metadata.c | 48 |
1 files changed, 14 insertions, 34 deletions
diff --git a/apps/metadata.c b/apps/metadata.c index ee0100ecf7..845536877c 100644 --- a/apps/metadata.c +++ b/apps/metadata.c | |||
@@ -88,36 +88,6 @@ struct apetag_item_header | |||
88 | long flags; | 88 | long flags; |
89 | }; | 89 | }; |
90 | 90 | ||
91 | struct format_list | ||
92 | { | ||
93 | char format; | ||
94 | char extension[5]; | ||
95 | }; | ||
96 | |||
97 | static const struct format_list formats[] = | ||
98 | { | ||
99 | { AFMT_MPA_L1, "mp1" }, | ||
100 | { AFMT_MPA_L2, "mp2" }, | ||
101 | { AFMT_MPA_L2, "mpa" }, | ||
102 | { AFMT_MPA_L3, "mp3" }, | ||
103 | #if CONFIG_CODEC == SWCODEC | ||
104 | { AFMT_OGG_VORBIS, "ogg" }, | ||
105 | { AFMT_PCM_WAV, "wav" }, | ||
106 | { AFMT_FLAC, "flac" }, | ||
107 | { AFMT_MPC, "mpc" }, | ||
108 | { AFMT_A52, "a52" }, | ||
109 | { AFMT_A52, "ac3" }, | ||
110 | { AFMT_WAVPACK, "wv" }, | ||
111 | { AFMT_ALAC, "m4a" }, | ||
112 | { AFMT_AAC, "mp4" }, | ||
113 | { AFMT_SHN, "shn" }, | ||
114 | { AFMT_AIFF, "aif" }, | ||
115 | { AFMT_AIFF, "aiff" }, | ||
116 | { AFMT_SID, "sid" }, | ||
117 | { AFMT_ADX, "adx" }, | ||
118 | #endif | ||
119 | }; | ||
120 | |||
121 | #if CONFIG_CODEC == SWCODEC | 91 | #if CONFIG_CODEC == SWCODEC |
122 | static const unsigned short a52_bitrates[] = | 92 | static const unsigned short a52_bitrates[] = |
123 | { | 93 | { |
@@ -1691,14 +1661,24 @@ unsigned int probe_file_format(const char *filename) | |||
1691 | return AFMT_UNKNOWN; | 1661 | return AFMT_UNKNOWN; |
1692 | } | 1662 | } |
1693 | 1663 | ||
1694 | suffix += 1; | 1664 | /* skip '.' */ |
1665 | suffix++; | ||
1666 | |||
1667 | for (i = 1; i < AFMT_NUM_CODECS; i++) | ||
1668 | { | ||
1669 | /* search extension list for type */ | ||
1670 | const char *ext = audio_formats[i].ext_list; | ||
1695 | 1671 | ||
1696 | for (i = 0; i < sizeof(formats) / sizeof(formats[0]); i++) | 1672 | do |
1697 | { | 1673 | { |
1698 | if (strcasecmp(suffix, formats[i].extension) == 0) | 1674 | if (strcasecmp(suffix, ext) == 0) |
1699 | { | 1675 | { |
1700 | return formats[i].format; | 1676 | return i; |
1677 | } | ||
1678 | |||
1679 | ext += strlen(ext) + 1; | ||
1701 | } | 1680 | } |
1681 | while (*ext != '\0'); | ||
1702 | } | 1682 | } |
1703 | 1683 | ||
1704 | return AFMT_UNKNOWN; | 1684 | return AFMT_UNKNOWN; |