summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2020-07-17 00:01:32 -0400
committerSolomon Peachy <pizza@shaftnet.org>2020-07-24 21:20:13 +0000
commit8cb555460ff79e636a7907fb2589e16db98c8600 (patch)
tree930a3878c7641c9ce045b24f0ade1309e36d5806
parent0c4f89370d05056faa789aa9cabcccc4e509fb9f (diff)
downloadrockbox-8cb555460ff79e636a7907fb2589e16db98c8600.tar.gz
rockbox-8cb555460ff79e636a7907fb2589e16db98c8600.zip
[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
-rw-r--r--apps/SOURCES6
-rw-r--r--apps/abrepeat.c46
-rw-r--r--apps/abrepeat.h11
-rw-r--r--apps/action.c2
-rw-r--r--apps/bookmark.c27
-rw-r--r--apps/codecs.c1
-rw-r--r--apps/cuesheet.c6
-rw-r--r--apps/debug_menu.c50
-rw-r--r--apps/features.txt8
-rw-r--r--apps/filetypes.c7
-rw-r--r--apps/gui/list.c9
-rw-r--r--apps/gui/list.h2
-rw-r--r--apps/gui/pitchscreen.c78
-rw-r--r--apps/gui/skin_engine/skin_display.c2
-rw-r--r--apps/gui/skin_engine/skin_tokens.c39
-rw-r--r--apps/gui/splash.c2
-rw-r--r--apps/gui/statusbar.c49
-rw-r--r--apps/gui/wps.c128
-rw-r--r--apps/lang/english.lang51
-rw-r--r--apps/main.c49
-rw-r--r--apps/menu.c2
-rw-r--r--apps/menus/eq_menu.c1
-rw-r--r--apps/menus/menu_common.c5
-rw-r--r--apps/menus/menu_common.h2
-rw-r--r--apps/menus/playback_menu.c27
-rw-r--r--apps/menus/radio_menu.c18
-rw-r--r--apps/menus/recording_menu.c20
-rw-r--r--apps/menus/settings_menu.c10
-rw-r--r--apps/menus/sound_menu.c12
-rw-r--r--apps/misc.c31
-rw-r--r--apps/misc.h4
-rw-r--r--apps/mpeg.c1979
-rw-r--r--apps/mpeg.h28
-rw-r--r--apps/playback.h3
-rw-r--r--apps/playlist.c16
-rw-r--r--apps/playlist.h4
-rw-r--r--apps/plugin.c16
-rw-r--r--apps/plugin.h21
-rw-r--r--apps/plugins/SOURCES18
-rw-r--r--apps/plugins/SOURCES.app_build4
-rw-r--r--apps/plugins/SUBDIRS7
-rw-r--r--apps/plugins/SUBDIRS.app_build5
-rw-r--r--apps/plugins/bitmaps/mono/SOURCES2
-rw-r--r--apps/plugins/bitmaps/native/SOURCES2
-rw-r--r--apps/plugins/chip8.c47
-rw-r--r--apps/plugins/lua/rocklib.c6
-rw-r--r--apps/plugins/metronome.c194
-rw-r--r--apps/plugins/mpegplayer/mpeg_settings.c2
-rw-r--r--apps/plugins/oscilloscope.c8
-rw-r--r--apps/plugins/properties.c6
-rw-r--r--apps/plugins/rockboy/rbsound.c26
-rw-r--r--apps/plugins/splitedit.c1231
-rw-r--r--apps/plugins/starfield.c3
-rw-r--r--apps/plugins/vu_meter.c8
-rw-r--r--apps/plugins/zxbox/spmain.c4
-rw-r--r--apps/plugins/zxbox/zxbox.c4
-rw-r--r--apps/plugins/zxbox/zxconfig.h2
-rw-r--r--apps/radio/radio.c111
-rw-r--r--apps/radio/radio_skin.c5
-rw-r--r--apps/recorder/icons.c8
-rw-r--r--apps/recorder/icons.h7
-rw-r--r--apps/recorder/keyboard.c4
-rw-r--r--apps/recorder/peakmeter.c75
-rw-r--r--apps/recorder/recording.c78
-rw-r--r--apps/recorder/recording.h3
-rw-r--r--apps/screens.c9
-rw-r--r--apps/scrobbler.c2
-rw-r--r--apps/settings.c12
-rw-r--r--apps/settings.h29
-rw-r--r--apps/settings_list.c25
-rw-r--r--apps/tagcache.c4
-rw-r--r--apps/tagtree.c10
-rw-r--r--apps/talk.c105
-rw-r--r--apps/tree.c12
-rw-r--r--docs/MAINTAINERS8
-rw-r--r--docs/PLUGIN_API77
-rw-r--r--firmware/SOURCES7
-rw-r--r--firmware/drivers/audio/sdl.c10
-rw-r--r--firmware/export/audio.h99
-rw-r--r--firmware/export/config.h13
-rw-r--r--firmware/export/config/agptekrocker.h4
-rw-r--r--firmware/export/config/android.h4
-rw-r--r--firmware/export/config/cowond2.h4
-rw-r--r--firmware/export/config/creativezen.h4
-rw-r--r--firmware/export/config/creativezenmozaic.h4
-rw-r--r--firmware/export/config/creativezenv.h4
-rw-r--r--firmware/export/config/creativezenxfi.h4
-rw-r--r--firmware/export/config/creativezenxfi2.h4
-rw-r--r--firmware/export/config/creativezenxfi3.h4
-rw-r--r--firmware/export/config/creativezenxfistyle.h4
-rw-r--r--firmware/export/config/creativezv.h4
-rw-r--r--firmware/export/config/gigabeatfx.h4
-rw-r--r--firmware/export/config/gigabeats.h4
-rw-r--r--firmware/export/config/gogearhdd1630.h4
-rw-r--r--firmware/export/config/gogearhdd6330.h4
-rw-r--r--firmware/export/config/gogearsa9200.h4
-rw-r--r--firmware/export/config/hifietma8.h4
-rw-r--r--firmware/export/config/hifietma8c.h4
-rw-r--r--firmware/export/config/hifietma9.h4
-rw-r--r--firmware/export/config/hifietma9c.h4
-rw-r--r--firmware/export/config/hifimanhm60x.h4
-rw-r--r--firmware/export/config/hifimanhm801.h4
-rw-r--r--firmware/export/config/iaudio7.h4
-rw-r--r--firmware/export/config/iaudiom3.h4
-rw-r--r--firmware/export/config/iaudiom5.h4
-rw-r--r--firmware/export/config/iaudiox5.h4
-rw-r--r--firmware/export/config/ibassodx50.h4
-rw-r--r--firmware/export/config/ibassodx90.h4
-rw-r--r--firmware/export/config/ihifi760.h4
-rw-r--r--firmware/export/config/ihifi770.h4
-rw-r--r--firmware/export/config/ihifi770c.h4
-rw-r--r--firmware/export/config/ihifi800.h4
-rw-r--r--firmware/export/config/ihifi960.h4
-rw-r--r--firmware/export/config/ipod1g2g.h4
-rw-r--r--firmware/export/config/ipod3g.h4
-rw-r--r--firmware/export/config/ipod4g.h4
-rw-r--r--firmware/export/config/ipod6g.h4
-rw-r--r--firmware/export/config/ipodcolor.h4
-rw-r--r--firmware/export/config/ipodmini1g.h4
-rw-r--r--firmware/export/config/ipodmini2g.h4
-rw-r--r--firmware/export/config/ipodnano1g.h4
-rw-r--r--firmware/export/config/ipodnano2g.h4
-rw-r--r--firmware/export/config/ipodvideo.h4
-rw-r--r--firmware/export/config/iriverh10.h4
-rw-r--r--firmware/export/config/iriverh100.h4
-rw-r--r--firmware/export/config/iriverh10_5gb.h4
-rw-r--r--firmware/export/config/iriverh120.h4
-rw-r--r--firmware/export/config/iriverh300.h4
-rw-r--r--firmware/export/config/iriverifp7xx.h4
-rw-r--r--firmware/export/config/logikdax.h4
-rw-r--r--firmware/export/config/lyreproto1.h4
-rw-r--r--firmware/export/config/meizum3.h4
-rw-r--r--firmware/export/config/meizum6sl.h4
-rw-r--r--firmware/export/config/meizum6sp.h4
-rw-r--r--firmware/export/config/mini2440.h4
-rw-r--r--firmware/export/config/mpiohd200.h4
-rw-r--r--firmware/export/config/mpiohd300.h4
-rw-r--r--firmware/export/config/mrobe100.h4
-rw-r--r--firmware/export/config/mrobe500.h4
-rw-r--r--firmware/export/config/nokian8xx.h4
-rw-r--r--firmware/export/config/nokian900.h4
-rw-r--r--firmware/export/config/ondavx747.h4
-rw-r--r--firmware/export/config/ondavx767.h4
-rw-r--r--firmware/export/config/ondavx777.h4
-rw-r--r--firmware/export/config/pandora.h4
-rw-r--r--firmware/export/config/rk27generic.h4
-rw-r--r--firmware/export/config/samsungyh820.h4
-rw-r--r--firmware/export/config/samsungyh920.h4
-rw-r--r--firmware/export/config/samsungyh925.h4
-rw-r--r--firmware/export/config/samsungypr0.h4
-rw-r--r--firmware/export/config/samsungypr1.h4
-rw-r--r--firmware/export/config/samsungyps3.h4
-rw-r--r--firmware/export/config/samsungypz5.h4
-rw-r--r--firmware/export/config/sansac100.h4
-rw-r--r--firmware/export/config/sansac200.h4
-rw-r--r--firmware/export/config/sansac200v2.h4
-rw-r--r--firmware/export/config/sansaclip.h4
-rw-r--r--firmware/export/config/sansaclipplus.h4
-rw-r--r--firmware/export/config/sansaclipv2.h4
-rw-r--r--firmware/export/config/sansaclipzip.h4
-rw-r--r--firmware/export/config/sansaconnect.h4
-rw-r--r--firmware/export/config/sansae200.h4
-rw-r--r--firmware/export/config/sansae200v2.h4
-rw-r--r--firmware/export/config/sansafuze.h4
-rw-r--r--firmware/export/config/sansafuzeplus.h4
-rw-r--r--firmware/export/config/sansafuzev2.h4
-rw-r--r--firmware/export/config/sansam200.h4
-rw-r--r--firmware/export/config/sansam200v4.h4
-rw-r--r--firmware/export/config/sansaview.h4
-rw-r--r--firmware/export/config/sdlapp.h4
-rw-r--r--firmware/export/config/sonynwze360.h4
-rw-r--r--firmware/export/config/sonynwze370.h4
-rw-r--r--firmware/export/config/sonynwzlinux.h4
-rw-r--r--firmware/export/config/tatungtpj1022.h4
-rw-r--r--firmware/export/config/vibe500.h4
-rw-r--r--firmware/export/config/xduoox20.h4
-rw-r--r--firmware/export/config/xduoox3.h4
-rw-r--r--firmware/export/config/xduoox3ii.h4
-rw-r--r--firmware/export/config/zenvisionm30gb.h4
-rw-r--r--firmware/export/config/zenvisionm60gb.h4
-rw-r--r--firmware/export/general.h2
-rw-r--r--firmware/export/mp3_playback.h51
-rw-r--r--firmware/general.c2
-rw-r--r--firmware/kernel/include/thread.h4
-rw-r--r--firmware/powermgmt.c5
-rw-r--r--firmware/target/hosted/maemo/pcm-gstreamer.c4
-rw-r--r--firmware/target/hosted/sdl/pcm-sdl.c3
-rw-r--r--lib/rbcodec/SOURCES2
-rw-r--r--lib/rbcodec/codecs/codecs.h10
-rw-r--r--lib/rbcodec/codecs/lib/SOURCES3
-rw-r--r--lib/rbcodec/metadata/id3tags.c24
-rw-r--r--lib/rbcodec/metadata/metadata.c23
-rw-r--r--lib/rbcodec/metadata/metadata.h19
-rw-r--r--lib/rbcodec/metadata/metadata_parsers.h4
-rw-r--r--lib/rbcodec/metadata/mp3.c4
-rw-r--r--lib/rbcodec/metadata/mp3data.c13
-rw-r--r--lib/rbcodec/rbcodec.make4
-rw-r--r--lib/skin_parser/tag_table.h2
-rw-r--r--manual/configure_rockbox/recording_settings.tex1
-rw-r--r--manual/getting_started/installation.tex8
-rw-r--r--manual/main_menu/recording_screen.tex1
-rw-r--r--manual/plugins/pictureflow.tex5
-rwxr-xr-xtools/buildzip.pl44
-rwxr-xr-xtools/configure135
-rw-r--r--tools/database/SOURCES6
-rw-r--r--tools/database/database.make4
-rw-r--r--uisimulator/common/stubs.c69
207 files changed, 322 insertions, 5594 deletions
diff --git a/apps/SOURCES b/apps/SOURCES
index 6a0b817834..d7cec53506 100644
--- a/apps/SOURCES
+++ b/apps/SOURCES
@@ -19,7 +19,6 @@ menus/plugin_menu.c
19#if CONFIG_TUNER 19#if CONFIG_TUNER
20menus/radio_menu.c 20menus/radio_menu.c
21#endif 21#endif
22#if CONFIG_CODEC == SWCODEC
23#ifdef HAVE_WM8978 22#ifdef HAVE_WM8978
24menus/audiohw_eq_menu.c 23menus/audiohw_eq_menu.c
25#endif 24#endif
@@ -27,9 +26,6 @@ menus/eq_menu.c
27buffering.c 26buffering.c
28voice_thread.c 27voice_thread.c
29rbcodec_helpers.c 28rbcodec_helpers.c
30#else /* !SWCODEC */
31mpeg.c
32#endif
33menus/main_menu.c 29menus/main_menu.c
34menus/playback_menu.c 30menus/playback_menu.c
35menus/playlist_menu.c 31menus/playlist_menu.c
@@ -163,7 +159,6 @@ radio/radioart.c
163#endif 159#endif
164#endif 160#endif
165 161
166#if CONFIG_CODEC == SWCODEC
167#if INPUT_SRC_CAPS != 0 162#if INPUT_SRC_CAPS != 0
168audio_path.c 163audio_path.c
169#endif /* INPUT_SRC_CAPS != 0 */ 164#endif /* INPUT_SRC_CAPS != 0 */
@@ -179,7 +174,6 @@ beep.c
179enc_config.c 174enc_config.c
180recorder/pcm_record.c 175recorder/pcm_record.c
181#endif 176#endif
182#endif
183#ifdef USB_ENABLE_HID 177#ifdef USB_ENABLE_HID
184usb_keymaps.c 178usb_keymaps.c
185#endif 179#endif
diff --git a/apps/abrepeat.c b/apps/abrepeat.c
index 999d9dcf38..19e9450c99 100644
--- a/apps/abrepeat.c
+++ b/apps/abrepeat.c
@@ -39,7 +39,6 @@ static inline bool ab_B_marker_set(void)
39} 39}
40 40
41 41
42#if (CONFIG_CODEC == SWCODEC)
43void ab_end_of_track_report(void) 42void ab_end_of_track_report(void)
44{ 43{
45 if ( ab_A_marker_set() && ! ab_B_marker_set() ) 44 if ( ab_A_marker_set() && ! ab_B_marker_set() )
@@ -47,38 +46,6 @@ void ab_end_of_track_report(void)
47 ab_jump_to_A_marker(); 46 ab_jump_to_A_marker();
48 } 47 }
49} 48}
50#else
51static int ab_audio_event_handler(unsigned short event, unsigned long data)
52{
53 int rc = AUDIO_EVENT_RC_IGNORED;
54 if ( ab_repeat_mode_enabled() )
55 {
56 switch(event)
57 {
58 case AUDIO_EVENT_POS_REPORT:
59 {
60 if ( ! (audio_status() & AUDIO_STATUS_PAUSE) &&
61 ab_reached_B_marker(data) )
62 {
63 ab_jump_to_A_marker();
64 rc = AUDIO_EVENT_RC_HANDLED;
65 }
66 break;
67 }
68 case AUDIO_EVENT_END_OF_TRACK:
69 {
70 if ( ab_A_marker_set() && ! ab_B_marker_set() )
71 {
72 ab_jump_to_A_marker();
73 rc = AUDIO_EVENT_RC_HANDLED;
74 }
75 break;
76 }
77 }
78 }
79 return rc;
80}
81#endif
82 49
83void ab_repeat_init(void) 50void ab_repeat_init(void)
84{ 51{
@@ -86,10 +53,6 @@ void ab_repeat_init(void)
86 if ( ! ab_initialized ) 53 if ( ! ab_initialized )
87 { 54 {
88 ab_initialized = true; 55 ab_initialized = true;
89#if (CONFIG_CODEC != SWCODEC)
90 audio_register_event_handler(ab_audio_event_handler,
91 AUDIO_EVENT_POS_REPORT | AUDIO_EVENT_END_OF_TRACK );
92#endif
93 } 56 }
94} 57}
95 58
@@ -116,16 +79,7 @@ reasonable amount of time for the typical user to react */
116 79
117void ab_jump_to_A_marker(void) 80void ab_jump_to_A_marker(void)
118{ 81{
119#if (CONFIG_CODEC != SWCODEC)
120 bool paused = (audio_status() & AUDIO_STATUS_PAUSE) != 0;
121 if ( ! paused )
122 audio_pause();
123#endif
124 audio_ff_rewind(ab_A_marker); 82 audio_ff_rewind(ab_A_marker);
125#if (CONFIG_CODEC != SWCODEC)
126 if ( ! paused )
127 audio_resume();
128#endif
129} 83}
130 84
131void ab_reset_markers(void) 85void ab_reset_markers(void)
diff --git a/apps/abrepeat.h b/apps/abrepeat.h
index ec0a07c827..f7ee65247c 100644
--- a/apps/abrepeat.h
+++ b/apps/abrepeat.h
@@ -41,9 +41,7 @@ void ab_set_B_marker(unsigned int song_position);
41 * The actual positions are returned via output parameter */ 41 * The actual positions are returned via output parameter */
42bool ab_get_A_marker(unsigned int *song_position); 42bool ab_get_A_marker(unsigned int *song_position);
43bool ab_get_B_marker(unsigned int *song_position); 43bool ab_get_B_marker(unsigned int *song_position);
44#if (CONFIG_CODEC == SWCODEC)
45void ab_end_of_track_report(void); 44void ab_end_of_track_report(void);
46#endif
47 45
48/* These functions really need to be inlined for speed */ 46/* These functions really need to be inlined for speed */
49extern unsigned int ab_A_marker; 47extern unsigned int ab_A_marker;
@@ -59,16 +57,9 @@ static inline bool ab_reached_B_marker(unsigned int song_position)
59/* following is the size of the window in which we'll detect that the B marker 57/* following is the size of the window in which we'll detect that the B marker
60was hit; it must be larger than the frequency (in milliseconds) at which this 58was hit; it must be larger than the frequency (in milliseconds) at which this
61function is called otherwise detection of the B marker will be unreliable */ 59function is called otherwise detection of the B marker will be unreliable */
62#if (CONFIG_CODEC == SWCODEC)
63/* On swcodec, the worst case seems to be 9600kHz with 1024 samples between 60/* On swcodec, the worst case seems to be 9600kHz with 1024 samples between
64 * calls, meaning ~9 calls per second, look within 1/5 of a second */ 61 * calls, meaning ~9 calls per second, look within 1/5 of a second */
65#define B_MARKER_DETECT_WINDOW 200 62#define B_MARKER_DETECT_WINDOW 200
66#else
67/* we assume that this function will be called on each system tick and derive
68the window size from this with a generous margin of error (note: the number
69of ticks per second is given by HZ) */
70#define B_MARKER_DETECT_WINDOW ((1000/HZ)*10)
71#endif
72 if (ab_B_marker != AB_MARKER_NONE) 63 if (ab_B_marker != AB_MARKER_NONE)
73 { 64 {
74 if ( (song_position >= ab_B_marker) 65 if ( (song_position >= ab_B_marker)
@@ -78,7 +69,6 @@ of ticks per second is given by HZ) */
78 return false; 69 return false;
79} 70}
80 71
81#if (CONFIG_CODEC == SWCODEC)
82static inline void ab_position_report(unsigned long position) 72static inline void ab_position_report(unsigned long position)
83{ 73{
84 if (ab_repeat_mode_enabled()) 74 if (ab_repeat_mode_enabled())
@@ -90,7 +80,6 @@ static inline void ab_position_report(unsigned long position)
90 } 80 }
91 } 81 }
92} 82}
93#endif
94 83
95#endif 84#endif
96 85
diff --git a/apps/action.c b/apps/action.c
index f92b84d105..2aee56ee04 100644
--- a/apps/action.c
+++ b/apps/action.c
@@ -832,10 +832,8 @@ static inline int update_action_last(action_last_t *last, action_cur_t *cur)
832 last->data = button_get_data(); 832 last->data = button_get_data();
833 last->tick = current_tick; 833 last->tick = current_tick;
834 834
835#if CONFIG_CODEC == SWCODEC
836 /* Produce keyclick */ 835 /* Produce keyclick */
837 keyclick_click(false, action); 836 keyclick_click(false, action);
838#endif
839 837
840 return action; 838 return action;
841} 839}
diff --git a/apps/bookmark.c b/apps/bookmark.c
index b19841fda0..22dfad6cce 100644
--- a/apps/bookmark.c
+++ b/apps/bookmark.c
@@ -183,13 +183,6 @@ bool bookmark_autobookmark(bool prompt_ok)
183 audio_pause(); /* first pause playback */ 183 audio_pause(); /* first pause playback */
184 update = (global_settings.autoupdatebookmark && bookmark_exists()); 184 update = (global_settings.autoupdatebookmark && bookmark_exists());
185 bookmark = create_bookmark(); 185 bookmark = create_bookmark();
186#if CONFIG_CODEC != SWCODEC
187 /* Workaround for inability to speak when paused: all callers will
188 just do audio_stop() when we return, so we can do it right
189 away. This makes it possible to speak the "Create a Bookmark?"
190 prompt and the "Bookmark Created" splash. */
191 audio_stop();
192#endif
193 186
194 if (update) 187 if (update)
195 return write_bookmark(true, bookmark); 188 return write_bookmark(true, bookmark);
@@ -415,13 +408,13 @@ static char* create_bookmark()
415 snprintf(global_bookmark, sizeof(global_bookmark), 408 snprintf(global_bookmark, sizeof(global_bookmark),
416 /* new optional bookmark token descriptors should be inserted 409 /* new optional bookmark token descriptors should be inserted
417 just before the "%s;%s" in this line... */ 410 just before the "%s;%s" in this line... */
418#if CONFIG_CODEC == SWCODEC && defined(HAVE_PITCHCONTROL) 411#if defined(HAVE_PITCHCONTROL)
419 ">%d;%d;%ld;%d;%ld;%d;%d;%ld;%ld;%s;%s", 412 ">%d;%d;%ld;%d;%ld;%d;%d;%ld;%ld;%s;%s",
420#else 413#else
421 ">%d;%d;%ld;%d;%ld;%d;%d;%s;%s", 414 ">%d;%d;%ld;%d;%ld;%d;%d;%s;%s",
422#endif 415#endif
423 /* ... their flags should go here ... */ 416 /* ... their flags should go here ... */
424#if CONFIG_CODEC == SWCODEC && defined(HAVE_PITCHCONTROL) 417#if defined(HAVE_PITCHCONTROL)
425 BM_PITCH | BM_SPEED, 418 BM_PITCH | BM_SPEED,
426#else 419#else
427 0, 420 0,
@@ -433,7 +426,7 @@ static char* create_bookmark()
433 global_settings.repeat_mode, 426 global_settings.repeat_mode,
434 global_settings.playlist_shuffle, 427 global_settings.playlist_shuffle,
435 /* ...and their values should go here */ 428 /* ...and their values should go here */
436#if CONFIG_CODEC == SWCODEC && defined(HAVE_PITCHCONTROL) 429#if defined(HAVE_PITCHCONTROL)
437 (long)sound_get_pitch(), 430 (long)sound_get_pitch(),
438 (long)dsp_get_timestretch(), 431 (long)dsp_get_timestretch(),
439#endif 432#endif
@@ -950,7 +943,6 @@ static void say_bookmark(const char* bookmark,
950 943
951 talk_number(bookmark_id + 1, false); 944 talk_number(bookmark_id + 1, false);
952 945
953#if CONFIG_CODEC == SWCODEC
954 bool is_dir = (global_temp_buffer[0] 946 bool is_dir = (global_temp_buffer[0]
955 && global_temp_buffer[strlen(global_temp_buffer)-1] == '/'); 947 && global_temp_buffer[strlen(global_temp_buffer)-1] == '/');
956 948
@@ -965,9 +957,6 @@ static void say_bookmark(const char* bookmark,
965 else talk_file_or_spell(NULL, global_temp_buffer, 957 else talk_file_or_spell(NULL, global_temp_buffer,
966 TALK_IDARRAY(LANG_PLAYLIST), true); 958 TALK_IDARRAY(LANG_PLAYLIST), true);
967 } 959 }
968#else
969 (void)show_playlist_name;
970#endif
971 960
972 if(bm.shuffle) 961 if(bm.shuffle)
973 talk_id(LANG_SHUFFLE, true); 962 talk_id(LANG_SHUFFLE, true);
@@ -977,13 +966,11 @@ static void say_bookmark(const char* bookmark,
977 talk_id(LANG_TIME, true); 966 talk_id(LANG_TIME, true);
978 talk_value(bm.resume_time / 1000, UNIT_TIME, true); 967 talk_value(bm.resume_time / 1000, UNIT_TIME, true);
979 968
980#if CONFIG_CODEC == SWCODEC
981 /* Track filename */ 969 /* Track filename */
982 if(!is_dir) 970 if(!is_dir)
983 global_temp_buffer[0] = 0; 971 global_temp_buffer[0] = 0;
984 talk_file_or_spell(global_temp_buffer, global_filename, 972 talk_file_or_spell(global_temp_buffer, global_filename,
985 TALK_IDARRAY(VOICE_FILE), true); 973 TALK_IDARRAY(VOICE_FILE), true);
986#endif
987} 974}
988 975
989/* ----------------------------------------------------------------------- */ 976/* ----------------------------------------------------------------------- */
@@ -992,17 +979,17 @@ static void say_bookmark(const char* bookmark,
992/* ------------------------------------------------------------------------*/ 979/* ------------------------------------------------------------------------*/
993static bool play_bookmark(const char* bookmark) 980static bool play_bookmark(const char* bookmark)
994{ 981{
995#if CONFIG_CODEC == SWCODEC && defined(HAVE_PITCHCONTROL) 982#if defined(HAVE_PITCHCONTROL)
996 /* preset pitch and speed to 100% in case bookmark doesn't have info */ 983 /* preset pitch and speed to 100% in case bookmark doesn't have info */
997 bm.pitch = sound_get_pitch(); 984 bm.pitch = sound_get_pitch();
998 bm.speed = dsp_get_timestretch(); 985 bm.speed = dsp_get_timestretch();
999#endif 986#endif
1000 987
1001 if (parse_bookmark(bookmark, true, true)) 988 if (parse_bookmark(bookmark, true, true))
1002 { 989 {
1003 global_settings.repeat_mode = bm.repeat_mode; 990 global_settings.repeat_mode = bm.repeat_mode;
1004 global_settings.playlist_shuffle = bm.shuffle; 991 global_settings.playlist_shuffle = bm.shuffle;
1005#if CONFIG_CODEC == SWCODEC && defined(HAVE_PITCHCONTROL) 992#if defined(HAVE_PITCHCONTROL)
1006 sound_set_pitch(bm.pitch); 993 sound_set_pitch(bm.pitch);
1007 dsp_set_timestretch(bm.speed); 994 dsp_set_timestretch(bm.speed);
1008#endif 995#endif
@@ -1011,7 +998,7 @@ static bool play_bookmark(const char* bookmark)
1011 return bookmark_play(global_temp_buffer, bm.resume_index, 998 return bookmark_play(global_temp_buffer, bm.resume_index,
1012 bm.resume_time, bm.resume_offset, bm.resume_seed, global_filename); 999 bm.resume_time, bm.resume_offset, bm.resume_seed, global_filename);
1013 } 1000 }
1014 1001
1015 return false; 1002 return false;
1016} 1003}
1017 1004
diff --git a/apps/codecs.c b/apps/codecs.c
index cabc9ba993..4d2dd34ce0 100644
--- a/apps/codecs.c
+++ b/apps/codecs.c
@@ -40,7 +40,6 @@
40#include "lang.h" 40#include "lang.h"
41#include "keyboard.h" 41#include "keyboard.h"
42#include "buffering.h" 42#include "buffering.h"
43#include "mp3_playback.h"
44#include "backlight.h" 43#include "backlight.h"
45#include "storage.h" 44#include "storage.h"
46#include "talk.h" 45#include "talk.h"
diff --git a/apps/cuesheet.c b/apps/cuesheet.c
index 24df4d49da..39152185e5 100644
--- a/apps/cuesheet.c
+++ b/apps/cuesheet.c
@@ -313,14 +313,8 @@ static bool seek(unsigned long pos)
313 } 313 }
314 else 314 else
315 { 315 {
316#if (CONFIG_CODEC == SWCODEC)
317 audio_pre_ff_rewind(); 316 audio_pre_ff_rewind();
318 audio_ff_rewind(pos); 317 audio_ff_rewind(pos);
319#else
320 audio_pause();
321 audio_ff_rewind(pos);
322 audio_resume();
323#endif
324 return true; 318 return true;
325 } 319 }
326} 320}
diff --git a/apps/debug_menu.c b/apps/debug_menu.c
index 8913558e6c..92451f284c 100644
--- a/apps/debug_menu.c
+++ b/apps/debug_menu.c
@@ -37,7 +37,6 @@
37#include "system.h" 37#include "system.h"
38#include "font.h" 38#include "font.h"
39#include "audio.h" 39#include "audio.h"
40#include "mp3_playback.h"
41#include "settings.h" 40#include "settings.h"
42#include "list.h" 41#include "list.h"
43#include "statusbar.h" 42#include "statusbar.h"
@@ -88,14 +87,12 @@
88#endif 87#endif
89#include "logfdisp.h" 88#include "logfdisp.h"
90#include "core_alloc.h" 89#include "core_alloc.h"
91#if CONFIG_CODEC == SWCODEC
92#include "pcmbuf.h" 90#include "pcmbuf.h"
93#include "buffering.h" 91#include "buffering.h"
94#include "playback.h" 92#include "playback.h"
95#if defined(HAVE_SPDIF_OUT) || defined(HAVE_SPDIF_IN) 93#if defined(HAVE_SPDIF_OUT) || defined(HAVE_SPDIF_IN)
96#include "spdif.h" 94#include "spdif.h"
97#endif 95#endif
98#endif
99#ifdef IRIVER_H300_SERIES 96#ifdef IRIVER_H300_SERIES
100#include "pcf50606.h" /* for pcf50606_read */ 97#include "pcf50606.h" /* for pcf50606_read */
101#endif 98#endif
@@ -304,48 +301,6 @@ static bool dbg_cpuinfo(void)
304#endif 301#endif
305 302
306#ifdef HAVE_LCD_BITMAP 303#ifdef HAVE_LCD_BITMAP
307#if CONFIG_CODEC != SWCODEC
308#ifndef SIMULATOR
309static bool dbg_audio_thread(void)
310{
311 struct audio_debug d;
312
313 lcd_setfont(FONT_SYSFIXED);
314
315 while(1)
316 {
317 if (action_userabort(HZ/5))
318 return false;
319
320 audio_get_debugdata(&d);
321
322 lcd_clear_display();
323
324 lcd_putsf(0, 0, "read: %x", d.audiobuf_read);
325 lcd_putsf(0, 1, "write: %x", d.audiobuf_write);
326 lcd_putsf(0, 2, "swap: %x", d.audiobuf_swapwrite);
327 lcd_putsf(0, 3, "playing: %d", d.playing);
328 lcd_putsf(0, 4, "playable: %x", d.playable_space);
329 lcd_putsf(0, 5, "unswapped: %x", d.unswapped_space);
330
331 /* Playable space left */
332 gui_scrollbar_draw(&screens[SCREEN_MAIN],0, 6*8, 112, 4, d.audiobuflen, 0,
333 d.playable_space, HORIZONTAL);
334
335 /* Show the watermark limit */
336 gui_scrollbar_draw(&screens[SCREEN_MAIN],0, 6*8+4, 112, 4, d.audiobuflen, 0,
337 d.low_watermark_level, HORIZONTAL);
338
339 lcd_putsf(0, 7, "wm: %x - %x",
340 d.low_watermark_level, d.lowest_watermark_level);
341
342 lcd_update();
343 }
344 lcd_setfont(FONT_UI);
345 return false;
346}
347#endif /* !SIMULATOR */
348#else /* CONFIG_CODEC == SWCODEC */
349static unsigned int ticks, freq_sum; 304static unsigned int ticks, freq_sum;
350#ifndef CPU_MULTI_FREQUENCY 305#ifndef CPU_MULTI_FREQUENCY
351static unsigned int boost_ticks; 306static unsigned int boost_ticks;
@@ -487,7 +442,6 @@ static bool dbg_buffering_thread(void)
487 442
488 return false; 443 return false;
489} 444}
490#endif /* CONFIG_CODEC */
491#endif /* HAVE_LCD_BITMAP */ 445#endif /* HAVE_LCD_BITMAP */
492 446
493static const char* bf_getname(int selected_item, void *data, 447static const char* bf_getname(int selected_item, void *data,
@@ -2606,11 +2560,7 @@ static const struct {
2606 { "View database info", dbg_tagcache_info }, 2560 { "View database info", dbg_tagcache_info },
2607#endif 2561#endif
2608#ifdef HAVE_LCD_BITMAP 2562#ifdef HAVE_LCD_BITMAP
2609#if CONFIG_CODEC == SWCODEC
2610 { "View buffering thread", dbg_buffering_thread }, 2563 { "View buffering thread", dbg_buffering_thread },
2611#elif !defined(SIMULATOR)
2612 { "View audio thread", dbg_audio_thread },
2613#endif
2614#ifdef PM_DEBUG 2564#ifdef PM_DEBUG
2615 { "pm histogram", peak_meter_histogram}, 2565 { "pm histogram", peak_meter_histogram},
2616#endif /* PM_DEBUG */ 2566#endif /* PM_DEBUG */
diff --git a/apps/features.txt b/apps/features.txt
index 1c942a7fe2..657b799345 100644
--- a/apps/features.txt
+++ b/apps/features.txt
@@ -109,11 +109,7 @@ radio_remote
109 109
110#if defined(HAVE_RECORDING) 110#if defined(HAVE_RECORDING)
111recording 111recording
112#if CONFIG_CODEC == SWCODEC
113recording_swcodec 112recording_swcodec
114#else
115recording_hwcodec
116#endif
117#if defined(HAVE_LINE_IN) 113#if defined(HAVE_LINE_IN)
118recording_linein 114recording_linein
119#endif 115#endif
@@ -151,11 +147,7 @@ spdif_power
151speaker 147speaker
152#endif 148#endif
153 149
154#if CONFIG_CODEC == SWCODEC
155swcodec 150swcodec
156#else
157hwcodec
158#endif
159 151
160#if defined(HAVE_TAGCACHE) 152#if defined(HAVE_TAGCACHE)
161tagcache 153tagcache
diff --git a/apps/filetypes.c b/apps/filetypes.c
index a30f012e53..9abcfec884 100644
--- a/apps/filetypes.c
+++ b/apps/filetypes.c
@@ -41,11 +41,7 @@
41#include "logf.h" 41#include "logf.h"
42 42
43/* max filetypes (plugins & icons stored here) */ 43/* max filetypes (plugins & icons stored here) */
44#if CONFIG_CODEC == SWCODEC
45#define MAX_FILETYPES 192 44#define MAX_FILETYPES 192
46#else
47#define MAX_FILETYPES 128
48#endif
49/* max viewer plugins */ 45/* max viewer plugins */
50#ifdef HAVE_LCD_BITMAP 46#ifdef HAVE_LCD_BITMAP
51#define MAX_VIEWERS 56 47#define MAX_VIEWERS 56
@@ -58,8 +54,6 @@ static const struct filetype inbuilt_filetypes[] = {
58 { "mp3", FILE_ATTR_AUDIO, Icon_Audio, VOICE_EXT_MPA }, 54 { "mp3", FILE_ATTR_AUDIO, Icon_Audio, VOICE_EXT_MPA },
59 { "mp2", FILE_ATTR_AUDIO, Icon_Audio, VOICE_EXT_MPA }, 55 { "mp2", FILE_ATTR_AUDIO, Icon_Audio, VOICE_EXT_MPA },
60 { "mpa", FILE_ATTR_AUDIO, Icon_Audio, VOICE_EXT_MPA }, 56 { "mpa", FILE_ATTR_AUDIO, Icon_Audio, VOICE_EXT_MPA },
61#if CONFIG_CODEC == SWCODEC
62 /* Temporary hack to allow playlist creation */
63 { "mp1", FILE_ATTR_AUDIO, Icon_Audio, VOICE_EXT_MPA }, 57 { "mp1", FILE_ATTR_AUDIO, Icon_Audio, VOICE_EXT_MPA },
64 { "ogg", FILE_ATTR_AUDIO, Icon_Audio, VOICE_EXT_MPA }, 58 { "ogg", FILE_ATTR_AUDIO, Icon_Audio, VOICE_EXT_MPA },
65 { "oga", FILE_ATTR_AUDIO, Icon_Audio, VOICE_EXT_MPA }, 59 { "oga", FILE_ATTR_AUDIO, Icon_Audio, VOICE_EXT_MPA },
@@ -121,7 +115,6 @@ static const struct filetype inbuilt_filetypes[] = {
121 { "vgz", FILE_ATTR_AUDIO, Icon_Audio, VOICE_EXT_MPA }, 115 { "vgz", FILE_ATTR_AUDIO, Icon_Audio, VOICE_EXT_MPA },
122 { "kss", FILE_ATTR_AUDIO, Icon_Audio, VOICE_EXT_MPA }, 116 { "kss", FILE_ATTR_AUDIO, Icon_Audio, VOICE_EXT_MPA },
123 { "aac", FILE_ATTR_AUDIO, Icon_Audio, VOICE_EXT_MPA }, 117 { "aac", FILE_ATTR_AUDIO, Icon_Audio, VOICE_EXT_MPA },
124#endif
125 { "m3u", FILE_ATTR_M3U, Icon_Playlist, LANG_PLAYLIST }, 118 { "m3u", FILE_ATTR_M3U, Icon_Playlist, LANG_PLAYLIST },
126 { "m3u8",FILE_ATTR_M3U, Icon_Playlist, LANG_PLAYLIST }, 119 { "m3u8",FILE_ATTR_M3U, Icon_Playlist, LANG_PLAYLIST },
127 { "cfg", FILE_ATTR_CFG, Icon_Config, VOICE_EXT_CFG }, 120 { "cfg", FILE_ATTR_CFG, Icon_Config, VOICE_EXT_CFG },
diff --git a/apps/gui/list.c b/apps/gui/list.c
index ce444cc9c2..b1120aa794 100644
--- a/apps/gui/list.c
+++ b/apps/gui/list.c
@@ -317,10 +317,6 @@ static void gui_list_put_selection_on_screen(struct gui_synclist * gui_list,
317 317
318static void edge_beep(struct gui_synclist * gui_list, bool wrap) 318static void edge_beep(struct gui_synclist * gui_list, bool wrap)
319{ 319{
320#if CONFIG_CODEC != SWCODEC
321 (void)gui_list;
322 (void)wrap;
323#else
324 if (global_settings.keyclick) 320 if (global_settings.keyclick)
325 { 321 {
326 list_speak_item *cb = gui_list->callback_speak_item; 322 list_speak_item *cb = gui_list->callback_speak_item;
@@ -354,7 +350,6 @@ static void edge_beep(struct gui_synclist * gui_list, bool wrap)
354 talk_force_shutup(); 350 talk_force_shutup();
355 } 351 }
356 } 352 }
357#endif
358} 353}
359 354
360static void _gui_synclist_speak_item(struct gui_synclist *lists) 355static void _gui_synclist_speak_item(struct gui_synclist *lists)
@@ -615,7 +610,6 @@ static void gui_synclist_scroll_left(struct gui_synclist * lists)
615} 610}
616#endif /* HAVE_LCD_BITMAP */ 611#endif /* HAVE_LCD_BITMAP */
617 612
618#if CONFIG_CODEC == SWCODEC
619bool gui_synclist_keyclick_callback(int action, void* data) 613bool gui_synclist_keyclick_callback(int action, void* data)
620{ 614{
621 struct gui_synclist *lists = (struct gui_synclist *)data; 615 struct gui_synclist *lists = (struct gui_synclist *)data;
@@ -633,7 +627,6 @@ bool gui_synclist_keyclick_callback(int action, void* data)
633 627
634 return action != ACTION_NONE; 628 return action != ACTION_NONE;
635} 629}
636#endif
637 630
638/* 631/*
639 * Magic to make sure the list gets updated correctly if the skin does 632 * Magic to make sure the list gets updated correctly if the skin does
@@ -864,9 +857,7 @@ bool list_do_action(int context, int timeout,
864 do_button, and places the action from get_action in *action. */ 857 do_button, and places the action from get_action in *action. */
865{ 858{
866 timeout = list_do_action_timeout(lists, timeout); 859 timeout = list_do_action_timeout(lists, timeout);
867#if CONFIG_CODEC == SWCODEC
868 keyclick_set_callback(gui_synclist_keyclick_callback, lists); 860 keyclick_set_callback(gui_synclist_keyclick_callback, lists);
869#endif
870 *action = get_action(context, timeout); 861 *action = get_action(context, timeout);
871 return gui_synclist_do_button(lists, action, wrap); 862 return gui_synclist_do_button(lists, action, wrap);
872} 863}
diff --git a/apps/gui/list.h b/apps/gui/list.h
index 1be9da496a..9107bf0591 100644
--- a/apps/gui/list.h
+++ b/apps/gui/list.h
@@ -170,9 +170,7 @@ extern void gui_synclist_hide_selection_marker(struct gui_synclist *lists,
170extern bool gui_synclist_item_is_onscreen(struct gui_synclist *lists, 170extern bool gui_synclist_item_is_onscreen(struct gui_synclist *lists,
171 enum screen_type screen, int item); 171 enum screen_type screen, int item);
172 172
173#if CONFIG_CODEC == SWCODEC
174extern bool gui_synclist_keyclick_callback(int action, void* data); 173extern bool gui_synclist_keyclick_callback(int action, void* data);
175#endif
176/* 174/*
177 * Do the action implied by the given button, 175 * Do the action implied by the given button,
178 * returns true if the action was handled. 176 * returns true if the action was handled.
diff --git a/apps/gui/pitchscreen.c b/apps/gui/pitchscreen.c
index bf016fdd5f..0d31193fa6 100644
--- a/apps/gui/pitchscreen.c
+++ b/apps/gui/pitchscreen.c
@@ -38,9 +38,7 @@
38#include "misc.h" 38#include "misc.h"
39#include "pitchscreen.h" 39#include "pitchscreen.h"
40#include "settings.h" 40#include "settings.h"
41#if CONFIG_CODEC == SWCODEC
42#include "tdspeed.h" 41#include "tdspeed.h"
43#endif
44 42
45#define ICON_BORDER 12 /* icons are currently 7x8, so add ~2 pixels */ 43#define ICON_BORDER 12 /* icons are currently 7x8, so add ~2 pixels */
46 /* on both sides when drawing */ 44 /* on both sides when drawing */
@@ -167,13 +165,9 @@ static bool at_limit = false;
167 165
168static void speak_pitch_mode(bool enqueue) 166static void speak_pitch_mode(bool enqueue)
169{ 167{
170#if CONFIG_CODEC == SWCODEC
171 bool timestretch_mode = global_settings.pitch_mode_timestretch && dsp_timestretch_available(); 168 bool timestretch_mode = global_settings.pitch_mode_timestretch && dsp_timestretch_available();
172 if (timestretch_mode) 169 if (timestretch_mode)
173 talk_id(VOICE_PITCH_TIMESTRETCH_MODE, enqueue); 170 talk_id(VOICE_PITCH_TIMESTRETCH_MODE, enqueue);
174#else
175#define timestretch_mode 0
176#endif
177 if (global_settings.pitch_mode_semitone) 171 if (global_settings.pitch_mode_semitone)
178 talk_id(VOICE_PITCH_SEMITONE_MODE, timestretch_mode ? true : enqueue); 172 talk_id(VOICE_PITCH_SEMITONE_MODE, timestretch_mode ? true : enqueue);
179 else 173 else
@@ -238,9 +232,7 @@ static void pitchscreen_draw_icons(struct screen *display,
238static void pitchscreen_draw(struct screen *display, int max_lines, 232static void pitchscreen_draw(struct screen *display, int max_lines,
239 struct viewport pitch_viewports[PITCH_ITEM_COUNT], 233 struct viewport pitch_viewports[PITCH_ITEM_COUNT],
240 int32_t pitch, int32_t semitone 234 int32_t pitch, int32_t semitone
241#if CONFIG_CODEC == SWCODEC
242 ,int32_t speed 235 ,int32_t speed
243#endif
244 ) 236 )
245{ 237{
246 const char* ptr; 238 const char* ptr;
@@ -308,7 +300,6 @@ static void pitchscreen_draw(struct screen *display, int max_lines,
308 /* Middle section upper line - hide for a small screen */ 300 /* Middle section upper line - hide for a small screen */
309 if ((show_lang_pitch = (max_lines >= 3))) 301 if ((show_lang_pitch = (max_lines >= 3)))
310 { 302 {
311#if CONFIG_CODEC == SWCODEC
312 if(global_settings.pitch_mode_timestretch) 303 if(global_settings.pitch_mode_timestretch)
313 { 304 {
314 /* Pitch:XXX.X% */ 305 /* Pitch:XXX.X% */
@@ -330,7 +321,6 @@ static void pitchscreen_draw(struct screen *display, int max_lines,
330 } 321 }
331 } 322 }
332 else 323 else
333#endif
334 { 324 {
335 /* Rate */ 325 /* Rate */
336 snprintf(buf, sizeof(buf), "%s:", str(LANG_PLAYBACK_RATE)); 326 snprintf(buf, sizeof(buf), "%s:", str(LANG_PLAYBACK_RATE));
@@ -344,7 +334,6 @@ static void pitchscreen_draw(struct screen *display, int max_lines,
344 334
345 /* Middle section lower line */ 335 /* Middle section lower line */
346 /* "Speed:XXX%" */ 336 /* "Speed:XXX%" */
347#if CONFIG_CODEC == SWCODEC
348 if(global_settings.pitch_mode_timestretch) 337 if(global_settings.pitch_mode_timestretch)
349 { 338 {
350 snprintf(buf, sizeof(buf), "%s: %ld.%ld%%", str(LANG_SPEED), 339 snprintf(buf, sizeof(buf), "%s: %ld.%ld%%", str(LANG_SPEED),
@@ -352,7 +341,6 @@ static void pitchscreen_draw(struct screen *display, int max_lines,
352 (speed % PITCH_SPEED_PRECISION) / (PITCH_SPEED_PRECISION / 10)); 341 (speed % PITCH_SPEED_PRECISION) / (PITCH_SPEED_PRECISION / 10));
353 } 342 }
354 else 343 else
355#endif
356 { 344 {
357 if(global_settings.pitch_mode_semitone) 345 if(global_settings.pitch_mode_semitone)
358 { 346 {
@@ -396,13 +384,11 @@ static void pitchscreen_draw(struct screen *display, int max_lines,
396 /* Middle section left/right labels */ 384 /* Middle section left/right labels */
397 const char *leftlabel = "-2%"; 385 const char *leftlabel = "-2%";
398 const char *rightlabel = "+2%"; 386 const char *rightlabel = "+2%";
399#if CONFIG_CODEC == SWCODEC
400 if (global_settings.pitch_mode_timestretch) 387 if (global_settings.pitch_mode_timestretch)
401 { 388 {
402 leftlabel = "<<"; 389 leftlabel = "<<";
403 rightlabel = ">>"; 390 rightlabel = ">>";
404 } 391 }
405#endif
406 392
407 /* Only display if they fit */ 393 /* Only display if they fit */
408 display->getstringsize(leftlabel, &w, &h); 394 display->getstringsize(leftlabel, &w, &h);
@@ -423,16 +409,12 @@ static void pitchscreen_draw(struct screen *display, int max_lines,
423} 409}
424 410
425static int32_t pitch_increase(int32_t pitch, int32_t pitch_delta, bool allow_cutoff 411static int32_t pitch_increase(int32_t pitch, int32_t pitch_delta, bool allow_cutoff
426#if CONFIG_CODEC == SWCODEC
427 /* need this to maintain correct pitch/speed caps */ 412 /* need this to maintain correct pitch/speed caps */
428 , int32_t speed 413 , int32_t speed
429#endif
430 ) 414 )
431{ 415{
432 int32_t new_pitch; 416 int32_t new_pitch;
433#if CONFIG_CODEC == SWCODEC
434 int32_t new_stretch; 417 int32_t new_stretch;
435#endif
436 at_limit = false; 418 at_limit = false;
437 419
438 if (pitch_delta < 0) 420 if (pitch_delta < 0)
@@ -480,7 +462,6 @@ static int32_t pitch_increase(int32_t pitch, int32_t pitch_delta, bool allow_cut
480 /* pitch_delta == 0 -> no real change */ 462 /* pitch_delta == 0 -> no real change */
481 return pitch; 463 return pitch;
482 } 464 }
483#if CONFIG_CODEC == SWCODEC
484 if (dsp_timestretch_available()) 465 if (dsp_timestretch_available())
485 { 466 {
486 /* increase the multiple to increase precision of this calculation */ 467 /* increase the multiple to increase precision of this calculation */
@@ -504,7 +485,6 @@ static int32_t pitch_increase(int32_t pitch, int32_t pitch_delta, bool allow_cut
504 at_limit = true; 485 at_limit = true;
505 } 486 }
506 } 487 }
507#endif
508 488
509 sound_set_pitch(new_pitch); 489 sound_set_pitch(new_pitch);
510 490
@@ -579,9 +559,7 @@ static int32_t get_pitch_from_semitone(int32_t semitone)
579static int32_t pitch_increase_semitone(int32_t pitch, 559static int32_t pitch_increase_semitone(int32_t pitch,
580 int32_t current_semitone, 560 int32_t current_semitone,
581 int32_t semitone_delta 561 int32_t semitone_delta
582#if CONFIG_CODEC == SWCODEC
583 , int32_t speed 562 , int32_t speed
584#endif
585 ) 563 )
586{ 564{
587 int32_t new_semitone = current_semitone; 565 int32_t new_semitone = current_semitone;
@@ -613,7 +591,6 @@ static int32_t pitch_increase_semitone(int32_t pitch,
613 591
614 int32_t new_pitch = get_pitch_from_semitone(new_semitone); 592 int32_t new_pitch = get_pitch_from_semitone(new_semitone);
615 593
616#if CONFIG_CODEC == SWCODEC
617 int32_t new_stretch = GET_STRETCH(new_pitch, speed); 594 int32_t new_stretch = GET_STRETCH(new_pitch, speed);
618 595
619 /* clamp the pitch so it doesn't go beyond the stretch limits */ 596 /* clamp the pitch so it doesn't go beyond the stretch limits */
@@ -629,12 +606,9 @@ static int32_t pitch_increase_semitone(int32_t pitch,
629 new_semitone = get_semitone_from_pitch(new_pitch); 606 new_semitone = get_semitone_from_pitch(new_pitch);
630 at_limit = true; 607 at_limit = true;
631 } 608 }
632#endif
633 609
634 pitch_increase(pitch, new_pitch - pitch, false 610 pitch_increase(pitch, new_pitch - pitch, false
635#if CONFIG_CODEC == SWCODEC
636 , speed 611 , speed
637#endif
638 ); 612 );
639 613
640 return new_semitone; 614 return new_semitone;
@@ -765,7 +739,6 @@ int gui_syncpitchscreen_run(void)
765 739
766 push_current_activity(ACTIVITY_PITCHSCREEN); 740 push_current_activity(ACTIVITY_PITCHSCREEN);
767 741
768#if CONFIG_CODEC == SWCODEC
769 int32_t new_speed = 0, new_stretch; 742 int32_t new_speed = 0, new_stretch;
770 743
771 /* the speed variable holds the apparent speed of the playback */ 744 /* the speed variable holds the apparent speed of the playback */
@@ -785,7 +758,6 @@ int gui_syncpitchscreen_run(void)
785 global_settings.pitch_mode_timestretch = false; 758 global_settings.pitch_mode_timestretch = false;
786 settings_save(); 759 settings_save();
787 } 760 }
788#endif
789 761
790 /* Count decimals for speaking */ 762 /* Count decimals for speaking */
791 for (i = PITCH_SPEED_PRECISION; i >= 10; i /= 10) 763 for (i = PITCH_SPEED_PRECISION; i >= 10; i /= 10)
@@ -806,23 +778,17 @@ int gui_syncpitchscreen_run(void)
806 /* also, draw the icons now, it's only needed once */ 778 /* also, draw the icons now, it's only needed once */
807 pitchscreen_draw_icons(&screens[i], &parent[i]); 779 pitchscreen_draw_icons(&screens[i], &parent[i]);
808 } 780 }
809#if CONFIG_CODEC == SWCODEC
810 pcmbuf_set_low_latency(true); 781 pcmbuf_set_low_latency(true);
811#endif
812 782
813 while (!exit) 783 while (!exit)
814 { 784 {
815 FOR_NB_SCREENS(i) 785 FOR_NB_SCREENS(i)
816 pitchscreen_draw(&screens[i], max_lines[i], 786 pitchscreen_draw(&screens[i], max_lines[i],
817 pitch_viewports[i], pitch, semitone 787 pitch_viewports[i], pitch, semitone
818#if CONFIG_CODEC == SWCODEC
819 , speed 788 , speed
820#endif
821 ); 789 );
822 pitch_delta = 0; 790 pitch_delta = 0;
823#if CONFIG_CODEC == SWCODEC
824 new_speed = 0; 791 new_speed = 0;
825#endif
826 792
827 if (global_settings.talk_menu && updated) 793 if (global_settings.talk_menu && updated)
828 { 794 {
@@ -835,29 +801,23 @@ int gui_syncpitchscreen_run(void)
835 else 801 else
836 talk_value_decimal(pitch, UNIT_PERCENT, decimals, false); 802 talk_value_decimal(pitch, UNIT_PERCENT, decimals, false);
837 break; 803 break;
838#if CONFIG_CODEC == SWCODEC
839 case 2: 804 case 2:
840 talk_value_decimal(speed, UNIT_PERCENT, decimals, false); 805 talk_value_decimal(speed, UNIT_PERCENT, decimals, false);
841 break; 806 break;
842#endif
843 case 3: 807 case 3:
844 speak_pitch_mode(false); 808 speak_pitch_mode(false);
845 break; 809 break;
846 case 4: 810 case 4:
847#if CONFIG_CODEC == SWCODEC
848 if (global_settings.pitch_mode_timestretch && dsp_timestretch_available()) 811 if (global_settings.pitch_mode_timestretch && dsp_timestretch_available())
849 talk_id(LANG_PITCH, false); 812 talk_id(LANG_PITCH, false);
850 else 813 else
851#endif
852 talk_id(LANG_PLAYBACK_RATE, false); 814 talk_id(LANG_PLAYBACK_RATE, false);
853 talk_value_decimal(pitch, UNIT_PERCENT, decimals, true); 815 talk_value_decimal(pitch, UNIT_PERCENT, decimals, true);
854#if CONFIG_CODEC == SWCODEC
855 if (global_settings.pitch_mode_timestretch && dsp_timestretch_available()) 816 if (global_settings.pitch_mode_timestretch && dsp_timestretch_available())
856 { 817 {
857 talk_id(LANG_SPEED, true); 818 talk_id(LANG_SPEED, true);
858 talk_value_decimal(speed, UNIT_PERCENT, decimals, true); 819 talk_value_decimal(speed, UNIT_PERCENT, decimals, true);
859 } 820 }
860#endif
861 speak_pitch_mode(true); 821 speak_pitch_mode(true);
862 break; 822 break;
863 default: 823 default:
@@ -910,24 +870,17 @@ int gui_syncpitchscreen_run(void)
910 break; 870 break;
911 871
912 case ACTION_PS_NUDGE_RIGHT: 872 case ACTION_PS_NUDGE_RIGHT:
913#if CONFIG_CODEC == SWCODEC
914 if (!global_settings.pitch_mode_timestretch) 873 if (!global_settings.pitch_mode_timestretch)
915 { 874 {
916#endif
917 new_pitch = pitch_increase(pitch, PITCH_NUDGE_DELTA, false 875 new_pitch = pitch_increase(pitch, PITCH_NUDGE_DELTA, false
918#if CONFIG_CODEC == SWCODEC
919 , speed 876 , speed
920#endif
921 ); 877 );
922 nudged = (new_pitch != pitch); 878 nudged = (new_pitch != pitch);
923 pitch = new_pitch; 879 pitch = new_pitch;
924 semitone = get_semitone_from_pitch(pitch); 880 semitone = get_semitone_from_pitch(pitch);
925#if CONFIG_CODEC == SWCODEC
926 speed = pitch; 881 speed = pitch;
927#endif
928 updated = nudged ? 1 : 0; 882 updated = nudged ? 1 : 0;
929 break; 883 break;
930#if CONFIG_CODEC == SWCODEC
931 } 884 }
932 else 885 else
933 { 886 {
@@ -948,19 +901,14 @@ int gui_syncpitchscreen_run(void)
948 updated = 2; 901 updated = 2;
949 } 902 }
950 break; 903 break;
951#endif
952 904
953 case ACTION_PS_NUDGE_RIGHTOFF: 905 case ACTION_PS_NUDGE_RIGHTOFF:
954 if (nudged) 906 if (nudged)
955 { 907 {
956 pitch = pitch_increase(pitch, -PITCH_NUDGE_DELTA, false 908 pitch = pitch_increase(pitch, -PITCH_NUDGE_DELTA, false
957#if CONFIG_CODEC == SWCODEC
958 , speed 909 , speed
959#endif
960 ); 910 );
961#if CONFIG_CODEC == SWCODEC
962 speed = pitch; 911 speed = pitch;
963#endif
964 semitone = get_semitone_from_pitch(pitch); 912 semitone = get_semitone_from_pitch(pitch);
965 nudged = false; 913 nudged = false;
966 updated = 1; 914 updated = 1;
@@ -968,24 +916,17 @@ int gui_syncpitchscreen_run(void)
968 break; 916 break;
969 917
970 case ACTION_PS_NUDGE_LEFT: 918 case ACTION_PS_NUDGE_LEFT:
971#if CONFIG_CODEC == SWCODEC
972 if (!global_settings.pitch_mode_timestretch) 919 if (!global_settings.pitch_mode_timestretch)
973 { 920 {
974#endif
975 new_pitch = pitch_increase(pitch, -PITCH_NUDGE_DELTA, false 921 new_pitch = pitch_increase(pitch, -PITCH_NUDGE_DELTA, false
976#if CONFIG_CODEC == SWCODEC
977 , speed 922 , speed
978#endif
979 ); 923 );
980 nudged = (new_pitch != pitch); 924 nudged = (new_pitch != pitch);
981 pitch = new_pitch; 925 pitch = new_pitch;
982 semitone = get_semitone_from_pitch(pitch); 926 semitone = get_semitone_from_pitch(pitch);
983#if CONFIG_CODEC == SWCODEC
984 speed = pitch; 927 speed = pitch;
985#endif
986 updated = nudged ? 1 : 0; 928 updated = nudged ? 1 : 0;
987 break; 929 break;
988#if CONFIG_CODEC == SWCODEC
989 } 930 }
990 else 931 else
991 { 932 {
@@ -1006,19 +947,14 @@ int gui_syncpitchscreen_run(void)
1006 updated = 2; 947 updated = 2;
1007 } 948 }
1008 break; 949 break;
1009#endif
1010 950
1011 case ACTION_PS_NUDGE_LEFTOFF: 951 case ACTION_PS_NUDGE_LEFTOFF:
1012 if (nudged) 952 if (nudged)
1013 { 953 {
1014 pitch = pitch_increase(pitch, PITCH_NUDGE_DELTA, false 954 pitch = pitch_increase(pitch, PITCH_NUDGE_DELTA, false
1015#if CONFIG_CODEC == SWCODEC
1016 , speed 955 , speed
1017#endif
1018 ); 956 );
1019#if CONFIG_CODEC == SWCODEC
1020 speed = pitch; 957 speed = pitch;
1021#endif
1022 semitone = get_semitone_from_pitch(pitch); 958 semitone = get_semitone_from_pitch(pitch);
1023 nudged = false; 959 nudged = false;
1024 updated = 1; 960 updated = 1;
@@ -1028,21 +964,18 @@ int gui_syncpitchscreen_run(void)
1028 case ACTION_PS_RESET: 964 case ACTION_PS_RESET:
1029 pitch = PITCH_SPEED_100; 965 pitch = PITCH_SPEED_100;
1030 sound_set_pitch(pitch); 966 sound_set_pitch(pitch);
1031#if CONFIG_CODEC == SWCODEC
1032 speed = PITCH_SPEED_100; 967 speed = PITCH_SPEED_100;
1033 if (dsp_timestretch_available()) 968 if (dsp_timestretch_available())
1034 { 969 {
1035 dsp_set_timestretch(PITCH_SPEED_100); 970 dsp_set_timestretch(PITCH_SPEED_100);
1036 at_limit = false; 971 at_limit = false;
1037 } 972 }
1038#endif
1039 semitone = get_semitone_from_pitch(pitch); 973 semitone = get_semitone_from_pitch(pitch);
1040 updated = 4; 974 updated = 4;
1041 break; 975 break;
1042 976
1043 case ACTION_PS_TOGGLE_MODE: 977 case ACTION_PS_TOGGLE_MODE:
1044 global_settings.pitch_mode_semitone = !global_settings.pitch_mode_semitone; 978 global_settings.pitch_mode_semitone = !global_settings.pitch_mode_semitone;
1045#if CONFIG_CODEC == SWCODEC
1046 979
1047 if (dsp_timestretch_available() && !global_settings.pitch_mode_semitone) 980 if (dsp_timestretch_available() && !global_settings.pitch_mode_semitone)
1048 { 981 {
@@ -1055,7 +988,6 @@ int gui_syncpitchscreen_run(void)
1055 } 988 }
1056 } 989 }
1057 settings_save(); 990 settings_save();
1058#endif
1059 updated = 3; 991 updated = 3;
1060 break; 992 break;
1061 993
@@ -1073,22 +1005,17 @@ int gui_syncpitchscreen_run(void)
1073 if (global_settings.pitch_mode_semitone) 1005 if (global_settings.pitch_mode_semitone)
1074 { 1006 {
1075 semitone = pitch_increase_semitone(pitch, semitone, pitch_delta 1007 semitone = pitch_increase_semitone(pitch, semitone, pitch_delta
1076#if CONFIG_CODEC == SWCODEC
1077 , speed 1008 , speed
1078#endif
1079 ); 1009 );
1080 pitch = get_pitch_from_semitone(semitone); 1010 pitch = get_pitch_from_semitone(semitone);
1081 } 1011 }
1082 else 1012 else
1083 { 1013 {
1084 pitch = pitch_increase(pitch, pitch_delta, true 1014 pitch = pitch_increase(pitch, pitch_delta, true
1085#if CONFIG_CODEC == SWCODEC
1086 , speed 1015 , speed
1087#endif
1088 ); 1016 );
1089 semitone = get_semitone_from_pitch(pitch); 1017 semitone = get_semitone_from_pitch(pitch);
1090 } 1018 }
1091#if CONFIG_CODEC == SWCODEC
1092 if (global_settings.pitch_mode_timestretch) 1019 if (global_settings.pitch_mode_timestretch)
1093 { 1020 {
1094 /* do this to make sure we properly obey the stretch limits */ 1021 /* do this to make sure we properly obey the stretch limits */
@@ -1098,10 +1025,8 @@ int gui_syncpitchscreen_run(void)
1098 { 1025 {
1099 speed = pitch; 1026 speed = pitch;
1100 } 1027 }
1101#endif
1102 } 1028 }
1103 1029
1104#if CONFIG_CODEC == SWCODEC
1105 if(new_speed) 1030 if(new_speed)
1106 { 1031 {
1107 new_stretch = GET_STRETCH(pitch, new_speed); 1032 new_stretch = GET_STRETCH(pitch, new_speed);
@@ -1135,11 +1060,8 @@ int gui_syncpitchscreen_run(void)
1135 /* when needed */ 1060 /* when needed */
1136 new_speed = 0; 1061 new_speed = 0;
1137 } 1062 }
1138#endif
1139 } 1063 }
1140#if CONFIG_CODEC == SWCODEC
1141 pcmbuf_set_low_latency(false); 1064 pcmbuf_set_low_latency(false);
1142#endif
1143 pop_current_activity(); 1065 pop_current_activity();
1144 return 0; 1066 return 0;
1145} 1067}
diff --git a/apps/gui/skin_engine/skin_display.c b/apps/gui/skin_engine/skin_display.c
index 7ee349b346..345d74b65c 100644
--- a/apps/gui/skin_engine/skin_display.c
+++ b/apps/gui/skin_engine/skin_display.c
@@ -57,9 +57,7 @@
57#endif 57#endif
58 58
59#include "cuesheet.h" 59#include "cuesheet.h"
60#if CONFIG_CODEC == SWCODEC
61#include "playback.h" 60#include "playback.h"
62#endif
63#include "backdrop.h" 61#include "backdrop.h"
64#include "viewport.h" 62#include "viewport.h"
65#if CONFIG_TUNER 63#if CONFIG_TUNER
diff --git a/apps/gui/skin_engine/skin_tokens.c b/apps/gui/skin_engine/skin_tokens.c
index 50704fd66e..2528a0af55 100644
--- a/apps/gui/skin_engine/skin_tokens.c
+++ b/apps/gui/skin_engine/skin_tokens.c
@@ -47,10 +47,8 @@
47#include "albumart.h" 47#include "albumart.h"
48#endif 48#endif
49#include "playlist.h" 49#include "playlist.h"
50#if CONFIG_CODEC == SWCODEC
51#include "playback.h" 50#include "playback.h"
52#include "tdspeed.h" 51#include "tdspeed.h"
53#endif
54#include "viewport.h" 52#include "viewport.h"
55#include "tagcache.h" 53#include "tagcache.h"
56 54
@@ -558,18 +556,16 @@ static struct mp3entry* get_mp3entry_from_offset(int offset, char **filename)
558 static char filename_buf[MAX_PATH + 1]; 556 static char filename_buf[MAX_PATH + 1];
559 fname = playlist_peek(offset, filename_buf, sizeof(filename_buf)); 557 fname = playlist_peek(offset, filename_buf, sizeof(filename_buf));
560 *filename = (char*)fname; 558 *filename = (char*)fname;
561#if CONFIG_CODEC == SWCODEC
562 static struct mp3entry tempid3; 559 static struct mp3entry tempid3;
563 if ( 560 if (
564#if defined(HAVE_TC_RAMCACHE) && defined(HAVE_DIRCACHE) 561#if defined(HAVE_TC_RAMCACHE) && defined(HAVE_DIRCACHE)
565 tagcache_fill_tags(&tempid3, fname) || 562 tagcache_fill_tags(&tempid3, fname) ||
566#endif 563#endif
567 audio_peek_track(&tempid3, offset) 564 audio_peek_track(&tempid3, offset)
568 ) 565 )
569 { 566 {
570 pid3 = &tempid3; 567 pid3 = &tempid3;
571 } 568 }
572#endif
573 } 569 }
574 return pid3; 570 return pid3;
575} 571}
@@ -1224,7 +1220,6 @@ const char *get_token_value(struct gui_wps *gwps,
1224 } 1220 }
1225#endif 1221#endif
1226 1222
1227#if (CONFIG_CODEC == SWCODEC)
1228 case SKIN_TOKEN_CROSSFADE: 1223 case SKIN_TOKEN_CROSSFADE:
1229#ifdef HAVE_CROSSFADE 1224#ifdef HAVE_CROSSFADE
1230 if (intval) 1225 if (intval)
@@ -1277,7 +1272,6 @@ const char *get_token_value(struct gui_wps *gwps,
1277 } 1272 }
1278 return buf; 1273 return buf;
1279 } 1274 }
1280#endif /* (CONFIG_CODEC == SWCODEC) */
1281 1275
1282#if defined (HAVE_PITCHCONTROL) 1276#if defined (HAVE_PITCHCONTROL)
1283 case SKIN_TOKEN_SOUND_PITCH: 1277 case SKIN_TOKEN_SOUND_PITCH:
@@ -1294,7 +1288,7 @@ const char *get_token_value(struct gui_wps *gwps,
1294 } 1288 }
1295#endif 1289#endif
1296 1290
1297#if (CONFIG_CODEC == SWCODEC) && defined (HAVE_PITCHCONTROL) 1291#if defined (HAVE_PITCHCONTROL)
1298 case SKIN_TOKEN_SOUND_SPEED: 1292 case SKIN_TOKEN_SOUND_SPEED:
1299 { 1293 {
1300 int32_t pitch = sound_get_pitch(); 1294 int32_t pitch = sound_get_pitch();
@@ -1462,7 +1456,6 @@ const char *get_token_value(struct gui_wps *gwps,
1462 return NULL; 1456 return NULL;
1463 case SKIN_TOKEN_REC_FREQ: /* order from REC_FREQ_CFG_VAL_LIST */ 1457 case SKIN_TOKEN_REC_FREQ: /* order from REC_FREQ_CFG_VAL_LIST */
1464 { 1458 {
1465#if CONFIG_CODEC == SWCODEC
1466 unsigned long samprk; 1459 unsigned long samprk;
1467 int rec_freq = global_settings.rec_frequency; 1460 int rec_freq = global_settings.rec_frequency;
1468 1461
@@ -1528,26 +1521,8 @@ const char *get_token_value(struct gui_wps *gwps,
1528 } 1521 }
1529 } 1522 }
1530 snprintf(buf, buf_size, "%lu.%1lu", samprk/1000,samprk%1000); 1523 snprintf(buf, buf_size, "%lu.%1lu", samprk/1000,samprk%1000);
1531#else /* HWCODEC */
1532
1533 static const char * const freq_strings[] =
1534 {"--", "44", "48", "32", "22", "24", "16"};
1535 int freq = 1 + global_settings.rec_frequency;
1536#ifdef HAVE_SPDIF_REC
1537 if (global_settings.rec_source == AUDIO_SRC_SPDIF)
1538 {
1539 /* Can't measure S/PDIF sample rate on Archos/Sim yet */
1540 freq = 0;
1541 }
1542#endif /* HAVE_SPDIF_IN */
1543 if (intval)
1544 *intval = freq+1; /* so the token gets a value 1<=x<=7 */
1545 snprintf(buf, buf_size, "%s\n",
1546 freq_strings[global_settings.rec_frequency]);
1547#endif
1548 return buf; 1524 return buf;
1549 } 1525 }
1550#if CONFIG_CODEC == SWCODEC
1551 case SKIN_TOKEN_REC_ENCODER: 1526 case SKIN_TOKEN_REC_ENCODER:
1552 { 1527 {
1553 int rec_format = global_settings.rec_format+1; /* WAV, AIFF, WV, MPEG */ 1528 int rec_format = global_settings.rec_format+1; /* WAV, AIFF, WV, MPEG */
@@ -1568,9 +1543,7 @@ const char *get_token_value(struct gui_wps *gwps,
1568 } 1543 }
1569 break; 1544 break;
1570 } 1545 }
1571#endif
1572 case SKIN_TOKEN_REC_BITRATE: 1546 case SKIN_TOKEN_REC_BITRATE:
1573#if CONFIG_CODEC == SWCODEC
1574 if (global_settings.rec_format == REC_FORMAT_MPA_L3) 1547 if (global_settings.rec_format == REC_FORMAT_MPA_L3)
1575 { 1548 {
1576 if (intval) 1549 if (intval)
@@ -1632,17 +1605,11 @@ const char *get_token_value(struct gui_wps *gwps,
1632 } 1605 }
1633 else 1606 else
1634 return NULL; /* Fixme later */ 1607 return NULL; /* Fixme later */
1635#else /* CONFIG_CODEC == HWCODEC */
1636 if (intval)
1637 *intval = global_settings.rec_quality+1;
1638 snprintf(buf, buf_size, "%d", global_settings.rec_quality);
1639 return buf;
1640#endif
1641 case SKIN_TOKEN_REC_MONO: 1608 case SKIN_TOKEN_REC_MONO:
1642 if (!global_settings.rec_channels) 1609 if (!global_settings.rec_channels)
1643 return "m"; 1610 return "m";
1644 return NULL; 1611 return NULL;
1645 1612
1646 case SKIN_TOKEN_REC_SECONDS: 1613 case SKIN_TOKEN_REC_SECONDS:
1647 { 1614 {
1648 int time = (audio_recorded_time() / HZ) % 60; 1615 int time = (audio_recorded_time() / HZ) % 60;
diff --git a/apps/gui/splash.c b/apps/gui/splash.c
index 56df77d57a..fa2c21768a 100644
--- a/apps/gui/splash.c
+++ b/apps/gui/splash.c
@@ -199,7 +199,7 @@ void splashf(int ticks, const char *fmt, ...)
199 199
200void splash(int ticks, const char *str) 200void splash(int ticks, const char *str)
201{ 201{
202#if !defined(SIMULATOR) || CONFIG_CODEC == SWCODEC 202#if !defined(SIMULATOR)
203 long id; 203 long id;
204 /* fmt may be a so called virtual pointer. See settings.h. */ 204 /* fmt may be a so called virtual pointer. See settings.h. */
205 if((id = P2ID((const unsigned char*)str)) >= 0) 205 if((id = P2ID((const unsigned char*)str)) >= 0)
diff --git a/apps/gui/statusbar.c b/apps/gui/statusbar.c
index 90d04a7930..0c8f54f749 100644
--- a/apps/gui/statusbar.c
+++ b/apps/gui/statusbar.c
@@ -27,9 +27,7 @@
27#include "sound.h" 27#include "sound.h"
28#include "settings.h" 28#include "settings.h"
29#include "viewport.h" 29#include "viewport.h"
30#if CONFIG_CODEC == SWCODEC
31#include "metadata.h" 30#include "metadata.h"
32#endif
33#include "icons.h" 31#include "icons.h"
34#include "powermgmt.h" 32#include "powermgmt.h"
35#include "usb.h" 33#include "usb.h"
@@ -602,7 +600,6 @@ static void gui_statusbar_time(struct screen * display, struct tm *time)
602#endif 600#endif
603 601
604#ifdef HAVE_RECORDING 602#ifdef HAVE_RECORDING
605#if CONFIG_CODEC == SWCODEC
606/** 603/**
607 * Write a number to the display using bitmaps and return new position 604 * Write a number to the display using bitmaps and return new position
608 */ 605 */
@@ -650,7 +647,7 @@ static void gui_statusbar_write_format_info(struct screen * display)
650 xpos += BM_GLYPH_WIDTH; 647 xpos += BM_GLYPH_WIDTH;
651 } 648 }
652 } 649 }
653 650
654 651
655 /* Show bitmap - clipping right edge if needed */ 652 /* Show bitmap - clipping right edge if needed */
656 display->mono_bitmap_part(bm, 0, 0, STATUSBAR_ENCODER_WIDTH, 653 display->mono_bitmap_part(bm, 0, 0, STATUSBAR_ENCODER_WIDTH,
@@ -695,58 +692,14 @@ static void gui_statusbar_write_samplerate_info(struct screen * display)
695 STATUSBAR_Y_POS, BM_GLYPH_WIDTH, 692 STATUSBAR_Y_POS, BM_GLYPH_WIDTH,
696 STATUSBAR_HEIGHT); 693 STATUSBAR_HEIGHT);
697} 694}
698#endif /* CONFIG_CODEC == SWCODEC */
699 695
700static void gui_statusbar_icon_recording_info(struct screen * display) 696static void gui_statusbar_icon_recording_info(struct screen * display)
701{ 697{
702#if CONFIG_CODEC != SWCODEC
703 char buffer[3];
704 const char *p = buffer;
705 int width, height;
706 display->setfont(FONT_SYSFIXED);
707#endif /* CONFIG_CODEC != SWCODEC */
708
709 /* Display Codec info in statusbar */ 698 /* Display Codec info in statusbar */
710#if CONFIG_CODEC == SWCODEC
711 gui_statusbar_write_format_info(display); 699 gui_statusbar_write_format_info(display);
712#else /* !SWCODEC */
713 display->mono_bitmap(bitmap_icons_5x8[Icon_q],
714 STATUSBAR_ENCODER_X_POS + 8, STATUSBAR_Y_POS,
715 5, STATUSBAR_HEIGHT);
716
717 snprintf(buffer, sizeof(buffer), "%d", global_settings.rec_quality);
718 display->getstringsize(buffer, &width, &height);
719 if (height <= STATUSBAR_HEIGHT)
720 display->putsxy(STATUSBAR_ENCODER_X_POS + 13, STATUSBAR_Y_POS, buffer);
721#endif /* CONFIG_CODEC == SWCODEC */
722 700
723 /* Display Samplerate info in statusbar */ 701 /* Display Samplerate info in statusbar */
724#if CONFIG_CODEC == SWCODEC
725 /* SWCODEC targets use bitmaps for glyphs */
726 gui_statusbar_write_samplerate_info(display); 702 gui_statusbar_write_samplerate_info(display);
727#else /* !SWCODEC */
728 /* hwcodec targets have sysfont characters */
729#ifdef HAVE_SPDIF_REC
730 if (global_settings.rec_source == AUDIO_SRC_SPDIF)
731 {
732 /* Can't measure S/PDIF sample rate on Archos/Sim yet */
733 p = "--";
734 }
735 else
736#endif /* HAVE_SPDIF_IN */
737 {
738 static const char * const freq_strings[] =
739 {"44", "48", "32", "22", "24", "16"};
740 p = freq_strings[global_settings.rec_frequency];
741 }
742
743 display->getstringsize(p, &width, &height);
744
745 if (height <= STATUSBAR_HEIGHT)
746 display->putsxy(STATUSBAR_RECFREQ_X_POS, STATUSBAR_Y_POS, p);
747
748 display->setfont(FONT_UI);
749#endif /* CONFIG_CODEC == SWCODEC */
750 703
751 /* Display Channel status in status bar */ 704 /* Display Channel status in status bar */
752 if(global_settings.rec_channels) 705 if(global_settings.rec_channels)
diff --git a/apps/gui/wps.c b/apps/gui/wps.c
index b417f82922..82321ff945 100644
--- a/apps/gui/wps.c
+++ b/apps/gui/wps.c
@@ -33,7 +33,6 @@
33#include "filetypes.h" 33#include "filetypes.h"
34#include "settings.h" 34#include "settings.h"
35#include "skin_engine/skin_engine.h" 35#include "skin_engine/skin_engine.h"
36#include "mp3_playback.h"
37#include "audio.h" 36#include "audio.h"
38#include "usb.h" 37#include "usb.h"
39#include "status.h" 38#include "status.h"
@@ -124,26 +123,17 @@ static void update_non_static(void)
124 123
125void pause_action(bool may_fade, bool updatewps) 124void pause_action(bool may_fade, bool updatewps)
126{ 125{
127#if CONFIG_CODEC == SWCODEC
128 /* Do audio first, then update, unless skin were to use its local 126 /* Do audio first, then update, unless skin were to use its local
129 status in which case, reverse it */ 127 status in which case, reverse it */
130 audio_pause(); 128 audio_pause();
131 129
132 if (updatewps) 130 if (updatewps)
133 update_non_static(); 131 update_non_static();
134#else
135 if (may_fade && global_settings.fade_on_stop)
136 fade(false, updatewps);
137 else
138 audio_pause();
139#endif
140 132
141 if (global_settings.pause_rewind) { 133 if (global_settings.pause_rewind) {
142 long newpos; 134 long newpos;
143 135
144#if (CONFIG_CODEC == SWCODEC)
145 audio_pre_ff_rewind(); 136 audio_pre_ff_rewind();
146#endif
147 newpos = audio_current_track()->elapsed 137 newpos = audio_current_track()->elapsed
148 - global_settings.pause_rewind * 1000; 138 - global_settings.pause_rewind * 1000;
149 audio_ff_rewind(newpos > 0 ? newpos : 0); 139 audio_ff_rewind(newpos > 0 ? newpos : 0);
@@ -154,80 +144,16 @@ void pause_action(bool may_fade, bool updatewps)
154 144
155void unpause_action(bool may_fade, bool updatewps) 145void unpause_action(bool may_fade, bool updatewps)
156{ 146{
157#if CONFIG_CODEC == SWCODEC
158 /* Do audio first, then update, unless skin were to use its local 147 /* Do audio first, then update, unless skin were to use its local
159 status in which case, reverse it */ 148 status in which case, reverse it */
160 audio_resume(); 149 audio_resume();
161 150
162 if (updatewps) 151 if (updatewps)
163 update_non_static(); 152 update_non_static();
164#else
165 if (may_fade && global_settings.fade_on_stop)
166 fade(true, updatewps);
167 else
168 audio_resume();
169#endif
170 153
171 (void)may_fade; 154 (void)may_fade;
172} 155}
173 156
174#if CONFIG_CODEC != SWCODEC
175void fade(bool fade_in, bool updatewps)
176{
177 int fp_global_vol = global_settings.volume << 8;
178 int fp_min_vol = sound_min(SOUND_VOLUME) << 8;
179 int fp_step = (fp_global_vol - fp_min_vol) / 10;
180
181 skin_get_global_state()->is_fading = !fade_in;
182 if (fade_in) {
183 /* fade in */
184 int fp_volume = fp_min_vol;
185
186 /* zero out the sound */
187 sound_set_volume(fp_min_vol >> 8);
188
189 sleep(HZ/10); /* let audio thread run */
190 audio_resume();
191
192 if (updatewps)
193 update_non_static();
194
195 while (fp_volume < fp_global_vol - fp_step) {
196 fp_volume += fp_step;
197 sound_set_volume(fp_volume >> 8);
198 sleep(1);
199 }
200 sound_set_volume(global_settings.volume);
201 }
202 else {
203 /* fade out */
204 int fp_volume = fp_global_vol;
205
206 if (updatewps)
207 update_non_static();
208
209 while (fp_volume > fp_min_vol + fp_step) {
210 fp_volume -= fp_step;
211 sound_set_volume(fp_volume >> 8);
212 sleep(1);
213 }
214 audio_pause();
215
216 skin_get_global_state()->is_fading = false;
217#if CONFIG_CODEC != SWCODEC
218#ifndef SIMULATOR
219 /* let audio thread run and wait for the mas to run out of data */
220 while (!mp3_pause_done())
221#endif
222 sleep(HZ/10);
223#endif
224
225 /* reset volume to what it was before the fade */
226 sound_set_volume(global_settings.volume);
227 }
228}
229#endif /* SWCODEC */
230
231static bool update_onvol_change(enum screen_type screen) 157static bool update_onvol_change(enum screen_type screen)
232{ 158{
233 skin_update(WPS, screen, SKIN_REFRESH_NON_STATIC); 159 skin_update(WPS, screen, SKIN_REFRESH_NON_STATIC);
@@ -264,17 +190,8 @@ static int skintouch_to_wps(struct wps_data *data)
264#endif 190#endif
265 case ACTION_TOUCH_SCROLLBAR: 191 case ACTION_TOUCH_SCROLLBAR:
266 skin_get_global_state()->id3->elapsed = skin_get_global_state()->id3->length*offset/100; 192 skin_get_global_state()->id3->elapsed = skin_get_global_state()->id3->length*offset/100;
267#if (CONFIG_CODEC == SWCODEC)
268 audio_pre_ff_rewind(); 193 audio_pre_ff_rewind();
269#else
270 if (!skin_get_global_state()->paused)
271 audio_pause();
272#endif
273 audio_ff_rewind(skin_get_global_state()->id3->elapsed); 194 audio_ff_rewind(skin_get_global_state()->id3->elapsed);
274#if (CONFIG_CODEC != SWCODEC)
275 if (!skin_get_global_state()->paused)
276 audio_resume();
277#endif
278 return ACTION_TOUCHSCREEN; 195 return ACTION_TOUCHSCREEN;
279 case ACTION_TOUCH_VOLUME: 196 case ACTION_TOUCH_VOLUME:
280 { 197 {
@@ -344,12 +261,7 @@ bool ffwd_rew(int button)
344 if ( (audio_status() & AUDIO_STATUS_PLAY) && 261 if ( (audio_status() & AUDIO_STATUS_PLAY) &&
345 skin_get_global_state()->id3 && skin_get_global_state()->id3->length ) 262 skin_get_global_state()->id3 && skin_get_global_state()->id3->length )
346 { 263 {
347#if (CONFIG_CODEC == SWCODEC)
348 audio_pre_ff_rewind(); 264 audio_pre_ff_rewind();
349#else
350 if (!skin_get_global_state()->paused)
351 audio_pause();
352#endif
353 if (direction > 0) 265 if (direction > 0)
354 status_set_ffmode(STATUS_FASTFORWARD); 266 status_set_ffmode(STATUS_FASTFORWARD);
355 else 267 else
@@ -393,10 +305,6 @@ bool ffwd_rew(int button)
393 skin_get_global_state()->ff_rewind_count = 0; 305 skin_get_global_state()->ff_rewind_count = 0;
394 skin_get_global_state()->ff_rewind = false; 306 skin_get_global_state()->ff_rewind = false;
395 status_set_ffmode(0); 307 status_set_ffmode(0);
396#if (CONFIG_CODEC != SWCODEC)
397 if (!skin_get_global_state()->paused)
398 audio_resume();
399#endif
400 exit = true; 308 exit = true;
401 break; 309 break;
402 310
@@ -495,19 +403,8 @@ static void prev_track(unsigned long skip_thresh)
495 return; 403 return;
496 } 404 }
497 405
498#if (CONFIG_CODEC == SWCODEC)
499 audio_pre_ff_rewind(); 406 audio_pre_ff_rewind();
500#else
501 if (!state->paused)
502 audio_pause();
503#endif
504
505 audio_ff_rewind(0); 407 audio_ff_rewind(0);
506
507#if (CONFIG_CODEC != SWCODEC)
508 if (!state->paused)
509 audio_resume();
510#endif
511 } 408 }
512} 409}
513 410
@@ -573,9 +470,7 @@ static void play_hop(int direction)
573 } 470 }
574 else if (direction == 1 && step >= remaining) 471 else if (direction == 1 && step >= remaining)
575 { 472 {
576#if CONFIG_CODEC == SWCODEC
577 system_sound_play(SOUND_TRACK_NO_MORE); 473 system_sound_play(SOUND_TRACK_NO_MORE);
578#endif
579 return; 474 return;
580 } 475 }
581 else if (direction == -1 && elapsed < step) 476 else if (direction == -1 && elapsed < step)
@@ -588,21 +483,10 @@ static void play_hop(int direction)
588 } 483 }
589 if(audio_status() & AUDIO_STATUS_PLAY) 484 if(audio_status() & AUDIO_STATUS_PLAY)
590 { 485 {
591#if (CONFIG_CODEC == SWCODEC)
592 audio_pre_ff_rewind(); 486 audio_pre_ff_rewind();
593#else
594 if (!state->paused)
595 audio_pause();
596#endif
597 } 487 }
598 488
599#if (CONFIG_CODEC == SWCODEC)
600 audio_ff_rewind(elapsed); 489 audio_ff_rewind(elapsed);
601#else
602 audio_ff_rewind(state->id3->elapsed = elapsed);
603 if (!state->paused)
604 audio_resume();
605#endif
606} 490}
607 491
608 492
@@ -867,12 +751,7 @@ long gui_wps_show(void)
867 { 751 {
868 if (state->id3->cuesheet) 752 if (state->id3->cuesheet)
869 { 753 {
870#if (CONFIG_CODEC == SWCODEC)
871 audio_pre_ff_rewind(); 754 audio_pre_ff_rewind();
872#else
873 if (!state->paused)
874 audio_pause();
875#endif
876 audio_ff_rewind(0); 755 audio_ff_rewind(0);
877 } 756 }
878 else 757 else
@@ -1128,13 +1007,8 @@ long gui_wps_show(void)
1128 } 1007 }
1129 1008
1130 if (exit) { 1009 if (exit) {
1131#if CONFIG_CODEC != SWCODEC
1132 if (global_settings.fade_on_stop)
1133 fade(false, true);
1134#else
1135 audio_pause(); 1010 audio_pause();
1136 update_non_static(); 1011 update_non_static();
1137#endif
1138 if (bookmark) 1012 if (bookmark)
1139 bookmark_autobookmark(true); 1013 bookmark_autobookmark(true);
1140 audio_stop(); 1014 audio_stop();
@@ -1200,11 +1074,9 @@ static void wps_state_init(void)
1200 /* add the WPS track event callbacks */ 1074 /* add the WPS track event callbacks */
1201 add_event(PLAYBACK_EVENT_TRACK_CHANGE, track_info_callback); 1075 add_event(PLAYBACK_EVENT_TRACK_CHANGE, track_info_callback);
1202 add_event(PLAYBACK_EVENT_NEXTTRACKID3_AVAILABLE, track_info_callback); 1076 add_event(PLAYBACK_EVENT_NEXTTRACKID3_AVAILABLE, track_info_callback);
1203#if CONFIG_CODEC == SWCODEC
1204 /* Use the same callback as ..._TRACK_CHANGE for when remaining handles have 1077 /* Use the same callback as ..._TRACK_CHANGE for when remaining handles have
1205 finished */ 1078 finished */
1206 add_event(PLAYBACK_EVENT_CUR_TRACK_READY, track_info_callback); 1079 add_event(PLAYBACK_EVENT_CUR_TRACK_READY, track_info_callback);
1207#endif
1208#ifdef AUDIO_FAST_SKIP_PREVIEW 1080#ifdef AUDIO_FAST_SKIP_PREVIEW
1209 add_event(PLAYBACK_EVENT_TRACK_SKIP, track_info_callback); 1081 add_event(PLAYBACK_EVENT_TRACK_SKIP, track_info_callback);
1210#endif 1082#endif
diff --git a/apps/lang/english.lang b/apps/lang/english.lang
index 11770606a1..fbd49c233d 100644
--- a/apps/lang/english.lang
+++ b/apps/lang/english.lang
@@ -5368,23 +5368,6 @@
5368 </voice> 5368 </voice>
5369</phrase> 5369</phrase>
5370<phrase> 5370<phrase>
5371 id: LANG_RECORDING_QUALITY
5372 desc: in the recording settings
5373 user: core
5374 <source>
5375 *: none
5376 recording_hwcodec: "Quality"
5377 </source>
5378 <dest>
5379 *: none
5380 recording_hwcodec: "Quality"
5381 </dest>
5382 <voice>
5383 *: none
5384 recording_hwcodec: "Quality"
5385 </voice>
5386</phrase>
5387<phrase>
5388 id: LANG_FREQUENCY 5371 id: LANG_FREQUENCY
5389 desc: in recording and playback settings 5372 desc: in recording and playback settings
5390 user: core 5373 user: core
@@ -5490,23 +5473,6 @@
5490 </voice> 5473 </voice>
5491</phrase> 5474</phrase>
5492<phrase> 5475<phrase>
5493 id: LANG_RECORDING_EDITABLE
5494 desc: Editable recordings setting
5495 user: core
5496 <source>
5497 *: none
5498 recording_hwcodec: "Independent Frames"
5499 </source>
5500 <dest>
5501 *: none
5502 recording_hwcodec: "Independent Frames"
5503 </dest>
5504 <voice>
5505 *: none
5506 recording_hwcodec: "Independent Frames"
5507 </voice>
5508</phrase>
5509<phrase>
5510 id: LANG_RECORD_TIMESPLIT 5476 id: LANG_RECORD_TIMESPLIT
5511 desc: Record split menu 5477 desc: Record split menu
5512 user: core 5478 user: core
@@ -9464,23 +9430,6 @@
9464 </voice> 9430 </voice>
9465</phrase> 9431</phrase>
9466<phrase> 9432<phrase>
9467 id: LANG_SYSFONT_RECORDING_QUALITY
9468 desc: in the recording settings
9469 user: core
9470 <source>
9471 *: none
9472 recording_hwcodec: "Quality"
9473 </source>
9474 <dest>
9475 *: none
9476 recording_hwcodec: "Quality"
9477 </dest>
9478 <voice>
9479 *: none
9480 recording_hwcodec: "Quality"
9481 </voice>
9482</phrase>
9483<phrase>
9484 id: LANG_SYSFONT_RECORDING_FREQUENCY 9433 id: LANG_SYSFONT_RECORDING_FREQUENCY
9485 desc: in the recording settings 9434 desc: in the recording settings
9486 user: core 9435 user: core
diff --git a/apps/main.c b/apps/main.c
index fe15675c69..4f468fa65b 100644
--- a/apps/main.c
+++ b/apps/main.c
@@ -45,7 +45,6 @@
45#include "serial.h" 45#include "serial.h"
46#endif 46#endif
47#include "audio.h" 47#include "audio.h"
48#include "mp3_playback.h"
49#include "settings.h" 48#include "settings.h"
50#include "backlight.h" 49#include "backlight.h"
51#include "status.h" 50#include "status.h"
@@ -87,12 +86,10 @@
87#include "iap.h" 86#include "iap.h"
88#endif 87#endif
89 88
90#if (CONFIG_CODEC == SWCODEC)
91#include "audio_thread.h" 89#include "audio_thread.h"
92#include "playback.h" 90#include "playback.h"
93#include "tdspeed.h" 91#include "tdspeed.h"
94#endif 92#if defined(HAVE_RECORDING) && !defined(SIMULATOR)
95#if (CONFIG_CODEC == SWCODEC) && defined(HAVE_RECORDING) && !defined(SIMULATOR)
96#include "pcm_record.h" 93#include "pcm_record.h"
97#endif 94#endif
98 95
@@ -258,7 +255,7 @@ static void init_tagcache(void) INIT_ATTR;
258static void init_tagcache(void) 255static void init_tagcache(void)
259{ 256{
260 bool clear = false; 257 bool clear = false;
261#if 0 /* CONFIG_CODEC == SWCODEC */ 258#if 0
262 long talked_tick = 0; 259 long talked_tick = 0;
263#endif 260#endif
264 tagcache_init(); 261 tagcache_init();
@@ -269,7 +266,7 @@ static void init_tagcache(void)
269 266
270 if (ret > 0) 267 if (ret > 0)
271 { 268 {
272#if 0 /* FIXME: Audio isn't even initialized yet! */ /* CONFIG_CODEC == SWCODEC */ 269#if 0 /* FIXME: Audio isn't even initialized yet! */
273 /* hwcodec can't use voice here, as the database commit 270 /* hwcodec can't use voice here, as the database commit
274 * uses the audio buffer. */ 271 * uses the audio buffer. */
275 if(global_settings.talk_menu 272 if(global_settings.talk_menu
@@ -365,10 +362,8 @@ static void init(void)
365 viewportmanager_init(); 362 viewportmanager_init();
366 363
367 storage_init(); 364 storage_init();
368#if CONFIG_CODEC == SWCODEC
369 pcm_init(); 365 pcm_init();
370 dsp_init(); 366 dsp_init();
371#endif
372 settings_reset(); 367 settings_reset();
373 settings_load(SETTINGS_ALL); 368 settings_load(SETTINGS_ALL);
374 settings_apply(true); 369 settings_apply(true);
@@ -384,23 +379,6 @@ static void init(void)
384 playlist_init(); 379 playlist_init();
385 shortcuts_init(); 380 shortcuts_init();
386 381
387#if CONFIG_CODEC != SWCODEC
388 mp3_init( global_settings.volume,
389 global_settings.bass,
390 global_settings.treble,
391 global_settings.balance,
392 global_settings.loudness,
393 global_settings.avc,
394 global_settings.channel_config,
395 global_settings.stereo_width,
396 global_settings.mdb_strength,
397 global_settings.mdb_harmonics,
398 global_settings.mdb_center,
399 global_settings.mdb_shape,
400 global_settings.mdb_enable,
401 global_settings.superbass);
402#endif /* CONFIG_CODEC != SWCODEC */
403
404 if (global_settings.audioscrobbler) 382 if (global_settings.audioscrobbler)
405 scrobbler_init(); 383 scrobbler_init();
406 384
@@ -599,10 +577,8 @@ static void init(void)
599 } 577 }
600 } 578 }
601 579
602#if CONFIG_CODEC == SWCODEC
603 pcm_init(); 580 pcm_init();
604 dsp_init(); 581 dsp_init();
605#endif
606 582
607#if defined(SETTINGS_RESET) || (CONFIG_KEYPAD == IPOD_4G_PAD) || \ 583#if defined(SETTINGS_RESET) || (CONFIG_KEYPAD == IPOD_4G_PAD) || \
608 (CONFIG_KEYPAD == IRIVER_H10_PAD) 584 (CONFIG_KEYPAD == IRIVER_H10_PAD)
@@ -669,25 +645,6 @@ static void init(void)
669 645
670 shortcuts_init(); 646 shortcuts_init();
671 647
672#if CONFIG_CODEC != SWCODEC
673 /* No buffer allocation (see buffer.c) may take place after the call to
674 audio_init() since the mpeg thread takes the rest of the buffer space */
675 mp3_init( global_settings.volume,
676 global_settings.bass,
677 global_settings.treble,
678 global_settings.balance,
679 global_settings.loudness,
680 global_settings.avc,
681 global_settings.channel_config,
682 global_settings.stereo_width,
683 global_settings.mdb_strength,
684 global_settings.mdb_harmonics,
685 global_settings.mdb_center,
686 global_settings.mdb_shape,
687 global_settings.mdb_enable,
688 global_settings.superbass);
689#endif /* CONFIG_CODEC != SWCODEC */
690
691 CHART(">audio_init"); 648 CHART(">audio_init");
692 audio_init(); 649 audio_init();
693 CHART("<audio_init"); 650 CHART("<audio_init");
diff --git a/apps/menu.c b/apps/menu.c
index 97af181267..49e6c58b2b 100644
--- a/apps/menu.c
+++ b/apps/menu.c
@@ -391,9 +391,7 @@ int do_menu(const struct menu_item_ex *start_menu, int *start_selected,
391 { 391 {
392 int new_audio_status; 392 int new_audio_status;
393 redraw_lists = false; 393 redraw_lists = false;
394#if CONFIG_CODEC == SWCODEC
395 keyclick_set_callback(gui_synclist_keyclick_callback, &lists); 394 keyclick_set_callback(gui_synclist_keyclick_callback, &lists);
396#endif
397 action = get_action(CONTEXT_MAINMENU, 395 action = get_action(CONTEXT_MAINMENU,
398 list_do_action_timeout(&lists, HZ)); 396 list_do_action_timeout(&lists, HZ));
399 397
diff --git a/apps/menus/eq_menu.c b/apps/menus/eq_menu.c
index b41e4b0981..683025629b 100644
--- a/apps/menus/eq_menu.c
+++ b/apps/menus/eq_menu.c
@@ -30,7 +30,6 @@
30#include "list.h" 30#include "list.h"
31#include "menu.h" 31#include "menu.h"
32#include "action.h" 32#include "action.h"
33#include "mp3_playback.h"
34#include "settings.h" 33#include "settings.h"
35#include "screens.h" 34#include "screens.h"
36#include "icons.h" 35#include "icons.h"
diff --git a/apps/menus/menu_common.c b/apps/menus/menu_common.c
index 2ef48cc23b..1fa8ba3af2 100644
--- a/apps/menus/menu_common.c
+++ b/apps/menus/menu_common.c
@@ -25,11 +25,8 @@
25#include "action.h" 25#include "action.h"
26#include "menu.h" 26#include "menu.h"
27#include "menu_common.h" 27#include "menu_common.h"
28#if CONFIG_CODEC == SWCODEC
29#include "pcmbuf.h" 28#include "pcmbuf.h"
30#endif
31 29
32#if CONFIG_CODEC == SWCODEC
33/* Use this callback if your menu adjusts DSP settings. */ 30/* Use this callback if your menu adjusts DSP settings. */
34int lowlatency_callback(int action, 31int lowlatency_callback(int action,
35 const struct menu_item_ex *this_item, 32 const struct menu_item_ex *this_item,
@@ -48,5 +45,3 @@ int lowlatency_callback(int action,
48 } 45 }
49 return action; 46 return action;
50} 47}
51#endif
52
diff --git a/apps/menus/menu_common.h b/apps/menus/menu_common.h
index e85ed8dc61..5a28c3f03c 100644
--- a/apps/menus/menu_common.h
+++ b/apps/menus/menu_common.h
@@ -24,11 +24,9 @@
24#include "menu.h" 24#include "menu.h"
25#include "config.h" 25#include "config.h"
26 26
27#if CONFIG_CODEC == SWCODEC
28int lowlatency_callback(int action, 27int lowlatency_callback(int action,
29 const struct menu_item_ex *this_item, 28 const struct menu_item_ex *this_item,
30 struct gui_synclist *this_list); 29 struct gui_synclist *this_list);
31#endif
32 30
33#endif /* _MENU_COMMON_H */ 31#endif /* _MENU_COMMON_H */
34 32
diff --git a/apps/menus/playback_menu.c b/apps/menus/playback_menu.c
index bf770c0f11..41c738725c 100644
--- a/apps/menus/playback_menu.c
+++ b/apps/menus/playback_menu.c
@@ -35,16 +35,13 @@
35#include "audio.h" 35#include "audio.h"
36#include "cuesheet.h" 36#include "cuesheet.h"
37#include "misc.h" 37#include "misc.h"
38#if CONFIG_CODEC == SWCODEC
39#include "playback.h" 38#include "playback.h"
40#include "pcm_sampr.h" 39#include "pcm_sampr.h"
41#ifdef HAVE_PLAY_FREQ 40#ifdef HAVE_PLAY_FREQ
42#include "talk.h" 41#include "talk.h"
43#endif 42#endif
44#endif
45
46 43
47#if (CONFIG_CODEC == SWCODEC) && defined(HAVE_CROSSFADE) 44#if defined(HAVE_CROSSFADE)
48static int setcrossfadeonexit_callback(int action, 45static int setcrossfadeonexit_callback(int action,
49 const struct menu_item_ex *this_item, 46 const struct menu_item_ex *this_item,
50 struct gui_synclist *this_list) 47 struct gui_synclist *this_list)
@@ -60,7 +57,7 @@ static int setcrossfadeonexit_callback(int action,
60 return action; 57 return action;
61} 58}
62 59
63#endif /* CONFIG_CODEC == SWCODEC */ 60#endif /* HAVE_CROSSFADE */
64 61
65/***********************************/ 62/***********************************/
66/* PLAYBACK MENU */ 63/* PLAYBACK MENU */
@@ -77,7 +74,6 @@ MENUITEM_SETTING(ff_rewind_min_step, &global_settings.ff_rewind_min_step, NULL);
77MAKE_MENU(ff_rewind_settings_menu, ID2P(LANG_WIND_MENU), 0, Icon_NOICON, 74MAKE_MENU(ff_rewind_settings_menu, ID2P(LANG_WIND_MENU), 0, Icon_NOICON,
78 &ff_rewind_min_step, &ff_rewind_accel); 75 &ff_rewind_min_step, &ff_rewind_accel);
79#ifdef HAVE_DISK_STORAGE 76#ifdef HAVE_DISK_STORAGE
80#if CONFIG_CODEC == SWCODEC
81static int buffermargin_callback(int action, 77static int buffermargin_callback(int action,
82 const struct menu_item_ex *this_item, 78 const struct menu_item_ex *this_item,
83 struct gui_synclist *this_list) 79 struct gui_synclist *this_list)
@@ -92,16 +88,12 @@ static int buffermargin_callback(int action,
92 } 88 }
93 return action; 89 return action;
94} 90}
95#else
96# define buffermargin_callback NULL
97#endif
98MENUITEM_SETTING(buffer_margin, &global_settings.buffer_margin, 91MENUITEM_SETTING(buffer_margin, &global_settings.buffer_margin,
99 buffermargin_callback); 92 buffermargin_callback);
100#endif /*HAVE_DISK_STORAGE */ 93#endif /*HAVE_DISK_STORAGE */
101MENUITEM_SETTING(fade_on_stop, &global_settings.fade_on_stop, NULL); 94MENUITEM_SETTING(fade_on_stop, &global_settings.fade_on_stop, NULL);
102MENUITEM_SETTING(party_mode, &global_settings.party_mode, NULL); 95MENUITEM_SETTING(party_mode, &global_settings.party_mode, NULL);
103 96
104#if CONFIG_CODEC == SWCODEC
105#ifdef HAVE_CROSSFADE 97#ifdef HAVE_CROSSFADE
106/* crossfade submenu */ 98/* crossfade submenu */
107MENUITEM_SETTING(crossfade, &global_settings.crossfade, setcrossfadeonexit_callback); 99MENUITEM_SETTING(crossfade, &global_settings.crossfade, setcrossfadeonexit_callback);
@@ -150,7 +142,6 @@ MAKE_MENU(replaygain_settings_menu,ID2P(LANG_REPLAYGAIN),0, Icon_NOICON,
150 &replaygain_type, &replaygain_noclip, &replaygain_preamp); 142 &replaygain_type, &replaygain_noclip, &replaygain_preamp);
151 143
152MENUITEM_SETTING(beep, &global_settings.beep ,NULL); 144MENUITEM_SETTING(beep, &global_settings.beep ,NULL);
153#endif /* CONFIG_CODEC == SWCODEC */
154 145
155#ifdef HAVE_SPDIF_POWER 146#ifdef HAVE_SPDIF_POWER
156MENUITEM_SETTING(spdif_enable, &global_settings.spdif_enable, NULL); 147MENUITEM_SETTING(spdif_enable, &global_settings.spdif_enable, NULL);
@@ -188,13 +179,7 @@ static int cuesheet_callback(int action,
188 switch (action) 179 switch (action)
189 { 180 {
190 case ACTION_EXIT_MENUITEM: /* on exit */ 181 case ACTION_EXIT_MENUITEM: /* on exit */
191#if CONFIG_CODEC == SWCODEC
192 audio_set_cuesheet(global_settings.cuesheet); 182 audio_set_cuesheet(global_settings.cuesheet);
193#else
194 if (global_settings.cuesheet)
195 splash(HZ*2, ID2P(LANG_PLEASE_REBOOT));
196 break;
197#endif
198 } 183 }
199 return action; 184 return action;
200} 185}
@@ -209,9 +194,7 @@ MAKE_MENU(unplug_menu, ID2P(LANG_HEADPHONE_UNPLUG), 0, Icon_NOICON,
209 194
210MENUITEM_SETTING(skip_length, &global_settings.skip_length, NULL); 195MENUITEM_SETTING(skip_length, &global_settings.skip_length, NULL);
211MENUITEM_SETTING(prevent_skip, &global_settings.prevent_skip, NULL); 196MENUITEM_SETTING(prevent_skip, &global_settings.prevent_skip, NULL);
212#if CONFIG_CODEC == SWCODEC
213MENUITEM_SETTING(resume_rewind, &global_settings.resume_rewind, NULL); 197MENUITEM_SETTING(resume_rewind, &global_settings.resume_rewind, NULL);
214#endif
215MENUITEM_SETTING(pause_rewind, &global_settings.pause_rewind, NULL); 198MENUITEM_SETTING(pause_rewind, &global_settings.pause_rewind, NULL);
216#ifdef HAVE_PLAY_FREQ 199#ifdef HAVE_PLAY_FREQ
217MENUITEM_SETTING(play_frequency, &global_settings.play_frequency, 200MENUITEM_SETTING(play_frequency, &global_settings.play_frequency,
@@ -227,13 +210,11 @@ MAKE_MENU(playback_settings,ID2P(LANG_PLAYBACK),0,
227#endif 210#endif
228 &fade_on_stop, &party_mode, 211 &fade_on_stop, &party_mode,
229 212
230#if (CONFIG_CODEC == SWCODEC) && defined(HAVE_CROSSFADE) 213#if defined(HAVE_CROSSFADE)
231 &crossfade_settings_menu, 214 &crossfade_settings_menu,
232#endif 215#endif
233 216
234#if CONFIG_CODEC == SWCODEC
235 &replaygain_settings_menu, &beep, 217 &replaygain_settings_menu, &beep,
236#endif
237 218
238#ifdef HAVE_SPDIF_POWER 219#ifdef HAVE_SPDIF_POWER
239 &spdif_enable, 220 &spdif_enable,
@@ -244,9 +225,7 @@ MAKE_MENU(playback_settings,ID2P(LANG_PLAYBACK),0,
244#endif 225#endif
245 ,&skip_length, &prevent_skip 226 ,&skip_length, &prevent_skip
246 227
247#if CONFIG_CODEC == SWCODEC
248 ,&resume_rewind 228 ,&resume_rewind
249#endif
250 ,&pause_rewind 229 ,&pause_rewind
251#ifdef HAVE_PLAY_FREQ 230#ifdef HAVE_PLAY_FREQ
252 ,&play_frequency 231 ,&play_frequency
diff --git a/apps/menus/radio_menu.c b/apps/menus/radio_menu.c
index 8871421c11..a6d259a21d 100644
--- a/apps/menus/radio_menu.c
+++ b/apps/menus/radio_menu.c
@@ -34,7 +34,7 @@
34#ifdef HAVE_RECORDING 34#ifdef HAVE_RECORDING
35#include "recording.h" /* recording_screen() */ 35#include "recording.h" /* recording_screen() */
36 36
37#if defined(HAVE_FMRADIO_REC) && CONFIG_CODEC == SWCODEC 37#if defined(HAVE_FMRADIO_REC)
38#define FM_RECORDING_SCREEN 38#define FM_RECORDING_SCREEN
39static int fm_recording_screen(void) 39static int fm_recording_screen(void)
40{ 40{
@@ -53,30 +53,20 @@ static int fm_recording_screen(void)
53 53
54MENUITEM_FUNCTION(recscreen_item, 0, ID2P(LANG_RECORDING), 54MENUITEM_FUNCTION(recscreen_item, 0, ID2P(LANG_RECORDING),
55 fm_recording_screen, NULL, NULL, Icon_Recording); 55 fm_recording_screen, NULL, NULL, Icon_Recording);
56#endif /* defined(HAVE_FMRADIO_REC) && CONFIG_CODEC == SWCODEC */ 56#endif /* defined(HAVE_FMRADIO_REC) */
57 57
58#if defined(HAVE_FMRADIO_REC) || CONFIG_CODEC != SWCODEC 58#if defined(HAVE_FMRADIO_REC)
59#define FM_RECORDING_SETTINGS 59#define FM_RECORDING_SETTINGS
60static int fm_recording_settings(void) 60static int fm_recording_settings(void)
61{ 61{
62 int ret = recording_menu(true); 62 int ret = recording_menu(true);
63 63
64#if CONFIG_CODEC != SWCODEC
65 if (!ret)
66 {
67 struct audio_recording_options rec_options;
68 rec_init_recording_options(&rec_options);
69 rec_options.rec_source = AUDIO_SRC_LINEIN;
70 rec_set_recording_options(&rec_options);
71 }
72#endif
73
74 return ret; 64 return ret;
75} 65}
76 66
77MENUITEM_FUNCTION(recsettings_item, 0, ID2P(LANG_RECORDING_SETTINGS), 67MENUITEM_FUNCTION(recsettings_item, 0, ID2P(LANG_RECORDING_SETTINGS),
78 fm_recording_settings, NULL, NULL, Icon_Recording); 68 fm_recording_settings, NULL, NULL, Icon_Recording);
79#endif /* defined(HAVE_FMRADIO_REC) || CONFIG_CODEC != SWCODEC */ 69#endif /* defined(HAVE_FMRADIO_REC) */
80#endif /* HAVE_RECORDING */ 70#endif /* HAVE_RECORDING */
81 71
82#ifndef FM_PRESET 72#ifndef FM_PRESET
diff --git a/apps/menus/recording_menu.c b/apps/menus/recording_menu.c
index 0f24420a63..c841de4e89 100644
--- a/apps/menus/recording_menu.c
+++ b/apps/menus/recording_menu.c
@@ -29,7 +29,6 @@
29#include "lcd.h" 29#include "lcd.h"
30#include "menu.h" 30#include "menu.h"
31#include "button.h" 31#include "button.h"
32#include "mp3_playback.h"
33#include "settings.h" 32#include "settings.h"
34#include "screens.h" 33#include "screens.h"
35#include "icons.h" 34#include "icons.h"
@@ -51,14 +50,12 @@
51#include "peakmeter.h" 50#include "peakmeter.h"
52#endif 51#endif
53#include "splash.h" 52#include "splash.h"
54#if CONFIG_CODEC == SWCODEC
55#include "metadata.h" 53#include "metadata.h"
56#include "menus/eq_menu.h" 54#include "menus/eq_menu.h"
57#ifdef HAVE_RECORDING 55#ifdef HAVE_RECORDING
58#include "enc_config.h" 56#include "enc_config.h"
59#endif 57#endif
60#include "general.h" 58#include "general.h"
61#endif
62#include "action.h" 59#include "action.h"
63#include "recording.h" 60#include "recording.h"
64#include "sound_menu.h" 61#include "sound_menu.h"
@@ -101,7 +98,6 @@ static int recsource_func(void)
101MENUITEM_FUNCTION(recsource, 0, ID2P(LANG_RECORDING_SOURCE), 98MENUITEM_FUNCTION(recsource, 0, ID2P(LANG_RECORDING_SOURCE),
102 recsource_func, NULL, recmenu_callback, Icon_Menu_setting); 99 recsource_func, NULL, recmenu_callback, Icon_Menu_setting);
103 100
104#if CONFIG_CODEC == SWCODEC
105/* Makes an options list from a source list of options and indexes */ 101/* Makes an options list from a source list of options and indexes */
106static void make_options_from_indexes(const struct opt_items *src_names, 102static void make_options_from_indexes(const struct opt_items *src_names,
107 const long *src_indexes, 103 const long *src_indexes,
@@ -112,12 +108,8 @@ static void make_options_from_indexes(const struct opt_items *src_names,
112 dst_names[n_indexes] = src_names[src_indexes[n_indexes]]; 108 dst_names[n_indexes] = src_names[src_indexes[n_indexes]];
113} /* make_options_from_indexes */ 109} /* make_options_from_indexes */
114 110
115
116#endif /* CONFIG_CODEC == SWCODEC */
117
118static int recfrequency_func(void) 111static int recfrequency_func(void)
119{ 112{
120#if CONFIG_CODEC == SWCODEC
121 static const struct opt_items names[REC_NUM_FREQ] = { 113 static const struct opt_items names[REC_NUM_FREQ] = {
122 REC_HAVE_96_([REC_FREQ_96] = { "96kHz", TALK_ID(96, UNIT_KHZ) },) 114 REC_HAVE_96_([REC_FREQ_96] = { "96kHz", TALK_ID(96, UNIT_KHZ) },)
123 REC_HAVE_88_([REC_FREQ_88] = { "88.2kHz", TALK_ID(88, UNIT_KHZ) },) 115 REC_HAVE_88_([REC_FREQ_88] = { "88.2kHz", TALK_ID(88, UNIT_KHZ) },)
@@ -195,7 +187,6 @@ static int recfrequency_func(void)
195 } 187 }
196 188
197 return ret; 189 return ret;
198#endif /* CONFIG_CODEC == SWCODEC */
199} /* recfrequency */ 190} /* recfrequency */
200MENUITEM_FUNCTION(recfrequency, 0, ID2P(LANG_FREQUENCY), 191MENUITEM_FUNCTION(recfrequency, 0, ID2P(LANG_FREQUENCY),
201 recfrequency_func, NULL, NULL, Icon_Menu_setting); 192 recfrequency_func, NULL, NULL, Icon_Menu_setting);
@@ -208,7 +199,6 @@ static int recchannels_func(void)
208 [CHN_MODE_MONO] = { STR(LANG_CHANNEL_MONO) } 199 [CHN_MODE_MONO] = { STR(LANG_CHANNEL_MONO) }
209 }; 200 };
210 201
211#if CONFIG_CODEC == SWCODEC
212 struct opt_items opts[CHN_NUM_MODES]; 202 struct opt_items opts[CHN_NUM_MODES];
213 long table[CHN_NUM_MODES]; 203 long table[CHN_NUM_MODES];
214 struct encoder_caps caps; 204 struct encoder_caps caps;
@@ -238,13 +228,10 @@ static int recchannels_func(void)
238 global_settings.rec_channels = table[rec_channels]; 228 global_settings.rec_channels = table[rec_channels];
239 229
240 return ret; 230 return ret;
241#endif /* CONFIG_CODEC == SWCODEC */
242} 231}
243MENUITEM_FUNCTION(recchannels, 0, ID2P(LANG_CHANNELS), 232MENUITEM_FUNCTION(recchannels, 0, ID2P(LANG_CHANNELS),
244 recchannels_func, NULL, NULL, Icon_Menu_setting); 233 recchannels_func, NULL, NULL, Icon_Menu_setting);
245 234
246#if CONFIG_CODEC == SWCODEC
247
248static int recmonomode_func(void) 235static int recmonomode_func(void)
249{ 236{
250 static const struct opt_items names[3] = { 237 static const struct opt_items names[3] = {
@@ -293,9 +280,6 @@ MENUITEM_FUNCTION(enc_global_config_menu_item, 0, ID2P(LANG_ENCODER_SETTINGS),
293 enc_global_config_menu, 280 enc_global_config_menu,
294 NULL, NULL, Icon_Submenu); 281 NULL, NULL, Icon_Submenu);
295 282
296#endif /* CONFIG_CODEC == SWCODEC */
297
298
299static int recmenu_callback(int action, 283static int recmenu_callback(int action,
300 const struct menu_item_ex *this_item, 284 const struct menu_item_ex *this_item,
301 struct gui_synclist *this_list) 285 struct gui_synclist *this_list)
@@ -603,14 +587,10 @@ MENUITEM_FUNCTION(save_recpresets_item, 0, ID2P(LANG_SAVE_SETTINGS),
603 587
604MAKE_MENU(recording_settings_menu, ID2P(LANG_RECORDING_SETTINGS), 588MAKE_MENU(recording_settings_menu, ID2P(LANG_RECORDING_SETTINGS),
605 NULL, Icon_Recording, 589 NULL, Icon_Recording,
606#if CONFIG_CODEC == SWCODEC
607 &recformat, &enc_global_config_menu_item, 590 &recformat, &enc_global_config_menu_item,
608#endif
609 &recfrequency, &recsource, /* recsource not shown if no_source */ 591 &recfrequency, &recsource, /* recsource not shown if no_source */
610 &recchannels, 592 &recchannels,
611#if CONFIG_CODEC == SWCODEC
612 &recmonomode, 593 &recmonomode,
613#endif
614 &filesplitoptionsmenu, 594 &filesplitoptionsmenu,
615 &rec_prerecord_time, 595 &rec_prerecord_time,
616 &clear_rec_directory_item, 596 &clear_rec_directory_item,
diff --git a/apps/menus/settings_menu.c b/apps/menus/settings_menu.c
index 2957b0635c..e2b496a6f7 100644
--- a/apps/menus/settings_menu.c
+++ b/apps/menus/settings_menu.c
@@ -38,9 +38,7 @@
38#include "yesno.h" 38#include "yesno.h"
39#include "talk.h" 39#include "talk.h"
40#include "powermgmt.h" 40#include "powermgmt.h"
41#if CONFIG_CODEC == SWCODEC
42#include "playback.h" 41#include "playback.h"
43#endif
44#if CONFIG_RTC 42#if CONFIG_RTC
45#include "screens.h" 43#include "screens.h"
46#endif 44#endif
@@ -326,7 +324,6 @@ MAKE_MENU(limits_menu, ID2P(LANG_LIMITS_MENU), 0, Icon_NOICON,
326 324
327 325
328/* Keyclick menu */ 326/* Keyclick menu */
329#if CONFIG_CODEC == SWCODEC
330MENUITEM_SETTING(keyclick, &global_settings.keyclick, NULL); 327MENUITEM_SETTING(keyclick, &global_settings.keyclick, NULL);
331MENUITEM_SETTING(keyclick_repeats, &global_settings.keyclick_repeats, NULL); 328MENUITEM_SETTING(keyclick_repeats, &global_settings.keyclick_repeats, NULL);
332#ifdef HAVE_HARDWARE_CLICK 329#ifdef HAVE_HARDWARE_CLICK
@@ -337,7 +334,6 @@ MAKE_MENU(keyclick_menu, ID2P(LANG_KEYCLICK), 0, Icon_NOICON,
337MAKE_MENU(keyclick_menu, ID2P(LANG_KEYCLICK), 0, Icon_NOICON, 334MAKE_MENU(keyclick_menu, ID2P(LANG_KEYCLICK), 0, Icon_NOICON,
338 &keyclick, &keyclick_repeats); 335 &keyclick, &keyclick_repeats);
339#endif 336#endif
340#endif
341 337
342#if CONFIG_CHARGING 338#if CONFIG_CHARGING
343MENUITEM_SETTING(car_adapter_mode, &global_settings.car_adapter_mode, NULL); 339MENUITEM_SETTING(car_adapter_mode, &global_settings.car_adapter_mode, NULL);
@@ -437,9 +433,7 @@ MAKE_MENU(system_menu, ID2P(LANG_SYSTEM),
437#ifdef HAVE_BUTTONLIGHT_BRIGHTNESS 433#ifdef HAVE_BUTTONLIGHT_BRIGHTNESS
438 &buttonlight_brightness, 434 &buttonlight_brightness,
439#endif 435#endif
440#if CONFIG_CODEC == SWCODEC
441 &keyclick_menu, 436 &keyclick_menu,
442#endif
443#ifdef HAVE_TOUCHPAD_SENSITIVITY_SETTING 437#ifdef HAVE_TOUCHPAD_SENSITIVITY_SETTING
444 &touchpad_sensitivity, 438 &touchpad_sensitivity,
445#endif 439#endif
@@ -619,7 +613,6 @@ MAKE_MENU(bookmark_settings_menu, ID2P(LANG_BOOKMARK_SETTINGS), 0,
619/***********************************/ 613/***********************************/
620/* AUTORESUME MENU */ 614/* AUTORESUME MENU */
621#ifdef HAVE_TAGCACHE 615#ifdef HAVE_TAGCACHE
622#if CONFIG_CODEC == SWCODEC
623 616
624static int autoresume_callback(int action, 617static int autoresume_callback(int action,
625 const struct menu_item_ex *this_item, 618 const struct menu_item_ex *this_item,
@@ -674,7 +667,6 @@ MAKE_MENU(autoresume_menu, ID2P(LANG_AUTORESUME),
674 0, Icon_NOICON, 667 0, Icon_NOICON,
675 &autoresume_enable, &autoresume_automatic); 668 &autoresume_enable, &autoresume_automatic);
676 669
677#endif /* CONFIG_CODEC == SWCODEC */
678#endif /* HAVE_TAGCACHE */ 670#endif /* HAVE_TAGCACHE */
679/* AUTORESUME MENU */ 671/* AUTORESUME MENU */
680/***********************************/ 672/***********************************/
@@ -758,10 +750,8 @@ MAKE_MENU(settings_menu_item, ID2P(LANG_GENERAL_SETTINGS), 0,
758 &startup_shutdown_menu, 750 &startup_shutdown_menu,
759 &bookmark_settings_menu, 751 &bookmark_settings_menu,
760#ifdef HAVE_TAGCACHE 752#ifdef HAVE_TAGCACHE
761#if CONFIG_CODEC == SWCODEC
762 &autoresume_menu, 753 &autoresume_menu,
763#endif 754#endif
764#endif
765 &browse_langs, &voice_settings_menu, 755 &browse_langs, &voice_settings_menu,
766#ifdef HAVE_HOTKEY 756#ifdef HAVE_HOTKEY
767 &hotkey_menu, 757 &hotkey_menu,
diff --git a/apps/menus/sound_menu.c b/apps/menus/sound_menu.c
index ee966ac62a..174329fcc8 100644
--- a/apps/menus/sound_menu.c
+++ b/apps/menus/sound_menu.c
@@ -108,18 +108,10 @@ MENUITEM_SETTING(treble_cutoff, &global_settings.treble_cutoff, NULL);
108 108
109MENUITEM_SETTING(balance, &global_settings.balance, NULL); 109MENUITEM_SETTING(balance, &global_settings.balance, NULL);
110MENUITEM_SETTING(channel_config, &global_settings.channel_config, 110MENUITEM_SETTING(channel_config, &global_settings.channel_config,
111#if CONFIG_CODEC == SWCODEC
112 lowlatency_callback 111 lowlatency_callback
113#else
114 NULL
115#endif
116); 112);
117MENUITEM_SETTING(stereo_width, &global_settings.stereo_width, 113MENUITEM_SETTING(stereo_width, &global_settings.stereo_width,
118#if CONFIG_CODEC == SWCODEC
119 lowlatency_callback 114 lowlatency_callback
120#else
121 NULL
122#endif
123); 115);
124 116
125#ifdef AUDIOHW_HAVE_DEPTH_3D 117#ifdef AUDIOHW_HAVE_DEPTH_3D
@@ -134,7 +126,6 @@ MENUITEM_SETTING(roll_off, &global_settings.roll_off, NULL);
134MENUITEM_SETTING(func_mode, &global_settings.func_mode, NULL); 126MENUITEM_SETTING(func_mode, &global_settings.func_mode, NULL);
135#endif 127#endif
136 128
137#if CONFIG_CODEC == SWCODEC
138 /* Crossfeed Submenu */ 129 /* Crossfeed Submenu */
139 MENUITEM_SETTING(crossfeed, &global_settings.crossfeed, lowlatency_callback); 130 MENUITEM_SETTING(crossfeed, &global_settings.crossfeed, lowlatency_callback);
140 MENUITEM_SETTING(crossfeed_direct_gain, 131 MENUITEM_SETTING(crossfeed_direct_gain,
@@ -216,7 +207,6 @@ static int timestretch_callback(int action,
216 MAKE_MENU(compressor_menu,ID2P(LANG_COMPRESSOR), NULL, Icon_NOICON, 207 MAKE_MENU(compressor_menu,ID2P(LANG_COMPRESSOR), NULL, Icon_NOICON,
217 &compressor_threshold, &compressor_gain, &compressor_ratio, 208 &compressor_threshold, &compressor_gain, &compressor_ratio,
218 &compressor_knee, &compressor_attack, &compressor_release); 209 &compressor_knee, &compressor_attack, &compressor_release);
219#endif
220 210
221#ifdef HAVE_SPEAKER 211#ifdef HAVE_SPEAKER
222 MENUITEM_SETTING(speaker_mode, &global_settings.speaker_mode, NULL); 212 MENUITEM_SETTING(speaker_mode, &global_settings.speaker_mode, NULL);
@@ -253,14 +243,12 @@ MAKE_MENU(sound_settings, ID2P(LANG_SOUND_SETTINGS), NULL, Icon_Audio,
253#ifdef AUDIOHW_HAVE_FUNCTIONAL_MODE 243#ifdef AUDIOHW_HAVE_FUNCTIONAL_MODE
254 ,&func_mode 244 ,&func_mode
255#endif 245#endif
256#if CONFIG_CODEC == SWCODEC
257 ,&crossfeed_menu, &equalizer_menu, &dithering_enabled 246 ,&crossfeed_menu, &equalizer_menu, &dithering_enabled
258 ,&surround_menu, &pbe_menu, &afr_enabled 247 ,&surround_menu, &pbe_menu, &afr_enabled
259#ifdef HAVE_PITCHCONTROL 248#ifdef HAVE_PITCHCONTROL
260 ,&timestretch_enabled 249 ,&timestretch_enabled
261#endif 250#endif
262 ,&compressor_menu 251 ,&compressor_menu
263#endif
264#ifdef HAVE_SPEAKER 252#ifdef HAVE_SPEAKER
265 ,&speaker_mode 253 ,&speaker_mode
266#endif 254#endif
diff --git a/apps/misc.c b/apps/misc.c
index 2e3292dba5..b20a0095ab 100644
--- a/apps/misc.c
+++ b/apps/misc.c
@@ -91,11 +91,7 @@
91#include "bookmark.h" 91#include "bookmark.h"
92#include "wps.h" 92#include "wps.h"
93#include "playback.h" 93#include "playback.h"
94#if CONFIG_CODEC == SWCODEC
95#include "voice_thread.h" 94#include "voice_thread.h"
96#else
97#include "mp3_playback.h"
98#endif
99 95
100#ifdef BOOTFILE 96#ifdef BOOTFILE
101#if !defined(USB_NONE) && !defined(USB_HANDLED_BY_OF) \ 97#if !defined(USB_NONE) && !defined(USB_HANDLED_BY_OF) \
@@ -302,7 +298,7 @@ static bool clean_shutdown(void (*callback)(void *), void *parameter)
302#endif 298#endif
303 { 299 {
304 bool batt_safe = battery_level_safe(); 300 bool batt_safe = battery_level_safe();
305#if CONFIG_CODEC != SWCODEC || defined(HAVE_RECORDING) 301#if defined(HAVE_RECORDING)
306 int audio_stat = audio_status(); 302 int audio_stat = audio_status();
307#endif 303#endif
308 304
@@ -339,19 +335,12 @@ static bool clean_shutdown(void (*callback)(void *), void *parameter)
339 splashf(0, "%s %s", str(LANG_WARNING_BATTERY_EMPTY), 335 splashf(0, "%s %s", str(LANG_WARNING_BATTERY_EMPTY),
340 str(LANG_SHUTTINGDOWN)); 336 str(LANG_SHUTTINGDOWN));
341 } 337 }
342#if CONFIG_CODEC != SWCODEC
343 if (global_settings.fade_on_stop
344 && (audio_stat & AUDIO_STATUS_PLAY))
345 {
346 fade(false, false);
347 }
348#endif
349 338
350#ifdef HAVE_DISK_STORAGE 339#ifdef HAVE_DISK_STORAGE
351 if (batt_safe) /* do not save on critical battery */ 340 if (batt_safe) /* do not save on critical battery */
352#endif 341#endif
353 { 342 {
354#if defined(HAVE_RECORDING) && CONFIG_CODEC == SWCODEC 343#if defined(HAVE_RECORDING)
355 if (audio_stat & AUDIO_STATUS_RECORD) 344 if (audio_stat & AUDIO_STATUS_RECORD)
356 { 345 {
357 rec_command(RECORDING_CMD_STOP); 346 rec_command(RECORDING_CMD_STOP);
@@ -368,13 +357,7 @@ static bool clean_shutdown(void (*callback)(void *), void *parameter)
368 if (callback != NULL) 357 if (callback != NULL)
369 callback(parameter); 358 callback(parameter);
370 359
371#if CONFIG_CODEC != SWCODEC 360#if defined(HAVE_RECORDING)
372 /* wait for audio_stop or audio_stop_recording to complete */
373 while (audio_status())
374 sleep(1);
375#endif
376
377#if defined(HAVE_RECORDING) && CONFIG_CODEC == SWCODEC
378 audio_close_recording(); 361 audio_close_recording();
379#endif 362#endif
380 scrobbler_shutdown(true); 363 scrobbler_shutdown(true);
@@ -403,9 +386,7 @@ static bool clean_shutdown(void (*callback)(void *), void *parameter)
403 enqueue = true; 386 enqueue = true;
404 } 387 }
405 talk_id(LANG_SHUTTINGDOWN, enqueue); 388 talk_id(LANG_SHUTTINGDOWN, enqueue);
406#if CONFIG_CODEC == SWCODEC
407 voice_wait(); 389 voice_wait();
408#endif
409 } 390 }
410 391
411 shutdown_hw(); 392 shutdown_hw();
@@ -426,10 +407,6 @@ bool list_stop_handler(void)
426 { 407 {
427 if (!global_settings.party_mode) 408 if (!global_settings.party_mode)
428 { 409 {
429#if CONFIG_CODEC != SWCODEC
430 if (global_settings.fade_on_stop)
431 fade(false, false);
432#endif
433 bookmark_autobookmark(true); 410 bookmark_autobookmark(true);
434 audio_stop(); 411 audio_stop();
435 ret = true; /* bookmarking can make a refresh necessary */ 412 ret = true; /* bookmarking can make a refresh necessary */
@@ -894,7 +871,6 @@ char *strip_extension(char* buffer, int buffer_size, const char *filename)
894 return buffer; 871 return buffer;
895} 872}
896 873
897#if CONFIG_CODEC == SWCODEC
898/* Play a standard sound */ 874/* Play a standard sound */
899void system_sound_play(enum system_sound sound) 875void system_sound_play(enum system_sound sound)
900{ 876{
@@ -1046,7 +1022,6 @@ void replaygain_update(void)
1046 settings.type = replaygain_setting_mode(settings.type); 1022 settings.type = replaygain_setting_mode(settings.type);
1047 dsp_replaygain_set_settings(&settings); 1023 dsp_replaygain_set_settings(&settings);
1048} 1024}
1049#endif /* CONFIG_CODEC == SWCODEC */
1050 1025
1051/* format a sound value like: -1.05 dB */ 1026/* format a sound value like: -1.05 dB */
1052int format_sound_value(char *buf, size_t size, int snd, int val) 1027int format_sound_value(char *buf, size_t size, int snd, int val)
diff --git a/apps/misc.h b/apps/misc.h
index 8d72e79a3d..10626dfaf4 100644
--- a/apps/misc.h
+++ b/apps/misc.h
@@ -181,7 +181,6 @@ enum current_activity {
181 ACTIVITY_USBSCREEN 181 ACTIVITY_USBSCREEN
182}; 182};
183 183
184#if CONFIG_CODEC == SWCODEC
185void beep_play(unsigned int frequency, unsigned int duration, 184void beep_play(unsigned int frequency, unsigned int duration,
186 unsigned int amplitude); 185 unsigned int amplitude);
187 186
@@ -209,9 +208,6 @@ void keyclick_click(bool rawbutton, int action);
209struct mp3entry; 208struct mp3entry;
210int id3_get_replaygain_mode(const struct mp3entry *id3); 209int id3_get_replaygain_mode(const struct mp3entry *id3);
211void replaygain_update(void); 210void replaygain_update(void);
212#else
213static inline void replaygain_update(void) {}
214#endif /* CONFIG_CODEC == SWCODEC */
215 211
216void push_current_activity(enum current_activity screen); 212void push_current_activity(enum current_activity screen);
217void pop_current_activity(void); 213void pop_current_activity(void);
diff --git a/apps/mpeg.c b/apps/mpeg.c
deleted file mode 100644
index e04c227cb1..0000000000
--- a/apps/mpeg.c
+++ /dev/null
@@ -1,1979 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2002 by Linus Nielsen Feltzing
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21#include <stdbool.h>
22#include <stdlib.h>
23#include "config.h"
24
25#if CONFIG_CODEC != SWCODEC
26
27#include "debug.h"
28#include "panic.h"
29#include "metadata.h"
30#include "mpeg.h"
31#include "audio.h"
32#include "storage.h"
33#include "string.h"
34#include <kernel.h>
35#include "thread.h"
36#include "errno.h"
37#include "mp3data.h"
38#include "core_alloc.h"
39#include "mp3_playback.h"
40#include "talk.h"
41#include "sound.h"
42#include "system.h"
43#include "appevents.h"
44#include "playlist.h"
45#include "cuesheet.h"
46#include "settings.h"
47#ifndef SIMULATOR
48#include "i2c.h"
49#include "system.h"
50#include "usb.h"
51#include "file.h"
52#include "hwcompat.h"
53#endif /* !SIMULATOR */
54#ifdef HAVE_LCD_BITMAP
55#include "lcd.h"
56#endif /* CONFIG_CODEC != SWCODEC */
57
58#define MPEG_SWAP_CHUNKSIZE 0x2000
59#define MPEG_HIGH_WATER 2 /* We leave 2 bytes empty because otherwise we
60 wouldn't be able to see the difference between
61 an empty buffer and a full one. */
62#define MPEG_LOW_WATER 0x60000
63#define MPEG_RECORDING_LOW_WATER 0x80000
64#define MPEG_LOW_WATER_CHUNKSIZE 0x40000
65#define MPEG_LOW_WATER_SWAP_CHUNKSIZE 0x10000
66#if (CONFIG_STORAGE & STORAGE_MMC)
67#define MPEG_PLAY_PENDING_THRESHOLD 0x20000
68#define MPEG_PLAY_PENDING_SWAPSIZE 0x20000
69#else
70#define MPEG_PLAY_PENDING_THRESHOLD 0x10000
71#define MPEG_PLAY_PENDING_SWAPSIZE 0x10000
72#endif
73
74#define MPEG_MAX_PRERECORD_SECONDS 30
75
76/* For ID3 info and VBR header */
77#define MPEG_RESERVED_HEADER_SPACE (4096 + 576)
78
79#ifndef SIMULATOR
80extern unsigned long mas_version_code;
81#endif
82
83#define MPEG_PLAY 1
84#define MPEG_STOP 2
85#define MPEG_PAUSE 3
86#define MPEG_RESUME 4
87#define MPEG_NEXT 5
88#define MPEG_PREV 6
89#define MPEG_FF_REWIND 7
90#define MPEG_FLUSH_RELOAD 8
91#define MPEG_RECORD 9
92#define MPEG_INIT_RECORDING 10
93#define MPEG_INIT_PLAYBACK 11
94#define MPEG_NEW_FILE 12
95#define MPEG_PAUSE_RECORDING 13
96#define MPEG_RESUME_RECORDING 14
97#define MPEG_NEED_DATA 100
98#define MPEG_TRACK_CHANGE 101
99#define MPEG_SAVE_DATA 102
100#define MPEG_STOP_DONE 103
101#define MPEG_PRERECORDING_TICK 104
102
103/* indicator for MPEG_NEED_DATA */
104#define GENERATE_UNBUFFER_EVENTS 1
105
106/* list of tracks in memory */
107#define MAX_TRACK_ENTRIES (1<<4) /* Must be power of 2 */
108#define MAX_TRACK_ENTRIES_MASK (MAX_TRACK_ENTRIES - 1)
109
110struct trackdata
111{
112 struct mp3entry id3;
113 int mempos;
114 int load_ahead_index;
115};
116
117static struct trackdata trackdata[MAX_TRACK_ENTRIES];
118
119static unsigned int current_track_counter = 0;
120
121#ifndef SIMULATOR
122static void stop_playing(void);
123
124static int track_read_idx = 0;
125static int track_write_idx = 0;
126#endif /* !SIMULATOR */
127
128/* Cuesheet support */
129static struct cuesheet *curr_cuesheet = NULL;
130static bool checked_for_cuesheet = false;
131
132static const char mpeg_thread_name[] = "mpeg";
133static unsigned int audio_thread_id;
134static bool audio_is_initialized;
135static unsigned int mpeg_errno;
136
137static bool playing = false; /* We are playing an MP3 stream */
138static bool is_playing = false; /* We are (attempting to) playing MP3 files */
139static bool paused; /* playback is paused */
140static int audiobuf_handle; /* handle to the audio buffer */
141static char* mpeg_audiobuf; /* poiunter to the audio buffer */
142static long audiobuflen; /* length of the audio buffer */
143#define AUDIO_BUFFER_RESERVE (256*1024)
144#ifdef SIMULATOR
145static char mpeg_stack[DEFAULT_STACK_SIZE];
146static struct mp3entry taginfo;
147#else /* !SIMULATOR */
148static struct event_queue mpeg_queue SHAREDBSS_ATTR;
149static long mpeg_stack[(DEFAULT_STACK_SIZE + 0x1000)/sizeof(long)];
150
151static int audiobuf_write;
152static int audiobuf_swapwrite;
153static long audiobuf_read;
154
155static int mpeg_file;
156
157static bool play_pending; /* We are about to start playing */
158static bool play_pending_track_change; /* When starting play we're starting a new file */
159static bool filling; /* We are filling the buffer with data from disk */
160static bool dma_underrun; /* True when the DMA has stopped because of
161 slow disk reading (read error, shaking) */
162static bool mpeg_stop_done;
163
164static int last_dma_tick = 0;
165static int last_dma_chunk_size;
166
167static long low_watermark; /* Dynamic low watermark level */
168static long low_watermark_margin = 0; /* Extra time in seconds for watermark */
169static long lowest_watermark_level; /* Debug value to observe the buffer
170 usage */
171
172struct audio_resume_info
173{
174 unsigned long elapsed;
175 unsigned long offset;
176};
177
178#ifdef HAVE_RECORDING
179static const unsigned char empty_id3_header[] =
180{
181 'I', 'D', '3', 0x03, 0x00, 0x00,
182 0x00, 0x00, 0x1f, 0x76 /* Size is 4096 minus 10 bytes for the header */
183};
184#endif /* HAVE_RECORDING */
185
186
187static int get_unplayed_space(void);
188static int get_playable_space(void);
189static int get_unswapped_space(void);
190#endif /* !SIMULATOR */
191
192static void audio_reset_buffer_noalloc(void* buf, size_t bufsize);
193static void audio_reset_buffer(void);
194
195
196#ifndef SIMULATOR
197static int num_tracks_in_memory(void)
198{
199 return (track_write_idx - track_read_idx) & MAX_TRACK_ENTRIES_MASK;
200}
201
202#ifdef DEBUG_TAGS
203static void debug_tags(void)
204{
205 int i;
206
207 for(i = 0;i < MAX_TRACK_ENTRIES;i++)
208 {
209 DEBUGF("%d - %s\n", i, trackdata[i].id3.path);
210 }
211 DEBUGF("read: %d, write :%d\n", track_read_idx, track_write_idx);
212 DEBUGF("num_tracks_in_memory: %d\n", num_tracks_in_memory());
213}
214#else /* !DEBUG_TAGS */
215#define debug_tags()
216#endif /* !DEBUG_TAGS */
217
218static void remove_current_tag(void)
219{
220 if(num_tracks_in_memory() > 0)
221 {
222 /* First move the index, so nobody tries to access the tag */
223 track_read_idx = (track_read_idx+1) & MAX_TRACK_ENTRIES_MASK;
224 checked_for_cuesheet = false;
225 debug_tags();
226 }
227 else
228 {
229 DEBUGF("remove_current_tag: no tracks to remove\n");
230 }
231}
232
233static void remove_all_non_current_tags(void)
234{
235 track_write_idx = (track_read_idx+1) & MAX_TRACK_ENTRIES_MASK;
236 debug_tags();
237}
238
239static void remove_all_tags(void)
240{
241 track_write_idx = track_read_idx;
242
243 debug_tags();
244}
245
246static struct trackdata *get_trackdata(int offset)
247{
248 if(offset >= num_tracks_in_memory())
249 return NULL;
250 else
251 return &trackdata[(track_read_idx + offset) & MAX_TRACK_ENTRIES_MASK];
252}
253#endif /* !SIMULATOR */
254
255/***********************************************************************/
256/* audio event handling */
257
258#define MAX_EVENT_HANDLERS 10
259struct event_handlers_table
260{
261 AUDIO_EVENT_HANDLER handler;
262 unsigned short mask;
263};
264static struct event_handlers_table event_handlers[MAX_EVENT_HANDLERS];
265static int event_handlers_count = 0;
266
267void audio_register_event_handler(AUDIO_EVENT_HANDLER handler, unsigned short mask)
268{
269 if (event_handlers_count < MAX_EVENT_HANDLERS)
270 {
271 event_handlers[event_handlers_count].handler = handler;
272 event_handlers[event_handlers_count].mask = mask;
273 event_handlers_count++;
274 }
275}
276
277/* dispatch calls each handler in the order registered and returns after some
278 handler actually handles the event (the event is assumed to no longer be valid
279 after this, due to the handler changing some condition); returns true if someone
280 handled the event, which is expected to cause the caller to skip its own handling
281 of the event */
282#ifndef SIMULATOR
283static bool audio_dispatch_event(unsigned short event, unsigned long data)
284{
285 int i = 0;
286 for(i=0; i < event_handlers_count; i++)
287 {
288 if ( event_handlers[i].mask & event )
289 {
290 int rc = event_handlers[i].handler(event, data);
291 if ( rc == AUDIO_EVENT_RC_HANDLED )
292 return true;
293 }
294 }
295 return false;
296}
297
298static void send_track_event(unsigned int id, struct mp3entry *id3)
299{
300 struct mp3entry *cur_id3 =
301 &trackdata[track_read_idx & MAX_TRACK_ENTRIES_MASK].id3;
302 unsigned int flags = id3 == cur_id3 ? TEF_CURRENT : 0;
303 send_event(id, &(struct track_event){ .flags = flags, .id3 = id3 });
304}
305#endif /* SIMULATOR */
306
307/***********************************************************************/
308
309static void set_elapsed(struct mp3entry* id3)
310{
311 if ( id3->vbr ) {
312 if ( id3->has_toc ) {
313 /* calculate elapsed time using TOC */
314 int i;
315 unsigned int remainder, plen, relpos, nextpos;
316
317 /* find wich percent we're at */
318 for (i=0; i<100; i++ )
319 {
320 if ( id3->offset < id3->toc[i] * (id3->filesize / 256) )
321 {
322 break;
323 }
324 }
325
326 i--;
327 if (i < 0)
328 i = 0;
329
330 relpos = id3->toc[i];
331
332 if (i < 99)
333 {
334 nextpos = id3->toc[i+1];
335 }
336 else
337 {
338 nextpos = 256;
339 }
340
341 remainder = id3->offset - (relpos * (id3->filesize / 256));
342
343 /* set time for this percent (divide before multiply to prevent
344 overflow on long files. loss of precision is negligible on
345 short files) */
346 id3->elapsed = i * (id3->length / 100);
347
348 /* calculate remainder time */
349 plen = (nextpos - relpos) * (id3->filesize / 256);
350 id3->elapsed += (((remainder * 100) / plen) *
351 (id3->length / 10000));
352 }
353 else {
354 /* no TOC exists. set a rough estimate using average bitrate */
355 int tpk = id3->length / (id3->filesize / 1024);
356 id3->elapsed = id3->offset / 1024 * tpk;
357 }
358 }
359 else
360 /* constant bitrate, use exact calculation */
361 id3->elapsed = id3->offset / (id3->bitrate / 8);
362}
363
364static int audio_get_file_pos_int(struct mp3entry *id3)
365{
366 int pos = -1;
367
368 if (id3->vbr)
369 {
370 if (id3->has_toc)
371 {
372 /* Use the TOC to find the new position */
373 unsigned int percent, remainder;
374 int curtoc, nexttoc, plen;
375
376 percent = (id3->elapsed*100)/id3->length;
377 if (percent > 99)
378 percent = 99;
379
380 curtoc = id3->toc[percent];
381
382 if (percent < 99)
383 nexttoc = id3->toc[percent+1];
384 else
385 nexttoc = 256;
386
387 pos = (id3->filesize/256)*curtoc;
388
389 /* Use the remainder to get a more accurate position */
390 remainder = (id3->elapsed*100)%id3->length;
391 remainder = (remainder*100)/id3->length;
392 plen = (nexttoc - curtoc)*(id3->filesize/256);
393 pos += (plen/100)*remainder;
394 }
395 else
396 {
397 /* No TOC exists, estimate the new position */
398 pos = (id3->filesize / (id3->length / 1000)) *
399 (id3->elapsed / 1000);
400 }
401 }
402 else if (id3->bitrate)
403 pos = id3->elapsed * (id3->bitrate / 8);
404 else
405 {
406 return -1;
407 }
408
409 if (pos >= (int)(id3->filesize - id3->id3v1len))
410 {
411 /* Don't seek right to the end of the file so that we can
412 transition properly to the next song */
413 pos = id3->filesize - id3->id3v1len - 1;
414 }
415 else if (pos < (int)id3->first_frame_offset)
416 {
417 /* skip past id3v2 tag and other leading garbage */
418 pos = id3->first_frame_offset;
419 }
420 return pos;
421}
422
423int audio_get_file_pos(void)
424{
425 struct mp3entry *id3 = audio_current_track();
426 return id3 ? audio_get_file_pos_int(id3) : 0;
427}
428
429unsigned long mpeg_get_last_header(void)
430{
431#ifdef SIMULATOR
432 return 0;
433#else /* !SIMULATOR */
434 unsigned long tmp[2];
435
436 /* Read the frame data from the MAS and reconstruct it with the
437 frame sync and all */
438 mas_readmem(MAS_BANK_D0, MAS_D0_MPEG_STATUS_1, tmp, 2);
439 return 0xffe00000 | ((tmp[0] & 0x7c00) << 6) | (tmp[1] & 0xffff);
440#endif /* !SIMULATOR */
441}
442
443static void do_stop(void)
444{
445 is_playing = false;
446 paused = false;
447
448#ifndef SIMULATOR
449 if (playing)
450 playlist_update_resume_info(audio_current_track());
451
452 stop_playing();
453 mpeg_stop_done = true;
454#else
455 playing = false;
456#endif
457}
458
459/* Buffer must not move. */
460static int shrink_callback(int handle, unsigned hints, void* start, size_t old_size)
461{
462 ssize_t extradata_size = old_size - audiobuflen;
463 /* check what buflib requests */
464 size_t wanted_size = (hints & BUFLIB_SHRINK_SIZE_MASK);
465 ssize_t size = (ssize_t)old_size - wanted_size;
466
467 /* keep at least 256K for the buffering */
468 if ((size - extradata_size) < AUDIO_BUFFER_RESERVE)
469 {
470 /* check if buflib needs the memory really hard. if yes we give
471 * up playback for now, otherwise refuse to shrink to keep at least
472 * 256K for the buffering */
473 if ((hints & BUFLIB_SHRINK_POS_MASK) != BUFLIB_SHRINK_POS_MASK)
474 return BUFLIB_CB_CANNOT_SHRINK;
475 }
476 /* TODO: Do it without stopping playback, if possible */
477 bool playing = (audio_status() & AUDIO_STATUS_PLAY) == AUDIO_STATUS_PLAY;
478 struct mp3entry *id3 = audio_current_track();
479 unsigned long elapsed = 0, offset = 0;
480 if (id3)
481 {
482 elapsed = id3->elapsed;
483 offset = id3->offset;
484 }
485 /* don't call audio_hard_stop() as it frees this handle */
486 if (thread_self() == audio_thread_id)
487 { /* inline case MPEG_STOP (audio_stop()) response
488 * if we're in the audio thread since audio_stop() otherwise deadlocks */
489 do_stop();
490 }
491 else
492 audio_stop();
493
494 switch (hints & BUFLIB_SHRINK_POS_MASK)
495 {
496 case BUFLIB_SHRINK_POS_BACK:
497 core_shrink(handle, start, size);
498 audio_reset_buffer_noalloc(start, size);
499 break;
500 case BUFLIB_SHRINK_POS_FRONT:
501 core_shrink(handle, start + wanted_size, size);
502 audio_reset_buffer_noalloc(start + wanted_size, size);
503 break;
504 case BUFLIB_SHRINK_POS_MASK:
505 audiobuf_handle = core_free(audiobuf_handle);
506 mpeg_audiobuf = NULL;
507 talk_buffer_set_policy(TALK_BUFFER_DEFAULT);
508 playing = false;
509 break;
510 }
511 if (playing)
512 { /* safe to call even from the audio thread (due to queue_post()) */
513 audio_play(elapsed, offset);
514 }
515
516 return BUFLIB_CB_OK;
517}
518
519static struct buflib_callbacks ops = {
520 .move_callback = NULL,
521 .shrink_callback = shrink_callback,
522};
523
524#ifndef SIMULATOR
525/* Send callback events to notify about removing old tracks. */
526static void generate_unbuffer_events(void)
527{
528 int i;
529 int numentries = MAX_TRACK_ENTRIES - num_tracks_in_memory();
530 int cur_idx = track_write_idx;
531
532 for (i = 0; i < numentries; i++)
533 {
534 /* Send an event to notify that track has finished. */
535 send_track_event(PLAYBACK_EVENT_TRACK_FINISH, &trackdata[cur_idx].id3);
536 cur_idx = (cur_idx + 1) & MAX_TRACK_ENTRIES_MASK;
537 }
538}
539
540/* Send callback events to notify about new tracks. */
541static void generate_postbuffer_events(void)
542{
543 int i;
544 int numentries = num_tracks_in_memory();
545 int cur_idx = track_read_idx;
546
547 for (i = 0; i < numentries; i++)
548 {
549 send_track_event(PLAYBACK_EVENT_TRACK_BUFFER, &trackdata[cur_idx].id3);
550 cur_idx = (cur_idx + 1) & MAX_TRACK_ENTRIES_MASK;
551 }
552}
553
554static void recalculate_watermark(int bitrate)
555{
556 int bytes_per_sec;
557 int time = storage_spinup_time();
558
559 /* A bitrate of 0 probably means empty VBR header. We play safe
560 and set a high threshold */
561 if(bitrate == 0)
562 bitrate = 320;
563
564 bytes_per_sec = bitrate * 1000 / 8;
565
566 if(time)
567 {
568 /* No drive spins up faster than 3.5s */
569 if(time < 350)
570 time = 350;
571
572 time = time * 3;
573 low_watermark = ((low_watermark_margin * HZ + time) *
574 bytes_per_sec) / HZ;
575 }
576 else
577 {
578 low_watermark = MPEG_LOW_WATER;
579 }
580}
581
582#ifdef HAVE_DISK_STORAGE
583void audio_set_buffer_margin(int setting)
584{
585 low_watermark_margin = setting; /* in seconds */
586}
587#endif
588
589void audio_get_debugdata(struct audio_debug *dbgdata)
590{
591 dbgdata->audiobuflen = audiobuflen;
592 dbgdata->audiobuf_write = audiobuf_write;
593 dbgdata->audiobuf_swapwrite = audiobuf_swapwrite;
594 dbgdata->audiobuf_read = audiobuf_read;
595
596 dbgdata->last_dma_chunk_size = last_dma_chunk_size;
597
598 dbgdata->playing = playing;
599 dbgdata->play_pending = play_pending;
600 dbgdata->is_playing = is_playing;
601 dbgdata->filling = filling;
602 dbgdata->dma_underrun = dma_underrun;
603
604 dbgdata->unplayed_space = get_unplayed_space();
605 dbgdata->playable_space = get_playable_space();
606 dbgdata->unswapped_space = get_unswapped_space();
607
608 dbgdata->low_watermark_level = low_watermark;
609 dbgdata->lowest_watermark_level = lowest_watermark_level;
610}
611
612#ifdef DEBUG
613static void dbg_timer_start(void)
614{
615 /* We are using timer 2 */
616
617 TSTR &= ~0x04; /* Stop the timer */
618 TSNC &= ~0x04; /* No synchronization */
619 TMDR &= ~0x44; /* Operate normally */
620
621 TCNT2 = 0; /* Start counting at 0 */
622 TCR2 = 0x03; /* Sysclock/8 */
623
624 TSTR |= 0x04; /* Start timer 2 */
625}
626
627static int dbg_cnt2us(unsigned int cnt)
628{
629 return (cnt * 10000) / (FREQ/800);
630}
631#endif /* DEBUG */
632
633static int get_unplayed_space(void)
634{
635 int space = audiobuf_write - audiobuf_read;
636 if (space < 0)
637 space += audiobuflen;
638 return space;
639}
640
641static int get_playable_space(void)
642{
643 int space = audiobuf_swapwrite - audiobuf_read;
644 if (space < 0)
645 space += audiobuflen;
646 return space;
647}
648
649static int get_unplayed_space_current_song(void)
650{
651 int space;
652
653 if (num_tracks_in_memory() > 1)
654 {
655 space = get_trackdata(1)->mempos - audiobuf_read;
656 }
657 else
658 {
659 space = audiobuf_write - audiobuf_read;
660 }
661
662 if (space < 0)
663 space += audiobuflen;
664
665 return space;
666}
667
668static int get_unswapped_space(void)
669{
670 int space = audiobuf_write - audiobuf_swapwrite;
671 if (space < 0)
672 space += audiobuflen;
673 return space;
674}
675
676void playback_tick(void)
677{
678 struct trackdata *ptd = get_trackdata(0);
679 if(ptd)
680 {
681 ptd->id3.elapsed += (current_tick - last_dma_tick) * 1000 / HZ;
682 last_dma_tick = current_tick;
683 audio_dispatch_event(AUDIO_EVENT_POS_REPORT,
684 (unsigned long)ptd->id3.elapsed);
685 }
686}
687
688static void reset_mp3_buffer(void)
689{
690 audiobuf_read = 0;
691 audiobuf_write = 0;
692 audiobuf_swapwrite = 0;
693 lowest_watermark_level = audiobuflen;
694}
695
696 /* DMA transfer end interrupt callback */
697static void transfer_end(const void** ppbuf, size_t* psize)
698{
699 if(playing && !paused)
700 {
701 int unplayed_space_left;
702 int space_until_end_of_buffer;
703 int track_offset = 1;
704 struct trackdata *track;
705
706 audiobuf_read += last_dma_chunk_size;
707 if(audiobuf_read >= audiobuflen)
708 audiobuf_read = 0;
709
710 /* First, check if we are on a track boundary */
711 if (num_tracks_in_memory() > 1)
712 {
713 if (audiobuf_read == get_trackdata(track_offset)->mempos)
714 {
715 if ( ! audio_dispatch_event(AUDIO_EVENT_END_OF_TRACK, 0) )
716 {
717 queue_post(&mpeg_queue, MPEG_TRACK_CHANGE, 0);
718 track_offset++;
719 }
720 }
721 }
722
723 unplayed_space_left = get_unplayed_space();
724
725 space_until_end_of_buffer = audiobuflen - audiobuf_read;
726
727 if(!filling && unplayed_space_left < low_watermark)
728 {
729 filling = true;
730 queue_post(&mpeg_queue, MPEG_NEED_DATA, GENERATE_UNBUFFER_EVENTS);
731 }
732
733 if(unplayed_space_left)
734 {
735 last_dma_chunk_size = MIN(0x2000, unplayed_space_left);
736 last_dma_chunk_size = MIN(last_dma_chunk_size,
737 space_until_end_of_buffer);
738
739 /* several tracks loaded? */
740 track = get_trackdata(track_offset);
741 if(track)
742 {
743 /* will we move across the track boundary? */
744 if (( audiobuf_read < track->mempos ) &&
745 ((audiobuf_read+last_dma_chunk_size) >
746 track->mempos ))
747 {
748 /* Make sure that we end exactly on the boundary */
749 last_dma_chunk_size = track->mempos - audiobuf_read;
750 }
751 }
752
753 *psize = last_dma_chunk_size & 0xffff;
754 *ppbuf = mpeg_audiobuf + audiobuf_read;
755 track = get_trackdata(0);
756 if(track)
757 track->id3.offset += last_dma_chunk_size;
758
759 /* Update the watermark debug level */
760 if(unplayed_space_left < lowest_watermark_level)
761 lowest_watermark_level = unplayed_space_left;
762 }
763 else
764 {
765 /* Check if the end of data is because of a hard disk error.
766 If there is an open file handle, we are still playing music.
767 If not, the last file has been loaded, and the file handle is
768 closed. */
769 if(mpeg_file >= 0)
770 {
771 /* Update the watermark debug level */
772 if(unplayed_space_left < lowest_watermark_level)
773 lowest_watermark_level = unplayed_space_left;
774
775 DEBUGF("DMA underrun.\n");
776 dma_underrun = true;
777 }
778 else
779 {
780 if ( ! audio_dispatch_event(AUDIO_EVENT_END_OF_TRACK, 0) )
781 {
782 DEBUGF("No more MP3 data. Stopping.\n");
783 queue_post(&mpeg_queue, MPEG_TRACK_CHANGE, 0);
784 playing = false;
785 }
786 }
787 *psize = 0; /* no more transfer */
788 }
789 }
790}
791
792static struct trackdata *add_track_to_tag_list(const char *filename)
793{
794 struct trackdata *track;
795 bool send_nid3_event;
796
797 if(num_tracks_in_memory() >= MAX_TRACK_ENTRIES)
798 {
799 DEBUGF("Tag memory is full\n");
800 return NULL;
801 }
802
803 track = &trackdata[track_write_idx];
804
805 /* grab id3 tag of new file and
806 remember where in memory it starts */
807 if(mp3info(&track->id3, filename))
808 {
809 DEBUGF("Bad mp3\n");
810 return NULL;
811 }
812 track->mempos = audiobuf_write;
813 track->id3.elapsed = 0;
814#ifdef HAVE_LCD_BITMAP
815 if (track->id3.title)
816 lcd_getstringsize(track->id3.title, NULL, NULL);
817 if (track->id3.artist)
818 lcd_getstringsize(track->id3.artist, NULL, NULL);
819 if (track->id3.album)
820 lcd_getstringsize(track->id3.album, NULL, NULL);
821#endif
822
823 /* if this track is the next track then let the UI know it can get it */
824 send_nid3_event = (track_write_idx == track_read_idx + 1);
825 track_write_idx = (track_write_idx+1) & MAX_TRACK_ENTRIES_MASK;
826 if (send_nid3_event)
827 send_track_event(PLAYBACK_EVENT_NEXTTRACKID3_AVAILABLE, &track->id3);
828 debug_tags();
829 return track;
830}
831
832static int new_file(int steps)
833{
834 int max_steps = playlist_amount();
835 int start = 0;
836 int i;
837 struct trackdata *track;
838 char name_buf[MAX_PATH+1];
839 const char *trackname;
840
841 /* Find out how many steps to advance. The load_ahead_index field tells
842 us how many playlist entries it had to skip to get to a valid one.
843 We add those together to find out where to start. */
844 if(steps > 0 && num_tracks_in_memory() > 1)
845 {
846 /* Begin with the song after the currently playing one */
847 i = 1;
848 while((track = get_trackdata(i++)))
849 {
850 start += track->load_ahead_index;
851 }
852 }
853
854 do {
855 trackname = playlist_peek(start + steps, name_buf, sizeof(name_buf));
856 if ( !trackname )
857 return -1;
858
859 DEBUGF("Loading %s\n", trackname);
860
861 mpeg_file = open(trackname, O_RDONLY);
862 if(mpeg_file < 0) {
863 DEBUGF("Couldn't open file: %s\n",trackname);
864 if(steps < 0)
865 steps--;
866 else
867 steps++;
868 }
869 else
870 {
871 struct trackdata *track = add_track_to_tag_list(trackname);
872
873 if(!track)
874 {
875 /* Bad mp3 file */
876 if(steps < 0)
877 steps--;
878 else
879 steps++;
880 close(mpeg_file);
881 mpeg_file = -1;
882 }
883 else
884 {
885 /* skip past id3v2 tag */
886 lseek(mpeg_file,
887 track->id3.first_frame_offset,
888 SEEK_SET);
889 track->id3.index = steps;
890 track->load_ahead_index = steps;
891 track->id3.offset = 0;
892
893 if(track->id3.vbr)
894 /* Average bitrate * 1.5 */
895 recalculate_watermark(
896 (track->id3.bitrate * 3) / 2);
897 else
898 recalculate_watermark(
899 track->id3.bitrate);
900
901 }
902 }
903
904 /* Bail out if no file could be opened */
905 if(abs(steps) > max_steps)
906 return -1;
907 } while ( mpeg_file < 0 );
908
909 return 0;
910}
911
912static void stop_playing(void)
913{
914 /* Stop the current stream */
915 mp3_play_stop();
916 playing = false;
917 filling = false;
918
919 if(mpeg_file >= 0)
920 close(mpeg_file);
921 mpeg_file = -1;
922 remove_all_tags();
923 generate_unbuffer_events();
924 reset_mp3_buffer();
925}
926
927static void end_current_track(void)
928{
929 play_pending = false;
930 playing = false;
931 mp3_play_pause(false);
932
933 reset_mp3_buffer();
934 remove_all_tags();
935 generate_unbuffer_events();
936
937 if(mpeg_file >= 0)
938 close(mpeg_file);
939}
940
941/* Is this a really the end of playback or is a new playlist starting */
942static void check_playlist_end(int direction)
943{
944 /* Use the largest possible step size to account for skipped tracks */
945 int steps = playlist_amount();
946
947 if (direction < 0)
948 steps = -steps;
949
950 if (playlist_next(steps) < 0)
951 is_playing = false;
952}
953
954static void update_playlist(void)
955{
956 if (num_tracks_in_memory() > 0)
957 {
958 struct trackdata *track = get_trackdata(0);
959 track->id3.index = playlist_next(track->id3.index);
960 }
961 else
962 {
963 /* End of playlist? */
964 check_playlist_end(1);
965 }
966
967 playlist_update_resume_info(audio_current_track());
968}
969
970static void track_change(void)
971{
972 DEBUGF("Track change\n");
973
974 if (num_tracks_in_memory() > 0)
975 {
976 remove_current_tag();
977 update_playlist();
978 if (is_playing)
979 {
980 send_track_event(PLAYBACK_EVENT_TRACK_CHANGE,
981 audio_current_track());
982 }
983 }
984
985 current_track_counter++;
986}
987
988#ifdef DEBUG
989void hexdump(const unsigned char *buf, int len)
990{
991 int i;
992
993 for(i = 0;i < len;i++)
994 {
995 if(i && (i & 15) == 0)
996 {
997 DEBUGF("\n");
998 }
999 DEBUGF("%02x ", buf[i]);
1000 }
1001 DEBUGF("\n");
1002}
1003#endif /* DEBUG */
1004
1005static void start_playback_if_ready(void)
1006{
1007 int playable_space;
1008
1009 playable_space = audiobuf_swapwrite - audiobuf_read;
1010 if(playable_space < 0)
1011 playable_space += audiobuflen;
1012
1013 /* See if we have started playing yet. If not, do it. */
1014 if(play_pending || dma_underrun)
1015 {
1016 /* If the filling has stopped, and we still haven't reached
1017 the watermark, the file must be smaller than the
1018 watermark. We must still play it. */
1019 if((playable_space >= MPEG_PLAY_PENDING_THRESHOLD) ||
1020 !filling || dma_underrun)
1021 {
1022 DEBUGF("P\n");
1023 if (play_pending) /* don't do this when recovering from DMA underrun */
1024 {
1025 generate_postbuffer_events(); /* signal first track as buffered */
1026 if (play_pending_track_change)
1027 {
1028 play_pending_track_change = false;
1029 send_track_event(PLAYBACK_EVENT_TRACK_CHANGE,
1030 audio_current_track());
1031 }
1032 play_pending = false;
1033 }
1034 playing = true;
1035
1036 last_dma_chunk_size = MIN(0x2000, get_unplayed_space_current_song());
1037 mp3_play_data(mpeg_audiobuf + audiobuf_read, last_dma_chunk_size, transfer_end);
1038 dma_underrun = false;
1039
1040 if (!paused)
1041 {
1042 last_dma_tick = current_tick;
1043 mp3_play_pause(true);
1044 }
1045
1046 /* Tell ourselves that we need more data */
1047 queue_post(&mpeg_queue, MPEG_NEED_DATA, 0);
1048 }
1049 }
1050}
1051
1052static bool swap_one_chunk(void)
1053{
1054 int free_space_left;
1055 int amount_to_swap;
1056
1057 free_space_left = get_unswapped_space();
1058
1059 if(free_space_left == 0 && !play_pending)
1060 return false;
1061
1062 /* Swap in larger chunks when the user is waiting for the playback
1063 to start, or when there is dangerously little playable data left */
1064 if(play_pending)
1065 amount_to_swap = MIN(MPEG_PLAY_PENDING_SWAPSIZE, free_space_left);
1066 else
1067 {
1068 if(get_playable_space() < low_watermark)
1069 amount_to_swap = MIN(MPEG_LOW_WATER_SWAP_CHUNKSIZE,
1070 free_space_left);
1071 else
1072 amount_to_swap = MIN(MPEG_SWAP_CHUNKSIZE, free_space_left);
1073 }
1074
1075 if(audiobuf_write < audiobuf_swapwrite)
1076 amount_to_swap = MIN(audiobuflen - audiobuf_swapwrite,
1077 amount_to_swap);
1078 else
1079 amount_to_swap = MIN(audiobuf_write - audiobuf_swapwrite,
1080 amount_to_swap);
1081
1082 bitswap(mpeg_audiobuf + audiobuf_swapwrite, amount_to_swap);
1083
1084 audiobuf_swapwrite += amount_to_swap;
1085 if(audiobuf_swapwrite >= audiobuflen)
1086 {
1087 audiobuf_swapwrite = 0;
1088 }
1089
1090 return true;
1091}
1092
1093static void mpeg_thread(void)
1094{
1095 static int pause_tick = 0;
1096 static unsigned int pause_track = 0;
1097 struct queue_event ev;
1098 int len;
1099 int free_space_left;
1100 int unplayed_space_left;
1101 int amount_to_read;
1102 int t1, t2;
1103 unsigned long start_elapsed, start_offset;
1104
1105 is_playing = false;
1106 play_pending = false;
1107 playing = false;
1108 mpeg_file = -1;
1109
1110 while(1)
1111 {
1112 yield();
1113
1114 /* Swap if necessary, and don't block on the queue_wait() */
1115 if(swap_one_chunk())
1116 {
1117 queue_wait_w_tmo(&mpeg_queue, &ev, 0);
1118 }
1119 else if (playing)
1120 {
1121 /* periodically update resume info */
1122 queue_wait_w_tmo(&mpeg_queue, &ev, HZ/2);
1123 }
1124 else
1125 {
1126 DEBUGF("S R:%x W:%x SW:%x\n",
1127 audiobuf_read, audiobuf_write, audiobuf_swapwrite);
1128 queue_wait(&mpeg_queue, &ev);
1129 }
1130
1131 start_playback_if_ready();
1132
1133 switch(ev.id)
1134 {
1135 case MPEG_PLAY:
1136 DEBUGF("MPEG_PLAY\n");
1137
1138#if CONFIG_TUNER
1139 /* Silence the A/D input, it may be on because the radio
1140 may be playing */
1141 mas_codec_writereg(6, 0x0000);
1142#endif /* CONFIG_TUNER */
1143
1144 /* Stop the current stream */
1145 paused = false;
1146 end_current_track();
1147
1148 if ( new_file(0) == -1 )
1149 {
1150 is_playing = false;
1151 track_change();
1152 break;
1153 }
1154
1155 start_elapsed = ((struct audio_resume_info *)ev.data)->elapsed;
1156 start_offset = ((struct audio_resume_info *)ev.data)->offset;
1157
1158 /* mid-song resume? */
1159 if (!start_offset && start_elapsed) {
1160 struct mp3entry *id3 = &get_trackdata(0)->id3;
1161 id3->elapsed = start_elapsed;
1162 start_offset = audio_get_file_pos_int(id3);
1163 }
1164
1165 if (start_offset) {
1166 struct mp3entry* id3 = &get_trackdata(0)->id3;
1167 lseek(mpeg_file, start_offset, SEEK_SET);
1168 id3->offset = start_offset;
1169 set_elapsed(id3);
1170 }
1171 else {
1172 /* skip past id3v2 tag */
1173 lseek(mpeg_file,
1174 get_trackdata(0)->id3.first_frame_offset,
1175 SEEK_SET);
1176
1177 }
1178
1179 /* Make it read more data */
1180 filling = true;
1181 queue_post(&mpeg_queue, MPEG_NEED_DATA, 0);
1182
1183 /* Tell the file loading code that we want to start playing
1184 as soon as we have some data */
1185 play_pending = true;
1186 play_pending_track_change = true;
1187
1188 update_playlist();
1189 current_track_counter++;
1190 break;
1191
1192 case MPEG_STOP:
1193 do_stop();
1194 break;
1195
1196 case MPEG_PAUSE:
1197 DEBUGF("MPEG_PAUSE\n");
1198 /* Stop the current stream */
1199 if (playing)
1200 playlist_update_resume_info(audio_current_track());
1201 paused = true;
1202 playing = false;
1203 pause_tick = current_tick;
1204 pause_track = current_track_counter;
1205 mp3_play_pause(false);
1206 break;
1207
1208 case MPEG_RESUME:
1209 DEBUGF("MPEG_RESUME\n");
1210 /* Continue the current stream */
1211 paused = false;
1212 if (!play_pending)
1213 {
1214 playing = true;
1215 if ( current_track_counter == pause_track )
1216 last_dma_tick += current_tick - pause_tick;
1217 else
1218 last_dma_tick = current_tick;
1219 pause_tick = 0;
1220 mp3_play_pause(true);
1221 }
1222 break;
1223
1224 case MPEG_NEXT:
1225 DEBUGF("MPEG_NEXT\n");
1226 /* is next track in ram? */
1227 if ( num_tracks_in_memory() > 1 ) {
1228 int unplayed_space_left, unswapped_space_left;
1229
1230 /* stop the current stream */
1231 play_pending = false;
1232 playing = false;
1233 mp3_play_pause(false);
1234
1235 track_change();
1236 audiobuf_read = get_trackdata(0)->mempos;
1237 last_dma_chunk_size = MIN(0x2000, get_unplayed_space_current_song());
1238 mp3_play_data(mpeg_audiobuf + audiobuf_read, last_dma_chunk_size, transfer_end);
1239 dma_underrun = false;
1240 last_dma_tick = current_tick;
1241
1242 unplayed_space_left = get_unplayed_space();
1243 unswapped_space_left = get_unswapped_space();
1244
1245 /* should we start reading more data? */
1246 if(!filling && (unplayed_space_left < low_watermark)) {
1247 filling = true;
1248 queue_post(&mpeg_queue, MPEG_NEED_DATA, GENERATE_UNBUFFER_EVENTS);
1249 play_pending = true;
1250 } else if(unswapped_space_left &&
1251 unswapped_space_left > unplayed_space_left) {
1252 /* Stop swapping the data from the previous file */
1253 audiobuf_swapwrite = audiobuf_read;
1254 play_pending = true;
1255 } else {
1256 playing = true;
1257 if (!paused)
1258 mp3_play_pause(true);
1259 }
1260 }
1261 else {
1262 if (!playlist_check(1))
1263 break;
1264
1265 /* stop the current stream */
1266 end_current_track();
1267
1268 if (new_file(1) < 0) {
1269 DEBUGF("No more files to play\n");
1270 filling = false;
1271
1272 check_playlist_end(1);
1273 current_track_counter++;
1274 } else {
1275 /* Make it read more data */
1276 filling = true;
1277 queue_post(&mpeg_queue, MPEG_NEED_DATA, 0);
1278
1279 /* Tell the file loading code that we want
1280 to start playing as soon as we have some data */
1281 play_pending = true;
1282 play_pending_track_change = true;
1283
1284 update_playlist();
1285 current_track_counter++;
1286 }
1287 }
1288 break;
1289
1290 case MPEG_PREV: {
1291 DEBUGF("MPEG_PREV\n");
1292
1293 if (!playlist_check(-1))
1294 break;
1295
1296 /* stop the current stream */
1297 end_current_track();
1298
1299 /* Open the next file */
1300 if (new_file(-1) < 0) {
1301 DEBUGF("No more files to play\n");
1302 filling = false;
1303
1304 check_playlist_end(-1);
1305 current_track_counter++;
1306 } else {
1307 /* Make it read more data */
1308 filling = true;
1309 queue_post(&mpeg_queue, MPEG_NEED_DATA, 0);
1310
1311 /* Tell the file loading code that we want to
1312 start playing as soon as we have some data */
1313 play_pending = true;
1314 play_pending_track_change = true;
1315
1316 update_playlist();
1317 current_track_counter++;
1318 }
1319 break;
1320 }
1321
1322 case MPEG_FF_REWIND: {
1323 struct mp3entry *id3 = audio_current_track();
1324 unsigned int oldtime = id3->elapsed;
1325 unsigned int newtime = (unsigned int)ev.data;
1326 int curpos, newpos, diffpos;
1327 DEBUGF("MPEG_FF_REWIND\n");
1328
1329 id3->elapsed = newtime;
1330
1331 newpos = audio_get_file_pos_int(id3);
1332 if(newpos < 0)
1333 {
1334 id3->elapsed = oldtime;
1335 break;
1336 }
1337
1338 if (mpeg_file >= 0)
1339 curpos = lseek(mpeg_file, 0, SEEK_CUR);
1340 else
1341 curpos = id3->filesize;
1342
1343 if (num_tracks_in_memory() > 1)
1344 {
1345 /* We have started loading other tracks that need to be
1346 accounted for */
1347 struct trackdata *track;
1348 int i = 0;
1349
1350 while((track = get_trackdata(i++)))
1351 {
1352 curpos += track->id3.filesize;
1353 }
1354 }
1355
1356 diffpos = curpos - newpos;
1357
1358 if(!filling && diffpos >= 0 && diffpos < audiobuflen)
1359 {
1360 int unplayed_space_left, unswapped_space_left;
1361
1362 /* We are changing to a position that's already in
1363 memory, so we just move the DMA read pointer. */
1364 audiobuf_read = audiobuf_write - diffpos;
1365 if (audiobuf_read < 0)
1366 {
1367 audiobuf_read += audiobuflen;
1368 }
1369
1370 unplayed_space_left = get_unplayed_space();
1371 unswapped_space_left = get_unswapped_space();
1372
1373 /* If unswapped_space_left is larger than
1374 unplayed_space_left, it means that the swapwrite pointer
1375 hasn't yet advanced up to the new location of the read
1376 pointer. We just move it, there is no need to swap
1377 data that won't be played anyway. */
1378
1379 if (unswapped_space_left > unplayed_space_left)
1380 {
1381 DEBUGF("Moved swapwrite\n");
1382 audiobuf_swapwrite = audiobuf_read;
1383 play_pending = true;
1384 }
1385
1386 if (mpeg_file>=0 && unplayed_space_left < low_watermark)
1387 {
1388 /* We need to load more data before starting */
1389 filling = true;
1390 queue_post(&mpeg_queue, MPEG_NEED_DATA, GENERATE_UNBUFFER_EVENTS);
1391 play_pending = true;
1392 }
1393 else
1394 {
1395 /* resume will start at new position */
1396 last_dma_chunk_size =
1397 MIN(0x2000, get_unplayed_space_current_song());
1398 mp3_play_data(mpeg_audiobuf + audiobuf_read,
1399 last_dma_chunk_size, transfer_end);
1400 dma_underrun = false;
1401 }
1402 }
1403 else
1404 {
1405 /* Move to the new position in the file and start
1406 loading data */
1407 reset_mp3_buffer();
1408
1409 if (num_tracks_in_memory() > 1)
1410 {
1411 /* We have to reload the current track */
1412 close(mpeg_file);
1413 remove_all_non_current_tags();
1414 generate_unbuffer_events();
1415 mpeg_file = -1;
1416 }
1417
1418 if (mpeg_file < 0)
1419 {
1420 mpeg_file = open(id3->path, O_RDONLY);
1421 if (mpeg_file < 0)
1422 {
1423 id3->elapsed = oldtime;
1424 break;
1425 }
1426 }
1427
1428 if(-1 == lseek(mpeg_file, newpos, SEEK_SET))
1429 {
1430 id3->elapsed = oldtime;
1431 break;
1432 }
1433
1434 filling = true;
1435 queue_post(&mpeg_queue, MPEG_NEED_DATA, 0);
1436
1437 /* Tell the file loading code that we want to start playing
1438 as soon as we have some data */
1439 play_pending = true;
1440 }
1441
1442 id3->offset = newpos;
1443
1444 break;
1445 }
1446
1447 case MPEG_FLUSH_RELOAD: {
1448 int numtracks = num_tracks_in_memory();
1449 bool reload_track = false;
1450
1451 if (numtracks > 1)
1452 {
1453 /* Reset the buffer */
1454 audiobuf_write = get_trackdata(1)->mempos;
1455
1456 /* Reset swapwrite unless we're still swapping current
1457 track */
1458 if (get_unplayed_space() <= get_playable_space())
1459 audiobuf_swapwrite = audiobuf_write;
1460
1461 close(mpeg_file);
1462 remove_all_non_current_tags();
1463 generate_unbuffer_events();
1464 mpeg_file = -1;
1465 reload_track = true;
1466 }
1467 else if (numtracks == 1 && mpeg_file < 0)
1468 {
1469 reload_track = true;
1470 }
1471
1472 if(reload_track && new_file(1) >= 0)
1473 {
1474 /* Tell ourselves that we want more data */
1475 filling = true;
1476 queue_post(&mpeg_queue, MPEG_NEED_DATA, 0);
1477 }
1478
1479 break;
1480 }
1481
1482 case MPEG_NEED_DATA:
1483 free_space_left = audiobuf_read - audiobuf_write;
1484
1485 /* We interpret 0 as "empty buffer" */
1486 if(free_space_left <= 0)
1487 free_space_left += audiobuflen;
1488
1489 unplayed_space_left = audiobuflen - free_space_left;
1490
1491 /* Make sure that we don't fill the entire buffer */
1492 free_space_left -= MPEG_HIGH_WATER;
1493
1494 if (ev.data == GENERATE_UNBUFFER_EVENTS)
1495 generate_unbuffer_events();
1496
1497 /* do we have any more buffer space to fill? */
1498 if(free_space_left <= 0)
1499 {
1500 DEBUGF("0\n");
1501 filling = false;
1502 generate_postbuffer_events();
1503 storage_sleep();
1504 break;
1505 }
1506
1507 /* Read small chunks while we are below the low water mark */
1508 if(unplayed_space_left < low_watermark)
1509 amount_to_read = MIN(MPEG_LOW_WATER_CHUNKSIZE,
1510 free_space_left);
1511 else
1512 amount_to_read = free_space_left;
1513
1514 /* Don't read more than until the end of the buffer */
1515 amount_to_read = MIN(audiobuflen - audiobuf_write,
1516 amount_to_read);
1517#if (CONFIG_STORAGE & STORAGE_MMC)
1518 /* MMC is slow, so don't read too large chunks */
1519 amount_to_read = MIN(0x40000, amount_to_read);
1520#elif MEMORYSIZE == 8
1521 amount_to_read = MIN(0x100000, amount_to_read);
1522#endif
1523
1524 /* Read as much mpeg data as we can fit in the buffer */
1525 if(mpeg_file >= 0)
1526 {
1527 DEBUGF("R\n");
1528 t1 = current_tick;
1529 len = read(mpeg_file, mpeg_audiobuf + audiobuf_write,
1530 amount_to_read);
1531 if(len > 0)
1532 {
1533 t2 = current_tick;
1534 DEBUGF("time: %d\n", t2 - t1);
1535 DEBUGF("R: %x\n", len);
1536
1537 /* Now make sure that we don't feed the MAS with ID3V1
1538 data */
1539 if (len < amount_to_read)
1540 {
1541 int i;
1542 static const unsigned char tag[] = "TAG";
1543 int taglen = 128;
1544 int tagptr = audiobuf_write + len - 128;
1545
1546 /* Really rare case: entire potential tag wasn't
1547 read in this call AND audiobuf_write < 128 */
1548 if (tagptr < 0)
1549 tagptr += audiobuflen;
1550
1551 for(i = 0;i < 3;i++)
1552 {
1553 if(tagptr >= audiobuflen)
1554 tagptr -= audiobuflen;
1555
1556 if(mpeg_audiobuf[tagptr] != tag[i])
1557 {
1558 taglen = 0;
1559 break;
1560 }
1561
1562 tagptr++;
1563 }
1564
1565 if(taglen)
1566 {
1567 /* Skip id3v1 tag */
1568 DEBUGF("Skipping ID3v1 tag\n");
1569 len -= taglen;
1570
1571 /* In the very rare case when the entire tag
1572 wasn't read in this read() len will be < 0.
1573 Take care of this when changing the write
1574 pointer. */
1575 }
1576 }
1577
1578 audiobuf_write += len;
1579
1580 if (audiobuf_write < 0)
1581 audiobuf_write += audiobuflen;
1582
1583 if(audiobuf_write >= audiobuflen)
1584 {
1585 audiobuf_write = 0;
1586 DEBUGF("W\n");
1587 }
1588
1589 /* Tell ourselves that we want more data */
1590 queue_post(&mpeg_queue, MPEG_NEED_DATA, 0);
1591 }
1592 else
1593 {
1594 if(len < 0)
1595 {
1596 DEBUGF("MPEG read error\n");
1597 }
1598
1599 close(mpeg_file);
1600 mpeg_file = -1;
1601
1602 if(new_file(1) < 0)
1603 {
1604 /* No more data to play */
1605 DEBUGF("No more files to play\n");
1606 filling = false;
1607 }
1608 else
1609 {
1610 /* Tell ourselves that we want more data */
1611 queue_post(&mpeg_queue, MPEG_NEED_DATA, 0);
1612 }
1613 }
1614 }
1615 break;
1616
1617 case MPEG_TRACK_CHANGE:
1618 track_change();
1619 break;
1620
1621#ifndef USB_NONE
1622 case SYS_USB_CONNECTED:
1623 is_playing = false;
1624 paused = false;
1625 stop_playing();
1626
1627 /* Tell the USB thread that we are safe */
1628 DEBUGF("mpeg_thread got SYS_USB_CONNECTED\n");
1629 usb_acknowledge(SYS_USB_CONNECTED_ACK);
1630
1631 /* Wait until the USB cable is extracted again */
1632 usb_wait_for_disconnect(&mpeg_queue);
1633 break;
1634#endif /* !USB_NONE */
1635
1636 case SYS_TIMEOUT:
1637 if (playing)
1638 playlist_update_resume_info(audio_current_track());
1639 break;
1640 }
1641 }
1642}
1643#endif /* !SIMULATOR */
1644
1645struct mp3entry* audio_current_track(void)
1646{
1647#ifdef SIMULATOR
1648 struct mp3entry *id3 = &taginfo;
1649#else /* !SIMULATOR */
1650 if(num_tracks_in_memory())
1651 {
1652 struct mp3entry *id3 = &get_trackdata(0)->id3;
1653#endif
1654 if (!checked_for_cuesheet && curr_cuesheet && id3->cuesheet == NULL)
1655 {
1656 checked_for_cuesheet = true; /* only check once per track */
1657 struct cuesheet_file cue_file;
1658
1659 if (look_for_cuesheet_file(id3, &cue_file) &&
1660 parse_cuesheet(&cue_file, curr_cuesheet))
1661 {
1662 id3->cuesheet = curr_cuesheet;
1663 }
1664 }
1665 return id3;
1666#ifndef SIMULATOR
1667 }
1668 else
1669 return NULL;
1670#endif /* !SIMULATOR */
1671}
1672
1673struct mp3entry* audio_next_track(void)
1674{
1675#ifdef SIMULATOR
1676 return &taginfo;
1677#else /* !SIMULATOR */
1678 if(num_tracks_in_memory() > 1)
1679 return &get_trackdata(1)->id3;
1680 else
1681 return NULL;
1682#endif /* !SIMULATOR */
1683}
1684
1685size_t audio_buffer_size(void)
1686{
1687 if (audiobuf_handle > 0)
1688 return audiobuflen;
1689 return 0;
1690}
1691
1692size_t audio_buffer_available(void)
1693{
1694 size_t size = 0;
1695 size_t core_size = core_available();
1696 if (audiobuf_handle > 0)
1697 return audiobuflen - AUDIO_BUFFER_RESERVE - 128;
1698 return MAX(core_size, size);
1699}
1700
1701static void audio_reset_buffer_noalloc(void* buf, size_t bufsize)
1702{
1703 mpeg_audiobuf = buf;
1704 audiobuflen = bufsize;
1705 if (global_settings.cuesheet)
1706 { /* enable cuesheet support */
1707 curr_cuesheet = (struct cuesheet*)mpeg_audiobuf;
1708 mpeg_audiobuf = SKIPBYTES(mpeg_audiobuf, sizeof(struct cuesheet));
1709 audiobuflen -= sizeof(struct cuesheet);
1710 }
1711}
1712
1713static void audio_reset_buffer(void)
1714{
1715 size_t bufsize = audiobuflen;
1716
1717 /* alloc buffer if it's was never allocated or freed by audio_hard_stop()
1718 * because voice cannot be played during audio playback make
1719 * talk.c give up all buffers and disable itself */
1720 if (!audiobuf_handle)
1721 {
1722 talk_buffer_set_policy(TALK_BUFFER_LOOSE);
1723 audiobuf_handle = core_alloc_maximum("audiobuf", &bufsize, &ops);
1724 }
1725
1726 audio_reset_buffer_noalloc(core_get_data(audiobuf_handle), bufsize);
1727}
1728
1729void audio_play(unsigned long elapsed, unsigned long offset)
1730{
1731 audio_reset_buffer();
1732#ifdef SIMULATOR
1733 char name_buf[MAX_PATH+1];
1734 const char* trackname;
1735 int steps=0;
1736
1737 is_playing = true;
1738
1739 do {
1740 trackname = playlist_peek(steps, name_buf, sizeof(name_buf));
1741 if (!trackname)
1742 break;
1743 if(mp3info(&taginfo, trackname)) {
1744 /* bad mp3, move on */
1745 if(++steps > playlist_amount())
1746 break;
1747 continue;
1748 }
1749#ifdef HAVE_MPEG_PLAY
1750 real_mpeg_play(trackname);
1751#endif
1752 playlist_next(steps);
1753 if (!offset && elapsed)
1754 {
1755 /* has an elapsed time but no offset; elapsed may take
1756 precedence in this case */
1757 taginfo.elapsed = elapsed;
1758 taginfo.offset = audio_get_file_pos_int(&taginfo);
1759 }
1760 else
1761 {
1762 taginfo.offset = offset;
1763 set_elapsed(&taginfo);
1764 }
1765 is_playing = true;
1766 playing = true;
1767 break;
1768 } while(1);
1769#else /* !SIMULATOR */
1770 static struct audio_resume_info resume;
1771 is_playing = true;
1772 resume.elapsed = elapsed;
1773 resume.offset = offset;
1774 queue_post(&mpeg_queue, MPEG_PLAY, (intptr_t)&resume);
1775#endif /* !SIMULATOR */
1776
1777 mpeg_errno = 0;
1778}
1779
1780void audio_stop(void)
1781{
1782 if (audiobuf_handle <= 0)
1783 return; /* nothing to do, must be hard-stopped already */
1784#ifndef SIMULATOR
1785 mpeg_stop_done = false;
1786 queue_post(&mpeg_queue, MPEG_STOP, 0);
1787 while(!mpeg_stop_done)
1788 yield();
1789#else /* SIMULATOR */
1790 paused = false;
1791 is_playing = false;
1792 playing = false;
1793#endif /* SIMULATOR */
1794}
1795
1796/* dummy */
1797void audio_stop_recording(void)
1798{
1799 audio_stop();
1800}
1801
1802void audio_hard_stop(void)
1803{
1804 if (audiobuf_handle > 0)
1805 {
1806 audio_stop();
1807 audiobuf_handle = core_free(audiobuf_handle);
1808 mpeg_audiobuf = NULL;
1809 talk_buffer_set_policy(TALK_BUFFER_DEFAULT);
1810 }
1811}
1812
1813void audio_pause(void)
1814{
1815#ifndef SIMULATOR
1816 queue_post(&mpeg_queue, MPEG_PAUSE, 0);
1817#else /* SIMULATOR */
1818 is_playing = true;
1819 playing = false;
1820 paused = true;
1821#endif /* SIMULATOR */
1822}
1823
1824void audio_resume(void)
1825{
1826#ifndef SIMULATOR
1827 queue_post(&mpeg_queue, MPEG_RESUME, 0);
1828#else /* SIMULATOR */
1829 is_playing = true;
1830 playing = true;
1831 paused = false;
1832#endif /* SIMULATOR */
1833}
1834
1835void audio_next(void)
1836{
1837#ifndef SIMULATOR
1838 queue_remove_from_head(&mpeg_queue, MPEG_NEED_DATA);
1839 queue_post(&mpeg_queue, MPEG_NEXT, 0);
1840#else /* SIMULATOR */
1841 char name_buf[MAX_PATH+1];
1842 const char* file;
1843 int steps = 1;
1844
1845 do {
1846 file = playlist_peek(steps, name_buf, sizeof(name_buf));
1847 if(!file)
1848 break;
1849 if(mp3info(&taginfo, file)) {
1850 if(++steps > playlist_amount())
1851 break;
1852 continue;
1853 }
1854 playlist_next(steps);
1855 current_track_counter++;
1856 is_playing = true;
1857 playing = true;
1858 break;
1859 } while(1);
1860#endif /* SIMULATOR */
1861}
1862
1863void audio_prev(void)
1864{
1865#ifndef SIMULATOR
1866 queue_remove_from_head(&mpeg_queue, MPEG_NEED_DATA);
1867 queue_post(&mpeg_queue, MPEG_PREV, 0);
1868#else /* SIMULATOR */
1869 char name_buf[MAX_PATH+1];
1870 const char* file;
1871 int steps = -1;
1872
1873 do {
1874 file = playlist_peek(steps, name_buf, sizeof(name_buf));
1875 if(!file)
1876 break;
1877 if(mp3info(&taginfo, file)) {
1878 steps--;
1879 continue;
1880 }
1881 playlist_next(steps);
1882 current_track_counter++;
1883 is_playing = true;
1884 playing = true;
1885 break;
1886 } while(1);
1887#endif /* SIMULATOR */
1888}
1889
1890void audio_ff_rewind(long newpos)
1891{
1892#ifndef SIMULATOR
1893 queue_post(&mpeg_queue, MPEG_FF_REWIND, newpos);
1894#else /* SIMULATOR */
1895 (void)newpos;
1896#endif /* SIMULATOR */
1897}
1898
1899void audio_flush_and_reload_tracks(void)
1900{
1901#ifndef SIMULATOR
1902 queue_post(&mpeg_queue, MPEG_FLUSH_RELOAD, 0);
1903#endif /* !SIMULATOR*/
1904}
1905
1906int audio_status(void)
1907{
1908 int ret = 0;
1909
1910 if(is_playing)
1911 ret |= AUDIO_STATUS_PLAY;
1912
1913 if(paused)
1914 ret |= AUDIO_STATUS_PAUSE;
1915
1916 if(mpeg_errno)
1917 ret |= AUDIO_STATUS_ERROR;
1918
1919 return ret;
1920}
1921
1922/* Unused function
1923unsigned int audio_error(void)
1924{
1925 return mpeg_errno;
1926}
1927*/
1928
1929void audio_error_clear(void)
1930{
1931 mpeg_errno = 0;
1932}
1933
1934#ifdef SIMULATOR
1935static void mpeg_thread(void)
1936{
1937 struct mp3entry* id3;
1938 while ( 1 ) {
1939 if (is_playing) {
1940 id3 = audio_current_track();
1941 if (!paused)
1942 {
1943 id3->elapsed+=1000;
1944 id3->offset+=1000;
1945 }
1946 if (id3->elapsed>=id3->length)
1947 audio_next();
1948 }
1949 sleep(HZ);
1950 }
1951}
1952#endif /* SIMULATOR */
1953
1954void audio_init(void)
1955{
1956 mpeg_errno = 0;
1957
1958 audio_reset_buffer();
1959
1960#ifndef SIMULATOR
1961 queue_init(&mpeg_queue, true);
1962#endif /* !SIMULATOR */
1963 audio_thread_id = create_thread(mpeg_thread, mpeg_stack,
1964 sizeof(mpeg_stack), 0, mpeg_thread_name
1965 IF_PRIO(, PRIORITY_SYSTEM)
1966 IF_COP(, CPU));
1967
1968 memset(trackdata, 0, sizeof(trackdata));
1969
1970#ifdef DEBUG
1971#ifndef SIMULATOR
1972 dbg_timer_start();
1973 dbg_cnt2us(0);
1974#endif /* !SIMULATOR */
1975#endif /* DEBUG */
1976 audio_is_initialized = true;
1977}
1978
1979#endif /* CONFIG_CODEC != SWCODEC */
diff --git a/apps/mpeg.h b/apps/mpeg.h
deleted file mode 100644
index 106933dba3..0000000000
--- a/apps/mpeg.h
+++ /dev/null
@@ -1,28 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2002 by Linus Nielsen Feltzing
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21#ifndef _MPEG_H_
22#define _MPEG_H_
23
24#if CONFIG_CODEC != SWCODEC
25unsigned long mpeg_get_last_header(void);
26
27#endif
28#endif
diff --git a/apps/playback.h b/apps/playback.h
index c2682e6baf..a87ef873d0 100644
--- a/apps/playback.h
+++ b/apps/playback.h
@@ -26,7 +26,6 @@
26#include <stdlib.h> 26#include <stdlib.h>
27#include "config.h" 27#include "config.h"
28 28
29#if CONFIG_CODEC == SWCODEC
30/* Including the code for fast previews is entirely optional since it 29/* Including the code for fast previews is entirely optional since it
31 does add two more mp3entry's - for certain targets it may be less 30 does add two more mp3entry's - for certain targets it may be less
32 beneficial such as flash-only storage */ 31 beneficial such as flash-only storage */
@@ -34,8 +33,6 @@
34#define AUDIO_FAST_SKIP_PREVIEW 33#define AUDIO_FAST_SKIP_PREVIEW
35#endif 34#endif
36 35
37#endif /* CONFIG_CODEC == SWCODEC */
38
39#ifdef HAVE_ALBUMART 36#ifdef HAVE_ALBUMART
40 37
41#include "bmp.h" 38#include "bmp.h"
diff --git a/apps/playlist.c b/apps/playlist.c
index 2bdc1f39cc..f903458004 100644
--- a/apps/playlist.c
+++ b/apps/playlist.c
@@ -647,11 +647,7 @@ static int create_and_play_dir(int direction, bool play_last)
647 else 647 else
648 index = 0; 648 index = 0;
649 649
650#if (CONFIG_CODEC == SWCODEC)
651 current_playlist.started = true; 650 current_playlist.started = true;
652#else
653 playlist_start(index, 0, 0);
654#endif
655 } 651 }
656 652
657 /* we've overwritten the dircache when getting the next/previous dir, 653 /* we've overwritten the dircache when getting the next/previous dir,
@@ -1090,7 +1086,6 @@ static int calculate_step_count(const struct playlist_info *playlist, int steps)
1090 return steps; 1086 return steps;
1091} 1087}
1092 1088
1093#if CONFIG_CODEC == SWCODEC
1094/* Marks the index of the track to be skipped that is "steps" away from 1089/* Marks the index of the track to be skipped that is "steps" away from
1095 * current playing track. 1090 * current playing track.
1096 */ 1091 */
@@ -1100,7 +1095,7 @@ void playlist_skip_entry(struct playlist_info *playlist, int steps)
1100 1095
1101 if (playlist == NULL) 1096 if (playlist == NULL)
1102 playlist = &current_playlist; 1097 playlist = &current_playlist;
1103 1098
1104 /* need to account for already skipped tracks */ 1099 /* need to account for already skipped tracks */
1105 steps = calculate_step_count(playlist, steps); 1100 steps = calculate_step_count(playlist, steps);
1106 1101
@@ -1112,7 +1107,6 @@ void playlist_skip_entry(struct playlist_info *playlist, int steps)
1112 1107
1113 playlist->indices[index] |= PLAYLIST_SKIPPED; 1108 playlist->indices[index] |= PLAYLIST_SKIPPED;
1114} 1109}
1115#endif /* CONFIG_CODEC == SWCODEC */
1116 1110
1117/* 1111/*
1118 * returns the index of the track that is "steps" away from current playing 1112 * returns the index of the track that is "steps" away from current playing
@@ -2649,11 +2643,9 @@ const char* playlist_peek(int steps, char* buf, size_t buf_size)
2649 if (index < 0) 2643 if (index < 0)
2650 return NULL; 2644 return NULL;
2651 2645
2652#if CONFIG_CODEC == SWCODEC
2653 /* Just testing - don't care about the file name */ 2646 /* Just testing - don't care about the file name */
2654 if (!buf || !buf_size) 2647 if (!buf || !buf_size)
2655 return ""; 2648 return "";
2656#endif
2657 2649
2658 control_file = playlist->indices[index] & PLAYLIST_INSERT_TYPE_MASK; 2650 control_file = playlist->indices[index] & PLAYLIST_INSERT_TYPE_MASK;
2659 seek = playlist->indices[index] & PLAYLIST_SEEK_MASK; 2651 seek = playlist->indices[index] & PLAYLIST_SEEK_MASK;
@@ -2730,11 +2722,7 @@ int playlist_next(int steps)
2730 sort_playlist(playlist, false, false); 2722 sort_playlist(playlist, false, false);
2731 randomise_playlist(playlist, current_tick, false, true); 2723 randomise_playlist(playlist, current_tick, false, true);
2732 2724
2733#if CONFIG_CODEC == SWCODEC
2734 playlist->started = true; 2725 playlist->started = true;
2735#else
2736 playlist_start(0, 0, 0);
2737#endif
2738 playlist->index = 0; 2726 playlist->index = 0;
2739 index = 0; 2727 index = 0;
2740 } 2728 }
@@ -2780,7 +2768,6 @@ int playlist_next(int steps)
2780 return index; 2768 return index;
2781} 2769}
2782 2770
2783#if CONFIG_CODEC == SWCODEC
2784/* try playing next or previous folder */ 2771/* try playing next or previous folder */
2785bool playlist_next_dir(int direction) 2772bool playlist_next_dir(int direction)
2786{ 2773{
@@ -2790,7 +2777,6 @@ bool playlist_next_dir(int direction)
2790 2777
2791 return create_and_play_dir(direction, false) >= 0; 2778 return create_and_play_dir(direction, false) >= 0;
2792} 2779}
2793#endif /* CONFIG_CODEC == SWCODEC */
2794 2780
2795/* Get resume info for current playing song. If return value is -1 then 2781/* Get resume info for current playing song. If return value is -1 then
2796 settings shouldn't be saved. */ 2782 settings shouldn't be saved. */
diff --git a/apps/playlist.h b/apps/playlist.h
index 220a577fb2..2eca7355e4 100644
--- a/apps/playlist.h
+++ b/apps/playlist.h
@@ -139,9 +139,7 @@ void playlist_start(int start_index, unsigned long elapsed,
139bool playlist_check(int steps); 139bool playlist_check(int steps);
140const char *playlist_peek(int steps, char* buf, size_t buf_size); 140const char *playlist_peek(int steps, char* buf, size_t buf_size);
141int playlist_next(int steps); 141int playlist_next(int steps);
142#if CONFIG_CODEC == SWCODEC
143bool playlist_next_dir(int direction); 142bool playlist_next_dir(int direction);
144#endif
145int playlist_get_resume_info(int *resume_index); 143int playlist_get_resume_info(int *resume_index);
146int playlist_update_resume_info(const struct mp3entry* id3); 144int playlist_update_resume_info(const struct mp3entry* id3);
147int playlist_get_display_index(void); 145int playlist_get_display_index(void);
@@ -165,9 +163,7 @@ int playlist_insert_directory(struct playlist_info* playlist,
165 bool recurse); 163 bool recurse);
166int playlist_insert_playlist(struct playlist_info* playlist, const char *filename, 164int playlist_insert_playlist(struct playlist_info* playlist, const char *filename,
167 int position, bool queue); 165 int position, bool queue);
168#if CONFIG_CODEC == SWCODEC
169void playlist_skip_entry(struct playlist_info *playlist, int steps); 166void playlist_skip_entry(struct playlist_info *playlist, int steps);
170#endif
171int playlist_delete(struct playlist_info* playlist, int index); 167int playlist_delete(struct playlist_info* playlist, int index);
172int playlist_move(struct playlist_info* playlist, int index, int new_index); 168int playlist_move(struct playlist_info* playlist, int index, int new_index);
173int playlist_randomise(struct playlist_info* playlist, unsigned int seed, 169int playlist_randomise(struct playlist_info* playlist, unsigned int seed,
diff --git a/apps/plugin.c b/apps/plugin.c
index 0ab73281ee..4c0f44b2e8 100644
--- a/apps/plugin.c
+++ b/apps/plugin.c
@@ -466,7 +466,6 @@ static const struct plugin_api rockbox_api = {
466 thread_self, 466 thread_self,
467 thread_exit, 467 thread_exit,
468 thread_wait, 468 thread_wait,
469#if (CONFIG_CODEC == SWCODEC)
470 thread_thaw, 469 thread_thaw,
471#ifdef HAVE_PRIORITY_SCHEDULING 470#ifdef HAVE_PRIORITY_SCHEDULING
472 thread_set_priority, 471 thread_set_priority,
@@ -474,7 +473,6 @@ static const struct plugin_api rockbox_api = {
474 mutex_init, 473 mutex_init,
475 mutex_lock, 474 mutex_lock,
476 mutex_unlock, 475 mutex_unlock,
477#endif
478#ifdef HAVE_SEMAPHORE_OBJECTS 476#ifdef HAVE_SEMAPHORE_OBJECTS
479 semaphore_init, 477 semaphore_init,
480 semaphore_wait, 478 semaphore_wait,
@@ -517,13 +515,11 @@ static const struct plugin_api rockbox_api = {
517 queue_delete, 515 queue_delete,
518 queue_post, 516 queue_post,
519 queue_wait_w_tmo, 517 queue_wait_w_tmo,
520#if CONFIG_CODEC == SWCODEC
521 queue_enable_queue_send, 518 queue_enable_queue_send,
522 queue_empty, 519 queue_empty,
523 queue_wait, 520 queue_wait,
524 queue_send, 521 queue_send,
525 queue_reply, 522 queue_reply,
526#endif
527 523
528#ifdef RB_PROFILE 524#ifdef RB_PROFILE
529 profile_thread, 525 profile_thread,
@@ -601,7 +597,7 @@ static const struct plugin_api rockbox_api = {
601#ifdef AUDIOHW_HAVE_EQ 597#ifdef AUDIOHW_HAVE_EQ
602 sound_enum_hw_eq_band_setting, 598 sound_enum_hw_eq_band_setting,
603#endif 599#endif
604#if ((CONFIG_CODEC == SWCODEC)) && defined (HAVE_PITCHCONTROL) 600#if defined (HAVE_PITCHCONTROL)
605 sound_set_pitch, 601 sound_set_pitch,
606#endif 602#endif
607#if (CONFIG_PLATFORM & PLATFORM_NATIVE) 603#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
@@ -609,11 +605,7 @@ static const struct plugin_api rockbox_api = {
609 mp3_play_pause, 605 mp3_play_pause,
610 mp3_play_stop, 606 mp3_play_stop,
611 mp3_is_playing, 607 mp3_is_playing,
612#if CONFIG_CODEC != SWCODEC
613 bitswap,
614#endif 608#endif
615#endif
616#if CONFIG_CODEC == SWCODEC
617 &audio_master_sampr_list[0], 609 &audio_master_sampr_list[0],
618 &hw_freq_sampr[0], 610 &hw_freq_sampr[0],
619 pcm_apply_settings, 611 pcm_apply_settings,
@@ -667,7 +659,6 @@ static const struct plugin_api rockbox_api = {
667 pcmbuf_fade, 659 pcmbuf_fade,
668 system_sound_play, 660 system_sound_play,
669 keyclick_click, 661 keyclick_click,
670#endif /* CONFIG_CODEC == SWCODEC */
671 662
672 /* metadata */ 663 /* metadata */
673 get_metadata, 664 get_metadata,
@@ -716,9 +707,6 @@ static const struct plugin_api rockbox_api = {
716 audio_current_track, 707 audio_current_track,
717 audio_flush_and_reload_tracks, 708 audio_flush_and_reload_tracks,
718 audio_get_file_pos, 709 audio_get_file_pos,
719#if !defined(SIMULATOR) && (CONFIG_CODEC != SWCODEC)
720 mpeg_get_last_header,
721#endif
722 710
723 /* menu */ 711 /* menu */
724 root_menu_get_options, 712 root_menu_get_options,
@@ -783,7 +771,6 @@ static const struct plugin_api rockbox_api = {
783#ifdef ROCKBOX_HAS_LOGF 771#ifdef ROCKBOX_HAS_LOGF
784 _logf, 772 _logf,
785#endif 773#endif
786#if CONFIG_CODEC == SWCODEC
787 codec_thread_do_callback, 774 codec_thread_do_callback,
788 codec_load_file, 775 codec_load_file,
789 codec_run_proc, 776 codec_run_proc,
@@ -792,7 +779,6 @@ static const struct plugin_api rockbox_api = {
792 find_array_ptr, 779 find_array_ptr,
793 remove_array_ptr, 780 remove_array_ptr,
794 round_value_to_list32, 781 round_value_to_list32,
795#endif /* CONFIG_CODEC == SWCODEC */
796 782
797#ifdef HAVE_LCD_BITMAP 783#ifdef HAVE_LCD_BITMAP
798 read_bmp_file, 784 read_bmp_file,
diff --git a/apps/plugin.h b/apps/plugin.h
index 8584d45fa7..41f65947a3 100644
--- a/apps/plugin.h
+++ b/apps/plugin.h
@@ -66,9 +66,8 @@ void* plugin_get_buffer(size_t *buffer_size);
66#include "scroll_engine.h" 66#include "scroll_engine.h"
67#include "metadata.h" 67#include "metadata.h"
68#include "sound.h" 68#include "sound.h"
69#include "mpeg.h"
70#include "audio.h" 69#include "audio.h"
71#include "mp3_playback.h" 70#include "voice_thread.h"
72#include "root_menu.h" 71#include "root_menu.h"
73#include "talk.h" 72#include "talk.h"
74#include "lang_enum.h" 73#include "lang_enum.h"
@@ -77,7 +76,6 @@ void* plugin_get_buffer(size_t *buffer_size);
77#endif 76#endif
78#include "misc.h" 77#include "misc.h"
79#include "pathfuncs.h" 78#include "pathfuncs.h"
80#if (CONFIG_CODEC == SWCODEC)
81#include "pcm_mixer.h" 79#include "pcm_mixer.h"
82#include "dsp-util.h" 80#include "dsp-util.h"
83#include "dsp_core.h" 81#include "dsp_core.h"
@@ -88,7 +86,6 @@ void* plugin_get_buffer(size_t *buffer_size);
88#ifdef HAVE_RECORDING 86#ifdef HAVE_RECORDING
89#include "recording.h" 87#include "recording.h"
90#endif 88#endif
91#endif /* CONFIG_CODEC == SWCODEC */
92#include "settings.h" 89#include "settings.h"
93#include "timer.h" 90#include "timer.h"
94#include "playlist.h" 91#include "playlist.h"
@@ -526,7 +523,6 @@ struct plugin_api {
526 unsigned int (*thread_self)(void); 523 unsigned int (*thread_self)(void);
527 void (*thread_exit)(void); 524 void (*thread_exit)(void);
528 void (*thread_wait)(unsigned int thread_id); 525 void (*thread_wait)(unsigned int thread_id);
529#if CONFIG_CODEC == SWCODEC
530 void (*thread_thaw)(unsigned int thread_id); 526 void (*thread_thaw)(unsigned int thread_id);
531#ifdef HAVE_PRIORITY_SCHEDULING 527#ifdef HAVE_PRIORITY_SCHEDULING
532 int (*thread_set_priority)(unsigned int thread_id, int priority); 528 int (*thread_set_priority)(unsigned int thread_id, int priority);
@@ -534,7 +530,6 @@ struct plugin_api {
534 void (*mutex_init)(struct mutex *m); 530 void (*mutex_init)(struct mutex *m);
535 void (*mutex_lock)(struct mutex *m); 531 void (*mutex_lock)(struct mutex *m);
536 void (*mutex_unlock)(struct mutex *m); 532 void (*mutex_unlock)(struct mutex *m);
537#endif
538#ifdef HAVE_SEMAPHORE_OBJECTS 533#ifdef HAVE_SEMAPHORE_OBJECTS
539 void (*semaphore_init)(struct semaphore *s, int max, int start); 534 void (*semaphore_init)(struct semaphore *s, int max, int start);
540 int (*semaphore_wait)(struct semaphore *s, int timeout); 535 int (*semaphore_wait)(struct semaphore *s, int timeout);
@@ -580,7 +575,6 @@ struct plugin_api {
580 void (*queue_post)(struct event_queue *q, long id, intptr_t data); 575 void (*queue_post)(struct event_queue *q, long id, intptr_t data);
581 void (*queue_wait_w_tmo)(struct event_queue *q, struct queue_event *ev, 576 void (*queue_wait_w_tmo)(struct event_queue *q, struct queue_event *ev,
582 int ticks); 577 int ticks);
583#if CONFIG_CODEC == SWCODEC
584 void (*queue_enable_queue_send)(struct event_queue *q, 578 void (*queue_enable_queue_send)(struct event_queue *q,
585 struct queue_sender_list *send, 579 struct queue_sender_list *send,
586 unsigned int thread_id); 580 unsigned int thread_id);
@@ -589,7 +583,6 @@ struct plugin_api {
589 intptr_t (*queue_send)(struct event_queue *q, long id, 583 intptr_t (*queue_send)(struct event_queue *q, long id,
590 intptr_t data); 584 intptr_t data);
591 void (*queue_reply)(struct event_queue *q, intptr_t retval); 585 void (*queue_reply)(struct event_queue *q, intptr_t retval);
592#endif /* CONFIG_CODEC == SWCODEC */
593 586
594#ifdef RB_PROFILE 587#ifdef RB_PROFILE
595 void (*profile_thread)(void); 588 void (*profile_thread)(void);
@@ -673,7 +666,7 @@ struct plugin_api {
673 int (*sound_enum_hw_eq_band_setting)(unsigned int band, 666 int (*sound_enum_hw_eq_band_setting)(unsigned int band,
674 unsigned int band_setting); 667 unsigned int band_setting);
675#endif /* AUDIOHW_HAVE_EQ */ 668#endif /* AUDIOHW_HAVE_EQ */
676#if ((CONFIG_CODEC == SWCODEC) && defined (HAVE_PITCHCONTROL)) 669#if defined (HAVE_PITCHCONTROL)
677 void (*sound_set_pitch)(int32_t pitch); 670 void (*sound_set_pitch)(int32_t pitch);
678#endif 671#endif
679#if (CONFIG_PLATFORM & PLATFORM_NATIVE) 672#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
@@ -682,11 +675,7 @@ struct plugin_api {
682 void (*mp3_play_pause)(bool play); 675 void (*mp3_play_pause)(bool play);
683 void (*mp3_play_stop)(void); 676 void (*mp3_play_stop)(void);
684 bool (*mp3_is_playing)(void); 677 bool (*mp3_is_playing)(void);
685#if CONFIG_CODEC != SWCODEC
686 void (*bitswap)(unsigned char *data, int length);
687#endif
688#endif /* PLATFORM_NATIVE */ 678#endif /* PLATFORM_NATIVE */
689#if CONFIG_CODEC == SWCODEC
690 const unsigned long *audio_master_sampr_list; 679 const unsigned long *audio_master_sampr_list;
691 const unsigned long *hw_freq_sampr; 680 const unsigned long *hw_freq_sampr;
692 void (*pcm_apply_settings)(void); 681 void (*pcm_apply_settings)(void);
@@ -752,7 +741,6 @@ struct plugin_api {
752 void (*pcmbuf_fade)(bool fade, bool in); 741 void (*pcmbuf_fade)(bool fade, bool in);
753 void (*system_sound_play)(enum system_sound sound); 742 void (*system_sound_play)(enum system_sound sound);
754 void (*keyclick_click)(bool rawbutton, int action); 743 void (*keyclick_click)(bool rawbutton, int action);
755#endif /* CONFIG_CODEC == SWCODEC */
756 744
757 /* metadata */ 745 /* metadata */
758 bool (*get_metadata)(struct mp3entry* id3, int fd, const char* trackname); 746 bool (*get_metadata)(struct mp3entry* id3, int fd, const char* trackname);
@@ -817,9 +805,6 @@ struct plugin_api {
817 struct mp3entry* (*audio_current_track)(void); 805 struct mp3entry* (*audio_current_track)(void);
818 void (*audio_flush_and_reload_tracks)(void); 806 void (*audio_flush_and_reload_tracks)(void);
819 int (*audio_get_file_pos)(void); 807 int (*audio_get_file_pos)(void);
820#if !defined(SIMULATOR) && (CONFIG_CODEC != SWCODEC)
821 unsigned long (*mpeg_get_last_header)(void);
822#endif
823 808
824 /* menu */ 809 /* menu */
825 struct menu_table *(*root_menu_get_options)(int *nb_options); 810 struct menu_table *(*root_menu_get_options)(int *nb_options);
@@ -902,7 +887,6 @@ struct plugin_api {
902#ifdef ROCKBOX_HAS_LOGF 887#ifdef ROCKBOX_HAS_LOGF
903 void (*logf)(const char *fmt, ...) ATTRIBUTE_PRINTF(1, 2); 888 void (*logf)(const char *fmt, ...) ATTRIBUTE_PRINTF(1, 2);
904#endif 889#endif
905#if CONFIG_CODEC == SWCODEC
906 void (*codec_thread_do_callback)(void (*fn)(void), 890 void (*codec_thread_do_callback)(void (*fn)(void),
907 unsigned int *audio_thread_id); 891 unsigned int *audio_thread_id);
908 int (*codec_load_file)(const char* codec, struct codec_api *api); 892 int (*codec_load_file)(const char* codec, struct codec_api *api);
@@ -915,7 +899,6 @@ struct plugin_api {
915 const unsigned long list[], 899 const unsigned long list[],
916 int count, 900 int count,
917 bool signd); 901 bool signd);
918#endif /* CONFIG_CODEC == SWCODEC */
919 902
920#ifdef HAVE_LCD_BITMAP 903#ifdef HAVE_LCD_BITMAP
921 int (*read_bmp_file)(const char* filename, struct bitmap *bm, int maxsize, 904 int (*read_bmp_file)(const char* filename, struct bitmap *bm, int maxsize,
diff --git a/apps/plugins/SOURCES b/apps/plugins/SOURCES
index 197f58ef5c..96ad535863 100644
--- a/apps/plugins/SOURCES
+++ b/apps/plugins/SOURCES
@@ -46,17 +46,12 @@ remote_control.c
46lamp.c 46lamp.c
47#endif /* HAVE_BACKLIGHT */ 47#endif /* HAVE_BACKLIGHT */
48 48
49
50
51#if CONFIG_CODEC == SWCODEC
52#if defined(HAVE_RECORDING) && (defined(HAVE_LINE_IN) || defined(HAVE_MIC_IN)) 49#if defined(HAVE_RECORDING) && (defined(HAVE_LINE_IN) || defined(HAVE_MIC_IN))
53pitch_detector.c 50pitch_detector.c
54#endif 51#endif
55 52
56mp3_encoder.c 53mp3_encoder.c
57wav2wv.c 54wav2wv.c
58#endif /* CONFIG_CODEC */
59
60 55
61#if CONFIG_RTC 56#if CONFIG_RTC
62alarmclock.c 57alarmclock.c
@@ -99,15 +94,6 @@ pictureflow.c
99 94
100#endif /* PLUGIN_BUFFER_SIZE <= 0x20000 && HAVE_LCD_BITMAP */ 95#endif /* PLUGIN_BUFFER_SIZE <= 0x20000 && HAVE_LCD_BITMAP */
101 96
102
103#if CONFIG_CODEC != SWCODEC
104
105#if defined(HAVE_LCD_BITMAP)
106splitedit.c
107#endif
108
109#endif /* HWCODEC */
110
111#if defined(IRIVER_H100_SERIES) 97#if defined(IRIVER_H100_SERIES)
112iriver_flash.c 98iriver_flash.c
113#endif 99#endif
@@ -207,9 +193,7 @@ superdom.c
207#ifdef HAVE_ADJUSTABLE_CPU_FREQ 193#ifdef HAVE_ADJUSTABLE_CPU_FREQ
208test_boost.c 194test_boost.c
209#endif 195#endif
210#if CONFIG_CODEC == SWCODEC
211test_codec.c 196test_codec.c
212#endif
213#ifdef HAVE_JPEG 197#ifdef HAVE_JPEG
214test_core_jpeg.c 198test_core_jpeg.c
215#endif 199#endif
@@ -232,9 +216,7 @@ test_mem_jpeg.c
232#ifdef HAVE_LCD_COLOR 216#ifdef HAVE_LCD_COLOR
233test_resize.c 217test_resize.c
234#endif 218#endif
235#if CONFIG_CODEC == SWCODEC
236test_sampr.c 219test_sampr.c
237#endif
238#ifdef HAVE_TOUCHSCREEN 220#ifdef HAVE_TOUCHSCREEN
239test_touchscreen.c 221test_touchscreen.c
240#endif 222#endif
diff --git a/apps/plugins/SOURCES.app_build b/apps/plugins/SOURCES.app_build
index 89a8b0ede6..8cfc5881b2 100644
--- a/apps/plugins/SOURCES.app_build
+++ b/apps/plugins/SOURCES.app_build
@@ -23,9 +23,7 @@ test_fps.c
23#ifdef HAVE_ADJUSTABLE_CPU_FREQ 23#ifdef HAVE_ADJUSTABLE_CPU_FREQ
24test_boost.c 24test_boost.c
25#endif 25#endif
26#if CONFIG_CODEC == SWCODEC
27test_codec.c 26test_codec.c
28#endif
29#ifdef HAVE_JPEG 27#ifdef HAVE_JPEG
30test_core_jpeg.c 28test_core_jpeg.c
31#endif 29#endif
@@ -46,9 +44,7 @@ test_mem_jpeg.c
46#ifdef HAVE_LCD_COLOR 44#ifdef HAVE_LCD_COLOR
47test_resize.c 45test_resize.c
48#endif 46#endif
49#if CONFIG_CODEC == SWCODEC
50test_sampr.c 47test_sampr.c
51#endif
52test_viewports.c 48test_viewports.c
53#endif /* HAVE_TEST_PLUGINS */ 49#endif /* HAVE_TEST_PLUGINS */
54 50
diff --git a/apps/plugins/SUBDIRS b/apps/plugins/SUBDIRS
index 5fd2d433c7..2c8e43c837 100644
--- a/apps/plugins/SUBDIRS
+++ b/apps/plugins/SUBDIRS
@@ -37,7 +37,7 @@ rockboy
37pictureflow 37pictureflow
38#endif 38#endif
39 39
40#if CONFIG_CODEC == SWCODEC && PLUGIN_BUFFER_SIZE > 0x20000 40#if PLUGIN_BUFFER_SIZE > 0x20000
41fft 41fft
42#endif 42#endif
43 43
@@ -70,9 +70,6 @@ pacbox
70doom 70doom
71#endif 71#endif
72 72
73/* For all the swcodec targets */
74#if CONFIG_CODEC == SWCODEC
75
76#if MEMORYSIZE > 2 /* we need a lot of RAM for instruments */ 73#if MEMORYSIZE > 2 /* we need a lot of RAM for instruments */
77midi 74midi
78mikmod 75mikmod
@@ -91,8 +88,6 @@ pdbox
91mpegplayer 88mpegplayer
92#endif 89#endif
93 90
94#endif /* CONFIG_CODEC == SWCODEC */
95
96/* Lua needs at least 160 KB to work in */ 91/* Lua needs at least 160 KB to work in */
97#if PLUGIN_BUFFER_SIZE >= 0x80000 92#if PLUGIN_BUFFER_SIZE >= 0x80000
98lua 93lua
diff --git a/apps/plugins/SUBDIRS.app_build b/apps/plugins/SUBDIRS.app_build
index 48a2d36d87..95b5e64639 100644
--- a/apps/plugins/SUBDIRS.app_build
+++ b/apps/plugins/SUBDIRS.app_build
@@ -10,7 +10,7 @@ lua
10lua_scripts 10lua_scripts
11#ifdef HAVE_LCD_BITMAP 11#ifdef HAVE_LCD_BITMAP
12 12
13#if CONFIG_CODEC == SWCODEC && PLUGIN_BUFFER_SIZE > 0x20000 13#if PLUGIN_BUFFER_SIZE > 0x20000
14fft 14fft
15#endif 15#endif
16 16
@@ -23,11 +23,8 @@ pictureflow
23#endif /* HAVE_LCD_BITMAP */ 23#endif /* HAVE_LCD_BITMAP */
24 24
25/* For all the swcodec targets */ 25/* For all the swcodec targets */
26#if CONFIG_CODEC == SWCODEC
27
28#if MEMORYSIZE > 2 /* we need a lot of RAM for instruments */ 26#if MEMORYSIZE > 2 /* we need a lot of RAM for instruments */
29mikmod 27mikmod
30#endif 28#endif
31 29
32#endif /* CONFIG_CODEC == SWCODEC */
33#endif /* HAVE_TOUCHSCREEN */ 30#endif /* HAVE_TOUCHSCREEN */
diff --git a/apps/plugins/bitmaps/mono/SOURCES b/apps/plugins/bitmaps/mono/SOURCES
index df1397d2e2..ad8b951e45 100644
--- a/apps/plugins/bitmaps/mono/SOURCES
+++ b/apps/plugins/bitmaps/mono/SOURCES
@@ -50,12 +50,10 @@ invadrox_fire.6x6x1.bmp
50#endif 50#endif
51#endif 51#endif
52 52
53#if CONFIG_CODEC == SWCODEC
54/* MPEGplayer */ 53/* MPEGplayer */
55mpegplayer_status_icons_8x8x1.bmp 54mpegplayer_status_icons_8x8x1.bmp
56mpegplayer_status_icons_12x12x1.bmp 55mpegplayer_status_icons_12x12x1.bmp
57mpegplayer_status_icons_16x16x1.bmp 56mpegplayer_status_icons_16x16x1.bmp
58#endif
59 57
60#if LCD_WIDTH == 160 && LCD_HEIGHT == 128 && LCD_DEPTH < 16 58#if LCD_WIDTH == 160 && LCD_HEIGHT == 128 && LCD_DEPTH < 16
61superdom_boarditems.160x128x1.bmp 59superdom_boarditems.160x128x1.bmp
diff --git a/apps/plugins/bitmaps/native/SOURCES b/apps/plugins/bitmaps/native/SOURCES
index 16df8a03d7..22f82800a7 100644
--- a/apps/plugins/bitmaps/native/SOURCES
+++ b/apps/plugins/bitmaps/native/SOURCES
@@ -957,7 +957,7 @@ rockboxlogo.91x32x1.bmp
957/* Pitch detector */ 957/* Pitch detector */
958/* The following preprocessor condition must match the condition */ 958/* The following preprocessor condition must match the condition */
959/* for pitch detector from plugins/SOURCES */ 959/* for pitch detector from plugins/SOURCES */
960#if (CONFIG_CODEC == SWCODEC) && defined(HAVE_RECORDING) && \ 960#if defined(HAVE_RECORDING) && \
961 (defined(HAVE_LINE_IN) || defined(HAVE_MIC_IN)) 961 (defined(HAVE_LINE_IN) || defined(HAVE_MIC_IN))
962#if (LCD_WIDTH >= 320) && (LCD_HEIGHT >= 240) && (LCD_DEPTH >= 16) 962#if (LCD_WIDTH >= 320) && (LCD_HEIGHT >= 240) && (LCD_DEPTH >= 16)
963pitch_notes.320x240x16.bmp 963pitch_notes.320x240x16.bmp
diff --git a/apps/plugins/chip8.c b/apps/plugins/chip8.c
index f861d19caa..cb7b85786f 100644
--- a/apps/plugins/chip8.c
+++ b/apps/plugins/chip8.c
@@ -1331,39 +1331,11 @@ static byte chip8_keymap[16];
1331static unsigned long starttimer; /* Timer value at the beginning */ 1331static unsigned long starttimer; /* Timer value at the beginning */
1332static unsigned long cycles; /* Number of update cycles (50Hz) */ 1332static unsigned long cycles; /* Number of update cycles (50Hz) */
1333 1333
1334#if (CONFIG_CODEC != SWCODEC) && !defined(SIMULATOR)
1335static bool is_playing;
1336
1337/* one frame of bitswapped mp3 data */
1338static unsigned char beep[]={255,
1339223, 28, 35, 0,192,210, 35,226, 72,188,242, 1,128,166, 16, 68,146,252,151, 19,
1340 10,180,245,127, 96,184, 3,184, 30, 0,118, 59,128,121,102, 6,212, 0, 97, 6,
1341 42, 65, 28,134,192,145, 57, 38,136, 73, 29, 38,132, 15, 21, 70, 91,185, 99,198,
1342 15,192, 83, 6, 33,129, 20, 6, 97, 33, 4, 6,245,128, 92, 6, 24, 0, 86, 6,
1343 56,129, 44, 24,224, 25, 13, 48, 50, 82,180, 11,251,106,249, 59, 24, 82,175,223,
1344252,119, 76,134,120,236,149,250,247,115,254,145,173,174,168,180,255,107,195, 89,
1345 24, 25, 48,131,192, 61, 48, 64, 10,176, 49, 64, 1,152, 50, 32, 8,140, 48, 16,
1346 5,129, 51,196,187, 41,177, 23,138, 70, 50, 8, 10,242, 48,192, 3,248,226, 0,
1347 20,100, 18, 96, 41, 96, 78,102, 7,201,122, 76,119, 20,137, 37,177, 15,132,224,
1348 20, 17,191, 67,147,187,116,211, 41,169, 63,172,182,186,217,155,111,140,104,254,
1349111,181,184,144, 17,148, 21,101,166,227,100, 86, 85, 85, 85};
1350/* callback to request more mp3 data */
1351static void callback(const void** start, size_t* size)
1352{
1353 *start = beep; /* give it the same frame again */
1354 *size = sizeof(beep);
1355}
1356#endif /* PLATFORM_NATIVE */
1357
1358/****************************************************************************/ 1334/****************************************************************************/
1359/* Turn sound on */ 1335/* Turn sound on */
1360/****************************************************************************/ 1336/****************************************************************************/
1361static void chip8_sound_on (void) 1337static void chip8_sound_on (void)
1362{ 1338{
1363#if(CONFIG_CODEC != SWCODEC) && !defined(SIMULATOR)
1364 if (!is_playing)
1365 rb->mp3_play_pause(true); /* kickoff audio */
1366#endif
1367} 1339}
1368 1340
1369/****************************************************************************/ 1341/****************************************************************************/
@@ -1371,10 +1343,6 @@ static void chip8_sound_on (void)
1371/****************************************************************************/ 1343/****************************************************************************/
1372static void chip8_sound_off (void) 1344static void chip8_sound_off (void)
1373{ 1345{
1374#if (CONFIG_CODEC != SWCODEC) && !defined(SIMULATOR)
1375 if (!is_playing)
1376 rb->mp3_play_pause(false); /* pause audio */
1377#endif
1378} 1346}
1379 1347
1380/****************************************************************************/ 1348/****************************************************************************/
@@ -1576,27 +1544,12 @@ static bool chip8_run(const char* file)
1576 rb->lcd_drawrect(CHIP8_X-1,CHIP8_Y-1,CHIP8_LCDWIDTH+2,CHIP8_HEIGHT+2); 1544 rb->lcd_drawrect(CHIP8_X-1,CHIP8_Y-1,CHIP8_LCDWIDTH+2,CHIP8_HEIGHT+2);
1577#endif 1545#endif
1578 rb->lcd_update(); 1546 rb->lcd_update();
1579#if (CONFIG_CODEC != SWCODEC) && !defined(SIMULATOR)
1580 /* init sound */
1581 is_playing = rb->mp3_is_playing(); /* would we disturb playback? */
1582 if (!is_playing) /* no? then we can make sound */
1583 { /* prepare */
1584 rb->mp3_play_data(beep, sizeof(beep), callback);
1585 }
1586#endif
1587 starttimer = *rb->current_tick; 1547 starttimer = *rb->current_tick;
1588 1548
1589 chip8_iperiod=15; 1549 chip8_iperiod=15;
1590 cycles = 0; 1550 cycles = 0;
1591 chip8(); 1551 chip8();
1592 1552
1593#if (CONFIG_CODEC != SWCODEC) && !defined(SIMULATOR)
1594 if (!is_playing)
1595 { /* stop it if we used audio */
1596 rb->mp3_play_stop(); /* Stop audio playback */
1597 }
1598#endif
1599
1600 if (chip8_running == 3) { 1553 if (chip8_running == 3) {
1601 /* unsupported instruction */ 1554 /* unsupported instruction */
1602 rb->splash(HZ, "Error: Unsupported" 1555 rb->splash(HZ, "Error: Unsupported"
diff --git a/apps/plugins/lua/rocklib.c b/apps/plugins/lua/rocklib.c
index 4fa989da46..e6eb543eda 100644
--- a/apps/plugins/lua/rocklib.c
+++ b/apps/plugins/lua/rocklib.c
@@ -487,7 +487,7 @@ RB_WRAP(sound)
487 lua_pushstring (L, rb->sound_unit(setting)); 487 lua_pushstring (L, rb->sound_unit(setting));
488 return 1; 488 return 1;
489 break; 489 break;
490#if ((CONFIG_CODEC == SWCODEC) && defined (HAVE_PITCHCONTROL)) 490#if defined (HAVE_PITCHCONTROL)
491 case SOUND_SET_PITCH: 491 case SOUND_SET_PITCH:
492 rb->sound_set_pitch(setting); 492 rb->sound_set_pitch(setting);
493 return 1;/*nil*/ 493 return 1;/*nil*/
@@ -507,7 +507,6 @@ RB_WRAP(sound)
507 return 1; 507 return 1;
508} 508}
509 509
510#if CONFIG_CODEC == SWCODEC
511RB_WRAP(pcm) 510RB_WRAP(pcm)
512{ 511{
513 enum e_pcm {PCM_APPLYSETTINGS = 0, PCM_ISPLAYING, PCM_ISPAUSED, 512 enum e_pcm {PCM_APPLYSETTINGS = 0, PCM_ISPLAYING, PCM_ISPAUSED,
@@ -579,7 +578,6 @@ RB_WRAP(mixer_frequency)
579 lua_pushinteger(L, result); 578 lua_pushinteger(L, result);
580 return 1; 579 return 1;
581} 580}
582#endif /*CONFIG_CODEC == SWCODEC*/
583 581
584/* DEVICE LIGHTING CONTROL */ 582/* DEVICE LIGHTING CONTROL */
585RB_WRAP(backlight_onoff) 583RB_WRAP(backlight_onoff)
@@ -953,10 +951,8 @@ static const luaL_Reg rocklib[] =
953 RB_FUNC(audio), 951 RB_FUNC(audio),
954 RB_FUNC(playlist), 952 RB_FUNC(playlist),
955 RB_FUNC(sound), 953 RB_FUNC(sound),
956#if CONFIG_CODEC == SWCODEC
957 RB_FUNC(pcm), 954 RB_FUNC(pcm),
958 RB_FUNC(mixer_frequency), 955 RB_FUNC(mixer_frequency),
959#endif
960 956
961 /* DEVICE LIGHTING CONTROL */ 957 /* DEVICE LIGHTING CONTROL */
962 RB_FUNC(backlight_onoff), 958 RB_FUNC(backlight_onoff),
diff --git a/apps/plugins/metronome.c b/apps/plugins/metronome.c
index 75947df618..eec8a92e78 100644
--- a/apps/plugins/metronome.c
+++ b/apps/plugins/metronome.c
@@ -123,143 +123,6 @@ const struct button_mapping *plugin_contexts[] =
123}; 123};
124#define PLA_ARRAY_COUNT sizeof(plugin_contexts)/sizeof(plugin_contexts[0]) 124#define PLA_ARRAY_COUNT sizeof(plugin_contexts)/sizeof(plugin_contexts[0])
125 125
126#if CONFIG_CODEC != SWCODEC
127#ifndef SIMULATOR
128/* MP3 tick sounds */
129static unsigned char tick_sound[] =
130{
131 255,251,112,196, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
132, 0, 73,110,102,111, 0, 0, 0, 15, 0, 0, 0, 3, 0, 0, 4,229, 0, 85, 85
133, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85
134, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85,170,170,170,170,170,170,170,170,170
135,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170
136,170,170,170,170,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255
137,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 0, 0, 0
138, 57, 76, 65, 77, 69, 51, 46, 57, 57,114, 1,205, 0, 0, 0, 0, 46,102, 0, 0
139, 20, 96, 36, 3, 64, 66, 0, 0, 96, 0, 0, 4,229,101,175,184,232, 0, 0, 0
140, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
141, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
142, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
143, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
145, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
146, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,251,112,196, 0, 0, 13
147, 92,189,103, 52,194,128, 2,165,176,176,247, 51, 16, 2, 0, 0, 24, 32, 0, 12
148,204,204,204,204,207,215,221,121,229, 74,224,152, 1,128, 24, 19, 17,207,217,246
149,252,132,212,226,225,192, 16, 0, 0, 0, 0, 32,163,100,111,255, 66, 7, 0, 48
150, 12, 14, 31, 59,255,255,234,112,248,112, 56, 40,223,193, 0, 64, 16, 4, 1, 51
151,229, 29,234, 4,193,240,124, 31, 62, 15,135,255, 7,193, 0, 64, 16, 12, 9, 1
152, 15,168, 16, 1,131,224,254,254,146,224,254, 8, 28, 88,127,255,148, 4, 32,128
153, 32,196,182,166,245,242,214,222,214, 73, 45,110, 52,137, 81, 39,107,255, 44, 76
154,148,140, 8,250, 66,148,195, 43, 3, 41, 15, 18,163, 80, 5, 20,248,174,140,138
155,115, 1,146, 50, 49, 32, 44,201,152,157, 53, 32, 33,157, 8, 34, 85,135, 88,105
156,186,131,252, 48,143,168,162, 44,209,142, 16, 88,221, 10,214, 94, 51, 52, 46,148
157,133, 36, 38,129,165, 36,164,139, 64,211, 11,115,101, 49, 5,136, 33,157, 18,241
158,137, 50, 53,194,213,173, 78,241,108, 1, 24,172,129,146,141,136, 24,119, 73, 51
159, 85,162,138,146, 51, 20,101,163,242,129, 56,212, 84,233, 44, 94, 11, 97,117, 74
160, 73, 37,162, 58, 20,146, 95,203, 31,246, 50, 55,111,214,223,205,213,230, 31,232
161,122,143,183, 14, 39, 91, 57, 15,251,186, 21,185,149, 48, 1,100, 64,200, 16,121
162,155, 72,110, 24,130, 98,255,251,114,196, 7,128, 17,169,247, 95,221,152,128, 10
163, 80, 62,233,185,150,170,113,174,203,251, 59, 12,190,170, 98, 4,156,122,140, 97
164,155, 60, 39, 8,145,195,116, 22,164, 82,118,116, 42,116,157, 68, 88, 70, 64, 93
165, 17, 35, 39,163,118,118, 77, 75, 82,187,215, 89,140, 46,100,112,151, 75, 73,169
166,107,181,157,170,251, 45,140, 75, 34,122, 28,228,146,111,255,235,210, 81,124,114
167,199, 52,180,138,174,207,255,235, 82,210, 64,123, 34,197,101, 47,255,254,234, 91
168, 14, 74, 68,234,219,255,254,206,131,143,162,120,234,210,191,255,245, 93, 18,200
169,225, 42, 29,171,255,254,165,164,196, 24,137, 32,223, 90, 93, 96, 64,217, 78, 35
170, 32, 53,185,107,237, 43,113, 98, 80,107,161, 3,206, 60,192, 10, 78,226,219,199
171,158,146,158, 47, 59, 90,253,154,221,198,138,147,100,150,206,233, 32, 39,192, 73
172, 23, 76,150,201, 41,209,186,217, 37,250,233, 38,198, 34, 24, 18, 33,130, 38,158
173, 73, 54, 69,146, 91, 36,182, 75,235, 64,216,196,138, 9,201, 69,174,138,157,244
174,154,150,208,246, 57, 72, 71, 2,148, 23, 76,115, 83,255,210,218,161, 56, 3, 68
175, 81, 49,190,139,253,125, 81,205, 25, 13,202,146,156,173,255,250,234,194, 8, 69
176, 13,142,255,255,209, 88,136, 73, 6,145,235, 26,142,191,255, 85,100,154,104,178
177,131,213, 0, 34, 0, 17,132, 0, 7,227, 82,135, 11,113, 70,110,105, 94,118, 22
178,255,251,112,196, 9, 0, 17, 61,249, 41,128,101,163, 73,217,178,153, 88,147, 21
179, 48,158,206,220,162,156,221, 7,209, 69, 20,117,163, 69,146, 68,145, 26,131,150
180, 0, 4,132, 41, 8,214,202,209, 69, 30,191,116, 76,156,240, 41,194,118, 23,147
181, 67,173, 87,255,233, 29, 64,216, 73,129, 10, 28,227,197,217, 43,255,254,203, 40
182,140, 48,129, 5,201, 21, 58, 95,255,232,180,168, 70,136,131,201,146,255,254,182
183,169,206, 5,216,101, 36,146,217,109,255,250,169, 38, 96, 35, 69, 51,167,157,191
184,255, 82,158,152,225, 46, 14, 99,235,100,159,255,253, 22, 29,162, 98, 84,108,210
185,202,128, 74, 16, 23,220, 23, 96,152, 17, 5,129,242, 49,137, 75, 60, 81, 16, 80
186, 34,106, 74, 91,255,222, 53, 18, 64,160, 70, 1,195, 5,139,230, 84,118,254,236
187, 44, 29, 1,130,196,195,130,236,237,255,253,156, 84, 60, 17, 10, 10, 19, 35,179
188,255,254,206,198, 14,132,130,194,196, 14, 67,179,255,254,198, 40,144,136, 80, 80
189, 76, 64,228, 57, 29,191,251, 57, 76, 34, 18, 8,132, 66,132,200,114, 59, 63,255
190,220,166, 17, 18, 18, 26, 32,112,201,159,240,144,184,169, 23,127,197,133, 69, 85
191, 76, 65, 77, 69, 51, 46, 57, 57, 46, 53, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85
192, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85
193, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85
194};
195static unsigned char tock_sound[] =
196{
197 255,251,112,196, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
198, 0, 73,110,102,111, 0, 0, 0, 15, 0, 0, 0, 3, 0, 0, 4,229, 0, 85, 85
199, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85
200, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85,170,170,170,170,170,170,170,170,170
201,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170
202,170,170,170,170,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255
203,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 0, 0, 0
204, 57, 76, 65, 77, 69, 51, 46, 57, 57,114, 1,205, 0, 0, 0, 0, 46,100, 0, 0
205, 20, 96, 36, 3, 64, 66, 0, 0, 96, 0, 0, 4,229,187,155,119, 17, 0, 0, 0
206, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
207, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
208, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
209, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
210, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
211, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
212, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,251,112,196, 0, 0, 13
213,105, 19,104,212,146,128, 10,164, 41,175,119, 51, 32, 0, 2, 32, 41, 84, 9,130
214, 96,152,109,228, 0, 16, 0, 6, 9,209,163,111,127,154, 48, 0, 0, 0, 0,129
215,194, 19,212,226, 97,240,248,187,255, 65, 0,248,124, 92,255,144,130, 1,192,225
216, 9,249,206,115,138, 16,158,132, 57,206,115,191,242, 16,132,111,212,231, 14, 7
217, 8, 70,243,156,231, 57,206,121,207,200, 66, 16, 92,231,255,134, 0, 0, 0,127
218,244, 60, 60, 51,255,192, 3,195,207,252, 0, 0, 0, 29, 39,244, 60, 48, 3,255
219,195,219,177,171,179,181, 8,157,251,239,155,104,162, 80, 5,194, 16,165,199, 42
220,104,133, 19,109, 88, 96, 61,104,242,117,118, 94,135, 29, 53, 72, 67, 85, 11, 54
221, 59, 64,154,155,128,195, 23,148, 98, 43,186, 43,139, 64,218, 82, 68,160,197,168
222,125, 10, 50, 41, 16,240, 30, 6,228, 52,117, 0, 51,130,146,122,152,109,162,201
223, 45,154, 30, 11, 66, 30, 76, 73,145,224, 52,149, 17, 55,138,112,105, 51, 36,147
224, 22,130, 89, 20,138, 36,114,212,145, 3,199,107,101,213, 25, 21,222,196,209,162
225, 40,168,168,165,162,100,142,163,220,186,250, 72,106, 54, 75, 48,243, 79,153, 54
226,163, 93,179,171,204,144,232,190,115, 19,208, 90,172,244, 40, 98,126, 35,161,234
227,122,143,221, 39,250,159, 61, 35,111,250,213,216, 6,252, 9,138, 17, 64, 1, 13
228, 56, 80, 58,104,184, 37,255,251,114,196, 7,128, 17,250, 1, 97,189,152, 0, 10
229, 44,192, 41,253,151,169,185,237, 56, 3,131,220, 24,180,204,165,221,129,107,210
230,192, 50,130, 26, 22, 26,180, 77, 81, 85,221,146, 33,197,224,198,197,228,146, 89
231,162,210, 69,100,233, 13, 25,145, 61, 19,206,151,232,172,212, 58,162,149, 53, 70
232,234,234, 81,176,186, 28, 39,145,253, 87, 33,130,150, 43, 36,187,245,169,141,200
233, 41,178,191,230, 68,233,170,255,230, 37,227,101,183,237, 49, 56,109,255,115,134
234,232,223,247,156, 62,191,250, 43, 42,169,127,245, 26,160,255,234,151,157,191,215
235, 46,164,223,235, 98,137,118,223,238,112,189,111,247, 56, 94,106, 16, 1, 77, 8
236, 25, 4,204, 0, 0,134, 96, 41,151,170, 74,147,135, 11,136, 28,220, 96,102,179
237, 16,145, 89,202, 11,197,114, 72, 0,241, 77, 88,211, 70,174,171, 10, 11, 84,163
238, 5, 53,191,241,191,106,245,209,114, 21,240,208, 75,172,190,150,103,205,178,252
239, 78, 36,166,139,132,106,231, 86,253,130, 80,178,201,254,193, 68, 20,207,254,206
240, 49, 19, 78,127,253,159,255, 33, 37, 37, 95,238,112,188, 89, 37, 79,238,165, 5
241,163,151,249,168,130,215,255,169,223,249,231, 15,149,191,161,227,209,235, 63,232
242,166, 10,198,183,232,150, 34,119,255,213, 17,255,231, 17, 44, 8, 2, 96, 1,101
243,184,243,226,216, 18, 60,216,132,105,150,250,101,165, 64,237,172,186, 35,114,126
244,255,251,112,196, 12,128,144,142, 3, 44,140,180,241, 1,207, 47,217, 72,244, 10
245, 48, 29, 88, 20, 21,128, 36,231,157,173,100,202, 35,136,119,133,228,209, 55,186
246,218,198,197,208,217, 11,233,178,254,186,137,128, 8,110, 71,253,212,136,138, 45
247,118,253,216, 34, 7, 74, 99,255, 60, 22,144,101,111,209, 72,136,196,175,254, 58
248, 15, 76, 71,249,184,138, 45, 30,127,234,199, 21, 35,191,245, 17, 75, 63,252,120
249,108, 58,223,209,199, 74,141, 91,254,131, 98, 70,255,212, 69, 42, 71,254,172, 54
250,127,252,116,107,255,168,212,194, 64, 61,126, 46,224,170, 52, 71,208,229, 19,209
251,148, 64,203,225,206,126, 29,230, 1,134,123,159,138,246, 67,199, 93,127,253, 50
252,148, 81, 37, 13, 40,145, 8, 37, 12, 6, 4, 49, 67,204,186,186,255,255,213,149
253,149,137, 16,132,162, 8,128, 90, 58, 93, 95,255,121,138, 96,161,131, 3, 33,200
254,118,127,255,238, 83, 5, 10, 8,228, 58, 47,255,252,197, 48, 96,104,116, 84, 84
255, 69,255,251, 24, 40, 80, 74, 69, 69, 64, 96,193, 7,141, 1, 89,203, 5,113, 81
256, 70,255,245,139, 85, 76, 65, 77, 69, 51, 46, 57, 57, 46, 53, 85, 85, 85, 85, 85
257, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85
258, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85
259, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85
260};
261#endif /* SIMULATOR */
262#else
263/* raw PCM */ 126/* raw PCM */
264static signed short tick_sound[] = 127static signed short tick_sound[] =
265{ 128{
@@ -641,7 +504,6 @@ static signed short tock_sound[] =
641,-3,2,-1,0,1,-1,0,0,1,-1,1 504,-3,2,-1,0,1,-1,0,0,1,-1,1
642,-2,3 505,-2,3
643}; 506};
644#endif
645 507
646/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 508/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
647 Utilities from pdbox plugin (Copyright (C) 2009 Wincent Balin) --- am I 509 Utilities from pdbox plugin (Copyright (C) 2009 Wincent Balin) --- am I
@@ -941,51 +803,6 @@ static int bpm_step_counter = 0;
941 803
942static bool sound_trigger = false; 804static bool sound_trigger = false;
943 805
944#if CONFIG_CODEC != SWCODEC
945
946#ifdef SIMULATOR
947
948/* No audio in HWCODEC simulator build. */
949#define MET_IS_PLAYING 0
950#define MET_PLAY_STOP do {} while(0)
951static void play_tick(void){ printf("tick\n"); }
952static void play_tock(void){ printf("tock\n"); }
953
954#else
955
956#define MET_IS_PLAYING rb->mp3_is_playing()
957#define MET_PLAY_STOP rb->mp3_play_stop()
958
959static void callback(const void** start, size_t* size)
960{
961 (void)start; /* unused parameter, avoid warning */
962 *size = 0; /* end of data */
963 sound_active = false;
964 rb->led(0);
965}
966
967/* Wondering: Should one prevent playing again while sound_active == true? */
968
969static void play_tick(void)
970{
971 sound_active = true;
972 rb->led(1);
973 rb->mp3_play_data(tick_sound, sizeof(tick_sound), callback);
974 rb->mp3_play_pause(true); /* kickoff audio */
975}
976
977static void play_tock(void)
978{
979 sound_active = true;
980 rb->led(1);
981 rb->mp3_play_data(tock_sound, sizeof(tock_sound), callback);
982 rb->mp3_play_pause(true); /* kickoff audio */
983}
984
985#endif /* SIMULATOR */
986
987#else /* CONFIG_CODEC == SWCODEC */
988
989#define MET_IS_PLAYING rb->pcm_is_playing() 806#define MET_IS_PLAYING rb->pcm_is_playing()
990#define MET_PLAY_STOP rb->audio_stop() 807#define MET_PLAY_STOP rb->audio_stop()
991 808
@@ -1014,8 +831,6 @@ static void play_tock(void)
1014 rb->pcm_play_data(NULL, NULL, tock_buf, sizeof(tock_buf)); 831 rb->pcm_play_data(NULL, NULL, tock_buf, sizeof(tock_buf));
1015} 832}
1016 833
1017#endif /* CONFIG_CODEC != SWCODEC */
1018
1019/* State: 0: blank/title, 1: tick, 2: tock 3: silent klick */ 834/* State: 0: blank/title, 1: tick, 2: tock 3: silent klick */
1020/* TODO: Could use more smart placement, using 835/* TODO: Could use more smart placement, using
1021 lcd_getstringsize() and such. */ 836 lcd_getstringsize() and such. */
@@ -1446,9 +1261,7 @@ static void cleanup(void)
1446 MET_PLAY_STOP; /* stop audio ISR */ 1261 MET_PLAY_STOP; /* stop audio ISR */
1447 tweak_volume(0); 1262 tweak_volume(0);
1448 rb->led(0); 1263 rb->led(0);
1449#if CONFIG_CODEC == SWCODEC
1450 rb->pcm_set_frequency(HW_SAMPR_DEFAULT); 1264 rb->pcm_set_frequency(HW_SAMPR_DEFAULT);
1451#endif
1452} 1265}
1453 1266
1454/* 1267/*
@@ -1786,12 +1599,6 @@ enum plugin_status plugin_start(const void* file)
1786 1599
1787 if(MET_IS_PLAYING) MET_PLAY_STOP; /* stop audio IS */ 1600 if(MET_IS_PLAYING) MET_PLAY_STOP; /* stop audio IS */
1788 1601
1789#if (CONFIG_CODEC != SWCODEC)
1790#ifndef SIMULATOR
1791 rb->bitswap(tick_sound, sizeof(tick_sound));
1792 rb->bitswap(tock_sound, sizeof(tock_sound));
1793#endif
1794#else
1795 prepare_buffers(); 1602 prepare_buffers();
1796#if INPUT_SRC_CAPS != 0 1603#if INPUT_SRC_CAPS != 0
1797 /* Select playback */ 1604 /* Select playback */
@@ -1799,7 +1606,6 @@ enum plugin_status plugin_start(const void* file)
1799 rb->audio_set_output_source(AUDIO_SRC_PLAYBACK); 1606 rb->audio_set_output_source(AUDIO_SRC_PLAYBACK);
1800#endif 1607#endif
1801 rb->pcm_set_frequency(SAMPR_44); 1608 rb->pcm_set_frequency(SAMPR_44);
1802#endif /* CONFIG_CODEC != SWCODEC */
1803 1609
1804 if(file) 1610 if(file)
1805 { 1611 {
diff --git a/apps/plugins/mpegplayer/mpeg_settings.c b/apps/plugins/mpegplayer/mpeg_settings.c
index d5d7c7c019..25eb313591 100644
--- a/apps/plugins/mpegplayer/mpeg_settings.c
+++ b/apps/plugins/mpegplayer/mpeg_settings.c
@@ -1245,7 +1245,6 @@ static void display_options(void)
1245 } 1245 }
1246} 1246}
1247 1247
1248#if CONFIG_CODEC == SWCODEC
1249static void audio_options(void) 1248static void audio_options(void)
1250{ 1249{
1251 int selected = 0; 1250 int selected = 0;
@@ -1307,7 +1306,6 @@ static void audio_options(void)
1307 menu_quit = true; 1306 menu_quit = true;
1308 } 1307 }
1309} 1308}
1310#endif
1311 1309
1312static void resume_options(void) 1310static void resume_options(void)
1313{ 1311{
diff --git a/apps/plugins/oscilloscope.c b/apps/plugins/oscilloscope.c
index 8e14f26bd5..2af70204a1 100644
--- a/apps/plugins/oscilloscope.c
+++ b/apps/plugins/oscilloscope.c
@@ -902,19 +902,11 @@ static int last_right;
902 902
903static void get_peaks(int *left, int *right) 903static void get_peaks(int *left, int *right)
904{ 904{
905#if CONFIG_CODEC == SWCODEC
906 static struct pcm_peaks peaks; 905 static struct pcm_peaks peaks;
907 rb->mixer_channel_calculate_peaks(PCM_MIXER_CHAN_PLAYBACK, 906 rb->mixer_channel_calculate_peaks(PCM_MIXER_CHAN_PLAYBACK,
908 &peaks); 907 &peaks);
909 *left = peaks.left; 908 *left = peaks.left;
910 *right = peaks.right; 909 *right = peaks.right;
911#elif defined (SIMULATOR)
912 *left = rand() % 0x8000;
913 *right = rand() % 0x8000;
914#else
915 *left = 0;
916 *right = 0;
917#endif
918} 910}
919 911
920static long get_next_delay(void) 912static long get_next_delay(void)
diff --git a/apps/plugins/properties.c b/apps/plugins/properties.c
index 686b4d6d1a..4c172ff108 100644
--- a/apps/plugins/properties.c
+++ b/apps/plugins/properties.c
@@ -112,13 +112,9 @@ static bool file_properties(const char* selected_file)
112 112
113 num_properties = 5; 113 num_properties = 5;
114 114
115#if (CONFIG_CODEC == SWCODEC)
116 int fd = rb->open(selected_file, O_RDONLY); 115 int fd = rb->open(selected_file, O_RDONLY);
117 if (fd >= 0 && 116 if (fd >= 0 &&
118 rb->get_metadata(&id3, fd, selected_file)) 117 rb->get_metadata(&id3, fd, selected_file))
119#else
120 if (!rb->mp3info(&id3, selected_file))
121#endif
122 { 118 {
123 long dur = id3.length / 1000; /* seconds */ 119 long dur = id3.length / 1000; /* seconds */
124 rb->snprintf(str_artist, sizeof str_artist, 120 rb->snprintf(str_artist, sizeof str_artist,
@@ -145,9 +141,7 @@ static bool file_properties(const char* selected_file)
145 num_properties++; 141 num_properties++;
146 } 142 }
147 } 143 }
148#if (CONFIG_CODEC == SWCODEC)
149 rb->close(fd); 144 rb->close(fd);
150#endif
151 found = true; 145 found = true;
152 break; 146 break;
153 } 147 }
diff --git a/apps/plugins/rockboy/rbsound.c b/apps/plugins/rockboy/rbsound.c
index 628879b4b7..c36e24b578 100644
--- a/apps/plugins/rockboy/rbsound.c
+++ b/apps/plugins/rockboy/rbsound.c
@@ -7,8 +7,6 @@ struct pcm pcm IBSS_ATTR;
7#define N_BUFS 2 7#define N_BUFS 2
8#define BUF_SIZE 2048 8#define BUF_SIZE 2048
9 9
10#if CONFIG_CODEC == SWCODEC
11
12bool doneplay=1; 10bool doneplay=1;
13bool bufnum=0; 11bool bufnum=0;
14 12
@@ -88,27 +86,3 @@ int rockboy_pcm_submit(void)
88 pcm.pos = 0; 86 pcm.pos = 0;
89 return 1; 87 return 1;
90} 88}
91
92#else
93
94void rockboy_pcm_init(void)
95{
96 pcm.hz = 44100;
97 pcm.stereo = 1;
98 pcm.buf = NULL;
99 pcm.len = 0;
100 pcm.pos = 0;
101}
102
103void rockboy_pcm_close(void)
104{
105 memset(&pcm, 0, sizeof pcm);
106}
107
108int rockboy_pcm_submit(void)
109{
110 pcm.pos =0;
111 return 0;
112}
113
114#endif
diff --git a/apps/plugins/splitedit.c b/apps/plugins/splitedit.c
deleted file mode 100644
index b698e2e18a..0000000000
--- a/apps/plugins/splitedit.c
+++ /dev/null
@@ -1,1231 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2002 Philipp Pertermann
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21
22#include "plugin.h"
23
24
25
26/* variable button definitions */
27#if CONFIG_KEYPAD == IRIVER_H100_PAD
28#define SPLITEDIT_QUIT BUTTON_OFF
29#define SPLITEDIT_PLAY BUTTON_ON
30#define SPLITEDIT_SAVE BUTTON_SELECT
31#define SPLITEDIT_LOOP_MODE BUTTON_MODE
32#define SPLITEDIT_SCALE (BUTTON_REC | BUTTON_UP)
33#define SPLITEDIT_SPEED50 (BUTTON_REC | BUTTON_LEFT)
34#define SPLITEDIT_SPEED100 (BUTTON_REC | BUTTON_DOWN)
35#define SPLITEDIT_SPEED150 (BUTTON_REC | BUTTON_RIGHT)
36#define SPLITEDIT_MENU_RUN BUTTON_RIGHT
37
38#elif (CONFIG_KEYPAD == SAMSUNG_YH820_PAD) || \
39 (CONFIG_KEYPAD == SAMSUNG_YH92X_PAD)
40#define SPLITEDIT_QUIT (BUTTON_REC | BUTTON_REW)
41#define SPLITEDIT_PLAY (BUTTON_REC | BUTTON_FFWD)
42#define SPLITEDIT_SAVE BUTTON_FFWD
43#define SPLITEDIT_LOOP_MODE BUTTON_REW
44#define SPLITEDIT_SCALE BUTTON_UP
45#define SPLITEDIT_SPEED50 BUTTON_LEFT
46#define SPLITEDIT_SPEED100 BUTTON_DOWN
47#define SPLITEDIT_SPEED150 BUTTON_RIGHT
48#define SPLITEDIT_MENU_RUN BUTTON_PLAY
49
50#define SPLITEDIT_RC_QUIT BUTTON_RC_STOP
51#endif
52
53#define BMPHEIGHT 7
54#define BMPWIDTH 13
55unsigned char LOOP_BMP[][13] =
56{
57 {0xfc,0x00,0x10,0x11,0x93,0x7f,0x13,0x11,0x7c,0x38,0x10,0x00,0x7c}, /*ALL */
58 {0x81,0x03,0x7f,0x03,0x91,0x10,0x10,0x10,0x7c,0x38,0x10,0x00,0x7c}, /*FROM*/
59 {0xfc,0x00,0x10,0x10,0x90,0x10,0x7c,0x38,0x11,0x03,0x7f,0x03,0x01}, /*TO */
60 {0x80,0x10,0x10,0x11,0x93,0x7f,0x13,0x11,0x10,0x7c,0x38,0x10,0x00}, /*FREE*/
61};
62
63unsigned char CUT_BMP[] =
64{
65 0xc1,0x63,0x63,0x36,0xb6,0x1c,0x1c,0x36,0x77,0x55,0x55,0x55,0x32,
66};
67
68unsigned char SCALE_BMP[][13] =
69{
70 {0x80,0x06,0x49,0x66,0xb0,0x18,0x0c,0x06,0x33,0x49,0x30,0x00,0x00}, /*lin*/
71 {0x80,0x30,0x78,0x48,0xff,0x7f,0x00,0x7f,0x7f,0x48,0x78,0x30,0x00}, /*db*/
72};
73
74#define TIMEBAR_Y 9
75#define TIMEBAR_HEIGHT 4
76
77#define OSCI_X 0
78#define OSCI_Y (TIMEBAR_Y + TIMEBAR_HEIGHT + 1)
79#define OSCI_WIDTH LCD_WIDTH
80#define OSCI_HEIGHT (LCD_HEIGHT - BMPHEIGHT - OSCI_Y - 1)
81
82/* Indices of the menu items in the save editor, see save_editor */
83#define SE_PART1_SAVE 0
84#define SE_PART1_NAME 1
85#define SE_PART2_SAVE 2
86#define SE_PART2_NAME 3
87#define SE_SAVE 4
88#define SE_COUNT 5
89
90/* contains the file name of the song that is to be split */
91static char path_mp3[MAX_PATH];
92
93/* Exit code of this plugin */
94static enum plugin_status splitedit_exit_code = PLUGIN_OK;
95
96/* The range in time that the displayed aerea comprises */
97static unsigned int range_start = 0;
98static unsigned int range_end = 0;
99
100/* The range in time that is being looped */
101static unsigned int play_start = 0;
102static unsigned int play_end = 0;
103
104/* Point in time (pixel) at which the split mark is set */
105static int split_x = OSCI_X + (OSCI_WIDTH / 2);
106
107/* Contains the peak values */
108static unsigned char osci_buffer[OSCI_WIDTH];
109
110/* if true peak values from a previous loop are only overwritten
111 if the new value is greater than the old value */
112static bool osci_valid = false;
113
114/**
115 * point in time from which on the osci_buffer is invalid
116 * if set to ~(unsigned int)0 the entire osci_buffer is invalid
117 */
118static unsigned int validation_start = ~(unsigned int)0;
119
120/* all the visible aerea is looped */
121#define LOOP_MODE_ALL 0
122
123/* loop starts at split point, ends at right visible border */
124#define LOOP_MODE_FROM 1
125
126/* loop start at left visible border, ends at split point */
127#define LOOP_MODE_TO 2
128
129/* let the song play without looping */
130#define LOOP_MODE_FREE 3
131
132/* see LOOP_MODE_XXX constants vor valid values */
133static int loop_mode = LOOP_MODE_FREE;
134
135/* minimal allowed timespan (ms) of the visible (and looped) aerea*/
136#define MIN_RANGE_SIZE 1000
137
138/* Format time into buf.
139 *
140 * buf - buffer to format to.
141 * buf_size - size of buffer.
142 * time - time to format, in milliseconds.
143 */
144static void format_time_ms(char* buf, int buf_size, int time)
145{
146 rb->snprintf(buf, buf_size, "%d:%02d:%03d", time / 60000,
147 time % 60000 / 1000, (time % 60000) % 1000);
148}
149
150/**
151 * converts screen coordinate (pixel) to time (ms)
152 */
153static int xpos_to_time(int xpos)
154{
155 int retval = 0;
156 int range = range_end - range_start;
157 retval = range_start + (((xpos - OSCI_X) * range) / OSCI_WIDTH);
158 return retval;
159}
160
161/**
162 * Converts time (ms) to screen coordinates (pixel).
163 */
164static int time_to_xpos(unsigned int time)
165{
166 int retval = OSCI_X;
167
168 /* clip the range */
169 if (time < range_start)
170 {
171 retval = OSCI_X;
172 }
173 else
174 if (time >= range_end)
175 {
176 retval = OSCI_X + OSCI_WIDTH;
177 }
178
179 /* do the calculation */
180 else
181 {
182 int range = range_end - range_start;
183 retval = OSCI_X + ((time - range_start) * OSCI_WIDTH) / range ;
184 }
185 return retval;
186}
187
188/**
189 * Updates the display of the textual data only.
190 */
191static void update_data(void)
192{
193 char buf[20];
194 char timebuf[10];
195 int w, h;
196
197 /* split point */
198 format_time_ms(timebuf, sizeof timebuf, xpos_to_time(split_x));
199 rb->snprintf(buf, sizeof buf, "Split at: %s", timebuf);
200
201 rb->lcd_getstringsize(buf, &w, &h);
202
203 rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
204 rb->lcd_fillrect(0, 0, LCD_WIDTH, h);
205 rb->lcd_set_drawmode(DRMODE_SOLID);
206 rb->lcd_puts(0, 0, buf);
207 rb->lcd_update_rect(0, 0, LCD_WIDTH, h);
208}
209
210/**
211 * Displays which part of the song is visible
212 * in the osci.
213 */
214static void update_timebar(struct mp3entry *mp3)
215{
216 rb->gui_scrollbar_draw
217 (
218 rb->screens[SCREEN_MAIN],0, TIMEBAR_Y, LCD_WIDTH, TIMEBAR_HEIGHT,
219 mp3->length, range_start, range_end,
220 HORIZONTAL
221 );
222 rb->lcd_update_rect(0, TIMEBAR_Y, LCD_WIDTH, TIMEBAR_HEIGHT);
223}
224
225/**
226 * Marks the entire area of the osci buffer invalid.
227 * It will be drawn with new values in the next loop.
228 */
229static void splitedit_invalidate_osci(void)
230{
231 osci_valid = false;
232 validation_start = ~(unsigned int)0;
233}
234
235/**
236 * Returns the loop mode. See the LOOP_MODE_XXX constants above.
237 */
238static int splitedit_get_loop_mode(void)
239{
240 return loop_mode;
241}
242
243/**
244 * Updates the icons that display the Fn key hints.
245 */
246static void update_icons(void)
247{
248 rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
249 rb->lcd_fillrect(0, LCD_HEIGHT - BMPHEIGHT, LCD_WIDTH, BMPHEIGHT);
250 rb->lcd_set_drawmode(DRMODE_SOLID);
251
252 /* The CUT icon */
253 rb->lcd_mono_bitmap(CUT_BMP,
254 LCD_WIDTH / 3 / 2 - BMPWIDTH / 2, LCD_HEIGHT - BMPHEIGHT,
255 BMPWIDTH, BMPHEIGHT);
256
257 /* The loop mode icon */
258 rb->lcd_mono_bitmap(LOOP_BMP[splitedit_get_loop_mode()],
259 LCD_WIDTH/3 + LCD_WIDTH/3 / 2 - BMPWIDTH/2, LCD_HEIGHT - BMPHEIGHT,
260 BMPWIDTH, BMPHEIGHT);
261
262 {
263 static int idx;
264 if (idx < 0 || idx > 1) idx = 0;
265 idx = 1 - idx;
266 rb->lcd_mono_bitmap(SCALE_BMP[idx],
267 2 *LCD_WIDTH/3 + LCD_WIDTH/3 / 2 - BMPWIDTH/2, LCD_HEIGHT - BMPHEIGHT,
268 BMPWIDTH, BMPHEIGHT);
269 }
270
271 rb->lcd_update_rect(0, LCD_HEIGHT - BMPHEIGHT, LCD_WIDTH, BMPHEIGHT);
272}
273
274/**
275 * Sets the loop mode. See the LOOP_MODE_XXX constants above.
276 */
277static void splitedit_set_loop_mode(int mode)
278{
279 int old_loop_mode = loop_mode;
280 /* range restriction */
281 loop_mode = mode % (LOOP_MODE_FREE + 1);
282 switch (loop_mode)
283 {
284 case LOOP_MODE_ALL:
285 play_start = range_start;
286 play_end = range_end;
287 break;
288
289 case LOOP_MODE_FROM:
290 play_start = xpos_to_time(split_x);
291 play_end = range_end;
292 break;
293
294 case LOOP_MODE_TO:
295 play_start = range_start;
296 play_end = xpos_to_time(split_x);
297 break;
298
299 case LOOP_MODE_FREE:
300 /* play_start is used when the song plays beyond its end */
301 play_start = range_start;
302 play_end = range_end;
303 break;
304 }
305
306 if (loop_mode != old_loop_mode)
307 {
308 update_icons();
309 }
310}
311
312/**
313 * Readraws the osci without clear.
314 */
315static void redraw_osci(void)
316{
317 int x;
318 for (x = 0; x < OSCI_WIDTH; x++)
319 {
320 if (osci_buffer[x] > 0)
321 {
322 rb->lcd_vline
323 (
324 OSCI_X + x, OSCI_Y + OSCI_HEIGHT - 1,
325 OSCI_Y + OSCI_HEIGHT - osci_buffer[x] - 1
326 );
327 }
328 }
329}
330
331/**
332 * Sets the range of time in which the user can finetune the split
333 * point. The split point is the center of the time range.
334 */
335static void set_range_by_time(
336 struct mp3entry *mp3,
337 unsigned int split_time,
338 unsigned int range)
339{
340 if (mp3 != NULL)
341 {
342 if (range < MIN_RANGE_SIZE)
343 {
344 range = MIN_RANGE_SIZE;
345 }
346 range_start = (split_time > range / 2) ? (split_time - range / 2) : 0;
347 range_end = MIN(range_start + range, mp3->length);
348 split_x = time_to_xpos(split_time);
349
350 splitedit_invalidate_osci();
351
352 /* this sets the play_start / play_end */
353 splitedit_set_loop_mode(splitedit_get_loop_mode());
354
355 update_data();
356 update_timebar(mp3);
357 }
358}
359
360/**
361 * Set the split point in screen coordinates
362 */
363static void splitedit_set_split_x(int newx)
364{
365 int minx = split_x - 2 > 0 ? split_x - 2: 0;
366
367 /* remove old split point from screen, only if moved */
368 if (split_x != newx)
369 {
370 rb->lcd_set_drawmode(DRMODE_COMPLEMENT);
371 rb->lcd_fillrect(minx, OSCI_Y, 5, 1);
372 rb->lcd_fillrect(split_x-1 > 0 ? split_x - 1: 0, OSCI_Y + 1, 3, 1);
373 rb->lcd_fillrect(split_x, OSCI_Y + 2, 1, OSCI_HEIGHT - 2);
374 rb->lcd_set_drawmode(DRMODE_SOLID);
375 rb->lcd_update_rect(minx, OSCI_Y, 5, OSCI_HEIGHT);
376 }
377
378 if (newx >= OSCI_X && newx < OSCI_X + OSCI_WIDTH)
379 {
380 split_x = newx;
381 /* in LOOP_FROM / LOOP_TO modes play_start /play_end must be updated */
382 splitedit_set_loop_mode(splitedit_get_loop_mode());
383
384 /* display new split time */
385 update_data();
386 }
387
388 /* display new split point */
389 minx = split_x - 2 > 0 ? split_x - 2: 0;
390 rb->lcd_set_drawmode(DRMODE_COMPLEMENT);
391 rb->lcd_fillrect(minx, OSCI_Y, 5, 1);
392 rb->lcd_fillrect(split_x - 1 > 0 ? split_x - 1: 0, OSCI_Y + 1, 3, 1);
393 rb->lcd_fillrect(split_x, OSCI_Y + 2, 1, OSCI_HEIGHT - 2);
394 rb->lcd_set_drawmode(DRMODE_SOLID);
395 rb->lcd_update_rect(minx, OSCI_Y, 5, OSCI_HEIGHT);
396}
397
398/**
399 * returns the split point in screen coordinates
400 */
401static int splitedit_get_split_x(void)
402{
403 return split_x;
404}
405
406/**
407 * Clears the osci area and redraws it
408 */
409static void update_osci(void)
410{
411 rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
412 rb->lcd_fillrect(OSCI_X, OSCI_Y, OSCI_WIDTH, OSCI_HEIGHT);
413 rb->lcd_set_drawmode(DRMODE_SOLID);
414 redraw_osci();
415 splitedit_set_split_x(splitedit_get_split_x());
416 rb->lcd_update_rect(OSCI_X, OSCI_Y, OSCI_WIDTH, OSCI_HEIGHT);
417}
418
419/**
420 * Zooms the visable and loopable range by the factor
421 * (counter / denominator). The split point is used as
422 * center point of the new selected range.
423 */
424static void zoom(struct mp3entry *mp3, int counter, int denominator)
425{
426 unsigned char oldbuf[OSCI_WIDTH];
427 int oldrange = range_end - range_start;
428 int range = oldrange * counter / denominator;
429 int i;
430 int oldindex;
431 int oldsplitx;
432 int splitx;
433 int split;
434
435 /* for stretching / shrinking a second buffer is needed */
436 rb->memcpy(&oldbuf, &osci_buffer, sizeof osci_buffer);
437
438 /* recalculate the new range and split point */
439 oldsplitx = split_x;
440 split = xpos_to_time(split_x);
441
442 set_range_by_time(mp3, split, range);
443 range = range_end - range_start;
444
445 splitx = time_to_xpos(split);
446
447 /* strech / shrink the existing osci buffer */
448 for (i = 0; i < OSCI_WIDTH; i++)
449 {
450 /* oldindex = (i + OSCI_X - splitx) * range / oldrange + oldsplitx ;*/
451 oldindex = (i*range / oldrange) + oldsplitx - (splitx*range /oldrange);
452 if (oldindex >= 0 && oldindex < OSCI_WIDTH)
453 {
454 osci_buffer[i] = oldbuf[oldindex];
455 }
456 else
457 {
458 osci_buffer[i] = 0;
459 }
460 }
461
462 splitx = time_to_xpos(split);
463 splitedit_set_split_x(splitx);
464 splitedit_invalidate_osci();
465
466}
467
468static void scroll(struct mp3entry *mp3)
469{
470 zoom(mp3, 1, 1);
471 rb->lcd_update_rect(OSCI_X, OSCI_Y, LCD_WIDTH, OSCI_HEIGHT);
472 update_osci();
473 update_data();
474}
475
476/**
477 * Zooms in by 3/4
478 */
479static void splitedit_zoom_in(struct mp3entry *mp3)
480{
481 rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
482 rb->lcd_fillrect(OSCI_X, OSCI_Y, OSCI_WIDTH, OSCI_HEIGHT);
483 rb->lcd_set_drawmode(DRMODE_SOLID);
484 zoom(mp3, 3, 4);
485 rb->lcd_update_rect(OSCI_X, OSCI_Y, LCD_WIDTH, OSCI_HEIGHT);
486 update_osci();
487 update_data();
488}
489
490/**
491 * Zooms out by 4/3
492 */
493static void splitedit_zoom_out(struct mp3entry *mp3)
494{
495 rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
496 rb->lcd_fillrect(OSCI_X, OSCI_Y, LCD_WIDTH, OSCI_HEIGHT);
497 rb->lcd_set_drawmode(DRMODE_SOLID);
498 zoom(mp3, 4, 3);
499 rb->lcd_update_rect(OSCI_X, OSCI_Y, LCD_WIDTH, OSCI_HEIGHT);
500 update_osci();
501 update_data();
502}
503
504/**
505 * Append part_no to the file name.
506 */
507static void generateFileName(char* file_name, int part_no)
508{
509 if (rb->strlen(file_name) <MAX_PATH)
510 {
511 int len = rb->strlen(file_name);
512 int ext_len = rb->strlen(".mp3");
513 if (rb->strcasecmp(
514 &file_name[len - ext_len],
515 ".mp3") == 0)
516 {
517 int i = 0;
518 /* shift the extension one position to the right*/
519 for (i = len; i > len - ext_len; i--)
520 {
521 file_name[i] = file_name[i - 1];
522 }
523 file_name[len - ext_len] = '0' + part_no;
524 }
525 else
526 {
527 rb->splash(0, "wrong extension");
528 rb->button_get(true);
529 rb->button_get(true);
530 }
531 }
532 else
533 {
534 rb->splash(0, "name too long");
535 rb->button_get(true);
536 rb->button_get(true);
537
538 }
539
540}
541
542/**
543 * Copy bytes from src to dest while displaying a progressbar.
544 * The files must be already open.
545 */
546static int copy_file(
547 int dest,
548 int src,
549 unsigned int bytes,
550 int prg_y,
551 int prg_h)
552{
553 long button;
554 unsigned char *buffer;
555 unsigned int i = 0;
556 ssize_t bytes_read = 1; /* ensure the for loop is executed */
557 size_t buffer_size;
558 buffer = rb->plugin_get_buffer(&buffer_size);
559
560 for (i = 0; i < bytes && bytes_read > 0; i += bytes_read)
561 {
562 ssize_t bytes_written;
563 unsigned int bytes_to_read =
564 bytes - i > buffer_size ? buffer_size : bytes - i;
565 bytes_read = rb->read(src, buffer, bytes_to_read);
566 bytes_written = rb->write(dest, buffer, bytes_read);
567
568 if (bytes_written < 0) {
569 rb->splash(0, "Write failed in copy.");
570 rb->button_get(true);
571 rb->button_get(true);
572 return -1;
573 }
574
575 button = rb->button_get(false);
576
577 if (button == SPLITEDIT_QUIT
578#ifdef SPLITEDIT_RC_QUIT
579 || button == SPLITEDIT_RC_QUIT:
580#endif
581 ) {
582 rb->splash(0, "Aborting copy.");
583 rb->button_get(true);
584 rb->button_get(true);
585 return -1;
586 }
587
588 rb->gui_scrollbar_draw(rb->screens[SCREEN_MAIN],0, prg_y, LCD_WIDTH,
589 prg_h, bytes, 0, i, HORIZONTAL);
590 rb->lcd_update_rect(0, prg_y, LCD_WIDTH, prg_h);
591 }
592
593 return 0;
594}
595
596/**
597 * Save the files, if the file_name is not NULL
598 */
599static int save(
600 struct mp3entry *mp3,
601 char *file_name1,
602 char *file_name2,
603 int splittime)
604{
605 int file1, file2, src_file;
606 unsigned int end = 0;
607 int retval = 0;
608
609 /* Verify that file 1 doesn't exit yet */
610 if (file_name1 != NULL)
611 {
612 file1 = rb->open(file_name1, O_RDONLY);
613 if (file1 >= 0)
614 {
615 rb->close(file1);
616 rb->splash(0, "File 1 exists. Please rename.");
617 rb->button_get(true);
618 rb->button_get(true);
619 return -1;
620 }
621 }
622
623 /* Verify that file 2 doesn't exit yet */
624 if (file_name2 != NULL)
625 {
626 file2 = rb->open(file_name2, O_RDONLY);
627 if (file2 >= 0)
628 {
629 rb->close(file2);
630 rb->splash(0, "File 2 exists. Please rename.");
631 rb->button_get(true);
632 rb->button_get(true);
633 return -2;
634 }
635 }
636
637 /* find the file position of the split point */
638 rb->audio_pause();
639 rb->audio_ff_rewind(splittime);
640 rb->yield();
641 rb->yield();
642 end = rb->audio_get_file_pos();
643
644 /* open the source file */
645 src_file = rb->open(mp3->path, O_RDONLY);
646 if (src_file >= 0)
647 {
648 int close_stat = 0;
649 int x, y;
650 long offset;
651 unsigned long last_header = rb->mpeg_get_last_header();
652
653 rb->lcd_getstringsize("M", &x, &y);
654
655 /* Find the next frame boundary */
656 rb->lseek(src_file, end, SEEK_SET);
657 rb->find_next_frame(src_file, &offset, 8000, last_header);
658 rb->lseek(src_file, 0, SEEK_SET);
659 end += offset;
660
661 /* write the file 1 */
662 if (file_name1 != NULL)
663 {
664 file1 = rb->open (file_name1, O_WRONLY | O_CREAT, 0666);
665 if (file1 >= 0)
666 {
667 int rc = copy_file(file1, src_file, end, y*2 + 1, y -1);
668 close_stat = rb->close(file1);
669
670 if (close_stat != 0)
671 {
672 rb->splashf(0, "failed closing file1: error %d", close_stat);
673 rb->button_get(true);
674 rb->button_get(true);
675 } else {
676 /* If there was an error, cleanup */
677 if (rc) {
678 rb->remove(file_name1);
679 }
680 }
681 }
682 else
683 {
684 rb->splashf(0, "Can't write File1: error %d", file1);
685 rb->button_get(true);
686 rb->button_get(true);
687 retval = -1;
688 }
689 }
690 /* if file1 hasn't been written we're not at the split point yet */
691 else
692 {
693 if (rb->lseek(src_file, end, SEEK_SET) < (off_t)end)
694 {
695 rb->splashf(0, "Src file to short: error %d", src_file);
696 rb->button_get(true);
697 rb->button_get(true);
698 }
699 }
700
701 if (file_name2 != NULL)
702 {
703 /* write file 2 */
704 file2 = rb->open (file_name2, O_WRONLY | O_CREAT, 0666);
705 if (file2 >= 0)
706 {
707 end = mp3->filesize - end;
708 int rc = copy_file(file2, src_file, end, y * 5 + 1, y -1);
709 close_stat = rb->close(file2);
710
711 if (close_stat != 0)
712 {
713 rb->splashf(0, "failed: closing file2: error %d",
714 close_stat);
715 rb->button_get(true);
716 rb->button_get(true);
717 } else {
718 /* If there was an error, cleanup */
719 if (rc) {
720 rb->remove(file_name2);
721 }
722 }
723 }
724 else
725 {
726 rb->splashf(0, "Can't write File2: error %d", file2);
727 rb->button_get(true);
728 rb->button_get(true);
729 retval = -2;
730 }
731 }
732
733 close_stat = rb->close(src_file);
734 if (close_stat != 0)
735 {
736 rb->splashf(0, "failed: closing src: error %d", close_stat);
737 rb->button_get(true);
738 rb->button_get(true);
739 }
740 }
741 else
742 {
743 rb->splash(0, "Source file not found");
744 rb->button_get(true);
745 rb->button_get(true);
746 retval = -3;
747 }
748
749 rb->audio_resume();
750
751 return retval;
752}
753
754static void puts_wrapper(int x, int y, const char *str, bool scroll, bool selected)
755{
756 struct line_desc line = LINE_DESC_DEFINIT;
757 struct screen *lcd = rb->screens[SCREEN_MAIN];
758 int w = lcd->getcharwidth();
759 int h = lcd->getcharheight();
760
761 line.scroll = scroll;
762 line.style = selected ? STYLE_INVERT : STYLE_DEFAULT;
763
764 rb->screens[0]->put_line(x * w, y * h, &line, str);
765}
766
767/**
768 * Let the user choose which file to save with which name
769 */
770static void save_editor(struct mp3entry *mp3, int splittime)
771{
772 bool exit_request = false;
773 int choice = 0;
774 int button = BUTTON_NONE;
775 char part1_name [MAX_PATH];
776 char part2_name [MAX_PATH];
777 bool part1_save = true;
778 bool part2_save = true;
779
780 /* file name for left part */
781 rb->strlcpy(part1_name, mp3->path, MAX_PATH);
782 generateFileName(part1_name, 1);
783
784 /* file name for right part */
785 rb->strlcpy(part2_name, mp3->path, MAX_PATH);
786 generateFileName(part2_name, 2);
787
788 while (!exit_request)
789 {
790 int pos;
791 rb->lcd_clear_display();
792
793 /* Save file1? */
794 puts_wrapper(0, 0, "Save part 1?", false, choice == SE_PART1_SAVE);
795 puts_wrapper(7, 0, part1_save?"yes":"no", false, false);
796
797 /* trim to display the filename without path */
798 for (pos = rb->strlen(part1_name); pos > 0; pos--)
799 {
800 if (part1_name[pos] == '/')
801 break;
802 }
803 pos++;
804
805 /* File name 1 */
806 puts_wrapper(0, 1, &part1_name[pos], true, choice == SE_PART1_NAME);
807
808 /* Save file2? */
809 puts_wrapper(0, 3, "Save part 2?", false, choice == SE_PART2_SAVE);
810 puts_wrapper(7, 3, part2_save?"yes":"no", false, false);
811
812 /* trim to display the filename without path */
813 for (pos = rb->strlen(part2_name); pos > 0; pos --)
814 {
815 if (part2_name[pos] == '/')
816 break;
817 }
818 pos++;
819
820 /* File name 2 */
821 puts_wrapper(0, 4, &part2_name[pos], true, choice == SE_PART2_NAME);
822
823 /* Save */
824 puts_wrapper(0, 6, "Save", false, choice == SE_SAVE);
825
826 rb->lcd_update();
827
828
829 button = rb->button_get(true);
830 switch (button)
831 {
832 case BUTTON_UP:
833 choice = (choice + SE_COUNT - 1) % SE_COUNT;
834 break;
835
836 case BUTTON_DOWN:
837 choice = (choice + 1) % SE_COUNT;
838 break;
839
840 case SPLITEDIT_MENU_RUN:
841 switch (choice)
842 {
843 int saved;
844
845 case SE_PART1_SAVE:
846 part1_save = !part1_save;
847 break;
848
849 case SE_PART1_NAME:
850 rb->kbd_input(part1_name, MAX_PATH, NULL);
851 break;
852
853 case SE_PART2_SAVE:
854 part2_save = !part2_save;
855 break;
856
857 case SE_PART2_NAME:
858 rb->kbd_input(part2_name, MAX_PATH, NULL);
859 break;
860
861 case SE_SAVE:
862 rb->lcd_scroll_stop();
863 rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
864 rb->lcd_fillrect(0, 6*8, LCD_WIDTH, LCD_HEIGHT);
865 rb->lcd_set_drawmode(DRMODE_SOLID);
866 saved = save
867 (
868 mp3,
869 part1_save?part1_name:NULL,
870 part2_save?part2_name:NULL,
871 splittime
872 );
873
874 /* if something failed the user may go on choosing */
875 if (saved >= 0)
876 {
877 exit_request = true;
878 }
879 break;
880 }
881 break;
882#ifdef SPLITEDIT_RC_QUIT
883 case SPLITEDIT_RC_QUIT:
884#endif
885 case SPLITEDIT_QUIT:
886 exit_request = true;
887 break;
888
889 default:
890 if (rb->default_event_handler(button) == SYS_USB_CONNECTED)
891 {
892 splitedit_exit_code = PLUGIN_USB_CONNECTED;
893 exit_request = true;
894 }
895 break;
896 }
897 }
898}
899
900/**
901 * The main loop of the editor
902 */
903static unsigned long splitedit_editor(struct mp3entry * mp3_to_split,
904 unsigned int split_time,
905 unsigned int range)
906{
907 int button = BUTTON_NONE;
908 int lastbutton = BUTTON_NONE;
909 struct mp3entry *mp3 = mp3_to_split;
910 unsigned int last_elapsed = 0;
911 int lastx = OSCI_X + (OSCI_WIDTH / 2);
912 int retval = -1;
913
914 if (mp3 != NULL)
915 {
916 /*unsigned short scheme = SCHEME_SPLIT_EDITOR;*/
917 bool exit_request = false;
918 set_range_by_time(mp3, split_time, range);
919 splitedit_set_loop_mode(LOOP_MODE_ALL);
920 update_icons();
921
922 /*while (scheme != SCHEME_RETURN) {*/
923 while (!exit_request)
924 {
925 unsigned int elapsed ;
926 int x ;
927
928 /* get position */
929 elapsed = mp3->elapsed;
930 x = time_to_xpos(elapsed);
931
932 /* are we still in the zoomed range? */
933 if (elapsed > play_start && elapsed < play_end)
934 {
935 /* read volume info */
936 unsigned short volume;
937 volume = OSCI_HEIGHT / 2;
938
939 /* update osci_buffer */
940 if (osci_valid || lastx == x)
941 {
942 int index = x - OSCI_X;
943 osci_buffer[index] = MAX(osci_buffer[index], volume);
944 }
945 else
946 {
947 int i;
948 osci_buffer[x - OSCI_X] = volume;
949 for (i = lastx + 1; i < x; i++)
950 {
951 osci_buffer[i - OSCI_X] = 0;
952 }
953 }
954
955 /* make room */
956 rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
957 rb->lcd_fillrect(lastx + 1, OSCI_Y, x - lastx, OSCI_HEIGHT);
958 rb->lcd_set_drawmode(DRMODE_SOLID);
959 /* draw a value */
960 if (osci_buffer[x - OSCI_X] > 0)
961 {
962 int i;
963 for (i = lastx +1; i <= x; i++)
964 {
965 rb->lcd_vline
966 (
967 i, OSCI_Y + OSCI_HEIGHT - 1,
968 OSCI_Y + OSCI_HEIGHT - osci_buffer[i - OSCI_X]-1
969 );
970 }
971 }
972
973 /* mark the current position */
974 if (lastx != x)
975 {
976 rb->lcd_set_drawmode(DRMODE_COMPLEMENT);
977 rb->lcd_fillrect(lastx, OSCI_Y, 1, OSCI_HEIGHT);
978 rb->lcd_fillrect(x, OSCI_Y, 1, OSCI_HEIGHT);
979 rb->lcd_set_drawmode(DRMODE_SOLID);
980 }
981
982 /* mark the split point */
983 if ((x > split_x - 2) && (lastx < split_x + 3))
984 {
985 if ((lastx < split_x) && (x >= split_x))
986 {
987 rb->lcd_set_drawmode(DRMODE_COMPLEMENT);
988 rb->lcd_fillrect
989 (
990 split_x, OSCI_Y + 2,
991 1, OSCI_HEIGHT - 2
992 );
993 rb->lcd_set_drawmode(DRMODE_SOLID);
994 }
995 rb->lcd_hline(split_x -2, split_x + 2, OSCI_Y);
996 rb->lcd_hline(split_x-1, split_x +1,OSCI_Y+1);
997 }
998
999 /* make visible */
1000 if (lastx <= x)
1001 {
1002 rb->lcd_update_rect(lastx, OSCI_Y, x-lastx+1, OSCI_HEIGHT);
1003 }
1004 else
1005 {
1006 rb->lcd_update_rect
1007 (
1008 lastx, OSCI_Y,
1009 OSCI_X + OSCI_WIDTH - lastx, OSCI_HEIGHT
1010 );
1011 rb->lcd_update_rect(0, OSCI_Y, x + 1, OSCI_HEIGHT);
1012 }
1013
1014 lastx = x;
1015 }
1016
1017 /* we're not in the zoom range -> rewind */
1018 else
1019 {
1020 if (elapsed >= play_end)
1021 {
1022 switch (splitedit_get_loop_mode())
1023 {
1024 unsigned int range_width;
1025
1026 case LOOP_MODE_ALL:
1027 case LOOP_MODE_TO:
1028 rb->audio_pause();
1029 rb->audio_ff_rewind(range_start);
1030#if (CONFIG_STORAGE & STORAGE_MMC)
1031/* MMC is slow - wait some time to allow track reload to finish */
1032 rb->sleep(HZ/20);
1033 if (mp3->elapsed > play_end) /* reload in progress */
1034 rb->splash(10*HZ, "Wait - reloading");
1035#endif
1036 rb->audio_resume();
1037 break;
1038
1039 case LOOP_MODE_FROM:
1040 rb->audio_pause();
1041 rb->audio_ff_rewind(xpos_to_time(split_x));
1042#if (CONFIG_STORAGE & STORAGE_MMC)
1043/* MMC is slow - wait some time to allow track reload to finish */
1044 rb->sleep(HZ/20);
1045 if (mp3->elapsed > play_end) /* reload in progress */
1046 rb->splash(10*HZ, "Wait - reloading");
1047#endif
1048 rb->audio_resume();
1049 break;
1050
1051 case LOOP_MODE_FREE:
1052 range_width = range_end - range_start;
1053 set_range_by_time(mp3,
1054 range_end + range_width / 2, range_width);
1055
1056 /* play_end und play_start anpassen */
1057 splitedit_set_loop_mode(LOOP_MODE_FREE);
1058 rb->memset(osci_buffer, 0, sizeof osci_buffer);
1059 update_osci();
1060 rb->lcd_update();
1061 break;
1062 }
1063 }
1064 }
1065
1066 button = rb->button_get(false);
1067 rb->yield();
1068
1069 /* here the evaluation of the key scheme starts.
1070 All functions the user triggers are called from
1071 within execute_scheme */
1072 /* key_scheme_execute(button, &scheme); */
1073 switch (button)
1074 {
1075 case SPLITEDIT_PLAY:
1076#ifdef SPLITEDIT_PLAY_PRE
1077 if (lastbutton != SPLITEDIT_PLAY_PRE)
1078 break;
1079#endif
1080 rb->audio_pause();
1081 rb->audio_ff_rewind(xpos_to_time(split_x));
1082 rb->audio_resume();
1083 break;
1084
1085 case BUTTON_UP:
1086 splitedit_zoom_in(mp3);
1087 lastx = time_to_xpos(mp3->elapsed);
1088 break;
1089
1090 case BUTTON_DOWN:
1091 splitedit_zoom_out(mp3);
1092 lastx = time_to_xpos(mp3->elapsed);
1093 break;
1094
1095 case BUTTON_LEFT:
1096 case BUTTON_LEFT | BUTTON_REPEAT:
1097 if (splitedit_get_split_x() > OSCI_X + 2)
1098 {
1099 splitedit_set_split_x(splitedit_get_split_x() - 1);
1100 }
1101 else
1102 {
1103 scroll(mp3);
1104 lastx = time_to_xpos(mp3->elapsed);
1105 }
1106 break;
1107
1108 case BUTTON_RIGHT:
1109 case BUTTON_RIGHT | BUTTON_REPEAT:
1110 if (splitedit_get_split_x() < OSCI_X + OSCI_WIDTH-3)
1111 {
1112 splitedit_set_split_x(splitedit_get_split_x() + 1);
1113 }
1114 else
1115 {
1116 scroll(mp3);
1117 lastx = time_to_xpos(mp3->elapsed);
1118 }
1119 break;
1120
1121 case SPLITEDIT_SAVE:
1122 save_editor(mp3, xpos_to_time(split_x));
1123 rb->lcd_clear_display();
1124 update_osci();
1125 update_timebar(mp3);
1126 update_icons();
1127 break;
1128
1129 case SPLITEDIT_LOOP_MODE:
1130 splitedit_set_loop_mode(splitedit_get_loop_mode() + 1);
1131 update_icons();
1132 break;
1133
1134 case SPLITEDIT_SCALE:
1135 splitedit_invalidate_osci();
1136 update_icons();
1137 break;
1138
1139#ifdef SPLITEDIT_RC_QUIT
1140 case SPLITEDIT_RC_QUIT:
1141#endif
1142 case SPLITEDIT_QUIT:
1143 exit_request = true;
1144 break;
1145
1146 default:
1147 if (rb->default_event_handler(button) == SYS_USB_CONNECTED)
1148 {
1149 splitedit_exit_code = PLUGIN_USB_CONNECTED;
1150 exit_request = true;
1151 }
1152 break;
1153
1154 }
1155 if (button != BUTTON_NONE)
1156 lastbutton = button;
1157
1158 if (validation_start == ~(unsigned int)0)
1159 {
1160 if (elapsed < range_end && elapsed > range_start)
1161 {
1162 validation_start = elapsed;
1163 }
1164 else
1165 {
1166 int endx = time_to_xpos(range_end);
1167 validation_start = xpos_to_time(endx - 2);
1168 }
1169 last_elapsed = elapsed + 1;
1170 }
1171 else
1172 {
1173 if ((last_elapsed <= validation_start) &&
1174 (elapsed > validation_start))
1175 {
1176 osci_valid = true;
1177 }
1178
1179 last_elapsed = elapsed;
1180 }
1181 update_data();
1182
1183 if (mp3 != rb->audio_current_track())
1184 {
1185 struct mp3entry *new_mp3 = rb->audio_current_track();
1186 if (rb->strncasecmp(path_mp3, new_mp3->path,
1187 sizeof (path_mp3)))
1188 {
1189 rb->splash(0, "Abort due to file change");
1190 rb->button_get(true);
1191 rb->button_get(true);
1192 exit_request = true;
1193 }
1194 else
1195 {
1196 mp3 = new_mp3;
1197 rb->audio_pause();
1198 rb->audio_flush_and_reload_tracks();
1199 rb->audio_ff_rewind(range_start);
1200 rb->audio_resume();
1201 }
1202 }
1203 }
1204 }
1205 return retval;
1206}
1207
1208enum plugin_status plugin_start(const void* parameter)
1209{
1210 struct mp3entry* mp3;
1211
1212 (void)parameter;
1213 rb->lcd_clear_display();
1214 rb->lcd_update();
1215 mp3 = rb->audio_current_track();
1216 if (mp3 != NULL)
1217 {
1218 if (rb->audio_status() & AUDIO_STATUS_PAUSE)
1219 {
1220 rb->audio_resume();
1221 }
1222 splitedit_editor(mp3, mp3->elapsed, MIN_RANGE_SIZE * 8);
1223 }
1224 else
1225 {
1226 rb->splash(0, "Play or pause a mp3 file first.");
1227 rb->button_get(true);
1228 rb->button_get(true);
1229 }
1230 return splitedit_exit_code;
1231}
diff --git a/apps/plugins/starfield.c b/apps/plugins/starfield.c
index dff3c4b4d1..24e2e4c085 100644
--- a/apps/plugins/starfield.c
+++ b/apps/plugins/starfield.c
@@ -220,7 +220,6 @@ static int plugin_main(void)
220 rb->sleep(1); 220 rb->sleep(1);
221 rb->lcd_clear_display(); 221 rb->lcd_clear_display();
222 222
223#if (CONFIG_CODEC == SWCODEC)
224 /* This will make the stars pulse to the music */ 223 /* This will make the stars pulse to the music */
225 if(pulse){ 224 if(pulse){
226 225
@@ -255,7 +254,7 @@ static int plugin_main(void)
255 starfield.z_move = avg_peak; 254 starfield.z_move = avg_peak;
256 255
257 } /* if pulse */ 256 } /* if pulse */
258#endif 257
259 starfield_move_and_draw(&starfield); 258 starfield_move_and_draw(&starfield);
260 259
261#ifdef HAVE_LCD_COLOR 260#ifdef HAVE_LCD_COLOR
diff --git a/apps/plugins/vu_meter.c b/apps/plugins/vu_meter.c
index a4d639ede6..d2ba8c992c 100644
--- a/apps/plugins/vu_meter.c
+++ b/apps/plugins/vu_meter.c
@@ -469,10 +469,6 @@
469#endif 469#endif
470#endif 470#endif
471 471
472#if defined(SIMULATOR) && (CONFIG_CODEC != SWCODEC)
473#define mas_codec_readreg(x) rand()%MAX_PEAK
474#endif
475
476/* Defines x positions on a logarithmic (dBfs) scale. */ 472/* Defines x positions on a logarithmic (dBfs) scale. */
477unsigned char analog_db_scale[LCD_WIDTH/2]; 473unsigned char analog_db_scale[LCD_WIDTH/2];
478 474
@@ -780,13 +776,11 @@ static void draw_digital_minimeters(void) {
780 776
781static void analog_meter(void) { 777static void analog_meter(void) {
782 778
783#if (CONFIG_CODEC == SWCODEC)
784 static struct pcm_peaks peaks; 779 static struct pcm_peaks peaks;
785 rb->mixer_channel_calculate_peaks(PCM_MIXER_CHAN_PLAYBACK, 780 rb->mixer_channel_calculate_peaks(PCM_MIXER_CHAN_PLAYBACK,
786 &peaks); 781 &peaks);
787 #define left_peak peaks.left 782 #define left_peak peaks.left
788 #define right_peak peaks.right 783 #define right_peak peaks.right
789#endif
790 784
791 if(vumeter_settings.analog_use_db_scale) { 785 if(vumeter_settings.analog_use_db_scale) {
792 left_needle_top_x = analog_db_scale[left_peak * half_width / MAX_PEAK]; 786 left_needle_top_x = analog_db_scale[left_peak * half_width / MAX_PEAK];
@@ -837,13 +831,11 @@ static void analog_meter(void) {
837} 831}
838 832
839static void digital_meter(void) { 833static void digital_meter(void) {
840#if (CONFIG_CODEC == SWCODEC)
841 static struct pcm_peaks peaks; 834 static struct pcm_peaks peaks;
842 rb->mixer_channel_calculate_peaks(PCM_MIXER_CHAN_PLAYBACK, 835 rb->mixer_channel_calculate_peaks(PCM_MIXER_CHAN_PLAYBACK,
843 &peaks); 836 &peaks);
844 #define left_peak peaks.left 837 #define left_peak peaks.left
845 #define right_peak peaks.right 838 #define right_peak peaks.right
846#endif
847 839
848 if(vumeter_settings.digital_use_db_scale) { 840 if(vumeter_settings.digital_use_db_scale) {
849 num_left_leds = digital_db_scale[left_peak * 44 / MAX_PEAK]; 841 num_left_leds = digital_db_scale[left_peak * 44 / MAX_PEAK];
diff --git a/apps/plugins/zxbox/spmain.c b/apps/plugins/zxbox/spmain.c
index e27770c70c..6c6b59c3fb 100644
--- a/apps/plugins/zxbox/spmain.c
+++ b/apps/plugins/zxbox/spmain.c
@@ -290,7 +290,7 @@ static void options_menu(void){
290 no_yes, 2, NULL); 290 no_yes, 2, NULL);
291 if (new_setting != settings.sound ) 291 if (new_setting != settings.sound )
292 settings.sound=new_setting; 292 settings.sound=new_setting;
293#if CONFIG_CODEC == SWCODEC && !defined SIMULATOR 293#if !defined SIMULATOR
294 rb->pcm_play_stop(); 294 rb->pcm_play_stop();
295#endif 295#endif
296 break; 296 break;
@@ -318,7 +318,7 @@ static void options_menu(void){
318/* menu */ 318/* menu */
319static bool zxbox_menu(void) 319static bool zxbox_menu(void)
320{ 320{
321#if CONFIG_CODEC == SWCODEC && !defined SIMULATOR 321#if !defined SIMULATOR
322 rb->pcm_play_stop(); 322 rb->pcm_play_stop();
323#endif 323#endif
324 int selected=0; 324 int selected=0;
diff --git a/apps/plugins/zxbox/zxbox.c b/apps/plugins/zxbox/zxbox.c
index d618243b92..4ebc0e0a9e 100644
--- a/apps/plugins/zxbox/zxbox.c
+++ b/apps/plugins/zxbox/zxbox.c
@@ -102,9 +102,9 @@ enum plugin_status plugin_start(const void* parameter)
102#ifdef USE_GREY 102#ifdef USE_GREY
103grey_show(false); 103grey_show(false);
104grey_release(); 104grey_release();
105#endif 105#endif
106 106
107#if CONFIG_CODEC == SWCODEC && !defined SIMULATOR 107#if !defined SIMULATOR
108 rb->pcm_play_stop(); 108 rb->pcm_play_stop();
109#endif 109#endif
110 110
diff --git a/apps/plugins/zxbox/zxconfig.h b/apps/plugins/zxbox/zxconfig.h
index 590da99f15..fb93dc5081 100644
--- a/apps/plugins/zxbox/zxconfig.h
+++ b/apps/plugins/zxbox/zxconfig.h
@@ -29,7 +29,7 @@ extern int intkeys[5];
29#define SPECT_MEM 1 29#define SPECT_MEM 1
30 30
31/* Define if sound driver is available. */ 31/* Define if sound driver is available. */
32#if CONFIG_CODEC == SWCODEC && !defined SIMULATOR 32#if !defined SIMULATOR
33#define HAVE_SOUND 33#define HAVE_SOUND
34#endif 34#endif
35 35
diff --git a/apps/radio/radio.c b/apps/radio/radio.c
index 362d10f9a3..6038d600a9 100644
--- a/apps/radio/radio.c
+++ b/apps/radio/radio.c
@@ -54,9 +54,7 @@
54#include "viewport.h" 54#include "viewport.h"
55#include "skin_engine/skin_engine.h" 55#include "skin_engine/skin_engine.h"
56#include "statusbar-skinned.h" 56#include "statusbar-skinned.h"
57#if CONFIG_CODEC == SWCODEC
58#include "playback.h" 57#include "playback.h"
59#endif
60#include "presets.h" 58#include "presets.h"
61 59
62#if CONFIG_TUNER 60#if CONFIG_TUNER
@@ -353,14 +351,6 @@ void radio_screen(void)
353 int lastbutton = BUTTON_NONE; 351 int lastbutton = BUTTON_NONE;
354 unsigned long rec_lastclick = 0; 352 unsigned long rec_lastclick = 0;
355#endif 353#endif
356#if CONFIG_CODEC != SWCODEC
357 int timeout = current_tick + HZ/10;
358#if !defined(SIMULATOR)
359 unsigned int last_seconds = 0;
360 unsigned int seconds = 0;
361 struct audio_recording_options rec_options;
362#endif /* SIMULATOR */
363#endif /* CONFIG_CODEC != SWCODEC */
364#ifndef HAVE_NOISY_IDLE_MODE 354#ifndef HAVE_NOISY_IDLE_MODE
365 int button_timeout = current_tick + (2*HZ); 355 int button_timeout = current_tick + (2*HZ);
366#endif 356#endif
@@ -383,29 +373,7 @@ void radio_screen(void)
383 373
384 fms_fix_displays(FMS_ENTER); 374 fms_fix_displays(FMS_ENTER);
385 375
386#ifndef SIMULATOR
387
388#if CONFIG_CODEC != SWCODEC
389 rec_create_directory();
390 audio_init_recording();
391
392 sound_settings_apply();
393 /* Yes, we use the D/A for monitoring */
394 peak_meter_playback(true);
395
396 peak_meter_enable(true);
397
398 rec_init_recording_options(&rec_options);
399 rec_options.rec_source = AUDIO_SRC_LINEIN;
400 rec_set_recording_options(&rec_options);
401
402 audio_set_recording_gain(sound_default(SOUND_LEFT_GAIN),
403 sound_default(SOUND_RIGHT_GAIN), AUDIO_GAIN_LINEIN);
404
405#endif /* CONFIG_CODEC != SWCODEC */
406#endif /* ndef SIMULATOR */
407 /* turn on radio */ 376 /* turn on radio */
408#if CONFIG_CODEC == SWCODEC
409 /* This should be done before touching audio settings */ 377 /* This should be done before touching audio settings */
410 while (!pcm_is_initialized()) 378 while (!pcm_is_initialized())
411 sleep(0); 379 sleep(0);
@@ -413,10 +381,6 @@ void radio_screen(void)
413 audio_set_input_source(AUDIO_SRC_FMRADIO, 381 audio_set_input_source(AUDIO_SRC_FMRADIO,
414 (radio_status == FMRADIO_PAUSED) ? 382 (radio_status == FMRADIO_PAUSED) ?
415 SRCF_FMRADIO_PAUSED : SRCF_FMRADIO_PLAYING); 383 SRCF_FMRADIO_PAUSED : SRCF_FMRADIO_PLAYING);
416#else
417 if (radio_status == FMRADIO_OFF)
418 radio_start();
419#endif
420 384
421 if(radio_preset_count() < 1 && yesno_pop(ID2P(LANG_FM_FIRST_AUTOSCAN))) 385 if(radio_preset_count() < 1 && yesno_pop(ID2P(LANG_FM_FIRST_AUTOSCAN)))
422 presets_scan(NULL); 386 presets_scan(NULL);
@@ -468,13 +432,6 @@ void radio_screen(void)
468 switch(button) 432 switch(button)
469 { 433 {
470 case ACTION_FM_STOP: 434 case ACTION_FM_STOP:
471#if CONFIG_CODEC != SWCODEC && !defined(SIMULATOR)
472 if(audio_status() == AUDIO_STATUS_RECORD)
473 {
474 audio_stop();
475 }
476 else
477#endif
478 { 435 {
479 done = true; 436 done = true;
480 if(presets_have_changed()) 437 if(presets_have_changed())
@@ -513,18 +470,11 @@ void radio_screen(void)
513 rec_command(RECORDING_CMD_START); 470 rec_command(RECORDING_CMD_START);
514 update_type = SKIN_REFRESH_ALL; 471 update_type = SKIN_REFRESH_ALL;
515 } 472 }
516#if CONFIG_CODEC != SWCODEC
517 last_seconds = 0;
518#endif
519#endif /* SIMULATOR */ 473#endif /* SIMULATOR */
520 break; 474 break;
521#endif /* #ifdef FM_RECORD */ 475#endif /* #ifdef FM_RECORD */
522 476
523 case ACTION_FM_EXIT: 477 case ACTION_FM_EXIT:
524#if CONFIG_CODEC != SWCODEC && !defined(SIMULATOR)
525 if(audio_status() == AUDIO_STATUS_RECORD)
526 audio_stop();
527#endif
528 keep_playing = true; 478 keep_playing = true;
529 done = true; 479 done = true;
530 if(presets_have_changed()) 480 if(presets_have_changed())
@@ -629,10 +579,6 @@ void radio_screen(void)
629#endif /* FM_FREEZE */ 579#endif /* FM_FREEZE */
630 580
631 case SYS_USB_CONNECTED: 581 case SYS_USB_CONNECTED:
632#if CONFIG_CODEC != SWCODEC
633 /* Only accept USB connection when not recording */
634 if(audio_status() != AUDIO_STATUS_RECORD)
635#endif
636 { 582 {
637 default_event_handler(SYS_USB_CONNECTED); 583 default_event_handler(SYS_USB_CONNECTED);
638 screen_freeze = true; /* Cosmetic: makes sure the 584 screen_freeze = true; /* Cosmetic: makes sure the
@@ -688,10 +634,6 @@ void radio_screen(void)
688 default_event_handler(button); 634 default_event_handler(button);
689 if (!tuner_get(RADIO_PRESENT)) 635 if (!tuner_get(RADIO_PRESENT))
690 { 636 {
691#if CONFIG_CODEC != SWCODEC && !defined(SIMULATOR)
692 if(audio_status() == AUDIO_STATUS_RECORD)
693 audio_stop();
694#endif
695 keep_playing = false; 637 keep_playing = false;
696 done = true; 638 done = true;
697 if(presets_have_changed()) 639 if(presets_have_changed())
@@ -713,21 +655,10 @@ void radio_screen(void)
713 lastbutton = button; 655 lastbutton = button;
714#endif 656#endif
715 657
716#if CONFIG_CODEC != SWCODEC
717 peak_meter_peek();
718#endif
719
720 if(!screen_freeze) 658 if(!screen_freeze)
721 { 659 {
722 /* Only display the peak meter when not recording */ 660 /* Only display the peak meter when not recording */
723#if CONFIG_CODEC != SWCODEC
724 if(TIME_AFTER(current_tick, timeout))
725 {
726 timeout = current_tick + HZ;
727#else /* SWCODEC */
728 { 661 {
729#endif /* CONFIG_CODEC == SWCODEC */
730
731 /* keep "mono" from always being displayed when paused */ 662 /* keep "mono" from always being displayed when paused */
732 if (radio_status != FMRADIO_PAUSED) 663 if (radio_status != FMRADIO_PAUSED)
733 { 664 {
@@ -742,15 +673,8 @@ void radio_screen(void)
742 } 673 }
743 } 674 }
744 675
745#if CONFIG_CODEC != SWCODEC && !defined(SIMULATOR)
746 seconds = audio_recorded_time() / HZ;
747 if (update_type || seconds > last_seconds)
748 {
749 last_seconds = seconds;
750#else
751 if (update_type) 676 if (update_type)
752 { 677 {
753#endif
754 FOR_NB_SCREENS(i) 678 FOR_NB_SCREENS(i)
755 skin_update(FM_SCREEN, i, update_type); 679 skin_update(FM_SCREEN, i, update_type);
756 if (update_type == (int)SKIN_REFRESH_ALL) 680 if (update_type == (int)SKIN_REFRESH_ALL)
@@ -774,13 +698,6 @@ void radio_screen(void)
774 enqueue); 698 enqueue);
775 } 699 }
776 700
777#if CONFIG_CODEC != SWCODEC
778 if(audio_status() & AUDIO_STATUS_ERROR)
779 {
780 done = true;
781 }
782#endif
783
784#ifndef HAVE_NOISY_IDLE_MODE 701#ifndef HAVE_NOISY_IDLE_MODE
785 if (TIME_AFTER(current_tick, button_timeout)) 702 if (TIME_AFTER(current_tick, button_timeout))
786 { 703 {
@@ -790,23 +707,6 @@ void radio_screen(void)
790 } /*while(!done)*/ 707 } /*while(!done)*/
791 708
792#ifndef SIMULATOR 709#ifndef SIMULATOR
793#if CONFIG_CODEC != SWCODEC
794 if(audio_status() & AUDIO_STATUS_ERROR)
795 {
796 splash(0, str(LANG_DISK_FULL));
797 audio_error_clear();
798
799 while(1)
800 {
801 button = get_action(CONTEXT_FM|ALLOW_SOFTLOCK, TIMEOUT_BLOCK);
802 if(button == ACTION_FM_STOP)
803 break;
804 }
805 }
806
807 audio_init_playback();
808#endif /* CONFIG_CODEC != SWCODEC */
809
810 sound_settings_apply(); 710 sound_settings_apply();
811#endif /* SIMULATOR */ 711#endif /* SIMULATOR */
812 712
@@ -814,23 +714,12 @@ void radio_screen(void)
814 { 714 {
815/* Catch FMRADIO_PLAYING status for the sim. */ 715/* Catch FMRADIO_PLAYING status for the sim. */
816#ifndef SIMULATOR 716#ifndef SIMULATOR
817#if CONFIG_CODEC != SWCODEC
818 /* Enable the Left and right A/D Converter */
819 audio_set_recording_gain(sound_default(SOUND_LEFT_GAIN),
820 sound_default(SOUND_RIGHT_GAIN),
821 AUDIO_GAIN_LINEIN);
822 mas_codec_writereg(6, 0x4000);
823#endif
824 end_search(); 717 end_search();
825#endif /* SIMULATOR */ 718#endif /* SIMULATOR */
826 } 719 }
827 else 720 else
828 { 721 {
829#if CONFIG_CODEC == SWCODEC
830 audio_set_input_source(AUDIO_SRC_PLAYBACK, SRCF_PLAYBACK); 722 audio_set_input_source(AUDIO_SRC_PLAYBACK, SRCF_PLAYBACK);
831#else
832 radio_stop();
833#endif
834 } 723 }
835 724
836#ifndef HAVE_NOISY_IDLE_MODE 725#ifndef HAVE_NOISY_IDLE_MODE
diff --git a/apps/radio/radio_skin.c b/apps/radio/radio_skin.c
index 90aa977e56..4d90c4e241 100644
--- a/apps/radio/radio_skin.c
+++ b/apps/radio/radio_skin.c
@@ -41,7 +41,7 @@
41char* default_radio_skin(enum screen_type screen) 41char* default_radio_skin(enum screen_type screen)
42{ 42{
43 (void)screen; 43 (void)screen;
44 static char default_fms[] = 44 static char default_fms[] =
45 "%s%?Ti<%Ti. |>%?Tn<%Tn|%Tf>\n" 45 "%s%?Ti<%Ti. |>%?Tn<%Tn|%Tf>\n"
46 "%Sx(Station:) %tf MHz\n" 46 "%Sx(Station:) %tf MHz\n"
47 "%?St(force fm mono)<%Sx(Force Mono)|%?ts<%Sx(Stereo)|%Sx(Mono)>>\n" 47 "%?St(force fm mono)<%Sx(Force Mono)|%?ts<%Sx(Stereo)|%Sx(Mono)>>\n"
@@ -49,9 +49,6 @@ char* default_radio_skin(enum screen_type screen)
49#ifdef HAVE_RADIO_RSSI 49#ifdef HAVE_RADIO_RSSI
50 "%Sx(Signal strength:) %tr dBuV\n" 50 "%Sx(Signal strength:) %tr dBuV\n"
51#endif 51#endif
52#if CONFIG_CODEC != SWCODEC && !defined(SIMULATOR)
53 "%?Rr<%Sx(Time:) %Rh:%Rn:%Rs|%?St(prerecording time)<%pm|%Sx(Prerecord Time) %Rs>>\n"
54#endif
55 "%pb\n" 52 "%pb\n"
56#ifdef HAVE_RDS_CAP 53#ifdef HAVE_RDS_CAP
57 "\n%s%ty\n" 54 "\n%s%ty\n"
diff --git a/apps/recorder/icons.c b/apps/recorder/icons.c
index 03a88c9fdc..cc53716674 100644
--- a/apps/recorder/icons.c
+++ b/apps/recorder/icons.c
@@ -40,10 +40,6 @@ const unsigned char bitmap_icons_5x8[][5] =
40 {0x7f, 0x22, 0x1c, 0x22, 0x7f}, /* Stereo recording */ 40 {0x7f, 0x22, 0x1c, 0x22, 0x7f}, /* Stereo recording */
41 [Icon_Mono] = 41 [Icon_Mono] =
42 {0x00, 0x1c, 0x22, 0x7f, 0x00}, /* Mono recording */ 42 {0x00, 0x1c, 0x22, 0x7f, 0x00}, /* Mono recording */
43#if CONFIG_CODEC != SWCODEC
44 [Icon_q] =
45 {0x1e, 0x21, 0x31, 0x21, 0x5e} /* Q icon */
46#endif
47}; 43};
48 44
49const unsigned char bitmap_icons_7x8[][7] = 45const unsigned char bitmap_icons_7x8[][7] =
@@ -68,7 +64,7 @@ const unsigned char bitmap_icons_7x8[][7] =
68 {0x7f,0x04,0x4e,0x5f,0x44,0x38,0x7f} /* Repeat-AB playmode */ 64 {0x7f,0x04,0x4e,0x5f,0x44,0x38,0x7f} /* Repeat-AB playmode */
69}; 65};
70 66
71#if CONFIG_CODEC == SWCODEC && defined(HAVE_RECORDING) 67#if defined(HAVE_RECORDING)
72const unsigned char bitmap_glyphs_4x8[][4] = 68const unsigned char bitmap_glyphs_4x8[][4] =
73{ 69{
74 /* Keep digits together and first! */ 70 /* Keep digits together and first! */
@@ -116,7 +112,7 @@ const unsigned char bitmap_formats_18x8[Format_18x8Last][18]=
116 {0x00, 0x1e, 0x20, 0x18, 0x20, 0x1e, 0x00, 0x3c, 0x0a, 112 {0x00, 0x1e, 0x20, 0x18, 0x20, 0x1e, 0x00, 0x3c, 0x0a,
117 0x0a, 0x0a, 0x3c, 0x00, 0x0e, 0x10, 0x20, 0x10, 0x0e}, /* WAV */ 113 0x0a, 0x0a, 0x3c, 0x00, 0x0e, 0x10, 0x20, 0x10, 0x0e}, /* WAV */
118}; 114};
119#endif /* CONFIG_CODEC == SWCODEC && defined(HAVE_RECORDING) */ 115#endif /* defined(HAVE_RECORDING) */
120 116
121/* Disk/MMC activity */ 117/* Disk/MMC activity */
122const unsigned char bitmap_icon_disk[12] = 118const unsigned char bitmap_icon_disk[12] =
diff --git a/apps/recorder/icons.h b/apps/recorder/icons.h
index 3c955ffe5b..4faa757184 100644
--- a/apps/recorder/icons.h
+++ b/apps/recorder/icons.h
@@ -42,9 +42,6 @@ enum icons_5x8 {
42 Icon_Lock_Remote, 42 Icon_Lock_Remote,
43 Icon_Stereo, 43 Icon_Stereo,
44 Icon_Mono, 44 Icon_Mono,
45#if CONFIG_CODEC != SWCODEC
46 Icon_q,
47#endif
48 Icon5x8Last 45 Icon5x8Last
49}; 46};
50 47
@@ -70,7 +67,7 @@ enum icons_7x8 {
70 Icon7x8Last 67 Icon7x8Last
71}; 68};
72 69
73#if CONFIG_CODEC == SWCODEC && defined (HAVE_RECORDING) 70#if defined (HAVE_RECORDING)
74#define BM_GLYPH_WIDTH 4 71#define BM_GLYPH_WIDTH 4
75enum Glyphs_4x8 { 72enum Glyphs_4x8 {
76 Glyph_4x8_0 = 0, 73 Glyph_4x8_0 = 0,
@@ -100,7 +97,7 @@ enum rec_format_18x8 {
100}; 97};
101extern const unsigned char bitmap_formats_18x8[Format_18x8Last][18]; 98extern const unsigned char bitmap_formats_18x8[Format_18x8Last][18];
102 99
103#endif /* CONFIG_CODEC == SWCODEC && defined (HAVE_RECORDING) */ 100#endif /* defined (HAVE_RECORDING) */
104 101
105extern const unsigned char bitmap_icons_5x8[Icon5x8Last][5]; 102extern const unsigned char bitmap_icons_5x8[Icon5x8Last][5];
106extern const unsigned char bitmap_icons_7x8[Icon7x8Last][7]; 103extern const unsigned char bitmap_icons_7x8[Icon7x8Last][7];
diff --git a/apps/recorder/keyboard.c b/apps/recorder/keyboard.c
index 4b19287b7f..f735afe84d 100644
--- a/apps/recorder/keyboard.c
+++ b/apps/recorder/keyboard.c
@@ -1218,16 +1218,12 @@ static void kbd_move_cursor(struct edit_state *state, int dir)
1218 else if (state->editpos > state->len_utf8) 1218 else if (state->editpos > state->len_utf8)
1219 { 1219 {
1220 state->editpos = 0; 1220 state->editpos = 0;
1221 #if CONFIG_CODEC == SWCODEC
1222 if (global_settings.talk_menu) beep_play(1000, 150, 1500); 1221 if (global_settings.talk_menu) beep_play(1000, 150, 1500);
1223 #endif
1224 } 1222 }
1225 else if (state->editpos < 0) 1223 else if (state->editpos < 0)
1226 { 1224 {
1227 state->editpos = state->len_utf8; 1225 state->editpos = state->len_utf8;
1228 #if CONFIG_CODEC == SWCODEC
1229 if (global_settings.talk_menu) beep_play(1000, 150, 1500); 1226 if (global_settings.talk_menu) beep_play(1000, 150, 1500);
1230 #endif
1231 } 1227 }
1232} 1228}
1233 1229
diff --git a/apps/recorder/peakmeter.c b/apps/recorder/peakmeter.c
index 5ff2f21215..5a03534040 100644
--- a/apps/recorder/peakmeter.c
+++ b/apps/recorder/peakmeter.c
@@ -19,9 +19,6 @@
19 * 19 *
20 ****************************************************************************/ 20 ****************************************************************************/
21#include "config.h" 21#include "config.h"
22#if defined(SIMULATOR) && (CONFIG_CODEC != SWCODEC)
23#include <stdlib.h> /* sim uses rand for peakmeter simulation */
24#endif
25#include "thread.h" 22#include "thread.h"
26#include "kernel.h" 23#include "kernel.h"
27#include "settings.h" 24#include "settings.h"
@@ -42,7 +39,6 @@
42#endif 39#endif
43#include "action.h" 40#include "action.h"
44 41
45#if CONFIG_CODEC == SWCODEC
46#include "pcm.h" 42#include "pcm.h"
47#include "pcm_mixer.h" 43#include "pcm_mixer.h"
48 44
@@ -50,17 +46,12 @@
50#include "pcm_record.h" 46#include "pcm_record.h"
51#endif 47#endif
52 48
49#if !(CONFIG_PLATFORM & PLATFORM_HOSTED)
53static bool pm_playback = true; /* selects between playback and recording peaks */ 50static bool pm_playback = true; /* selects between playback and recording peaks */
54#endif 51#endif
55 52
56static struct meter_scales scales[NB_SCREENS]; 53static struct meter_scales scales[NB_SCREENS];
57 54
58#if !defined(SIMULATOR) && CONFIG_CODEC != SWCODEC
59/* Data source */
60static int pm_src_left = MAS_REG_DQPEAK_L;
61static int pm_src_right = MAS_REG_DQPEAK_R;
62#endif
63
64/* Current values and cumulation */ 55/* Current values and cumulation */
65static int pm_cur_left; /* current values (last peak_meter_peek) */ 56static int pm_cur_left; /* current values (last peak_meter_peek) */
66static int pm_cur_right; 57static int pm_cur_right;
@@ -554,16 +545,8 @@ void peak_meter_playback(bool playback)
554{ 545{
555#if (CONFIG_PLATFORM & PLATFORM_HOSTED) 546#if (CONFIG_PLATFORM & PLATFORM_HOSTED)
556 (void)playback; 547 (void)playback;
557#elif CONFIG_CODEC == SWCODEC
558 pm_playback = playback;
559#else 548#else
560 if (playback) { 549 pm_playback = playback;
561 pm_src_left = MAS_REG_DQPEAK_L;
562 pm_src_right = MAS_REG_DQPEAK_R;
563 } else {
564 pm_src_left = MAS_REG_QPEAK_L;
565 pm_src_right = MAS_REG_QPEAK_R;
566 }
567#endif 550#endif
568 /* reset the scales just in case recording and playback 551 /* reset the scales just in case recording and playback
569 use different viewport sizes. Normally we should be checking viewport 552 use different viewport sizes. Normally we should be checking viewport
@@ -599,7 +582,10 @@ void peak_meter_peek(void)
599 bool was_clipping = pm_clip_left || pm_clip_right; 582 bool was_clipping = pm_clip_left || pm_clip_right;
600#endif 583#endif
601 /* read current values */ 584 /* read current values */
602#if CONFIG_CODEC == SWCODEC 585#if (CONFIG_PLATFORM & PLATFORM_HOSTED)
586 pm_cur_left = left = 8000;
587 pm_cur_right = right = 9000;
588#else
603 if (pm_playback) 589 if (pm_playback)
604 { 590 {
605 static struct pcm_peaks chan_peaks; /* *MUST* be static */ 591 static struct pcm_peaks chan_peaks; /* *MUST* be static */
@@ -614,14 +600,6 @@ void peak_meter_peek(void)
614#endif 600#endif
615 left = pm_cur_left; 601 left = pm_cur_left;
616 right = pm_cur_right; 602 right = pm_cur_right;
617#else
618#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
619 pm_cur_left = left = mas_codec_readreg(pm_src_left);
620 pm_cur_right = right = mas_codec_readreg(pm_src_right);
621#else
622 pm_cur_left = left = 8000;
623 pm_cur_right = right = 9000;
624#endif
625#endif 603#endif
626 604
627 /* check for clips 605 /* check for clips
@@ -632,22 +610,12 @@ void peak_meter_peek(void)
632 a real clip. For software codecs, the peak is already 610 a real clip. For software codecs, the peak is already
633 the max of a bunch of samples, so use one max value 611 the max of a bunch of samples, so use one max value
634 or you fail to detect clipping! */ 612 or you fail to detect clipping! */
635#if CONFIG_CODEC == SWCODEC
636 if (left == MAX_PEAK - 1) { 613 if (left == MAX_PEAK - 1) {
637#else
638 if ((left == pm_max_left) &&
639 (left == MAX_PEAK - 1)) {
640#endif
641 pm_clip_left = true; 614 pm_clip_left = true;
642 pm_clip_timeout_l = current_tick + pm_clip_hold; 615 pm_clip_timeout_l = current_tick + pm_clip_hold;
643 } 616 }
644 617
645#if CONFIG_CODEC == SWCODEC
646 if (right == MAX_PEAK - 1) { 618 if (right == MAX_PEAK - 1) {
647#else
648 if ((right == pm_max_right) &&
649 (right == MAX_PEAK - 1)) {
650#endif
651 pm_clip_right = true; 619 pm_clip_right = true;
652 pm_clip_timeout_r = current_tick + pm_clip_hold; 620 pm_clip_timeout_r = current_tick + pm_clip_hold;
653 } 621 }
@@ -668,14 +636,12 @@ void peak_meter_peek(void)
668 pm_max_right = MAX(pm_max_right, right); 636 pm_max_right = MAX(pm_max_right, right);
669 637
670#ifdef HAVE_RECORDING 638#ifdef HAVE_RECORDING
671#if CONFIG_CODEC == SWCODEC
672 /* Ignore any unread peakmeter data */ 639 /* Ignore any unread peakmeter data */
673#define MAX_DROP_TIME HZ/7 /* this value may need tweaking. Increase if you are 640#define MAX_DROP_TIME HZ/7 /* this value may need tweaking. Increase if you are
674 getting trig events when you shouldn't with 641 getting trig events when you shouldn't with
675 trig_stp_hold = 0 */ 642 trig_stp_hold = 0 */
676 if (!trig_stp_hold) 643 if (!trig_stp_hold)
677 trig_stp_hold = MAX_DROP_TIME; 644 trig_stp_hold = MAX_DROP_TIME;
678#endif
679 645
680 switch (trig_status) { 646 switch (trig_status) {
681 case TRIG_READY: 647 case TRIG_READY:
@@ -735,11 +701,7 @@ void peak_meter_peek(void)
735 || (right > trig_stp_threshold)) { 701 || (right > trig_stp_threshold)) {
736 /* restart hold time countdown */ 702 /* restart hold time countdown */
737 trig_lowtime = current_tick; 703 trig_lowtime = current_tick;
738#if CONFIG_CODEC == SWCODEC
739 } else if (current_tick - trig_lowtime > MAX_DROP_TIME){ 704 } else if (current_tick - trig_lowtime > MAX_DROP_TIME){
740#else
741 } else {
742#endif
743 set_trig_status(TRIG_POSTREC); 705 set_trig_status(TRIG_POSTREC);
744 trig_hightime = current_tick; 706 trig_hightime = current_tick;
745 } 707 }
@@ -797,12 +759,10 @@ void peak_meter_peek(void)
797 } 759 }
798 break; 760 break;
799 } 761 }
800#if CONFIG_CODEC == SWCODEC
801 /* restore stop hold value */ 762 /* restore stop hold value */
802 if (trig_stp_hold == MAX_DROP_TIME) 763 if (trig_stp_hold == MAX_DROP_TIME)
803 trig_stp_hold = 0; 764 trig_stp_hold = 0;
804#endif 765#endif
805#endif
806 /* check levels next time peakmeter drawn */ 766 /* check levels next time peakmeter drawn */
807 level_check = true; 767 level_check = true;
808#ifdef PM_DEBUG 768#ifdef PM_DEBUG
@@ -822,11 +782,6 @@ static int peak_meter_read_l(void)
822 by peak_meter_peek since the last call of peak_meter_read_l */ 782 by peak_meter_peek since the last call of peak_meter_read_l */
823 int retval; 783 int retval;
824 784
825#if defined(SIMULATOR) && (CONFIG_CODEC != SWCODEC)
826 srand(current_tick);
827 pm_max_left = rand()%MAX_PEAK;
828#endif
829
830 retval = pm_max_left; 785 retval = pm_max_left;
831 786
832#if defined(HAVE_HISTOGRAM) || defined(HAVE_AGC) 787#if defined(HAVE_HISTOGRAM) || defined(HAVE_AGC)
@@ -855,11 +810,6 @@ static int peak_meter_read_r(void)
855 by peak_meter_peek since the last call of peak_meter_read_r */ 810 by peak_meter_peek since the last call of peak_meter_read_r */
856 int retval; 811 int retval;
857 812
858#if defined(SIMULATOR) && (CONFIG_CODEC != SWCODEC)
859 srand(current_tick);
860 pm_max_right = rand()%MAX_PEAK;
861#endif
862
863 retval = pm_max_right; 813 retval = pm_max_right;
864 814
865#if defined(HAVE_HISTOGRAM) || defined(HAVE_AGC) 815#if defined(HAVE_HISTOGRAM) || defined(HAVE_AGC)
@@ -1128,11 +1078,7 @@ static void peak_meter_draw(struct screen *display, struct meter_scales *scales,
1128 /* cliplight */ 1078 /* cliplight */
1129 if ((pm_clip_left || pm_clip_right) && 1079 if ((pm_clip_left || pm_clip_right) &&
1130 global_settings.cliplight && 1080 global_settings.cliplight &&
1131#if CONFIG_CODEC == SWCODEC
1132 !pm_playback) 1081 !pm_playback)
1133#else
1134 !(audio_status() & (AUDIO_STATUS_PLAY | AUDIO_STATUS_ERROR)))
1135#endif
1136 { 1082 {
1137 /* if clipping, cliplight setting on and in recording screen */ 1083 /* if clipping, cliplight setting on and in recording screen */
1138 if (global_settings.cliplight <= 2) 1084 if (global_settings.cliplight <= 2)
@@ -1375,16 +1321,7 @@ int peak_meter_draw_get_btn(int action_context, int x[], int y[],
1375 long next_refresh = current_tick; 1321 long next_refresh = current_tick;
1376 long next_big_refresh = current_tick + HZ / 10; 1322 long next_big_refresh = current_tick + HZ / 10;
1377 int i; 1323 int i;
1378#if (CONFIG_CODEC == SWCODEC)
1379 bool highperf = false; 1324 bool highperf = false;
1380#else
1381 /* On MAS targets, we need to poll as often as possible in order to not
1382 * miss a peak, as the MAS does only provide a quasi-peak. When the disk
1383 * is active, it must not draw too much CPU power or a buffer overrun can
1384 * happen when saving a recording. As a compromise, poll only once per tick
1385 * when the disk is active, otherwise spin around as fast as possible. */
1386 bool highperf = !storage_disk_is_active();
1387#endif
1388 bool dopeek = true; 1325 bool dopeek = true;
1389 1326
1390 while (TIME_BEFORE(current_tick, next_big_refresh)) { 1327 while (TIME_BEFORE(current_tick, next_big_refresh)) {
diff --git a/apps/recorder/recording.c b/apps/recorder/recording.c
index 553f815e52..36331a72f3 100644
--- a/apps/recorder/recording.c
+++ b/apps/recorder/recording.c
@@ -31,17 +31,14 @@
31#include "lcd.h" 31#include "lcd.h"
32#include "led.h" 32#include "led.h"
33#include "audio.h" 33#include "audio.h"
34#if CONFIG_CODEC == SWCODEC
35#include "thread.h" 34#include "thread.h"
36#include "enc_config.h" 35#include "enc_config.h"
37#include "playback.h" 36#include "playback.h"
38#if defined(HAVE_SPDIF_IN) || defined(HAVE_SPDIF_OUT) 37#if defined(HAVE_SPDIF_IN) || defined(HAVE_SPDIF_OUT)
39#include "spdif.h" 38#include "spdif.h"
40#endif 39#endif
41#endif /* CONFIG_CODEC == SWCODEC */
42#include "pcm_record.h" 40#include "pcm_record.h"
43#include "recording.h" 41#include "recording.h"
44#include "mp3_playback.h"
45#include "button.h" 42#include "button.h"
46#include "kernel.h" 43#include "kernel.h"
47#include "settings.h" 44#include "settings.h"
@@ -166,19 +163,9 @@ static bool update_list = false; /* (GIU) list needs updating */
166static int file_number = -1; 163static int file_number = -1;
167#endif /* CONFIG_RTC */ 164#endif /* CONFIG_RTC */
168 165
169#if CONFIG_CODEC == SWCODEC
170
171#define REC_FILE_ENDING(rec_format) \ 166#define REC_FILE_ENDING(rec_format) \
172 (audio_formats[rec_format_afmt[rec_format]].ext_list) 167 (audio_formats[rec_format_afmt[rec_format]].ext_list)
173 168
174#else /* CONFIG_CODEC != SWCODEC */
175
176/* default record file extension for HWCODEC */
177#define REC_FILE_ENDING(rec_format) \
178 (audio_formats[AFMT_MPA_L3].ext_list)
179
180#endif /* CONFIG_CODEC == SWCODEC */
181
182/* path for current file */ 169/* path for current file */
183static char path_buffer[MAX_PATH]; 170static char path_buffer[MAX_PATH];
184 171
@@ -607,18 +594,12 @@ void rec_init_recording_options(struct audio_recording_options *options)
607 options->rec_frequency = global_settings.rec_frequency; 594 options->rec_frequency = global_settings.rec_frequency;
608 options->rec_channels = global_settings.rec_channels; 595 options->rec_channels = global_settings.rec_channels;
609 options->rec_prerecord_time = global_settings.rec_prerecord_time; 596 options->rec_prerecord_time = global_settings.rec_prerecord_time;
610#if CONFIG_CODEC == SWCODEC
611 options->rec_mono_mode = global_settings.rec_mono_mode; 597 options->rec_mono_mode = global_settings.rec_mono_mode;
612 options->rec_source_flags = 0; 598 options->rec_source_flags = 0;
613 options->enc_config.rec_format = global_settings.rec_format; 599 options->enc_config.rec_format = global_settings.rec_format;
614 global_to_encoder_config(&options->enc_config); 600 global_to_encoder_config(&options->enc_config);
615#else
616 options->rec_quality = global_settings.rec_quality;
617 options->rec_editable = global_settings.rec_editable;
618#endif
619} 601}
620 602
621#if CONFIG_CODEC == SWCODEC
622void rec_set_source(int source, unsigned flags) 603void rec_set_source(int source, unsigned flags)
623{ 604{
624 /* Set audio input source, power up/down devices */ 605 /* Set audio input source, power up/down devices */
@@ -628,14 +609,11 @@ void rec_set_source(int source, unsigned flags)
628 peak_meter_playback((flags & SRCF_RECORDING) == 0); 609 peak_meter_playback((flags & SRCF_RECORDING) == 0);
629 peak_meter_enable(true); 610 peak_meter_enable(true);
630} 611}
631#endif /* CONFIG_CODEC == SWCODEC */
632 612
633void rec_set_recording_options(struct audio_recording_options *options) 613void rec_set_recording_options(struct audio_recording_options *options)
634{ 614{
635#if CONFIG_CODEC == SWCODEC
636 rec_set_source(options->rec_source, 615 rec_set_source(options->rec_source,
637 options->rec_source_flags | SRCF_RECORDING); 616 options->rec_source_flags | SRCF_RECORDING);
638#endif
639 audio_set_recording_options(options); 617 audio_set_recording_options(options);
640} 618}
641 619
@@ -646,9 +624,7 @@ void rec_command(enum recording_command cmd)
646 case RECORDING_CMD_STOP_SHUTDOWN: 624 case RECORDING_CMD_STOP_SHUTDOWN:
647 pm_activate_clipcount(false); 625 pm_activate_clipcount(false);
648 audio_stop_recording(); 626 audio_stop_recording();
649#if CONFIG_CODEC == SWCODEC
650 audio_close_recording(); 627 audio_close_recording();
651#endif
652 sys_poweroff(); 628 sys_poweroff();
653 break; 629 break;
654 case RECORDING_CMD_STOP: 630 case RECORDING_CMD_STOP:
@@ -695,12 +671,6 @@ static void trigger_listener(int trigger_status)
695 if(!(audio_status() & AUDIO_STATUS_RECORD)) 671 if(!(audio_status() & AUDIO_STATUS_RECORD))
696 { 672 {
697 rec_status |= RCSTAT_HAVE_RECORDED; 673 rec_status |= RCSTAT_HAVE_RECORDED;
698 rec_command(RECORDING_CMD_START);
699#if CONFIG_CODEC != SWCODEC
700 /* give control to mpeg thread so that it can start
701 recording */
702 yield(); yield(); yield();
703#endif
704 } 674 }
705 675
706 /* if we're already recording this is a retrigger */ 676 /* if we're already recording this is a retrigger */
@@ -791,14 +761,9 @@ enum rec_list_items_mono {
791#ifdef HAVE_SPDIF_REC 761#ifdef HAVE_SPDIF_REC
792enum rec_list_items_spdif { 762enum rec_list_items_spdif {
793 ITEM_VOLUME_D = 0, 763 ITEM_VOLUME_D = 0,
794#if CONFIG_CODEC == SWCODEC
795 ITEM_SAMPLERATE_D = 6, 764 ITEM_SAMPLERATE_D = 6,
796 ITEM_FILENAME_D = 7, 765 ITEM_FILENAME_D = 7,
797 ITEM_COUNT_D = 3, 766 ITEM_COUNT_D = 3,
798#else
799 ITEM_FILENAME_D = 7,
800 ITEM_COUNT_D = 2,
801#endif
802}; 767};
803#endif 768#endif
804 769
@@ -892,14 +857,12 @@ static const char* reclist_get_name(int selected_item, void * data,
892 buf3, sizeof(buf3))); 857 buf3, sizeof(buf3)));
893 break; 858 break;
894#endif 859#endif
895#if CONFIG_CODEC == SWCODEC
896#ifdef HAVE_SPDIF_REC 860#ifdef HAVE_SPDIF_REC
897 case ITEM_SAMPLERATE_D: 861 case ITEM_SAMPLERATE_D:
898 snprintf(buffer, buffer_len, "%s: %lu", 862 snprintf(buffer, buffer_len, "%s: %lu",
899 str(LANG_FREQUENCY), pcm_rec_sample_rate()); 863 str(LANG_FREQUENCY), pcm_rec_sample_rate());
900 break; 864 break;
901#endif 865#endif
902#endif
903 case ITEM_FILENAME: 866 case ITEM_FILENAME:
904 { 867 {
905 if(audio_status() & AUDIO_STATUS_RECORD) 868 if(audio_status() & AUDIO_STATUS_RECORD)
@@ -973,16 +936,12 @@ bool recording_screen(bool no_source)
973 const unsigned long split_seconds = (unsigned) global_settings.rec_timesplit * 60; 936 const unsigned long split_seconds = (unsigned) global_settings.rec_timesplit * 60;
974 const unsigned long split_bytes = rec_sizesplit_bytes(); 937 const unsigned long split_bytes = rec_sizesplit_bytes();
975 938
976#if CONFIG_CODEC == SWCODEC
977 int warning_counter = 0; 939 int warning_counter = 0;
978 #define WARNING_PERIOD 7 940 #define WARNING_PERIOD 7
979#endif
980 941
981#if CONFIG_CODEC == SWCODEC
982#ifdef HAVE_SPDIF_REC 942#ifdef HAVE_SPDIF_REC
983 unsigned long prev_sample_rate = 0; 943 unsigned long prev_sample_rate = 0;
984#endif 944#endif
985#endif
986 945
987#ifdef HAVE_FMRADIO_REC 946#ifdef HAVE_FMRADIO_REC
988 /* Radio is left on if: 947 /* Radio is left on if:
@@ -1030,7 +989,6 @@ bool recording_screen(bool no_source)
1030 ata_set_led_enabled(false); 989 ata_set_led_enabled(false);
1031#endif 990#endif
1032 991
1033#if CONFIG_CODEC == SWCODEC
1034 /* hardware samplerate gets messed up so prevent mixer playing */ 992 /* hardware samplerate gets messed up so prevent mixer playing */
1035 int keyclick = global_settings.keyclick; 993 int keyclick = global_settings.keyclick;
1036 global_settings.keyclick = 0; 994 global_settings.keyclick = 0;
@@ -1039,11 +997,6 @@ bool recording_screen(bool no_source)
1039 talk_disable(true); 997 talk_disable(true);
1040 /* audio_init_recording stops anything playing when it takes the audio 998 /* audio_init_recording stops anything playing when it takes the audio
1041 buffer */ 999 buffer */
1042#else
1043 /* Yes, we use the D/A for monitoring */
1044 peak_meter_enable(true);
1045 peak_meter_playback(true);
1046#endif
1047 1000
1048#ifdef HAVE_AGC 1001#ifdef HAVE_AGC
1049 peak_meter_get_peakhold(&peak_l, &peak_r); 1002 peak_meter_get_peakhold(&peak_l, &peak_r);
@@ -1175,7 +1128,7 @@ bool recording_screen(bool no_source)
1175 goto rec_abort; 1128 goto rec_abort;
1176 } 1129 }
1177 1130
1178#if CONFIG_CODEC == SWCODEC && CONFIG_RTC == 0 1131#if CONFIG_RTC == 0
1179 /* If format changed, a new number is required */ 1132 /* If format changed, a new number is required */
1180 rec_init_filename(); 1133 rec_init_filename();
1181#endif 1134#endif
@@ -1202,12 +1155,8 @@ bool recording_screen(bool no_source)
1202 if(global_settings.rec_source == AUDIO_SRC_SPDIF) 1155 if(global_settings.rec_source == AUDIO_SRC_SPDIF)
1203 { 1156 {
1204 listid_to_enum[0] = ITEM_VOLUME_D; 1157 listid_to_enum[0] = ITEM_VOLUME_D;
1205#if CONFIG_CODEC == SWCODEC
1206 listid_to_enum[1] = ITEM_SAMPLERATE_D; 1158 listid_to_enum[1] = ITEM_SAMPLERATE_D;
1207 listid_to_enum[2] = ITEM_FILENAME_D; 1159 listid_to_enum[2] = ITEM_FILENAME_D;
1208#else
1209 listid_to_enum[1] = ITEM_FILENAME_D;
1210#endif
1211 1160
1212 gui_synclist_set_nb_items(&lists, ITEM_COUNT_D); /* spdif */ 1161 gui_synclist_set_nb_items(&lists, ITEM_COUNT_D); /* spdif */
1213 } 1162 }
@@ -1452,10 +1401,6 @@ bool recording_screen(bool no_source)
1452 } 1401 }
1453 else 1402 else
1454 { 1403 {
1455#if CONFIG_CODEC != SWCODEC
1456 peak_meter_playback(true);
1457 peak_meter_enable(false);
1458#endif
1459 done = 1; 1404 done = 1;
1460 } 1405 }
1461 update_countdown = 0; /* Update immediately */ 1406 update_countdown = 0; /* Update immediately */
@@ -1543,11 +1488,7 @@ bool recording_screen(bool no_source)
1543 update_countdown = 0; /* Update immediately */ 1488 update_countdown = 0; /* Update immediately */
1544 break; 1489 break;
1545 case ACTION_STD_MENU: 1490 case ACTION_STD_MENU:
1546#if CONFIG_CODEC == SWCODEC
1547 if(!(audio_stat & AUDIO_STATUS_RECORD)) 1491 if(!(audio_stat & AUDIO_STATUS_RECORD))
1548#else
1549 if(audio_stat != AUDIO_STATUS_RECORD)
1550#endif
1551 { 1492 {
1552#if (CONFIG_LED == LED_REAL) 1493#if (CONFIG_LED == LED_REAL)
1553 /* led is restored at begin of loop / end of function */ 1494 /* led is restored at begin of loop / end of function */
@@ -1622,7 +1563,6 @@ bool recording_screen(bool no_source)
1622 dsize = split_bytes; 1563 dsize = split_bytes;
1623 num_recorded_bytes = audio_num_recorded_bytes(); 1564 num_recorded_bytes = audio_num_recorded_bytes();
1624 1565
1625#if CONFIG_CODEC == SWCODEC
1626 if ((audio_stat & AUDIO_STATUS_WARNING) 1566 if ((audio_stat & AUDIO_STATUS_WARNING)
1627 && (warning_counter++ % WARNING_PERIOD) < WARNING_PERIOD/2) 1567 && (warning_counter++ % WARNING_PERIOD) < WARNING_PERIOD/2)
1628 { 1568 {
@@ -1635,7 +1575,6 @@ bool recording_screen(bool no_source)
1635 (unsigned long)pcm_rec_get_warnings()); 1575 (unsigned long)pcm_rec_get_warnings());
1636 } 1576 }
1637 else 1577 else
1638#endif /* CONFIG_CODEC == SWCODEC */
1639 if ((global_settings.rec_sizesplit) && 1578 if ((global_settings.rec_sizesplit) &&
1640 (global_settings.rec_split_method)) 1579 (global_settings.rec_split_method))
1641 { 1580 {
@@ -1657,16 +1596,11 @@ bool recording_screen(bool no_source)
1657 1596
1658 if(audio_stat & AUDIO_STATUS_PRERECORD) 1597 if(audio_stat & AUDIO_STATUS_PRERECORD)
1659 { 1598 {
1660#if CONFIG_CODEC == SWCODEC
1661 /* Tracks amount of prerecorded data in buffer */ 1599 /* Tracks amount of prerecorded data in buffer */
1662 snprintf(buf, sizeof(buf), "%s (%lu/%ds)...", 1600 snprintf(buf, sizeof(buf), "%s (%lu/%ds)...",
1663 str(LANG_RECORD_PRERECORD), 1601 str(LANG_RECORD_PRERECORD),
1664 audio_prerecorded_time() / HZ, 1602 audio_prerecorded_time() / HZ,
1665 global_settings.rec_prerecord_time); 1603 global_settings.rec_prerecord_time);
1666#else /* !SWCODEC */
1667 snprintf(buf, sizeof(buf), "%s...",
1668 str(LANG_RECORD_PRERECORD));
1669#endif /* CONFIG_CODEC == SWCODEC */
1670 } 1604 }
1671 else 1605 else
1672 { 1606 {
@@ -1782,7 +1716,6 @@ bool recording_screen(bool no_source)
1782 } 1716 }
1783#endif /* HAVE_AGC */ 1717#endif /* HAVE_AGC */
1784 1718
1785#if CONFIG_CODEC == SWCODEC
1786#ifdef HAVE_SPDIF_REC 1719#ifdef HAVE_SPDIF_REC
1787 if((global_settings.rec_source == AUDIO_SRC_SPDIF) && 1720 if((global_settings.rec_source == AUDIO_SRC_SPDIF) &&
1788 (prev_sample_rate != pcm_rec_sample_rate())) 1721 (prev_sample_rate != pcm_rec_sample_rate()))
@@ -1792,7 +1725,6 @@ bool recording_screen(bool no_source)
1792 update_list = true; 1725 update_list = true;
1793 } 1726 }
1794#endif 1727#endif
1795#endif
1796 1728
1797 if(update_list) 1729 if(update_list)
1798 { 1730 {
@@ -1824,11 +1756,9 @@ bool recording_screen(bool no_source)
1824 FOR_NB_SCREENS(i) 1756 FOR_NB_SCREENS(i)
1825 screens[i].update(); 1757 screens[i].update();
1826 1758
1827#if CONFIG_CODEC == SWCODEC
1828 /* stop recording first and try to finish saving whatever it can */ 1759 /* stop recording first and try to finish saving whatever it can */
1829 rec_command(RECORDING_CMD_STOP); 1760 rec_command(RECORDING_CMD_STOP);
1830 audio_close_recording(); 1761 audio_close_recording();
1831#endif
1832 1762
1833 audio_error_clear(); 1763 audio_error_clear();
1834 1764
@@ -1841,7 +1771,6 @@ bool recording_screen(bool no_source)
1841 1771
1842rec_abort: 1772rec_abort:
1843 1773
1844#if CONFIG_CODEC == SWCODEC
1845 rec_command(RECORDING_CMD_STOP); 1774 rec_command(RECORDING_CMD_STOP);
1846 audio_close_recording(); 1775 audio_close_recording();
1847 1776
@@ -1861,9 +1790,6 @@ rec_abort:
1861 1790
1862 /* restore keyclick */ 1791 /* restore keyclick */
1863 global_settings.keyclick = keyclick; 1792 global_settings.keyclick = keyclick;
1864#else /* !SWCODEC */
1865 audio_init_playback();
1866#endif /* CONFIG_CODEC == SWCODEC */
1867 1793
1868#ifdef HAVE_SPEAKER 1794#ifdef HAVE_SPEAKER
1869 /* Re-enable speaker */ 1795 /* Re-enable speaker */
@@ -1895,12 +1821,10 @@ rec_abort:
1895 return (rec_status & RCSTAT_BEEN_IN_USB_MODE) != 0; 1821 return (rec_status & RCSTAT_BEEN_IN_USB_MODE) != 0;
1896} /* recording_screen */ 1822} /* recording_screen */
1897 1823
1898#if CONFIG_CODEC == SWCODEC
1899void audio_beep(int duration) 1824void audio_beep(int duration)
1900{ 1825{
1901 /* dummy */ 1826 /* dummy */
1902 (void)duration; 1827 (void)duration;
1903} 1828}
1904#endif /* #ifdef CONFIG_CODEC == SWCODEC */
1905 1829
1906#endif /* HAVE_RECORDING */ 1830#endif /* HAVE_RECORDING */
diff --git a/apps/recorder/recording.h b/apps/recorder/recording.h
index 406986e8e0..12088f84f6 100644
--- a/apps/recorder/recording.h
+++ b/apps/recorder/recording.h
@@ -33,17 +33,14 @@ void settings_apply_trigger(void);
33/* If true, start recording automatically when recording_sreen() is entered */ 33/* If true, start recording automatically when recording_sreen() is entered */
34extern bool recording_start_automatic; 34extern bool recording_start_automatic;
35 35
36#if CONFIG_CODEC == SWCODEC
37/* handles device powerup, sets audio source and peakmeter mode */ 36/* handles device powerup, sets audio source and peakmeter mode */
38void rec_set_source(int source, unsigned flags); 37void rec_set_source(int source, unsigned flags);
39#endif /* CONFIG_CODEC == SW_CODEC */
40 38
41/* Initializes a recording_options structure with global settings. 39/* Initializes a recording_options structure with global settings.
42 pass returned data to audio_set_recording_options or 40 pass returned data to audio_set_recording_options or
43 rec_set_recording_options */ 41 rec_set_recording_options */
44void rec_init_recording_options(struct audio_recording_options *options); 42void rec_init_recording_options(struct audio_recording_options *options);
45/* steals mp3 buffer, sets source and then options */ 43/* steals mp3 buffer, sets source and then options */
46/* SRCF_RECORDING is implied for SWCODEC */
47void rec_set_recording_options(struct audio_recording_options *options); 44void rec_set_recording_options(struct audio_recording_options *options);
48 45
49enum recording_command 46enum recording_command
diff --git a/apps/screens.c b/apps/screens.c
index ecd406037d..47f110efd9 100644
--- a/apps/screens.c
+++ b/apps/screens.c
@@ -30,7 +30,6 @@
30#include "icons.h" 30#include "icons.h"
31#include "font.h" 31#include "font.h"
32#include "audio.h" 32#include "audio.h"
33#include "mp3_playback.h"
34#include "usb.h" 33#include "usb.h"
35#include "settings.h" 34#include "settings.h"
36#include "status.h" 35#include "status.h"
@@ -380,10 +379,8 @@ static const int id3_headers[]=
380 LANG_ID3_PLAYLIST, 379 LANG_ID3_PLAYLIST,
381 LANG_ID3_BITRATE, 380 LANG_ID3_BITRATE,
382 LANG_ID3_FREQUENCY, 381 LANG_ID3_FREQUENCY,
383#if CONFIG_CODEC == SWCODEC
384 LANG_ID3_TRACK_GAIN, 382 LANG_ID3_TRACK_GAIN,
385 LANG_ID3_ALBUM_GAIN, 383 LANG_ID3_ALBUM_GAIN,
386#endif
387 LANG_FILESIZE, 384 LANG_FILESIZE,
388 LANG_ID3_PATH, 385 LANG_ID3_PATH,
389}; 386};
@@ -423,7 +420,6 @@ static void say_number_and_spell(char *buf, bool year_style)
423 } 420 }
424} 421}
425 422
426#if CONFIG_CODEC == SWCODEC
427/* Say a replaygain ID3 value from its text form */ 423/* Say a replaygain ID3 value from its text form */
428static void say_gain(char *buf) 424static void say_gain(char *buf)
429{ 425{
@@ -479,7 +475,6 @@ static void say_gain(char *buf)
479 }else /* we didn't find a number, just spell everything */ 475 }else /* we didn't find a number, just spell everything */
480 talk_spell(buf, true); 476 talk_spell(buf, true);
481} 477}
482#endif
483 478
484static const char * id3_get_or_speak_info(int selected_item, void* data, 479static const char * id3_get_or_speak_info(int selected_item, void* data,
485 char *buffer, size_t buffer_len, 480 char *buffer, size_t buffer_len,
@@ -619,7 +614,6 @@ static const char * id3_get_or_speak_info(int selected_item, void* data,
619 if(say_it) 614 if(say_it)
620 talk_value(id3->frequency, UNIT_HERTZ, true); 615 talk_value(id3->frequency, UNIT_HERTZ, true);
621 break; 616 break;
622#if CONFIG_CODEC == SWCODEC
623 case LANG_ID3_TRACK_GAIN: 617 case LANG_ID3_TRACK_GAIN:
624 replaygain_itoa(buffer, buffer_len, id3->track_level); 618 replaygain_itoa(buffer, buffer_len, id3->track_level);
625 val=(id3->track_level) ? buffer : NULL; /* only show level!=0 */ 619 val=(id3->track_level) ? buffer : NULL; /* only show level!=0 */
@@ -632,12 +626,11 @@ static const char * id3_get_or_speak_info(int selected_item, void* data,
632 if(say_it && val) 626 if(say_it && val)
633 say_gain(val); 627 say_gain(val);
634 break; 628 break;
635#endif
636 case LANG_ID3_PATH: 629 case LANG_ID3_PATH:
637 val=id3->path; 630 val=id3->path;
638 if(say_it && val) 631 if(say_it && val)
639 talk_fullpath(val, true); 632 talk_fullpath(val, true);
640 break; 633 break;
641 case LANG_ID3_COMPOSER: 634 case LANG_ID3_COMPOSER:
642 val=id3->composer; 635 val=id3->composer;
643 if(say_it && val) 636 if(say_it && val)
diff --git a/apps/scrobbler.c b/apps/scrobbler.c
index 2793e70725..3622137a20 100644
--- a/apps/scrobbler.c
+++ b/apps/scrobbler.c
@@ -226,9 +226,7 @@ static void scrobbler_finish_event(unsigned short id, void *data)
226 226
227 /* add entry using the currently ending track */ 227 /* add entry using the currently ending track */
228 if (pending && (te->flags & TEF_CURRENT) 228 if (pending && (te->flags & TEF_CURRENT)
229#if CONFIG_CODEC == SWCODEC
230 && !(te->flags & TEF_REWIND) 229 && !(te->flags & TEF_REWIND)
231#endif
232 ) 230 )
233 { 231 {
234 pending = false; 232 pending = false;
diff --git a/apps/settings.c b/apps/settings.c
index 185e2c3576..17e200812e 100644
--- a/apps/settings.c
+++ b/apps/settings.c
@@ -77,14 +77,12 @@
77struct user_settings global_settings; 77struct user_settings global_settings;
78struct system_status global_status; 78struct system_status global_status;
79 79
80#if CONFIG_CODEC == SWCODEC
81#include "dsp_proc_settings.h" 80#include "dsp_proc_settings.h"
82#include "playback.h" 81#include "playback.h"
83#ifdef HAVE_RECORDING 82#ifdef HAVE_RECORDING
84#include "enc_config.h" 83#include "enc_config.h"
85#endif 84#endif
86#include "pcm_sampr.h" 85#include "pcm_sampr.h"
87#endif /* CONFIG_CODEC == SWCODEC */
88 86
89#define NVRAM_DATA_START 8 87#define NVRAM_DATA_START 8
90#ifdef HAVE_RTC_RAM 88#ifdef HAVE_RTC_RAM
@@ -589,12 +587,10 @@ static bool settings_write_config(const char* filename, int options)
589 continue; 587 continue;
590 break; 588 break;
591#endif 589#endif
592#if CONFIG_CODEC == SWCODEC
593 case SETTINGS_SAVE_EQPRESET: 590 case SETTINGS_SAVE_EQPRESET:
594 if ((settings[i].flags&F_EQSETTING) == 0) 591 if ((settings[i].flags&F_EQSETTING) == 0)
595 continue; 592 continue;
596 break; 593 break;
597#endif
598 } 594 }
599 595
600 cfg_to_string(i, value, MAX_PATH); 596 cfg_to_string(i, value, MAX_PATH);
@@ -675,12 +671,10 @@ bool settings_save_config(int options)
675 namebase = "recording"; 671 namebase = "recording";
676 break; 672 break;
677#endif 673#endif
678#if CONFIG_CODEC == SWCODEC
679 case SETTINGS_SAVE_EQPRESET: 674 case SETTINGS_SAVE_EQPRESET:
680 folder = EQS_DIR; 675 folder = EQS_DIR;
681 namebase = "eq"; 676 namebase = "eq";
682 break; 677 break;
683#endif
684 case SETTINGS_SAVE_SOUND: 678 case SETTINGS_SAVE_SOUND:
685 folder = ROCKBOX_DIR; 679 folder = ROCKBOX_DIR;
686 namebase = "sound"; 680 namebase = "sound";
@@ -982,7 +976,6 @@ void settings_apply(bool read_disk)
982 lcd_scroll_delay(global_settings.scroll_delay); 976 lcd_scroll_delay(global_settings.scroll_delay);
983 977
984 978
985#if CONFIG_CODEC == SWCODEC
986#ifdef HAVE_PLAY_FREQ 979#ifdef HAVE_PLAY_FREQ
987 /* before crossfade */ 980 /* before crossfade */
988 audio_set_playback_frequency(global_settings.play_frequency); 981 audio_set_playback_frequency(global_settings.play_frequency);
@@ -1016,7 +1009,6 @@ void settings_apply(bool read_disk)
1016 dsp_timestretch_enable(global_settings.timestretch_enabled); 1009 dsp_timestretch_enable(global_settings.timestretch_enabled);
1017#endif 1010#endif
1018 dsp_set_compressor(&global_settings.compressor_settings); 1011 dsp_set_compressor(&global_settings.compressor_settings);
1019#endif
1020 1012
1021#ifdef HAVE_SPDIF_POWER 1013#ifdef HAVE_SPDIF_POWER
1022 spdif_power_enable(global_settings.spdif_enable); 1014 spdif_power_enable(global_settings.spdif_enable);
@@ -1068,7 +1060,7 @@ void settings_apply(bool read_disk)
1068#endif 1060#endif
1069 1061
1070 /* This should stay last */ 1062 /* This should stay last */
1071#if defined(HAVE_RECORDING) && CONFIG_CODEC == SWCODEC 1063#if defined(HAVE_RECORDING)
1072 enc_global_settings_apply(); 1064 enc_global_settings_apply();
1073#endif 1065#endif
1074#ifdef HAVE_LCD_BITMAP 1066#ifdef HAVE_LCD_BITMAP
@@ -1114,7 +1106,7 @@ void settings_reset(void)
1114{ 1106{
1115 for(int i=0; i<nb_settings; i++) 1107 for(int i=0; i<nb_settings; i++)
1116 reset_setting(&settings[i], settings[i].setting); 1108 reset_setting(&settings[i], settings[i].setting);
1117#if defined (HAVE_RECORDING) && CONFIG_CODEC == SWCODEC 1109#if defined (HAVE_RECORDING)
1118 enc_global_settings_reset(); 1110 enc_global_settings_reset();
1119#endif 1111#endif
1120#ifdef HAVE_LCD_BITMAP 1112#ifdef HAVE_LCD_BITMAP
diff --git a/apps/settings.h b/apps/settings.h
index 4661966ad2..3d3939695c 100644
--- a/apps/settings.h
+++ b/apps/settings.h
@@ -30,10 +30,8 @@
30#include "statusbar.h" /* for the statusbar values */ 30#include "statusbar.h" /* for the statusbar values */
31#include "quickscreen.h" 31#include "quickscreen.h"
32#include "button.h" 32#include "button.h"
33#if CONFIG_CODEC == SWCODEC
34#include "audio.h" 33#include "audio.h"
35#include "dsp_proc_settings.h" 34#include "dsp_proc_settings.h"
36#endif
37#include "rbpaths.h" 35#include "rbpaths.h"
38 36
39struct opt_items { 37struct opt_items {
@@ -218,9 +216,7 @@ enum {
218#ifdef HAVE_RECORDING 216#ifdef HAVE_RECORDING
219 SETTINGS_SAVE_RECPRESETS, 217 SETTINGS_SAVE_RECPRESETS,
220#endif 218#endif
221#if CONFIG_CODEC == SWCODEC
222 SETTINGS_SAVE_EQPRESET, 219 SETTINGS_SAVE_EQPRESET,
223#endif
224}; 220};
225bool settings_save_config(int options); 221bool settings_save_config(int options);
226 222
@@ -307,17 +303,6 @@ struct user_settings
307 int channel_config; /* Stereo, Mono, Custom, Mono left, Mono right, Karaoke */ 303 int channel_config; /* Stereo, Mono, Custom, Mono left, Mono right, Karaoke */
308 int stereo_width; /* 0-255% */ 304 int stereo_width; /* 0-255% */
309 305
310#if CONFIG_CODEC != SWCODEC
311 int loudness; /* loudness eq: 0-100 0=off 100=max */
312 int avc; /* auto volume correct: 0=off, 1=20ms, 2=2s 3=4s 4=8s */
313 int mdb_strength; /* 0-127dB */
314 int mdb_harmonics; /* 0-100% */
315 int mdb_center; /* 20-300Hz */
316 int mdb_shape; /* 50-300Hz */
317 bool mdb_enable; /* true/false */
318 bool superbass; /* true/false */
319#endif
320
321#ifdef AUDIOHW_HAVE_BASS_CUTOFF 306#ifdef AUDIOHW_HAVE_BASS_CUTOFF
322 int bass_cutoff; 307 int bass_cutoff;
323#endif 308#endif
@@ -325,7 +310,6 @@ struct user_settings
325 int treble_cutoff; 310 int treble_cutoff;
326#endif 311#endif
327 312
328#if CONFIG_CODEC == SWCODEC
329#ifdef HAVE_CROSSFADE 313#ifdef HAVE_CROSSFADE
330 /* Crossfade */ 314 /* Crossfade */
331 int crossfade; /* Enable crossfade (0=off, 1=shuffle, 2=trackskip, 315 int crossfade; /* Enable crossfade (0=off, 1=shuffle, 2=trackskip,
@@ -360,10 +344,8 @@ struct user_settings
360#ifdef HAVE_PITCHCONTROL 344#ifdef HAVE_PITCHCONTROL
361 bool timestretch_enabled; 345 bool timestretch_enabled;
362#endif 346#endif
363#endif /* CONFIG_CODEC == SWCODEC */
364 347
365#ifdef HAVE_RECORDING 348#ifdef HAVE_RECORDING
366#if CONFIG_CODEC == SWCODEC
367 int rec_format; /* record format index */ 349 int rec_format; /* record format index */
368 int rec_mono_mode; /* how to create mono: L, R, L+R */ 350 int rec_mono_mode; /* how to create mono: L, R, L+R */
369 351
@@ -377,9 +359,6 @@ struct user_settings
377#endif 359#endif
378 /* Encoder Settings End */ 360 /* Encoder Settings End */
379 361
380#else
381 int rec_quality; /* 0-7 */
382#endif /* CONFIG_CODEC == SWCODEC */
383 int rec_source; /* 0=mic, 1=line, 2=S/PDIF, 2 or 3=FM Radio */ 362 int rec_source; /* 0=mic, 1=line, 2=S/PDIF, 2 or 3=FM Radio */
384 int rec_frequency; /* 0 = 44.1kHz (depends on target) 363 int rec_frequency; /* 0 = 44.1kHz (depends on target)
385 1 = 48kHz 364 1 = 48kHz
@@ -754,10 +733,8 @@ struct user_settings
754#ifdef HAVE_PITCHCONTROL 733#ifdef HAVE_PITCHCONTROL
755 /* pitch screen settings */ 734 /* pitch screen settings */
756 bool pitch_mode_semitone; 735 bool pitch_mode_semitone;
757#if CONFIG_CODEC == SWCODEC
758 bool pitch_mode_timestretch; 736 bool pitch_mode_timestretch;
759#endif 737#endif
760#endif
761 /* If values are just added to the end, no need to bump plugin API 738 /* If values are just added to the end, no need to bump plugin API
762 version. */ 739 version. */
763 /* new stuff to be added at the end */ 740 /* new stuff to be added at the end */
@@ -778,9 +755,7 @@ struct user_settings
778#endif 755#endif
779#endif 756#endif
780 757
781#if CONFIG_CODEC == SWCODEC
782 struct compressor_settings compressor_settings; 758 struct compressor_settings compressor_settings;
783#endif
784 759
785 int sleeptimer_duration; /* In minutes; 0=off */ 760 int sleeptimer_duration; /* In minutes; 0=off */
786 bool sleeptimer_on_startup; 761 bool sleeptimer_on_startup;
@@ -797,10 +772,8 @@ struct user_settings
797 int hotkey_tree; 772 int hotkey_tree;
798#endif 773#endif
799 774
800#if CONFIG_CODEC == SWCODEC
801 /* When resuming playback (after a stop), rewind this number of seconds */ 775 /* When resuming playback (after a stop), rewind this number of seconds */
802 int resume_rewind; 776 int resume_rewind;
803#endif
804 777
805#ifdef AUDIOHW_HAVE_DEPTH_3D 778#ifdef AUDIOHW_HAVE_DEPTH_3D
806 int depth_3d; 779 int depth_3d;
@@ -830,10 +803,8 @@ struct user_settings
830#endif /* AUDIOHW_HAVE_EQ */ 803#endif /* AUDIOHW_HAVE_EQ */
831 804
832#ifdef HAVE_HARDWARE_CLICK 805#ifdef HAVE_HARDWARE_CLICK
833#if CONFIG_CODEC == SWCODEC
834 bool keyclick_hardware; /* hardware piezo keyclick */ 806 bool keyclick_hardware; /* hardware piezo keyclick */
835#endif 807#endif
836#endif
837 808
838 char start_directory[MAX_PATHNAME+1]; 809 char start_directory[MAX_PATHNAME+1];
839 /* Has the root been customized from the .cfg file? false = no, true = loaded from cfg */ 810 /* Has the root been customized from the .cfg file? false = no, true = loaded from cfg */
diff --git a/apps/settings_list.c b/apps/settings_list.c
index 348caec6e5..7f6f4fefc7 100644
--- a/apps/settings_list.c
+++ b/apps/settings_list.c
@@ -310,7 +310,6 @@ static const char graphic_numeric[] = "graphic,numeric";
310 310
311#ifdef HAVE_RECORDING 311#ifdef HAVE_RECORDING
312/* these should be in the config.h files */ 312/* these should be in the config.h files */
313#if CONFIG_CODEC == SWCODEC
314# ifdef HAVE_UDA1380 313# ifdef HAVE_UDA1380
315# define DEFAULT_REC_MIC_GAIN 16 314# define DEFAULT_REC_MIC_GAIN 16
316# define DEFAULT_REC_LEFT_GAIN 0 315# define DEFAULT_REC_LEFT_GAIN 0
@@ -332,7 +331,6 @@ static const char graphic_numeric[] = "graphic,numeric";
332# define DEFAULT_REC_LEFT_GAIN 0 331# define DEFAULT_REC_LEFT_GAIN 0
333# define DEFAULT_REC_RIGHT_GAIN 0 332# define DEFAULT_REC_RIGHT_GAIN 0
334# endif 333# endif
335#endif
336 334
337#endif /* HAVE_RECORDING */ 335#endif /* HAVE_RECORDING */
338 336
@@ -472,8 +470,6 @@ static const char* scanaccel_formatter(char *buffer, size_t buffer_size,
472} 470}
473#endif 471#endif
474 472
475#if CONFIG_CODEC == SWCODEC
476
477static const char* formatter_unit_0_is_off(char *buffer, size_t buffer_size, 473static const char* formatter_unit_0_is_off(char *buffer, size_t buffer_size,
478 int val, const char *unit) 474 int val, const char *unit)
479{ 475{
@@ -591,7 +587,6 @@ static void eq_set_default(void* setting, void* defaultval)
591{ 587{
592 memcpy(setting, defaultval, sizeof(struct eq_band_setting)); 588 memcpy(setting, defaultval, sizeof(struct eq_band_setting));
593} 589}
594#endif
595 590
596#ifdef HAVE_QUICKSCREEN 591#ifdef HAVE_QUICKSCREEN
597static int find_setting_by_name(char*name) 592static int find_setting_by_name(char*name)
@@ -1213,15 +1208,11 @@ const struct settings_list settings[] = {
1213 "seek acceleration", "very fast,fast,normal,slow,very slow", NULL, 5, 1208 "seek acceleration", "very fast,fast,normal,slow,very slow", NULL, 5,
1214 ID2P(LANG_VERY_FAST), ID2P(LANG_FAST), ID2P(LANG_NORMAL), 1209 ID2P(LANG_VERY_FAST), ID2P(LANG_FAST), ID2P(LANG_NORMAL),
1215 ID2P(LANG_SLOW) , ID2P(LANG_VERY_SLOW)), 1210 ID2P(LANG_SLOW) , ID2P(LANG_VERY_SLOW)),
1216#if (CONFIG_CODEC == SWCODEC) && defined(HAVE_DISK_STORAGE) 1211#if defined(HAVE_DISK_STORAGE)
1217 TABLE_SETTING(F_TIME_SETTING | F_ALLOW_ARBITRARY_VALS, buffer_margin, 1212 TABLE_SETTING(F_TIME_SETTING | F_ALLOW_ARBITRARY_VALS, buffer_margin,
1218 LANG_MP3BUFFER_MARGIN, 5, "antiskip", NULL, UNIT_SEC, 1213 LANG_MP3BUFFER_MARGIN, 5, "antiskip", NULL, UNIT_SEC,
1219 NULL, NULL, 1214 NULL, NULL,
1220 NULL,8, 5,15,30,60,120,180,300,600), 1215 NULL,8, 5,15,30,60,120,180,300,600),
1221#elif defined(HAVE_DISK_STORAGE)
1222 INT_SETTING(F_TIME_SETTING, buffer_margin, LANG_MP3BUFFER_MARGIN, 0,
1223 "antiskip", UNIT_SEC, 0, 7, 1, formatter_time_unit_0_is_off,
1224 getlang_time_unit_0_is_off, audio_set_buffer_margin),
1225#endif 1216#endif
1226 /* disk */ 1217 /* disk */
1227#ifdef HAVE_DISK_STORAGE 1218#ifdef HAVE_DISK_STORAGE
@@ -1348,10 +1339,8 @@ const struct settings_list settings[] = {
1348 TALK_ID(1792, UNIT_MB)), 1339 TALK_ID(1792, UNIT_MB)),
1349 {F_T_INT|F_RECSETTING, &global_settings.rec_channels, LANG_CHANNELS, INT(0), 1340 {F_T_INT|F_RECSETTING, &global_settings.rec_channels, LANG_CHANNELS, INT(0),
1350 "rec channels","stereo,mono",UNUSED}, 1341 "rec channels","stereo,mono",UNUSED},
1351#if CONFIG_CODEC == SWCODEC
1352 {F_T_INT|F_RECSETTING, &global_settings.rec_mono_mode, 1342 {F_T_INT|F_RECSETTING, &global_settings.rec_mono_mode,
1353 LANG_RECORDING_MONO_MODE, INT(0), "rec mono mode","L+R,L,R",UNUSED}, 1343 LANG_RECORDING_MONO_MODE, INT(0), "rec mono mode","L+R,L,R",UNUSED},
1354#endif
1355 CHOICE_SETTING(F_RECSETTING, rec_split_type, LANG_SPLIT_TYPE, 0, 1344 CHOICE_SETTING(F_RECSETTING, rec_split_type, LANG_SPLIT_TYPE, 0,
1356 "rec split type", "Split,Stop,Shutdown", NULL, 3, 1345 "rec split type", "Split,Stop,Shutdown", NULL, 3,
1357 ID2P(LANG_START_NEW_FILE), ID2P(LANG_STOP_RECORDING),ID2P(LANG_STOP_RECORDING_AND_SHUTDOWN)), 1346 ID2P(LANG_START_NEW_FILE), ID2P(LANG_STOP_RECORDING),ID2P(LANG_STOP_RECORDING_AND_SHUTDOWN)),
@@ -1398,7 +1387,6 @@ const struct settings_list settings[] = {
1398 INT(DEFAULT_REC_RIGHT_GAIN), 1387 INT(DEFAULT_REC_RIGHT_GAIN),
1399 "rec right gain",NULL,UNUSED}, 1388 "rec right gain",NULL,UNUSED},
1400#endif /* DEFAULT_REC_RIGHT_GAIN */ 1389#endif /* DEFAULT_REC_RIGHT_GAIN */
1401#if CONFIG_CODEC == SWCODEC
1402 {F_T_INT|F_RECSETTING,&global_settings.rec_frequency, 1390 {F_T_INT|F_RECSETTING,&global_settings.rec_frequency,
1403 LANG_FREQUENCY,INT(REC_FREQ_DEFAULT), 1391 LANG_FREQUENCY,INT(REC_FREQ_DEFAULT),
1404 "rec frequency",REC_FREQ_CFG_VAL_LIST,UNUSED}, 1392 "rec frequency",REC_FREQ_CFG_VAL_LIST,UNUSED},
@@ -1417,7 +1405,6 @@ const struct settings_list settings[] = {
1417 /* wavpack_enc */ 1405 /* wavpack_enc */
1418 /* (no settings yet) */ 1406 /* (no settings yet) */
1419 /** Encoder settings end **/ 1407 /** Encoder settings end **/
1420#endif /* CONFIG_CODEC == SWCODEC */
1421 /* values for the trigger */ 1408 /* values for the trigger */
1422 INT_SETTING(F_RECSETTING, rec_start_thres_db, LANG_RECORD_START_THRESHOLD, -35, 1409 INT_SETTING(F_RECSETTING, rec_start_thres_db, LANG_RECORD_START_THRESHOLD, -35,
1423 "trigger start threshold dB", UNIT_DB, -89, 0, 1, NULL, NULL, NULL), 1410 "trigger start threshold dB", UNIT_DB, -89, 0, 1, NULL, NULL, NULL),
@@ -1465,7 +1452,6 @@ const struct settings_list settings[] = {
1465 LANG_SET_BOOL_YES, LANG_SET_BOOL_NO, NULL), 1452 LANG_SET_BOOL_YES, LANG_SET_BOOL_NO, NULL),
1466 1453
1467#ifdef HAVE_TAGCACHE 1454#ifdef HAVE_TAGCACHE
1468#if CONFIG_CODEC == SWCODEC
1469 BOOL_SETTING(0, autoresume_enable, LANG_AUTORESUME, false, 1455 BOOL_SETTING(0, autoresume_enable, LANG_AUTORESUME, false,
1470 "autoresume enable", off_on, 1456 "autoresume enable", off_on,
1471 LANG_SET_BOOL_YES, LANG_SET_BOOL_NO, NULL), 1457 LANG_SET_BOOL_YES, LANG_SET_BOOL_NO, NULL),
@@ -1478,7 +1464,6 @@ const struct settings_list settings[] = {
1478 ID2P(LANG_AUTORESUME_CUSTOM)), 1464 ID2P(LANG_AUTORESUME_CUSTOM)),
1479 TEXT_SETTING(0, autoresume_paths, "autoresume next track paths", 1465 TEXT_SETTING(0, autoresume_paths, "autoresume next track paths",
1480 "/podcast:/podcasts", NULL, NULL), 1466 "/podcast:/podcasts", NULL, NULL),
1481#endif
1482 1467
1483 OFFON_SETTING(0, runtimedb, LANG_RUNTIMEDB_ACTIVE, false, 1468 OFFON_SETTING(0, runtimedb, LANG_RUNTIMEDB_ACTIVE, false,
1484 "gather runtime data", NULL), 1469 "gather runtime data", NULL),
@@ -1486,7 +1471,6 @@ const struct settings_list settings[] = {
1486 DEFAULT_TAGCACHE_SCAN_PATHS, NULL, NULL), 1471 DEFAULT_TAGCACHE_SCAN_PATHS, NULL, NULL),
1487#endif 1472#endif
1488 1473
1489#if CONFIG_CODEC == SWCODEC
1490 /* replay gain */ 1474 /* replay gain */
1491 CHOICE_SETTING(F_SOUNDSETTING, replaygain_settings.type, 1475 CHOICE_SETTING(F_SOUNDSETTING, replaygain_settings.type,
1492 LANG_REPLAYGAIN_MODE, REPLAYGAIN_SHUFFLE, "replaygain type", 1476 LANG_REPLAYGAIN_MODE, REPLAYGAIN_SHUFFLE, "replaygain type",
@@ -1747,7 +1731,6 @@ const struct settings_list settings[] = {
1747 LANG_COMPRESSOR_RELEASE, 500, 1731 LANG_COMPRESSOR_RELEASE, 500,
1748 "compressor release time", UNIT_MS, 100, 1000, 1732 "compressor release time", UNIT_MS, 100, 1000,
1749 100, NULL, NULL, compressor_set), 1733 100, NULL, NULL, compressor_set),
1750#endif /* CONFIG_CODEC == SWCODEC */
1751 1734
1752#ifdef AUDIOHW_HAVE_BASS_CUTOFF 1735#ifdef AUDIOHW_HAVE_BASS_CUTOFF
1753 SOUND_SETTING(F_NO_WRAP, bass_cutoff, LANG_BASS_CUTOFF, 1736 SOUND_SETTING(F_NO_WRAP, bass_cutoff, LANG_BASS_CUTOFF,
@@ -2023,7 +2006,6 @@ const struct settings_list settings[] = {
2023 3, "list_accel_wait", UNIT_SEC, 1, 10, 1, 2006 3, "list_accel_wait", UNIT_SEC, 1, 10, 1,
2024 scanaccel_formatter, NULL, NULL), 2007 scanaccel_formatter, NULL, NULL),
2025#endif /* HAVE_WHEEL_ACCELERATION */ 2008#endif /* HAVE_WHEEL_ACCELERATION */
2026#if CONFIG_CODEC == SWCODEC
2027 /* keyclick */ 2009 /* keyclick */
2028#ifdef HAVE_HARDWARE_CLICK 2010#ifdef HAVE_HARDWARE_CLICK
2029 CHOICE_SETTING(0, keyclick, LANG_KEYCLICK_SOFTWARE, 0, 2011 CHOICE_SETTING(0, keyclick, LANG_KEYCLICK_SOFTWARE, 0,
@@ -2042,7 +2024,6 @@ const struct settings_list settings[] = {
2042 OFFON_SETTING(0, keyclick_repeats, LANG_KEYCLICK_REPEATS, false, 2024 OFFON_SETTING(0, keyclick_repeats, LANG_KEYCLICK_REPEATS, false,
2043 "keyclick repeats", NULL), 2025 "keyclick repeats", NULL),
2044#endif 2026#endif
2045#endif /* CONFIG_CODEC == SWCODEC */
2046 TEXT_SETTING(0, playlist_catalog_dir, "playlist catalog directory", 2027 TEXT_SETTING(0, playlist_catalog_dir, "playlist catalog directory",
2047 PLAYLIST_CATALOG_DEFAULT_DIR, NULL, NULL), 2028 PLAYLIST_CATALOG_DEFAULT_DIR, NULL, NULL),
2048 INT_SETTING(F_TIME_SETTING, sleeptimer_duration, LANG_SLEEP_TIMER_DURATION, 2029 INT_SETTING(F_TIME_SETTING, sleeptimer_duration, LANG_SLEEP_TIMER_DURATION,
@@ -2117,11 +2098,9 @@ const struct settings_list settings[] = {
2117#ifdef HAVE_PITCHCONTROL 2098#ifdef HAVE_PITCHCONTROL
2118 OFFON_SETTING(0, pitch_mode_semitone, LANG_SEMITONE, false, 2099 OFFON_SETTING(0, pitch_mode_semitone, LANG_SEMITONE, false,
2119 "Semitone pitch change", NULL), 2100 "Semitone pitch change", NULL),
2120#if CONFIG_CODEC == SWCODEC
2121 OFFON_SETTING(0, pitch_mode_timestretch, LANG_TIMESTRETCH, false, 2101 OFFON_SETTING(0, pitch_mode_timestretch, LANG_TIMESTRETCH, false,
2122 "Timestretch mode", NULL), 2102 "Timestretch mode", NULL),
2123#endif 2103#endif
2124#endif
2125 2104
2126#ifdef USB_ENABLE_HID 2105#ifdef USB_ENABLE_HID
2127 OFFON_SETTING(0, usb_hid, LANG_USB_HID, true, "usb hid", usb_set_hid), 2106 OFFON_SETTING(0, usb_hid, LANG_USB_HID, true, "usb hid", usb_set_hid),
@@ -2187,11 +2166,9 @@ const struct settings_list settings[] = {
2187 HOTKEY_OPEN_WITH, HOTKEY_DELETE, HOTKEY_INSERT, HOTKEY_INSERT_SHUFFLED), 2166 HOTKEY_OPEN_WITH, HOTKEY_DELETE, HOTKEY_INSERT, HOTKEY_INSERT_SHUFFLED),
2188#endif 2167#endif
2189 2168
2190#if CONFIG_CODEC == SWCODEC
2191 INT_SETTING(F_TIME_SETTING, resume_rewind, LANG_RESUME_REWIND, 0, 2169 INT_SETTING(F_TIME_SETTING, resume_rewind, LANG_RESUME_REWIND, 0,
2192 "resume rewind", UNIT_SEC, 0, 60, 5, 2170 "resume rewind", UNIT_SEC, 0, 60, 5,
2193 formatter_time_unit_0_is_off, getlang_time_unit_0_is_off, NULL), 2171 formatter_time_unit_0_is_off, getlang_time_unit_0_is_off, NULL),
2194#endif
2195 CUSTOM_SETTING(0, root_menu_customized, 2172 CUSTOM_SETTING(0, root_menu_customized,
2196 LANG_ROCKBOX_TITLE, /* lang string here is never actually used */ 2173 LANG_ROCKBOX_TITLE, /* lang string here is never actually used */
2197 NULL, "root menu order", 2174 NULL, "root menu order",
diff --git a/apps/tagcache.c b/apps/tagcache.c
index 7265ce87b2..bff1550059 100644
--- a/apps/tagcache.c
+++ b/apps/tagcache.c
@@ -1779,7 +1779,6 @@ bool tagcache_fill_tags(struct mp3entry *id3, const char *filename)
1779 if (id3->bitrate == 0) 1779 if (id3->bitrate == 0)
1780 id3->bitrate = 1; 1780 id3->bitrate = 1;
1781 1781
1782#if CONFIG_CODEC == SWCODEC
1783 if (global_settings.autoresume_enable) 1782 if (global_settings.autoresume_enable)
1784 { 1783 {
1785 id3->elapsed = get_tag_numeric(entry, tag_lastelapsed, idx_id); 1784 id3->elapsed = get_tag_numeric(entry, tag_lastelapsed, idx_id);
@@ -1790,8 +1789,7 @@ bool tagcache_fill_tags(struct mp3entry *id3, const char *filename)
1790 logf("tagcache_fill_tags: Set offset for %s to %lX\n", 1789 logf("tagcache_fill_tags: Set offset for %s to %lX\n",
1791 id3->title, id3->offset); 1790 id3->title, id3->offset);
1792 } 1791 }
1793#endif 1792
1794
1795 return true; 1793 return true;
1796} 1794}
1797#endif /* defined(HAVE_TC_RAMCACHE) && defined(HAVE_DIRCACHE) */ 1795#endif /* defined(HAVE_TC_RAMCACHE) && defined(HAVE_DIRCACHE) */
diff --git a/apps/tagtree.c b/apps/tagtree.c
index 0625e860ab..f006baa581 100644
--- a/apps/tagtree.c
+++ b/apps/tagtree.c
@@ -879,7 +879,6 @@ static void tagtree_buffer_event(unsigned short id, void *ev_data)
879 logf("-> %ld/%ld", id3->playcount, id3->playtime); 879 logf("-> %ld/%ld", id3->playcount, id3->playtime);
880 } 880 }
881 881
882 #if CONFIG_CODEC == SWCODEC
883 if (autoresume) 882 if (autoresume)
884 { 883 {
885 /* Load current file resume info if not already defined (by 884 /* Load current file resume info if not already defined (by
@@ -900,7 +899,6 @@ static void tagtree_buffer_event(unsigned short id, void *ev_data)
900 str_or_empty(id3->title), id3->offset); 899 str_or_empty(id3->title), id3->offset);
901 } 900 }
902 } 901 }
903 #endif
904 902
905 /* Store our tagcache index pointer. */ 903 /* Store our tagcache index pointer. */
906 id3->tagcache_idx = tcs.idx_id+1; 904 id3->tagcache_idx = tcs.idx_id+1;
@@ -922,25 +920,20 @@ static void tagtree_track_finish_event(unsigned short id, void *ev_data)
922 } 920 }
923 tagcache_idx--; 921 tagcache_idx--;
924 922
925#if CONFIG_CODEC == SWCODEC /* HWCODEC doesn't have automatic_skip */
926 bool auto_skip = te->flags & TEF_AUTO_SKIP; 923 bool auto_skip = te->flags & TEF_AUTO_SKIP;
927#endif
928 bool runtimedb = global_settings.runtimedb; 924 bool runtimedb = global_settings.runtimedb;
929 bool autoresume = global_settings.autoresume_enable; 925 bool autoresume = global_settings.autoresume_enable;
930 926
931 /* Don't process unplayed tracks, or tracks interrupted within the 927 /* Don't process unplayed tracks, or tracks interrupted within the
932 first 15 seconds but always process autoresume point */ 928 first 15 seconds but always process autoresume point */
933 if (runtimedb && (id3->elapsed == 0 929 if (runtimedb && (id3->elapsed == 0
934#if CONFIG_CODEC == SWCODEC
935 || (id3->elapsed < 15 * 1000 && !auto_skip) 930 || (id3->elapsed < 15 * 1000 && !auto_skip)
936#endif
937 )) 931 ))
938 { 932 {
939 logf("not db logging unplayed or skipped track"); 933 logf("not db logging unplayed or skipped track");
940 runtimedb = false; 934 runtimedb = false;
941 } 935 }
942 936
943#if CONFIG_CODEC == SWCODEC
944 /* 3s because that is the threshold the WPS uses to rewind instead 937 /* 3s because that is the threshold the WPS uses to rewind instead
945 of skip backwards */ 938 of skip backwards */
946 if (autoresume && (id3->elapsed == 0 939 if (autoresume && (id3->elapsed == 0
@@ -949,7 +942,6 @@ static void tagtree_track_finish_event(unsigned short id, void *ev_data)
949 logf("not logging autoresume"); 942 logf("not logging autoresume");
950 autoresume = false; 943 autoresume = false;
951 } 944 }
952#endif
953 945
954 /* Do not gather data unless proper setting has been enabled and at least 946 /* Do not gather data unless proper setting has been enabled and at least
955 one is still slated to be recorded */ 947 one is still slated to be recorded */
@@ -987,7 +979,6 @@ static void tagtree_track_finish_event(unsigned short id, void *ev_data)
987 tagcache_update_numeric(tagcache_idx, tag_lastplayed, lastplayed); 979 tagcache_update_numeric(tagcache_idx, tag_lastplayed, lastplayed);
988 } 980 }
989 981
990#if CONFIG_CODEC == SWCODEC
991 if (autoresume) 982 if (autoresume)
992 { 983 {
993 unsigned long elapsed = auto_skip ? 0 : id3->elapsed; 984 unsigned long elapsed = auto_skip ? 0 : id3->elapsed;
@@ -998,7 +989,6 @@ static void tagtree_track_finish_event(unsigned short id, void *ev_data)
998 logf("tagtree_track_finish_event: Save resume for %s: %lX %lX", 989 logf("tagtree_track_finish_event: Save resume for %s: %lX %lX",
999 str_or_empty(id3->title), elapsed, offset); 990 str_or_empty(id3->title), elapsed, offset);
1000 } 991 }
1001#endif
1002} 992}
1003 993
1004int tagtree_export(void) 994int tagtree_export(void)
diff --git a/apps/talk.c b/apps/talk.c
index 3aedaf34ec..4b65700a5d 100644
--- a/apps/talk.c
+++ b/apps/talk.c
@@ -32,11 +32,7 @@
32#include "settings.h" 32#include "settings.h"
33#include "settings_list.h" 33#include "settings_list.h"
34#include "splash.h" 34#include "splash.h"
35#if CONFIG_CODEC == SWCODEC
36#include "voice_thread.h" 35#include "voice_thread.h"
37#else
38#include "mp3_playback.h"
39#endif
40#include "audio.h" 36#include "audio.h"
41#include "lang.h" 37#include "lang.h"
42#include "talk.h" 38#include "talk.h"
@@ -107,7 +103,7 @@ struct voicefile_header /* file format of our voice file */
107 103
108/***************** Globals *****************/ 104/***************** Globals *****************/
109 105
110#if (CONFIG_CODEC == SWCODEC && MEMORYSIZE <= 2) 106#if MEMORYSIZE <= 2
111/* On low memory swcodec targets the entire voice file wouldn't fit in memory 107/* On low memory swcodec targets the entire voice file wouldn't fit in memory
112 * together with codecs, so we load clips each time they are accessed. */ 108 * together with codecs, so we load clips each time they are accessed. */
113#define TALK_PROGRESSIVE_LOAD 109#define TALK_PROGRESSIVE_LOAD
@@ -131,15 +127,10 @@ static bool force_enqueue_next; /* enqueue next utterance even if enqueue is fal
131static int queue_write; /* write index of queue, by application */ 127static int queue_write; /* write index of queue, by application */
132static int queue_read; /* read index of queue, by ISR context */ 128static int queue_read; /* read index of queue, by ISR context */
133static enum talk_status talk_status = TALK_STATUS_OK; 129static enum talk_status talk_status = TALK_STATUS_OK;
134#if CONFIG_CODEC == SWCODEC
135/* protects queue_read, queue_write and thumbnail_buf_used */ 130/* protects queue_read, queue_write and thumbnail_buf_used */
136static struct mutex queue_mutex SHAREDBSS_ATTR; 131static struct mutex queue_mutex SHAREDBSS_ATTR;
137#define talk_queue_lock() ({ mutex_lock(&queue_mutex); }) 132#define talk_queue_lock() ({ mutex_lock(&queue_mutex); })
138#define talk_queue_unlock() ({ mutex_unlock(&queue_mutex); }) 133#define talk_queue_unlock() ({ mutex_unlock(&queue_mutex); })
139#else
140#define talk_queue_lock() ({ })
141#define talk_queue_unlock() ({ })
142#endif /* CONFIG_CODEC */
143static int sent; /* how many bytes handed over to playback, owned by ISR */ 134static int sent; /* how many bytes handed over to playback, owned by ISR */
144static unsigned char curr_hd[3]; /* current frame header, for re-sync */ 135static unsigned char curr_hd[3]; /* current frame header, for re-sync */
145static unsigned char last_lang[MAX_FILENAME+1]; /* name of last used lang file (in talk_init) */ 136static unsigned char last_lang[MAX_FILENAME+1]; /* name of last used lang file (in talk_init) */
@@ -186,16 +177,8 @@ static int move_callback(int handle, void *current, void *new)
186 177
187static struct mutex read_buffer_mutex; 178static struct mutex read_buffer_mutex;
188 179
189 180static inline bool check_audio_status(void)
190/* on HWCODEC only voice xor audio can be active at a time */
191static bool check_audio_status(void)
192{ 181{
193#if CONFIG_CODEC != SWCODEC
194 if (audio_status()) /* busy, buffer in use */
195 return false;
196 /* ensure playback is given up on the buffer */
197 audio_hard_stop();
198#endif
199 return true; 182 return true;
200} 183}
201 184
@@ -670,20 +653,16 @@ static bool load_voicefile_data(int fd)
670 return true; 653 return true;
671} 654}
672 655
673/* Use a static buffer to avoid difficulties with buflib during DMA 656/* Use a static buffer to avoid difficulties with buflib during
674 * (hwcodec)/buffer passing to the voice_thread (swcodec). Clips 657 * buffer passing to the voice_thread (swcodec). Clips can be played
675 * can be played in chunks so the size is not that important */ 658 in chunks so the size is not that important */
676static unsigned char commit_buffer[2<<10]; 659static unsigned char commit_buffer[2<<10];
677 660
678static void* commit_transfer(struct queue_entry *qe, size_t *size) 661static void* commit_transfer(struct queue_entry *qe, size_t *size)
679{ 662{
680 void *buf = NULL; /* shut up gcc */ 663 void *buf = NULL; /* shut up gcc */
681 static unsigned char *bufpos = commit_buffer; 664 static unsigned char *bufpos = commit_buffer;
682#if CONFIG_CODEC != SWCODEC
683 sent = MIN(qe->remaining, 0xFFFF);
684#else
685 sent = qe->remaining; 665 sent = qe->remaining;
686#endif
687 sent = MIN((size_t)sent, sizeof(commit_buffer)); 666 sent = MIN((size_t)sent, sizeof(commit_buffer));
688 buf = buflib_get_data(&clip_ctx, qe->handle); 667 buf = buflib_get_data(&clip_ctx, qe->handle);
689 /* adjust buffer position to what has been played already */ 668 /* adjust buffer position to what has been played already */
@@ -706,13 +685,11 @@ static inline bool is_silence(struct queue_entry *qe)
706static void mp3_callback(const void** start, size_t* size) 685static void mp3_callback(const void** start, size_t* size)
707{ 686{
708 struct queue_entry *qe = &queue[queue_read]; 687 struct queue_entry *qe = &queue[queue_read];
709#if CONFIG_CODEC == SWCODEC
710 /* voice_thread.c hints us how many of the buffer we provided it actually 688 /* voice_thread.c hints us how many of the buffer we provided it actually
711 * consumed. Because buffers have to be frame-aligned for speex 689 * consumed. Because buffers have to be frame-aligned for speex
712 * it might be less than what we presented */ 690 * it might be less than what we presented */
713 if (*size) 691 if (*size)
714 sent = *size; 692 sent = *size;
715#endif
716 qe->remaining -= sent; /* we completed this */ 693 qe->remaining -= sent; /* we completed this */
717 694
718 if (qe->remaining > 0) /* current clip not finished? */ 695 if (qe->remaining > 0) /* current clip not finished? */
@@ -757,55 +734,7 @@ static void mp3_callback(const void** start, size_t* size)
757/* stop the playback and the pending clips */ 734/* stop the playback and the pending clips */
758void talk_force_shutup(void) 735void talk_force_shutup(void)
759{ 736{
760 /* Most of this is MAS only */ 737 /* Had nothing to do (was frame boundary or not our clip) */
761#if CONFIG_CODEC != SWCODEC
762#ifdef SIMULATOR
763 return;
764#endif
765 unsigned char* pos;
766 unsigned char* search;
767 unsigned char* end;
768 int len;
769 if (QUEUE_LEVEL == 0) /* has ended anyway */
770 return;
771
772 /* search next frame boundary and continue up to there */
773 pos = search = mp3_get_pos();
774 end = buflib_get_data(&clip_ctx, queue[queue_read].handle);
775 len = queue[queue_read].length;
776
777 if (pos >= end && pos <= (end+len)) /* really our clip? */
778 { /* (for strange reasons this isn't nesessarily the case) */
779 /* find the next frame boundary */
780 while (search < (end+len)) /* search the remaining data */
781 {
782 if (*search++ != 0xFF) /* quick search for frame sync byte */
783 continue; /* (this does the majority of the job) */
784
785 /* look at the (bitswapped) rest of header candidate */
786 if (search[0] == curr_hd[0] /* do the quicker checks first */
787 && search[2] == curr_hd[2]
788 && (search[1] & 0x30) == (curr_hd[1] & 0x30)) /* sample rate */
789 {
790 search--; /* back to the sync byte */
791 break; /* From looking at it, this is our header. */
792 }
793 }
794
795 if (search-pos)
796 { /* play old data until the frame end, to keep the MAS in sync */
797 sent = search-pos;
798
799 queue_write = (queue_read + 1) & QUEUE_MASK; /* will be empty after next callback */
800 queue[queue_read].length = sent; /* current one ends after this */
801
802 thumbnail_buf_used = 0;
803 return;
804 }
805 }
806#endif /* CONFIG_CODEC != SWCODEC */
807
808 /* Either SWCODEC, or MAS had nothing to do (was frame boundary or not our clip) */
809 mp3_play_stop(); 738 mp3_play_stop();
810 talk_queue_lock(); 739 talk_queue_lock();
811 queue_write = queue_read = 0; /* reset the queue */ 740 queue_write = queue_read = 0; /* reset the queue */
@@ -885,9 +814,7 @@ void talk_init(void)
885 814
886 if(!talk_initialized) 815 if(!talk_initialized)
887 { 816 {
888#if CONFIG_CODEC == SWCODEC
889 mutex_init(&queue_mutex); 817 mutex_init(&queue_mutex);
890#endif /* CONFIG_CODEC == SWCODEC */
891 mutex_init(&read_buffer_mutex); 818 mutex_init(&read_buffer_mutex);
892 } 819 }
893 820
@@ -957,11 +884,9 @@ void talk_init(void)
957 884
958 load_voicefile_data(filehandle); 885 load_voicefile_data(filehandle);
959 886
960#if CONFIG_CODEC == SWCODEC
961 /* Initialize the actual voice clip playback engine as well */ 887 /* Initialize the actual voice clip playback engine as well */
962 if (talk_voice_required()) 888 if (talk_voice_required())
963 voice_thread_init(); 889 voice_thread_init();
964#endif
965 890
966out: 891out:
967 close(filehandle); /* close again, this was just to detect presence */ 892 close(filehandle); /* close again, this was just to detect presence */
@@ -1062,9 +987,6 @@ static int _talk_file(const char* filename,
1062 int fd; 987 int fd;
1063 int size; 988 int size;
1064 int handle, oldest = -1; 989 int handle, oldest = -1;
1065#if CONFIG_CODEC != SWCODEC
1066 struct mp3entry info;
1067#endif
1068 990
1069 /* reload needed? */ 991 /* reload needed? */
1070 if (talk_temp_disable_count > 0) 992 if (talk_temp_disable_count > 0)
@@ -1080,13 +1002,6 @@ static int _talk_file(const char* filename,
1080 close(fd); 1002 close(fd);
1081 } 1003 }
1082 1004
1083#if CONFIG_CODEC != SWCODEC
1084 if(mp3info(&info, filename)) /* use this to find real start */
1085 {
1086 return 0; /* failed to open, or invalid */
1087 }
1088#endif
1089
1090 if (!enqueue) 1005 if (!enqueue)
1091 /* shutup now to free the thumbnail buffer */ 1006 /* shutup now to free the thumbnail buffer */
1092 talk_shutup(); 1007 talk_shutup();
@@ -1098,10 +1013,6 @@ static int _talk_file(const char* filename,
1098 } 1013 }
1099 size = filesize(fd); 1014 size = filesize(fd);
1100 1015
1101#if CONFIG_CODEC != SWCODEC
1102 size -= lseek(fd, info.first_frame_offset, SEEK_SET); /* behind ID data */
1103#endif
1104
1105 /* free clips from cache until this one succeeds to allocate */ 1016 /* free clips from cache until this one succeeds to allocate */
1106 while ((handle = buflib_alloc(&clip_ctx, size)) < 0) 1017 while ((handle = buflib_alloc(&clip_ctx, size)) < 0)
1107 oldest = free_oldest_clip(); 1018 oldest = free_oldest_clip();
@@ -1116,10 +1027,6 @@ static int _talk_file(const char* filename,
1116 struct queue_entry clip; 1027 struct queue_entry clip;
1117 clip.handle = handle; 1028 clip.handle = handle;
1118 clip.length = clip.remaining = size; 1029 clip.length = clip.remaining = size;
1119#if CONFIG_CODEC != SWCODEC && !defined(SIMULATOR)
1120 /* bitswap doesnt yield() */
1121 bitswap(buflib_get_data(&clip_ctx, handle), size);
1122#endif
1123 if(prefix_ids) 1030 if(prefix_ids)
1124 /* prefix thumbnail by speaking these ids, but only now 1031 /* prefix thumbnail by speaking these ids, but only now
1125 that we know there's actually a thumbnail to be 1032 that we know there's actually a thumbnail to be
diff --git a/apps/tree.c b/apps/tree.c
index fb0d0a3ac5..e159c3465f 100644
--- a/apps/tree.c
+++ b/apps/tree.c
@@ -650,9 +650,7 @@ static int dirbrowse(void)
650 if (tc.dirlevel < 0) 650 if (tc.dirlevel < 0)
651 tc.dirlevel = 0; /* shouldnt be needed.. this code needs work! */ 651 tc.dirlevel = 0; /* shouldnt be needed.. this code needs work! */
652 652
653#if CONFIG_CODEC == SWCODEC
654 keyclick_set_callback(gui_synclist_keyclick_callback, &tree_lists); 653 keyclick_set_callback(gui_synclist_keyclick_callback, &tree_lists);
655#endif
656 button = get_action(CONTEXT_TREE, 654 button = get_action(CONTEXT_TREE,
657 list_do_action_timeout(&tree_lists, HZ/2)); 655 list_do_action_timeout(&tree_lists, HZ/2));
658#ifdef HAVE_LCD_BITMAP 656#ifdef HAVE_LCD_BITMAP
@@ -1175,11 +1173,6 @@ static void say_filetype(int attr)
1175 1173
1176static int ft_play_dirname(char* name) 1174static int ft_play_dirname(char* name)
1177{ 1175{
1178#if CONFIG_CODEC != SWCODEC
1179 if (audio_status() & AUDIO_STATUS_PLAY)
1180 return 0;
1181#endif
1182
1183 return talk_file(tc.currdir, name, dir_thumbnail_name, NULL, 1176 return talk_file(tc.currdir, name, dir_thumbnail_name, NULL,
1184 global_settings.talk_filetype ? 1177 global_settings.talk_filetype ?
1185 TALK_IDARRAY(VOICE_DIR) : NULL, 1178 TALK_IDARRAY(VOICE_DIR) : NULL,
@@ -1188,11 +1181,6 @@ static int ft_play_dirname(char* name)
1188 1181
1189static int ft_play_filename(char *dir, char *file, int attr) 1182static int ft_play_filename(char *dir, char *file, int attr)
1190{ 1183{
1191#if CONFIG_CODEC != SWCODEC
1192 if (audio_status() & AUDIO_STATUS_PLAY)
1193 return 0;
1194#endif
1195
1196 if (strlen(file) >= strlen(file_thumbnail_ext) 1184 if (strlen(file) >= strlen(file_thumbnail_ext)
1197 && strcasecmp(&file[strlen(file) - strlen(file_thumbnail_ext)], 1185 && strcasecmp(&file[strlen(file) - strlen(file_thumbnail_ext)],
1198 file_thumbnail_ext)) 1186 file_thumbnail_ext))
diff --git a/docs/MAINTAINERS b/docs/MAINTAINERS
index 52ac7fb0db..0da14791ca 100644
--- a/docs/MAINTAINERS
+++ b/docs/MAINTAINERS
@@ -76,11 +76,9 @@ Core code (Mid-level)
76:DSP: Michael Sevakis,Thom Johansen 76:DSP: Michael Sevakis,Thom Johansen
77:LCD/Graphics API: Jens Arnold 77:LCD/Graphics API: Jens Arnold
78:Buffering engine: Nicolas Pennequin 78:Buffering engine: Nicolas Pennequin
79:Playback engine (HWCODEC): 79:Playback engine: Michael Sevakis, Nicolas Pennequin
80:Playback engine (SWCODEC): Michael Sevakis, Nicolas Pennequin 80:PCM playback API: Michael Sevakis
81:PCM playback API (SWCODEC): Michael Sevakis 81:PCM recording API: Michael Sevakis
82:PCM recording API (SWCODEC): Michael Sevakis
83:Recording API (HWCODEC):
84:Fonts and Unicode: 82:Fonts and Unicode:
85:Replaygain: Magnus Holmgren 83:Replaygain: Magnus Holmgren
86:Profiling: 84:Profiling:
diff --git a/docs/PLUGIN_API b/docs/PLUGIN_API
index e7ab119f97..7cd04cc410 100644
--- a/docs/PLUGIN_API
+++ b/docs/PLUGIN_API
@@ -111,20 +111,20 @@ void audio_resume(void)
111 111
112void audio_set_input_source(int source, unsigned flags) 112void audio_set_input_source(int source, unsigned flags)
113 \group sound 113 \group sound
114 \conditions (CONFIG_CODEC == SWCODEC) && (INPUT_SRC_CAPS != 0) 114 \conditions (INPUT_SRC_CAPS != 0)
115 \param source 115 \param source
116 \param flags 116 \param flags
117 \description 117 \description
118 118
119void audio_set_output_source(int monitor) 119void audio_set_output_source(int monitor)
120 \group sound 120 \group sound
121 \conditions (CONFIG_CODEC == SWCODEC) && (INPUT_SRC_CAPS != 0) 121 \conditions (INPUT_SRC_CAPS != 0)
122 \param monitor 122 \param monitor
123 \description 123 \description
124 124
125void audio_set_recording_gain(int left, int right, int type) 125void audio_set_recording_gain(int left, int right, int type)
126 \group sound 126 \group sound
127 \conditions (CONFIG_CODEC == SWCODEC) && (defined(HAVE_RECORDING)) 127 \conditions (defined(HAVE_RECORDING))
128 \param left 128 \param left
129 \param right 129 \param right
130 \param type 130 \param type
@@ -191,16 +191,8 @@ unsigned short *bidi_l2v( const unsigned char *str, int orientation )
191 \return 191 \return
192 \description 192 \description
193 193
194void bitswap(unsigned char *data, int length)
195 \group sound
196 \conditions (!defined(SIMULATOR)) && (CONFIG_CODEC != SWCODEC)
197 \param data
198 \param length
199 \description Swap the bits for each element of array =data= of size =length=
200
201int bufadvance(int handle_id, off_t offset) 194int bufadvance(int handle_id, off_t offset)
202 \group buffering API 195 \group buffering API
203 \conditions ((CONFIG_CODEC == SWCODEC))
204 \param handle_id 196 \param handle_id
205 \param offset 197 \param offset
206 \return 198 \return
@@ -208,7 +200,6 @@ int bufadvance(int handle_id, off_t offset)
208 200
209int bufalloc(const void *src, size_t size, enum data_type type) 201int bufalloc(const void *src, size_t size, enum data_type type)
210 \group buffering API 202 \group buffering API
211 \conditions ((CONFIG_CODEC == SWCODEC))
212 \param src 203 \param src
213 \param size 204 \param size
214 \param type 205 \param type
@@ -217,14 +208,12 @@ int bufalloc(const void *src, size_t size, enum data_type type)
217 208
218bool bufclose(int handle_id) 209bool bufclose(int handle_id)
219 \group buffering API 210 \group buffering API
220 \conditions ((CONFIG_CODEC == SWCODEC))
221 \param handle_id 211 \param handle_id
222 \return 212 \return
223 \description 213 \description
224 214
225ssize_t bufcuttail(int handle_id, size_t size) 215ssize_t bufcuttail(int handle_id, size_t size)
226 \group buffering API 216 \group buffering API
227 \conditions ((CONFIG_CODEC == SWCODEC))
228 \param handle_id 217 \param handle_id
229 \param size 218 \param size
230 \return 219 \return
@@ -232,7 +221,6 @@ ssize_t bufcuttail(int handle_id, size_t size)
232 221
233ssize_t bufgetdata(int handle_id, size_t size, void **data) 222ssize_t bufgetdata(int handle_id, size_t size, void **data)
234 \group buffering API 223 \group buffering API
235 \conditions ((CONFIG_CODEC == SWCODEC))
236 \param handle_id 224 \param handle_id
237 \param size 225 \param size
238 \param data 226 \param data
@@ -241,7 +229,6 @@ ssize_t bufgetdata(int handle_id, size_t size, void **data)
241 229
242ssize_t bufgettail(int handle_id, size_t size, void **data) 230ssize_t bufgettail(int handle_id, size_t size, void **data)
243 \group buffering API 231 \group buffering API
244 \conditions ((CONFIG_CODEC == SWCODEC))
245 \param handle_id 232 \param handle_id
246 \param size 233 \param size
247 \param data 234 \param data
@@ -250,7 +237,6 @@ ssize_t bufgettail(int handle_id, size_t size, void **data)
250 237
251int bufopen(const char *file, size_t offset, enum data_type type) 238int bufopen(const char *file, size_t offset, enum data_type type)
252 \group buffering API 239 \group buffering API
253 \conditions ((CONFIG_CODEC == SWCODEC))
254 \param file 240 \param file
255 \param offset 241 \param offset
256 \param type 242 \param type
@@ -259,7 +245,6 @@ int bufopen(const char *file, size_t offset, enum data_type type)
259 245
260ssize_t bufread(int handle_id, size_t size, void *dest) 246ssize_t bufread(int handle_id, size_t size, void *dest)
261 \group buffering API 247 \group buffering API
262 \conditions ((CONFIG_CODEC == SWCODEC))
263 \param handle_id 248 \param handle_id
264 \param size 249 \param size
265 \param dest 250 \param dest
@@ -268,37 +253,31 @@ ssize_t bufread(int handle_id, size_t size, void *dest)
268 253
269int bufseek(int handle_id, size_t newpos) 254int bufseek(int handle_id, size_t newpos)
270 \group buffering API 255 \group buffering API
271 \conditions ((CONFIG_CODEC == SWCODEC))
272 \param handle_id 256 \param handle_id
273 \param newpos 257 \param newpos
274 \return 258 \return
275 \description 259 \description
276 260
277ssize_t buf_get_offset(int handle_id, void *ptr) 261ssize_t buf_get_offset(int handle_id, void *ptr)
278 \conditions ((CONFIG_CODEC == SWCODEC))
279 \param handle_id 262 \param handle_id
280 \param ptr 263 \param ptr
281 \return 264 \return
282 \description 265 \description
283 266
284ssize_t buf_handle_offset(int handle_id) 267ssize_t buf_handle_offset(int handle_id)
285 \conditions ((CONFIG_CODEC == SWCODEC))
286 \param handle_id 268 \param handle_id
287 \return 269 \return
288 \description 270 \description
289 271
290void buf_request_buffer_handle(int handle_id) 272void buf_request_buffer_handle(int handle_id)
291 \conditions ((CONFIG_CODEC == SWCODEC))
292 \param handle_id 273 \param handle_id
293 \description 274 \description
294 275
295void buf_set_base_handle(int handle_id) 276void buf_set_base_handle(int handle_id)
296 \conditions ((CONFIG_CODEC == SWCODEC))
297 \param handle_id 277 \param handle_id
298 \description 278 \description
299 279
300size_t buf_used(void) 280size_t buf_used(void)
301 \conditions ((CONFIG_CODEC == SWCODEC))
302 \return 281 \return
303 \description 282 \description
304 283
@@ -410,7 +389,6 @@ int closedir(DIR* dir)
410 389
411int codec_load_file(const char* codec, struct codec_api *api) 390int codec_load_file(const char* codec, struct codec_api *api)
412 \group misc 391 \group misc
413 \conditions (CONFIG_CODEC == SWCODEC)
414 \param codec 392 \param codec
415 \param api 393 \param api
416 \return 394 \return
@@ -540,7 +518,6 @@ int do_menu(const struct menu_item_ex *menu, int *start_selected, struct viewpor
540 518
541intptr_t dsp_configure(struct dsp_config *dsp, int setting, intptr_t value) 519intptr_t dsp_configure(struct dsp_config *dsp, int setting, intptr_t value)
542 \group sound 520 \group sound
543 \conditions (CONFIG_CODEC == SWCODEC)
544 \param dsp 521 \param dsp
545 \param setting 522 \param setting
546 \param value 523 \param value
@@ -549,13 +526,11 @@ intptr_t dsp_configure(struct dsp_config *dsp, int setting, intptr_t value)
549 526
550void dsp_dither_enable(bool enable) 527void dsp_dither_enable(bool enable)
551 \group sound 528 \group sound
552 \conditions (CONFIG_CODEC == SWCODEC)
553 \param enable 529 \param enable
554 \description 530 \description
555 531
556int dsp_process(struct dsp_config *dsp, char *dest, const char *src[], int count) 532int dsp_process(struct dsp_config *dsp, char *dest, const char *src[], int count)
557 \group sound 533 \group sound
558 \conditions (CONFIG_CODEC == SWCODEC)
559 \param dsp 534 \param dsp
560 \param dest 535 \param dest
561 \param src[] 536 \param src[]
@@ -565,13 +540,11 @@ int dsp_process(struct dsp_config *dsp, char *dest, const char *src[], int count
565 540
566void dsp_set_crossfeed(bool enable) 541void dsp_set_crossfeed(bool enable)
567 \group sound 542 \group sound
568 \conditions (CONFIG_CODEC == SWCODEC)
569 \param enable 543 \param enable
570 \description 544 \description
571 545
572void dsp_set_eq(bool enable) 546void dsp_set_eq(bool enable)
573 \group sound 547 \group sound
574 \conditions (CONFIG_CODEC == SWCODEC)
575 \param enable 548 \param enable
576 \description 549 \description
577 550
@@ -666,7 +639,6 @@ int get_action(int context, int timeout)
666 639
667const char *get_codec_filename(int cod_spec) 640const char *get_codec_filename(int cod_spec)
668 \group misc 641 \group misc
669 \conditions (CONFIG_CODEC == SWCODEC)
670 \param cod_spec 642 \param cod_spec
671 \return 643 \return
672 \description 644 \description
@@ -681,7 +653,6 @@ int get_custom_action(int context,int timeout, const struct button_mapping* (*ge
681 653
682bool get_metadata(struct mp3entry* id3, int fd, const char* trackname) 654bool get_metadata(struct mp3entry* id3, int fd, const char* trackname)
683 \group misc 655 \group misc
684 \conditions (CONFIG_CODEC == SWCODEC)
685 \param id3 656 \param id3
686 \param fd 657 \param fd
687 \param trackname 658 \param trackname
@@ -1342,19 +1313,17 @@ void logf(const char *fmt, ...) ATTRIBUTE_PRINTF(1, 2)
1342 1313
1343const unsigned long *audio_master_sampr_list 1314const unsigned long *audio_master_sampr_list
1344 \group sound 1315 \group sound
1345 \conditions (CONFIG_CODEC == SWCODEC)
1346 \return 1316 \return
1347 \description 1317 \description
1348 1318
1349const unsigned long *hw_freq_sampr 1319const unsigned long *hw_freq_sampr
1350 \group sound 1320 \group sound
1351 \conditions (CONFIG_CODEC == SWCODEC)
1352 \return 1321 \return
1353 \description 1322 \description
1354 1323
1355const unsigned long *rec_freq_sampr 1324const unsigned long *rec_freq_sampr
1356 \group sound 1325 \group sound
1357 \conditions (CONFIG_CODEC == SWCODEC) && (defined(HAVE_RECORDING)) 1326 \conditions defined(HAVE_RECORDING)
1358 \return 1327 \return
1359 \description 1328 \description
1360 1329
@@ -1443,27 +1412,18 @@ void mp3_play_stop(void)
1443 \conditions (!defined(SIMULATOR)) 1412 \conditions (!defined(SIMULATOR))
1444 \description Stops playback 1413 \description Stops playback
1445 1414
1446unsigned long mpeg_get_last_header(void)
1447 \group playback control
1448 \conditions (!defined(SIMULATOR) && (CONFIG_CODEC != SWCODEC))
1449 \return
1450 \description
1451
1452void mutex_init(struct mutex *m) 1415void mutex_init(struct mutex *m)
1453 \group kernel/ system 1416 \group kernel/ system
1454 \conditions (CONFIG_CODEC == SWCODEC)
1455 \param m 1417 \param m
1456 \description 1418 \description
1457 1419
1458void mutex_lock(struct mutex *m) 1420void mutex_lock(struct mutex *m)
1459 \group kernel/ system 1421 \group kernel/ system
1460 \conditions (CONFIG_CODEC == SWCODEC)
1461 \param m 1422 \param m
1462 \description 1423 \description
1463 1424
1464void mutex_unlock(struct mutex *m) 1425void mutex_unlock(struct mutex *m)
1465 \group kernel/ system 1426 \group kernel/ system
1466 \conditions (CONFIG_CODEC == SWCODEC)
1467 \param m 1427 \param m
1468 \description 1428 \description
1469 1429
@@ -1484,54 +1444,48 @@ bool option_screen(const struct settings_list *setting, struct viewport parent[N
1484 1444
1485void pcm_apply_settings(void) 1445void pcm_apply_settings(void)
1486 \group sound 1446 \group sound
1487 \conditions (CONFIG_CODEC == SWCODEC)
1488 \description 1447 \description
1489 1448
1490void pcm_calculate_peaks(int *left, int *right) 1449void pcm_calculate_peaks(int *left, int *right)
1491 \group sound 1450 \group sound
1492 \conditions (CONFIG_CODEC == SWCODEC)
1493 \param left 1451 \param left
1494 \param right 1452 \param right
1495 \description 1453 \description
1496 1454
1497void pcm_calculate_rec_peaks(int *left, int *right) 1455void pcm_calculate_rec_peaks(int *left, int *right)
1498 \group sound 1456 \group sound
1499 \conditions (CONFIG_CODEC == SWCODEC) && (defined(HAVE_RECORDING)) 1457 \conditions defined(HAVE_RECORDING)
1500 \param left 1458 \param left
1501 \param right 1459 \param right
1502 \description 1460 \description
1503 1461
1504void pcm_close_recording(void) 1462void pcm_close_recording(void)
1505 \group sound 1463 \group sound
1506 \conditions (CONFIG_CODEC == SWCODEC) && (defined(HAVE_RECORDING)) 1464 \conditions defined(HAVE_RECORDING)
1507 \description 1465 \description
1508 1466
1509size_t pcm_get_bytes_waiting(void) 1467size_t pcm_get_bytes_waiting(void)
1510 \group sound 1468 \group sound
1511 \conditions (CONFIG_CODEC == SWCODEC)
1512 \return 1469 \return
1513 \description 1470 \description
1514 1471
1515void pcm_init_recording(void) 1472void pcm_init_recording(void)
1516 \group sound 1473 \group sound
1517 \conditions (CONFIG_CODEC == SWCODEC) && (defined(HAVE_RECORDING)) 1474 \conditions defined(HAVE_RECORDING)
1518 \description 1475 \description
1519 1476
1520bool pcm_is_paused(void) 1477bool pcm_is_paused(void)
1521 \group sound 1478 \group sound
1522 \conditions (CONFIG_CODEC == SWCODEC)
1523 \return true if playback is paused, else false 1479 \return true if playback is paused, else false
1524 \description 1480 \description
1525 1481
1526bool pcm_is_playing(void) 1482bool pcm_is_playing(void)
1527 \group sound 1483 \group sound
1528 \conditions (CONFIG_CODEC == SWCODEC)
1529 \return true unless playback is paused 1484 \return true unless playback is paused
1530 \description 1485 \description
1531 1486
1532void pcm_play_data(pcm_more_callback_type get_more, unsigned char* start, size_t size) 1487void pcm_play_data(pcm_more_callback_type get_more, unsigned char* start, size_t size)
1533 \group sound 1488 \group sound
1534 \conditions (CONFIG_CODEC == SWCODEC)
1535 \param get_more Optional callback 1489 \param get_more Optional callback
1536 \param start is the address of raw 16-16, interleaved PCM data 1490 \param start is the address of raw 16-16, interleaved PCM data
1537 \param size is the size of the data to play 1491 \param size is the size of the data to play
@@ -1539,28 +1493,24 @@ void pcm_play_data(pcm_more_callback_type get_more, unsigned char* start, size_t
1539 1493
1540void pcm_play_lock(void) 1494void pcm_play_lock(void)
1541 \group sound 1495 \group sound
1542 \conditions (CONFIG_CODEC == SWCODEC)
1543 \description 1496 \description
1544 1497
1545void pcm_play_pause(bool play) 1498void pcm_play_pause(bool play)
1546 \group sound 1499 \group sound
1547 \conditions (CONFIG_CODEC == SWCODEC)
1548 \param play 1500 \param play
1549 \description Pauses or unpauses the playback depending on the truth value of =play= 1501 \description Pauses or unpauses the playback depending on the truth value of =play=
1550 1502
1551void pcm_play_stop(void) 1503void pcm_play_stop(void)
1552 \group sound 1504 \group sound
1553 \conditions (CONFIG_CODEC == SWCODEC)
1554 \description Stops the playback and empties the audio buffer unlike [F[pcm_play_pause]] 1505 \description Stops the playback and empties the audio buffer unlike [F[pcm_play_pause]]
1555 1506
1556void pcm_play_unlock(void) 1507void pcm_play_unlock(void)
1557 \group sound 1508 \group sound
1558 \conditions (CONFIG_CODEC == SWCODEC)
1559 \description 1509 \description
1560 1510
1561void pcm_record_data(pcm_more_callback_type2 more_ready, void *start, size_t size) 1511void pcm_record_data(pcm_more_callback_type2 more_ready, void *start, size_t size)
1562 \group sound 1512 \group sound
1563 \conditions (CONFIG_CODEC == SWCODEC) && (defined(HAVE_RECORDING)) 1513 \conditions defined(HAVE_RECORDING)
1564 \param more_ready 1514 \param more_ready
1565 \param start 1515 \param start
1566 \param size 1516 \param size
@@ -1568,20 +1518,19 @@ void pcm_record_data(pcm_more_callback_type2 more_ready, void *start, size_t siz
1568 1518
1569void pcm_record_more(void *start, size_t size) 1519void pcm_record_more(void *start, size_t size)
1570 \group sound 1520 \group sound
1571 \conditions (CONFIG_CODEC == SWCODEC) && (defined(HAVE_RECORDING)) 1521 \conditions defined(HAVE_RECORDING)
1572 \param start 1522 \param start
1573 \param size 1523 \param size
1574 \description 1524 \description
1575 1525
1576void pcm_set_frequency(unsigned int frequency) 1526void pcm_set_frequency(unsigned int frequency)
1577 \group sound 1527 \group sound
1578 \conditions (CONFIG_CODEC == SWCODEC)
1579 \param frequency 1528 \param frequency
1580 \description 1529 \description
1581 1530
1582void pcm_stop_recording(void) 1531void pcm_stop_recording(void)
1583 \group sound 1532 \group sound
1584 \conditions (CONFIG_CODEC == SWCODEC) && (defined(HAVE_RECORDING)) 1533 \conditions defined(HAVE_RECORDING)
1585 \description 1534 \description
1586 1535
1587int playlist_amount(void) 1536int playlist_amount(void)
@@ -1757,13 +1706,11 @@ void queue_delete(struct event_queue *q)
1757 \description 1706 \description
1758 1707
1759bool queue_empty(const struct event_queue *q) 1708bool queue_empty(const struct event_queue *q)
1760 \conditions (CONFIG_CODEC == SWCODEC)
1761 \param q 1709 \param q
1762 \return 1710 \return
1763 \description 1711 \description
1764 1712
1765void queue_enable_queue_send(struct event_queue *q, struct queue_sender_list *send, struct thread_entry *owner) 1713void queue_enable_queue_send(struct event_queue *q, struct queue_sender_list *send, struct thread_entry *owner)
1766 \conditions (CONFIG_CODEC == SWCODEC)
1767 \param q 1714 \param q
1768 \param send 1715 \param send
1769 \param owner 1716 \param owner
@@ -1781,13 +1728,11 @@ void queue_post(struct event_queue *q, long id, intptr_t data)
1781 \description 1728 \description
1782 1729
1783void queue_reply(struct event_queue *q, intptr_t retval) 1730void queue_reply(struct event_queue *q, intptr_t retval)
1784 \conditions (CONFIG_CODEC == SWCODEC)
1785 \param q 1731 \param q
1786 \param retval 1732 \param retval
1787 \description 1733 \description
1788 1734
1789intptr_t queue_send(struct event_queue *q, long id, intptr_t data) 1735intptr_t queue_send(struct event_queue *q, long id, intptr_t data)
1790 \conditions (CONFIG_CODEC == SWCODEC)
1791 \param q 1736 \param q
1792 \param id 1737 \param id
1793 \param data 1738 \param data
@@ -1795,7 +1740,6 @@ intptr_t queue_send(struct event_queue *q, long id, intptr_t data)
1795 \description 1740 \description
1796 1741
1797void queue_wait(struct event_queue *q, struct queue_event *ev) 1742void queue_wait(struct event_queue *q, struct queue_event *ev)
1798 \conditions (CONFIG_CODEC == SWCODEC)
1799 \param q 1743 \param q
1800 \param ev 1744 \param ev
1801 \description 1745 \description
@@ -2066,7 +2010,6 @@ void sound_set(int setting, int value)
2066 2010
2067void sound_set_pitch(int pitch) 2011void sound_set_pitch(int pitch)
2068 \group playback control 2012 \group playback control
2069 \conditions (CONFIG_CODEC == SWCODEC)
2070 \param pitch 2013 \param pitch
2071 \description 2014 \description
2072 2015
diff --git a/firmware/SOURCES b/firmware/SOURCES
index 9cd1a5671c..cc1dca3557 100644
--- a/firmware/SOURCES
+++ b/firmware/SOURCES
@@ -425,8 +425,6 @@ drivers/rds.c
425/* Sound */ 425/* Sound */
426sound.c 426sound.c
427 427
428#if CONFIG_CODEC == SWCODEC
429
430#ifndef BOOTLOADER 428#ifndef BOOTLOADER
431pcm_sampr.c 429pcm_sampr.c
432pcm.c 430pcm.c
@@ -440,7 +438,6 @@ enc_base.c
440 438
441drivers/audio/audiohw-swcodec.c 439drivers/audio/audiohw-swcodec.c
442#endif /* BOOTLOADER */ 440#endif /* BOOTLOADER */
443#endif /* SWCODEC */
444 441
445/* Audio codec */ 442/* Audio codec */
446#if (CONFIG_PLATFORM & PLATFORM_NATIVE) && !defined(BOOTLOADER) 443#if (CONFIG_PLATFORM & PLATFORM_NATIVE) && !defined(BOOTLOADER)
@@ -505,13 +502,13 @@ drivers/audio/rocker_codec.c
505drivers/audio/xduoolinux_codec.c 502drivers/audio/xduoolinux_codec.c
506#elif defined(HAVE_SDL_AUDIO) 503#elif defined(HAVE_SDL_AUDIO)
507drivers/audio/sdl.c 504drivers/audio/sdl.c
508#if CONFIG_CODEC == SWCODEC 505
509#if (CONFIG_PLATFORM & PLATFORM_MAEMO5) 506#if (CONFIG_PLATFORM & PLATFORM_MAEMO5)
510target/hosted/maemo/pcm-gstreamer.c 507target/hosted/maemo/pcm-gstreamer.c
511#else 508#else
512target/hosted/sdl/pcm-sdl.c 509target/hosted/sdl/pcm-sdl.c
513#endif /* (CONFIG_PLATFORM & PLATFORM_MAEMO) */ 510#endif /* (CONFIG_PLATFORM & PLATFORM_MAEMO) */
514#endif /* CONFIG_CODEC == SWCODEC */ 511
515#endif 512#endif
516#endif /* (CONFIG_PLATFORM & PLATFORM_NATIVE) && !defined(BOOTLOADER) */ 513#endif /* (CONFIG_PLATFORM & PLATFORM_NATIVE) && !defined(BOOTLOADER) */
517 514
diff --git a/firmware/drivers/audio/sdl.c b/firmware/drivers/audio/sdl.c
index d701665889..fb49a291d1 100644
--- a/firmware/drivers/audio/sdl.c
+++ b/firmware/drivers/audio/sdl.c
@@ -48,7 +48,7 @@ void audiohw_set_volume(int volume)
48#ifdef HAVE_SW_VOLUME_CONTROL 48#ifdef HAVE_SW_VOLUME_CONTROL
49 volume = sdl_volume_level(volume); 49 volume = sdl_volume_level(volume);
50 pcm_set_master_volume(volume, volume); 50 pcm_set_master_volume(volume, volume);
51#elif CONFIG_CODEC == SWCODEC 51#else
52 extern void pcm_set_mixer_volume(int volume); 52 extern void pcm_set_mixer_volume(int volume);
53 pcm_set_mixer_volume(volume); 53 pcm_set_mixer_volume(volume);
54#endif 54#endif
@@ -87,14 +87,6 @@ void audiohw_set_bass(int value) { (void)value; }
87void audiohw_set_treble(int value) { (void)value; } 87void audiohw_set_treble(int value) { (void)value; }
88#endif 88#endif
89#endif /* HAVE_SW_TONE_CONTROLS */ 89#endif /* HAVE_SW_TONE_CONTROLS */
90#if CONFIG_CODEC != SWCODEC
91void audiohw_set_channel(int value) { (void)value; }
92void audiohw_set_stereo_width(int value){ (void)value; }
93#ifdef HAVE_PITCHCONTROL
94void audiohw_set_pitch(int32_t value) { (void)value; }
95int32_t audiohw_get_pitch(void) { return PITCH_SPEED_100; }
96#endif
97#endif /* CONFIG_CODEC != SWCODEC */
98#if defined(AUDIOHW_HAVE_BASS_CUTOFF) 90#if defined(AUDIOHW_HAVE_BASS_CUTOFF)
99void audiohw_set_bass_cutoff(int value) { (void)value; } 91void audiohw_set_bass_cutoff(int value) { (void)value; }
100#endif 92#endif
diff --git a/firmware/export/audio.h b/firmware/export/audio.h
index 5ed9c706a4..c2c23dfd5c 100644
--- a/firmware/export/audio.h
+++ b/firmware/export/audio.h
@@ -18,8 +18,8 @@
18 * KIND, either express or implied. 18 * KIND, either express or implied.
19 * 19 *
20 ****************************************************************************/ 20 ****************************************************************************/
21#ifndef AUDIO_H 21#ifndef __AUDIO_H
22#define AUDIO_H 22#define __AUDIO_H
23 23
24#include <stdbool.h> 24#include <stdbool.h>
25#include <string.h> /* size_t */ 25#include <string.h> /* size_t */
@@ -27,13 +27,11 @@
27/* These must always be included with audio.h for this to compile under 27/* These must always be included with audio.h for this to compile under
28 cetain conditions. Do it here or else spread the complication around to 28 cetain conditions. Do it here or else spread the complication around to
29 many files. */ 29 many files. */
30#if CONFIG_CODEC == SWCODEC
31#include "pcm_sampr.h" 30#include "pcm_sampr.h"
32#include "pcm.h" 31#include "pcm.h"
33#ifdef HAVE_RECORDING 32#ifdef HAVE_RECORDING
34#include "enc_base.h" 33#include "enc_base.h"
35#endif /* HAVE_RECORDING */ 34#endif /* HAVE_RECORDING */
36#endif /* CONFIG_CODEC == SWCODEC */
37 35
38#define AUDIO_STATUS_PLAY 0x0001 36#define AUDIO_STATUS_PLAY 0x0001
39#define AUDIO_STATUS_PAUSE 0x0002 37#define AUDIO_STATUS_PAUSE 0x0002
@@ -75,44 +73,9 @@ void audio_error_clear(void);
75int audio_get_file_pos(void); 73int audio_get_file_pos(void);
76void audio_beep(int duration); 74void audio_beep(int duration);
77 75
78#if CONFIG_CODEC == SWCODEC
79void audio_next_dir(void); 76void audio_next_dir(void);
80void audio_prev_dir(void); 77void audio_prev_dir(void);
81 78
82#else /* hwcodec only */
83struct audio_debug
84{
85 int audiobuflen;
86 int audiobuf_write;
87 int audiobuf_swapwrite;
88 int audiobuf_read;
89
90 int last_dma_chunk_size;
91
92 bool dma_on;
93 bool playing;
94 bool play_pending;
95 bool is_playing;
96 bool filling;
97 bool dma_underrun;
98
99 int unplayed_space;
100 int playable_space;
101 int unswapped_space;
102
103 int low_watermark_level;
104 int lowest_watermark_level;
105};
106
107void audio_get_debugdata(struct audio_debug *dbgdata);
108/* unsigned int audio_error(void); - unused function */
109void audio_init_playback(void);
110
111#define audio_next_dir() ({ })
112#define audio_prev_dir() ({ })
113
114#endif
115
116/* channel modes */ 79/* channel modes */
117enum rec_channel_modes 80enum rec_channel_modes
118{ 81{
@@ -124,12 +87,10 @@ enum rec_channel_modes
124 CHN_NUM_MODES 87 CHN_NUM_MODES
125}; 88};
126 89
127#if CONFIG_CODEC == SWCODEC
128/* channel mode capability bits */ 90/* channel mode capability bits */
129#define CHN_CAP_STEREO (1 << CHN_MODE_STEREO) 91#define CHN_CAP_STEREO (1 << CHN_MODE_STEREO)
130#define CHN_CAP_MONO (1 << CHN_MODE_MONO) 92#define CHN_CAP_MONO (1 << CHN_MODE_MONO)
131#define CHN_CAP_ALL (CHN_CAP_STEREO | CHN_CAP_MONO) 93#define CHN_CAP_ALL (CHN_CAP_STEREO | CHN_CAP_MONO)
132#endif /* CONFIG_CODEC == SWCODEC */
133 94
134/* the enums below must match prestr[] in recording.c */ 95/* the enums below must match prestr[] in recording.c */
135enum audio_sources 96enum audio_sources
@@ -164,7 +125,6 @@ enum rec_sources
164}; 125};
165#endif /* HAVE_RECORDING */ 126#endif /* HAVE_RECORDING */
166 127
167#if CONFIG_CODEC == SWCODEC
168/* selects a source to monitor for recording or playback */ 128/* selects a source to monitor for recording or playback */
169#define SRCF_PLAYBACK 0x0000 /* default */ 129#define SRCF_PLAYBACK 0x0000 /* default */
170#define SRCF_RECORDING 0x1000 130#define SRCF_RECORDING 0x1000
@@ -173,7 +133,6 @@ enum rec_sources
173#define SRCF_FMRADIO_PLAYING 0x0000 /* default */ 133#define SRCF_FMRADIO_PLAYING 0x0000 /* default */
174#define SRCF_FMRADIO_PAUSED 0x2000 134#define SRCF_FMRADIO_PAUSED 0x2000
175#endif 135#endif
176#endif
177 136
178#ifdef HAVE_RECORDING 137#ifdef HAVE_RECORDING
179/* parameters for audio_set_recording_options */ 138/* parameters for audio_set_recording_options */
@@ -183,14 +142,9 @@ struct audio_recording_options
183 int rec_frequency; 142 int rec_frequency;
184 int rec_channels; 143 int rec_channels;
185 int rec_prerecord_time; 144 int rec_prerecord_time;
186#if CONFIG_CODEC == SWCODEC
187 int rec_mono_mode; 145 int rec_mono_mode;
188 int rec_source_flags; /* for rec_set_source */ 146 int rec_source_flags; /* for rec_set_source */
189 struct encoder_config enc_config; 147 struct encoder_config enc_config;
190#else
191 int rec_quality;
192 bool rec_editable;
193#endif
194}; 148};
195 149
196/* audio recording functions */ 150/* audio recording functions */
@@ -206,15 +160,10 @@ void audio_set_recording_gain(int left, int right, int type);
206unsigned long audio_recorded_time(void); 160unsigned long audio_recorded_time(void);
207unsigned long audio_num_recorded_bytes(void); 161unsigned long audio_num_recorded_bytes(void);
208 162
209#if CONFIG_CODEC == SWCODEC
210/* SWCODEC recording functions */
211unsigned long audio_prerecorded_time(void); 163unsigned long audio_prerecorded_time(void);
212#endif /* CONFIG_CODEC == SWCODEC */
213 164
214#endif /* HAVE_RECORDING */ 165#endif /* HAVE_RECORDING */
215 166
216#if CONFIG_CODEC == SWCODEC
217/* SWCODEC misc. audio functions */
218#if INPUT_SRC_CAPS != 0 167#if INPUT_SRC_CAPS != 0
219/* audio.c */ 168/* audio.c */
220void audio_set_input_source(int source, unsigned flags); 169void audio_set_input_source(int source, unsigned flags);
@@ -223,7 +172,6 @@ void audio_set_input_source(int source, unsigned flags);
223void audio_input_mux(int source, unsigned flags); 172void audio_input_mux(int source, unsigned flags);
224void audio_set_output_source(int source); 173void audio_set_output_source(int source);
225#endif /* INPUT_SRC_CAPS */ 174#endif /* INPUT_SRC_CAPS */
226#endif /* CONFIG_CODEC == SWCODEC */
227 175
228#ifdef HAVE_SPDIF_IN 176#ifdef HAVE_SPDIF_IN
229/* returns index into rec_master_sampr_list */ 177/* returns index into rec_master_sampr_list */
@@ -247,11 +195,9 @@ enum track_event_flags
247{ 195{
248 TEF_NONE = 0x0, /* no flags are set */ 196 TEF_NONE = 0x0, /* no flags are set */
249 TEF_CURRENT = 0x1, /* event is for the current track */ 197 TEF_CURRENT = 0x1, /* event is for the current track */
250#if CONFIG_CODEC == SWCODEC
251 TEF_AUTO_SKIP = 0x2, /* event is sent in context of auto skip */ 198 TEF_AUTO_SKIP = 0x2, /* event is sent in context of auto skip */
252 TEF_REWIND = 0x4, /* interpret as rewind, id3->elapsed is the 199 TEF_REWIND = 0x4, /* interpret as rewind, id3->elapsed is the
253 position before the seek back to 0 */ 200 position before the seek back to 0 */
254#endif /* CONFIG_CODEC == SWCODEC */
255}; 201};
256 202
257struct track_event 203struct track_event
@@ -260,43 +206,4 @@ struct track_event
260 struct mp3entry *id3; /* pointer to mp3entry describing track */ 206 struct mp3entry *id3; /* pointer to mp3entry describing track */
261}; 207};
262 208
263#if CONFIG_CODEC != SWCODEC 209#endif /* __AUDIO_H */
264/* subscribe to one or more audio event(s) by OR'ing together the desired */
265/* event IDs (defined below); a handler is called with a solitary event ID */
266/* (so switch() is okay) and possibly some useful data (depending on the */
267/* event); a handler must return one of the return codes defined below */
268
269typedef int (*AUDIO_EVENT_HANDLER)(unsigned short event, unsigned long data);
270
271void audio_register_event_handler(AUDIO_EVENT_HANDLER handler, unsigned short mask);
272
273/***********************************************************************/
274/* handler return codes */
275
276#define AUDIO_EVENT_RC_IGNORED 200
277 /* indicates that no action was taken or the event was not recognized */
278
279#define AUDIO_EVENT_RC_HANDLED 201
280 /* indicates that the event was handled and some action was taken which renders
281 the original event invalid; USE WITH CARE!; this return code aborts all further
282 processing of the given event */
283
284/***********************************************************************/
285/* audio event IDs */
286
287#define AUDIO_EVENT_POS_REPORT (1<<0)
288 /* sends a periodic song position report to handlers; a report is sent on
289 each kernal tick; the number of ticks per second is defined by HZ; on each
290 report the current song position is passed in 'data'; if a handler takes an
291 action that changes the song or the song position it must return
292 AUDIO_EVENT_RC_HANDLED which suppresses the event for any remaining handlers */
293
294#define AUDIO_EVENT_END_OF_TRACK (1<<1)
295 /* generated when the end of the currently playing track is reached; no
296 data is passed; if the handler implements some alternate end-of-track
297 processing it should return AUDIO_EVENT_RC_HANDLED which suppresses the
298 event for any remaining handlers as well as the normal end-of-track
299 processing */
300
301#endif
302#endif
diff --git a/firmware/export/config.h b/firmware/export/config.h
index 6ce9bede41..e4397517db 100644
--- a/firmware/export/config.h
+++ b/firmware/export/config.h
@@ -53,9 +53,6 @@
53#define RDA5802 0x80 /* RDA Microelectronics */ 53#define RDA5802 0x80 /* RDA Microelectronics */
54#define STFM1000 0x100 /* Sigmatel */ 54#define STFM1000 0x100 /* Sigmatel */
55 55
56/* CONFIG_CODEC */
57#define SWCODEC 1 /* if codec is done by SW */
58
59/* CONFIG_CPU */ 56/* CONFIG_CPU */
60#define MCF5249 5249 57#define MCF5249 5249
61#define MCF5250 5250 58#define MCF5250 5250
@@ -903,7 +900,6 @@ Lyre prototype 1 */
903#define HAVE_PICTUREFLOW_INTEGRATION 900#define HAVE_PICTUREFLOW_INTEGRATION
904#endif 901#endif
905 902
906#if (CONFIG_CODEC == SWCODEC)
907#ifdef BOOTLOADER 903#ifdef BOOTLOADER
908 904
909#ifdef HAVE_BOOTLOADER_USB_MODE 905#ifdef HAVE_BOOTLOADER_USB_MODE
@@ -975,8 +971,6 @@ Lyre prototype 1 */
975#define HAVE_CROSSFADE 971#define HAVE_CROSSFADE
976#endif 972#endif
977 973
978#endif /* (CONFIG_CODEC == SWCODEC) */
979
980/* Determine if accesses should be strictly long aligned. */ 974/* Determine if accesses should be strictly long aligned. */
981#if defined(CPU_ARM) || defined(CPU_MIPS) 975#if defined(CPU_ARM) || defined(CPU_MIPS)
982#define ROCKBOX_STRICT_ALIGN 1 976#define ROCKBOX_STRICT_ALIGN 1
@@ -1248,19 +1242,16 @@ Lyre prototype 1 */
1248#define HAVE_PCM_FULL_DUPLEX 1242#define HAVE_PCM_FULL_DUPLEX
1249#endif 1243#endif
1250 1244
1251#if (CONFIG_CODEC == SWCODEC)
1252#define HAVE_PITCHCONTROL 1245#define HAVE_PITCHCONTROL
1253#endif
1254 1246
1255/* enable logging messages to disk*/ 1247/* enable logging messages to disk*/
1256#if !defined(BOOTLOADER) && !defined(__PCTOOL__) && (CONFIG_CODEC == SWCODEC) 1248#if !defined(BOOTLOADER) && !defined(__PCTOOL__)
1257#define ROCKBOX_HAS_LOGDISKF 1249#define ROCKBOX_HAS_LOGDISKF
1258#endif 1250#endif
1259 1251
1260#if defined(HAVE_SDL_AUDIO) \ 1252#if defined(HAVE_SDL_AUDIO) \
1261 && !(CONFIG_PLATFORM & PLATFORM_MAEMO5) \ 1253 && !(CONFIG_PLATFORM & PLATFORM_MAEMO5) \
1262 && !defined(HAVE_SW_VOLUME_CONTROL) \ 1254 && !defined(HAVE_SW_VOLUME_CONTROL)
1263 && CONFIG_CODEC == SWCODEC
1264/* SW volume is needed for accurate control and no double buffering should be 1255/* SW volume is needed for accurate control and no double buffering should be
1265 * required. If target uses SW volume, then its definitions are used instead 1256 * required. If target uses SW volume, then its definitions are used instead
1266 * so things are as on target. */ 1257 * so things are as on target. */
diff --git a/firmware/export/config/agptekrocker.h b/firmware/export/config/agptekrocker.h
index a943ff4273..3d5565f1d9 100644
--- a/firmware/export/config/agptekrocker.h
+++ b/firmware/export/config/agptekrocker.h
@@ -75,8 +75,8 @@
75/* The number of bytes reserved for loadable plugins */ 75/* The number of bytes reserved for loadable plugins */
76#define PLUGIN_BUFFER_SIZE 0x100000 76#define PLUGIN_BUFFER_SIZE 0x100000
77 77
78/* Define this if you do software codec */ 78
79#define CONFIG_CODEC SWCODEC 79
80#define HAVE_ROCKER_CODEC 80#define HAVE_ROCKER_CODEC
81 81
82#define HAVE_HEADPHONE_DETECTION 82#define HAVE_HEADPHONE_DETECTION
diff --git a/firmware/export/config/android.h b/firmware/export/config/android.h
index 2aee700f08..fa95ade999 100644
--- a/firmware/export/config/android.h
+++ b/firmware/export/config/android.h
@@ -67,8 +67,8 @@
67 67
68#define AB_REPEAT_ENABLE 68#define AB_REPEAT_ENABLE
69 69
70/* Define this if you do software codec */ 70
71#define CONFIG_CODEC SWCODEC 71
72 72
73#define HAVE_MULTIMEDIA_KEYS 73#define HAVE_MULTIMEDIA_KEYS
74#define CONFIG_KEYPAD ANDROID_PAD 74#define CONFIG_KEYPAD ANDROID_PAD
diff --git a/firmware/export/config/cowond2.h b/firmware/export/config/cowond2.h
index 167f1125a1..f0e117dd7a 100644
--- a/firmware/export/config/cowond2.h
+++ b/firmware/export/config/cowond2.h
@@ -107,8 +107,8 @@
107 107
108#define AB_REPEAT_ENABLE 108#define AB_REPEAT_ENABLE
109 109
110/* Define this if you do software codec */ 110
111#define CONFIG_CODEC SWCODEC 111
112 112
113/* The D2 uses a WM8985 codec */ 113/* The D2 uses a WM8985 codec */
114#define HAVE_WM8985 114#define HAVE_WM8985
diff --git a/firmware/export/config/creativezen.h b/firmware/export/config/creativezen.h
index 0033b7d4eb..234556dd23 100644
--- a/firmware/export/config/creativezen.h
+++ b/firmware/export/config/creativezen.h
@@ -89,8 +89,8 @@
89/* Define this to enable morse code input */ 89/* Define this to enable morse code input */
90#define HAVE_MORSE_INPUT 90#define HAVE_MORSE_INPUT
91 91
92/* Define this if you do software codec */ 92
93#define CONFIG_CODEC SWCODEC 93
94 94
95/* LCD dimensions */ 95/* LCD dimensions */
96#define LCD_WIDTH 320 96#define LCD_WIDTH 320
diff --git a/firmware/export/config/creativezenmozaic.h b/firmware/export/config/creativezenmozaic.h
index 3a95d0388a..c8397f26bb 100644
--- a/firmware/export/config/creativezenmozaic.h
+++ b/firmware/export/config/creativezenmozaic.h
@@ -90,8 +90,8 @@
90/* Define this to enable morse code input */ 90/* Define this to enable morse code input */
91#define HAVE_MORSE_INPUT 91#define HAVE_MORSE_INPUT
92 92
93/* Define this if you do software codec */ 93
94#define CONFIG_CODEC SWCODEC 94
95 95
96/* LCD dimensions */ 96/* LCD dimensions */
97#define LCD_WIDTH 128 97#define LCD_WIDTH 128
diff --git a/firmware/export/config/creativezenv.h b/firmware/export/config/creativezenv.h
index 3e9be8ba29..fcdc39242f 100644
--- a/firmware/export/config/creativezenv.h
+++ b/firmware/export/config/creativezenv.h
@@ -87,8 +87,8 @@
87/* Define this to enable morse code input */ 87/* Define this to enable morse code input */
88#define HAVE_MORSE_INPUT 88#define HAVE_MORSE_INPUT
89 89
90/* Define this if you do software codec */ 90
91#define CONFIG_CODEC SWCODEC 91
92 92
93/* LCD dimensions */ 93/* LCD dimensions */
94#define LCD_WIDTH 132 94#define LCD_WIDTH 132
diff --git a/firmware/export/config/creativezenxfi.h b/firmware/export/config/creativezenxfi.h
index 35bd1efdfb..2eb747687a 100644
--- a/firmware/export/config/creativezenxfi.h
+++ b/firmware/export/config/creativezenxfi.h
@@ -94,8 +94,8 @@
94/* Define this to enable morse code input */ 94/* Define this to enable morse code input */
95#define HAVE_MORSE_INPUT 95#define HAVE_MORSE_INPUT
96 96
97/* Define this if you do software codec */ 97
98#define CONFIG_CODEC SWCODEC 98
99 99
100/* LCD dimensions */ 100/* LCD dimensions */
101#define LCD_WIDTH 320 101#define LCD_WIDTH 320
diff --git a/firmware/export/config/creativezenxfi2.h b/firmware/export/config/creativezenxfi2.h
index 3945311e29..9e5c748cd9 100644
--- a/firmware/export/config/creativezenxfi2.h
+++ b/firmware/export/config/creativezenxfi2.h
@@ -97,8 +97,8 @@
97/* Define this to enable morse code input */ 97/* Define this to enable morse code input */
98#define HAVE_MORSE_INPUT 98#define HAVE_MORSE_INPUT
99 99
100/* Define this if you do software codec */ 100
101#define CONFIG_CODEC SWCODEC 101
102 102
103/* LCD dimensions */ 103/* LCD dimensions */
104#define LCD_WIDTH 240 104#define LCD_WIDTH 240
diff --git a/firmware/export/config/creativezenxfi3.h b/firmware/export/config/creativezenxfi3.h
index d72b41d608..a3626800bd 100644
--- a/firmware/export/config/creativezenxfi3.h
+++ b/firmware/export/config/creativezenxfi3.h
@@ -97,8 +97,8 @@
97/* Define this to enable morse code input */ 97/* Define this to enable morse code input */
98#define HAVE_MORSE_INPUT 98#define HAVE_MORSE_INPUT
99 99
100/* Define this if you do software codec */ 100
101#define CONFIG_CODEC SWCODEC 101
102 102
103/* Define this if you have a speaker */ 103/* Define this if you have a speaker */
104#define HAVE_SPEAKER 104#define HAVE_SPEAKER
diff --git a/firmware/export/config/creativezenxfistyle.h b/firmware/export/config/creativezenxfistyle.h
index 0c6cd470e3..afb2b18db4 100644
--- a/firmware/export/config/creativezenxfistyle.h
+++ b/firmware/export/config/creativezenxfistyle.h
@@ -94,8 +94,8 @@
94/* Define this to enable morse code input */ 94/* Define this to enable morse code input */
95#define HAVE_MORSE_INPUT 95#define HAVE_MORSE_INPUT
96 96
97/* Define this if you do software codec */ 97
98#define CONFIG_CODEC SWCODEC 98
99 99
100/* LCD dimensions */ 100/* LCD dimensions */
101#define LCD_WIDTH 320 101#define LCD_WIDTH 320
diff --git a/firmware/export/config/creativezv.h b/firmware/export/config/creativezv.h
index ce812d38c9..a38c72afaa 100644
--- a/firmware/export/config/creativezv.h
+++ b/firmware/export/config/creativezv.h
@@ -80,8 +80,8 @@
80/* Define this to enable morse code input */ 80/* Define this to enable morse code input */
81#define HAVE_MORSE_INPUT 81#define HAVE_MORSE_INPUT
82 82
83/* Define this if you do software codec */ 83
84#define CONFIG_CODEC SWCODEC 84
85 85
86/* define this if you have a real-time clock */ 86/* define this if you have a real-time clock */
87//#define CONFIG_RTC RTC_RX5X348AB 87//#define CONFIG_RTC RTC_RX5X348AB
diff --git a/firmware/export/config/gigabeatfx.h b/firmware/export/config/gigabeatfx.h
index c9e20ad8a7..2382cb9d43 100644
--- a/firmware/export/config/gigabeatfx.h
+++ b/firmware/export/config/gigabeatfx.h
@@ -69,8 +69,8 @@
69/* Define this to enable morse code input */ 69/* Define this to enable morse code input */
70#define HAVE_MORSE_INPUT 70#define HAVE_MORSE_INPUT
71 71
72/* Define this if you do software codec */ 72
73#define CONFIG_CODEC SWCODEC 73
74 74
75/* define this if you have a real-time clock */ 75/* define this if you have a real-time clock */
76#define CONFIG_RTC RTC_S3C2440 76#define CONFIG_RTC RTC_S3C2440
diff --git a/firmware/export/config/gigabeats.h b/firmware/export/config/gigabeats.h
index 928e8c0e60..1a60fff38f 100644
--- a/firmware/export/config/gigabeats.h
+++ b/firmware/export/config/gigabeats.h
@@ -59,8 +59,8 @@
59/* Define this to enable morse code input */ 59/* Define this to enable morse code input */
60#define HAVE_MORSE_INPUT 60#define HAVE_MORSE_INPUT
61 61
62/* Define this if you do software codec */ 62
63#define CONFIG_CODEC SWCODEC 63
64 64
65/* define this if you have a real-time clock */ 65/* define this if you have a real-time clock */
66#define CONFIG_RTC RTC_MC13783 66#define CONFIG_RTC RTC_MC13783
diff --git a/firmware/export/config/gogearhdd1630.h b/firmware/export/config/gogearhdd1630.h
index 773d3fe158..4a4f7b10d4 100644
--- a/firmware/export/config/gogearhdd1630.h
+++ b/firmware/export/config/gogearhdd1630.h
@@ -85,8 +85,8 @@
85/* define this if the target has volume keys which can be used in the lists */ 85/* define this if the target has volume keys which can be used in the lists */
86#define HAVE_VOLUME_IN_LIST 86#define HAVE_VOLUME_IN_LIST
87 87
88/* Define this if you do software codec */ 88
89#define CONFIG_CODEC SWCODEC 89
90 90
91/* define this if you have a real-time clock. The HDD16x0 has a PCF8563 RTC, 91/* define this if you have a real-time clock. The HDD16x0 has a PCF8563 RTC,
92 but it's register compatible with the E8564. */ 92 but it's register compatible with the E8564. */
diff --git a/firmware/export/config/gogearhdd6330.h b/firmware/export/config/gogearhdd6330.h
index 3f89240a48..921ca637f2 100644
--- a/firmware/export/config/gogearhdd6330.h
+++ b/firmware/export/config/gogearhdd6330.h
@@ -85,8 +85,8 @@
85/* define this if the target has volume keys which can be used in the lists */ 85/* define this if the target has volume keys which can be used in the lists */
86#define HAVE_VOLUME_IN_LIST 86#define HAVE_VOLUME_IN_LIST
87 87
88/* Define this if you do software codec */ 88
89#define CONFIG_CODEC SWCODEC 89
90 90
91/* define this if you have a real-time clock. The HDD16x0 has a PCF8563 RTC, 91/* define this if you have a real-time clock. The HDD16x0 has a PCF8563 RTC,
92 but it's register compatible with the E8564. */ 92 but it's register compatible with the E8564. */
diff --git a/firmware/export/config/gogearsa9200.h b/firmware/export/config/gogearsa9200.h
index f0487fcbb3..c1aeb527cd 100644
--- a/firmware/export/config/gogearsa9200.h
+++ b/firmware/export/config/gogearsa9200.h
@@ -68,8 +68,8 @@
68/* define this if the target has volume keys which can be used in the lists */ 68/* define this if the target has volume keys which can be used in the lists */
69#define HAVE_VOLUME_IN_LIST 69#define HAVE_VOLUME_IN_LIST
70 70
71/* Define this if you do software codec */ 71
72#define CONFIG_CODEC SWCODEC 72
73 73
74/* There is no hardware tone control */ 74/* There is no hardware tone control */
75#define HAVE_SW_TONE_CONTROLS 75#define HAVE_SW_TONE_CONTROLS
diff --git a/firmware/export/config/hifietma8.h b/firmware/export/config/hifietma8.h
index 0cd63f9d14..48c4145c80 100644
--- a/firmware/export/config/hifietma8.h
+++ b/firmware/export/config/hifietma8.h
@@ -75,8 +75,8 @@
75/* Define this to enable morse code input */ 75/* Define this to enable morse code input */
76#define HAVE_MORSE_INPUT 76#define HAVE_MORSE_INPUT
77 77
78/* Define this if you do software codec */ 78
79#define CONFIG_CODEC SWCODEC 79
80 80
81#define CONFIG_LCD LCD_ILI9342 81#define CONFIG_LCD LCD_ILI9342
82 82
diff --git a/firmware/export/config/hifietma8c.h b/firmware/export/config/hifietma8c.h
index 0fc93ab61f..72b5ea7ee4 100644
--- a/firmware/export/config/hifietma8c.h
+++ b/firmware/export/config/hifietma8c.h
@@ -75,8 +75,8 @@
75/* Define this to enable morse code input */ 75/* Define this to enable morse code input */
76#define HAVE_MORSE_INPUT 76#define HAVE_MORSE_INPUT
77 77
78/* Define this if you do software codec */ 78
79#define CONFIG_CODEC SWCODEC 79
80 80
81#define CONFIG_LCD LCD_ILI9342C 81#define CONFIG_LCD LCD_ILI9342C
82 82
diff --git a/firmware/export/config/hifietma9.h b/firmware/export/config/hifietma9.h
index c7a206f0f4..6b96afde08 100644
--- a/firmware/export/config/hifietma9.h
+++ b/firmware/export/config/hifietma9.h
@@ -75,8 +75,8 @@
75/* Define this to enable morse code input */ 75/* Define this to enable morse code input */
76#define HAVE_MORSE_INPUT 76#define HAVE_MORSE_INPUT
77 77
78/* Define this if you do software codec */ 78
79#define CONFIG_CODEC SWCODEC 79
80 80
81#define CONFIG_LCD LCD_ILI9342 81#define CONFIG_LCD LCD_ILI9342
82 82
diff --git a/firmware/export/config/hifietma9c.h b/firmware/export/config/hifietma9c.h
index ff312aa94f..5bdb28cd6e 100644
--- a/firmware/export/config/hifietma9c.h
+++ b/firmware/export/config/hifietma9c.h
@@ -75,8 +75,8 @@
75/* Define this to enable morse code input */ 75/* Define this to enable morse code input */
76#define HAVE_MORSE_INPUT 76#define HAVE_MORSE_INPUT
77 77
78/* Define this if you do software codec */ 78
79#define CONFIG_CODEC SWCODEC 79
80 80
81#define CONFIG_LCD LCD_ILI9342C 81#define CONFIG_LCD LCD_ILI9342C
82 82
diff --git a/firmware/export/config/hifimanhm60x.h b/firmware/export/config/hifimanhm60x.h
index 9cb9713bc8..fc718ba935 100644
--- a/firmware/export/config/hifimanhm60x.h
+++ b/firmware/export/config/hifimanhm60x.h
@@ -90,8 +90,8 @@
90/* Define this to enable morse code input */ 90/* Define this to enable morse code input */
91#define HAVE_MORSE_INPUT 91#define HAVE_MORSE_INPUT
92 92
93/* Define this if you do software codec */ 93
94#define CONFIG_CODEC SWCODEC 94
95 95
96/* define this if you have a real-time clock */ 96/* define this if you have a real-time clock */
97/* #define CONFIG_RTC RTC_NANO2G */ 97/* #define CONFIG_RTC RTC_NANO2G */
diff --git a/firmware/export/config/hifimanhm801.h b/firmware/export/config/hifimanhm801.h
index 023b532e3c..049c4a40b5 100644
--- a/firmware/export/config/hifimanhm801.h
+++ b/firmware/export/config/hifimanhm801.h
@@ -87,8 +87,8 @@
87/* Define this to enable morse code input */ 87/* Define this to enable morse code input */
88#define HAVE_MORSE_INPUT 88#define HAVE_MORSE_INPUT
89 89
90/* Define this if you do software codec */ 90
91#define CONFIG_CODEC SWCODEC 91
92 92
93#define CONFIG_LCD LCD_HX8340B 93#define CONFIG_LCD LCD_HX8340B
94 94
diff --git a/firmware/export/config/iaudio7.h b/firmware/export/config/iaudio7.h
index 8d03e04be2..0cc8b19787 100644
--- a/firmware/export/config/iaudio7.h
+++ b/firmware/export/config/iaudio7.h
@@ -107,8 +107,8 @@
107 107
108#define AB_REPEAT_ENABLE 108#define AB_REPEAT_ENABLE
109 109
110/* Define this if you do software codec */ 110
111#define CONFIG_CODEC SWCODEC 111
112 112
113/* The iaudio7 uses built-in WM8731 codec */ 113/* The iaudio7 uses built-in WM8731 codec */
114#define HAVE_WM8731 114#define HAVE_WM8731
diff --git a/firmware/export/config/iaudiom3.h b/firmware/export/config/iaudiom3.h
index 8dd7396ca3..06ada6b8d5 100644
--- a/firmware/export/config/iaudiom3.h
+++ b/firmware/export/config/iaudiom3.h
@@ -73,8 +73,8 @@
73#define AB_REPEAT_ENABLE 73#define AB_REPEAT_ENABLE
74#define ACTION_WPSAB_SINGLE ACTION_WPS_BROWSE 74#define ACTION_WPSAB_SINGLE ACTION_WPS_BROWSE
75 75
76/* Define this if you do software codec */ 76
77#define CONFIG_CODEC SWCODEC 77
78 78
79/* define this if you have a real-time clock */ 79/* define this if you have a real-time clock */
80/* #define CONFIG_RTC FIXME: most probably none */ 80/* #define CONFIG_RTC FIXME: most probably none */
diff --git a/firmware/export/config/iaudiom5.h b/firmware/export/config/iaudiom5.h
index 19c77ceb2d..9619fd36bb 100644
--- a/firmware/export/config/iaudiom5.h
+++ b/firmware/export/config/iaudiom5.h
@@ -92,8 +92,8 @@
92#define AB_REPEAT_ENABLE 92#define AB_REPEAT_ENABLE
93#define ACTION_WPSAB_SINGLE ACTION_WPS_BROWSE 93#define ACTION_WPSAB_SINGLE ACTION_WPS_BROWSE
94 94
95/* Define this if you do software codec */ 95
96#define CONFIG_CODEC SWCODEC 96
97 97
98/* define this if you have a real-time clock */ 98/* define this if you have a real-time clock */
99#define CONFIG_RTC RTC_PCF50606 99#define CONFIG_RTC RTC_PCF50606
diff --git a/firmware/export/config/iaudiox5.h b/firmware/export/config/iaudiox5.h
index d74c4472e9..0b520bf12c 100644
--- a/firmware/export/config/iaudiox5.h
+++ b/firmware/export/config/iaudiox5.h
@@ -94,8 +94,8 @@
94#define AB_REPEAT_ENABLE 94#define AB_REPEAT_ENABLE
95#define ACTION_WPSAB_SINGLE ACTION_WPS_BROWSE 95#define ACTION_WPSAB_SINGLE ACTION_WPS_BROWSE
96 96
97/* Define this if you do software codec */ 97
98#define CONFIG_CODEC SWCODEC 98
99 99
100/* define this if you have a real-time clock */ 100/* define this if you have a real-time clock */
101#define CONFIG_RTC RTC_PCF50606 101#define CONFIG_RTC RTC_PCF50606
diff --git a/firmware/export/config/ibassodx50.h b/firmware/export/config/ibassodx50.h
index e26d43c4a7..9ebad8b120 100644
--- a/firmware/export/config/ibassodx50.h
+++ b/firmware/export/config/ibassodx50.h
@@ -95,8 +95,8 @@
95/* Which backlight fading type? */ 95/* Which backlight fading type? */
96#define CONFIG_BACKLIGHT_FADING BACKLIGHT_FADING_SW_SETTING 96#define CONFIG_BACKLIGHT_FADING BACKLIGHT_FADING_SW_SETTING
97 97
98/* Define this if you do software codec */ 98
99#define CONFIG_CODEC SWCODEC 99
100#define HAVE_SW_TONE_CONTROLS 100#define HAVE_SW_TONE_CONTROLS
101#define HAVE_SW_VOLUME_CONTROL 101#define HAVE_SW_VOLUME_CONTROL
102#define HW_SAMPR_CAPS SAMPR_CAP_ALL 102#define HW_SAMPR_CAPS SAMPR_CAP_ALL
diff --git a/firmware/export/config/ibassodx90.h b/firmware/export/config/ibassodx90.h
index 6de06d9e27..7f8b3725c8 100644
--- a/firmware/export/config/ibassodx90.h
+++ b/firmware/export/config/ibassodx90.h
@@ -94,8 +94,8 @@
94/* Which backlight fading type? */ 94/* Which backlight fading type? */
95#define CONFIG_BACKLIGHT_FADING BACKLIGHT_FADING_SW_SETTING 95#define CONFIG_BACKLIGHT_FADING BACKLIGHT_FADING_SW_SETTING
96 96
97/* Define this if you do software codec */ 97
98#define CONFIG_CODEC SWCODEC 98
99#define HAVE_SW_TONE_CONTROLS 99#define HAVE_SW_TONE_CONTROLS
100#define HAVE_SW_VOLUME_CONTROL 100#define HAVE_SW_VOLUME_CONTROL
101#define HW_SAMPR_CAPS SAMPR_CAP_ALL 101#define HW_SAMPR_CAPS SAMPR_CAP_ALL
diff --git a/firmware/export/config/ihifi760.h b/firmware/export/config/ihifi760.h
index 3e6d3e8449..06ed3640a3 100644
--- a/firmware/export/config/ihifi760.h
+++ b/firmware/export/config/ihifi760.h
@@ -90,8 +90,8 @@
90/* Define this to enable morse code input */ 90/* Define this to enable morse code input */
91#define HAVE_MORSE_INPUT 91#define HAVE_MORSE_INPUT
92 92
93/* Define this if you do software codec */ 93
94#define CONFIG_CODEC SWCODEC 94
95 95
96/* define this if you have a real-time clock */ 96/* define this if you have a real-time clock */
97/* #define CONFIG_RTC RTC_NANO2G */ 97/* #define CONFIG_RTC RTC_NANO2G */
diff --git a/firmware/export/config/ihifi770.h b/firmware/export/config/ihifi770.h
index 5215b2f637..f2c28bee2d 100644
--- a/firmware/export/config/ihifi770.h
+++ b/firmware/export/config/ihifi770.h
@@ -91,8 +91,8 @@
91/* Define this if a programmable hotkey is mapped */ 91/* Define this if a programmable hotkey is mapped */
92/* #define HAVE_HOTKEY */ 92/* #define HAVE_HOTKEY */
93 93
94/* Define this if you do software codec */ 94
95#define CONFIG_CODEC SWCODEC 95
96 96
97/* define this if you have a real-time clock */ 97/* define this if you have a real-time clock */
98/* #define CONFIG_RTC RTC_NANO2G */ 98/* #define CONFIG_RTC RTC_NANO2G */
diff --git a/firmware/export/config/ihifi770c.h b/firmware/export/config/ihifi770c.h
index 41081dc0e8..589ef44046 100644
--- a/firmware/export/config/ihifi770c.h
+++ b/firmware/export/config/ihifi770c.h
@@ -91,8 +91,8 @@
91/* Define this if a programmable hotkey is mapped */ 91/* Define this if a programmable hotkey is mapped */
92/* #define HAVE_HOTKEY */ 92/* #define HAVE_HOTKEY */
93 93
94/* Define this if you do software codec */ 94
95#define CONFIG_CODEC SWCODEC 95
96 96
97/* define this if you have a real-time clock */ 97/* define this if you have a real-time clock */
98/* #define CONFIG_RTC RTC_NANO2G */ 98/* #define CONFIG_RTC RTC_NANO2G */
diff --git a/firmware/export/config/ihifi800.h b/firmware/export/config/ihifi800.h
index 63ae764e14..9ee488111c 100644
--- a/firmware/export/config/ihifi800.h
+++ b/firmware/export/config/ihifi800.h
@@ -91,8 +91,8 @@
91/* Define this if a programmable hotkey is mapped */ 91/* Define this if a programmable hotkey is mapped */
92/* #define HAVE_HOTKEY */ 92/* #define HAVE_HOTKEY */
93 93
94/* Define this if you do software codec */ 94
95#define CONFIG_CODEC SWCODEC 95
96 96
97/* define this if you have a real-time clock */ 97/* define this if you have a real-time clock */
98/* #define CONFIG_RTC RTC_NANO2G */ 98/* #define CONFIG_RTC RTC_NANO2G */
diff --git a/firmware/export/config/ihifi960.h b/firmware/export/config/ihifi960.h
index 99c1fcd5b1..9b0c1fe7e2 100644
--- a/firmware/export/config/ihifi960.h
+++ b/firmware/export/config/ihifi960.h
@@ -90,8 +90,8 @@
90/* Define this to enable morse code input */ 90/* Define this to enable morse code input */
91#define HAVE_MORSE_INPUT 91#define HAVE_MORSE_INPUT
92 92
93/* Define this if you do software codec */ 93
94#define CONFIG_CODEC SWCODEC 94
95 95
96/* define this if you have a real-time clock */ 96/* define this if you have a real-time clock */
97/* #define CONFIG_RTC RTC_NANO2G */ 97/* #define CONFIG_RTC RTC_NANO2G */
diff --git a/firmware/export/config/ipod1g2g.h b/firmware/export/config/ipod1g2g.h
index 1d0fd5c9fb..5dfac2e0c3 100644
--- a/firmware/export/config/ipod1g2g.h
+++ b/firmware/export/config/ipod1g2g.h
@@ -92,8 +92,8 @@
92/* Define this to enable morse code input */ 92/* Define this to enable morse code input */
93#define HAVE_MORSE_INPUT 93#define HAVE_MORSE_INPUT
94 94
95/* Define this if you do software codec */ 95
96#define CONFIG_CODEC SWCODEC 96
97 97
98/* Define this if you have a software controlled poweroff */ 98/* Define this if you have a software controlled poweroff */
99#define HAVE_SW_POWEROFF 99#define HAVE_SW_POWEROFF
diff --git a/firmware/export/config/ipod3g.h b/firmware/export/config/ipod3g.h
index b34bd6547b..3914d9f654 100644
--- a/firmware/export/config/ipod3g.h
+++ b/firmware/export/config/ipod3g.h
@@ -92,8 +92,8 @@
92/* Define this to enable morse code input */ 92/* Define this to enable morse code input */
93#define HAVE_MORSE_INPUT 93#define HAVE_MORSE_INPUT
94 94
95/* Define this if you do software codec */ 95
96#define CONFIG_CODEC SWCODEC 96
97 97
98/* define this if you have a real-time clock */ 98/* define this if you have a real-time clock */
99#define CONFIG_RTC RTC_PCF50605 99#define CONFIG_RTC RTC_PCF50605
diff --git a/firmware/export/config/ipod4g.h b/firmware/export/config/ipod4g.h
index 785491a9ab..e838174701 100644
--- a/firmware/export/config/ipod4g.h
+++ b/firmware/export/config/ipod4g.h
@@ -84,8 +84,8 @@
84/* Define this to enable morse code input */ 84/* Define this to enable morse code input */
85#define HAVE_MORSE_INPUT 85#define HAVE_MORSE_INPUT
86 86
87/* Define this if you do software codec */ 87
88#define CONFIG_CODEC SWCODEC 88
89 89
90/* define this if you have a real-time clock */ 90/* define this if you have a real-time clock */
91#define CONFIG_RTC RTC_PCF50605 91#define CONFIG_RTC RTC_PCF50605
diff --git a/firmware/export/config/ipod6g.h b/firmware/export/config/ipod6g.h
index b4be39d935..d3c4805389 100644
--- a/firmware/export/config/ipod6g.h
+++ b/firmware/export/config/ipod6g.h
@@ -110,8 +110,8 @@
110/* Define this to enable morse code input */ 110/* Define this to enable morse code input */
111#define HAVE_MORSE_INPUT 111#define HAVE_MORSE_INPUT
112 112
113/* Define this if you do software codec */ 113
114#define CONFIG_CODEC SWCODEC 114
115 115
116/* define this if you have a real-time clock */ 116/* define this if you have a real-time clock */
117#define CONFIG_RTC RTC_NANO2G 117#define CONFIG_RTC RTC_NANO2G
diff --git a/firmware/export/config/ipodcolor.h b/firmware/export/config/ipodcolor.h
index 33533f925f..6292b97d58 100644
--- a/firmware/export/config/ipodcolor.h
+++ b/firmware/export/config/ipodcolor.h
@@ -71,8 +71,8 @@
71/* Define this to enable morse code input */ 71/* Define this to enable morse code input */
72#define HAVE_MORSE_INPUT 72#define HAVE_MORSE_INPUT
73 73
74/* Define this if you do software codec */ 74
75#define CONFIG_CODEC SWCODEC 75
76 76
77/* define this if you have a real-time clock */ 77/* define this if you have a real-time clock */
78#define CONFIG_RTC RTC_PCF50605 78#define CONFIG_RTC RTC_PCF50605
diff --git a/firmware/export/config/ipodmini1g.h b/firmware/export/config/ipodmini1g.h
index 4f9f1b3dd9..84481550f1 100644
--- a/firmware/export/config/ipodmini1g.h
+++ b/firmware/export/config/ipodmini1g.h
@@ -93,8 +93,8 @@
93/* Define this to enable morse code input */ 93/* Define this to enable morse code input */
94#define HAVE_MORSE_INPUT 94#define HAVE_MORSE_INPUT
95 95
96/* Define this if you do software codec */ 96
97#define CONFIG_CODEC SWCODEC 97
98 98
99/* define this if you have a real-time clock */ 99/* define this if you have a real-time clock */
100#define CONFIG_RTC RTC_PCF50605 100#define CONFIG_RTC RTC_PCF50605
diff --git a/firmware/export/config/ipodmini2g.h b/firmware/export/config/ipodmini2g.h
index 977eb3da3f..ffc566920d 100644
--- a/firmware/export/config/ipodmini2g.h
+++ b/firmware/export/config/ipodmini2g.h
@@ -85,8 +85,8 @@
85/* Define this to enable morse code input */ 85/* Define this to enable morse code input */
86#define HAVE_MORSE_INPUT 86#define HAVE_MORSE_INPUT
87 87
88/* Define this if you do software codec */ 88
89#define CONFIG_CODEC SWCODEC 89
90 90
91/* define this if you have a real-time clock */ 91/* define this if you have a real-time clock */
92#define CONFIG_RTC RTC_PCF50605 92#define CONFIG_RTC RTC_PCF50605
diff --git a/firmware/export/config/ipodnano1g.h b/firmware/export/config/ipodnano1g.h
index 81d4a0ae4c..8ca7544dbe 100644
--- a/firmware/export/config/ipodnano1g.h
+++ b/firmware/export/config/ipodnano1g.h
@@ -74,8 +74,8 @@
74/* Define this to enable morse code input */ 74/* Define this to enable morse code input */
75#define HAVE_MORSE_INPUT 75#define HAVE_MORSE_INPUT
76 76
77/* Define this if you do software codec */ 77
78#define CONFIG_CODEC SWCODEC 78
79 79
80/* define this if you have a real-time clock */ 80/* define this if you have a real-time clock */
81#define CONFIG_RTC RTC_PCF50605 81#define CONFIG_RTC RTC_PCF50605
diff --git a/firmware/export/config/ipodnano2g.h b/firmware/export/config/ipodnano2g.h
index 0693cedc14..362258a822 100644
--- a/firmware/export/config/ipodnano2g.h
+++ b/firmware/export/config/ipodnano2g.h
@@ -111,8 +111,8 @@
111/* Define this to enable morse code input */ 111/* Define this to enable morse code input */
112#define HAVE_MORSE_INPUT 112#define HAVE_MORSE_INPUT
113 113
114/* Define this if you do software codec */ 114
115#define CONFIG_CODEC SWCODEC 115
116 116
117/* define this if you have a real-time clock */ 117/* define this if you have a real-time clock */
118#define CONFIG_RTC RTC_NANO2G 118#define CONFIG_RTC RTC_NANO2G
diff --git a/firmware/export/config/ipodvideo.h b/firmware/export/config/ipodvideo.h
index 7f1d83f4a5..d48f7e3387 100644
--- a/firmware/export/config/ipodvideo.h
+++ b/firmware/export/config/ipodvideo.h
@@ -70,8 +70,8 @@
70/* Define this to enable morse code input */ 70/* Define this to enable morse code input */
71#define HAVE_MORSE_INPUT 71#define HAVE_MORSE_INPUT
72 72
73/* Define this if you do software codec */ 73
74#define CONFIG_CODEC SWCODEC 74
75 75
76/* define this if you have a real-time clock */ 76/* define this if you have a real-time clock */
77#define CONFIG_RTC RTC_PCF50605 77#define CONFIG_RTC RTC_PCF50605
diff --git a/firmware/export/config/iriverh10.h b/firmware/export/config/iriverh10.h
index efa0c993a1..ed3157020a 100644
--- a/firmware/export/config/iriverh10.h
+++ b/firmware/export/config/iriverh10.h
@@ -79,8 +79,8 @@
79/* Define this to enable morse code input */ 79/* Define this to enable morse code input */
80#define HAVE_MORSE_INPUT 80#define HAVE_MORSE_INPUT
81 81
82/* Define this if you do software codec */ 82
83#define CONFIG_CODEC SWCODEC 83
84 84
85/* define this if you have a real-time clock */ 85/* define this if you have a real-time clock */
86#ifndef BOOTLOADER 86#ifndef BOOTLOADER
diff --git a/firmware/export/config/iriverh100.h b/firmware/export/config/iriverh100.h
index 33d79cb194..798ee27f44 100644
--- a/firmware/export/config/iriverh100.h
+++ b/firmware/export/config/iriverh100.h
@@ -73,8 +73,8 @@
73/* Define this to enable morse code input */ 73/* Define this to enable morse code input */
74#define HAVE_MORSE_INPUT 74#define HAVE_MORSE_INPUT
75 75
76/* Define this if you do software codec */ 76
77#define CONFIG_CODEC SWCODEC 77
78 78
79/* Define this if you have an remote lcd */ 79/* Define this if you have an remote lcd */
80#define HAVE_REMOTE_LCD 80#define HAVE_REMOTE_LCD
diff --git a/firmware/export/config/iriverh10_5gb.h b/firmware/export/config/iriverh10_5gb.h
index 4d3c3f28b0..b75e834a1f 100644
--- a/firmware/export/config/iriverh10_5gb.h
+++ b/firmware/export/config/iriverh10_5gb.h
@@ -62,8 +62,8 @@
62/* Define this to enable morse code input */ 62/* Define this to enable morse code input */
63#define HAVE_MORSE_INPUT 63#define HAVE_MORSE_INPUT
64 64
65/* Define this if you do software codec */ 65
66#define CONFIG_CODEC SWCODEC 66
67 67
68/* define this if you have a real-time clock */ 68/* define this if you have a real-time clock */
69#ifndef BOOTLOADER 69#ifndef BOOTLOADER
diff --git a/firmware/export/config/iriverh120.h b/firmware/export/config/iriverh120.h
index 2c3a67330a..e1cfda768b 100644
--- a/firmware/export/config/iriverh120.h
+++ b/firmware/export/config/iriverh120.h
@@ -73,8 +73,8 @@
73/* Define this to enable morse code input */ 73/* Define this to enable morse code input */
74#define HAVE_MORSE_INPUT 74#define HAVE_MORSE_INPUT
75 75
76/* Define this if you do software codec */ 76
77#define CONFIG_CODEC SWCODEC 77
78 78
79/* define this if you have a disk storage, i.e. something 79/* define this if you have a disk storage, i.e. something
80 that needs spinups and can cause skips when shaked */ 80 that needs spinups and can cause skips when shaked */
diff --git a/firmware/export/config/iriverh300.h b/firmware/export/config/iriverh300.h
index 0be9d0da7a..15c5448aed 100644
--- a/firmware/export/config/iriverh300.h
+++ b/firmware/export/config/iriverh300.h
@@ -66,8 +66,8 @@
66/* Define this to enable morse code input */ 66/* Define this to enable morse code input */
67#define HAVE_MORSE_INPUT 67#define HAVE_MORSE_INPUT
68 68
69/* Define this if you do software codec */ 69
70#define CONFIG_CODEC SWCODEC 70
71 71
72/* define this if you have a real-time clock */ 72/* define this if you have a real-time clock */
73#define CONFIG_RTC RTC_PCF50606 73#define CONFIG_RTC RTC_PCF50606
diff --git a/firmware/export/config/iriverifp7xx.h b/firmware/export/config/iriverifp7xx.h
index db905c4674..cb48d9713d 100644
--- a/firmware/export/config/iriverifp7xx.h
+++ b/firmware/export/config/iriverifp7xx.h
@@ -41,8 +41,8 @@
41 41
42#define HAVE_FAT16SUPPORT 42#define HAVE_FAT16SUPPORT
43 43
44/* Define this if you do software codec */ 44
45#define CONFIG_CODEC SWCODEC 45
46 46
47/* Define this if you have a software controlled poweroff */ 47/* Define this if you have a software controlled poweroff */
48#define HAVE_SW_POWEROFF 48#define HAVE_SW_POWEROFF
diff --git a/firmware/export/config/logikdax.h b/firmware/export/config/logikdax.h
index 0168cd810b..5f35c6e725 100644
--- a/firmware/export/config/logikdax.h
+++ b/firmware/export/config/logikdax.h
@@ -80,8 +80,8 @@
80 80
81#define AB_REPEAT_ENABLE 81#define AB_REPEAT_ENABLE
82 82
83/* Define this if you do software codec */ 83
84#define CONFIG_CODEC SWCODEC 84
85 85
86/* The DAX uses built-in WM8731 codec */ 86/* The DAX uses built-in WM8731 codec */
87#define HAVE_WM8731 87#define HAVE_WM8731
diff --git a/firmware/export/config/lyreproto1.h b/firmware/export/config/lyreproto1.h
index 2ec1199acb..5281a4a864 100644
--- a/firmware/export/config/lyreproto1.h
+++ b/firmware/export/config/lyreproto1.h
@@ -61,8 +61,8 @@
61 61
62#define CONFIG_KEYPAD LYRE_PROTO1_PAD 62#define CONFIG_KEYPAD LYRE_PROTO1_PAD
63 63
64/* Define this if you do software codec */ 64
65#define CONFIG_CODEC SWCODEC 65
66 66
67/* The number of bytes reserved for loadable codecs */ 67/* The number of bytes reserved for loadable codecs */
68#define CODEC_SIZE 0x100000 68#define CODEC_SIZE 0x100000
diff --git a/firmware/export/config/meizum3.h b/firmware/export/config/meizum3.h
index 9c88db0621..161330d38f 100644
--- a/firmware/export/config/meizum3.h
+++ b/firmware/export/config/meizum3.h
@@ -77,8 +77,8 @@
77//#define AB_REPEAT_ENABLE 77//#define AB_REPEAT_ENABLE
78//#define ACTION_WPSAB_SINGLE ACTION_WPS_BROWSE 78//#define ACTION_WPSAB_SINGLE ACTION_WPS_BROWSE
79 79
80/* Define this if you do software codec */ 80
81#define CONFIG_CODEC SWCODEC 81
82 82
83/* define this if you have a real-time clock */ 83/* define this if you have a real-time clock */
84//#define CONFIG_RTC RTC_S5L8700 84//#define CONFIG_RTC RTC_S5L8700
diff --git a/firmware/export/config/meizum6sl.h b/firmware/export/config/meizum6sl.h
index 7d568f3319..267950b9e2 100644
--- a/firmware/export/config/meizum6sl.h
+++ b/firmware/export/config/meizum6sl.h
@@ -77,8 +77,8 @@
77//#define AB_REPEAT_ENABLE 77//#define AB_REPEAT_ENABLE
78//#define ACTION_WPSAB_SINGLE ACTION_WPS_BROWSE 78//#define ACTION_WPSAB_SINGLE ACTION_WPS_BROWSE
79 79
80/* Define this if you do software codec */ 80
81#define CONFIG_CODEC SWCODEC 81
82 82
83/* define this if you have a real-time clock */ 83/* define this if you have a real-time clock */
84#define CONFIG_RTC RTC_S5L8700 84#define CONFIG_RTC RTC_S5L8700
diff --git a/firmware/export/config/meizum6sp.h b/firmware/export/config/meizum6sp.h
index 35dd84c589..dc9e2f657e 100644
--- a/firmware/export/config/meizum6sp.h
+++ b/firmware/export/config/meizum6sp.h
@@ -83,8 +83,8 @@
83//#define AB_REPEAT_ENABLE 83//#define AB_REPEAT_ENABLE
84//#define ACTION_WPSAB_SINGLE ACTION_WPS_BROWSE 84//#define ACTION_WPSAB_SINGLE ACTION_WPS_BROWSE
85 85
86/* Define this if you do software codec */ 86
87#define CONFIG_CODEC SWCODEC 87
88 88
89/* define this if you have a real-time clock */ 89/* define this if you have a real-time clock */
90#define CONFIG_RTC RTC_S5L8700 90#define CONFIG_RTC RTC_S5L8700
diff --git a/firmware/export/config/mini2440.h b/firmware/export/config/mini2440.h
index b872b78f83..f78c101c80 100644
--- a/firmware/export/config/mini2440.h
+++ b/firmware/export/config/mini2440.h
@@ -114,8 +114,8 @@
114/* define this if you have a real-time clock */ 114/* define this if you have a real-time clock */
115#define CONFIG_RTC RTC_S3C2440 115#define CONFIG_RTC RTC_S3C2440
116 116
117/* Define this if you do software codec */ 117
118#define CONFIG_CODEC SWCODEC 118
119 119
120/* The number of bytes reserved for loadable codecs */ 120/* The number of bytes reserved for loadable codecs */
121#define CODEC_SIZE 0x100000 121#define CODEC_SIZE 0x100000
diff --git a/firmware/export/config/mpiohd200.h b/firmware/export/config/mpiohd200.h
index b6539e3a44..da2420b814 100644
--- a/firmware/export/config/mpiohd200.h
+++ b/firmware/export/config/mpiohd200.h
@@ -67,8 +67,8 @@
67 67
68#define CONFIG_KEYPAD MPIO_HD200_PAD 68#define CONFIG_KEYPAD MPIO_HD200_PAD
69 69
70/* Define this if you do software codec */ 70
71#define CONFIG_CODEC SWCODEC 71
72 72
73#define CONFIG_LCD LCD_TL0350A 73#define CONFIG_LCD LCD_TL0350A
74#define HAVE_LCD_SHUTDOWN 74#define HAVE_LCD_SHUTDOWN
diff --git a/firmware/export/config/mpiohd300.h b/firmware/export/config/mpiohd300.h
index 7858672301..bf0821e1a9 100644
--- a/firmware/export/config/mpiohd300.h
+++ b/firmware/export/config/mpiohd300.h
@@ -67,8 +67,8 @@
67 67
68#define CONFIG_KEYPAD MPIO_HD300_PAD 68#define CONFIG_KEYPAD MPIO_HD300_PAD
69 69
70/* Define this if you do software codec */ 70
71#define CONFIG_CODEC SWCODEC 71
72 72
73/* Define this if you have RTC */ 73/* Define this if you have RTC */
74#define CONFIG_RTC RTC_S35380A 74#define CONFIG_RTC RTC_S35380A
diff --git a/firmware/export/config/mrobe100.h b/firmware/export/config/mrobe100.h
index 5b6a489550..f2ecb5a6f0 100644
--- a/firmware/export/config/mrobe100.h
+++ b/firmware/export/config/mrobe100.h
@@ -67,8 +67,8 @@
67/* Define this to enable morse code input */ 67/* Define this to enable morse code input */
68#define HAVE_MORSE_INPUT 68#define HAVE_MORSE_INPUT
69 69
70/* Define this if you do software codec */ 70
71#define CONFIG_CODEC SWCODEC 71
72 72
73/* define this if you have a real-time clock */ 73/* define this if you have a real-time clock */
74#ifndef BOOTLOADER 74#ifndef BOOTLOADER
diff --git a/firmware/export/config/mrobe500.h b/firmware/export/config/mrobe500.h
index 32b4f7c99d..82a4ef28d1 100644
--- a/firmware/export/config/mrobe500.h
+++ b/firmware/export/config/mrobe500.h
@@ -143,8 +143,8 @@
143/* define this if the target has volume keys which can be used in the lists */ 143/* define this if the target has volume keys which can be used in the lists */
144#define HAVE_VOLUME_IN_LIST 144#define HAVE_VOLUME_IN_LIST
145 145
146/* Define this if you do software codec */ 146
147#define CONFIG_CODEC SWCODEC 147
148 148
149//#define HAVE_HARDWARE_BEEP 149//#define HAVE_HARDWARE_BEEP
150 150
diff --git a/firmware/export/config/nokian8xx.h b/firmware/export/config/nokian8xx.h
index 566683c760..4204fddf1d 100644
--- a/firmware/export/config/nokian8xx.h
+++ b/firmware/export/config/nokian8xx.h
@@ -57,8 +57,8 @@
57 57
58#define AB_REPEAT_ENABLE 58#define AB_REPEAT_ENABLE
59 59
60/* Define this if you do software codec */ 60
61#define CONFIG_CODEC SWCODEC 61
62 62
63/* Work around debug macro expansion of strncmp in scratchbox */ 63/* Work around debug macro expansion of strncmp in scratchbox */
64#define _HAVE_STRING_ARCH_strncmp 64#define _HAVE_STRING_ARCH_strncmp
diff --git a/firmware/export/config/nokian900.h b/firmware/export/config/nokian900.h
index c6d6eb8205..bf692af312 100644
--- a/firmware/export/config/nokian900.h
+++ b/firmware/export/config/nokian900.h
@@ -57,8 +57,8 @@
57 57
58#define AB_REPEAT_ENABLE 58#define AB_REPEAT_ENABLE
59 59
60/* Define this if you do software codec */ 60
61#define CONFIG_CODEC SWCODEC 61
62 62
63/* Work around debug macro expansion of strncmp in scratchbox */ 63/* Work around debug macro expansion of strncmp in scratchbox */
64#define _HAVE_STRING_ARCH_strncmp 64#define _HAVE_STRING_ARCH_strncmp
diff --git a/firmware/export/config/ondavx747.h b/firmware/export/config/ondavx747.h
index bf2c47e05c..e14edb3e37 100644
--- a/firmware/export/config/ondavx747.h
+++ b/firmware/export/config/ondavx747.h
@@ -87,8 +87,8 @@
87#define HAVE_TOUCHSCREEN 87#define HAVE_TOUCHSCREEN
88#define HAVE_BUTTON_DATA 88#define HAVE_BUTTON_DATA
89 89
90/* Define this if you do software codec */ 90
91#define CONFIG_CODEC SWCODEC 91
92 92
93/* define this if you have a real-time clock */ 93/* define this if you have a real-time clock */
94#define CONFIG_RTC RTC_JZ4740 94#define CONFIG_RTC RTC_JZ4740
diff --git a/firmware/export/config/ondavx767.h b/firmware/export/config/ondavx767.h
index 3718d202a2..dbad0b6a95 100644
--- a/firmware/export/config/ondavx767.h
+++ b/firmware/export/config/ondavx767.h
@@ -76,8 +76,8 @@
76 76
77#define CONFIG_KEYPAD ONDAVX767_PAD 77#define CONFIG_KEYPAD ONDAVX767_PAD
78 78
79/* Define this if you do software codec */ 79
80#define CONFIG_CODEC SWCODEC 80
81 81
82/* define this if you have a real-time clock */ 82/* define this if you have a real-time clock */
83#define CONFIG_RTC RTC_JZ4740 83#define CONFIG_RTC RTC_JZ4740
diff --git a/firmware/export/config/ondavx777.h b/firmware/export/config/ondavx777.h
index 17e3eda165..7225096237 100644
--- a/firmware/export/config/ondavx777.h
+++ b/firmware/export/config/ondavx777.h
@@ -81,8 +81,8 @@
81#define HAVE_TOUCHSCREEN 81#define HAVE_TOUCHSCREEN
82#define HAVE_BUTTON_DATA 82#define HAVE_BUTTON_DATA
83 83
84/* Define this if you do software codec */ 84
85#define CONFIG_CODEC SWCODEC 85
86 86
87/* define this if you have a real-time clock */ 87/* define this if you have a real-time clock */
88#define CONFIG_RTC RTC_JZ4740 88#define CONFIG_RTC RTC_JZ4740
diff --git a/firmware/export/config/pandora.h b/firmware/export/config/pandora.h
index bd11441dd7..27745073ec 100644
--- a/firmware/export/config/pandora.h
+++ b/firmware/export/config/pandora.h
@@ -57,8 +57,8 @@
57 57
58#define AB_REPEAT_ENABLE 58#define AB_REPEAT_ENABLE
59 59
60/* Define this if you do software codec */ 60
61#define CONFIG_CODEC SWCODEC 61
62 62
63/* Work around debug macro expansion of strncmp in scratchbox */ 63/* Work around debug macro expansion of strncmp in scratchbox */
64#define _HAVE_STRING_ARCH_strncmp 64#define _HAVE_STRING_ARCH_strncmp
diff --git a/firmware/export/config/rk27generic.h b/firmware/export/config/rk27generic.h
index 69cf9f3758..c116f17603 100644
--- a/firmware/export/config/rk27generic.h
+++ b/firmware/export/config/rk27generic.h
@@ -95,8 +95,8 @@
95/* Define this to enable morse code input */ 95/* Define this to enable morse code input */
96#define HAVE_MORSE_INPUT 96#define HAVE_MORSE_INPUT
97 97
98/* Define this if you do software codec */ 98
99#define CONFIG_CODEC SWCODEC 99
100 100
101/* define this if you have a real-time clock */ 101/* define this if you have a real-time clock */
102/* #define CONFIG_RTC RTC_NANO2G */ 102/* #define CONFIG_RTC RTC_NANO2G */
diff --git a/firmware/export/config/samsungyh820.h b/firmware/export/config/samsungyh820.h
index 51c829c70b..4980084a07 100644
--- a/firmware/export/config/samsungyh820.h
+++ b/firmware/export/config/samsungyh820.h
@@ -102,8 +102,8 @@
102/* Define this to enable morse code input */ 102/* Define this to enable morse code input */
103#define HAVE_MORSE_INPUT 103#define HAVE_MORSE_INPUT
104 104
105/* Define this if you do software codec */ 105
106#define CONFIG_CODEC SWCODEC 106
107 107
108/* define this if you have a disk storage, i.e. something 108/* define this if you have a disk storage, i.e. something
109 that needs spinups and can cause skips when shaked */ 109 that needs spinups and can cause skips when shaked */
diff --git a/firmware/export/config/samsungyh920.h b/firmware/export/config/samsungyh920.h
index 0f7060c02f..aaf93609b0 100644
--- a/firmware/export/config/samsungyh920.h
+++ b/firmware/export/config/samsungyh920.h
@@ -95,8 +95,8 @@
95/* Define this to enable morse code input */ 95/* Define this to enable morse code input */
96#define HAVE_MORSE_INPUT 96#define HAVE_MORSE_INPUT
97 97
98/* Define this if you do software codec */ 98
99#define CONFIG_CODEC SWCODEC 99
100 100
101/* define this if you have a real-time clock */ 101/* define this if you have a real-time clock */
102#ifndef BOOTLOADER 102#ifndef BOOTLOADER
diff --git a/firmware/export/config/samsungyh925.h b/firmware/export/config/samsungyh925.h
index 8c102d7fd1..10e9743f3a 100644
--- a/firmware/export/config/samsungyh925.h
+++ b/firmware/export/config/samsungyh925.h
@@ -92,8 +92,8 @@
92/* Define this to enable morse code input */ 92/* Define this to enable morse code input */
93#define HAVE_MORSE_INPUT 93#define HAVE_MORSE_INPUT
94 94
95/* Define this if you do software codec */ 95
96#define CONFIG_CODEC SWCODEC 96
97 97
98/* define this if you have a real-time clock */ 98/* define this if you have a real-time clock */
99#ifndef BOOTLOADER 99#ifndef BOOTLOADER
diff --git a/firmware/export/config/samsungypr0.h b/firmware/export/config/samsungypr0.h
index 212eaa8ec2..e9596fb9cc 100644
--- a/firmware/export/config/samsungypr0.h
+++ b/firmware/export/config/samsungypr0.h
@@ -84,8 +84,8 @@
84#define AB_REPEAT_ENABLE 84#define AB_REPEAT_ENABLE
85#define ACTION_WPSAB_SINGLE ACTION_WPS_HOTKEY 85#define ACTION_WPSAB_SINGLE ACTION_WPS_HOTKEY
86 86
87/* Define this if you do software codec */ 87
88#define CONFIG_CODEC SWCODEC 88
89 89
90/* R0 KeyPad configuration for plugins */ 90/* R0 KeyPad configuration for plugins */
91#define CONFIG_KEYPAD SAMSUNG_YPR0_PAD 91#define CONFIG_KEYPAD SAMSUNG_YPR0_PAD
diff --git a/firmware/export/config/samsungypr1.h b/firmware/export/config/samsungypr1.h
index 710cc3a3db..0021f81a52 100644
--- a/firmware/export/config/samsungypr1.h
+++ b/firmware/export/config/samsungypr1.h
@@ -89,8 +89,8 @@
89 89
90#define AB_REPEAT_ENABLE 90#define AB_REPEAT_ENABLE
91 91
92/* Define this if you do software codec */ 92
93#define CONFIG_CODEC SWCODEC 93
94 94
95/* R1 KeyPad configuration for plugins */ 95/* R1 KeyPad configuration for plugins */
96#define CONFIG_KEYPAD SAMSUNG_YPR1_PAD 96#define CONFIG_KEYPAD SAMSUNG_YPR1_PAD
diff --git a/firmware/export/config/samsungyps3.h b/firmware/export/config/samsungyps3.h
index 3843a3c08d..3707507f72 100644
--- a/firmware/export/config/samsungyps3.h
+++ b/firmware/export/config/samsungyps3.h
@@ -80,8 +80,8 @@
80//#define AB_REPEAT_ENABLE 80//#define AB_REPEAT_ENABLE
81//#define ACTION_WPSAB_SINGLE ACTION_WPS_BROWSE 81//#define ACTION_WPSAB_SINGLE ACTION_WPS_BROWSE
82 82
83/* Define this if you do software codec */ 83
84#define CONFIG_CODEC SWCODEC 84
85 85
86/* define this if you have a real-time clock */ 86/* define this if you have a real-time clock */
87#define CONFIG_RTC RTC_S35390A 87#define CONFIG_RTC RTC_S35390A
diff --git a/firmware/export/config/samsungypz5.h b/firmware/export/config/samsungypz5.h
index 882acc2a6c..8c013e7c29 100644
--- a/firmware/export/config/samsungypz5.h
+++ b/firmware/export/config/samsungypz5.h
@@ -94,8 +94,8 @@
94/* Define this to enable morse code input */ 94/* Define this to enable morse code input */
95#define HAVE_MORSE_INPUT 95#define HAVE_MORSE_INPUT
96 96
97/* Define this if you do software codec */ 97
98#define CONFIG_CODEC SWCODEC 98
99 99
100/* LCD dimensions */ 100/* LCD dimensions */
101#define LCD_WIDTH 128 101#define LCD_WIDTH 128
diff --git a/firmware/export/config/sansac100.h b/firmware/export/config/sansac100.h
index 109977ed06..7e984762d6 100644
--- a/firmware/export/config/sansac100.h
+++ b/firmware/export/config/sansac100.h
@@ -68,8 +68,8 @@
68 68
69#define AB_REPEAT_ENABLE 69#define AB_REPEAT_ENABLE
70 70
71/* Define this if you do software codec */ 71
72#define CONFIG_CODEC SWCODEC 72
73 73
74/* Define this if you have the TLV320 audio codec */ 74/* Define this if you have the TLV320 audio codec */
75#define HAVE_TLV320 75#define HAVE_TLV320
diff --git a/firmware/export/config/sansac200.h b/firmware/export/config/sansac200.h
index 4e8ea55002..1eed043b8c 100644
--- a/firmware/export/config/sansac200.h
+++ b/firmware/export/config/sansac200.h
@@ -84,8 +84,8 @@
84/* define this if the target has volume keys which can be used in the lists */ 84/* define this if the target has volume keys which can be used in the lists */
85#define HAVE_VOLUME_IN_LIST 85#define HAVE_VOLUME_IN_LIST
86 86
87/* Define this if you do software codec */ 87
88#define CONFIG_CODEC SWCODEC 88
89 89
90/* There is no hardware tone control */ 90/* There is no hardware tone control */
91#define HAVE_SW_TONE_CONTROLS 91#define HAVE_SW_TONE_CONTROLS
diff --git a/firmware/export/config/sansac200v2.h b/firmware/export/config/sansac200v2.h
index a51f9e3b00..e98b44d0e8 100644
--- a/firmware/export/config/sansac200v2.h
+++ b/firmware/export/config/sansac200v2.h
@@ -88,8 +88,8 @@
88/* define this if the target has volume keys which can be used in the lists */ 88/* define this if the target has volume keys which can be used in the lists */
89#define HAVE_VOLUME_IN_LIST 89#define HAVE_VOLUME_IN_LIST
90 90
91/* Define this if you do software codec */ 91
92#define CONFIG_CODEC SWCODEC 92
93 93
94/* There is no hardware tone control */ 94/* There is no hardware tone control */
95#define HAVE_SW_TONE_CONTROLS 95#define HAVE_SW_TONE_CONTROLS
diff --git a/firmware/export/config/sansaclip.h b/firmware/export/config/sansaclip.h
index 35496e5fda..70f66779a4 100644
--- a/firmware/export/config/sansaclip.h
+++ b/firmware/export/config/sansaclip.h
@@ -93,8 +93,8 @@
93/* define this if the target has volume keys which can be used in the lists */ 93/* define this if the target has volume keys which can be used in the lists */
94#define HAVE_VOLUME_IN_LIST 94#define HAVE_VOLUME_IN_LIST
95 95
96/* Define this if you do software codec */ 96
97#define CONFIG_CODEC SWCODEC 97
98/* There is no hardware tone control */ 98/* There is no hardware tone control */
99#define HAVE_SW_TONE_CONTROLS 99#define HAVE_SW_TONE_CONTROLS
100 100
diff --git a/firmware/export/config/sansaclipplus.h b/firmware/export/config/sansaclipplus.h
index 851884da36..54ffdb1071 100644
--- a/firmware/export/config/sansaclipplus.h
+++ b/firmware/export/config/sansaclipplus.h
@@ -103,8 +103,8 @@
103 103
104#define HAVE_GUI_BOOST 104#define HAVE_GUI_BOOST
105 105
106/* Define this if you do software codec */ 106
107#define CONFIG_CODEC SWCODEC 107
108/* There is no hardware tone control */ 108/* There is no hardware tone control */
109#define HAVE_SW_TONE_CONTROLS 109#define HAVE_SW_TONE_CONTROLS
110 110
diff --git a/firmware/export/config/sansaclipv2.h b/firmware/export/config/sansaclipv2.h
index 581f6e900f..04c2efacfa 100644
--- a/firmware/export/config/sansaclipv2.h
+++ b/firmware/export/config/sansaclipv2.h
@@ -97,8 +97,8 @@
97 97
98#define HAVE_GUI_BOOST 98#define HAVE_GUI_BOOST
99 99
100/* Define this if you do software codec */ 100
101#define CONFIG_CODEC SWCODEC 101
102/* There is no hardware tone control */ 102/* There is no hardware tone control */
103#define HAVE_SW_TONE_CONTROLS 103#define HAVE_SW_TONE_CONTROLS
104 104
diff --git a/firmware/export/config/sansaclipzip.h b/firmware/export/config/sansaclipzip.h
index 8c2e3404d4..9513b0074c 100644
--- a/firmware/export/config/sansaclipzip.h
+++ b/firmware/export/config/sansaclipzip.h
@@ -98,8 +98,8 @@
98 98
99#define HAVE_GUI_BOOST 99#define HAVE_GUI_BOOST
100 100
101/* Define this if you do software codec */ 101
102#define CONFIG_CODEC SWCODEC 102
103/* There is no hardware tone control */ 103/* There is no hardware tone control */
104#define HAVE_SW_TONE_CONTROLS 104#define HAVE_SW_TONE_CONTROLS
105 105
diff --git a/firmware/export/config/sansaconnect.h b/firmware/export/config/sansaconnect.h
index 9e6be6cbee..8ad4cab396 100644
--- a/firmware/export/config/sansaconnect.h
+++ b/firmware/export/config/sansaconnect.h
@@ -101,8 +101,8 @@
101 101
102#define HAVE_MORSE_INPUT 102#define HAVE_MORSE_INPUT
103 103
104/* Define this if you do software codec */ 104
105#define CONFIG_CODEC SWCODEC 105
106 106
107//#define HAVE_HARDWARE_BEEP 107//#define HAVE_HARDWARE_BEEP
108 108
diff --git a/firmware/export/config/sansae200.h b/firmware/export/config/sansae200.h
index db3ccb1c1c..af9baa3202 100644
--- a/firmware/export/config/sansae200.h
+++ b/firmware/export/config/sansae200.h
@@ -82,8 +82,8 @@
82/* Define this to enable morse code input */ 82/* Define this to enable morse code input */
83#define HAVE_MORSE_INPUT 83#define HAVE_MORSE_INPUT
84 84
85/* Define this if you do software codec */ 85
86#define CONFIG_CODEC SWCODEC 86
87/* There is no hardware tone control */ 87/* There is no hardware tone control */
88#define HAVE_SW_TONE_CONTROLS 88#define HAVE_SW_TONE_CONTROLS
89/* The PP5024 has a built-in AustriaMicrosystems AS3514 */ 89/* The PP5024 has a built-in AustriaMicrosystems AS3514 */
diff --git a/firmware/export/config/sansae200v2.h b/firmware/export/config/sansae200v2.h
index 96b51f4e12..604f51db23 100644
--- a/firmware/export/config/sansae200v2.h
+++ b/firmware/export/config/sansae200v2.h
@@ -84,8 +84,8 @@
84/* Define this to have CPU boosted while scrolling in the UI */ 84/* Define this to have CPU boosted while scrolling in the UI */
85#define HAVE_GUI_BOOST 85#define HAVE_GUI_BOOST
86 86
87/* Define this if you do software codec */ 87
88#define CONFIG_CODEC SWCODEC 88
89 89
90/* There is no hardware tone control */ 90/* There is no hardware tone control */
91#define HAVE_SW_TONE_CONTROLS 91#define HAVE_SW_TONE_CONTROLS
diff --git a/firmware/export/config/sansafuze.h b/firmware/export/config/sansafuze.h
index fae3463d75..e918cd888f 100644
--- a/firmware/export/config/sansafuze.h
+++ b/firmware/export/config/sansafuze.h
@@ -91,8 +91,8 @@
91/* Define this to enable morse code input */ 91/* Define this to enable morse code input */
92#define HAVE_MORSE_INPUT 92#define HAVE_MORSE_INPUT
93 93
94/* Define this if you do software codec */ 94
95#define CONFIG_CODEC SWCODEC 95
96 96
97 97
98/* LCD dimensions */ 98/* LCD dimensions */
diff --git a/firmware/export/config/sansafuzeplus.h b/firmware/export/config/sansafuzeplus.h
index 2a57619b06..bd587be11a 100644
--- a/firmware/export/config/sansafuzeplus.h
+++ b/firmware/export/config/sansafuzeplus.h
@@ -95,8 +95,8 @@
95/* Define this to enable morse code input */ 95/* Define this to enable morse code input */
96#define HAVE_MORSE_INPUT 96#define HAVE_MORSE_INPUT
97 97
98/* Define this if you do software codec */ 98
99#define CONFIG_CODEC SWCODEC 99
100 100
101/* LCD dimensions */ 101/* LCD dimensions */
102#define LCD_WIDTH 240 102#define LCD_WIDTH 240
diff --git a/firmware/export/config/sansafuzev2.h b/firmware/export/config/sansafuzev2.h
index b85e0747a3..1fa03cf6be 100644
--- a/firmware/export/config/sansafuzev2.h
+++ b/firmware/export/config/sansafuzev2.h
@@ -102,8 +102,8 @@
102/* Define this to enable morse code input */ 102/* Define this to enable morse code input */
103#define HAVE_MORSE_INPUT 103#define HAVE_MORSE_INPUT
104 104
105/* Define this if you do software codec */ 105
106#define CONFIG_CODEC SWCODEC 106
107 107
108 108
109/* LCD dimensions */ 109/* LCD dimensions */
diff --git a/firmware/export/config/sansam200.h b/firmware/export/config/sansam200.h
index fa4a129e26..044802550e 100644
--- a/firmware/export/config/sansam200.h
+++ b/firmware/export/config/sansam200.h
@@ -77,8 +77,8 @@
77 77
78#define AB_REPEAT_ENABLE 78#define AB_REPEAT_ENABLE
79 79
80/* Define this if you do software codec */ 80
81#define CONFIG_CODEC SWCODEC 81
82 82
83/* Define this if you have the TLV320 audio codec */ 83/* Define this if you have the TLV320 audio codec */
84#define HAVE_TLV320 84#define HAVE_TLV320
diff --git a/firmware/export/config/sansam200v4.h b/firmware/export/config/sansam200v4.h
index d905d10c95..7415ba7dae 100644
--- a/firmware/export/config/sansam200v4.h
+++ b/firmware/export/config/sansam200v4.h
@@ -92,8 +92,8 @@
92#define CONFIG_TUNER TEA5767 92#define CONFIG_TUNER TEA5767
93#define CONFIG_TUNER_XTAL 32768 93#define CONFIG_TUNER_XTAL 32768
94 94
95/* Define this if you do software codec */ 95
96#define CONFIG_CODEC SWCODEC 96
97 97
98/* Define this if you have the TLV320 audio codec */ 98/* Define this if you have the TLV320 audio codec */
99/*#define HAVE_TLV320*/ 99/*#define HAVE_TLV320*/
diff --git a/firmware/export/config/sansaview.h b/firmware/export/config/sansaview.h
index 21083da7cb..1057c5e817 100644
--- a/firmware/export/config/sansaview.h
+++ b/firmware/export/config/sansaview.h
@@ -71,8 +71,8 @@
71/* Define this to enable morse code input */ 71/* Define this to enable morse code input */
72#define HAVE_MORSE_INPUT 72#define HAVE_MORSE_INPUT
73 73
74/* Define this if you do software codec */ 74
75#define CONFIG_CODEC SWCODEC 75
76/* There is no hardware tone control */ 76/* There is no hardware tone control */
77/* #define HAVE_SW_TONE_CONTROLS*/ 77/* #define HAVE_SW_TONE_CONTROLS*/
78#define HAVE_WM8731 78#define HAVE_WM8731
diff --git a/firmware/export/config/sdlapp.h b/firmware/export/config/sdlapp.h
index 626bd5c99f..dde0b2783c 100644
--- a/firmware/export/config/sdlapp.h
+++ b/firmware/export/config/sdlapp.h
@@ -65,8 +65,8 @@
65 65
66#define AB_REPEAT_ENABLE 66#define AB_REPEAT_ENABLE
67 67
68/* Define this if you do software codec */ 68
69#define CONFIG_CODEC SWCODEC 69
70 70
71#define HAVE_SCROLLWHEEL 71#define HAVE_SCROLLWHEEL
72#define CONFIG_KEYPAD SDL_PAD 72#define CONFIG_KEYPAD SDL_PAD
diff --git a/firmware/export/config/sonynwze360.h b/firmware/export/config/sonynwze360.h
index a25e95d274..0049f13123 100644
--- a/firmware/export/config/sonynwze360.h
+++ b/firmware/export/config/sonynwze360.h
@@ -83,8 +83,8 @@
83/* Define this to enable morse code input */ 83/* Define this to enable morse code input */
84#define HAVE_MORSE_INPUT 84#define HAVE_MORSE_INPUT
85 85
86/* Define this if you do software codec */ 86
87#define CONFIG_CODEC SWCODEC 87
88 88
89/* LCD dimensions */ 89/* LCD dimensions */
90#define LCD_WIDTH 240 90#define LCD_WIDTH 240
diff --git a/firmware/export/config/sonynwze370.h b/firmware/export/config/sonynwze370.h
index 2ed87f2f1b..f0e6d08e0d 100644
--- a/firmware/export/config/sonynwze370.h
+++ b/firmware/export/config/sonynwze370.h
@@ -80,8 +80,8 @@
80/* Define this to enable morse code input */ 80/* Define this to enable morse code input */
81#define HAVE_MORSE_INPUT 81#define HAVE_MORSE_INPUT
82 82
83/* Define this if you do software codec */ 83
84#define CONFIG_CODEC SWCODEC 84
85 85
86/* LCD dimensions */ 86/* LCD dimensions */
87#define LCD_WIDTH 128 87#define LCD_WIDTH 128
diff --git a/firmware/export/config/sonynwzlinux.h b/firmware/export/config/sonynwzlinux.h
index 00b606b1e3..771cef57bb 100644
--- a/firmware/export/config/sonynwzlinux.h
+++ b/firmware/export/config/sonynwzlinux.h
@@ -59,8 +59,8 @@
59/* The number of bytes reserved for loadable plugins */ 59/* The number of bytes reserved for loadable plugins */
60#define PLUGIN_BUFFER_SIZE 0x100000 60#define PLUGIN_BUFFER_SIZE 0x100000
61 61
62/* Define this if you do software codec */ 62
63#define CONFIG_CODEC SWCODEC 63
64 64
65#define CONFIG_TUNER SI4700 65#define CONFIG_TUNER SI4700
66 66
diff --git a/firmware/export/config/tatungtpj1022.h b/firmware/export/config/tatungtpj1022.h
index 7c25039f9f..7f3b579c49 100644
--- a/firmware/export/config/tatungtpj1022.h
+++ b/firmware/export/config/tatungtpj1022.h
@@ -45,8 +45,8 @@
45 45
46#define CONFIG_KEYPAD TATUNG_TPJ1022_PAD 46#define CONFIG_KEYPAD TATUNG_TPJ1022_PAD
47 47
48/* Define this if you do software codec */ 48
49#define CONFIG_CODEC SWCODEC 49
50 50
51/* define this if you have a real-time clock */ 51/* define this if you have a real-time clock */
52#ifndef BOOTLOADER 52#ifndef BOOTLOADER
diff --git a/firmware/export/config/vibe500.h b/firmware/export/config/vibe500.h
index 8e61726434..0626fe1078 100644
--- a/firmware/export/config/vibe500.h
+++ b/firmware/export/config/vibe500.h
@@ -75,8 +75,8 @@
75/* Define this to enable morse code input */ 75/* Define this to enable morse code input */
76#define HAVE_MORSE_INPUT 76#define HAVE_MORSE_INPUT
77 77
78/* Define this if you do software codec */ 78
79#define CONFIG_CODEC SWCODEC 79
80 80
81/* define this if you have a real-time clock */ 81/* define this if you have a real-time clock */
82/* Philips 8563T - E8564 is a clone of it */ 82/* Philips 8563T - E8564 is a clone of it */
diff --git a/firmware/export/config/xduoox20.h b/firmware/export/config/xduoox20.h
index 018e32888f..b453e42a9c 100644
--- a/firmware/export/config/xduoox20.h
+++ b/firmware/export/config/xduoox20.h
@@ -72,8 +72,8 @@
72/* The number of bytes reserved for loadable plugins */ 72/* The number of bytes reserved for loadable plugins */
73#define PLUGIN_BUFFER_SIZE 0x100000 73#define PLUGIN_BUFFER_SIZE 0x100000
74 74
75/* Define this if you do software codec */ 75
76#define CONFIG_CODEC SWCODEC 76
77 77
78#define HAVE_HEADPHONE_DETECTION 78#define HAVE_HEADPHONE_DETECTION
79 79
diff --git a/firmware/export/config/xduoox3.h b/firmware/export/config/xduoox3.h
index 14f9369567..3d35555ebf 100644
--- a/firmware/export/config/xduoox3.h
+++ b/firmware/export/config/xduoox3.h
@@ -81,8 +81,8 @@
81/* Define this if a programmable hotkey is mapped */ 81/* Define this if a programmable hotkey is mapped */
82#define HAVE_HOTKEY 82#define HAVE_HOTKEY
83 83
84/* Define this if you do software codec */ 84
85#define CONFIG_CODEC SWCODEC 85
86 86
87#ifndef BOOTLOADER 87#ifndef BOOTLOADER
88/* define this if you have a real-time clock */ 88/* define this if you have a real-time clock */
diff --git a/firmware/export/config/xduoox3ii.h b/firmware/export/config/xduoox3ii.h
index 886d91dc0f..fb72532993 100644
--- a/firmware/export/config/xduoox3ii.h
+++ b/firmware/export/config/xduoox3ii.h
@@ -72,8 +72,8 @@
72/* The number of bytes reserved for loadable plugins */ 72/* The number of bytes reserved for loadable plugins */
73#define PLUGIN_BUFFER_SIZE 0x100000 73#define PLUGIN_BUFFER_SIZE 0x100000
74 74
75/* Define this if you do software codec */ 75
76#define CONFIG_CODEC SWCODEC 76
77 77
78#define HAVE_HEADPHONE_DETECTION 78#define HAVE_HEADPHONE_DETECTION
79 79
diff --git a/firmware/export/config/zenvisionm30gb.h b/firmware/export/config/zenvisionm30gb.h
index 6ce2876551..5fa5496b20 100644
--- a/firmware/export/config/zenvisionm30gb.h
+++ b/firmware/export/config/zenvisionm30gb.h
@@ -81,8 +81,8 @@
81/* Define this to enable morse code input */ 81/* Define this to enable morse code input */
82#define HAVE_MORSE_INPUT 82#define HAVE_MORSE_INPUT
83 83
84/* Define this if you do software codec */ 84
85#define CONFIG_CODEC SWCODEC 85
86 86
87/* define this if you have a real-time clock */ 87/* define this if you have a real-time clock */
88//#define CONFIG_RTC RTC_RX5X348AB 88//#define CONFIG_RTC RTC_RX5X348AB
diff --git a/firmware/export/config/zenvisionm60gb.h b/firmware/export/config/zenvisionm60gb.h
index 5510e9a338..23e92ddb0a 100644
--- a/firmware/export/config/zenvisionm60gb.h
+++ b/firmware/export/config/zenvisionm60gb.h
@@ -80,8 +80,8 @@
80/* Define this to enable morse code input */ 80/* Define this to enable morse code input */
81#define HAVE_MORSE_INPUT 81#define HAVE_MORSE_INPUT
82 82
83/* Define this if you do software codec */ 83
84#define CONFIG_CODEC SWCODEC 84
85 85
86/* define this if you have a real-time clock */ 86/* define this if you have a real-time clock */
87//#define CONFIG_RTC RTC_RX5X348AB 87//#define CONFIG_RTC RTC_RX5X348AB
diff --git a/firmware/export/general.h b/firmware/export/general.h
index 16c824086b..9762823998 100644
--- a/firmware/export/general.h
+++ b/firmware/export/general.h
@@ -26,7 +26,6 @@
26#include <stddef.h> 26#include <stddef.h>
27#include "config.h" 27#include "config.h"
28 28
29#if CONFIG_CODEC == SWCODEC
30/* round a signed/unsigned 32bit value to the closest of a list of values */ 29/* round a signed/unsigned 32bit value to the closest of a list of values */
31/* returns the index of the closest value */ 30/* returns the index of the closest value */
32int round_value_to_list32(unsigned long value, 31int round_value_to_list32(unsigned long value,
@@ -38,7 +37,6 @@ int make_list_from_caps32(unsigned long src_mask,
38 const unsigned long *src_list, 37 const unsigned long *src_list,
39 unsigned long caps_mask, 38 unsigned long caps_mask,
40 unsigned long *caps_list); 39 unsigned long *caps_list);
41#endif /* CONFIG_CODEC == SWCODEC */
42 40
43/* Create a filename with a number part in a way that the number is 1 41/* Create a filename with a number part in a way that the number is 1
44 * higher than the highest numbered file matching the same pattern. 42 * higher than the highest numbered file matching the same pattern.
diff --git a/firmware/export/mp3_playback.h b/firmware/export/mp3_playback.h
deleted file mode 100644
index 51efb45651..0000000000
--- a/firmware/export/mp3_playback.h
+++ /dev/null
@@ -1,51 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Code that has been in mpeg.c/h before, now creating an encapsulated play
11 * data module, to be used by other sources than file playback as well.
12 *
13 * Copyright (C) 2004 by Linus Nielsen Feltzing
14 *
15 * This program is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU General Public License
17 * as published by the Free Software Foundation; either version 2
18 * of the License, or (at your option) any later version.
19 *
20 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
21 * KIND, either express or implied.
22 *
23 ****************************************************************************/
24#ifndef _MP3_PLAYBACK_H_
25#define _MP3_PLAYBACK_H_
26
27#include <stdbool.h>
28
29/* callback fn */
30#ifndef MP3_PLAY_CALLBACK_DEFINED
31#define MP3_PLAY_CALLBACK_DEFINED
32typedef void (*mp3_play_callback_t)(const void **start, size_t* size);
33#endif
34
35/* functions formerly in mpeg.c */
36void mp3_init(int volume, int bass, int treble, int balance, int loudness,
37 int avc, int channel_config, int stereo_width,
38 int mdb_strength, int mdb_harmonics,
39 int mdb_center, int mdb_shape, bool mdb_enable,
40 bool superbass);
41
42void mp3_play_data(const void* start, size_t size,
43 mp3_play_callback_t get_more);
44void mp3_play_pause(bool play);
45bool mp3_pause_done(void);
46void mp3_play_stop(void);
47bool mp3_is_playing(void);
48unsigned char* mp3_get_pos(void);
49void mp3_shutdown(void);
50
51#endif /* #ifndef _MP3_PLAYBACK_H_ */
diff --git a/firmware/general.c b/firmware/general.c
index a4e7fba0f6..8508b34b88 100644
--- a/firmware/general.c
+++ b/firmware/general.c
@@ -31,7 +31,6 @@
31#include "time.h" 31#include "time.h"
32#include "timefuncs.h" 32#include "timefuncs.h"
33 33
34#if CONFIG_CODEC == SWCODEC
35int round_value_to_list32(unsigned long value, 34int round_value_to_list32(unsigned long value,
36 const unsigned long list[], 35 const unsigned long list[],
37 int count, 36 int count,
@@ -87,7 +86,6 @@ int make_list_from_caps32(unsigned long src_mask,
87 86
88 return count; 87 return count;
89} /* make_list_from_caps32 */ 88} /* make_list_from_caps32 */
90#endif /* CONFIG_CODEC == SWCODEC */
91 89
92/* Create a filename with a number part in a way that the number is 1 90/* Create a filename with a number part in a way that the number is 1
93 * higher than the highest numbered file matching the same pattern. 91 * higher than the highest numbered file matching the same pattern.
diff --git a/firmware/kernel/include/thread.h b/firmware/kernel/include/thread.h
index a4f338ed0c..75d13773c6 100644
--- a/firmware/kernel/include/thread.h
+++ b/firmware/kernel/include/thread.h
@@ -66,15 +66,11 @@
66#define IO_PRIORITY_IMMEDIATE 0 66#define IO_PRIORITY_IMMEDIATE 0
67#define IO_PRIORITY_BACKGROUND 32 67#define IO_PRIORITY_BACKGROUND 32
68 68
69#if CONFIG_CODEC == SWCODEC
70# ifdef HAVE_HARDWARE_CLICK 69# ifdef HAVE_HARDWARE_CLICK
71# define BASETHREADS 17 70# define BASETHREADS 17
72# else 71# else
73# define BASETHREADS 16 72# define BASETHREADS 16
74# endif 73# endif
75#else
76# define BASETHREADS 11
77#endif /* CONFIG_CODE == * */
78 74
79#ifndef TARGET_EXTRA_THREADS 75#ifndef TARGET_EXTRA_THREADS
80#define TARGET_EXTRA_THREADS 0 76#define TARGET_EXTRA_THREADS 0
diff --git a/firmware/powermgmt.c b/firmware/powermgmt.c
index 750f8d5ef4..ed979f83ce 100644
--- a/firmware/powermgmt.c
+++ b/firmware/powermgmt.c
@@ -31,7 +31,6 @@
31#include "storage.h" 31#include "storage.h"
32#include "power.h" 32#include "power.h"
33#include "audio.h" 33#include "audio.h"
34#include "mp3_playback.h"
35#include "usb.h" 34#include "usb.h"
36#include "powermgmt.h" 35#include "powermgmt.h"
37#include "backlight.h" 36#include "backlight.h"
@@ -770,11 +769,7 @@ void shutdown_hw(void)
770 storage_spindown(1); 769 storage_spindown(1);
771 } 770 }
772 771
773#if CONFIG_CODEC == SWCODEC
774 audiohw_close(); 772 audiohw_close();
775#else
776 mp3_shutdown();
777#endif
778 773
779 /* If HD is still active we try to wait for spindown, otherwise the 774 /* If HD is still active we try to wait for spindown, otherwise the
780 shutdown_timeout in power_thread_step will force a power off */ 775 shutdown_timeout in power_thread_step will force a power off */
diff --git a/firmware/target/hosted/maemo/pcm-gstreamer.c b/firmware/target/hosted/maemo/pcm-gstreamer.c
index 5bca6f2d92..bd264fe5d3 100644
--- a/firmware/target/hosted/maemo/pcm-gstreamer.c
+++ b/firmware/target/hosted/maemo/pcm-gstreamer.c
@@ -65,8 +65,6 @@
65extern bool debug_audio; 65extern bool debug_audio;
66#endif 66#endif
67 67
68#if CONFIG_CODEC == SWCODEC
69
70/* Declarations for libplayblack */ 68/* Declarations for libplayblack */
71pb_playback_t *playback = NULL; 69pb_playback_t *playback = NULL;
72void playback_state_req_handler(pb_playback_t *pb, 70void playback_state_req_handler(pb_playback_t *pb,
@@ -481,5 +479,3 @@ unsigned long spdif_measure_frequency(void)
481#endif 479#endif
482 480
483#endif /* HAVE_RECORDING */ 481#endif /* HAVE_RECORDING */
484
485#endif /* CONFIG_CODEC == SWCODEC */
diff --git a/firmware/target/hosted/sdl/pcm-sdl.c b/firmware/target/hosted/sdl/pcm-sdl.c
index 290dffbb95..9cb35beb48 100644
--- a/firmware/target/hosted/sdl/pcm-sdl.c
+++ b/firmware/target/hosted/sdl/pcm-sdl.c
@@ -51,7 +51,6 @@
51extern bool debug_audio; 51extern bool debug_audio;
52#endif 52#endif
53 53
54#if CONFIG_CODEC == SWCODEC
55static int cvt_status = -1; 54static int cvt_status = -1;
56 55
57static const void *pcm_data; 56static const void *pcm_data;
@@ -411,5 +410,3 @@ void pcm_play_dma_init(void)
411void pcm_play_dma_postinit(void) 410void pcm_play_dma_postinit(void)
412{ 411{
413} 412}
414
415#endif /* CONFIG_CODEC == SWCODEC */
diff --git a/lib/rbcodec/SOURCES b/lib/rbcodec/SOURCES
index 9180237632..c288bb6de4 100644
--- a/lib/rbcodec/SOURCES
+++ b/lib/rbcodec/SOURCES
@@ -2,7 +2,6 @@ metadata/metadata.c
2metadata/id3tags.c 2metadata/id3tags.c
3metadata/mp3.c 3metadata/mp3.c
4metadata/mp3data.c 4metadata/mp3data.c
5#if CONFIG_CODEC == SWCODEC
6dsp/channel_mode.c 5dsp/channel_mode.c
7dsp/compressor.c 6dsp/compressor.c
8dsp/crossfeed.c 7dsp/crossfeed.c
@@ -64,4 +63,3 @@ metadata/vox.c
64metadata/wave.c 63metadata/wave.c
65metadata/wavpack.c 64metadata/wavpack.c
66metadata/aac.c 65metadata/aac.c
67#endif
diff --git a/lib/rbcodec/codecs/codecs.h b/lib/rbcodec/codecs/codecs.h
index e04727fea8..6048e5012c 100644
--- a/lib/rbcodec/codecs/codecs.h
+++ b/lib/rbcodec/codecs/codecs.h
@@ -34,14 +34,12 @@
34#include "profile.h" 34#include "profile.h"
35#include "thread.h" 35#include "thread.h"
36#endif 36#endif
37#if (CONFIG_CODEC == SWCODEC)
38#ifdef HAVE_RECORDING 37#ifdef HAVE_RECORDING
39#include "enc_base.h" 38#include "enc_base.h"
40#endif 39#endif
41#include "dsp_core.h" 40#include "dsp_core.h"
42#include "dsp_misc.h" 41#include "dsp_misc.h"
43#include "dsp-util.h" 42#include "dsp-util.h"
44#endif
45 43
46#include "gcc_extensions.h" 44#include "gcc_extensions.h"
47#include "load_code.h" 45#include "load_code.h"
@@ -281,18 +279,18 @@ int codec_load_buf(int hid, struct codec_api *api);
281int codec_load_file(const char* codec, struct codec_api *api); 279int codec_load_file(const char* codec, struct codec_api *api);
282int codec_run_proc(void); 280int codec_run_proc(void);
283int codec_close(void); 281int codec_close(void);
284#if CONFIG_CODEC == SWCODEC && defined(HAVE_RECORDING) 282#if defined(HAVE_RECORDING)
285enc_callback_t codec_get_enc_callback(void); 283enc_callback_t codec_get_enc_callback(void);
286#else
287#define codec_get_enc_callback() NULL
288#endif 284#endif
289 285
290/* defined by the codec */ 286/* defined by the codec */
291enum codec_status codec_start(enum codec_entry_call_reason reason); 287enum codec_status codec_start(enum codec_entry_call_reason reason);
292enum codec_status codec_main(enum codec_entry_call_reason reason); 288enum codec_status codec_main(enum codec_entry_call_reason reason);
293enum codec_status codec_run(void); 289enum codec_status codec_run(void);
294#if CONFIG_CODEC == SWCODEC && defined(HAVE_RECORDING) 290#if defined(HAVE_RECORDING)
295int enc_callback(enum enc_callback_reason reason, void *params); 291int enc_callback(enum enc_callback_reason reason, void *params);
292#else
293#define codec_get_enc_callback() NULL
296#endif 294#endif
297 295
298#endif /* _CODECS_H_ */ 296#endif /* _CODECS_H_ */
diff --git a/lib/rbcodec/codecs/lib/SOURCES b/lib/rbcodec/codecs/lib/SOURCES
index f4b951a5eb..ffa7184019 100644
--- a/lib/rbcodec/codecs/lib/SOURCES
+++ b/lib/rbcodec/codecs/lib/SOURCES
@@ -1,4 +1,3 @@
1#if CONFIG_CODEC == SWCODEC /* software codec platforms */
2codeclib.c 1codeclib.c
3ffmpeg_bitstream.c 2ffmpeg_bitstream.c
4 3
@@ -6,6 +5,6 @@ mdct_lookup.c
6fft-ffmpeg.c 5fft-ffmpeg.c
7mdct.c 6mdct.c
8 7
9#elif (CONFIG_PLATFORM & PLATFORM_HOSTED) && defined(__APPLE__) 8#if (CONFIG_PLATFORM & PLATFORM_HOSTED) && defined(__APPLE__)
10osx.dummy.c 9osx.dummy.c
11#endif 10#endif
diff --git a/lib/rbcodec/metadata/id3tags.c b/lib/rbcodec/metadata/id3tags.c
index 84b3c593ef..c3a0473e7e 100644
--- a/lib/rbcodec/metadata/id3tags.c
+++ b/lib/rbcodec/metadata/id3tags.c
@@ -43,9 +43,7 @@
43 43
44#include "metadata.h" 44#include "metadata.h"
45#include "mp3data.h" 45#include "mp3data.h"
46#if CONFIG_CODEC == SWCODEC
47#include "metadata_common.h" 46#include "metadata_common.h"
48#endif
49#include "metadata_parsers.h" 47#include "metadata_parsers.h"
50#include "misc.h" 48#include "misc.h"
51 49
@@ -91,9 +89,6 @@ static const char* const genres[] = {
91 "Synthpop" 89 "Synthpop"
92}; 90};
93 91
94#if CONFIG_CODEC != SWCODEC
95static
96#endif
97char* id3_get_num_genre(unsigned int genre_num) 92char* id3_get_num_genre(unsigned int genre_num)
98{ 93{
99 if (genre_num < ARRAYLEN(genres)) 94 if (genre_num < ARRAYLEN(genres))
@@ -376,23 +371,20 @@ static int parseuser( struct mp3entry* entry, char* tag, int bufferpos )
376 /* At least part of the value was read, so we can safely try to 371 /* At least part of the value was read, so we can safely try to
377 * parse it */ 372 * parse it */
378 value = tag + desc_len + 1; 373 value = tag + desc_len + 1;
379 374
380 if (!strcasecmp(tag, "ALBUM ARTIST")) { 375 if (!strcasecmp(tag, "ALBUM ARTIST")) {
381 length = strlen(value) + 1; 376 length = strlen(value) + 1;
382 strlcpy(tag, value, length); 377 strlcpy(tag, value, length);
383 entry->albumartist = tag; 378 entry->albumartist = tag;
384#if CONFIG_CODEC == SWCODEC
385 } else { 379 } else {
386 /* Call parse_replaygain(). */ 380 /* Call parse_replaygain(). */
387 parse_replaygain(tag, value, entry); 381 parse_replaygain(tag, value, entry);
388#endif
389 } 382 }
390 } 383 }
391 384
392 return tag - entry->id3v2buf + length; 385 return tag - entry->id3v2buf + length;
393} 386}
394 387
395#if CONFIG_CODEC == SWCODEC
396/* parse RVA2 binary data and convert to replaygain information. */ 388/* parse RVA2 binary data and convert to replaygain information. */
397static int parserva2( struct mp3entry* entry, char* tag, int bufferpos) 389static int parserva2( struct mp3entry* entry, char* tag, int bufferpos)
398{ 390{
@@ -452,13 +444,12 @@ static int parserva2( struct mp3entry* entry, char* tag, int bufferpos)
452 return start_pos; 444 return start_pos;
453 } 445 }
454 } 446 }
455 447
456 parse_replaygain_int(album, gain, peak * 2, entry); 448 parse_replaygain_int(album, gain, peak * 2, entry);
457 } 449 }
458 450
459 return start_pos; 451 return start_pos;
460} 452}
461#endif
462 453
463static int parsembtid( struct mp3entry* entry, char* tag, int bufferpos ) 454static int parsembtid( struct mp3entry* entry, char* tag, int bufferpos )
464{ 455{
@@ -514,9 +505,7 @@ static const struct tag_resolver taglist[] = {
514 { "PIC", 3, 0, &parsealbumart, true }, 505 { "PIC", 3, 0, &parsealbumart, true },
515#endif 506#endif
516 { "TXXX", 4, 0, &parseuser, false }, 507 { "TXXX", 4, 0, &parseuser, false },
517#if CONFIG_CODEC == SWCODEC
518 { "RVA2", 4, 0, &parserva2, true }, 508 { "RVA2", 4, 0, &parserva2, true },
519#endif
520 { "UFID", 4, 0, &parsembtid, false }, 509 { "UFID", 4, 0, &parsembtid, false },
521}; 510};
522 511
@@ -738,9 +727,7 @@ void setid3v2title(int fd, struct mp3entry *entry)
738 bool unsynch = false; 727 bool unsynch = false;
739 int i, j; 728 int i, j;
740 int rc; 729 int rc;
741#if CONFIG_CODEC == SWCODEC
742 bool itunes_gapless = false; 730 bool itunes_gapless = false;
743#endif
744 731
745#ifdef HAVE_ALBUMART 732#ifdef HAVE_ALBUMART
746 entry->has_embedded_albumart = false; 733 entry->has_embedded_albumart = false;
@@ -984,14 +971,11 @@ void setid3v2title(int fd, struct mp3entry *entry)
984 (tr->tag_length == 3 && !memcmp( header, "COM", 3))) { 971 (tr->tag_length == 3 && !memcmp( header, "COM", 3))) {
985 int offset; 972 int offset;
986 if(bytesread >= 8 && !strncmp(tag+4, "iTun", 4)) { 973 if(bytesread >= 8 && !strncmp(tag+4, "iTun", 4)) {
987#if CONFIG_CODEC == SWCODEC
988 /* check for iTunes gapless information */ 974 /* check for iTunes gapless information */
989 if(bytesread >= 12 && !strncmp(tag+4, "iTunSMPB", 8)) 975 if(bytesread >= 12 && !strncmp(tag+4, "iTunSMPB", 8))
990 itunes_gapless = true; 976 itunes_gapless = true;
991 else 977 else
992#endif 978 break; /* ignore other with iTunes tags */
993 /* ignore other with iTunes tags */
994 break;
995 } 979 }
996 980
997 offset = 3 + unicode_len(*tag, tag + 4); 981 offset = 3 + unicode_len(*tag, tag + 4);
@@ -1071,7 +1055,6 @@ void setid3v2title(int fd, struct mp3entry *entry)
1071 tag[bytesread] = 0; 1055 tag[bytesread] = 0;
1072 bufferpos += bytesread + 1; 1056 bufferpos += bytesread + 1;
1073 1057
1074#if CONFIG_CODEC == SWCODEC
1075 /* parse the tag if it contains iTunes gapless info */ 1058 /* parse the tag if it contains iTunes gapless info */
1076 if (itunes_gapless) 1059 if (itunes_gapless)
1077 { 1060 {
@@ -1079,7 +1062,6 @@ void setid3v2title(int fd, struct mp3entry *entry)
1079 entry->lead_trim = get_itunes_int32(tag, 1); 1062 entry->lead_trim = get_itunes_int32(tag, 1);
1080 entry->tail_trim = get_itunes_int32(tag, 2); 1063 entry->tail_trim = get_itunes_int32(tag, 2);
1081 } 1064 }
1082#endif
1083 1065
1084 /* Note that parser functions sometimes set *ptag to NULL, so 1066 /* Note that parser functions sometimes set *ptag to NULL, so
1085 * the "!*ptag" check here doesn't always have the desired 1067 * the "!*ptag" check here doesn't always have the desired
diff --git a/lib/rbcodec/metadata/metadata.c b/lib/rbcodec/metadata/metadata.c
index c24a27df2b..9c41347975 100644
--- a/lib/rbcodec/metadata/metadata.c
+++ b/lib/rbcodec/metadata/metadata.c
@@ -29,8 +29,6 @@
29 29
30#include "metadata_parsers.h" 30#include "metadata_parsers.h"
31 31
32#if CONFIG_CODEC == SWCODEC
33
34/* For trailing tag stripping and base audio data types */ 32/* For trailing tag stripping and base audio data types */
35#include "buffering.h" 33#include "buffering.h"
36 34
@@ -53,7 +51,6 @@ static bool get_other_asap_metadata(int fd, struct mp3entry *id3)
53 id3->genre_string = id3_get_num_genre(36); 51 id3->genre_string = id3_get_num_genre(36);
54 return true; 52 return true;
55} 53}
56#endif /* CONFIG_CODEC == SWCODEC */
57bool write_metadata_log = false; 54bool write_metadata_log = false;
58 55
59const struct afmt_entry audio_formats[AFMT_NUM_CODECS] = 56const struct afmt_entry audio_formats[AFMT_NUM_CODECS] =
@@ -66,13 +63,7 @@ const struct afmt_entry audio_formats[AFMT_NUM_CODECS] =
66 [AFMT_MPA_L2] = 63 [AFMT_MPA_L2] =
67 AFMT_ENTRY("MP2", "mpa", NULL, get_mp3_metadata, "mpa\0mp2\0"), 64 AFMT_ENTRY("MP2", "mpa", NULL, get_mp3_metadata, "mpa\0mp2\0"),
68 65
69#if CONFIG_CODEC != SWCODEC 66 /* MPEG Audio layer 3 */
70 /* MPEG Audio layer 3 on HWCODEC: .talk clips, no encoder */
71 [AFMT_MPA_L3] =
72 AFMT_ENTRY("MP3", "mpa", NULL, get_mp3_metadata, "mp3\0talk\0"),
73
74#else /* CONFIG_CODEC == SWCODEC */
75 /* MPEG Audio layer 3 on SWCODEC */
76 [AFMT_MPA_L3] = 67 [AFMT_MPA_L3] =
77 AFMT_ENTRY("MP3", "mpa", "mp3_enc", get_mp3_metadata, "mp3\0"), 68 AFMT_ENTRY("MP3", "mpa", "mp3_enc", get_mp3_metadata, "mp3\0"),
78 69
@@ -238,10 +229,9 @@ const struct afmt_entry audio_formats[AFMT_NUM_CODECS] =
238 /* AAC bitstream format */ 229 /* AAC bitstream format */
239 [AFMT_AAC_BSF] = 230 [AFMT_AAC_BSF] =
240 AFMT_ENTRY("AAC", "aac_bsf", NULL, get_aac_metadata, "aac\0"), 231 AFMT_ENTRY("AAC", "aac_bsf", NULL, get_aac_metadata, "aac\0"),
241#endif
242}; 232};
243 233
244#if CONFIG_CODEC == SWCODEC && defined (HAVE_RECORDING) 234#if defined (HAVE_RECORDING)
245/* get REC_FORMAT_* corresponding AFMT_* */ 235/* get REC_FORMAT_* corresponding AFMT_* */
246const int rec_format_afmt[REC_NUM_FORMATS] = 236const int rec_format_afmt[REC_NUM_FORMATS] =
247{ 237{
@@ -267,9 +257,8 @@ const int afmt_rec_format[AFMT_NUM_CODECS] =
267 [AFMT_PCM_WAV] = REC_FORMAT_PCM_WAV, 257 [AFMT_PCM_WAV] = REC_FORMAT_PCM_WAV,
268}; 258};
269#endif 259#endif
270#endif /* CONFIG_CODEC == SWCODEC && defined (HAVE_RECORDING) */ 260#endif /* defined (HAVE_RECORDING) */
271 261
272#if CONFIG_CODEC == SWCODEC
273/* Get the canonical AFMT type */ 262/* Get the canonical AFMT type */
274int get_audio_base_codec_type(int type) 263int get_audio_base_codec_type(int type)
275{ 264{
@@ -357,8 +346,6 @@ bool format_buffers_with_offset(int afmt)
357 return false; 346 return false;
358 } 347 }
359} 348}
360#endif /* CONFIG_CODEC == SWCODEC */
361
362 349
363/* Simple file type probing by looking at the filename extension. */ 350/* Simple file type probing by looking at the filename extension. */
364unsigned int probe_file_format(const char *filename) 351unsigned int probe_file_format(const char *filename)
@@ -464,7 +451,6 @@ bool get_metadata(struct mp3entry* id3, int fd, const char* trackname)
464} 451}
465 452
466#ifndef __PCTOOL__ 453#ifndef __PCTOOL__
467#if CONFIG_CODEC == SWCODEC
468void strip_tags(int handle_id) 454void strip_tags(int handle_id)
469{ 455{
470 static const unsigned char tag[] = "TAG"; 456 static const unsigned char tag[] = "TAG";
@@ -500,7 +486,6 @@ void strip_tags(int handle_id)
500 logf("Cutting off APE tag (%ldB)", len); 486 logf("Cutting off APE tag (%ldB)", len);
501 bufcuttail(handle_id, len); 487 bufcuttail(handle_id, len);
502} 488}
503#endif /* CONFIG_CODEC == SWCODEC */
504#endif /* ! __PCTOOL__ */ 489#endif /* ! __PCTOOL__ */
505 490
506#define MOVE_ENTRY(x) if (x) x += offset; 491#define MOVE_ENTRY(x) if (x) x += offset;
@@ -544,7 +529,6 @@ void wipe_mp3entry(struct mp3entry *id3)
544 memset(id3, 0, sizeof (struct mp3entry)); 529 memset(id3, 0, sizeof (struct mp3entry));
545} 530}
546 531
547#if CONFIG_CODEC == SWCODEC
548/* Glean what is possible from the filename alone - does not parse metadata */ 532/* Glean what is possible from the filename alone - does not parse metadata */
549void fill_metadata_from_path(struct mp3entry *id3, const char *trackname) 533void fill_metadata_from_path(struct mp3entry *id3, const char *trackname)
550{ 534{
@@ -574,4 +558,3 @@ void fill_metadata_from_path(struct mp3entry *id3, const char *trackname)
574 /* Copy the path info */ 558 /* Copy the path info */
575 strlcpy(id3->path, trackname, sizeof (id3->path)); 559 strlcpy(id3->path, trackname, sizeof (id3->path));
576} 560}
577#endif /* CONFIG_CODEC == SWCODEC */
diff --git a/lib/rbcodec/metadata/metadata.h b/lib/rbcodec/metadata/metadata.h
index a7ebcf16e5..5c78eae9d4 100644
--- a/lib/rbcodec/metadata/metadata.h
+++ b/lib/rbcodec/metadata/metadata.h
@@ -37,7 +37,6 @@ enum
37 AFMT_MPA_L2, /* MPEG Audio layer 2 */ 37 AFMT_MPA_L2, /* MPEG Audio layer 2 */
38 AFMT_MPA_L3, /* MPEG Audio layer 3 */ 38 AFMT_MPA_L3, /* MPEG Audio layer 3 */
39 39
40#if CONFIG_CODEC == SWCODEC
41 AFMT_AIFF, /* Audio Interchange File Format */ 40 AFMT_AIFF, /* Audio Interchange File Format */
42 AFMT_PCM_WAV, /* Uncompressed PCM in a WAV file */ 41 AFMT_PCM_WAV, /* Uncompressed PCM in a WAV file */
43 AFMT_OGG_VORBIS, /* Ogg Vorbis */ 42 AFMT_OGG_VORBIS, /* Ogg Vorbis */
@@ -91,7 +90,6 @@ enum
91 AFMT_KSS, /* KSS (MSX computer KSS Music File) */ 90 AFMT_KSS, /* KSS (MSX computer KSS Music File) */
92 AFMT_OPUS, /* Opus (see http://www.opus-codec.org ) */ 91 AFMT_OPUS, /* Opus (see http://www.opus-codec.org ) */
93 AFMT_AAC_BSF, 92 AFMT_AAC_BSF,
94#endif
95 93
96 /* add new formats at any index above this line to have a sensible order - 94 /* add new formats at any index above this line to have a sensible order -
97 specified array index inits are used */ 95 specified array index inits are used */
@@ -99,7 +97,7 @@ enum
99 97
100 AFMT_NUM_CODECS, 98 AFMT_NUM_CODECS,
101 99
102#if CONFIG_CODEC == SWCODEC && defined(HAVE_RECORDING) 100#if defined(HAVE_RECORDING)
103 /* masks to decompose parts */ 101 /* masks to decompose parts */
104 CODEC_AFMT_MASK = 0x0fff, 102 CODEC_AFMT_MASK = 0x0fff,
105 CODEC_TYPE_MASK = 0x7000, 103 CODEC_TYPE_MASK = 0x7000,
@@ -107,10 +105,9 @@ enum
107 /* switch for specifying codec type when requesting a filename */ 105 /* switch for specifying codec type when requesting a filename */
108 CODEC_TYPE_DECODER = (0 << 12), /* default */ 106 CODEC_TYPE_DECODER = (0 << 12), /* default */
109 CODEC_TYPE_ENCODER = (1 << 12), 107 CODEC_TYPE_ENCODER = (1 << 12),
110#endif /* CONFIG_CODEC == SWCODEC && defined(HAVE_RECORDING) */ 108#endif /* defined(HAVE_RECORDING) */
111}; 109};
112 110
113#if CONFIG_CODEC == SWCODEC
114#if (CONFIG_PLATFORM & PLATFORM_ANDROID) 111#if (CONFIG_PLATFORM & PLATFORM_ANDROID)
115#define CODEC_EXTENSION "so" 112#define CODEC_EXTENSION "so"
116#define CODEC_PREFIX "lib" 113#define CODEC_PREFIX "lib"
@@ -157,24 +154,16 @@ extern const int rec_format_afmt[REC_NUM_FORMATS];
157 { label, root_fname, func, ext_list } 154 { label, root_fname, func, ext_list }
158#endif /* HAVE_RECORDING */ 155#endif /* HAVE_RECORDING */
159 156
160#else /* !SWCODEC */
161
162#define AFMT_ENTRY(label, root_fname, enc_root_fname, func, ext_list) \
163 { label, func, ext_list }
164#endif /* CONFIG_CODEC == SWCODEC */
165
166/** Database of audio formats **/ 157/** Database of audio formats **/
167/* record describing the audio format */ 158/* record describing the audio format */
168struct mp3entry; 159struct mp3entry;
169struct afmt_entry 160struct afmt_entry
170{ 161{
171 const char *label; /* format label */ 162 const char *label; /* format label */
172#if CONFIG_CODEC == SWCODEC
173 const char *codec_root_fn; /* root codec filename (sans _enc and .codec) */ 163 const char *codec_root_fn; /* root codec filename (sans _enc and .codec) */
174#ifdef HAVE_RECORDING 164#ifdef HAVE_RECORDING
175 const char *codec_enc_root_fn; /* filename of encoder codec */ 165 const char *codec_enc_root_fn; /* filename of encoder codec */
176#endif 166#endif
177#endif
178 bool (*parse_func)(int fd, struct mp3entry *id3); /* return true on success */ 167 bool (*parse_func)(int fd, struct mp3entry *id3); /* return true on success */
179 const char *ext_list; /* NULL terminated extension 168 const char *ext_list; /* NULL terminated extension
180 list for type with the first as 169 list for type with the first as
@@ -305,14 +294,12 @@ struct mp3entry {
305#endif 294#endif
306 295
307 /* replaygain support */ 296 /* replaygain support */
308#if CONFIG_CODEC == SWCODEC
309 long track_level; /* holds the level in dB * (1<<FP_BITS) */ 297 long track_level; /* holds the level in dB * (1<<FP_BITS) */
310 long album_level; 298 long album_level;
311 long track_gain; /* s19.12 signed fixed point. 0 for no gain. */ 299 long track_gain; /* s19.12 signed fixed point. 0 for no gain. */
312 long album_gain; 300 long album_gain;
313 long track_peak; /* s19.12 signed fixed point. 0 for no peak. */ 301 long track_peak; /* s19.12 signed fixed point. 0 for no peak. */
314 long album_peak; 302 long album_peak;
315#endif
316 303
317#ifdef HAVE_ALBUMART 304#ifdef HAVE_ALBUMART
318 bool has_embedded_albumart; 305 bool has_embedded_albumart;
@@ -335,13 +322,11 @@ void adjust_mp3entry(struct mp3entry *entry, void *dest, const void *orig);
335void copy_mp3entry(struct mp3entry *dest, const struct mp3entry *orig); 322void copy_mp3entry(struct mp3entry *dest, const struct mp3entry *orig);
336void wipe_mp3entry(struct mp3entry *id3); 323void wipe_mp3entry(struct mp3entry *id3);
337 324
338#if CONFIG_CODEC == SWCODEC
339void fill_metadata_from_path(struct mp3entry *id3, const char *trackname); 325void fill_metadata_from_path(struct mp3entry *id3, const char *trackname);
340int get_audio_base_codec_type(int type); 326int get_audio_base_codec_type(int type);
341void strip_tags(int handle_id); 327void strip_tags(int handle_id);
342bool rbcodec_format_is_atomic(int afmt); 328bool rbcodec_format_is_atomic(int afmt);
343bool format_buffers_with_offset(int afmt); 329bool format_buffers_with_offset(int afmt);
344#endif
345 330
346#endif 331#endif
347 332
diff --git a/lib/rbcodec/metadata/metadata_parsers.h b/lib/rbcodec/metadata/metadata_parsers.h
index 45cf140012..cc7d8a102e 100644
--- a/lib/rbcodec/metadata/metadata_parsers.h
+++ b/lib/rbcodec/metadata/metadata_parsers.h
@@ -19,15 +19,12 @@
19 * 19 *
20 ****************************************************************************/ 20 ****************************************************************************/
21 21
22#if CONFIG_CODEC == SWCODEC
23char* id3_get_num_genre(unsigned int genre_num); 22char* id3_get_num_genre(unsigned int genre_num);
24#endif
25int getid3v1len(int fd); 23int getid3v1len(int fd);
26int getid3v2len(int fd); 24int getid3v2len(int fd);
27bool setid3v1title(int fd, struct mp3entry *entry); 25bool setid3v1title(int fd, struct mp3entry *entry);
28void setid3v2title(int fd, struct mp3entry *entry); 26void setid3v2title(int fd, struct mp3entry *entry);
29bool get_mp3_metadata(int fd, struct mp3entry* id3); 27bool get_mp3_metadata(int fd, struct mp3entry* id3);
30#if CONFIG_CODEC == SWCODEC
31bool get_adx_metadata(int fd, struct mp3entry* id3); 28bool get_adx_metadata(int fd, struct mp3entry* id3);
32bool get_aiff_metadata(int fd, struct mp3entry* id3); 29bool get_aiff_metadata(int fd, struct mp3entry* id3);
33bool get_flac_metadata(int fd, struct mp3entry* id3); 30bool get_flac_metadata(int fd, struct mp3entry* id3);
@@ -58,4 +55,3 @@ bool get_sgc_metadata(int fd, struct mp3entry* id3);
58bool get_vgm_metadata(int fd, struct mp3entry* id3); 55bool get_vgm_metadata(int fd, struct mp3entry* id3);
59bool get_kss_metadata(int fd, struct mp3entry* id3); 56bool get_kss_metadata(int fd, struct mp3entry* id3);
60bool get_aac_metadata(int fd, struct mp3entry* id3); 57bool get_aac_metadata(int fd, struct mp3entry* id3);
61#endif /* CONFIG_CODEC == SWCODEC */
diff --git a/lib/rbcodec/metadata/mp3.c b/lib/rbcodec/metadata/mp3.c
index 2096e70898..ffe20fb3ea 100644
--- a/lib/rbcodec/metadata/mp3.c
+++ b/lib/rbcodec/metadata/mp3.c
@@ -108,11 +108,9 @@ static int getsonglength(int fd, struct mp3entry *entry)
108 entry->frequency = info.frequency; 108 entry->frequency = info.frequency;
109 entry->layer = info.layer; 109 entry->layer = info.layer;
110 switch(entry->layer) { 110 switch(entry->layer) {
111#if CONFIG_CODEC==SWCODEC
112 case 0: 111 case 0:
113 entry->codectype=AFMT_MPA_L1; 112 entry->codectype=AFMT_MPA_L1;
114 break; 113 break;
115#endif
116 case 1: 114 case 1:
117 entry->codectype=AFMT_MPA_L2; 115 entry->codectype=AFMT_MPA_L2;
118 break; 116 break;
@@ -143,12 +141,10 @@ static int getsonglength(int fd, struct mp3entry *entry)
143 entry->vbr = info.is_vbr; 141 entry->vbr = info.is_vbr;
144 entry->has_toc = info.has_toc; 142 entry->has_toc = info.has_toc;
145 143
146#if CONFIG_CODEC==SWCODEC
147 if (!entry->lead_trim) 144 if (!entry->lead_trim)
148 entry->lead_trim = info.enc_delay; 145 entry->lead_trim = info.enc_delay;
149 if (!entry->tail_trim) 146 if (!entry->tail_trim)
150 entry->tail_trim = info.enc_padding; 147 entry->tail_trim = info.enc_padding;
151#endif
152 148
153 memcpy(entry->toc, info.toc, sizeof(info.toc)); 149 memcpy(entry->toc, info.toc, sizeof(info.toc));
154 150
diff --git a/lib/rbcodec/metadata/mp3data.c b/lib/rbcodec/metadata/mp3data.c
index 49f9786c29..83605126d6 100644
--- a/lib/rbcodec/metadata/mp3data.c
+++ b/lib/rbcodec/metadata/mp3data.c
@@ -115,11 +115,6 @@ static bool is_mp3frameheader(unsigned long head)
115 return false; 115 return false;
116 if (!(head & LAYER_MASK)) /* no layer? */ 116 if (!(head & LAYER_MASK)) /* no layer? */
117 return false; 117 return false;
118#if CONFIG_CODEC != SWCODEC
119 /* The MAS can't decode layer 1, so treat layer 1 data as invalid */
120 if ((head & LAYER_MASK) == LAYER_MASK)
121 return false;
122#endif
123 if ((head & BITRATE_MASK) == BITRATE_MASK) /* bad bitrate? */ 118 if ((head & BITRATE_MASK) == BITRATE_MASK) /* bad bitrate? */
124 return false; 119 return false;
125 if (!(head & BITRATE_MASK)) /* no bitrate? */ 120 if (!(head & BITRATE_MASK)) /* no bitrate? */
@@ -454,7 +449,6 @@ static void get_xing_info(struct mp3info *info, unsigned char *buf)
454 /* We don't care about this, but need to skip it */ 449 /* We don't care about this, but need to skip it */
455 i += 4; 450 i += 4;
456 } 451 }
457#if CONFIG_CODEC==SWCODEC
458 i += 21; 452 i += 21;
459 info->enc_delay = ((int)buf[i ] << 4) | (buf[i+1] >> 4); 453 info->enc_delay = ((int)buf[i ] << 4) | (buf[i+1] >> 4);
460 info->enc_padding = ((int)(buf[i+1]&0xF) << 8) | buf[i+2]; 454 info->enc_padding = ((int)(buf[i+1]&0xF) << 8) | buf[i+2];
@@ -467,7 +461,6 @@ static void get_xing_info(struct mp3info *info, unsigned char *buf)
467 info->enc_delay = -1; 461 info->enc_delay = -1;
468 info->enc_padding = -1; 462 info->enc_padding = -1;
469 } 463 }
470#endif
471} 464}
472 465
473/* Extract information from a 'VBRI' header. */ 466/* Extract information from a 'VBRI' header. */
@@ -541,18 +534,16 @@ int get_mp3file_info(int fd, struct mp3info *info)
541 /* Initialize info and frame */ 534 /* Initialize info and frame */
542 memset(info, 0, sizeof(struct mp3info)); 535 memset(info, 0, sizeof(struct mp3info));
543 memset(frame, 0, sizeof(frame)); 536 memset(frame, 0, sizeof(frame));
544 537
545#if CONFIG_CODEC==SWCODEC
546 /* These two are needed for proper LAME gapless MP3 playback */ 538 /* These two are needed for proper LAME gapless MP3 playback */
547 info->enc_delay = -1; 539 info->enc_delay = -1;
548 info->enc_padding = -1; 540 info->enc_padding = -1;
549#endif
550 541
551 /* Get the very first single MPEG frame. */ 542 /* Get the very first single MPEG frame. */
552 result = get_next_header_info(fd, &bytecount, info, true); 543 result = get_next_header_info(fd, &bytecount, info, true);
553 if(result) 544 if(result)
554 return result; 545 return result;
555 546
556 /* Read the amount of frame data to the buffer that is required for the 547 /* Read the amount of frame data to the buffer that is required for the
557 * vbr tag parsing. Skip the rest. */ 548 * vbr tag parsing. Skip the rest. */
558 buf_size = MIN(info->frame_size-4, (int)sizeof(frame)); 549 buf_size = MIN(info->frame_size-4, (int)sizeof(frame));
diff --git a/lib/rbcodec/rbcodec.make b/lib/rbcodec/rbcodec.make
index bc4e54fddf..f2a7c7e569 100644
--- a/lib/rbcodec/rbcodec.make
+++ b/lib/rbcodec/rbcodec.make
@@ -22,6 +22,4 @@ CORE_LIBS := $(RBCODECLIB) $(CORE_LIBS)
22$(RBCODECLIB): $(RBCODECLIB_OBJ) 22$(RBCODECLIB): $(RBCODECLIB_OBJ)
23 $(call PRINTS,AR $(@F))$(AR) rcs $@ $^ >/dev/null 23 $(call PRINTS,AR $(@F))$(AR) rcs $@ $^ >/dev/null
24 24
25ifdef SOFTWARECODECS 25include $(RBCODECLIB_DIR)/codecs/codecs.make
26 include $(RBCODECLIB_DIR)/codecs/codecs.make
27endif
diff --git a/lib/skin_parser/tag_table.h b/lib/skin_parser/tag_table.h
index dc0c11f0ad..54ba23ce6e 100644
--- a/lib/skin_parser/tag_table.h
+++ b/lib/skin_parser/tag_table.h
@@ -256,7 +256,7 @@ enum skin_token_type {
256 SKIN_TOKEN_IS_RECORDING, 256 SKIN_TOKEN_IS_RECORDING,
257 SKIN_TOKEN_REC_FREQ, 257 SKIN_TOKEN_REC_FREQ,
258 SKIN_TOKEN_REC_ENCODER, 258 SKIN_TOKEN_REC_ENCODER,
259 SKIN_TOKEN_REC_BITRATE, /* SWCODEC: MP3 bitrate, HWCODEC: MP3 "quality" */ 259 SKIN_TOKEN_REC_BITRATE,
260 SKIN_TOKEN_REC_MONO, 260 SKIN_TOKEN_REC_MONO,
261 SKIN_TOKEN_REC_SECONDS, 261 SKIN_TOKEN_REC_SECONDS,
262 SKIN_TOKEN_REC_MINUTES, 262 SKIN_TOKEN_REC_MINUTES,
diff --git a/manual/configure_rockbox/recording_settings.tex b/manual/configure_rockbox/recording_settings.tex
index 5fc8f16840..09b5b76b3c 100644
--- a/manual/configure_rockbox/recording_settings.tex
+++ b/manual/configure_rockbox/recording_settings.tex
@@ -91,7 +91,6 @@
91 Choose the source of the recording. The options are: 91 Choose the source of the recording. The options are:
92 \opt{recording_digital}{\setting{Digital} (SPDIF), }% 92 \opt{recording_digital}{\setting{Digital} (SPDIF), }%
93 \opt{recording_mic}{\setting{Microphone}}% 93 \opt{recording_mic}{\setting{Microphone}}%
94 \opt{recording_hwcodec}{ and \setting{Line~In}.}%
95 \opt{recording_swcodec}{% 94 \opt{recording_swcodec}{%
96 \nopt{radio}{\opt{recording_linein}{ and \setting{Line~In}.}}% 95 \nopt{radio}{\opt{recording_linein}{ and \setting{Line~In}.}}%
97 \opt{radio}{% 96 \opt{radio}{%
diff --git a/manual/getting_started/installation.tex b/manual/getting_started/installation.tex
index 0b3b25a4e8..77a3e326f9 100644
--- a/manual/getting_started/installation.tex
+++ b/manual/getting_started/installation.tex
@@ -243,8 +243,6 @@ still available to you.\\
243 various important aspects of Rockbox, such as the different versions 243 various important aspects of Rockbox, such as the different versions
244 available.\\}} 244 available.\\}}
245 245
246\opt{hwcodec}{Rockbox itself comes as a single package. There is no need
247 to install additional software to run Rockbox.}
248\opt{swcodec} { 246\opt{swcodec} {
249 \opt{HAVE_RB_BL_ON_DISK}{There are three separate components, 247 \opt{HAVE_RB_BL_ON_DISK}{There are three separate components,
250 two of which need to be installed in order to run Rockbox:} 248 two of which need to be installed in order to run Rockbox:}
@@ -690,10 +688,8 @@ The new build will be installed over your current build.\\
690 data partition.\\} 688 data partition.\\}
691} 689}
692 690
693\nopt{hwcodec}{ 691The bootloader only changes rarely, and should not normally
694 The bootloader only changes rarely, and should not normally 692need to be updated.\\
695 need to be updated.\\
696}
697 693
698\note{If you use Rockbox Utility be aware that it cannot detect manually 694\note{If you use Rockbox Utility be aware that it cannot detect manually
699 installed components.} 695 installed components.}
diff --git a/manual/main_menu/recording_screen.tex b/manual/main_menu/recording_screen.tex
index a3c8ca006c..0d1de44c83 100644
--- a/manual/main_menu/recording_screen.tex
+++ b/manual/main_menu/recording_screen.tex
@@ -22,7 +22,6 @@ recording.\\*
22the peak meters to freeze in the process. This is expected behaviour, and 22the peak meters to freeze in the process. This is expected behaviour, and
23nothing to worry about. The recording continues during the spin up.\\*}}} 23nothing to worry about. The recording continues during the spin up.\\*}}}
24 24
25\opt{recording_hwcodec}{The frequency, channels and quality}
26\opt{recording_swcodec}{The frequency and channels} settings are shown in the 25\opt{recording_swcodec}{The frequency and channels} settings are shown in the
27status bar.\\* 26status bar.\\*
28 27
diff --git a/manual/plugins/pictureflow.tex b/manual/plugins/pictureflow.tex
index 017c42d9b7..1915cc38c9 100644
--- a/manual/plugins/pictureflow.tex
+++ b/manual/plugins/pictureflow.tex
@@ -5,11 +5,6 @@ art. \opt{swcodec}{It is possible to start playback of the selected
5album from PictureFlow. Playback will start from the selected track. The 5album from PictureFlow. Playback will start from the selected track. The
6PictureFlow plugin will continue to run while your tracks are played.} 6PictureFlow plugin will continue to run while your tracks are played.}
7 7
8\opt{hwcodec}{
9\note{PictureFlow is a visualisation only. It cannot be used to select and
10play music. Also, using this plugin will cause playback to stop.}
11}
12
13\subsubsection{Requirements} 8\subsubsection{Requirements}
14PictureFlow uses both the album art (see \reference{ref:album_art}) and 9PictureFlow uses both the album art (see \reference{ref:album_art}) and
15database (see \reference{ref:database}) features of Rockbox. 10database (see \reference{ref:database}) features of Rockbox.
diff --git a/tools/buildzip.pl b/tools/buildzip.pl
index b1626f429c..0e980139bf 100755
--- a/tools/buildzip.pl
+++ b/tools/buildzip.pl
@@ -92,7 +92,7 @@ sub find_copyfile {
92 print "cp $path $destination\n" if $verbose; 92 print "cp $path $destination\n" if $verbose;
93 copy($path, $destination); 93 copy($path, $destination);
94 chmod(0755, $destination.'/'.$path); 94 chmod(0755, $destination.'/'.$path);
95 } 95 }
96 } 96 }
97 } 97 }
98} 98}
@@ -266,7 +266,6 @@ LCD Height: LCD_HEIGHT
266Icon Width: CONFIG_DEFAULT_ICON_WIDTH 266Icon Width: CONFIG_DEFAULT_ICON_WIDTH
267Icon Height: CONFIG_DEFAULT_ICON_HEIGHT 267Icon Height: CONFIG_DEFAULT_ICON_HEIGHT
268#endif 268#endif
269Codec: CONFIG_CODEC
270#ifdef HAVE_REMOTE_LCD 269#ifdef HAVE_REMOTE_LCD
271Remote Depth: LCD_REMOTE_DEPTH 270Remote Depth: LCD_REMOTE_DEPTH
272Remote Icon Width: CONFIG_REMOTE_DEFAULT_ICON_WIDTH 271Remote Icon Width: CONFIG_REMOTE_DEFAULT_ICON_WIDTH
@@ -287,7 +286,7 @@ STOP
287 286
288 open(TARGET, "$c|"); 287 open(TARGET, "$c|");
289 288
290 my ($bitmap, $width, $height, $depth, $swcodec, $icon_h, $icon_w); 289 my ($bitmap, $width, $height, $depth, $icon_h, $icon_w);
291 my ($remote_depth, $remote_icon_h, $remote_icon_w); 290 my ($remote_depth, $remote_icon_h, $remote_icon_w);
292 my ($recording); 291 my ($recording);
293 my $icon_count = 1; 292 my $icon_count = 1;
@@ -311,10 +310,6 @@ STOP
311 elsif($_ =~ /^Icon Height: (\d*)/) { 310 elsif($_ =~ /^Icon Height: (\d*)/) {
312 $icon_h = $1; 311 $icon_h = $1;
313 } 312 }
314 elsif($_ =~ /^Codec: (\d*)/) {
315 # SWCODEC is 1, the others are HWCODEC
316 $swcodec = ($1 == 1);
317 }
318 elsif($_ =~ /^Remote Depth: (\d*)/) { 313 elsif($_ =~ /^Remote Depth: (\d*)/) {
319 $remote_depth = $1; 314 $remote_depth = $1;
320 } 315 }
@@ -332,7 +327,7 @@ STOP
332 unlink("gcctemp"); 327 unlink("gcctemp");
333 328
334 return ($bitmap, $depth, $width, $height, $icon_w, $icon_h, $recording, 329 return ($bitmap, $depth, $width, $height, $icon_w, $icon_h, $recording,
335 $swcodec, $remote_depth, $remote_icon_w, $remote_icon_h); 330 $remote_depth, $remote_icon_w, $remote_icon_h);
336} 331}
337 332
338sub filesize { 333sub filesize {
@@ -345,17 +340,17 @@ sub filesize {
345 340
346 341
347sub buildzip { 342sub buildzip {
348 my ($image, $fonts)=@_; 343 my ($image, $fonts)=@_;
349 my $libdir = $install; 344 my $libdir = $install;
350 my $temp_dir = ".rockbox"; 345 my $temp_dir = ".rockbox";
351 346
352 print "buildzip: image=$image fonts=$fonts\n" if $verbose; 347 print "buildzip: image=$image fonts=$fonts\n" if $verbose;
353 348
354 my ($bitmap, $depth, $width, $height, $icon_w, $icon_h, $recording, 349 my ($bitmap, $depth, $width, $height, $icon_w, $icon_h, $recording,
355 $swcodec, $remote_depth, $remote_icon_w, $remote_icon_h) = 350 $remote_depth, $remote_icon_w, $remote_icon_h) =
356 &gettargetinfo(); 351 &gettargetinfo();
357 352
358 # print "Bitmap: $bitmap\nDepth: $depth\nSwcodec: $swcodec\n"; 353 # print "Bitmap: $bitmap\nDepth: $depth\n";
359 354
360 # remove old traces 355 # remove old traces
361 rmtree($temp_dir); 356 rmtree($temp_dir);
@@ -406,11 +401,8 @@ sub buildzip {
406 glob_mkdir("$temp_dir/recpresets"); 401 glob_mkdir("$temp_dir/recpresets");
407 } 402 }
408 403
409 if($swcodec) { 404 glob_mkdir("$temp_dir/eqs");
410 glob_mkdir("$temp_dir/eqs"); 405 glob_copy("$ROOT/lib/rbcodec/dsp/eqs/*.cfg", "$temp_dir/eqs/"); # equalizer presets
411
412 glob_copy("$ROOT/lib/rbcodec/dsp/eqs/*.cfg", "$temp_dir/eqs/"); # equalizer presets
413 }
414 406
415 glob_mkdir("$temp_dir/wps"); 407 glob_mkdir("$temp_dir/wps");
416 glob_mkdir("$temp_dir/icons"); 408 glob_mkdir("$temp_dir/icons");
@@ -556,7 +548,7 @@ sub buildzip {
556 if( filesize("rombox.ucl") > 1000) { 548 if( filesize("rombox.ucl") > 1000) {
557 copy("rombox.ucl", "$temp_dir/rombox.ucl"); # UCL for flashing 549 copy("rombox.ucl", "$temp_dir/rombox.ucl"); # UCL for flashing
558 } 550 }
559 551
560 # Check for rombox.target 552 # Check for rombox.target
561 if ($image=~/(.*)\.(\w+)$/) 553 if ($image=~/(.*)\.(\w+)$/)
562 { 554 {
@@ -596,20 +588,16 @@ sub buildzip {
596 else { 588 else {
597 print STDERR "No wps module present, can't do the WPS magic!\n"; 589 print STDERR "No wps module present, can't do the WPS magic!\n";
598 } 590 }
599 591
600 # until buildwps.pl is fixed, manually copy the classic_statusbar theme across 592 # until buildwps.pl is fixed, manually copy the classic_statusbar theme across
601 mkdir "$temp_dir/wps/classic_statusbar", 0777; 593 mkdir "$temp_dir/wps/classic_statusbar", 0777;
602 glob_copy("$ROOT/wps/classic_statusbar/*.bmp", "$temp_dir/wps/classic_statusbar"); 594 glob_copy("$ROOT/wps/classic_statusbar/*.bmp", "$temp_dir/wps/classic_statusbar");
603 if ($swcodec) { 595 if ($depth == 16) {
604 if ($depth == 16) { 596 copy("$ROOT/wps/classic_statusbar.sbs", "$temp_dir/wps");
605 copy("$ROOT/wps/classic_statusbar.sbs", "$temp_dir/wps"); 597 } elsif ($depth > 1) {
606 } elsif ($depth > 1) { 598 copy("$ROOT/wps/classic_statusbar.grey.sbs", "$temp_dir/wps/classic_statusbar.sbs");
607 copy("$ROOT/wps/classic_statusbar.grey.sbs", "$temp_dir/wps/classic_statusbar.sbs");
608 } else {
609 copy("$ROOT/wps/classic_statusbar.mono.sbs", "$temp_dir/wps/classic_statusbar.sbs");
610 }
611 } else { 599 } else {
612 copy("$ROOT/wps/classic_statusbar.112x64x1.sbs", "$temp_dir/wps/classic_statusbar.sbs"); 600 copy("$ROOT/wps/classic_statusbar.mono.sbs", "$temp_dir/wps/classic_statusbar.sbs");
613 } 601 }
614 if ($remote_depth != $depth) { 602 if ($remote_depth != $depth) {
615 copy("$ROOT/wps/classic_statusbar.mono.sbs", "$temp_dir/wps/classic_statusbar.rsbs"); 603 copy("$ROOT/wps/classic_statusbar.mono.sbs", "$temp_dir/wps/classic_statusbar.rsbs");
diff --git a/tools/configure b/tools/configure
index b4a7910397..79875aca14 100755
--- a/tools/configure
+++ b/tools/configure
@@ -1268,19 +1268,8 @@ voiceconfig () {
1268 echo "$TTS_ENGINE options set to $TTS_OPTS" 1268 echo "$TTS_ENGINE options set to $TTS_OPTS"
1269 fi 1269 fi
1270 1270
1271 if [ "$swcodec" = "yes" ]; then 1271 ENCODER="rbspeexenc"
1272 ENCODER="rbspeexenc" 1272 ENC_OPTS="-q 7 -c 10"
1273 ENC_OPTS="-q 7 -c 10"
1274 else
1275 if [ -n "`findtool lame`" ]; then
1276 ENCODER="lame"
1277 ENC_OPTS="-t -m m -h -V 9 -S -B 64 -b 8"
1278 else
1279 echo "You need LAME in the system path to build voice files for"
1280 echo "HWCODEC targets."
1281 exit 4
1282 fi
1283 fi
1284 1273
1285 echo "Using $ENCODER for encoding voice clips" 1274 echo "Using $ENCODER for encoding voice clips"
1286 1275
@@ -1650,7 +1639,6 @@ fi
1650 # plugins: set to 'yes' to build the plugins. Early development builds can 1639 # plugins: set to 'yes' to build the plugins. Early development builds can
1651 # set this to no in the early stages to have an easier life for a 1640 # set this to no in the early stages to have an easier life for a
1652 # while 1641 # while
1653 # swcodec: set 'yes' on swcodec targets
1654 # toolset: lists what particular tools in the tools/ directory that this 1642 # toolset: lists what particular tools in the tools/ directory that this
1655 # target needs to have built prior to building Rockbox 1643 # target needs to have built prior to building Rockbox
1656 # 1644 #
@@ -1677,7 +1665,6 @@ fi
1677 appextra="recorder:gui:radio" 1665 appextra="recorder:gui:radio"
1678 flash="$pwd/rombox.iriver" 1666 flash="$pwd/rombox.iriver"
1679 plugins="yes" 1667 plugins="yes"
1680 swcodec="yes"
1681 # toolset is the tools within the tools directory that we build for 1668 # toolset is the tools within the tools directory that we build for
1682 # this particular target. 1669 # this particular target.
1683 toolset=$iriverbitmaptools 1670 toolset=$iriverbitmaptools
@@ -1700,7 +1687,6 @@ fi
1700 output="rockbox.iriver" 1687 output="rockbox.iriver"
1701 appextra="recorder:gui:radio" 1688 appextra="recorder:gui:radio"
1702 plugins="yes" 1689 plugins="yes"
1703 swcodec="yes"
1704 # toolset is the tools within the tools directory that we build for 1690 # toolset is the tools within the tools directory that we build for
1705 # this particular target. 1691 # this particular target.
1706 toolset=$iriverbitmaptools 1692 toolset=$iriverbitmaptools
@@ -1725,7 +1711,6 @@ fi
1725 appextra="recorder:gui:radio" 1711 appextra="recorder:gui:radio"
1726 flash="$pwd/rombox.iriver" 1712 flash="$pwd/rombox.iriver"
1727 plugins="yes" 1713 plugins="yes"
1728 swcodec="yes"
1729 # toolset is the tools within the tools directory that we build for 1714 # toolset is the tools within the tools directory that we build for
1730 # this particular target. 1715 # this particular target.
1731 toolset=$iriverbitmaptools 1716 toolset=$iriverbitmaptools
@@ -1746,7 +1731,6 @@ fi
1746 output="rockbox.wma" 1731 output="rockbox.wma"
1747 appextra="recorder:gui:radio" 1732 appextra="recorder:gui:radio"
1748 plugins="yes" 1733 plugins="yes"
1749 swcodec="yes"
1750 # toolset is the tools within the tools directory that we build for 1734 # toolset is the tools within the tools directory that we build for
1751 # this particular target. 1735 # this particular target.
1752 toolset=$genericbitmaptools 1736 toolset=$genericbitmaptools
@@ -1767,7 +1751,6 @@ fi
1767 output="rockbox.mi4" 1751 output="rockbox.mi4"
1768 appextra="recorder:gui:radio" 1752 appextra="recorder:gui:radio"
1769 plugins="yes" 1753 plugins="yes"
1770 swcodec="yes"
1771 boottool="$rootdir/tools/scramble -mi4v3 -model=h10 -type=RBBL" 1754 boottool="$rootdir/tools/scramble -mi4v3 -model=h10 -type=RBBL"
1772 bootoutput="H10_20GC.mi4" 1755 bootoutput="H10_20GC.mi4"
1773 # toolset is the tools within the tools directory that we build for 1756 # toolset is the tools within the tools directory that we build for
@@ -1792,7 +1775,6 @@ fi
1792 output="rockbox.mi4" 1775 output="rockbox.mi4"
1793 appextra="recorder:gui:radio" 1776 appextra="recorder:gui:radio"
1794 plugins="yes" 1777 plugins="yes"
1795 swcodec="yes"
1796 boottool="$rootdir/tools/scramble -mi4v2 -model=h105 -type=RBBL" 1778 boottool="$rootdir/tools/scramble -mi4v2 -model=h105 -type=RBBL"
1797 bootoutput="H10.mi4" 1779 bootoutput="H10.mi4"
1798 # toolset is the tools within the tools directory that we build for 1780 # toolset is the tools within the tools directory that we build for
@@ -1817,7 +1799,6 @@ fi
1817 output="rockbox.ipod" 1799 output="rockbox.ipod"
1818 appextra="recorder:gui:radio" 1800 appextra="recorder:gui:radio"
1819 plugins="yes" 1801 plugins="yes"
1820 swcodec="yes"
1821 bootoutput="bootloader-$modelname.ipod" 1802 bootoutput="bootloader-$modelname.ipod"
1822 # toolset is the tools within the tools directory that we build for 1803 # toolset is the tools within the tools directory that we build for
1823 # this particular target. 1804 # this particular target.
@@ -1841,7 +1822,6 @@ fi
1841 output="rockbox.ipod" 1822 output="rockbox.ipod"
1842 appextra="recorder:gui:radio" 1823 appextra="recorder:gui:radio"
1843 plugins="yes" 1824 plugins="yes"
1844 swcodec="yes"
1845 bootoutput="bootloader-$modelname.ipod" 1825 bootoutput="bootloader-$modelname.ipod"
1846 # toolset is the tools within the tools directory that we build for 1826 # toolset is the tools within the tools directory that we build for
1847 # this particular target. 1827 # this particular target.
@@ -1865,7 +1845,6 @@ fi
1865 output="rockbox.ipod" 1845 output="rockbox.ipod"
1866 appextra="recorder:gui:radio" 1846 appextra="recorder:gui:radio"
1867 plugins="yes" 1847 plugins="yes"
1868 swcodec="yes"
1869 bootoutput="bootloader-$modelname.ipod" 1848 bootoutput="bootloader-$modelname.ipod"
1870 # toolset is the tools within the tools directory that we build for 1849 # toolset is the tools within the tools directory that we build for
1871 # this particular target. 1850 # this particular target.
@@ -1889,7 +1868,6 @@ fi
1889 output="rockbox.ipod" 1868 output="rockbox.ipod"
1890 appextra="recorder:gui:radio" 1869 appextra="recorder:gui:radio"
1891 plugins="yes" 1870 plugins="yes"
1892 swcodec="yes"
1893 bootoutput="bootloader-$modelname.ipod" 1871 bootoutput="bootloader-$modelname.ipod"
1894 # toolset is the tools within the tools directory that we build for 1872 # toolset is the tools within the tools directory that we build for
1895 # this particular target. 1873 # this particular target.
@@ -1913,7 +1891,6 @@ fi
1913 output="rockbox.ipod" 1891 output="rockbox.ipod"
1914 appextra="recorder:gui:radio" 1892 appextra="recorder:gui:radio"
1915 plugins="yes" 1893 plugins="yes"
1916 swcodec="yes"
1917 bootoutput="bootloader-$modelname.ipod" 1894 bootoutput="bootloader-$modelname.ipod"
1918 # toolset is the tools within the tools directory that we build for 1895 # toolset is the tools within the tools directory that we build for
1919 # this particular target. 1896 # this particular target.
@@ -1937,7 +1914,6 @@ fi
1937 output="rockbox.ipod" 1914 output="rockbox.ipod"
1938 appextra="recorder:gui:radio" 1915 appextra="recorder:gui:radio"
1939 plugins="yes" 1916 plugins="yes"
1940 swcodec="yes"
1941 bootoutput="bootloader-$modelname.ipod" 1917 bootoutput="bootloader-$modelname.ipod"
1942 # toolset is the tools within the tools directory that we build for 1918 # toolset is the tools within the tools directory that we build for
1943 # this particular target. 1919 # this particular target.
@@ -1961,7 +1937,6 @@ fi
1961 output="rockbox.ipod" 1937 output="rockbox.ipod"
1962 appextra="recorder:gui:radio" 1938 appextra="recorder:gui:radio"
1963 plugins="yes" 1939 plugins="yes"
1964 swcodec="yes"
1965 bootoutput="bootloader-$modelname.ipod" 1940 bootoutput="bootloader-$modelname.ipod"
1966 # toolset is the tools within the tools directory that we build for 1941 # toolset is the tools within the tools directory that we build for
1967 # this particular target. 1942 # this particular target.
@@ -1985,7 +1960,6 @@ fi
1985 output="rockbox.ipod" 1960 output="rockbox.ipod"
1986 appextra="recorder:gui:radio" 1961 appextra="recorder:gui:radio"
1987 plugins="yes" 1962 plugins="yes"
1988 swcodec="yes"
1989 bootoutput="bootloader-$modelname.ipod" 1963 bootoutput="bootloader-$modelname.ipod"
1990 # toolset is the tools within the tools directory that we build for 1964 # toolset is the tools within the tools directory that we build for
1991 # this particular target. 1965 # this particular target.
@@ -2009,7 +1983,6 @@ fi
2009 output="rockbox.ipod" 1983 output="rockbox.ipod"
2010 appextra="recorder:gui:radio" 1984 appextra="recorder:gui:radio"
2011 plugins="yes" 1985 plugins="yes"
2012 swcodec="yes"
2013 bootoutput="bootloader-$modelname.ipod" 1986 bootoutput="bootloader-$modelname.ipod"
2014 # toolset is the tools within the tools directory that we build for 1987 # toolset is the tools within the tools directory that we build for
2015 # this particular target. 1988 # this particular target.
@@ -2032,7 +2005,6 @@ fi
2032 output="rockbox.ipod" 2005 output="rockbox.ipod"
2033 appextra="recorder:gui:radio" 2006 appextra="recorder:gui:radio"
2034 plugins="yes" 2007 plugins="yes"
2035 swcodec="yes"
2036 bootoutput="bootloader-$modelname.ipod" 2008 bootoutput="bootloader-$modelname.ipod"
2037 # toolset is the tools within the tools directory that we build for 2009 # toolset is the tools within the tools directory that we build for
2038 # this particular target. 2010 # this particular target.
@@ -2059,7 +2031,6 @@ fi
2059 bootoutput="x5_fw.bin" 2031 bootoutput="x5_fw.bin"
2060 appextra="recorder:gui:radio" 2032 appextra="recorder:gui:radio"
2061 plugins="yes" 2033 plugins="yes"
2062 swcodec="yes"
2063 # toolset is the tools within the tools directory that we build for 2034 # toolset is the tools within the tools directory that we build for
2064 # this particular target. 2035 # this particular target.
2065 toolset="$iaudiobitmaptools" 2036 toolset="$iaudiobitmaptools"
@@ -2085,7 +2056,6 @@ fi
2085 bootoutput="m5_fw.bin" 2056 bootoutput="m5_fw.bin"
2086 appextra="recorder:gui:radio" 2057 appextra="recorder:gui:radio"
2087 plugins="yes" 2058 plugins="yes"
2088 swcodec="yes"
2089 # toolset is the tools within the tools directory that we build for 2059 # toolset is the tools within the tools directory that we build for
2090 # this particular target. 2060 # this particular target.
2091 toolset="$iaudiobitmaptools" 2061 toolset="$iaudiobitmaptools"
@@ -2108,7 +2078,6 @@ fi
2108 output="rockbox.iaudio" 2078 output="rockbox.iaudio"
2109 appextra="recorder:gui:radio" 2079 appextra="recorder:gui:radio"
2110 plugins="yes" 2080 plugins="yes"
2111 swcodec="yes"
2112 bootoutput="I7_FW.BIN" 2081 bootoutput="I7_FW.BIN"
2113 # toolset is the tools within the tools directory that we build for 2082 # toolset is the tools within the tools directory that we build for
2114 # this particular target. 2083 # this particular target.
@@ -2133,7 +2102,6 @@ fi
2133 bootoutput="bootloader-cowond2.bin" 2102 bootoutput="bootloader-cowond2.bin"
2134 appextra="recorder:gui:radio" 2103 appextra="recorder:gui:radio"
2135 plugins="yes" 2104 plugins="yes"
2136 swcodec="yes"
2137 toolset="$tccbitmaptools" 2105 toolset="$tccbitmaptools"
2138 # architecture, manufacturer and model for the target-tree build 2106 # architecture, manufacturer and model for the target-tree build
2139 t_cpu="arm" 2107 t_cpu="arm"
@@ -2155,7 +2123,6 @@ fi
2155 bootoutput="cowon_m3.bin" 2123 bootoutput="cowon_m3.bin"
2156 appextra="recorder:gui:radio" 2124 appextra="recorder:gui:radio"
2157 plugins="yes" 2125 plugins="yes"
2158 swcodec="yes"
2159 # toolset is the tools within the tools directory that we build for 2126 # toolset is the tools within the tools directory that we build for
2160 # this particular target. 2127 # this particular target.
2161 toolset="$iaudiobitmaptools" 2128 toolset="$iaudiobitmaptools"
@@ -2177,7 +2144,6 @@ fi
2177 output="rockbox.gigabeat" 2144 output="rockbox.gigabeat"
2178 appextra="recorder:gui:radio" 2145 appextra="recorder:gui:radio"
2179 plugins="yes" 2146 plugins="yes"
2180 swcodec="yes"
2181 toolset=$gigabeatbitmaptools 2147 toolset=$gigabeatbitmaptools
2182 boottool="$rootdir/tools/scramble -gigabeat" 2148 boottool="$rootdir/tools/scramble -gigabeat"
2183 bootoutput="FWIMG01.DAT" 2149 bootoutput="FWIMG01.DAT"
@@ -2199,7 +2165,6 @@ fi
2199 output="rockbox.gigabeat" 2165 output="rockbox.gigabeat"
2200 appextra="recorder:gui:radio" 2166 appextra="recorder:gui:radio"
2201 plugins="yes" 2167 plugins="yes"
2202 swcodec="yes"
2203 toolset="$gigabeatbitmaptools" 2168 toolset="$gigabeatbitmaptools"
2204 boottool="$rootdir/tools/scramble -gigabeats" 2169 boottool="$rootdir/tools/scramble -gigabeats"
2205 bootoutput="nk.bin" 2170 bootoutput="nk.bin"
@@ -2223,7 +2188,6 @@ fi
2223 output="rockbox.mrobe500" 2188 output="rockbox.mrobe500"
2224 appextra="recorder:gui:radio" 2189 appextra="recorder:gui:radio"
2225 plugins="yes" 2190 plugins="yes"
2226 swcodec="yes"
2227 toolset=$gigabeatbitmaptools 2191 toolset=$gigabeatbitmaptools
2228 boottool="cp " 2192 boottool="cp "
2229 bootoutput="rockbox.mrboot" 2193 bootoutput="rockbox.mrboot"
@@ -2247,7 +2211,6 @@ fi
2247 output="rockbox.mi4" 2211 output="rockbox.mi4"
2248 appextra="recorder:gui:radio" 2212 appextra="recorder:gui:radio"
2249 plugins="yes" 2213 plugins="yes"
2250 swcodec="yes"
2251 boottool="$rootdir/tools/scramble -mi4v2 -model=m100 -type=RBBL" 2214 boottool="$rootdir/tools/scramble -mi4v2 -model=m100 -type=RBBL"
2252 bootoutput="pp5020.mi4" 2215 bootoutput="pp5020.mi4"
2253 # toolset is the tools within the tools directory that we build for 2216 # toolset is the tools within the tools directory that we build for
@@ -2274,7 +2237,6 @@ fi
2274 output="rockbox.logik" 2237 output="rockbox.logik"
2275 appextra="recorder:gui:radio" 2238 appextra="recorder:gui:radio"
2276 plugins="" 2239 plugins=""
2277 swcodec="yes"
2278 # toolset is the tools within the tools directory that we build for 2240 # toolset is the tools within the tools directory that we build for
2279 # this particular target. 2241 # this particular target.
2280 toolset=$tccbitmaptools 2242 toolset=$tccbitmaptools
@@ -2296,7 +2258,6 @@ fi
2296 bootoutput="bootloader-zenxfistyle.creative" 2258 bootoutput="bootloader-zenxfistyle.creative"
2297 appextra="gui:recorder:radio" 2259 appextra="gui:recorder:radio"
2298 plugins="yes" 2260 plugins="yes"
2299 swcodec="yes"
2300 toolset=$scramblebitmaptools 2261 toolset=$scramblebitmaptools
2301 t_cpu="arm" 2262 t_cpu="arm"
2302 t_manufacturer="imx233" 2263 t_manufacturer="imx233"
@@ -2317,7 +2278,6 @@ fi
2317 output="rockbox.zvm" 2278 output="rockbox.zvm"
2318 appextra="recorder:gui:radio" 2279 appextra="recorder:gui:radio"
2319 plugins="yes" 2280 plugins="yes"
2320 swcodec="yes"
2321 toolset=$ipodbitmaptools 2281 toolset=$ipodbitmaptools
2322 boottool="$rootdir/tools/scramble -creative=zvm -no-ciff" 2282 boottool="$rootdir/tools/scramble -creative=zvm -no-ciff"
2323 bootoutput="rockbox.zvmboot" 2283 bootoutput="rockbox.zvmboot"
@@ -2340,7 +2300,6 @@ fi
2340 output="rockbox.zvm60" 2300 output="rockbox.zvm60"
2341 appextra="recorder:gui:radio" 2301 appextra="recorder:gui:radio"
2342 plugins="yes" 2302 plugins="yes"
2343 swcodec="yes"
2344 toolset=$ipodbitmaptools 2303 toolset=$ipodbitmaptools
2345 boottool="$rootdir/tools/scramble -creative=zvm60" 2304 boottool="$rootdir/tools/scramble -creative=zvm60"
2346 bootoutput="rockbox.zvm60boot" 2305 bootoutput="rockbox.zvm60boot"
@@ -2363,7 +2322,6 @@ fi
2363 output="rockbox.zv" 2322 output="rockbox.zv"
2364 appextra="recorder:gui:radio" 2323 appextra="recorder:gui:radio"
2365 plugins="" 2324 plugins=""
2366 swcodec="yes"
2367 toolset=$ipodbitmaptools 2325 toolset=$ipodbitmaptools
2368 boottool="$rootdir/tools/scramble -creative=zenvision" 2326 boottool="$rootdir/tools/scramble -creative=zenvision"
2369 bootoutput="rockbox.zvboot" 2327 bootoutput="rockbox.zvboot"
@@ -2385,7 +2343,6 @@ fi
2385 bootoutput="bootloader-zenxfi2.creative" 2343 bootoutput="bootloader-zenxfi2.creative"
2386 appextra="gui:recorder:radio" 2344 appextra="gui:recorder:radio"
2387 plugins="yes" 2345 plugins="yes"
2388 swcodec="yes"
2389 toolset=$scramblebitmaptools 2346 toolset=$scramblebitmaptools
2390 t_cpu="arm" 2347 t_cpu="arm"
2391 t_manufacturer="imx233" 2348 t_manufacturer="imx233"
@@ -2405,7 +2362,6 @@ fi
2405 bootoutput="bootloader-zenxfi3.creative" 2362 bootoutput="bootloader-zenxfi3.creative"
2406 appextra="gui:recorder:radio" 2363 appextra="gui:recorder:radio"
2407 plugins="yes" 2364 plugins="yes"
2408 swcodec="yes"
2409 toolset=$scramblebitmaptools 2365 toolset=$scramblebitmaptools
2410 t_cpu="arm" 2366 t_cpu="arm"
2411 t_manufacturer="imx233" 2367 t_manufacturer="imx233"
@@ -2425,7 +2381,6 @@ fi
2425 bootoutput="bootloader-zenv.creative" 2381 bootoutput="bootloader-zenv.creative"
2426 appextra="radio:gui:recorder" 2382 appextra="radio:gui:recorder"
2427 plugins="" 2383 plugins=""
2428 swcodec="yes"
2429 toolset=$scramblebitmaptools 2384 toolset=$scramblebitmaptools
2430 t_cpu="arm" 2385 t_cpu="arm"
2431 t_manufacturer="imx233" 2386 t_manufacturer="imx233"
@@ -2445,7 +2400,6 @@ fi
2445 bootoutput="bootloader-zenxfi.creative" 2400 bootoutput="bootloader-zenxfi.creative"
2446 appextra="gui:recorder:radio" 2401 appextra="gui:recorder:radio"
2447 plugins="yes" 2402 plugins="yes"
2448 swcodec="yes"
2449 toolset=$scramblebitmaptools 2403 toolset=$scramblebitmaptools
2450 t_cpu="arm" 2404 t_cpu="arm"
2451 t_manufacturer="imx233" 2405 t_manufacturer="imx233"
@@ -2465,7 +2419,6 @@ fi
2465 bootoutput="bootloader-zenmozaic.creative" 2419 bootoutput="bootloader-zenmozaic.creative"
2466 appextra="gui:recorder:radio" 2420 appextra="gui:recorder:radio"
2467 plugins="yes" 2421 plugins="yes"
2468 swcodec="yes"
2469 toolset=$scramblebitmaptools 2422 toolset=$scramblebitmaptools
2470 t_cpu="arm" 2423 t_cpu="arm"
2471 t_manufacturer="imx233" 2424 t_manufacturer="imx233"
@@ -2485,7 +2438,6 @@ fi
2485 bootoutput="bootloader-zen.creative" 2438 bootoutput="bootloader-zen.creative"
2486 appextra="gui:recorder:radio" 2439 appextra="gui:recorder:radio"
2487 plugins="yes" 2440 plugins="yes"
2488 swcodec="yes"
2489 toolset=$scramblebitmaptools 2441 toolset=$scramblebitmaptools
2490 t_cpu="arm" 2442 t_cpu="arm"
2491 t_manufacturer="imx233" 2443 t_manufacturer="imx233"
@@ -2506,7 +2458,6 @@ fi
2506 output="rockbox.mi4" 2458 output="rockbox.mi4"
2507 appextra="recorder:gui:radio" 2459 appextra="recorder:gui:radio"
2508 plugins="yes" 2460 plugins="yes"
2509 swcodec="yes"
2510 boottool="$rootdir/tools/scramble -mi4v3 -model=e200 -type=RBBL" 2461 boottool="$rootdir/tools/scramble -mi4v3 -model=e200 -type=RBBL"
2511 bootoutput="PP5022.mi4" 2462 bootoutput="PP5022.mi4"
2512 # toolset is the tools within the tools directory that we build for 2463 # toolset is the tools within the tools directory that we build for
@@ -2534,7 +2485,6 @@ fi
2534 output="rockbox.mi4" 2485 output="rockbox.mi4"
2535 appextra="recorder:gui:radio" 2486 appextra="recorder:gui:radio"
2536 plugins="yes" 2487 plugins="yes"
2537 swcodec="yes"
2538 boottool="$rootdir/tools/scramble -mi4r -model=e20r -type=RBBL" 2488 boottool="$rootdir/tools/scramble -mi4r -model=e20r -type=RBBL"
2539 bootoutput="pp5022.mi4" 2489 bootoutput="pp5022.mi4"
2540 # toolset is the tools within the tools directory that we build for 2490 # toolset is the tools within the tools directory that we build for
@@ -2559,7 +2509,6 @@ fi
2559 output="rockbox.mi4" 2509 output="rockbox.mi4"
2560 appextra="recorder:gui:radio" 2510 appextra="recorder:gui:radio"
2561 plugins="yes" 2511 plugins="yes"
2562 swcodec="yes"
2563 boottool="$rootdir/tools/scramble -mi4v3 -model=c200 -type=RBBL" 2512 boottool="$rootdir/tools/scramble -mi4v3 -model=c200 -type=RBBL"
2564 bootoutput="firmware.mi4" 2513 bootoutput="firmware.mi4"
2565 # toolset is the tools within the tools directory that we build for 2514 # toolset is the tools within the tools directory that we build for
@@ -2586,7 +2535,6 @@ fi
2586 output="rockbox.m200" 2535 output="rockbox.m200"
2587 appextra="recorder:gui:radio" 2536 appextra="recorder:gui:radio"
2588 plugins="" 2537 plugins=""
2589 swcodec="yes"
2590 # toolset is the tools within the tools directory that we build for 2538 # toolset is the tools within the tools directory that we build for
2591 # this particular target. 2539 # this particular target.
2592 toolset=$tccbitmaptools 2540 toolset=$tccbitmaptools
@@ -2610,7 +2558,6 @@ fi
2610 output="rockbox.c100" 2558 output="rockbox.c100"
2611 appextra="recorder:gui:radio" 2559 appextra="recorder:gui:radio"
2612 plugins="" 2560 plugins=""
2613 swcodec="yes"
2614 # toolset is the tools within the tools directory that we build for 2561 # toolset is the tools within the tools directory that we build for
2615 # this particular target. 2562 # this particular target.
2616 toolset=$tccbitmaptools 2563 toolset=$tccbitmaptools
@@ -2632,7 +2579,6 @@ fi
2632 bootoutput="bootloader-clip.sansa" 2579 bootoutput="bootloader-clip.sansa"
2633 appextra="recorder:gui:radio" 2580 appextra="recorder:gui:radio"
2634 plugins="yes" 2581 plugins="yes"
2635 swcodec="yes"
2636 toolset=$scramblebitmaptools 2582 toolset=$scramblebitmaptools
2637 t_cpu="arm" 2583 t_cpu="arm"
2638 t_manufacturer="as3525" 2584 t_manufacturer="as3525"
@@ -2655,7 +2601,6 @@ fi
2655 bootoutput="bootloader-e200v2.sansa" 2601 bootoutput="bootloader-e200v2.sansa"
2656 appextra="recorder:gui:radio" 2602 appextra="recorder:gui:radio"
2657 plugins="yes" 2603 plugins="yes"
2658 swcodec="yes"
2659 toolset=$scramblebitmaptools 2604 toolset=$scramblebitmaptools
2660 t_cpu="arm" 2605 t_cpu="arm"
2661 t_manufacturer="as3525" 2606 t_manufacturer="as3525"
@@ -2676,7 +2621,6 @@ fi
2676 bootoutput="bootloader-m200v4.sansa" 2621 bootoutput="bootloader-m200v4.sansa"
2677 appextra="recorder:gui:radio" 2622 appextra="recorder:gui:radio"
2678 plugins="yes" 2623 plugins="yes"
2679 swcodec="yes"
2680 toolset=$scramblebitmaptools 2624 toolset=$scramblebitmaptools
2681 t_cpu="arm" 2625 t_cpu="arm"
2682 t_manufacturer="as3525" 2626 t_manufacturer="as3525"
@@ -2699,7 +2643,6 @@ fi
2699 bootoutput="bootloader-fuze.sansa" 2643 bootoutput="bootloader-fuze.sansa"
2700 appextra="recorder:gui:radio" 2644 appextra="recorder:gui:radio"
2701 plugins="yes" 2645 plugins="yes"
2702 swcodec="yes"
2703 toolset=$scramblebitmaptools 2646 toolset=$scramblebitmaptools
2704 t_cpu="arm" 2647 t_cpu="arm"
2705 t_manufacturer="as3525" 2648 t_manufacturer="as3525"
@@ -2720,7 +2663,6 @@ fi
2720 bootoutput="bootloader-c200v2.sansa" 2663 bootoutput="bootloader-c200v2.sansa"
2721 appextra="recorder:gui:radio" 2664 appextra="recorder:gui:radio"
2722 plugins="yes" 2665 plugins="yes"
2723 swcodec="yes"
2724 # toolset is the tools within the tools directory that we build for 2666 # toolset is the tools within the tools directory that we build for
2725 # this particular target. 2667 # this particular target.
2726 toolset=$scramblebitmaptools 2668 toolset=$scramblebitmaptools
@@ -2745,7 +2687,6 @@ fi
2745 bootoutput="bootloader-clipv2.sansa" 2687 bootoutput="bootloader-clipv2.sansa"
2746 appextra="recorder:gui:radio" 2688 appextra="recorder:gui:radio"
2747 plugins="yes" 2689 plugins="yes"
2748 swcodec="yes"
2749 toolset=$scramblebitmaptools 2690 toolset=$scramblebitmaptools
2750 t_cpu="arm" 2691 t_cpu="arm"
2751 t_manufacturer="as3525" 2692 t_manufacturer="as3525"
@@ -2764,7 +2705,6 @@ fi
2764 output="rockbox.mi4" 2705 output="rockbox.mi4"
2765 appextra="gui" 2706 appextra="gui"
2766 plugins="" 2707 plugins=""
2767 swcodec="yes"
2768 boottool="$rootdir/tools/scramble -mi4v3 -model=view -type=RBBL" 2708 boottool="$rootdir/tools/scramble -mi4v3 -model=view -type=RBBL"
2769 bootoutput="firmware.mi4" 2709 bootoutput="firmware.mi4"
2770 # toolset is the tools within the tools directory that we build for 2710 # toolset is the tools within the tools directory that we build for
@@ -2788,7 +2728,6 @@ fi
2788 bootoutput="bootloader-clipplus.sansa" 2728 bootoutput="bootloader-clipplus.sansa"
2789 appextra="recorder:gui:radio" 2729 appextra="recorder:gui:radio"
2790 plugins="yes" 2730 plugins="yes"
2791 swcodec="yes"
2792 toolset=$scramblebitmaptools 2731 toolset=$scramblebitmaptools
2793 t_cpu="arm" 2732 t_cpu="arm"
2794 t_manufacturer="as3525" 2733 t_manufacturer="as3525"
@@ -2808,7 +2747,6 @@ fi
2808 bootoutput="bootloader-fuzev2.sansa" 2747 bootoutput="bootloader-fuzev2.sansa"
2809 appextra="recorder:gui:radio" 2748 appextra="recorder:gui:radio"
2810 plugins="yes" 2749 plugins="yes"
2811 swcodec="yes"
2812 toolset=$scramblebitmaptools 2750 toolset=$scramblebitmaptools
2813 t_cpu="arm" 2751 t_cpu="arm"
2814 t_manufacturer="as3525" 2752 t_manufacturer="as3525"
@@ -2828,7 +2766,6 @@ fi
2828 bootoutput="bootloader-fuzeplus.sansa" 2766 bootoutput="bootloader-fuzeplus.sansa"
2829 appextra="gui:recorder:radio" 2767 appextra="gui:recorder:radio"
2830 plugins="yes" 2768 plugins="yes"
2831 swcodec="yes"
2832 toolset=$scramblebitmaptools 2769 toolset=$scramblebitmaptools
2833 t_cpu="arm" 2770 t_cpu="arm"
2834 t_manufacturer="imx233" 2771 t_manufacturer="imx233"
@@ -2848,7 +2785,6 @@ fi
2848 bootoutput="bootloader-clipzip.sansa" 2785 bootoutput="bootloader-clipzip.sansa"
2849 appextra="recorder:gui:radio" 2786 appextra="recorder:gui:radio"
2850 plugins="yes" 2787 plugins="yes"
2851 swcodec="yes"
2852 toolset=$scramblebitmaptools 2788 toolset=$scramblebitmaptools
2853 t_cpu="arm" 2789 t_cpu="arm"
2854 t_manufacturer="as3525" 2790 t_manufacturer="as3525"
@@ -2868,7 +2804,6 @@ fi
2868 bootoutput="bootloader-connect.sansa" 2804 bootoutput="bootloader-connect.sansa"
2869 appextra="recorder:gui" 2805 appextra="recorder:gui"
2870 plugins="yes" 2806 plugins="yes"
2871 swcodec="yes"
2872 toolset=$scramblebitmaptools 2807 toolset=$scramblebitmaptools
2873 t_cpu="arm" 2808 t_cpu="arm"
2874 t_manufacturer="tms320dm320" 2809 t_manufacturer="tms320dm320"
@@ -2888,7 +2823,6 @@ fi
2888 output="rockbox.elio" 2823 output="rockbox.elio"
2889 appextra="recorder:gui:radio" 2824 appextra="recorder:gui:radio"
2890 plugins="yes" 2825 plugins="yes"
2891 swcodec="yes"
2892 boottool="$rootdir/tools/scramble -mi4v2" 2826 boottool="$rootdir/tools/scramble -mi4v2"
2893 bootoutput="pp5020.mi4" 2827 bootoutput="pp5020.mi4"
2894 # toolset is the tools within the tools directory that we build for 2828 # toolset is the tools within the tools directory that we build for
@@ -2913,7 +2847,6 @@ fi
2913 output="rockbox.mi4" 2847 output="rockbox.mi4"
2914 appextra="recorder:gui:radio" 2848 appextra="recorder:gui:radio"
2915 plugins="yes" 2849 plugins="yes"
2916 swcodec="yes"
2917 boottool="$rootdir/tools/scramble -mi4v3 -model=9200 -type=RBBL" 2850 boottool="$rootdir/tools/scramble -mi4v3 -model=9200 -type=RBBL"
2918 bootoutput="FWImage.ebn" 2851 bootoutput="FWImage.ebn"
2919 # toolset is the tools within the tools directory that we build for 2852 # toolset is the tools within the tools directory that we build for
@@ -2938,7 +2871,6 @@ fi
2938 output="rockbox.mi4" 2871 output="rockbox.mi4"
2939 appextra="recorder:gui:radio" 2872 appextra="recorder:gui:radio"
2940 plugins="yes" 2873 plugins="yes"
2941 swcodec="yes"
2942 boottool="$rootdir/tools/scramble -mi4v3 -model=1630 -type=RBBL" 2874 boottool="$rootdir/tools/scramble -mi4v3 -model=1630 -type=RBBL"
2943 bootoutput="FWImage.ebn" 2875 bootoutput="FWImage.ebn"
2944 # toolset is the tools within the tools directory that we build for 2876 # toolset is the tools within the tools directory that we build for
@@ -2963,7 +2895,6 @@ fi
2963 output="rockbox.mi4" 2895 output="rockbox.mi4"
2964 appextra="recorder:gui:radio" 2896 appextra="recorder:gui:radio"
2965 plugins="yes" 2897 plugins="yes"
2966 swcodec="yes"
2967 boottool="$rootdir/tools/scramble -mi4v3 -model=6330 -type=RBBL" 2898 boottool="$rootdir/tools/scramble -mi4v3 -model=6330 -type=RBBL"
2968 bootoutput="FWImage.ebn" 2899 bootoutput="FWImage.ebn"
2969 # toolset is the tools within the tools directory that we build for 2900 # toolset is the tools within the tools directory that we build for
@@ -2988,7 +2919,6 @@ fi
2988 output="rockbox.meizu" 2919 output="rockbox.meizu"
2989 appextra="recorder:gui:radio" 2920 appextra="recorder:gui:radio"
2990 plugins="no" #FIXME 2921 plugins="no" #FIXME
2991 swcodec="yes"
2992 toolset=$genericbitmaptools 2922 toolset=$genericbitmaptools
2993 boottool="cp" 2923 boottool="cp"
2994 bootoutput="rockboot.ebn" 2924 bootoutput="rockboot.ebn"
@@ -3010,7 +2940,6 @@ fi
3010 output="rockbox.meizu" 2940 output="rockbox.meizu"
3011 appextra="recorder:gui:radio" 2941 appextra="recorder:gui:radio"
3012 plugins="no" #FIXME 2942 plugins="no" #FIXME
3013 swcodec="yes"
3014 toolset=$genericbitmaptools 2943 toolset=$genericbitmaptools
3015 boottool="cp" 2944 boottool="cp"
3016 bootoutput="rockboot.ebn" 2945 bootoutput="rockboot.ebn"
@@ -3032,7 +2961,6 @@ fi
3032 output="rockbox.meizu" 2961 output="rockbox.meizu"
3033 appextra="recorder:gui:radio" 2962 appextra="recorder:gui:radio"
3034 plugins="no" #FIXME 2963 plugins="no" #FIXME
3035 swcodec="yes"
3036 toolset=$genericbitmaptools 2964 toolset=$genericbitmaptools
3037 boottool="cp" 2965 boottool="cp"
3038 bootoutput="rockboot.ebn" 2966 bootoutput="rockboot.ebn"
@@ -3054,7 +2982,6 @@ fi
3054 output="rockbox.vx747" 2982 output="rockbox.vx747"
3055 appextra="recorder:gui:radio" 2983 appextra="recorder:gui:radio"
3056 plugins="yes" 2984 plugins="yes"
3057 swcodec="yes"
3058 toolset=$genericbitmaptools 2985 toolset=$genericbitmaptools
3059 boottool="$rootdir/tools/scramble -ccpmp" 2986 boottool="$rootdir/tools/scramble -ccpmp"
3060 bootoutput="ccpmp.bin" 2987 bootoutput="ccpmp.bin"
@@ -3076,7 +3003,6 @@ fi
3076 output="rockbox.vx767" 3003 output="rockbox.vx767"
3077 appextra="recorder:gui:radio" 3004 appextra="recorder:gui:radio"
3078 plugins="" #FIXME 3005 plugins="" #FIXME
3079 swcodec="yes"
3080 toolset=$genericbitmaptools 3006 toolset=$genericbitmaptools
3081 boottool="$rootdir/tools/scramble -ccpmp" 3007 boottool="$rootdir/tools/scramble -ccpmp"
3082 bootoutput="ccpmp.bin" 3008 bootoutput="ccpmp.bin"
@@ -3098,7 +3024,6 @@ fi
3098 output="rockbox.vx747p" 3024 output="rockbox.vx747p"
3099 appextra="recorder:gui:radio" 3025 appextra="recorder:gui:radio"
3100 plugins="yes" 3026 plugins="yes"
3101 swcodec="yes"
3102 toolset=$genericbitmaptools 3027 toolset=$genericbitmaptools
3103 boottool="$rootdir/tools/scramble -ccpmp" 3028 boottool="$rootdir/tools/scramble -ccpmp"
3104 bootoutput="ccpmp.bin" 3029 bootoutput="ccpmp.bin"
@@ -3120,7 +3045,6 @@ fi
3120 output="rockbox.vx777" 3045 output="rockbox.vx777"
3121 appextra="recorder:gui:radio" 3046 appextra="recorder:gui:radio"
3122 plugins="yes" 3047 plugins="yes"
3123 swcodec="yes"
3124 toolset=$genericbitmaptools 3048 toolset=$genericbitmaptools
3125 boottool="$rootdir/tools/scramble -ccpmp" 3049 boottool="$rootdir/tools/scramble -ccpmp"
3126 bootoutput="ccpmp.bin" 3050 bootoutput="ccpmp.bin"
@@ -3142,7 +3066,6 @@ fi
3142 output="rockbox.lyre" 3066 output="rockbox.lyre"
3143 appextra="recorder:gui:radio" 3067 appextra="recorder:gui:radio"
3144 plugins="" 3068 plugins=""
3145 swcodec="yes"
3146 toolset=$scramblebitmaptools 3069 toolset=$scramblebitmaptools
3147 boottool="cp" 3070 boottool="cp"
3148 bootoutput="bootloader-proto1.lyre" 3071 bootoutput="bootloader-proto1.lyre"
@@ -3164,7 +3087,6 @@ fi
3164 output="rockbox.mini2440" 3087 output="rockbox.mini2440"
3165 appextra="recorder:gui:radio" 3088 appextra="recorder:gui:radio"
3166 plugins="" 3089 plugins=""
3167 swcodec="yes"
3168 toolset=$scramblebitmaptools 3090 toolset=$scramblebitmaptools
3169 boottool="cp" 3091 boottool="cp"
3170 bootoutput="bootloader-mini2440.lyre" 3092 bootoutput="bootloader-mini2440.lyre"
@@ -3186,7 +3108,6 @@ fi
3186 output="rockbox.mi4" 3108 output="rockbox.mi4"
3187 appextra="recorder:gui:radio" 3109 appextra="recorder:gui:radio"
3188 plugins="yes" 3110 plugins="yes"
3189 swcodec="yes"
3190 boottool="$rootdir/tools/scramble -mi4v2 -model=y820 -type=RBBL" 3111 boottool="$rootdir/tools/scramble -mi4v2 -model=y820 -type=RBBL"
3191 bootoutput="FW_YH820.mi4" 3112 bootoutput="FW_YH820.mi4"
3192 # toolset is the tools within the tools directory that we build for 3113 # toolset is the tools within the tools directory that we build for
@@ -3211,7 +3132,6 @@ fi
3211 output="rockbox.mi4" 3132 output="rockbox.mi4"
3212 appextra="recorder:gui:radio" 3133 appextra="recorder:gui:radio"
3213 plugins="yes" 3134 plugins="yes"
3214 swcodec="yes"
3215 boottool="$rootdir/tools/scramble -mi4v2 -model=y920 -type=RBBL" 3135 boottool="$rootdir/tools/scramble -mi4v2 -model=y920 -type=RBBL"
3216 bootoutput="PP5020.mi4" 3136 bootoutput="PP5020.mi4"
3217 # toolset is the tools within the tools directory that we build for 3137 # toolset is the tools within the tools directory that we build for
@@ -3236,7 +3156,6 @@ fi
3236 output="rockbox.mi4" 3156 output="rockbox.mi4"
3237 appextra="recorder:gui:radio" 3157 appextra="recorder:gui:radio"
3238 plugins="yes" 3158 plugins="yes"
3239 swcodec="yes"
3240 boottool="$rootdir/tools/scramble -mi4v2 -model=y925 -type=RBBL" 3159 boottool="$rootdir/tools/scramble -mi4v2 -model=y925 -type=RBBL"
3241 bootoutput="FW_YH925.mi4" 3160 bootoutput="FW_YH925.mi4"
3242 # toolset is the tools within the tools directory that we build for 3161 # toolset is the tools within the tools directory that we build for
@@ -3261,7 +3180,6 @@ fi
3261 output="rockbox.yps3" 3180 output="rockbox.yps3"
3262 appextra="recorder:gui:radio" 3181 appextra="recorder:gui:radio"
3263 plugins="no" #FIXME 3182 plugins="no" #FIXME
3264 swcodec="yes"
3265 toolset=$genericbitmaptools 3183 toolset=$genericbitmaptools
3266 boottool="cp" 3184 boottool="cp"
3267 bootoutput="rockboot.ebn" 3185 bootoutput="rockboot.ebn"
@@ -3283,7 +3201,6 @@ fi
3283 bootoutput="bootloader-ypz5.samsung" 3201 bootoutput="bootloader-ypz5.samsung"
3284 appextra="gui:recorder:radio" 3202 appextra="gui:recorder:radio"
3285 plugins="" 3203 plugins=""
3286 swcodec="yes"
3287 toolset=$scramblebitmaptools 3204 toolset=$scramblebitmaptools
3288 t_cpu="arm" 3205 t_cpu="arm"
3289 t_manufacturer="imx233" 3206 t_manufacturer="imx233"
@@ -3303,7 +3220,6 @@ fi
3303 output="rockbox.mi4" 3220 output="rockbox.mi4"
3304 appextra="recorder:gui:radio" 3221 appextra="recorder:gui:radio"
3305 plugins="yes" 3222 plugins="yes"
3306 swcodec="yes"
3307 boottool="$rootdir/tools/scramble -mi4v3 -model=v500 -type=RBBL" 3223 boottool="$rootdir/tools/scramble -mi4v3 -model=v500 -type=RBBL"
3308 bootoutput="jukebox.mi4" 3224 bootoutput="jukebox.mi4"
3309 # toolset is the tools within the tools directory that we build for 3225 # toolset is the tools within the tools directory that we build for
@@ -3329,7 +3245,6 @@ fi
3329 bootoutput="bootloader.mpio" 3245 bootoutput="bootloader.mpio"
3330 appextra="recorder:gui:radio" 3246 appextra="recorder:gui:radio"
3331 plugins="yes" 3247 plugins="yes"
3332 swcodec="yes"
3333 # toolset is the tools within the tools directory that we build for 3248 # toolset is the tools within the tools directory that we build for
3334 # this particular target. 3249 # this particular target.
3335 toolset="$genericbitmaptools" 3250 toolset="$genericbitmaptools"
@@ -3352,7 +3267,6 @@ fi
3352 bootoutput="bootloader.mpio" 3267 bootoutput="bootloader.mpio"
3353 appextra="recorder:gui:radio" 3268 appextra="recorder:gui:radio"
3354 plugins="yes" 3269 plugins="yes"
3355 swcodec="yes"
3356 # toolset is the tools within the tools directory that we build for 3270 # toolset is the tools within the tools directory that we build for
3357 # this particular target. 3271 # this particular target.
3358 toolset="$genericbitmaptools" 3272 toolset="$genericbitmaptools"
@@ -3375,7 +3289,6 @@ fi
3375 bootoutput="bootloader.rkw" 3289 bootoutput="bootloader.rkw"
3376 appextra="recorder:gui:radio" 3290 appextra="recorder:gui:radio"
3377 plugins="" 3291 plugins=""
3378 swcodec="yes"
3379 # toolset is the tools within the tools directory that we build for 3292 # toolset is the tools within the tools directory that we build for
3380 # this particular target. 3293 # this particular target.
3381 toolset="$genericbitmaptools" 3294 toolset="$genericbitmaptools"
@@ -3398,7 +3311,6 @@ fi
3398 bootoutput="bootloader.rkw" 3311 bootoutput="bootloader.rkw"
3399 appextra="recorder:gui" 3312 appextra="recorder:gui"
3400 plugins="yes" 3313 plugins="yes"
3401 swcodec="yes"
3402 # toolset is the tools within the tools directory that we build for 3314 # toolset is the tools within the tools directory that we build for
3403 # this particular target. 3315 # this particular target.
3404 toolset="$genericbitmaptools" 3316 toolset="$genericbitmaptools"
@@ -3421,7 +3333,6 @@ fi
3421 bootoutput="bootloader.rkw" 3333 bootoutput="bootloader.rkw"
3422 appextra="recorder:gui" 3334 appextra="recorder:gui"
3423 plugins="yes" 3335 plugins="yes"
3424 swcodec="yes"
3425 # toolset is the tools within the tools directory that we build for 3336 # toolset is the tools within the tools directory that we build for
3426 # this particular target. 3337 # this particular target.
3427 toolset="$genericbitmaptools" 3338 toolset="$genericbitmaptools"
@@ -3449,7 +3360,6 @@ fi
3449 bootoutput="rockbox" 3360 bootoutput="rockbox"
3450 appextra="recorder:gui:radio" 3361 appextra="recorder:gui:radio"
3451 plugins="yes" 3362 plugins="yes"
3452 swcodec="yes"
3453 # architecture, manufacturer and model for the target-tree build 3363 # architecture, manufacturer and model for the target-tree build
3454 t_cpu="hosted" 3364 t_cpu="hosted"
3455 t_manufacturer="sdl" 3365 t_manufacturer="sdl"
@@ -3477,7 +3387,6 @@ fi
3477 bootoutput="librockbox.so" 3387 bootoutput="librockbox.so"
3478 appextra="recorder:gui:radio:hosted/android" 3388 appextra="recorder:gui:radio:hosted/android"
3479 plugins="yes" 3389 plugins="yes"
3480 swcodec="yes"
3481 # architecture, manufacturer and model for the target-tree build 3390 # architecture, manufacturer and model for the target-tree build
3482 t_cpu="hosted" 3391 t_cpu="hosted"
3483 t_manufacturer="android" 3392 t_manufacturer="android"
@@ -3504,7 +3413,6 @@ fi
3504 bootoutput="rockbox" 3413 bootoutput="rockbox"
3505 appextra="recorder:gui:radio" 3414 appextra="recorder:gui:radio"
3506 plugins="yes" 3415 plugins="yes"
3507 swcodec="yes"
3508 # architecture, manufacturer and model for the target-tree build 3416 # architecture, manufacturer and model for the target-tree build
3509 t_cpu="hosted" 3417 t_cpu="hosted"
3510 t_manufacturer="maemo" 3418 t_manufacturer="maemo"
@@ -3531,7 +3439,6 @@ fi
3531 bootoutput="rockbox" 3439 bootoutput="rockbox"
3532 appextra="recorder:gui:radio" 3440 appextra="recorder:gui:radio"
3533 plugins="yes" 3441 plugins="yes"
3534 swcodec="yes"
3535 # architecture, manufacturer and model for the target-tree build 3442 # architecture, manufacturer and model for the target-tree build
3536 t_cpu="hosted" 3443 t_cpu="hosted"
3537 t_manufacturer="maemo" 3444 t_manufacturer="maemo"
@@ -3558,7 +3465,6 @@ fi
3558 bootoutput="rockbox" 3465 bootoutput="rockbox"
3559 appextra="recorder:gui:radio" 3466 appextra="recorder:gui:radio"
3560 plugins="yes" 3467 plugins="yes"
3561 swcodec="yes"
3562 # architecture, manufacturer and model for the target-tree build 3468 # architecture, manufacturer and model for the target-tree build
3563 t_cpu="hosted" 3469 t_cpu="hosted"
3564 t_manufacturer="pandora" 3470 t_manufacturer="pandora"
@@ -3581,7 +3487,6 @@ fi
3581 bootoutput="rockbox" 3487 bootoutput="rockbox"
3582 appextra="recorder:gui:radio" 3488 appextra="recorder:gui:radio"
3583 plugins="yes" 3489 plugins="yes"
3584 swcodec="yes"
3585 # architecture, manufacturer and model for the target-tree build 3490 # architecture, manufacturer and model for the target-tree build
3586 t_cpu="hosted" 3491 t_cpu="hosted"
3587 t_manufacturer="samsungypr" 3492 t_manufacturer="samsungypr"
@@ -3609,7 +3514,6 @@ fi
3609 bootoutput="librockbox.so" 3514 bootoutput="librockbox.so"
3610 appextra="recorder:gui:radio:hosted/android" 3515 appextra="recorder:gui:radio:hosted/android"
3611 plugins="yes" 3516 plugins="yes"
3612 swcodec="yes"
3613 # architecture, manufacturer and model for the target-tree build 3517 # architecture, manufacturer and model for the target-tree build
3614 t_cpu="hosted" 3518 t_cpu="hosted"
3615 t_manufacturer="android" 3519 t_manufacturer="android"
@@ -3637,7 +3541,6 @@ fi
3637 bootoutput="librockbox.so" 3541 bootoutput="librockbox.so"
3638 appextra="recorder:gui:radio:hosted/android" 3542 appextra="recorder:gui:radio:hosted/android"
3639 plugins="yes" 3543 plugins="yes"
3640 swcodec="yes"
3641 # architecture, manufacturer and model for the target-tree build 3544 # architecture, manufacturer and model for the target-tree build
3642 t_cpu="hosted" 3545 t_cpu="hosted"
3643 t_manufacturer="android" 3546 t_manufacturer="android"
@@ -3661,7 +3564,6 @@ fi
3661 bootoutput="rockbox" 3564 bootoutput="rockbox"
3662 appextra="recorder:gui:radio" 3565 appextra="recorder:gui:radio"
3663 plugins="yes" 3566 plugins="yes"
3664 swcodec="yes"
3665 # architecture, manufacturer and model for the target-tree build 3567 # architecture, manufacturer and model for the target-tree build
3666 t_cpu="hosted" 3568 t_cpu="hosted"
3667 t_manufacturer="samsungypr" 3569 t_manufacturer="samsungypr"
@@ -3681,7 +3583,6 @@ fi
3681 bootoutput="bootloader.rkw" 3583 bootoutput="bootloader.rkw"
3682 appextra="recorder:gui" 3584 appextra="recorder:gui"
3683 plugins="" 3585 plugins=""
3684 swcodec="yes"
3685 # toolset is the tools within the tools directory that we build for 3586 # toolset is the tools within the tools directory that we build for
3686 # this particular target. 3587 # this particular target.
3687 toolset="$genericbitmaptools" 3588 toolset="$genericbitmaptools"
@@ -3704,7 +3605,6 @@ fi
3704 bootoutput="bootloader.rkw" 3605 bootoutput="bootloader.rkw"
3705 appextra="recorder:gui" 3606 appextra="recorder:gui"
3706 plugins="" 3607 plugins=""
3707 swcodec="yes"
3708 # toolset is the tools within the tools directory that we build for 3608 # toolset is the tools within the tools directory that we build for
3709 # this particular target. 3609 # this particular target.
3710 toolset="$genericbitmaptools" 3610 toolset="$genericbitmaptools"
@@ -3727,7 +3627,6 @@ fi
3727 bootoutput="bootloader.rkw" 3627 bootoutput="bootloader.rkw"
3728 appextra="recorder:gui" 3628 appextra="recorder:gui"
3729 plugins="" 3629 plugins=""
3730 swcodec="yes"
3731 # toolset is the tools within the tools directory that we build for 3630 # toolset is the tools within the tools directory that we build for
3732 # this particular target. 3631 # this particular target.
3733 toolset="$genericbitmaptools" 3632 toolset="$genericbitmaptools"
@@ -3750,7 +3649,6 @@ fi
3750 bootoutput="bootloader.rkw" 3649 bootoutput="bootloader.rkw"
3751 appextra="recorder:gui" 3650 appextra="recorder:gui"
3752 plugins="" 3651 plugins=""
3753 swcodec="yes"
3754 # toolset is the tools within the tools directory that we build for 3652 # toolset is the tools within the tools directory that we build for
3755 # this particular target. 3653 # this particular target.
3756 toolset="$genericbitmaptools" 3654 toolset="$genericbitmaptools"
@@ -3774,7 +3672,6 @@ fi
3774 bootoutput="bootloader-nwze350.sony" 3672 bootoutput="bootloader-nwze350.sony"
3775 appextra="gui:recorder:radio" 3673 appextra="gui:recorder:radio"
3776 plugins="yes" 3674 plugins="yes"
3777 swcodec="yes"
3778 toolset=$genericbitmaptools 3675 toolset=$genericbitmaptools
3779 t_cpu="hosted" 3676 t_cpu="hosted"
3780 t_manufacturer="sonynwz" 3677 t_manufacturer="sonynwz"
@@ -3795,7 +3692,6 @@ fi
3795 bootoutput="bootloader-nwze370.sony" 3692 bootoutput="bootloader-nwze370.sony"
3796 appextra="gui:recorder:radio" 3693 appextra="gui:recorder:radio"
3797 plugins="yes" 3694 plugins="yes"
3798 swcodec="yes"
3799 toolset=$scramblebitmaptools 3695 toolset=$scramblebitmaptools
3800 t_cpu="arm" 3696 t_cpu="arm"
3801 t_manufacturer="imx233" 3697 t_manufacturer="imx233"
@@ -3815,7 +3711,6 @@ fi
3815 bootoutput="bootloader-nwze360.sony" 3711 bootoutput="bootloader-nwze360.sony"
3816 appextra="gui:recorder:radio" 3712 appextra="gui:recorder:radio"
3817 plugins="yes" 3713 plugins="yes"
3818 swcodec="yes"
3819 toolset=$scramblebitmaptools 3714 toolset=$scramblebitmaptools
3820 t_cpu="arm" 3715 t_cpu="arm"
3821 t_manufacturer="imx233" 3716 t_manufacturer="imx233"
@@ -3837,7 +3732,6 @@ fi
3837 bootoutput="bootloader-nwze450.sony" 3732 bootoutput="bootloader-nwze450.sony"
3838 appextra="gui:recorder:radio" 3733 appextra="gui:recorder:radio"
3839 plugins="yes" 3734 plugins="yes"
3840 swcodec="yes"
3841 toolset=$genericbitmaptools 3735 toolset=$genericbitmaptools
3842 t_cpu="hosted" 3736 t_cpu="hosted"
3843 t_manufacturer="sonynwz" 3737 t_manufacturer="sonynwz"
@@ -3860,7 +3754,6 @@ fi
3860 bootoutput="bootloader-nwze460.sony" 3754 bootoutput="bootloader-nwze460.sony"
3861 appextra="gui:recorder:radio" 3755 appextra="gui:recorder:radio"
3862 plugins="yes" 3756 plugins="yes"
3863 swcodec="yes"
3864 toolset=$genericbitmaptools 3757 toolset=$genericbitmaptools
3865 t_cpu="hosted" 3758 t_cpu="hosted"
3866 t_manufacturer="sonynwz" 3759 t_manufacturer="sonynwz"
@@ -3883,7 +3776,6 @@ fi
3883 bootoutput="bootloader-nwze470.sony" 3776 bootoutput="bootloader-nwze470.sony"
3884 appextra="gui:recorder:radio" 3777 appextra="gui:recorder:radio"
3885 plugins="yes" 3778 plugins="yes"
3886 swcodec="yes"
3887 toolset=$genericbitmaptools 3779 toolset=$genericbitmaptools
3888 t_cpu="hosted" 3780 t_cpu="hosted"
3889 t_manufacturer="sonynwz" 3781 t_manufacturer="sonynwz"
@@ -3906,7 +3798,6 @@ fi
3906 bootoutput="bootloader-nwze580.sony" 3798 bootoutput="bootloader-nwze580.sony"
3907 appextra="gui:recorder:radio" 3799 appextra="gui:recorder:radio"
3908 plugins="yes" 3800 plugins="yes"
3909 swcodec="yes"
3910 toolset=$genericbitmaptools 3801 toolset=$genericbitmaptools
3911 t_cpu="hosted" 3802 t_cpu="hosted"
3912 t_manufacturer="sonynwz" 3803 t_manufacturer="sonynwz"
@@ -3929,7 +3820,6 @@ fi
3929 bootoutput="bootloader-nwza10.sony" 3820 bootoutput="bootloader-nwza10.sony"
3930 appextra="gui:recorder:radio" 3821 appextra="gui:recorder:radio"
3931 plugins="yes" 3822 plugins="yes"
3932 swcodec="yes"
3933 toolset=$genericbitmaptools 3823 toolset=$genericbitmaptools
3934 t_cpu="hosted" 3824 t_cpu="hosted"
3935 t_manufacturer="sonynwz" 3825 t_manufacturer="sonynwz"
@@ -3952,7 +3842,6 @@ fi
3952 bootoutput="bootloader-nwa20.sony" 3842 bootoutput="bootloader-nwa20.sony"
3953 appextra="gui:recorder:radio" 3843 appextra="gui:recorder:radio"
3954 plugins="yes" 3844 plugins="yes"
3955 swcodec="yes"
3956 toolset=$genericbitmaptools 3845 toolset=$genericbitmaptools
3957 t_cpu="hosted" 3846 t_cpu="hosted"
3958 t_manufacturer="sonynwz" 3847 t_manufacturer="sonynwz"
@@ -3975,7 +3864,6 @@ fi
3975 bootoutput="bootloader-nwza860.sony" 3864 bootoutput="bootloader-nwza860.sony"
3976 appextra="gui:recorder:radio" 3865 appextra="gui:recorder:radio"
3977 plugins="" 3866 plugins=""
3978 swcodec="yes"
3979 toolset=$genericbitmaptools 3867 toolset=$genericbitmaptools
3980 t_cpu="hosted" 3868 t_cpu="hosted"
3981 t_manufacturer="sonynwz" 3869 t_manufacturer="sonynwz"
@@ -3998,7 +3886,6 @@ fi
3998 bootoutput="bootloader-nwzs750.sony" 3886 bootoutput="bootloader-nwzs750.sony"
3999 appextra="gui:recorder:radio" 3887 appextra="gui:recorder:radio"
4000 plugins="yes" 3888 plugins="yes"
4001 swcodec="yes"
4002 toolset=$genericbitmaptools 3889 toolset=$genericbitmaptools
4003 t_cpu="hosted" 3890 t_cpu="hosted"
4004 t_manufacturer="sonynwz" 3891 t_manufacturer="sonynwz"
@@ -4020,7 +3907,6 @@ fi
4020 bootoutput="bootloader.rkw" 3907 bootoutput="bootloader.rkw"
4021 appextra="recorder:gui" 3908 appextra="recorder:gui"
4022 plugins="" 3909 plugins=""
4023 swcodec="yes"
4024 # toolset is the tools within the tools directory that we build for 3910 # toolset is the tools within the tools directory that we build for
4025 # this particular target. 3911 # this particular target.
4026 toolset="$genericbitmaptools" 3912 toolset="$genericbitmaptools"
@@ -4043,7 +3929,6 @@ fi
4043 bootoutput="bootloader.rkw" 3929 bootoutput="bootloader.rkw"
4044 appextra="recorder:gui" 3930 appextra="recorder:gui"
4045 plugins="" 3931 plugins=""
4046 swcodec="yes"
4047 # toolset is the tools within the tools directory that we build for 3932 # toolset is the tools within the tools directory that we build for
4048 # this particular target. 3933 # this particular target.
4049 toolset="$genericbitmaptools" 3934 toolset="$genericbitmaptools"
@@ -4072,7 +3957,6 @@ fi
4072 bootoutput="rockbox" 3957 bootoutput="rockbox"
4073 appextra="recorder:gui:hosted" 3958 appextra="recorder:gui:hosted"
4074 plugins="yes" 3959 plugins="yes"
4075 swcodec="yes"
4076 # architecture, manufacturer and model for the target-tree build 3960 # architecture, manufacturer and model for the target-tree build
4077 t_cpu="hosted" 3961 t_cpu="hosted"
4078 t_manufacturer="ibasso" 3962 t_manufacturer="ibasso"
@@ -4097,7 +3981,6 @@ fi
4097 bootoutput="rockbox" 3981 bootoutput="rockbox"
4098 appextra="recorder:gui:hosted" 3982 appextra="recorder:gui:hosted"
4099 plugins="yes" 3983 plugins="yes"
4100 swcodec="yes"
4101 # architecture, manufacturer and model for the target-tree build 3984 # architecture, manufacturer and model for the target-tree build
4102 t_cpu="hosted" 3985 t_cpu="hosted"
4103 t_manufacturer="ibasso" 3986 t_manufacturer="ibasso"
@@ -4119,7 +4002,6 @@ fi
4119 bootoutput="bootloader.rocker" 4002 bootoutput="bootloader.rocker"
4120 appextra="recorder:gui:hosted" 4003 appextra="recorder:gui:hosted"
4121 plugins="yes" 4004 plugins="yes"
4122 swcodec="yes"
4123 # architecture, manufacturer and model for the target-tree build 4005 # architecture, manufacturer and model for the target-tree build
4124 t_cpu="hosted" 4006 t_cpu="hosted"
4125 t_manufacturer="agptek" 4007 t_manufacturer="agptek"
@@ -4139,7 +4021,6 @@ fi
4139 output="rockbox.x3" 4021 output="rockbox.x3"
4140 appextra="recorder:gui:radio" 4022 appextra="recorder:gui:radio"
4141 plugins="yes" 4023 plugins="yes"
4142 swcodec="yes"
4143 toolset=$genericbitmaptools 4024 toolset=$genericbitmaptools
4144 boottool="cp" 4025 boottool="cp"
4145 bootoutput="bootloader-x3.bin" 4026 bootoutput="bootloader-x3.bin"
@@ -4165,7 +4046,6 @@ fi
4165 bootoutput="bootloader.x3ii" 4046 bootoutput="bootloader.x3ii"
4166 appextra="recorder:gui:hosted" 4047 appextra="recorder:gui:hosted"
4167 plugins="yes" 4048 plugins="yes"
4168 swcodec="yes"
4169 # architecture, manufacturer and model for the target-tree build 4049 # architecture, manufacturer and model for the target-tree build
4170 t_cpu="hosted" 4050 t_cpu="hosted"
4171 t_manufacturer="xduoo" 4051 t_manufacturer="xduoo"
@@ -4188,7 +4068,6 @@ fi
4188 bootoutput="bootloader.x20" 4068 bootoutput="bootloader.x20"
4189 appextra="recorder:gui:hosted" 4069 appextra="recorder:gui:hosted"
4190 plugins="yes" 4070 plugins="yes"
4191 swcodec="yes"
4192 # architecture, manufacturer and model for the target-tree build 4071 # architecture, manufacturer and model for the target-tree build
4193 t_cpu="hosted" 4072 t_cpu="hosted"
4194 t_manufacturer="xduoo" 4073 t_manufacturer="xduoo"
@@ -4208,7 +4087,6 @@ fi
4208 bootoutput="bootloader.rkw" 4087 bootoutput="bootloader.rkw"
4209 appextra="recorder:gui" 4088 appextra="recorder:gui"
4210 plugins="yes" 4089 plugins="yes"
4211 swcodec="yes"
4212 # toolset is the tools within the tools directory that we build for 4090 # toolset is the tools within the tools directory that we build for
4213 # this particular target. 4091 # this particular target.
4214 toolset="$genericbitmaptools" 4092 toolset="$genericbitmaptools"
@@ -4231,7 +4109,6 @@ fi
4231 bootoutput="bootloader.rkw" 4109 bootoutput="bootloader.rkw"
4232 appextra="recorder:gui" 4110 appextra="recorder:gui"
4233 plugins="yes" 4111 plugins="yes"
4234 swcodec="yes"
4235 # toolset is the tools within the tools directory that we build for 4112 # toolset is the tools within the tools directory that we build for
4236 # this particular target. 4113 # this particular target.
4237 toolset="$genericbitmaptools" 4114 toolset="$genericbitmaptools"
@@ -4254,7 +4131,6 @@ fi
4254 bootoutput="bootloader.rkw" 4131 bootoutput="bootloader.rkw"
4255 appextra="recorder:gui" 4132 appextra="recorder:gui"
4256 plugins="yes" 4133 plugins="yes"
4257 swcodec="yes"
4258 # toolset is the tools within the tools directory that we build for 4134 # toolset is the tools within the tools directory that we build for
4259 # this particular target. 4135 # this particular target.
4260 toolset="$genericbitmaptools" 4136 toolset="$genericbitmaptools"
@@ -4793,11 +4669,7 @@ if test -n "$t_cpu"; then
4793 GCCOPTS="$GCCOPTS" 4669 GCCOPTS="$GCCOPTS"
4794fi 4670fi
4795 4671
4796if test "$swcodec" = "yes"; then 4672voicetoolset="rbspeexenc voicefont wavtrim"
4797 voicetoolset="rbspeexenc voicefont wavtrim"
4798else
4799 voicetoolset="voicefont wavtrim"
4800fi
4801 4673
4802if test "$apps" = "apps"; then 4674if test "$apps" = "apps"; then
4803 # only when we build "real" apps we build the .lng files 4675 # only when we build "real" apps we build the .lng files
@@ -4853,7 +4725,6 @@ export BMP2RB_REMOTENATIVE=${bmp2rb_remotenative}
4853export BINARY=${output} 4725export BINARY=${output}
4854export APPEXTRA=${appextra} 4726export APPEXTRA=${appextra}
4855export ENABLEDPLUGINS=${plugins} 4727export ENABLEDPLUGINS=${plugins}
4856export SOFTWARECODECS=${swcodec}
4857export EXTRA_DEFINES=${extradefines} 4728export EXTRA_DEFINES=${extradefines}
4858export HOSTCC=${HOSTCC} 4729export HOSTCC=${HOSTCC}
4859export HOSTAR=${HOSTAR} 4730export HOSTAR=${HOSTAR}
diff --git a/tools/database/SOURCES b/tools/database/SOURCES
index 36d6247092..ca1775022c 100644
--- a/tools/database/SOURCES
+++ b/tools/database/SOURCES
@@ -20,10 +20,4 @@ database.c
20#else /* !APPLICATION */ 20#else /* !APPLICATION */
21../../uisimulator/common/filesystem-sim.c 21../../uisimulator/common/filesystem-sim.c
22#endif /* APPLICATION */ 22#endif /* APPLICATION */
23#if CONFIG_CODEC != SWCODEC
24../../lib/rbcodec/metadata/id3tags.c
25../../lib/rbcodec/metadata/metadata.c
26../../lib/rbcodec/metadata/mp3.c
27../../lib/rbcodec/metadata/mp3data.c
28#endif
29/* Caution. metadata files do not add!! */ 23/* Caution. metadata files do not add!! */
diff --git a/tools/database/database.make b/tools/database/database.make
index 7fc360232e..dfe632446b 100644
--- a/tools/database/database.make
+++ b/tools/database/database.make
@@ -38,10 +38,8 @@ INCLUDES += -I$(ROOTDIR)/apps/gui \
38 -I$(ROOTDIR)/lib/rbcodec/dsp \ 38 -I$(ROOTDIR)/lib/rbcodec/dsp \
39 -I$(APPSDIR) \ 39 -I$(APPSDIR) \
40 -I$(BUILDDIR) 40 -I$(BUILDDIR)
41 41
42ifdef SOFTWARECODECS
43OTHERLIBS := $(FIXEDPOINTLIB) 42OTHERLIBS := $(FIXEDPOINTLIB)
44endif
45 43
46.SECONDEXPANSION: # $$(OBJ) is not populated until after this 44.SECONDEXPANSION: # $$(OBJ) is not populated until after this
47 45
diff --git a/uisimulator/common/stubs.c b/uisimulator/common/stubs.c
index 9374a97d66..5c8e03d6f8 100644
--- a/uisimulator/common/stubs.c
+++ b/uisimulator/common/stubs.c
@@ -35,75 +35,6 @@
35 35
36static bool storage_spinning = false; 36static bool storage_spinning = false;
37 37
38#if CONFIG_CODEC != SWCODEC
39#include "mp3_playback.h"
40
41void audio_set_buffer_margin(int seconds)
42{
43 (void)seconds;
44}
45
46/* list of tracks in memory */
47#define MAX_ID3_TAGS (1<<4) /* Must be power of 2 */
48#define MAX_ID3_TAGS_MASK (MAX_ID3_TAGS - 1)
49
50static bool paused; /* playback is paused */
51static bool playing; /* We are playing an MP3 stream */
52
53bool audio_is_initialized = false;
54
55void mp3_init(int volume, int bass, int treble, int balance, int loudness,
56 int avc, int channel_config, int stereo_width,
57 int mdb_strength, int mdb_harmonics,
58 int mdb_center, int mdb_shape, bool mdb_enable,
59 bool superbass)
60{
61 (void)volume;
62 (void)bass;
63 (void)treble;
64 (void)balance;
65 (void)loudness;
66 (void)avc;
67 (void)channel_config;
68 (void)stereo_width;
69 (void)mdb_strength;
70 (void)mdb_harmonics;
71 (void)mdb_center;
72 (void)mdb_shape;
73 (void)mdb_enable;
74 (void)superbass;
75 audio_is_initialized = true;
76
77 playing = false;
78 paused = true;
79}
80
81void mp3_play_pause(bool play)
82{
83 (void)play;
84}
85
86void mp3_play_stop(void)
87{
88}
89
90unsigned char* mp3_get_pos(void)
91{
92 return NULL;
93}
94
95void mp3_play_data(const void* start, size_t size,
96 mp3_play_callback_t get_more)
97{
98 (void)start; (void)size; (void)get_more;
99}
100
101void mp3_shutdown(void)
102{
103}
104
105#endif /* CODEC != SWCODEC */
106
107int fat_startsector(void) 38int fat_startsector(void)
108{ 39{
109 return 63; 40 return 63;