diff options
| author | Barry Wardell <rockbox@barrywardell.net> | 2006-12-18 01:52:21 +0000 |
|---|---|---|
| committer | Barry Wardell <rockbox@barrywardell.net> | 2006-12-18 01:52:21 +0000 |
| commit | df0dc2262ea10f621677c0f97aae1c205e253b87 (patch) | |
| tree | d25085132fe9f0504d221360092537492cedd3b8 /apps | |
| parent | 440353a9aa1159584b977a2852e723ae07bad2a6 (diff) | |
| download | rockbox-df0dc2262ea10f621677c0f97aae1c205e253b87.zip rockbox-df0dc2262ea10f621677c0f97aae1c205e253b87.tar.gz rockbox-df0dc2262ea10f621677c0f97aae1c205e253b87.tar.bz2 rockbox-df0dc2262ea10f621677c0f97aae1c205e253b87.tar.xz | |
FS#6096. Recording on PortalPlayer targets (H10, iPod Video, iPod 4g, iPod Color, iPod Nano).
* Fix failed compile of enc_config.c when HAVE_MPEG2_SAMPR is not defined.
* Fix bug in AIFF encoder header creation on little endian targets.
* Add recording screen keymaps for H10 and iPod.
* Move pcm_playback PP specific code to target tree.
* Add recording code to wmcodec drivers.
* Add pcm_record code.
Some problems still remain:
* Playback doesn't work after recording until Rockbox is restarted.
* Gain control not implemented.
* Only 16-bit/44KHz for now. The hardware should be capable of up to 24-bit/96KHz.
* Line-in recording not tested on H10.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11794 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
| -rw-r--r-- | apps/codecs/aiff_enc.c | 2 | ||||
| -rw-r--r-- | apps/enc_config.c | 4 | ||||
| -rw-r--r-- | apps/keymaps/keymap-h10.c | 10 | ||||
| -rw-r--r-- | apps/keymaps/keymap-ipod.c | 8 | ||||
| -rw-r--r-- | apps/main.c | 3 | ||||
| -rw-r--r-- | apps/settings.c | 21 |
6 files changed, 41 insertions, 7 deletions
diff --git a/apps/codecs/aiff_enc.c b/apps/codecs/aiff_enc.c index aca1951..f1569d2 100644 --- a/apps/codecs/aiff_enc.c +++ b/apps/codecs/aiff_enc.c @@ -59,7 +59,7 @@ struct aiff_header aiff_header = H_TO_BE32(18), /* comm_size */ 0, /* num_channels (*) */ 0, /* num_sample_frames (*) */ - H_TO_BE32(PCM_DEPTH_BITS), /* sample_size */ + H_TO_BE16(PCM_DEPTH_BITS), /* sample_size */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* sample_rate (*) */ { 'S', 'S', 'N', 'D' }, /* ssnd_id */ 0, /* ssnd_size (*) */ diff --git a/apps/enc_config.c b/apps/enc_config.c index 2d2abae..f4ea1cc 100644 --- a/apps/enc_config.c +++ b/apps/enc_config.c @@ -159,9 +159,9 @@ static bool mp3_enc_bitrate(struct encoder_config *cfg) MPEG1_BITR_CAPS | MPEG2_BITR_CAPS, mp3_enc_bitr, MPEG1_BITR_CAPS #ifdef HAVE_MPEG2_SAMPR - | (MPEG2_BITR_CAPS & ~(MP3_BITR_CAP_144 | MP3_BITR_CAP_8)), + | (MPEG2_BITR_CAPS & ~(MP3_BITR_CAP_144 | MP3_BITR_CAP_8)) #endif - rate_list); + , rate_list); int index = round_value_to_list32(cfg->mp3_enc.bitrate, rate_list, n_rates, false); diff --git a/apps/keymaps/keymap-h10.c b/apps/keymaps/keymap-h10.c index 33bcb13..16c8c49 100644 --- a/apps/keymaps/keymap-h10.c +++ b/apps/keymaps/keymap-h10.c @@ -298,6 +298,12 @@ static const struct button_mapping button_context_bmark[] = { LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD), }; /* button_context_bmark */ +const struct button_mapping button_context_recscreen[] = { + { ACTION_REC_PAUSE, BUTTON_PLAY, BUTTON_NONE }, + + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_SETTINGS) +}; /* button_context_recscreen */ + static const struct button_mapping* get_context_mapping_remote( int context ) { context ^= CONTEXT_REMOTE; @@ -325,6 +331,8 @@ static const struct button_mapping* get_context_mapping_remote( int context ) return remote_button_context_quickscreen; case CONTEXT_PITCHSCREEN: return remote_button_context_pitchscreen; + case CONTEXT_RECSCREEN: + return button_context_recscreen; default: return remote_button_context_standard; @@ -374,6 +382,8 @@ const struct button_mapping* get_context_mapping(int context) return button_context_pitchscreen; case CONTEXT_KEYBOARD: return button_context_keyboard; + case CONTEXT_RECSCREEN: + return button_context_recscreen; default: return button_context_standard; diff --git a/apps/keymaps/keymap-ipod.c b/apps/keymaps/keymap-ipod.c index 26189d9..8ca0c56 100644 --- a/apps/keymaps/keymap-ipod.c +++ b/apps/keymaps/keymap-ipod.c @@ -166,6 +166,12 @@ static const struct button_mapping button_context_keyboard[] = { LAST_ITEM_IN_LIST }; /* button_context_keyboard */ +const struct button_mapping button_context_recscreen[] = { + { ACTION_REC_PAUSE, BUTTON_PLAY, BUTTON_NONE }, + + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_SETTINGS) +}; /* button_context_recscreen */ + /* get_context_mapping returns a pointer to one of the above defined arrays depending on the context */ const struct button_mapping* get_context_mapping(int context) { @@ -202,6 +208,8 @@ const struct button_mapping* get_context_mapping(int context) return button_context_pitchscreen; case CONTEXT_KEYBOARD: return button_context_keyboard; + case CONTEXT_RECSCREEN: + return button_context_recscreen; default: return button_context_standard; } diff --git a/apps/main.c b/apps/main.c index abc7740..f9e6054 100644 --- a/apps/main.c +++ b/apps/main.c @@ -78,6 +78,9 @@ #endif #if (CONFIG_CODEC == SWCODEC) && defined(HAVE_RECORDING) && !defined(SIMULATOR) #include "pcm_record.h" +#endif + +#ifdef BUTTON_REC #define SETTINGS_RESET BUTTON_REC #endif diff --git a/apps/settings.c b/apps/settings.c index 91ffc0d..454ba18 100644 --- a/apps/settings.c +++ b/apps/settings.c @@ -100,7 +100,7 @@ const char rec_base_directory[] = REC_BASE_DIR; #include "eq_menu.h" #endif -#define CONFIG_BLOCK_VERSION 56 +#define CONFIG_BLOCK_VERSION 57 #define CONFIG_BLOCK_SIZE 512 #define RTC_BLOCK_SIZE 44 @@ -521,13 +521,26 @@ static const struct bit_entry hd_bits[] = #if CONFIG_CODEC == SWCODEC #ifdef HAVE_UDA1380 {8|SIGNED, S_O(rec_mic_gain), 16 /* 8 dB */, "rec mic gain", NULL }, /* -128...+108 */ -#endif -#ifdef HAVE_TLV320 + {8|SIGNED, S_O(rec_left_gain), 0, "rec left gain", NULL }, /* -128...+96 */ + {8|SIGNED, S_O(rec_right_gain), 0, "rec right gain", NULL }, /* -128...+96 */ +#elif defined(HAVE_TLV320) /* TLV320 only has no mic boost or 20db mic boost */ {1, S_O(rec_mic_gain), 0 /* 0 dB */, "rec mic gain", NULL }, /* 0db or 20db */ -#endif {8|SIGNED, S_O(rec_left_gain), 0, "rec left gain", NULL }, /* -128...+96 */ {8|SIGNED, S_O(rec_right_gain), 0, "rec right gain", NULL }, /* -128...+96 */ +#elif defined(HAVE_WM8975) + {8|SIGNED, S_O(rec_mic_gain), 16 /* 8 dB */, "rec mic gain", NULL }, /* -128...+108 */ + {8|SIGNED, S_O(rec_left_gain), 0, "rec left gain", NULL }, /* -128...+96 */ + {8|SIGNED, S_O(rec_right_gain), 0, "rec right gain", NULL }, /* -128...+96 */ +#elif defined(HAVE_WM8758) + {8|SIGNED, S_O(rec_mic_gain), 16 /* 8 dB */, "rec mic gain", NULL }, /* -128...+108 */ + {8|SIGNED, S_O(rec_left_gain), 0, "rec left gain", NULL }, /* -128...+96 */ + {8|SIGNED, S_O(rec_right_gain), 0, "rec right gain", NULL }, /* -128...+96 */ +#elif defined(HAVE_WM8731) + {8|SIGNED, S_O(rec_mic_gain), 16 /* 8 dB */, "rec mic gain", NULL }, /* -128...+108 */ + {8|SIGNED, S_O(rec_left_gain), 0, "rec left gain", NULL }, /* -128...+96 */ + {8|SIGNED, S_O(rec_right_gain), 0, "rec right gain", NULL }, /* -128...+96 */ +#endif {REC_FREQ_CFG_NUM_BITS, S_O(rec_frequency), REC_FREQ_DEFAULT, "rec frequency", REC_FREQ_CFG_VAL_LIST }, {REC_FORMAT_CFG_NUM_BITS ,S_O(rec_format), REC_FORMAT_DEFAULT, |