Rockbox open source high quality audio player as a Music Player Daemon
mpris rockbox mpd libadwaita audio rust zig deno
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

[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

+322 -5594
-6
apps/SOURCES
··· 19 19 #if CONFIG_TUNER 20 20 menus/radio_menu.c 21 21 #endif 22 - #if CONFIG_CODEC == SWCODEC 23 22 #ifdef HAVE_WM8978 24 23 menus/audiohw_eq_menu.c 25 24 #endif ··· 27 26 buffering.c 28 27 voice_thread.c 29 28 rbcodec_helpers.c 30 - #else /* !SWCODEC */ 31 - mpeg.c 32 - #endif 33 29 menus/main_menu.c 34 30 menus/playback_menu.c 35 31 menus/playlist_menu.c ··· 163 159 #endif 164 160 #endif 165 161 166 - #if CONFIG_CODEC == SWCODEC 167 162 #if INPUT_SRC_CAPS != 0 168 163 audio_path.c 169 164 #endif /* INPUT_SRC_CAPS != 0 */ ··· 178 173 #ifdef HAVE_RECORDING 179 174 enc_config.c 180 175 recorder/pcm_record.c 181 - #endif 182 176 #endif 183 177 #ifdef USB_ENABLE_HID 184 178 usb_keymaps.c
-46
apps/abrepeat.c
··· 39 39 } 40 40 41 41 42 - #if (CONFIG_CODEC == SWCODEC) 43 42 void ab_end_of_track_report(void) 44 43 { 45 44 if ( ab_A_marker_set() && ! ab_B_marker_set() ) ··· 47 46 ab_jump_to_A_marker(); 48 47 } 49 48 } 50 - #else 51 - static 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 83 50 void ab_repeat_init(void) 84 51 { ··· 86 53 if ( ! ab_initialized ) 87 54 { 88 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 79 117 80 void 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 82 audio_ff_rewind(ab_A_marker); 125 - #if (CONFIG_CODEC != SWCODEC) 126 - if ( ! paused ) 127 - audio_resume(); 128 - #endif 129 83 } 130 84 131 85 void ab_reset_markers(void)
-11
apps/abrepeat.h
··· 41 41 * The actual positions are returned via output parameter */ 42 42 bool ab_get_A_marker(unsigned int *song_position); 43 43 bool ab_get_B_marker(unsigned int *song_position); 44 - #if (CONFIG_CODEC == SWCODEC) 45 44 void ab_end_of_track_report(void); 46 - #endif 47 45 48 46 /* These functions really need to be inlined for speed */ 49 47 extern unsigned int ab_A_marker; ··· 59 57 /* following is the size of the window in which we'll detect that the B marker 60 58 was hit; it must be larger than the frequency (in milliseconds) at which this 61 59 function is called otherwise detection of the B marker will be unreliable */ 62 - #if (CONFIG_CODEC == SWCODEC) 63 60 /* On swcodec, the worst case seems to be 9600kHz with 1024 samples between 64 61 * calls, meaning ~9 calls per second, look within 1/5 of a second */ 65 62 #define B_MARKER_DETECT_WINDOW 200 66 - #else 67 - /* we assume that this function will be called on each system tick and derive 68 - the window size from this with a generous margin of error (note: the number 69 - of ticks per second is given by HZ) */ 70 - #define B_MARKER_DETECT_WINDOW ((1000/HZ)*10) 71 - #endif 72 63 if (ab_B_marker != AB_MARKER_NONE) 73 64 { 74 65 if ( (song_position >= ab_B_marker) ··· 78 69 return false; 79 70 } 80 71 81 - #if (CONFIG_CODEC == SWCODEC) 82 72 static inline void ab_position_report(unsigned long position) 83 73 { 84 74 if (ab_repeat_mode_enabled()) ··· 90 80 } 91 81 } 92 82 } 93 - #endif 94 83 95 84 #endif 96 85
-2
apps/action.c
··· 832 832 last->data = button_get_data(); 833 833 last->tick = current_tick; 834 834 835 - #if CONFIG_CODEC == SWCODEC 836 835 /* Produce keyclick */ 837 836 keyclick_click(false, action); 838 - #endif 839 837 840 838 return action; 841 839 }
+7 -20
apps/bookmark.c
··· 183 183 audio_pause(); /* first pause playback */ 184 184 update = (global_settings.autoupdatebookmark && bookmark_exists()); 185 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 187 if (update) 195 188 return write_bookmark(true, bookmark); ··· 415 408 snprintf(global_bookmark, sizeof(global_bookmark), 416 409 /* new optional bookmark token descriptors should be inserted 417 410 just before the "%s;%s" in this line... */ 418 - #if CONFIG_CODEC == SWCODEC && defined(HAVE_PITCHCONTROL) 411 + #if defined(HAVE_PITCHCONTROL) 419 412 ">%d;%d;%ld;%d;%ld;%d;%d;%ld;%ld;%s;%s", 420 413 #else 421 414 ">%d;%d;%ld;%d;%ld;%d;%d;%s;%s", 422 415 #endif 423 416 /* ... their flags should go here ... */ 424 - #if CONFIG_CODEC == SWCODEC && defined(HAVE_PITCHCONTROL) 417 + #if defined(HAVE_PITCHCONTROL) 425 418 BM_PITCH | BM_SPEED, 426 419 #else 427 420 0, ··· 433 426 global_settings.repeat_mode, 434 427 global_settings.playlist_shuffle, 435 428 /* ...and their values should go here */ 436 - #if CONFIG_CODEC == SWCODEC && defined(HAVE_PITCHCONTROL) 429 + #if defined(HAVE_PITCHCONTROL) 437 430 (long)sound_get_pitch(), 438 431 (long)dsp_get_timestretch(), 439 432 #endif ··· 950 943 951 944 talk_number(bookmark_id + 1, false); 952 945 953 - #if CONFIG_CODEC == SWCODEC 954 946 bool is_dir = (global_temp_buffer[0] 955 947 && global_temp_buffer[strlen(global_temp_buffer)-1] == '/'); 956 948 ··· 965 957 else talk_file_or_spell(NULL, global_temp_buffer, 966 958 TALK_IDARRAY(LANG_PLAYLIST), true); 967 959 } 968 - #else 969 - (void)show_playlist_name; 970 - #endif 971 960 972 961 if(bm.shuffle) 973 962 talk_id(LANG_SHUFFLE, true); ··· 977 966 talk_id(LANG_TIME, true); 978 967 talk_value(bm.resume_time / 1000, UNIT_TIME, true); 979 968 980 - #if CONFIG_CODEC == SWCODEC 981 969 /* Track filename */ 982 970 if(!is_dir) 983 971 global_temp_buffer[0] = 0; 984 972 talk_file_or_spell(global_temp_buffer, global_filename, 985 973 TALK_IDARRAY(VOICE_FILE), true); 986 - #endif 987 974 } 988 975 989 976 /* ----------------------------------------------------------------------- */ ··· 992 979 /* ------------------------------------------------------------------------*/ 993 980 static bool play_bookmark(const char* bookmark) 994 981 { 995 - #if CONFIG_CODEC == SWCODEC && defined(HAVE_PITCHCONTROL) 982 + #if defined(HAVE_PITCHCONTROL) 996 983 /* preset pitch and speed to 100% in case bookmark doesn't have info */ 997 984 bm.pitch = sound_get_pitch(); 998 985 bm.speed = dsp_get_timestretch(); 999 986 #endif 1000 - 987 + 1001 988 if (parse_bookmark(bookmark, true, true)) 1002 989 { 1003 990 global_settings.repeat_mode = bm.repeat_mode; 1004 991 global_settings.playlist_shuffle = bm.shuffle; 1005 - #if CONFIG_CODEC == SWCODEC && defined(HAVE_PITCHCONTROL) 992 + #if defined(HAVE_PITCHCONTROL) 1006 993 sound_set_pitch(bm.pitch); 1007 994 dsp_set_timestretch(bm.speed); 1008 995 #endif ··· 1011 998 return bookmark_play(global_temp_buffer, bm.resume_index, 1012 999 bm.resume_time, bm.resume_offset, bm.resume_seed, global_filename); 1013 1000 } 1014 - 1001 + 1015 1002 return false; 1016 1003 } 1017 1004
-1
apps/codecs.c
··· 40 40 #include "lang.h" 41 41 #include "keyboard.h" 42 42 #include "buffering.h" 43 - #include "mp3_playback.h" 44 43 #include "backlight.h" 45 44 #include "storage.h" 46 45 #include "talk.h"
-6
apps/cuesheet.c
··· 313 313 } 314 314 else 315 315 { 316 - #if (CONFIG_CODEC == SWCODEC) 317 316 audio_pre_ff_rewind(); 318 317 audio_ff_rewind(pos); 319 - #else 320 - audio_pause(); 321 - audio_ff_rewind(pos); 322 - audio_resume(); 323 - #endif 324 318 return true; 325 319 } 326 320 }
-50
apps/debug_menu.c
··· 37 37 #include "system.h" 38 38 #include "font.h" 39 39 #include "audio.h" 40 - #include "mp3_playback.h" 41 40 #include "settings.h" 42 41 #include "list.h" 43 42 #include "statusbar.h" ··· 88 87 #endif 89 88 #include "logfdisp.h" 90 89 #include "core_alloc.h" 91 - #if CONFIG_CODEC == SWCODEC 92 90 #include "pcmbuf.h" 93 91 #include "buffering.h" 94 92 #include "playback.h" 95 93 #if defined(HAVE_SPDIF_OUT) || defined(HAVE_SPDIF_IN) 96 94 #include "spdif.h" 97 - #endif 98 95 #endif 99 96 #ifdef IRIVER_H300_SERIES 100 97 #include "pcf50606.h" /* for pcf50606_read */ ··· 304 301 #endif 305 302 306 303 #ifdef HAVE_LCD_BITMAP 307 - #if CONFIG_CODEC != SWCODEC 308 - #ifndef SIMULATOR 309 - static 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 */ 349 304 static unsigned int ticks, freq_sum; 350 305 #ifndef CPU_MULTI_FREQUENCY 351 306 static unsigned int boost_ticks; ··· 487 442 488 443 return false; 489 444 } 490 - #endif /* CONFIG_CODEC */ 491 445 #endif /* HAVE_LCD_BITMAP */ 492 446 493 447 static const char* bf_getname(int selected_item, void *data, ··· 2606 2560 { "View database info", dbg_tagcache_info }, 2607 2561 #endif 2608 2562 #ifdef HAVE_LCD_BITMAP 2609 - #if CONFIG_CODEC == SWCODEC 2610 2563 { "View buffering thread", dbg_buffering_thread }, 2611 - #elif !defined(SIMULATOR) 2612 - { "View audio thread", dbg_audio_thread }, 2613 - #endif 2614 2564 #ifdef PM_DEBUG 2615 2565 { "pm histogram", peak_meter_histogram}, 2616 2566 #endif /* PM_DEBUG */
-8
apps/features.txt
··· 109 109 110 110 #if defined(HAVE_RECORDING) 111 111 recording 112 - #if CONFIG_CODEC == SWCODEC 113 112 recording_swcodec 114 - #else 115 - recording_hwcodec 116 - #endif 117 113 #if defined(HAVE_LINE_IN) 118 114 recording_linein 119 115 #endif ··· 151 147 speaker 152 148 #endif 153 149 154 - #if CONFIG_CODEC == SWCODEC 155 150 swcodec 156 - #else 157 - hwcodec 158 - #endif 159 151 160 152 #if defined(HAVE_TAGCACHE) 161 153 tagcache
-7
apps/filetypes.c
··· 41 41 #include "logf.h" 42 42 43 43 /* max filetypes (plugins & icons stored here) */ 44 - #if CONFIG_CODEC == SWCODEC 45 44 #define MAX_FILETYPES 192 46 - #else 47 - #define MAX_FILETYPES 128 48 - #endif 49 45 /* max viewer plugins */ 50 46 #ifdef HAVE_LCD_BITMAP 51 47 #define MAX_VIEWERS 56 ··· 58 54 { "mp3", FILE_ATTR_AUDIO, Icon_Audio, VOICE_EXT_MPA }, 59 55 { "mp2", FILE_ATTR_AUDIO, Icon_Audio, VOICE_EXT_MPA }, 60 56 { "mpa", FILE_ATTR_AUDIO, Icon_Audio, VOICE_EXT_MPA }, 61 - #if CONFIG_CODEC == SWCODEC 62 - /* Temporary hack to allow playlist creation */ 63 57 { "mp1", FILE_ATTR_AUDIO, Icon_Audio, VOICE_EXT_MPA }, 64 58 { "ogg", FILE_ATTR_AUDIO, Icon_Audio, VOICE_EXT_MPA }, 65 59 { "oga", FILE_ATTR_AUDIO, Icon_Audio, VOICE_EXT_MPA }, ··· 121 115 { "vgz", FILE_ATTR_AUDIO, Icon_Audio, VOICE_EXT_MPA }, 122 116 { "kss", FILE_ATTR_AUDIO, Icon_Audio, VOICE_EXT_MPA }, 123 117 { "aac", FILE_ATTR_AUDIO, Icon_Audio, VOICE_EXT_MPA }, 124 - #endif 125 118 { "m3u", FILE_ATTR_M3U, Icon_Playlist, LANG_PLAYLIST }, 126 119 { "m3u8",FILE_ATTR_M3U, Icon_Playlist, LANG_PLAYLIST }, 127 120 { "cfg", FILE_ATTR_CFG, Icon_Config, VOICE_EXT_CFG },
-9
apps/gui/list.c
··· 317 317 318 318 static 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 320 if (global_settings.keyclick) 325 321 { 326 322 list_speak_item *cb = gui_list->callback_speak_item; ··· 354 350 talk_force_shutup(); 355 351 } 356 352 } 357 - #endif 358 353 } 359 354 360 355 static void _gui_synclist_speak_item(struct gui_synclist *lists) ··· 615 610 } 616 611 #endif /* HAVE_LCD_BITMAP */ 617 612 618 - #if CONFIG_CODEC == SWCODEC 619 613 bool gui_synclist_keyclick_callback(int action, void* data) 620 614 { 621 615 struct gui_synclist *lists = (struct gui_synclist *)data; ··· 633 627 634 628 return action != ACTION_NONE; 635 629 } 636 - #endif 637 630 638 631 /* 639 632 * Magic to make sure the list gets updated correctly if the skin does ··· 864 857 do_button, and places the action from get_action in *action. */ 865 858 { 866 859 timeout = list_do_action_timeout(lists, timeout); 867 - #if CONFIG_CODEC == SWCODEC 868 860 keyclick_set_callback(gui_synclist_keyclick_callback, lists); 869 - #endif 870 861 *action = get_action(context, timeout); 871 862 return gui_synclist_do_button(lists, action, wrap); 872 863 }
-2
apps/gui/list.h
··· 170 170 extern bool gui_synclist_item_is_onscreen(struct gui_synclist *lists, 171 171 enum screen_type screen, int item); 172 172 173 - #if CONFIG_CODEC == SWCODEC 174 173 extern bool gui_synclist_keyclick_callback(int action, void* data); 175 - #endif 176 174 /* 177 175 * Do the action implied by the given button, 178 176 * returns true if the action was handled.
-78
apps/gui/pitchscreen.c
··· 38 38 #include "misc.h" 39 39 #include "pitchscreen.h" 40 40 #include "settings.h" 41 - #if CONFIG_CODEC == SWCODEC 42 41 #include "tdspeed.h" 43 - #endif 44 42 45 43 #define ICON_BORDER 12 /* icons are currently 7x8, so add ~2 pixels */ 46 44 /* on both sides when drawing */ ··· 167 165 168 166 static void speak_pitch_mode(bool enqueue) 169 167 { 170 - #if CONFIG_CODEC == SWCODEC 171 168 bool timestretch_mode = global_settings.pitch_mode_timestretch && dsp_timestretch_available(); 172 169 if (timestretch_mode) 173 170 talk_id(VOICE_PITCH_TIMESTRETCH_MODE, enqueue); 174 - #else 175 - #define timestretch_mode 0 176 - #endif 177 171 if (global_settings.pitch_mode_semitone) 178 172 talk_id(VOICE_PITCH_SEMITONE_MODE, timestretch_mode ? true : enqueue); 179 173 else ··· 238 232 static void pitchscreen_draw(struct screen *display, int max_lines, 239 233 struct viewport pitch_viewports[PITCH_ITEM_COUNT], 240 234 int32_t pitch, int32_t semitone 241 - #if CONFIG_CODEC == SWCODEC 242 235 ,int32_t speed 243 - #endif 244 236 ) 245 237 { 246 238 const char* ptr; ··· 308 300 /* Middle section upper line - hide for a small screen */ 309 301 if ((show_lang_pitch = (max_lines >= 3))) 310 302 { 311 - #if CONFIG_CODEC == SWCODEC 312 303 if(global_settings.pitch_mode_timestretch) 313 304 { 314 305 /* Pitch:XXX.X% */ ··· 330 321 } 331 322 } 332 323 else 333 - #endif 334 324 { 335 325 /* Rate */ 336 326 snprintf(buf, sizeof(buf), "%s:", str(LANG_PLAYBACK_RATE)); ··· 344 334 345 335 /* Middle section lower line */ 346 336 /* "Speed:XXX%" */ 347 - #if CONFIG_CODEC == SWCODEC 348 337 if(global_settings.pitch_mode_timestretch) 349 338 { 350 339 snprintf(buf, sizeof(buf), "%s: %ld.%ld%%", str(LANG_SPEED), ··· 352 341 (speed % PITCH_SPEED_PRECISION) / (PITCH_SPEED_PRECISION / 10)); 353 342 } 354 343 else 355 - #endif 356 344 { 357 345 if(global_settings.pitch_mode_semitone) 358 346 { ··· 396 384 /* Middle section left/right labels */ 397 385 const char *leftlabel = "-2%"; 398 386 const char *rightlabel = "+2%"; 399 - #if CONFIG_CODEC == SWCODEC 400 387 if (global_settings.pitch_mode_timestretch) 401 388 { 402 389 leftlabel = "<<"; 403 390 rightlabel = ">>"; 404 391 } 405 - #endif 406 392 407 393 /* Only display if they fit */ 408 394 display->getstringsize(leftlabel, &w, &h); ··· 423 409 } 424 410 425 411 static int32_t pitch_increase(int32_t pitch, int32_t pitch_delta, bool allow_cutoff 426 - #if CONFIG_CODEC == SWCODEC 427 412 /* need this to maintain correct pitch/speed caps */ 428 413 , int32_t speed 429 - #endif 430 414 ) 431 415 { 432 416 int32_t new_pitch; 433 - #if CONFIG_CODEC == SWCODEC 434 417 int32_t new_stretch; 435 - #endif 436 418 at_limit = false; 437 419 438 420 if (pitch_delta < 0) ··· 480 462 /* pitch_delta == 0 -> no real change */ 481 463 return pitch; 482 464 } 483 - #if CONFIG_CODEC == SWCODEC 484 465 if (dsp_timestretch_available()) 485 466 { 486 467 /* increase the multiple to increase precision of this calculation */ ··· 504 485 at_limit = true; 505 486 } 506 487 } 507 - #endif 508 488 509 489 sound_set_pitch(new_pitch); 510 490 ··· 579 559 static int32_t pitch_increase_semitone(int32_t pitch, 580 560 int32_t current_semitone, 581 561 int32_t semitone_delta 582 - #if CONFIG_CODEC == SWCODEC 583 562 , int32_t speed 584 - #endif 585 563 ) 586 564 { 587 565 int32_t new_semitone = current_semitone; ··· 613 591 614 592 int32_t new_pitch = get_pitch_from_semitone(new_semitone); 615 593 616 - #if CONFIG_CODEC == SWCODEC 617 594 int32_t new_stretch = GET_STRETCH(new_pitch, speed); 618 595 619 596 /* clamp the pitch so it doesn't go beyond the stretch limits */ ··· 629 606 new_semitone = get_semitone_from_pitch(new_pitch); 630 607 at_limit = true; 631 608 } 632 - #endif 633 609 634 610 pitch_increase(pitch, new_pitch - pitch, false 635 - #if CONFIG_CODEC == SWCODEC 636 611 , speed 637 - #endif 638 612 ); 639 613 640 614 return new_semitone; ··· 765 739 766 740 push_current_activity(ACTIVITY_PITCHSCREEN); 767 741 768 - #if CONFIG_CODEC == SWCODEC 769 742 int32_t new_speed = 0, new_stretch; 770 743 771 744 /* the speed variable holds the apparent speed of the playback */ ··· 785 758 global_settings.pitch_mode_timestretch = false; 786 759 settings_save(); 787 760 } 788 - #endif 789 761 790 762 /* Count decimals for speaking */ 791 763 for (i = PITCH_SPEED_PRECISION; i >= 10; i /= 10) ··· 806 778 /* also, draw the icons now, it's only needed once */ 807 779 pitchscreen_draw_icons(&screens[i], &parent[i]); 808 780 } 809 - #if CONFIG_CODEC == SWCODEC 810 781 pcmbuf_set_low_latency(true); 811 - #endif 812 782 813 783 while (!exit) 814 784 { 815 785 FOR_NB_SCREENS(i) 816 786 pitchscreen_draw(&screens[i], max_lines[i], 817 787 pitch_viewports[i], pitch, semitone 818 - #if CONFIG_CODEC == SWCODEC 819 788 , speed 820 - #endif 821 789 ); 822 790 pitch_delta = 0; 823 - #if CONFIG_CODEC == SWCODEC 824 791 new_speed = 0; 825 - #endif 826 792 827 793 if (global_settings.talk_menu && updated) 828 794 { ··· 835 801 else 836 802 talk_value_decimal(pitch, UNIT_PERCENT, decimals, false); 837 803 break; 838 - #if CONFIG_CODEC == SWCODEC 839 804 case 2: 840 805 talk_value_decimal(speed, UNIT_PERCENT, decimals, false); 841 806 break; 842 - #endif 843 807 case 3: 844 808 speak_pitch_mode(false); 845 809 break; 846 810 case 4: 847 - #if CONFIG_CODEC == SWCODEC 848 811 if (global_settings.pitch_mode_timestretch && dsp_timestretch_available()) 849 812 talk_id(LANG_PITCH, false); 850 813 else 851 - #endif 852 814 talk_id(LANG_PLAYBACK_RATE, false); 853 815 talk_value_decimal(pitch, UNIT_PERCENT, decimals, true); 854 - #if CONFIG_CODEC == SWCODEC 855 816 if (global_settings.pitch_mode_timestretch && dsp_timestretch_available()) 856 817 { 857 818 talk_id(LANG_SPEED, true); 858 819 talk_value_decimal(speed, UNIT_PERCENT, decimals, true); 859 820 } 860 - #endif 861 821 speak_pitch_mode(true); 862 822 break; 863 823 default: ··· 910 870 break; 911 871 912 872 case ACTION_PS_NUDGE_RIGHT: 913 - #if CONFIG_CODEC == SWCODEC 914 873 if (!global_settings.pitch_mode_timestretch) 915 874 { 916 - #endif 917 875 new_pitch = pitch_increase(pitch, PITCH_NUDGE_DELTA, false 918 - #if CONFIG_CODEC == SWCODEC 919 876 , speed 920 - #endif 921 877 ); 922 878 nudged = (new_pitch != pitch); 923 879 pitch = new_pitch; 924 880 semitone = get_semitone_from_pitch(pitch); 925 - #if CONFIG_CODEC == SWCODEC 926 881 speed = pitch; 927 - #endif 928 882 updated = nudged ? 1 : 0; 929 883 break; 930 - #if CONFIG_CODEC == SWCODEC 931 884 } 932 885 else 933 886 { ··· 948 901 updated = 2; 949 902 } 950 903 break; 951 - #endif 952 904 953 905 case ACTION_PS_NUDGE_RIGHTOFF: 954 906 if (nudged) 955 907 { 956 908 pitch = pitch_increase(pitch, -PITCH_NUDGE_DELTA, false 957 - #if CONFIG_CODEC == SWCODEC 958 909 , speed 959 - #endif 960 910 ); 961 - #if CONFIG_CODEC == SWCODEC 962 911 speed = pitch; 963 - #endif 964 912 semitone = get_semitone_from_pitch(pitch); 965 913 nudged = false; 966 914 updated = 1; ··· 968 916 break; 969 917 970 918 case ACTION_PS_NUDGE_LEFT: 971 - #if CONFIG_CODEC == SWCODEC 972 919 if (!global_settings.pitch_mode_timestretch) 973 920 { 974 - #endif 975 921 new_pitch = pitch_increase(pitch, -PITCH_NUDGE_DELTA, false 976 - #if CONFIG_CODEC == SWCODEC 977 922 , speed 978 - #endif 979 923 ); 980 924 nudged = (new_pitch != pitch); 981 925 pitch = new_pitch; 982 926 semitone = get_semitone_from_pitch(pitch); 983 - #if CONFIG_CODEC == SWCODEC 984 927 speed = pitch; 985 - #endif 986 928 updated = nudged ? 1 : 0; 987 929 break; 988 - #if CONFIG_CODEC == SWCODEC 989 930 } 990 931 else 991 932 { ··· 1006 947 updated = 2; 1007 948 } 1008 949 break; 1009 - #endif 1010 950 1011 951 case ACTION_PS_NUDGE_LEFTOFF: 1012 952 if (nudged) 1013 953 { 1014 954 pitch = pitch_increase(pitch, PITCH_NUDGE_DELTA, false 1015 - #if CONFIG_CODEC == SWCODEC 1016 955 , speed 1017 - #endif 1018 956 ); 1019 - #if CONFIG_CODEC == SWCODEC 1020 957 speed = pitch; 1021 - #endif 1022 958 semitone = get_semitone_from_pitch(pitch); 1023 959 nudged = false; 1024 960 updated = 1; ··· 1028 964 case ACTION_PS_RESET: 1029 965 pitch = PITCH_SPEED_100; 1030 966 sound_set_pitch(pitch); 1031 - #if CONFIG_CODEC == SWCODEC 1032 967 speed = PITCH_SPEED_100; 1033 968 if (dsp_timestretch_available()) 1034 969 { 1035 970 dsp_set_timestretch(PITCH_SPEED_100); 1036 971 at_limit = false; 1037 972 } 1038 - #endif 1039 973 semitone = get_semitone_from_pitch(pitch); 1040 974 updated = 4; 1041 975 break; 1042 976 1043 977 case ACTION_PS_TOGGLE_MODE: 1044 978 global_settings.pitch_mode_semitone = !global_settings.pitch_mode_semitone; 1045 - #if CONFIG_CODEC == SWCODEC 1046 979 1047 980 if (dsp_timestretch_available() && !global_settings.pitch_mode_semitone) 1048 981 { ··· 1055 988 } 1056 989 } 1057 990 settings_save(); 1058 - #endif 1059 991 updated = 3; 1060 992 break; 1061 993 ··· 1073 1005 if (global_settings.pitch_mode_semitone) 1074 1006 { 1075 1007 semitone = pitch_increase_semitone(pitch, semitone, pitch_delta 1076 - #if CONFIG_CODEC == SWCODEC 1077 1008 , speed 1078 - #endif 1079 1009 ); 1080 1010 pitch = get_pitch_from_semitone(semitone); 1081 1011 } 1082 1012 else 1083 1013 { 1084 1014 pitch = pitch_increase(pitch, pitch_delta, true 1085 - #if CONFIG_CODEC == SWCODEC 1086 1015 , speed 1087 - #endif 1088 1016 ); 1089 1017 semitone = get_semitone_from_pitch(pitch); 1090 1018 } 1091 - #if CONFIG_CODEC == SWCODEC 1092 1019 if (global_settings.pitch_mode_timestretch) 1093 1020 { 1094 1021 /* do this to make sure we properly obey the stretch limits */ ··· 1098 1025 { 1099 1026 speed = pitch; 1100 1027 } 1101 - #endif 1102 1028 } 1103 1029 1104 - #if CONFIG_CODEC == SWCODEC 1105 1030 if(new_speed) 1106 1031 { 1107 1032 new_stretch = GET_STRETCH(pitch, new_speed); ··· 1135 1060 /* when needed */ 1136 1061 new_speed = 0; 1137 1062 } 1138 - #endif 1139 1063 } 1140 - #if CONFIG_CODEC == SWCODEC 1141 1064 pcmbuf_set_low_latency(false); 1142 - #endif 1143 1065 pop_current_activity(); 1144 1066 return 0; 1145 1067 }
-2
apps/gui/skin_engine/skin_display.c
··· 57 57 #endif 58 58 59 59 #include "cuesheet.h" 60 - #if CONFIG_CODEC == SWCODEC 61 60 #include "playback.h" 62 - #endif 63 61 #include "backdrop.h" 64 62 #include "viewport.h" 65 63 #if CONFIG_TUNER
+3 -36
apps/gui/skin_engine/skin_tokens.c
··· 47 47 #include "albumart.h" 48 48 #endif 49 49 #include "playlist.h" 50 - #if CONFIG_CODEC == SWCODEC 51 50 #include "playback.h" 52 51 #include "tdspeed.h" 53 - #endif 54 52 #include "viewport.h" 55 53 #include "tagcache.h" 56 54 ··· 558 556 static char filename_buf[MAX_PATH + 1]; 559 557 fname = playlist_peek(offset, filename_buf, sizeof(filename_buf)); 560 558 *filename = (char*)fname; 561 - #if CONFIG_CODEC == SWCODEC 562 559 static struct mp3entry tempid3; 563 560 if ( 564 561 #if defined(HAVE_TC_RAMCACHE) && defined(HAVE_DIRCACHE) 565 562 tagcache_fill_tags(&tempid3, fname) || 566 - #endif 563 + #endif 567 564 audio_peek_track(&tempid3, offset) 568 565 ) 569 566 { 570 567 pid3 = &tempid3; 571 568 } 572 - #endif 573 569 } 574 570 return pid3; 575 571 } ··· 1224 1220 } 1225 1221 #endif 1226 1222 1227 - #if (CONFIG_CODEC == SWCODEC) 1228 1223 case SKIN_TOKEN_CROSSFADE: 1229 1224 #ifdef HAVE_CROSSFADE 1230 1225 if (intval) ··· 1277 1272 } 1278 1273 return buf; 1279 1274 } 1280 - #endif /* (CONFIG_CODEC == SWCODEC) */ 1281 1275 1282 1276 #if defined (HAVE_PITCHCONTROL) 1283 1277 case SKIN_TOKEN_SOUND_PITCH: ··· 1294 1288 } 1295 1289 #endif 1296 1290 1297 - #if (CONFIG_CODEC == SWCODEC) && defined (HAVE_PITCHCONTROL) 1291 + #if defined (HAVE_PITCHCONTROL) 1298 1292 case SKIN_TOKEN_SOUND_SPEED: 1299 1293 { 1300 1294 int32_t pitch = sound_get_pitch(); ··· 1462 1456 return NULL; 1463 1457 case SKIN_TOKEN_REC_FREQ: /* order from REC_FREQ_CFG_VAL_LIST */ 1464 1458 { 1465 - #if CONFIG_CODEC == SWCODEC 1466 1459 unsigned long samprk; 1467 1460 int rec_freq = global_settings.rec_frequency; 1468 1461 ··· 1528 1521 } 1529 1522 } 1530 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 1524 return buf; 1549 1525 } 1550 - #if CONFIG_CODEC == SWCODEC 1551 1526 case SKIN_TOKEN_REC_ENCODER: 1552 1527 { 1553 1528 int rec_format = global_settings.rec_format+1; /* WAV, AIFF, WV, MPEG */ ··· 1568 1543 } 1569 1544 break; 1570 1545 } 1571 - #endif 1572 1546 case SKIN_TOKEN_REC_BITRATE: 1573 - #if CONFIG_CODEC == SWCODEC 1574 1547 if (global_settings.rec_format == REC_FORMAT_MPA_L3) 1575 1548 { 1576 1549 if (intval) ··· 1632 1605 } 1633 1606 else 1634 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 1608 case SKIN_TOKEN_REC_MONO: 1642 1609 if (!global_settings.rec_channels) 1643 1610 return "m"; 1644 1611 return NULL; 1645 - 1612 + 1646 1613 case SKIN_TOKEN_REC_SECONDS: 1647 1614 { 1648 1615 int time = (audio_recorded_time() / HZ) % 60;
+1 -1
apps/gui/splash.c
··· 199 199 200 200 void splash(int ticks, const char *str) 201 201 { 202 - #if !defined(SIMULATOR) || CONFIG_CODEC == SWCODEC 202 + #if !defined(SIMULATOR) 203 203 long id; 204 204 /* fmt may be a so called virtual pointer. See settings.h. */ 205 205 if((id = P2ID((const unsigned char*)str)) >= 0)
+1 -48
apps/gui/statusbar.c
··· 27 27 #include "sound.h" 28 28 #include "settings.h" 29 29 #include "viewport.h" 30 - #if CONFIG_CODEC == SWCODEC 31 30 #include "metadata.h" 32 - #endif 33 31 #include "icons.h" 34 32 #include "powermgmt.h" 35 33 #include "usb.h" ··· 602 600 #endif 603 601 604 602 #ifdef HAVE_RECORDING 605 - #if CONFIG_CODEC == SWCODEC 606 603 /** 607 604 * Write a number to the display using bitmaps and return new position 608 605 */ ··· 650 647 xpos += BM_GLYPH_WIDTH; 651 648 } 652 649 } 653 - 650 + 654 651 655 652 /* Show bitmap - clipping right edge if needed */ 656 653 display->mono_bitmap_part(bm, 0, 0, STATUSBAR_ENCODER_WIDTH, ··· 695 692 STATUSBAR_Y_POS, BM_GLYPH_WIDTH, 696 693 STATUSBAR_HEIGHT); 697 694 } 698 - #endif /* CONFIG_CODEC == SWCODEC */ 699 695 700 696 static 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 698 /* Display Codec info in statusbar */ 710 - #if CONFIG_CODEC == SWCODEC 711 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 701 /* Display Samplerate info in statusbar */ 724 - #if CONFIG_CODEC == SWCODEC 725 - /* SWCODEC targets use bitmaps for glyphs */ 726 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 704 /* Display Channel status in status bar */ 752 705 if(global_settings.rec_channels)
-128
apps/gui/wps.c
··· 33 33 #include "filetypes.h" 34 34 #include "settings.h" 35 35 #include "skin_engine/skin_engine.h" 36 - #include "mp3_playback.h" 37 36 #include "audio.h" 38 37 #include "usb.h" 39 38 #include "status.h" ··· 124 123 125 124 void pause_action(bool may_fade, bool updatewps) 126 125 { 127 - #if CONFIG_CODEC == SWCODEC 128 126 /* Do audio first, then update, unless skin were to use its local 129 127 status in which case, reverse it */ 130 128 audio_pause(); 131 129 132 130 if (updatewps) 133 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 133 if (global_settings.pause_rewind) { 142 134 long newpos; 143 135 144 - #if (CONFIG_CODEC == SWCODEC) 145 136 audio_pre_ff_rewind(); 146 - #endif 147 137 newpos = audio_current_track()->elapsed 148 138 - global_settings.pause_rewind * 1000; 149 139 audio_ff_rewind(newpos > 0 ? newpos : 0); ··· 154 144 155 145 void unpause_action(bool may_fade, bool updatewps) 156 146 { 157 - #if CONFIG_CODEC == SWCODEC 158 147 /* Do audio first, then update, unless skin were to use its local 159 148 status in which case, reverse it */ 160 149 audio_resume(); 161 150 162 151 if (updatewps) 163 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 154 (void)may_fade; 172 155 } 173 156 174 - #if CONFIG_CODEC != SWCODEC 175 - void 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 - 231 157 static bool update_onvol_change(enum screen_type screen) 232 158 { 233 159 skin_update(WPS, screen, SKIN_REFRESH_NON_STATIC); ··· 264 190 #endif 265 191 case ACTION_TOUCH_SCROLLBAR: 266 192 skin_get_global_state()->id3->elapsed = skin_get_global_state()->id3->length*offset/100; 267 - #if (CONFIG_CODEC == SWCODEC) 268 193 audio_pre_ff_rewind(); 269 - #else 270 - if (!skin_get_global_state()->paused) 271 - audio_pause(); 272 - #endif 273 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 195 return ACTION_TOUCHSCREEN; 279 196 case ACTION_TOUCH_VOLUME: 280 197 { ··· 344 261 if ( (audio_status() & AUDIO_STATUS_PLAY) && 345 262 skin_get_global_state()->id3 && skin_get_global_state()->id3->length ) 346 263 { 347 - #if (CONFIG_CODEC == SWCODEC) 348 264 audio_pre_ff_rewind(); 349 - #else 350 - if (!skin_get_global_state()->paused) 351 - audio_pause(); 352 - #endif 353 265 if (direction > 0) 354 266 status_set_ffmode(STATUS_FASTFORWARD); 355 267 else ··· 393 305 skin_get_global_state()->ff_rewind_count = 0; 394 306 skin_get_global_state()->ff_rewind = false; 395 307 status_set_ffmode(0); 396 - #if (CONFIG_CODEC != SWCODEC) 397 - if (!skin_get_global_state()->paused) 398 - audio_resume(); 399 - #endif 400 308 exit = true; 401 309 break; 402 310 ··· 495 403 return; 496 404 } 497 405 498 - #if (CONFIG_CODEC == SWCODEC) 499 406 audio_pre_ff_rewind(); 500 - #else 501 - if (!state->paused) 502 - audio_pause(); 503 - #endif 504 - 505 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 470 } 574 471 else if (direction == 1 && step >= remaining) 575 472 { 576 - #if CONFIG_CODEC == SWCODEC 577 473 system_sound_play(SOUND_TRACK_NO_MORE); 578 - #endif 579 474 return; 580 475 } 581 476 else if (direction == -1 && elapsed < step) ··· 588 483 } 589 484 if(audio_status() & AUDIO_STATUS_PLAY) 590 485 { 591 - #if (CONFIG_CODEC == SWCODEC) 592 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 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 751 { 868 752 if (state->id3->cuesheet) 869 753 { 870 - #if (CONFIG_CODEC == SWCODEC) 871 754 audio_pre_ff_rewind(); 872 - #else 873 - if (!state->paused) 874 - audio_pause(); 875 - #endif 876 755 audio_ff_rewind(0); 877 756 } 878 757 else ··· 1128 1007 } 1129 1008 1130 1009 if (exit) { 1131 - #if CONFIG_CODEC != SWCODEC 1132 - if (global_settings.fade_on_stop) 1133 - fade(false, true); 1134 - #else 1135 1010 audio_pause(); 1136 1011 update_non_static(); 1137 - #endif 1138 1012 if (bookmark) 1139 1013 bookmark_autobookmark(true); 1140 1014 audio_stop(); ··· 1200 1074 /* add the WPS track event callbacks */ 1201 1075 add_event(PLAYBACK_EVENT_TRACK_CHANGE, track_info_callback); 1202 1076 add_event(PLAYBACK_EVENT_NEXTTRACKID3_AVAILABLE, track_info_callback); 1203 - #if CONFIG_CODEC == SWCODEC 1204 1077 /* Use the same callback as ..._TRACK_CHANGE for when remaining handles have 1205 1078 finished */ 1206 1079 add_event(PLAYBACK_EVENT_CUR_TRACK_READY, track_info_callback); 1207 - #endif 1208 1080 #ifdef AUDIO_FAST_SKIP_PREVIEW 1209 1081 add_event(PLAYBACK_EVENT_TRACK_SKIP, track_info_callback); 1210 1082 #endif
-51
apps/lang/english.lang
··· 5368 5368 </voice> 5369 5369 </phrase> 5370 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 5371 id: LANG_FREQUENCY 5389 5372 desc: in recording and playback settings 5390 5373 user: core ··· 5487 5470 <voice> 5488 5471 *: none 5489 5472 recording: "Line In" 5490 - </voice> 5491 - </phrase> 5492 - <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 5473 </voice> 5508 5474 </phrase> 5509 5475 <phrase> ··· 9461 9427 <voice> 9462 9428 *: none 9463 9429 recording: "Mono" 9464 - </voice> 9465 - </phrase> 9466 - <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 9430 </voice> 9482 9431 </phrase> 9483 9432 <phrase>
+3 -46
apps/main.c
··· 45 45 #include "serial.h" 46 46 #endif 47 47 #include "audio.h" 48 - #include "mp3_playback.h" 49 48 #include "settings.h" 50 49 #include "backlight.h" 51 50 #include "status.h" ··· 87 86 #include "iap.h" 88 87 #endif 89 88 90 - #if (CONFIG_CODEC == SWCODEC) 91 89 #include "audio_thread.h" 92 90 #include "playback.h" 93 91 #include "tdspeed.h" 94 - #endif 95 - #if (CONFIG_CODEC == SWCODEC) && defined(HAVE_RECORDING) && !defined(SIMULATOR) 92 + #if defined(HAVE_RECORDING) && !defined(SIMULATOR) 96 93 #include "pcm_record.h" 97 94 #endif 98 95 ··· 258 255 static void init_tagcache(void) 259 256 { 260 257 bool clear = false; 261 - #if 0 /* CONFIG_CODEC == SWCODEC */ 258 + #if 0 262 259 long talked_tick = 0; 263 260 #endif 264 261 tagcache_init(); ··· 269 266 270 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 270 /* hwcodec can't use voice here, as the database commit 274 271 * uses the audio buffer. */ 275 272 if(global_settings.talk_menu ··· 365 362 viewportmanager_init(); 366 363 367 364 storage_init(); 368 - #if CONFIG_CODEC == SWCODEC 369 365 pcm_init(); 370 366 dsp_init(); 371 - #endif 372 367 settings_reset(); 373 368 settings_load(SETTINGS_ALL); 374 369 settings_apply(true); ··· 384 379 playlist_init(); 385 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 382 if (global_settings.audioscrobbler) 405 383 scrobbler_init(); 406 384 ··· 599 577 } 600 578 } 601 579 602 - #if CONFIG_CODEC == SWCODEC 603 580 pcm_init(); 604 581 dsp_init(); 605 - #endif 606 582 607 583 #if defined(SETTINGS_RESET) || (CONFIG_KEYPAD == IPOD_4G_PAD) || \ 608 584 (CONFIG_KEYPAD == IRIVER_H10_PAD) ··· 668 644 scrobbler_init(); 669 645 670 646 shortcuts_init(); 671 - 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 647 691 648 CHART(">audio_init"); 692 649 audio_init();
-2
apps/menu.c
··· 391 391 { 392 392 int new_audio_status; 393 393 redraw_lists = false; 394 - #if CONFIG_CODEC == SWCODEC 395 394 keyclick_set_callback(gui_synclist_keyclick_callback, &lists); 396 - #endif 397 395 action = get_action(CONTEXT_MAINMENU, 398 396 list_do_action_timeout(&lists, HZ)); 399 397
-1
apps/menus/eq_menu.c
··· 30 30 #include "list.h" 31 31 #include "menu.h" 32 32 #include "action.h" 33 - #include "mp3_playback.h" 34 33 #include "settings.h" 35 34 #include "screens.h" 36 35 #include "icons.h"
-5
apps/menus/menu_common.c
··· 25 25 #include "action.h" 26 26 #include "menu.h" 27 27 #include "menu_common.h" 28 - #if CONFIG_CODEC == SWCODEC 29 28 #include "pcmbuf.h" 30 - #endif 31 29 32 - #if CONFIG_CODEC == SWCODEC 33 30 /* Use this callback if your menu adjusts DSP settings. */ 34 31 int lowlatency_callback(int action, 35 32 const struct menu_item_ex *this_item, ··· 48 45 } 49 46 return action; 50 47 } 51 - #endif 52 -
-2
apps/menus/menu_common.h
··· 24 24 #include "menu.h" 25 25 #include "config.h" 26 26 27 - #if CONFIG_CODEC == SWCODEC 28 27 int lowlatency_callback(int action, 29 28 const struct menu_item_ex *this_item, 30 29 struct gui_synclist *this_list); 31 - #endif 32 30 33 31 #endif /* _MENU_COMMON_H */ 34 32
+3 -24
apps/menus/playback_menu.c
··· 35 35 #include "audio.h" 36 36 #include "cuesheet.h" 37 37 #include "misc.h" 38 - #if CONFIG_CODEC == SWCODEC 39 38 #include "playback.h" 40 39 #include "pcm_sampr.h" 41 40 #ifdef HAVE_PLAY_FREQ 42 41 #include "talk.h" 43 42 #endif 44 - #endif 45 - 46 43 47 - #if (CONFIG_CODEC == SWCODEC) && defined(HAVE_CROSSFADE) 44 + #if defined(HAVE_CROSSFADE) 48 45 static int setcrossfadeonexit_callback(int action, 49 46 const struct menu_item_ex *this_item, 50 47 struct gui_synclist *this_list) ··· 60 57 return action; 61 58 } 62 59 63 - #endif /* CONFIG_CODEC == SWCODEC */ 60 + #endif /* HAVE_CROSSFADE */ 64 61 65 62 /***********************************/ 66 63 /* PLAYBACK MENU */ ··· 77 74 MAKE_MENU(ff_rewind_settings_menu, ID2P(LANG_WIND_MENU), 0, Icon_NOICON, 78 75 &ff_rewind_min_step, &ff_rewind_accel); 79 76 #ifdef HAVE_DISK_STORAGE 80 - #if CONFIG_CODEC == SWCODEC 81 77 static int buffermargin_callback(int action, 82 78 const struct menu_item_ex *this_item, 83 79 struct gui_synclist *this_list) ··· 92 88 } 93 89 return action; 94 90 } 95 - #else 96 - # define buffermargin_callback NULL 97 - #endif 98 91 MENUITEM_SETTING(buffer_margin, &global_settings.buffer_margin, 99 92 buffermargin_callback); 100 93 #endif /*HAVE_DISK_STORAGE */ 101 94 MENUITEM_SETTING(fade_on_stop, &global_settings.fade_on_stop, NULL); 102 95 MENUITEM_SETTING(party_mode, &global_settings.party_mode, NULL); 103 96 104 - #if CONFIG_CODEC == SWCODEC 105 97 #ifdef HAVE_CROSSFADE 106 98 /* crossfade submenu */ 107 99 MENUITEM_SETTING(crossfade, &global_settings.crossfade, setcrossfadeonexit_callback); ··· 150 142 &replaygain_type, &replaygain_noclip, &replaygain_preamp); 151 143 152 144 MENUITEM_SETTING(beep, &global_settings.beep ,NULL); 153 - #endif /* CONFIG_CODEC == SWCODEC */ 154 145 155 146 #ifdef HAVE_SPDIF_POWER 156 147 MENUITEM_SETTING(spdif_enable, &global_settings.spdif_enable, NULL); ··· 188 179 switch (action) 189 180 { 190 181 case ACTION_EXIT_MENUITEM: /* on exit */ 191 - #if CONFIG_CODEC == SWCODEC 192 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 184 return action; 200 185 } ··· 209 194 210 195 MENUITEM_SETTING(skip_length, &global_settings.skip_length, NULL); 211 196 MENUITEM_SETTING(prevent_skip, &global_settings.prevent_skip, NULL); 212 - #if CONFIG_CODEC == SWCODEC 213 197 MENUITEM_SETTING(resume_rewind, &global_settings.resume_rewind, NULL); 214 - #endif 215 198 MENUITEM_SETTING(pause_rewind, &global_settings.pause_rewind, NULL); 216 199 #ifdef HAVE_PLAY_FREQ 217 200 MENUITEM_SETTING(play_frequency, &global_settings.play_frequency, ··· 227 210 #endif 228 211 &fade_on_stop, &party_mode, 229 212 230 - #if (CONFIG_CODEC == SWCODEC) && defined(HAVE_CROSSFADE) 213 + #if defined(HAVE_CROSSFADE) 231 214 &crossfade_settings_menu, 232 215 #endif 233 216 234 - #if CONFIG_CODEC == SWCODEC 235 217 &replaygain_settings_menu, &beep, 236 - #endif 237 218 238 219 #ifdef HAVE_SPDIF_POWER 239 220 &spdif_enable, ··· 244 225 #endif 245 226 ,&skip_length, &prevent_skip 246 227 247 - #if CONFIG_CODEC == SWCODEC 248 228 ,&resume_rewind 249 - #endif 250 229 ,&pause_rewind 251 230 #ifdef HAVE_PLAY_FREQ 252 231 ,&play_frequency
+4 -14
apps/menus/radio_menu.c
··· 34 34 #ifdef HAVE_RECORDING 35 35 #include "recording.h" /* recording_screen() */ 36 36 37 - #if defined(HAVE_FMRADIO_REC) && CONFIG_CODEC == SWCODEC 37 + #if defined(HAVE_FMRADIO_REC) 38 38 #define FM_RECORDING_SCREEN 39 39 static int fm_recording_screen(void) 40 40 { ··· 53 53 54 54 MENUITEM_FUNCTION(recscreen_item, 0, ID2P(LANG_RECORDING), 55 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 59 #define FM_RECORDING_SETTINGS 60 60 static int fm_recording_settings(void) 61 61 { 62 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 64 return ret; 75 65 } 76 66 77 67 MENUITEM_FUNCTION(recsettings_item, 0, ID2P(LANG_RECORDING_SETTINGS), 78 68 fm_recording_settings, NULL, NULL, Icon_Recording); 79 - #endif /* defined(HAVE_FMRADIO_REC) || CONFIG_CODEC != SWCODEC */ 69 + #endif /* defined(HAVE_FMRADIO_REC) */ 80 70 #endif /* HAVE_RECORDING */ 81 71 82 72 #ifndef FM_PRESET
-20
apps/menus/recording_menu.c
··· 29 29 #include "lcd.h" 30 30 #include "menu.h" 31 31 #include "button.h" 32 - #include "mp3_playback.h" 33 32 #include "settings.h" 34 33 #include "screens.h" 35 34 #include "icons.h" ··· 51 50 #include "peakmeter.h" 52 51 #endif 53 52 #include "splash.h" 54 - #if CONFIG_CODEC == SWCODEC 55 53 #include "metadata.h" 56 54 #include "menus/eq_menu.h" 57 55 #ifdef HAVE_RECORDING 58 56 #include "enc_config.h" 59 57 #endif 60 58 #include "general.h" 61 - #endif 62 59 #include "action.h" 63 60 #include "recording.h" 64 61 #include "sound_menu.h" ··· 101 98 MENUITEM_FUNCTION(recsource, 0, ID2P(LANG_RECORDING_SOURCE), 102 99 recsource_func, NULL, recmenu_callback, Icon_Menu_setting); 103 100 104 - #if CONFIG_CODEC == SWCODEC 105 101 /* Makes an options list from a source list of options and indexes */ 106 102 static void make_options_from_indexes(const struct opt_items *src_names, 107 103 const long *src_indexes, ··· 112 108 dst_names[n_indexes] = src_names[src_indexes[n_indexes]]; 113 109 } /* make_options_from_indexes */ 114 110 115 - 116 - #endif /* CONFIG_CODEC == SWCODEC */ 117 - 118 111 static int recfrequency_func(void) 119 112 { 120 - #if CONFIG_CODEC == SWCODEC 121 113 static const struct opt_items names[REC_NUM_FREQ] = { 122 114 REC_HAVE_96_([REC_FREQ_96] = { "96kHz", TALK_ID(96, UNIT_KHZ) },) 123 115 REC_HAVE_88_([REC_FREQ_88] = { "88.2kHz", TALK_ID(88, UNIT_KHZ) },) ··· 195 187 } 196 188 197 189 return ret; 198 - #endif /* CONFIG_CODEC == SWCODEC */ 199 190 } /* recfrequency */ 200 191 MENUITEM_FUNCTION(recfrequency, 0, ID2P(LANG_FREQUENCY), 201 192 recfrequency_func, NULL, NULL, Icon_Menu_setting); ··· 208 199 [CHN_MODE_MONO] = { STR(LANG_CHANNEL_MONO) } 209 200 }; 210 201 211 - #if CONFIG_CODEC == SWCODEC 212 202 struct opt_items opts[CHN_NUM_MODES]; 213 203 long table[CHN_NUM_MODES]; 214 204 struct encoder_caps caps; ··· 238 228 global_settings.rec_channels = table[rec_channels]; 239 229 240 230 return ret; 241 - #endif /* CONFIG_CODEC == SWCODEC */ 242 231 } 243 232 MENUITEM_FUNCTION(recchannels, 0, ID2P(LANG_CHANNELS), 244 233 recchannels_func, NULL, NULL, Icon_Menu_setting); 245 234 246 - #if CONFIG_CODEC == SWCODEC 247 - 248 235 static int recmonomode_func(void) 249 236 { 250 237 static const struct opt_items names[3] = { ··· 292 279 MENUITEM_FUNCTION(enc_global_config_menu_item, 0, ID2P(LANG_ENCODER_SETTINGS), 293 280 enc_global_config_menu, 294 281 NULL, NULL, Icon_Submenu); 295 - 296 - #endif /* CONFIG_CODEC == SWCODEC */ 297 - 298 282 299 283 static int recmenu_callback(int action, 300 284 const struct menu_item_ex *this_item, ··· 603 587 604 588 MAKE_MENU(recording_settings_menu, ID2P(LANG_RECORDING_SETTINGS), 605 589 NULL, Icon_Recording, 606 - #if CONFIG_CODEC == SWCODEC 607 590 &recformat, &enc_global_config_menu_item, 608 - #endif 609 591 &recfrequency, &recsource, /* recsource not shown if no_source */ 610 592 &recchannels, 611 - #if CONFIG_CODEC == SWCODEC 612 593 &recmonomode, 613 - #endif 614 594 &filesplitoptionsmenu, 615 595 &rec_prerecord_time, 616 596 &clear_rec_directory_item,
-10
apps/menus/settings_menu.c
··· 38 38 #include "yesno.h" 39 39 #include "talk.h" 40 40 #include "powermgmt.h" 41 - #if CONFIG_CODEC == SWCODEC 42 41 #include "playback.h" 43 - #endif 44 42 #if CONFIG_RTC 45 43 #include "screens.h" 46 44 #endif ··· 326 324 327 325 328 326 /* Keyclick menu */ 329 - #if CONFIG_CODEC == SWCODEC 330 327 MENUITEM_SETTING(keyclick, &global_settings.keyclick, NULL); 331 328 MENUITEM_SETTING(keyclick_repeats, &global_settings.keyclick_repeats, NULL); 332 329 #ifdef HAVE_HARDWARE_CLICK ··· 336 333 #else 337 334 MAKE_MENU(keyclick_menu, ID2P(LANG_KEYCLICK), 0, Icon_NOICON, 338 335 &keyclick, &keyclick_repeats); 339 - #endif 340 336 #endif 341 337 342 338 #if CONFIG_CHARGING ··· 437 433 #ifdef HAVE_BUTTONLIGHT_BRIGHTNESS 438 434 &buttonlight_brightness, 439 435 #endif 440 - #if CONFIG_CODEC == SWCODEC 441 436 &keyclick_menu, 442 - #endif 443 437 #ifdef HAVE_TOUCHPAD_SENSITIVITY_SETTING 444 438 &touchpad_sensitivity, 445 439 #endif ··· 619 613 /***********************************/ 620 614 /* AUTORESUME MENU */ 621 615 #ifdef HAVE_TAGCACHE 622 - #if CONFIG_CODEC == SWCODEC 623 616 624 617 static int autoresume_callback(int action, 625 618 const struct menu_item_ex *this_item, ··· 674 667 0, Icon_NOICON, 675 668 &autoresume_enable, &autoresume_automatic); 676 669 677 - #endif /* CONFIG_CODEC == SWCODEC */ 678 670 #endif /* HAVE_TAGCACHE */ 679 671 /* AUTORESUME MENU */ 680 672 /***********************************/ ··· 758 750 &startup_shutdown_menu, 759 751 &bookmark_settings_menu, 760 752 #ifdef HAVE_TAGCACHE 761 - #if CONFIG_CODEC == SWCODEC 762 753 &autoresume_menu, 763 - #endif 764 754 #endif 765 755 &browse_langs, &voice_settings_menu, 766 756 #ifdef HAVE_HOTKEY
-12
apps/menus/sound_menu.c
··· 108 108 109 109 MENUITEM_SETTING(balance, &global_settings.balance, NULL); 110 110 MENUITEM_SETTING(channel_config, &global_settings.channel_config, 111 - #if CONFIG_CODEC == SWCODEC 112 111 lowlatency_callback 113 - #else 114 - NULL 115 - #endif 116 112 ); 117 113 MENUITEM_SETTING(stereo_width, &global_settings.stereo_width, 118 - #if CONFIG_CODEC == SWCODEC 119 114 lowlatency_callback 120 - #else 121 - NULL 122 - #endif 123 115 ); 124 116 125 117 #ifdef AUDIOHW_HAVE_DEPTH_3D ··· 134 126 MENUITEM_SETTING(func_mode, &global_settings.func_mode, NULL); 135 127 #endif 136 128 137 - #if CONFIG_CODEC == SWCODEC 138 129 /* Crossfeed Submenu */ 139 130 MENUITEM_SETTING(crossfeed, &global_settings.crossfeed, lowlatency_callback); 140 131 MENUITEM_SETTING(crossfeed_direct_gain, ··· 216 207 MAKE_MENU(compressor_menu,ID2P(LANG_COMPRESSOR), NULL, Icon_NOICON, 217 208 &compressor_threshold, &compressor_gain, &compressor_ratio, 218 209 &compressor_knee, &compressor_attack, &compressor_release); 219 - #endif 220 210 221 211 #ifdef HAVE_SPEAKER 222 212 MENUITEM_SETTING(speaker_mode, &global_settings.speaker_mode, NULL); ··· 253 243 #ifdef AUDIOHW_HAVE_FUNCTIONAL_MODE 254 244 ,&func_mode 255 245 #endif 256 - #if CONFIG_CODEC == SWCODEC 257 246 ,&crossfeed_menu, &equalizer_menu, &dithering_enabled 258 247 ,&surround_menu, &pbe_menu, &afr_enabled 259 248 #ifdef HAVE_PITCHCONTROL 260 249 ,&timestretch_enabled 261 250 #endif 262 251 ,&compressor_menu 263 - #endif 264 252 #ifdef HAVE_SPEAKER 265 253 ,&speaker_mode 266 254 #endif
+3 -28
apps/misc.c
··· 91 91 #include "bookmark.h" 92 92 #include "wps.h" 93 93 #include "playback.h" 94 - #if CONFIG_CODEC == SWCODEC 95 94 #include "voice_thread.h" 96 - #else 97 - #include "mp3_playback.h" 98 - #endif 99 95 100 96 #ifdef BOOTFILE 101 97 #if !defined(USB_NONE) && !defined(USB_HANDLED_BY_OF) \ ··· 302 298 #endif 303 299 { 304 300 bool batt_safe = battery_level_safe(); 305 - #if CONFIG_CODEC != SWCODEC || defined(HAVE_RECORDING) 301 + #if defined(HAVE_RECORDING) 306 302 int audio_stat = audio_status(); 307 303 #endif 308 304 ··· 339 335 splashf(0, "%s %s", str(LANG_WARNING_BATTERY_EMPTY), 340 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 339 #ifdef HAVE_DISK_STORAGE 351 340 if (batt_safe) /* do not save on critical battery */ 352 341 #endif 353 342 { 354 - #if defined(HAVE_RECORDING) && CONFIG_CODEC == SWCODEC 343 + #if defined(HAVE_RECORDING) 355 344 if (audio_stat & AUDIO_STATUS_RECORD) 356 345 { 357 346 rec_command(RECORDING_CMD_STOP); ··· 368 357 if (callback != NULL) 369 358 callback(parameter); 370 359 371 - #if CONFIG_CODEC != SWCODEC 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 360 + #if defined(HAVE_RECORDING) 378 361 audio_close_recording(); 379 362 #endif 380 363 scrobbler_shutdown(true); ··· 403 386 enqueue = true; 404 387 } 405 388 talk_id(LANG_SHUTTINGDOWN, enqueue); 406 - #if CONFIG_CODEC == SWCODEC 407 389 voice_wait(); 408 - #endif 409 390 } 410 391 411 392 shutdown_hw(); ··· 426 407 { 427 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 410 bookmark_autobookmark(true); 434 411 audio_stop(); 435 412 ret = true; /* bookmarking can make a refresh necessary */ ··· 894 871 return buffer; 895 872 } 896 873 897 - #if CONFIG_CODEC == SWCODEC 898 874 /* Play a standard sound */ 899 875 void system_sound_play(enum system_sound sound) 900 876 { ··· 1046 1022 settings.type = replaygain_setting_mode(settings.type); 1047 1023 dsp_replaygain_set_settings(&settings); 1048 1024 } 1049 - #endif /* CONFIG_CODEC == SWCODEC */ 1050 1025 1051 1026 /* format a sound value like: -1.05 dB */ 1052 1027 int format_sound_value(char *buf, size_t size, int snd, int val)
-4
apps/misc.h
··· 181 181 ACTIVITY_USBSCREEN 182 182 }; 183 183 184 - #if CONFIG_CODEC == SWCODEC 185 184 void beep_play(unsigned int frequency, unsigned int duration, 186 185 unsigned int amplitude); 187 186 ··· 209 208 struct mp3entry; 210 209 int id3_get_replaygain_mode(const struct mp3entry *id3); 211 210 void replaygain_update(void); 212 - #else 213 - static inline void replaygain_update(void) {} 214 - #endif /* CONFIG_CODEC == SWCODEC */ 215 211 216 212 void push_current_activity(enum current_activity screen); 217 213 void pop_current_activity(void);
-1979
apps/mpeg.c
··· 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 80 - extern 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 - 110 - struct trackdata 111 - { 112 - struct mp3entry id3; 113 - int mempos; 114 - int load_ahead_index; 115 - }; 116 - 117 - static struct trackdata trackdata[MAX_TRACK_ENTRIES]; 118 - 119 - static unsigned int current_track_counter = 0; 120 - 121 - #ifndef SIMULATOR 122 - static void stop_playing(void); 123 - 124 - static int track_read_idx = 0; 125 - static int track_write_idx = 0; 126 - #endif /* !SIMULATOR */ 127 - 128 - /* Cuesheet support */ 129 - static struct cuesheet *curr_cuesheet = NULL; 130 - static bool checked_for_cuesheet = false; 131 - 132 - static const char mpeg_thread_name[] = "mpeg"; 133 - static unsigned int audio_thread_id; 134 - static bool audio_is_initialized; 135 - static unsigned int mpeg_errno; 136 - 137 - static bool playing = false; /* We are playing an MP3 stream */ 138 - static bool is_playing = false; /* We are (attempting to) playing MP3 files */ 139 - static bool paused; /* playback is paused */ 140 - static int audiobuf_handle; /* handle to the audio buffer */ 141 - static char* mpeg_audiobuf; /* poiunter to the audio buffer */ 142 - static long audiobuflen; /* length of the audio buffer */ 143 - #define AUDIO_BUFFER_RESERVE (256*1024) 144 - #ifdef SIMULATOR 145 - static char mpeg_stack[DEFAULT_STACK_SIZE]; 146 - static struct mp3entry taginfo; 147 - #else /* !SIMULATOR */ 148 - static struct event_queue mpeg_queue SHAREDBSS_ATTR; 149 - static long mpeg_stack[(DEFAULT_STACK_SIZE + 0x1000)/sizeof(long)]; 150 - 151 - static int audiobuf_write; 152 - static int audiobuf_swapwrite; 153 - static long audiobuf_read; 154 - 155 - static int mpeg_file; 156 - 157 - static bool play_pending; /* We are about to start playing */ 158 - static bool play_pending_track_change; /* When starting play we're starting a new file */ 159 - static bool filling; /* We are filling the buffer with data from disk */ 160 - static bool dma_underrun; /* True when the DMA has stopped because of 161 - slow disk reading (read error, shaking) */ 162 - static bool mpeg_stop_done; 163 - 164 - static int last_dma_tick = 0; 165 - static int last_dma_chunk_size; 166 - 167 - static long low_watermark; /* Dynamic low watermark level */ 168 - static long low_watermark_margin = 0; /* Extra time in seconds for watermark */ 169 - static long lowest_watermark_level; /* Debug value to observe the buffer 170 - usage */ 171 - 172 - struct audio_resume_info 173 - { 174 - unsigned long elapsed; 175 - unsigned long offset; 176 - }; 177 - 178 - #ifdef HAVE_RECORDING 179 - static 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 - 187 - static int get_unplayed_space(void); 188 - static int get_playable_space(void); 189 - static int get_unswapped_space(void); 190 - #endif /* !SIMULATOR */ 191 - 192 - static void audio_reset_buffer_noalloc(void* buf, size_t bufsize); 193 - static void audio_reset_buffer(void); 194 - 195 - 196 - #ifndef SIMULATOR 197 - static 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 203 - static 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 - 218 - static 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 - 233 - static 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 - 239 - static void remove_all_tags(void) 240 - { 241 - track_write_idx = track_read_idx; 242 - 243 - debug_tags(); 244 - } 245 - 246 - static 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 259 - struct event_handlers_table 260 - { 261 - AUDIO_EVENT_HANDLER handler; 262 - unsigned short mask; 263 - }; 264 - static struct event_handlers_table event_handlers[MAX_EVENT_HANDLERS]; 265 - static int event_handlers_count = 0; 266 - 267 - void 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 283 - static 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 - 298 - static 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 - 309 - static 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 - 364 - static 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 - 423 - int 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 - 429 - unsigned 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 - 443 - static 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. */ 460 - static 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 - 519 - static 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. */ 526 - static 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. */ 541 - static 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 - 554 - static 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 583 - void audio_set_buffer_margin(int setting) 584 - { 585 - low_watermark_margin = setting; /* in seconds */ 586 - } 587 - #endif 588 - 589 - void 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 613 - static 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 - 627 - static int dbg_cnt2us(unsigned int cnt) 628 - { 629 - return (cnt * 10000) / (FREQ/800); 630 - } 631 - #endif /* DEBUG */ 632 - 633 - static 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 - 641 - static 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 - 649 - static 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 - 668 - static 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 - 676 - void 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 - 688 - static 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 */ 697 - static 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 - 792 - static 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 - 832 - static 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 - 912 - static 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 - 927 - static 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 */ 942 - static 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 - 954 - static 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 - 970 - static 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 989 - void 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 - 1005 - static 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 - 1052 - static 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 - 1093 - static 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 - 1645 - struct 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 - 1673 - struct 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 - 1685 - size_t audio_buffer_size(void) 1686 - { 1687 - if (audiobuf_handle > 0) 1688 - return audiobuflen; 1689 - return 0; 1690 - } 1691 - 1692 - size_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 - 1701 - static 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 - 1713 - static 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 - 1729 - void 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 - 1780 - void 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 */ 1797 - void audio_stop_recording(void) 1798 - { 1799 - audio_stop(); 1800 - } 1801 - 1802 - void 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 - 1813 - void 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 - 1824 - void 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 - 1835 - void 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 - 1863 - void 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 - 1890 - void 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 - 1899 - void audio_flush_and_reload_tracks(void) 1900 - { 1901 - #ifndef SIMULATOR 1902 - queue_post(&mpeg_queue, MPEG_FLUSH_RELOAD, 0); 1903 - #endif /* !SIMULATOR*/ 1904 - } 1905 - 1906 - int 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 1923 - unsigned int audio_error(void) 1924 - { 1925 - return mpeg_errno; 1926 - } 1927 - */ 1928 - 1929 - void audio_error_clear(void) 1930 - { 1931 - mpeg_errno = 0; 1932 - } 1933 - 1934 - #ifdef SIMULATOR 1935 - static 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 - 1954 - void 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 */
-28
apps/mpeg.h
··· 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 25 - unsigned long mpeg_get_last_header(void); 26 - 27 - #endif 28 - #endif
-3
apps/playback.h
··· 26 26 #include <stdlib.h> 27 27 #include "config.h" 28 28 29 - #if CONFIG_CODEC == SWCODEC 30 29 /* Including the code for fast previews is entirely optional since it 31 30 does add two more mp3entry's - for certain targets it may be less 32 31 beneficial such as flash-only storage */ 33 32 #if MEMORYSIZE > 2 34 33 #define AUDIO_FAST_SKIP_PREVIEW 35 34 #endif 36 - 37 - #endif /* CONFIG_CODEC == SWCODEC */ 38 35 39 36 #ifdef HAVE_ALBUMART 40 37
+1 -15
apps/playlist.c
··· 647 647 else 648 648 index = 0; 649 649 650 - #if (CONFIG_CODEC == SWCODEC) 651 650 current_playlist.started = true; 652 - #else 653 - playlist_start(index, 0, 0); 654 - #endif 655 651 } 656 652 657 653 /* we've overwritten the dircache when getting the next/previous dir, ··· 1090 1086 return steps; 1091 1087 } 1092 1088 1093 - #if CONFIG_CODEC == SWCODEC 1094 1089 /* Marks the index of the track to be skipped that is "steps" away from 1095 1090 * current playing track. 1096 1091 */ ··· 1100 1095 1101 1096 if (playlist == NULL) 1102 1097 playlist = &current_playlist; 1103 - 1098 + 1104 1099 /* need to account for already skipped tracks */ 1105 1100 steps = calculate_step_count(playlist, steps); 1106 1101 ··· 1112 1107 1113 1108 playlist->indices[index] |= PLAYLIST_SKIPPED; 1114 1109 } 1115 - #endif /* CONFIG_CODEC == SWCODEC */ 1116 1110 1117 1111 /* 1118 1112 * returns the index of the track that is "steps" away from current playing ··· 2649 2643 if (index < 0) 2650 2644 return NULL; 2651 2645 2652 - #if CONFIG_CODEC == SWCODEC 2653 2646 /* Just testing - don't care about the file name */ 2654 2647 if (!buf || !buf_size) 2655 2648 return ""; 2656 - #endif 2657 2649 2658 2650 control_file = playlist->indices[index] & PLAYLIST_INSERT_TYPE_MASK; 2659 2651 seek = playlist->indices[index] & PLAYLIST_SEEK_MASK; ··· 2730 2722 sort_playlist(playlist, false, false); 2731 2723 randomise_playlist(playlist, current_tick, false, true); 2732 2724 2733 - #if CONFIG_CODEC == SWCODEC 2734 2725 playlist->started = true; 2735 - #else 2736 - playlist_start(0, 0, 0); 2737 - #endif 2738 2726 playlist->index = 0; 2739 2727 index = 0; 2740 2728 } ··· 2780 2768 return index; 2781 2769 } 2782 2770 2783 - #if CONFIG_CODEC == SWCODEC 2784 2771 /* try playing next or previous folder */ 2785 2772 bool playlist_next_dir(int direction) 2786 2773 { ··· 2790 2777 2791 2778 return create_and_play_dir(direction, false) >= 0; 2792 2779 } 2793 - #endif /* CONFIG_CODEC == SWCODEC */ 2794 2780 2795 2781 /* Get resume info for current playing song. If return value is -1 then 2796 2782 settings shouldn't be saved. */
-4
apps/playlist.h
··· 139 139 bool playlist_check(int steps); 140 140 const char *playlist_peek(int steps, char* buf, size_t buf_size); 141 141 int playlist_next(int steps); 142 - #if CONFIG_CODEC == SWCODEC 143 142 bool playlist_next_dir(int direction); 144 - #endif 145 143 int playlist_get_resume_info(int *resume_index); 146 144 int playlist_update_resume_info(const struct mp3entry* id3); 147 145 int playlist_get_display_index(void); ··· 165 163 bool recurse); 166 164 int playlist_insert_playlist(struct playlist_info* playlist, const char *filename, 167 165 int position, bool queue); 168 - #if CONFIG_CODEC == SWCODEC 169 166 void playlist_skip_entry(struct playlist_info *playlist, int steps); 170 - #endif 171 167 int playlist_delete(struct playlist_info* playlist, int index); 172 168 int playlist_move(struct playlist_info* playlist, int index, int new_index); 173 169 int playlist_randomise(struct playlist_info* playlist, unsigned int seed,
+1 -15
apps/plugin.c
··· 466 466 thread_self, 467 467 thread_exit, 468 468 thread_wait, 469 - #if (CONFIG_CODEC == SWCODEC) 470 469 thread_thaw, 471 470 #ifdef HAVE_PRIORITY_SCHEDULING 472 471 thread_set_priority, ··· 474 473 mutex_init, 475 474 mutex_lock, 476 475 mutex_unlock, 477 - #endif 478 476 #ifdef HAVE_SEMAPHORE_OBJECTS 479 477 semaphore_init, 480 478 semaphore_wait, ··· 517 515 queue_delete, 518 516 queue_post, 519 517 queue_wait_w_tmo, 520 - #if CONFIG_CODEC == SWCODEC 521 518 queue_enable_queue_send, 522 519 queue_empty, 523 520 queue_wait, 524 521 queue_send, 525 522 queue_reply, 526 - #endif 527 523 528 524 #ifdef RB_PROFILE 529 525 profile_thread, ··· 601 597 #ifdef AUDIOHW_HAVE_EQ 602 598 sound_enum_hw_eq_band_setting, 603 599 #endif 604 - #if ((CONFIG_CODEC == SWCODEC)) && defined (HAVE_PITCHCONTROL) 600 + #if defined (HAVE_PITCHCONTROL) 605 601 sound_set_pitch, 606 602 #endif 607 603 #if (CONFIG_PLATFORM & PLATFORM_NATIVE) ··· 609 605 mp3_play_pause, 610 606 mp3_play_stop, 611 607 mp3_is_playing, 612 - #if CONFIG_CODEC != SWCODEC 613 - bitswap, 614 608 #endif 615 - #endif 616 - #if CONFIG_CODEC == SWCODEC 617 609 &audio_master_sampr_list[0], 618 610 &hw_freq_sampr[0], 619 611 pcm_apply_settings, ··· 667 659 pcmbuf_fade, 668 660 system_sound_play, 669 661 keyclick_click, 670 - #endif /* CONFIG_CODEC == SWCODEC */ 671 662 672 663 /* metadata */ 673 664 get_metadata, ··· 716 707 audio_current_track, 717 708 audio_flush_and_reload_tracks, 718 709 audio_get_file_pos, 719 - #if !defined(SIMULATOR) && (CONFIG_CODEC != SWCODEC) 720 - mpeg_get_last_header, 721 - #endif 722 710 723 711 /* menu */ 724 712 root_menu_get_options, ··· 783 771 #ifdef ROCKBOX_HAS_LOGF 784 772 _logf, 785 773 #endif 786 - #if CONFIG_CODEC == SWCODEC 787 774 codec_thread_do_callback, 788 775 codec_load_file, 789 776 codec_run_proc, ··· 792 779 find_array_ptr, 793 780 remove_array_ptr, 794 781 round_value_to_list32, 795 - #endif /* CONFIG_CODEC == SWCODEC */ 796 782 797 783 #ifdef HAVE_LCD_BITMAP 798 784 read_bmp_file,
+2 -19
apps/plugin.h
··· 66 66 #include "scroll_engine.h" 67 67 #include "metadata.h" 68 68 #include "sound.h" 69 - #include "mpeg.h" 70 69 #include "audio.h" 71 - #include "mp3_playback.h" 70 + #include "voice_thread.h" 72 71 #include "root_menu.h" 73 72 #include "talk.h" 74 73 #include "lang_enum.h" ··· 77 76 #endif 78 77 #include "misc.h" 79 78 #include "pathfuncs.h" 80 - #if (CONFIG_CODEC == SWCODEC) 81 79 #include "pcm_mixer.h" 82 80 #include "dsp-util.h" 83 81 #include "dsp_core.h" ··· 88 86 #ifdef HAVE_RECORDING 89 87 #include "recording.h" 90 88 #endif 91 - #endif /* CONFIG_CODEC == SWCODEC */ 92 89 #include "settings.h" 93 90 #include "timer.h" 94 91 #include "playlist.h" ··· 526 523 unsigned int (*thread_self)(void); 527 524 void (*thread_exit)(void); 528 525 void (*thread_wait)(unsigned int thread_id); 529 - #if CONFIG_CODEC == SWCODEC 530 526 void (*thread_thaw)(unsigned int thread_id); 531 527 #ifdef HAVE_PRIORITY_SCHEDULING 532 528 int (*thread_set_priority)(unsigned int thread_id, int priority); ··· 534 530 void (*mutex_init)(struct mutex *m); 535 531 void (*mutex_lock)(struct mutex *m); 536 532 void (*mutex_unlock)(struct mutex *m); 537 - #endif 538 533 #ifdef HAVE_SEMAPHORE_OBJECTS 539 534 void (*semaphore_init)(struct semaphore *s, int max, int start); 540 535 int (*semaphore_wait)(struct semaphore *s, int timeout); ··· 580 575 void (*queue_post)(struct event_queue *q, long id, intptr_t data); 581 576 void (*queue_wait_w_tmo)(struct event_queue *q, struct queue_event *ev, 582 577 int ticks); 583 - #if CONFIG_CODEC == SWCODEC 584 578 void (*queue_enable_queue_send)(struct event_queue *q, 585 579 struct queue_sender_list *send, 586 580 unsigned int thread_id); ··· 589 583 intptr_t (*queue_send)(struct event_queue *q, long id, 590 584 intptr_t data); 591 585 void (*queue_reply)(struct event_queue *q, intptr_t retval); 592 - #endif /* CONFIG_CODEC == SWCODEC */ 593 586 594 587 #ifdef RB_PROFILE 595 588 void (*profile_thread)(void); ··· 673 666 int (*sound_enum_hw_eq_band_setting)(unsigned int band, 674 667 unsigned int band_setting); 675 668 #endif /* AUDIOHW_HAVE_EQ */ 676 - #if ((CONFIG_CODEC == SWCODEC) && defined (HAVE_PITCHCONTROL)) 669 + #if defined (HAVE_PITCHCONTROL) 677 670 void (*sound_set_pitch)(int32_t pitch); 678 671 #endif 679 672 #if (CONFIG_PLATFORM & PLATFORM_NATIVE) ··· 682 675 void (*mp3_play_pause)(bool play); 683 676 void (*mp3_play_stop)(void); 684 677 bool (*mp3_is_playing)(void); 685 - #if CONFIG_CODEC != SWCODEC 686 - void (*bitswap)(unsigned char *data, int length); 687 - #endif 688 678 #endif /* PLATFORM_NATIVE */ 689 - #if CONFIG_CODEC == SWCODEC 690 679 const unsigned long *audio_master_sampr_list; 691 680 const unsigned long *hw_freq_sampr; 692 681 void (*pcm_apply_settings)(void); ··· 752 741 void (*pcmbuf_fade)(bool fade, bool in); 753 742 void (*system_sound_play)(enum system_sound sound); 754 743 void (*keyclick_click)(bool rawbutton, int action); 755 - #endif /* CONFIG_CODEC == SWCODEC */ 756 744 757 745 /* metadata */ 758 746 bool (*get_metadata)(struct mp3entry* id3, int fd, const char* trackname); ··· 817 805 struct mp3entry* (*audio_current_track)(void); 818 806 void (*audio_flush_and_reload_tracks)(void); 819 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 809 /* menu */ 825 810 struct menu_table *(*root_menu_get_options)(int *nb_options); ··· 902 887 #ifdef ROCKBOX_HAS_LOGF 903 888 void (*logf)(const char *fmt, ...) ATTRIBUTE_PRINTF(1, 2); 904 889 #endif 905 - #if CONFIG_CODEC == SWCODEC 906 890 void (*codec_thread_do_callback)(void (*fn)(void), 907 891 unsigned int *audio_thread_id); 908 892 int (*codec_load_file)(const char* codec, struct codec_api *api); ··· 915 899 const unsigned long list[], 916 900 int count, 917 901 bool signd); 918 - #endif /* CONFIG_CODEC == SWCODEC */ 919 902 920 903 #ifdef HAVE_LCD_BITMAP 921 904 int (*read_bmp_file)(const char* filename, struct bitmap *bm, int maxsize,
-18
apps/plugins/SOURCES
··· 46 46 lamp.c 47 47 #endif /* HAVE_BACKLIGHT */ 48 48 49 - 50 - 51 - #if CONFIG_CODEC == SWCODEC 52 49 #if defined(HAVE_RECORDING) && (defined(HAVE_LINE_IN) || defined(HAVE_MIC_IN)) 53 50 pitch_detector.c 54 51 #endif 55 52 56 53 mp3_encoder.c 57 54 wav2wv.c 58 - #endif /* CONFIG_CODEC */ 59 - 60 55 61 56 #if CONFIG_RTC 62 57 alarmclock.c ··· 98 93 pictureflow.c 99 94 100 95 #endif /* PLUGIN_BUFFER_SIZE <= 0x20000 && HAVE_LCD_BITMAP */ 101 - 102 - 103 - #if CONFIG_CODEC != SWCODEC 104 - 105 - #if defined(HAVE_LCD_BITMAP) 106 - splitedit.c 107 - #endif 108 - 109 - #endif /* HWCODEC */ 110 96 111 97 #if defined(IRIVER_H100_SERIES) 112 98 iriver_flash.c ··· 207 193 #ifdef HAVE_ADJUSTABLE_CPU_FREQ 208 194 test_boost.c 209 195 #endif 210 - #if CONFIG_CODEC == SWCODEC 211 196 test_codec.c 212 - #endif 213 197 #ifdef HAVE_JPEG 214 198 test_core_jpeg.c 215 199 #endif ··· 232 216 #ifdef HAVE_LCD_COLOR 233 217 test_resize.c 234 218 #endif 235 - #if CONFIG_CODEC == SWCODEC 236 219 test_sampr.c 237 - #endif 238 220 #ifdef HAVE_TOUCHSCREEN 239 221 test_touchscreen.c 240 222 #endif
-4
apps/plugins/SOURCES.app_build
··· 23 23 #ifdef HAVE_ADJUSTABLE_CPU_FREQ 24 24 test_boost.c 25 25 #endif 26 - #if CONFIG_CODEC == SWCODEC 27 26 test_codec.c 28 - #endif 29 27 #ifdef HAVE_JPEG 30 28 test_core_jpeg.c 31 29 #endif ··· 46 44 #ifdef HAVE_LCD_COLOR 47 45 test_resize.c 48 46 #endif 49 - #if CONFIG_CODEC == SWCODEC 50 47 test_sampr.c 51 - #endif 52 48 test_viewports.c 53 49 #endif /* HAVE_TEST_PLUGINS */ 54 50
+1 -6
apps/plugins/SUBDIRS
··· 37 37 pictureflow 38 38 #endif 39 39 40 - #if CONFIG_CODEC == SWCODEC && PLUGIN_BUFFER_SIZE > 0x20000 40 + #if PLUGIN_BUFFER_SIZE > 0x20000 41 41 fft 42 42 #endif 43 43 ··· 70 70 doom 71 71 #endif 72 72 73 - /* For all the swcodec targets */ 74 - #if CONFIG_CODEC == SWCODEC 75 - 76 73 #if MEMORYSIZE > 2 /* we need a lot of RAM for instruments */ 77 74 midi 78 75 mikmod ··· 90 87 #if !defined(RB_PROFILE) && MEMORYSIZE > 2 /* mpegplayer allocates at least 2MB of RAM */ 91 88 mpegplayer 92 89 #endif 93 - 94 - #endif /* CONFIG_CODEC == SWCODEC */ 95 90 96 91 /* Lua needs at least 160 KB to work in */ 97 92 #if PLUGIN_BUFFER_SIZE >= 0x80000
+1 -4
apps/plugins/SUBDIRS.app_build
··· 10 10 lua_scripts 11 11 #ifdef HAVE_LCD_BITMAP 12 12 13 - #if CONFIG_CODEC == SWCODEC && PLUGIN_BUFFER_SIZE > 0x20000 13 + #if PLUGIN_BUFFER_SIZE > 0x20000 14 14 fft 15 15 #endif 16 16 ··· 23 23 #endif /* HAVE_LCD_BITMAP */ 24 24 25 25 /* For all the swcodec targets */ 26 - #if CONFIG_CODEC == SWCODEC 27 - 28 26 #if MEMORYSIZE > 2 /* we need a lot of RAM for instruments */ 29 27 mikmod 30 28 #endif 31 29 32 - #endif /* CONFIG_CODEC == SWCODEC */ 33 30 #endif /* HAVE_TOUCHSCREEN */
-2
apps/plugins/bitmaps/mono/SOURCES
··· 50 50 #endif 51 51 #endif 52 52 53 - #if CONFIG_CODEC == SWCODEC 54 53 /* MPEGplayer */ 55 54 mpegplayer_status_icons_8x8x1.bmp 56 55 mpegplayer_status_icons_12x12x1.bmp 57 56 mpegplayer_status_icons_16x16x1.bmp 58 - #endif 59 57 60 58 #if LCD_WIDTH == 160 && LCD_HEIGHT == 128 && LCD_DEPTH < 16 61 59 superdom_boarditems.160x128x1.bmp
+1 -1
apps/plugins/bitmaps/native/SOURCES
··· 957 957 /* Pitch detector */ 958 958 /* The following preprocessor condition must match the condition */ 959 959 /* for pitch detector from plugins/SOURCES */ 960 - #if (CONFIG_CODEC == SWCODEC) && defined(HAVE_RECORDING) && \ 960 + #if defined(HAVE_RECORDING) && \ 961 961 (defined(HAVE_LINE_IN) || defined(HAVE_MIC_IN)) 962 962 #if (LCD_WIDTH >= 320) && (LCD_HEIGHT >= 240) && (LCD_DEPTH >= 16) 963 963 pitch_notes.320x240x16.bmp
-47
apps/plugins/chip8.c
··· 1331 1331 static unsigned long starttimer; /* Timer value at the beginning */ 1332 1332 static unsigned long cycles; /* Number of update cycles (50Hz) */ 1333 1333 1334 - #if (CONFIG_CODEC != SWCODEC) && !defined(SIMULATOR) 1335 - static bool is_playing; 1336 - 1337 - /* one frame of bitswapped mp3 data */ 1338 - static unsigned char beep[]={255, 1339 - 223, 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, 1344 - 252,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, 1349 - 111,181,184,144, 17,148, 21,101,166,227,100, 86, 85, 85, 85}; 1350 - /* callback to request more mp3 data */ 1351 - static 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 1335 /* Turn sound on */ 1360 1336 /****************************************************************************/ 1361 1337 static 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 1343 /****************************************************************************/ 1372 1344 static 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 1544 rb->lcd_drawrect(CHIP8_X-1,CHIP8_Y-1,CHIP8_LCDWIDTH+2,CHIP8_HEIGHT+2); 1577 1545 #endif 1578 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 1547 starttimer = *rb->current_tick; 1588 1548 1589 1549 chip8_iperiod=15; 1590 1550 cycles = 0; 1591 1551 chip8(); 1592 - 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 1552 1600 1553 if (chip8_running == 3) { 1601 1554 /* unsupported instruction */
+1 -5
apps/plugins/lua/rocklib.c
··· 487 487 lua_pushstring (L, rb->sound_unit(setting)); 488 488 return 1; 489 489 break; 490 - #if ((CONFIG_CODEC == SWCODEC) && defined (HAVE_PITCHCONTROL)) 490 + #if defined (HAVE_PITCHCONTROL) 491 491 case SOUND_SET_PITCH: 492 492 rb->sound_set_pitch(setting); 493 493 return 1;/*nil*/ ··· 507 507 return 1; 508 508 } 509 509 510 - #if CONFIG_CODEC == SWCODEC 511 510 RB_WRAP(pcm) 512 511 { 513 512 enum e_pcm {PCM_APPLYSETTINGS = 0, PCM_ISPLAYING, PCM_ISPAUSED, ··· 579 578 lua_pushinteger(L, result); 580 579 return 1; 581 580 } 582 - #endif /*CONFIG_CODEC == SWCODEC*/ 583 581 584 582 /* DEVICE LIGHTING CONTROL */ 585 583 RB_WRAP(backlight_onoff) ··· 953 951 RB_FUNC(audio), 954 952 RB_FUNC(playlist), 955 953 RB_FUNC(sound), 956 - #if CONFIG_CODEC == SWCODEC 957 954 RB_FUNC(pcm), 958 955 RB_FUNC(mixer_frequency), 959 - #endif 960 956 961 957 /* DEVICE LIGHTING CONTROL */ 962 958 RB_FUNC(backlight_onoff),
-194
apps/plugins/metronome.c
··· 123 123 }; 124 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 */ 129 - static 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 - }; 195 - static 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 126 /* raw PCM */ 264 127 static signed short tick_sound[] = 265 128 { ··· 641 504 ,-3,2,-1,0,1,-1,0,0,1,-1,1 642 505 ,-2,3 643 506 }; 644 - #endif 645 507 646 508 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 647 509 Utilities from pdbox plugin (Copyright (C) 2009 Wincent Balin) --- am I ··· 941 803 942 804 static 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) 951 - static void play_tick(void){ printf("tick\n"); } 952 - static 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 - 959 - static 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 - 969 - static 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 - 977 - static 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 806 #define MET_IS_PLAYING rb->pcm_is_playing() 990 807 #define MET_PLAY_STOP rb->audio_stop() 991 808 ··· 1013 830 { 1014 831 rb->pcm_play_data(NULL, NULL, tock_buf, sizeof(tock_buf)); 1015 832 } 1016 - 1017 - #endif /* CONFIG_CODEC != SWCODEC */ 1018 833 1019 834 /* State: 0: blank/title, 1: tick, 2: tock 3: silent klick */ 1020 835 /* TODO: Could use more smart placement, using ··· 1446 1261 MET_PLAY_STOP; /* stop audio ISR */ 1447 1262 tweak_volume(0); 1448 1263 rb->led(0); 1449 - #if CONFIG_CODEC == SWCODEC 1450 1264 rb->pcm_set_frequency(HW_SAMPR_DEFAULT); 1451 - #endif 1452 1265 } 1453 1266 1454 1267 /* ··· 1786 1599 1787 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 1602 prepare_buffers(); 1796 1603 #if INPUT_SRC_CAPS != 0 1797 1604 /* Select playback */ ··· 1799 1606 rb->audio_set_output_source(AUDIO_SRC_PLAYBACK); 1800 1607 #endif 1801 1608 rb->pcm_set_frequency(SAMPR_44); 1802 - #endif /* CONFIG_CODEC != SWCODEC */ 1803 1609 1804 1610 if(file) 1805 1611 {
-2
apps/plugins/mpegplayer/mpeg_settings.c
··· 1245 1245 } 1246 1246 } 1247 1247 1248 - #if CONFIG_CODEC == SWCODEC 1249 1248 static void audio_options(void) 1250 1249 { 1251 1250 int selected = 0; ··· 1307 1306 menu_quit = true; 1308 1307 } 1309 1308 } 1310 - #endif 1311 1309 1312 1310 static void resume_options(void) 1313 1311 {
-8
apps/plugins/oscilloscope.c
··· 902 902 903 903 static void get_peaks(int *left, int *right) 904 904 { 905 - #if CONFIG_CODEC == SWCODEC 906 905 static struct pcm_peaks peaks; 907 906 rb->mixer_channel_calculate_peaks(PCM_MIXER_CHAN_PLAYBACK, 908 907 &peaks); 909 908 *left = peaks.left; 910 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 920 912 static long get_next_delay(void)
-6
apps/plugins/properties.c
··· 112 112 113 113 num_properties = 5; 114 114 115 - #if (CONFIG_CODEC == SWCODEC) 116 115 int fd = rb->open(selected_file, O_RDONLY); 117 116 if (fd >= 0 && 118 117 rb->get_metadata(&id3, fd, selected_file)) 119 - #else 120 - if (!rb->mp3info(&id3, selected_file)) 121 - #endif 122 118 { 123 119 long dur = id3.length / 1000; /* seconds */ 124 120 rb->snprintf(str_artist, sizeof str_artist, ··· 145 141 num_properties++; 146 142 } 147 143 } 148 - #if (CONFIG_CODEC == SWCODEC) 149 144 rb->close(fd); 150 - #endif 151 145 found = true; 152 146 break; 153 147 }
-26
apps/plugins/rockboy/rbsound.c
··· 7 7 #define N_BUFS 2 8 8 #define BUF_SIZE 2048 9 9 10 - #if CONFIG_CODEC == SWCODEC 11 - 12 10 bool doneplay=1; 13 11 bool bufnum=0; 14 12 ··· 88 86 pcm.pos = 0; 89 87 return 1; 90 88 } 91 - 92 - #else 93 - 94 - void 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 - 103 - void rockboy_pcm_close(void) 104 - { 105 - memset(&pcm, 0, sizeof pcm); 106 - } 107 - 108 - int rockboy_pcm_submit(void) 109 - { 110 - pcm.pos =0; 111 - return 0; 112 - } 113 - 114 - #endif
-1231
apps/plugins/splitedit.c
··· 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 55 - unsigned 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 - 63 - unsigned char CUT_BMP[] = 64 - { 65 - 0xc1,0x63,0x63,0x36,0xb6,0x1c,0x1c,0x36,0x77,0x55,0x55,0x55,0x32, 66 - }; 67 - 68 - unsigned 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 */ 91 - static char path_mp3[MAX_PATH]; 92 - 93 - /* Exit code of this plugin */ 94 - static enum plugin_status splitedit_exit_code = PLUGIN_OK; 95 - 96 - /* The range in time that the displayed aerea comprises */ 97 - static unsigned int range_start = 0; 98 - static unsigned int range_end = 0; 99 - 100 - /* The range in time that is being looped */ 101 - static unsigned int play_start = 0; 102 - static unsigned int play_end = 0; 103 - 104 - /* Point in time (pixel) at which the split mark is set */ 105 - static int split_x = OSCI_X + (OSCI_WIDTH / 2); 106 - 107 - /* Contains the peak values */ 108 - static 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 */ 112 - static 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 - */ 118 - static 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 */ 133 - static 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 - */ 144 - static 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 - */ 153 - static 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 - */ 164 - static 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 - */ 191 - static 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 - */ 214 - static 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 - */ 229 - static 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 - */ 238 - static 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 - */ 246 - static 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 - */ 277 - static 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 - */ 315 - static 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 - */ 335 - static 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 - */ 363 - static 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 - */ 401 - static int splitedit_get_split_x(void) 402 - { 403 - return split_x; 404 - } 405 - 406 - /** 407 - * Clears the osci area and redraws it 408 - */ 409 - static 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 - */ 424 - static 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 - 468 - static 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 - */ 479 - static 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 - */ 493 - static 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 - */ 507 - static 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 - */ 546 - static 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 - */ 599 - static 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 - 754 - static 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 - */ 770 - static 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 - */ 903 - static 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 - 1208 - enum 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 - }
+1 -2
apps/plugins/starfield.c
··· 220 220 rb->sleep(1); 221 221 rb->lcd_clear_display(); 222 222 223 - #if (CONFIG_CODEC == SWCODEC) 224 223 /* This will make the stars pulse to the music */ 225 224 if(pulse){ 226 225 ··· 255 254 starfield.z_move = avg_peak; 256 255 257 256 } /* if pulse */ 258 - #endif 257 + 259 258 starfield_move_and_draw(&starfield); 260 259 261 260 #ifdef HAVE_LCD_COLOR
-8
apps/plugins/vu_meter.c
··· 469 469 #endif 470 470 #endif 471 471 472 - #if defined(SIMULATOR) && (CONFIG_CODEC != SWCODEC) 473 - #define mas_codec_readreg(x) rand()%MAX_PEAK 474 - #endif 475 - 476 472 /* Defines x positions on a logarithmic (dBfs) scale. */ 477 473 unsigned char analog_db_scale[LCD_WIDTH/2]; 478 474 ··· 780 776 781 777 static void analog_meter(void) { 782 778 783 - #if (CONFIG_CODEC == SWCODEC) 784 779 static struct pcm_peaks peaks; 785 780 rb->mixer_channel_calculate_peaks(PCM_MIXER_CHAN_PLAYBACK, 786 781 &peaks); 787 782 #define left_peak peaks.left 788 783 #define right_peak peaks.right 789 - #endif 790 784 791 785 if(vumeter_settings.analog_use_db_scale) { 792 786 left_needle_top_x = analog_db_scale[left_peak * half_width / MAX_PEAK]; ··· 837 831 } 838 832 839 833 static void digital_meter(void) { 840 - #if (CONFIG_CODEC == SWCODEC) 841 834 static struct pcm_peaks peaks; 842 835 rb->mixer_channel_calculate_peaks(PCM_MIXER_CHAN_PLAYBACK, 843 836 &peaks); 844 837 #define left_peak peaks.left 845 838 #define right_peak peaks.right 846 - #endif 847 839 848 840 if(vumeter_settings.digital_use_db_scale) { 849 841 num_left_leds = digital_db_scale[left_peak * 44 / MAX_PEAK];
+2 -2
apps/plugins/zxbox/spmain.c
··· 290 290 no_yes, 2, NULL); 291 291 if (new_setting != settings.sound ) 292 292 settings.sound=new_setting; 293 - #if CONFIG_CODEC == SWCODEC && !defined SIMULATOR 293 + #if !defined SIMULATOR 294 294 rb->pcm_play_stop(); 295 295 #endif 296 296 break; ··· 318 318 /* menu */ 319 319 static bool zxbox_menu(void) 320 320 { 321 - #if CONFIG_CODEC == SWCODEC && !defined SIMULATOR 321 + #if !defined SIMULATOR 322 322 rb->pcm_play_stop(); 323 323 #endif 324 324 int selected=0;
+2 -2
apps/plugins/zxbox/zxbox.c
··· 102 102 #ifdef USE_GREY 103 103 grey_show(false); 104 104 grey_release(); 105 - #endif 105 + #endif 106 106 107 - #if CONFIG_CODEC == SWCODEC && !defined SIMULATOR 107 + #if !defined SIMULATOR 108 108 rb->pcm_play_stop(); 109 109 #endif 110 110
+1 -1
apps/plugins/zxbox/zxconfig.h
··· 29 29 #define SPECT_MEM 1 30 30 31 31 /* Define if sound driver is available. */ 32 - #if CONFIG_CODEC == SWCODEC && !defined SIMULATOR 32 + #if !defined SIMULATOR 33 33 #define HAVE_SOUND 34 34 #endif 35 35
-111
apps/radio/radio.c
··· 54 54 #include "viewport.h" 55 55 #include "skin_engine/skin_engine.h" 56 56 #include "statusbar-skinned.h" 57 - #if CONFIG_CODEC == SWCODEC 58 57 #include "playback.h" 59 - #endif 60 58 #include "presets.h" 61 59 62 60 #if CONFIG_TUNER ··· 353 351 int lastbutton = BUTTON_NONE; 354 352 unsigned long rec_lastclick = 0; 355 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 354 #ifndef HAVE_NOISY_IDLE_MODE 365 355 int button_timeout = current_tick + (2*HZ); 366 356 #endif ··· 383 373 384 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 376 /* turn on radio */ 408 - #if CONFIG_CODEC == SWCODEC 409 377 /* This should be done before touching audio settings */ 410 378 while (!pcm_is_initialized()) 411 379 sleep(0); ··· 413 381 audio_set_input_source(AUDIO_SRC_FMRADIO, 414 382 (radio_status == FMRADIO_PAUSED) ? 415 383 SRCF_FMRADIO_PAUSED : SRCF_FMRADIO_PLAYING); 416 - #else 417 - if (radio_status == FMRADIO_OFF) 418 - radio_start(); 419 - #endif 420 384 421 385 if(radio_preset_count() < 1 && yesno_pop(ID2P(LANG_FM_FIRST_AUTOSCAN))) 422 386 presets_scan(NULL); ··· 468 432 switch(button) 469 433 { 470 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 436 done = true; 480 437 if(presets_have_changed()) ··· 513 470 rec_command(RECORDING_CMD_START); 514 471 update_type = SKIN_REFRESH_ALL; 515 472 } 516 - #if CONFIG_CODEC != SWCODEC 517 - last_seconds = 0; 518 - #endif 519 473 #endif /* SIMULATOR */ 520 474 break; 521 475 #endif /* #ifdef FM_RECORD */ 522 476 523 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 478 keep_playing = true; 529 479 done = true; 530 480 if(presets_have_changed()) ··· 629 579 #endif /* FM_FREEZE */ 630 580 631 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 583 default_event_handler(SYS_USB_CONNECTED); 638 584 screen_freeze = true; /* Cosmetic: makes sure the ··· 688 634 default_event_handler(button); 689 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 637 keep_playing = false; 696 638 done = true; 697 639 if(presets_have_changed()) ··· 713 655 lastbutton = button; 714 656 #endif 715 657 716 - #if CONFIG_CODEC != SWCODEC 717 - peak_meter_peek(); 718 - #endif 719 - 720 658 if(!screen_freeze) 721 659 { 722 660 /* Only display the peak meter when not recording */ 723 - #if CONFIG_CODEC != SWCODEC 724 - if(TIME_AFTER(current_tick, timeout)) 725 661 { 726 - timeout = current_tick + HZ; 727 - #else /* SWCODEC */ 728 - { 729 - #endif /* CONFIG_CODEC == SWCODEC */ 730 - 731 662 /* keep "mono" from always being displayed when paused */ 732 663 if (radio_status != FMRADIO_PAUSED) 733 664 { ··· 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 676 if (update_type) 752 677 { 753 - #endif 754 678 FOR_NB_SCREENS(i) 755 679 skin_update(FM_SCREEN, i, update_type); 756 680 if (update_type == (int)SKIN_REFRESH_ALL) ··· 774 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 701 #ifndef HAVE_NOISY_IDLE_MODE 785 702 if (TIME_AFTER(current_tick, button_timeout)) 786 703 { ··· 790 707 } /*while(!done)*/ 791 708 792 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 710 sound_settings_apply(); 811 711 #endif /* SIMULATOR */ 812 712 ··· 814 714 { 815 715 /* Catch FMRADIO_PLAYING status for the sim. */ 816 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 717 end_search(); 825 718 #endif /* SIMULATOR */ 826 719 } 827 720 else 828 721 { 829 - #if CONFIG_CODEC == SWCODEC 830 722 audio_set_input_source(AUDIO_SRC_PLAYBACK, SRCF_PLAYBACK); 831 - #else 832 - radio_stop(); 833 - #endif 834 723 } 835 724 836 725 #ifndef HAVE_NOISY_IDLE_MODE
+1 -4
apps/radio/radio_skin.c
··· 41 41 char* default_radio_skin(enum screen_type screen) 42 42 { 43 43 (void)screen; 44 - static char default_fms[] = 44 + static char default_fms[] = 45 45 "%s%?Ti<%Ti. |>%?Tn<%Tn|%Tf>\n" 46 46 "%Sx(Station:) %tf MHz\n" 47 47 "%?St(force fm mono)<%Sx(Force Mono)|%?ts<%Sx(Stereo)|%Sx(Mono)>>\n" 48 48 "%Sx(Mode:) %?tm<%Sx(Scan)|%Sx(Preset)>\n" 49 49 #ifdef HAVE_RADIO_RSSI 50 50 "%Sx(Signal strength:) %tr dBuV\n" 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 51 #endif 55 52 "%pb\n" 56 53 #ifdef HAVE_RDS_CAP
+2 -6
apps/recorder/icons.c
··· 40 40 {0x7f, 0x22, 0x1c, 0x22, 0x7f}, /* Stereo recording */ 41 41 [Icon_Mono] = 42 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 49 45 const unsigned char bitmap_icons_7x8[][7] = ··· 68 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) 72 68 const unsigned char bitmap_glyphs_4x8[][4] = 73 69 { 74 70 /* Keep digits together and first! */ ··· 116 112 {0x00, 0x1e, 0x20, 0x18, 0x20, 0x1e, 0x00, 0x3c, 0x0a, 117 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 117 /* Disk/MMC activity */ 122 118 const unsigned char bitmap_icon_disk[12] =
+2 -5
apps/recorder/icons.h
··· 42 42 Icon_Lock_Remote, 43 43 Icon_Stereo, 44 44 Icon_Mono, 45 - #if CONFIG_CODEC != SWCODEC 46 - Icon_q, 47 - #endif 48 45 Icon5x8Last 49 46 }; 50 47 ··· 70 67 Icon7x8Last 71 68 }; 72 69 73 - #if CONFIG_CODEC == SWCODEC && defined (HAVE_RECORDING) 70 + #if defined (HAVE_RECORDING) 74 71 #define BM_GLYPH_WIDTH 4 75 72 enum Glyphs_4x8 { 76 73 Glyph_4x8_0 = 0, ··· 100 97 }; 101 98 extern 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 105 102 extern const unsigned char bitmap_icons_5x8[Icon5x8Last][5]; 106 103 extern const unsigned char bitmap_icons_7x8[Icon7x8Last][7];
-4
apps/recorder/keyboard.c
··· 1218 1218 else if (state->editpos > state->len_utf8) 1219 1219 { 1220 1220 state->editpos = 0; 1221 - #if CONFIG_CODEC == SWCODEC 1222 1221 if (global_settings.talk_menu) beep_play(1000, 150, 1500); 1223 - #endif 1224 1222 } 1225 1223 else if (state->editpos < 0) 1226 1224 { 1227 1225 state->editpos = state->len_utf8; 1228 - #if CONFIG_CODEC == SWCODEC 1229 1226 if (global_settings.talk_menu) beep_play(1000, 150, 1500); 1230 - #endif 1231 1227 } 1232 1228 } 1233 1229
+6 -69
apps/recorder/peakmeter.c
··· 19 19 * 20 20 ****************************************************************************/ 21 21 #include "config.h" 22 - #if defined(SIMULATOR) && (CONFIG_CODEC != SWCODEC) 23 - #include <stdlib.h> /* sim uses rand for peakmeter simulation */ 24 - #endif 25 22 #include "thread.h" 26 23 #include "kernel.h" 27 24 #include "settings.h" ··· 42 39 #endif 43 40 #include "action.h" 44 41 45 - #if CONFIG_CODEC == SWCODEC 46 42 #include "pcm.h" 47 43 #include "pcm_mixer.h" 48 44 ··· 50 46 #include "pcm_record.h" 51 47 #endif 52 48 49 + #if !(CONFIG_PLATFORM & PLATFORM_HOSTED) 53 50 static bool pm_playback = true; /* selects between playback and recording peaks */ 54 51 #endif 55 52 56 53 static struct meter_scales scales[NB_SCREENS]; 57 - 58 - #if !defined(SIMULATOR) && CONFIG_CODEC != SWCODEC 59 - /* Data source */ 60 - static int pm_src_left = MAS_REG_DQPEAK_L; 61 - static int pm_src_right = MAS_REG_DQPEAK_R; 62 - #endif 63 54 64 55 /* Current values and cumulation */ 65 56 static int pm_cur_left; /* current values (last peak_meter_peek) */ ··· 554 545 { 555 546 #if (CONFIG_PLATFORM & PLATFORM_HOSTED) 556 547 (void)playback; 557 - #elif CONFIG_CODEC == SWCODEC 558 - pm_playback = playback; 559 548 #else 560 - if (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 - } 549 + pm_playback = playback; 567 550 #endif 568 551 /* reset the scales just in case recording and playback 569 552 use different viewport sizes. Normally we should be checking viewport ··· 599 582 bool was_clipping = pm_clip_left || pm_clip_right; 600 583 #endif 601 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 589 if (pm_playback) 604 590 { 605 591 static struct pcm_peaks chan_peaks; /* *MUST* be static */ ··· 614 600 #endif 615 601 left = pm_cur_left; 616 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 603 #endif 626 604 627 605 /* check for clips ··· 632 610 a real clip. For software codecs, the peak is already 633 611 the max of a bunch of samples, so use one max value 634 612 or you fail to detect clipping! */ 635 - #if CONFIG_CODEC == SWCODEC 636 613 if (left == MAX_PEAK - 1) { 637 - #else 638 - if ((left == pm_max_left) && 639 - (left == MAX_PEAK - 1)) { 640 - #endif 641 614 pm_clip_left = true; 642 615 pm_clip_timeout_l = current_tick + pm_clip_hold; 643 616 } 644 617 645 - #if CONFIG_CODEC == SWCODEC 646 618 if (right == MAX_PEAK - 1) { 647 - #else 648 - if ((right == pm_max_right) && 649 - (right == MAX_PEAK - 1)) { 650 - #endif 651 619 pm_clip_right = true; 652 620 pm_clip_timeout_r = current_tick + pm_clip_hold; 653 621 } ··· 668 636 pm_max_right = MAX(pm_max_right, right); 669 637 670 638 #ifdef HAVE_RECORDING 671 - #if CONFIG_CODEC == SWCODEC 672 639 /* Ignore any unread peakmeter data */ 673 640 #define MAX_DROP_TIME HZ/7 /* this value may need tweaking. Increase if you are 674 641 getting trig events when you shouldn't with 675 642 trig_stp_hold = 0 */ 676 643 if (!trig_stp_hold) 677 644 trig_stp_hold = MAX_DROP_TIME; 678 - #endif 679 645 680 646 switch (trig_status) { 681 647 case TRIG_READY: ··· 735 701 || (right > trig_stp_threshold)) { 736 702 /* restart hold time countdown */ 737 703 trig_lowtime = current_tick; 738 - #if CONFIG_CODEC == SWCODEC 739 704 } else if (current_tick - trig_lowtime > MAX_DROP_TIME){ 740 - #else 741 - } else { 742 - #endif 743 705 set_trig_status(TRIG_POSTREC); 744 706 trig_hightime = current_tick; 745 707 } ··· 797 759 } 798 760 break; 799 761 } 800 - #if CONFIG_CODEC == SWCODEC 801 762 /* restore stop hold value */ 802 763 if (trig_stp_hold == MAX_DROP_TIME) 803 764 trig_stp_hold = 0; 804 - #endif 805 765 #endif 806 766 /* check levels next time peakmeter drawn */ 807 767 level_check = true; ··· 821 781 /* pm_max_left contains the maximum of all peak values that were read 822 782 by peak_meter_peek since the last call of peak_meter_read_l */ 823 783 int retval; 824 - 825 - #if defined(SIMULATOR) && (CONFIG_CODEC != SWCODEC) 826 - srand(current_tick); 827 - pm_max_left = rand()%MAX_PEAK; 828 - #endif 829 784 830 785 retval = pm_max_left; 831 786 ··· 855 810 by peak_meter_peek since the last call of peak_meter_read_r */ 856 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 813 retval = pm_max_right; 864 814 865 815 #if defined(HAVE_HISTOGRAM) || defined(HAVE_AGC) ··· 1128 1078 /* cliplight */ 1129 1079 if ((pm_clip_left || pm_clip_right) && 1130 1080 global_settings.cliplight && 1131 - #if CONFIG_CODEC == SWCODEC 1132 1081 !pm_playback) 1133 - #else 1134 - !(audio_status() & (AUDIO_STATUS_PLAY | AUDIO_STATUS_ERROR))) 1135 - #endif 1136 1082 { 1137 1083 /* if clipping, cliplight setting on and in recording screen */ 1138 1084 if (global_settings.cliplight <= 2) ··· 1375 1321 long next_refresh = current_tick; 1376 1322 long next_big_refresh = current_tick + HZ / 10; 1377 1323 int i; 1378 - #if (CONFIG_CODEC == SWCODEC) 1379 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 1325 bool dopeek = true; 1389 1326 1390 1327 while (TIME_BEFORE(current_tick, next_big_refresh)) {
+1 -77
apps/recorder/recording.c
··· 31 31 #include "lcd.h" 32 32 #include "led.h" 33 33 #include "audio.h" 34 - #if CONFIG_CODEC == SWCODEC 35 34 #include "thread.h" 36 35 #include "enc_config.h" 37 36 #include "playback.h" 38 37 #if defined(HAVE_SPDIF_IN) || defined(HAVE_SPDIF_OUT) 39 38 #include "spdif.h" 40 39 #endif 41 - #endif /* CONFIG_CODEC == SWCODEC */ 42 40 #include "pcm_record.h" 43 41 #include "recording.h" 44 - #include "mp3_playback.h" 45 42 #include "button.h" 46 43 #include "kernel.h" 47 44 #include "settings.h" ··· 166 163 static int file_number = -1; 167 164 #endif /* CONFIG_RTC */ 168 165 169 - #if CONFIG_CODEC == SWCODEC 170 - 171 166 #define REC_FILE_ENDING(rec_format) \ 172 167 (audio_formats[rec_format_afmt[rec_format]].ext_list) 173 - 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 168 182 169 /* path for current file */ 183 170 static char path_buffer[MAX_PATH]; ··· 607 594 options->rec_frequency = global_settings.rec_frequency; 608 595 options->rec_channels = global_settings.rec_channels; 609 596 options->rec_prerecord_time = global_settings.rec_prerecord_time; 610 - #if CONFIG_CODEC == SWCODEC 611 597 options->rec_mono_mode = global_settings.rec_mono_mode; 612 598 options->rec_source_flags = 0; 613 599 options->enc_config.rec_format = global_settings.rec_format; 614 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 622 603 void rec_set_source(int source, unsigned flags) 623 604 { 624 605 /* Set audio input source, power up/down devices */ ··· 628 609 peak_meter_playback((flags & SRCF_RECORDING) == 0); 629 610 peak_meter_enable(true); 630 611 } 631 - #endif /* CONFIG_CODEC == SWCODEC */ 632 612 633 613 void rec_set_recording_options(struct audio_recording_options *options) 634 614 { 635 - #if CONFIG_CODEC == SWCODEC 636 615 rec_set_source(options->rec_source, 637 616 options->rec_source_flags | SRCF_RECORDING); 638 - #endif 639 617 audio_set_recording_options(options); 640 618 } 641 619 ··· 646 624 case RECORDING_CMD_STOP_SHUTDOWN: 647 625 pm_activate_clipcount(false); 648 626 audio_stop_recording(); 649 - #if CONFIG_CODEC == SWCODEC 650 627 audio_close_recording(); 651 - #endif 652 628 sys_poweroff(); 653 629 break; 654 630 case RECORDING_CMD_STOP: ··· 695 671 if(!(audio_status() & AUDIO_STATUS_RECORD)) 696 672 { 697 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 676 /* if we're already recording this is a retrigger */ ··· 791 761 #ifdef HAVE_SPDIF_REC 792 762 enum rec_list_items_spdif { 793 763 ITEM_VOLUME_D = 0, 794 - #if CONFIG_CODEC == SWCODEC 795 764 ITEM_SAMPLERATE_D = 6, 796 765 ITEM_FILENAME_D = 7, 797 766 ITEM_COUNT_D = 3, 798 - #else 799 - ITEM_FILENAME_D = 7, 800 - ITEM_COUNT_D = 2, 801 - #endif 802 767 }; 803 768 #endif 804 769 ··· 892 857 buf3, sizeof(buf3))); 893 858 break; 894 859 #endif 895 - #if CONFIG_CODEC == SWCODEC 896 860 #ifdef HAVE_SPDIF_REC 897 861 case ITEM_SAMPLERATE_D: 898 862 snprintf(buffer, buffer_len, "%s: %lu", 899 863 str(LANG_FREQUENCY), pcm_rec_sample_rate()); 900 864 break; 901 - #endif 902 865 #endif 903 866 case ITEM_FILENAME: 904 867 { ··· 973 936 const unsigned long split_seconds = (unsigned) global_settings.rec_timesplit * 60; 974 937 const unsigned long split_bytes = rec_sizesplit_bytes(); 975 938 976 - #if CONFIG_CODEC == SWCODEC 977 939 int warning_counter = 0; 978 940 #define WARNING_PERIOD 7 979 - #endif 980 941 981 - #if CONFIG_CODEC == SWCODEC 982 942 #ifdef HAVE_SPDIF_REC 983 943 unsigned long prev_sample_rate = 0; 984 - #endif 985 944 #endif 986 945 987 946 #ifdef HAVE_FMRADIO_REC ··· 1030 989 ata_set_led_enabled(false); 1031 990 #endif 1032 991 1033 - #if CONFIG_CODEC == SWCODEC 1034 992 /* hardware samplerate gets messed up so prevent mixer playing */ 1035 993 int keyclick = global_settings.keyclick; 1036 994 global_settings.keyclick = 0; ··· 1039 997 talk_disable(true); 1040 998 /* audio_init_recording stops anything playing when it takes the audio 1041 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 1001 #ifdef HAVE_AGC 1049 1002 peak_meter_get_peakhold(&peak_l, &peak_r); ··· 1175 1128 goto rec_abort; 1176 1129 } 1177 1130 1178 - #if CONFIG_CODEC == SWCODEC && CONFIG_RTC == 0 1131 + #if CONFIG_RTC == 0 1179 1132 /* If format changed, a new number is required */ 1180 1133 rec_init_filename(); 1181 1134 #endif ··· 1202 1155 if(global_settings.rec_source == AUDIO_SRC_SPDIF) 1203 1156 { 1204 1157 listid_to_enum[0] = ITEM_VOLUME_D; 1205 - #if CONFIG_CODEC == SWCODEC 1206 1158 listid_to_enum[1] = ITEM_SAMPLERATE_D; 1207 1159 listid_to_enum[2] = ITEM_FILENAME_D; 1208 - #else 1209 - listid_to_enum[1] = ITEM_FILENAME_D; 1210 - #endif 1211 1160 1212 1161 gui_synclist_set_nb_items(&lists, ITEM_COUNT_D); /* spdif */ 1213 1162 } ··· 1452 1401 } 1453 1402 else 1454 1403 { 1455 - #if CONFIG_CODEC != SWCODEC 1456 - peak_meter_playback(true); 1457 - peak_meter_enable(false); 1458 - #endif 1459 1404 done = 1; 1460 1405 } 1461 1406 update_countdown = 0; /* Update immediately */ ··· 1543 1488 update_countdown = 0; /* Update immediately */ 1544 1489 break; 1545 1490 case ACTION_STD_MENU: 1546 - #if CONFIG_CODEC == SWCODEC 1547 1491 if(!(audio_stat & AUDIO_STATUS_RECORD)) 1548 - #else 1549 - if(audio_stat != AUDIO_STATUS_RECORD) 1550 - #endif 1551 1492 { 1552 1493 #if (CONFIG_LED == LED_REAL) 1553 1494 /* led is restored at begin of loop / end of function */ ··· 1622 1563 dsize = split_bytes; 1623 1564 num_recorded_bytes = audio_num_recorded_bytes(); 1624 1565 1625 - #if CONFIG_CODEC == SWCODEC 1626 1566 if ((audio_stat & AUDIO_STATUS_WARNING) 1627 1567 && (warning_counter++ % WARNING_PERIOD) < WARNING_PERIOD/2) 1628 1568 { ··· 1635 1575 (unsigned long)pcm_rec_get_warnings()); 1636 1576 } 1637 1577 else 1638 - #endif /* CONFIG_CODEC == SWCODEC */ 1639 1578 if ((global_settings.rec_sizesplit) && 1640 1579 (global_settings.rec_split_method)) 1641 1580 { ··· 1657 1596 1658 1597 if(audio_stat & AUDIO_STATUS_PRERECORD) 1659 1598 { 1660 - #if CONFIG_CODEC == SWCODEC 1661 1599 /* Tracks amount of prerecorded data in buffer */ 1662 1600 snprintf(buf, sizeof(buf), "%s (%lu/%ds)...", 1663 1601 str(LANG_RECORD_PRERECORD), 1664 1602 audio_prerecorded_time() / HZ, 1665 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 1605 else 1672 1606 { ··· 1782 1716 } 1783 1717 #endif /* HAVE_AGC */ 1784 1718 1785 - #if CONFIG_CODEC == SWCODEC 1786 1719 #ifdef HAVE_SPDIF_REC 1787 1720 if((global_settings.rec_source == AUDIO_SRC_SPDIF) && 1788 1721 (prev_sample_rate != pcm_rec_sample_rate())) ··· 1792 1725 update_list = true; 1793 1726 } 1794 1727 #endif 1795 - #endif 1796 1728 1797 1729 if(update_list) 1798 1730 { ··· 1824 1756 FOR_NB_SCREENS(i) 1825 1757 screens[i].update(); 1826 1758 1827 - #if CONFIG_CODEC == SWCODEC 1828 1759 /* stop recording first and try to finish saving whatever it can */ 1829 1760 rec_command(RECORDING_CMD_STOP); 1830 1761 audio_close_recording(); 1831 - #endif 1832 1762 1833 1763 audio_error_clear(); 1834 1764 ··· 1841 1771 1842 1772 rec_abort: 1843 1773 1844 - #if CONFIG_CODEC == SWCODEC 1845 1774 rec_command(RECORDING_CMD_STOP); 1846 1775 audio_close_recording(); 1847 1776 ··· 1861 1790 1862 1791 /* restore keyclick */ 1863 1792 global_settings.keyclick = keyclick; 1864 - #else /* !SWCODEC */ 1865 - audio_init_playback(); 1866 - #endif /* CONFIG_CODEC == SWCODEC */ 1867 1793 1868 1794 #ifdef HAVE_SPEAKER 1869 1795 /* Re-enable speaker */ ··· 1895 1821 return (rec_status & RCSTAT_BEEN_IN_USB_MODE) != 0; 1896 1822 } /* recording_screen */ 1897 1823 1898 - #if CONFIG_CODEC == SWCODEC 1899 1824 void audio_beep(int duration) 1900 1825 { 1901 1826 /* dummy */ 1902 1827 (void)duration; 1903 1828 } 1904 - #endif /* #ifdef CONFIG_CODEC == SWCODEC */ 1905 1829 1906 1830 #endif /* HAVE_RECORDING */
-3
apps/recorder/recording.h
··· 33 33 /* If true, start recording automatically when recording_sreen() is entered */ 34 34 extern bool recording_start_automatic; 35 35 36 - #if CONFIG_CODEC == SWCODEC 37 36 /* handles device powerup, sets audio source and peakmeter mode */ 38 37 void rec_set_source(int source, unsigned flags); 39 - #endif /* CONFIG_CODEC == SW_CODEC */ 40 38 41 39 /* Initializes a recording_options structure with global settings. 42 40 pass returned data to audio_set_recording_options or 43 41 rec_set_recording_options */ 44 42 void rec_init_recording_options(struct audio_recording_options *options); 45 43 /* steals mp3 buffer, sets source and then options */ 46 - /* SRCF_RECORDING is implied for SWCODEC */ 47 44 void rec_set_recording_options(struct audio_recording_options *options); 48 45 49 46 enum recording_command
+1 -8
apps/screens.c
··· 30 30 #include "icons.h" 31 31 #include "font.h" 32 32 #include "audio.h" 33 - #include "mp3_playback.h" 34 33 #include "usb.h" 35 34 #include "settings.h" 36 35 #include "status.h" ··· 380 379 LANG_ID3_PLAYLIST, 381 380 LANG_ID3_BITRATE, 382 381 LANG_ID3_FREQUENCY, 383 - #if CONFIG_CODEC == SWCODEC 384 382 LANG_ID3_TRACK_GAIN, 385 383 LANG_ID3_ALBUM_GAIN, 386 - #endif 387 384 LANG_FILESIZE, 388 385 LANG_ID3_PATH, 389 386 }; ··· 423 420 } 424 421 } 425 422 426 - #if CONFIG_CODEC == SWCODEC 427 423 /* Say a replaygain ID3 value from its text form */ 428 424 static void say_gain(char *buf) 429 425 { ··· 479 475 }else /* we didn't find a number, just spell everything */ 480 476 talk_spell(buf, true); 481 477 } 482 - #endif 483 478 484 479 static const char * id3_get_or_speak_info(int selected_item, void* data, 485 480 char *buffer, size_t buffer_len, ··· 619 614 if(say_it) 620 615 talk_value(id3->frequency, UNIT_HERTZ, true); 621 616 break; 622 - #if CONFIG_CODEC == SWCODEC 623 617 case LANG_ID3_TRACK_GAIN: 624 618 replaygain_itoa(buffer, buffer_len, id3->track_level); 625 619 val=(id3->track_level) ? buffer : NULL; /* only show level!=0 */ ··· 632 626 if(say_it && val) 633 627 say_gain(val); 634 628 break; 635 - #endif 636 629 case LANG_ID3_PATH: 637 630 val=id3->path; 638 631 if(say_it && val) 639 632 talk_fullpath(val, true); 640 - break; 633 + break; 641 634 case LANG_ID3_COMPOSER: 642 635 val=id3->composer; 643 636 if(say_it && val)
-2
apps/scrobbler.c
··· 226 226 227 227 /* add entry using the currently ending track */ 228 228 if (pending && (te->flags & TEF_CURRENT) 229 - #if CONFIG_CODEC == SWCODEC 230 229 && !(te->flags & TEF_REWIND) 231 - #endif 232 230 ) 233 231 { 234 232 pending = false;
+2 -10
apps/settings.c
··· 77 77 struct user_settings global_settings; 78 78 struct system_status global_status; 79 79 80 - #if CONFIG_CODEC == SWCODEC 81 80 #include "dsp_proc_settings.h" 82 81 #include "playback.h" 83 82 #ifdef HAVE_RECORDING 84 83 #include "enc_config.h" 85 84 #endif 86 85 #include "pcm_sampr.h" 87 - #endif /* CONFIG_CODEC == SWCODEC */ 88 86 89 87 #define NVRAM_DATA_START 8 90 88 #ifdef HAVE_RTC_RAM ··· 589 587 continue; 590 588 break; 591 589 #endif 592 - #if CONFIG_CODEC == SWCODEC 593 590 case SETTINGS_SAVE_EQPRESET: 594 591 if ((settings[i].flags&F_EQSETTING) == 0) 595 592 continue; 596 593 break; 597 - #endif 598 594 } 599 595 600 596 cfg_to_string(i, value, MAX_PATH); ··· 675 671 namebase = "recording"; 676 672 break; 677 673 #endif 678 - #if CONFIG_CODEC == SWCODEC 679 674 case SETTINGS_SAVE_EQPRESET: 680 675 folder = EQS_DIR; 681 676 namebase = "eq"; 682 677 break; 683 - #endif 684 678 case SETTINGS_SAVE_SOUND: 685 679 folder = ROCKBOX_DIR; 686 680 namebase = "sound"; ··· 982 976 lcd_scroll_delay(global_settings.scroll_delay); 983 977 984 978 985 - #if CONFIG_CODEC == SWCODEC 986 979 #ifdef HAVE_PLAY_FREQ 987 980 /* before crossfade */ 988 981 audio_set_playback_frequency(global_settings.play_frequency); ··· 1016 1009 dsp_timestretch_enable(global_settings.timestretch_enabled); 1017 1010 #endif 1018 1011 dsp_set_compressor(&global_settings.compressor_settings); 1019 - #endif 1020 1012 1021 1013 #ifdef HAVE_SPDIF_POWER 1022 1014 spdif_power_enable(global_settings.spdif_enable); ··· 1068 1060 #endif 1069 1061 1070 1062 /* This should stay last */ 1071 - #if defined(HAVE_RECORDING) && CONFIG_CODEC == SWCODEC 1063 + #if defined(HAVE_RECORDING) 1072 1064 enc_global_settings_apply(); 1073 1065 #endif 1074 1066 #ifdef HAVE_LCD_BITMAP ··· 1114 1106 { 1115 1107 for(int i=0; i<nb_settings; i++) 1116 1108 reset_setting(&settings[i], settings[i].setting); 1117 - #if defined (HAVE_RECORDING) && CONFIG_CODEC == SWCODEC 1109 + #if defined (HAVE_RECORDING) 1118 1110 enc_global_settings_reset(); 1119 1111 #endif 1120 1112 #ifdef HAVE_LCD_BITMAP
-29
apps/settings.h
··· 30 30 #include "statusbar.h" /* for the statusbar values */ 31 31 #include "quickscreen.h" 32 32 #include "button.h" 33 - #if CONFIG_CODEC == SWCODEC 34 33 #include "audio.h" 35 34 #include "dsp_proc_settings.h" 36 - #endif 37 35 #include "rbpaths.h" 38 36 39 37 struct opt_items { ··· 218 216 #ifdef HAVE_RECORDING 219 217 SETTINGS_SAVE_RECPRESETS, 220 218 #endif 221 - #if CONFIG_CODEC == SWCODEC 222 219 SETTINGS_SAVE_EQPRESET, 223 - #endif 224 220 }; 225 221 bool settings_save_config(int options); 226 222 ··· 306 302 int treble; /* treble boost/cut in decibels */ 307 303 int channel_config; /* Stereo, Mono, Custom, Mono left, Mono right, Karaoke */ 308 304 int stereo_width; /* 0-255% */ 309 - 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 305 321 306 #ifdef AUDIOHW_HAVE_BASS_CUTOFF 322 307 int bass_cutoff; ··· 325 310 int treble_cutoff; 326 311 #endif 327 312 328 - #if CONFIG_CODEC == SWCODEC 329 313 #ifdef HAVE_CROSSFADE 330 314 /* Crossfade */ 331 315 int crossfade; /* Enable crossfade (0=off, 1=shuffle, 2=trackskip, ··· 360 344 #ifdef HAVE_PITCHCONTROL 361 345 bool timestretch_enabled; 362 346 #endif 363 - #endif /* CONFIG_CODEC == SWCODEC */ 364 347 365 348 #ifdef HAVE_RECORDING 366 - #if CONFIG_CODEC == SWCODEC 367 349 int rec_format; /* record format index */ 368 350 int rec_mono_mode; /* how to create mono: L, R, L+R */ 369 351 ··· 377 359 #endif 378 360 /* Encoder Settings End */ 379 361 380 - #else 381 - int rec_quality; /* 0-7 */ 382 - #endif /* CONFIG_CODEC == SWCODEC */ 383 362 int rec_source; /* 0=mic, 1=line, 2=S/PDIF, 2 or 3=FM Radio */ 384 363 int rec_frequency; /* 0 = 44.1kHz (depends on target) 385 364 1 = 48kHz ··· 754 733 #ifdef HAVE_PITCHCONTROL 755 734 /* pitch screen settings */ 756 735 bool pitch_mode_semitone; 757 - #if CONFIG_CODEC == SWCODEC 758 736 bool pitch_mode_timestretch; 759 - #endif 760 737 #endif 761 738 /* If values are just added to the end, no need to bump plugin API 762 739 version. */ ··· 778 755 #endif 779 756 #endif 780 757 781 - #if CONFIG_CODEC == SWCODEC 782 758 struct compressor_settings compressor_settings; 783 - #endif 784 759 785 760 int sleeptimer_duration; /* In minutes; 0=off */ 786 761 bool sleeptimer_on_startup; ··· 797 772 int hotkey_tree; 798 773 #endif 799 774 800 - #if CONFIG_CODEC == SWCODEC 801 775 /* When resuming playback (after a stop), rewind this number of seconds */ 802 776 int resume_rewind; 803 - #endif 804 777 805 778 #ifdef AUDIOHW_HAVE_DEPTH_3D 806 779 int depth_3d; ··· 830 803 #endif /* AUDIOHW_HAVE_EQ */ 831 804 832 805 #ifdef HAVE_HARDWARE_CLICK 833 - #if CONFIG_CODEC == SWCODEC 834 806 bool keyclick_hardware; /* hardware piezo keyclick */ 835 - #endif 836 807 #endif 837 808 838 809 char start_directory[MAX_PATHNAME+1];
+1 -24
apps/settings_list.c
··· 310 310 311 311 #ifdef HAVE_RECORDING 312 312 /* these should be in the config.h files */ 313 - #if CONFIG_CODEC == SWCODEC 314 313 # ifdef HAVE_UDA1380 315 314 # define DEFAULT_REC_MIC_GAIN 16 316 315 # define DEFAULT_REC_LEFT_GAIN 0 ··· 332 331 # define DEFAULT_REC_LEFT_GAIN 0 333 332 # define DEFAULT_REC_RIGHT_GAIN 0 334 333 # endif 335 - #endif 336 334 337 335 #endif /* HAVE_RECORDING */ 338 336 ··· 472 470 } 473 471 #endif 474 472 475 - #if CONFIG_CODEC == SWCODEC 476 - 477 473 static const char* formatter_unit_0_is_off(char *buffer, size_t buffer_size, 478 474 int val, const char *unit) 479 475 { ··· 591 587 { 592 588 memcpy(setting, defaultval, sizeof(struct eq_band_setting)); 593 589 } 594 - #endif 595 590 596 591 #ifdef HAVE_QUICKSCREEN 597 592 static int find_setting_by_name(char*name) ··· 1213 1208 "seek acceleration", "very fast,fast,normal,slow,very slow", NULL, 5, 1214 1209 ID2P(LANG_VERY_FAST), ID2P(LANG_FAST), ID2P(LANG_NORMAL), 1215 1210 ID2P(LANG_SLOW) , ID2P(LANG_VERY_SLOW)), 1216 - #if (CONFIG_CODEC == SWCODEC) && defined(HAVE_DISK_STORAGE) 1211 + #if defined(HAVE_DISK_STORAGE) 1217 1212 TABLE_SETTING(F_TIME_SETTING | F_ALLOW_ARBITRARY_VALS, buffer_margin, 1218 1213 LANG_MP3BUFFER_MARGIN, 5, "antiskip", NULL, UNIT_SEC, 1219 1214 NULL, NULL, 1220 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 1216 #endif 1226 1217 /* disk */ 1227 1218 #ifdef HAVE_DISK_STORAGE ··· 1348 1339 TALK_ID(1792, UNIT_MB)), 1349 1340 {F_T_INT|F_RECSETTING, &global_settings.rec_channels, LANG_CHANNELS, INT(0), 1350 1341 "rec channels","stereo,mono",UNUSED}, 1351 - #if CONFIG_CODEC == SWCODEC 1352 1342 {F_T_INT|F_RECSETTING, &global_settings.rec_mono_mode, 1353 1343 LANG_RECORDING_MONO_MODE, INT(0), "rec mono mode","L+R,L,R",UNUSED}, 1354 - #endif 1355 1344 CHOICE_SETTING(F_RECSETTING, rec_split_type, LANG_SPLIT_TYPE, 0, 1356 1345 "rec split type", "Split,Stop,Shutdown", NULL, 3, 1357 1346 ID2P(LANG_START_NEW_FILE), ID2P(LANG_STOP_RECORDING),ID2P(LANG_STOP_RECORDING_AND_SHUTDOWN)), ··· 1398 1387 INT(DEFAULT_REC_RIGHT_GAIN), 1399 1388 "rec right gain",NULL,UNUSED}, 1400 1389 #endif /* DEFAULT_REC_RIGHT_GAIN */ 1401 - #if CONFIG_CODEC == SWCODEC 1402 1390 {F_T_INT|F_RECSETTING,&global_settings.rec_frequency, 1403 1391 LANG_FREQUENCY,INT(REC_FREQ_DEFAULT), 1404 1392 "rec frequency",REC_FREQ_CFG_VAL_LIST,UNUSED}, ··· 1417 1405 /* wavpack_enc */ 1418 1406 /* (no settings yet) */ 1419 1407 /** Encoder settings end **/ 1420 - #endif /* CONFIG_CODEC == SWCODEC */ 1421 1408 /* values for the trigger */ 1422 1409 INT_SETTING(F_RECSETTING, rec_start_thres_db, LANG_RECORD_START_THRESHOLD, -35, 1423 1410 "trigger start threshold dB", UNIT_DB, -89, 0, 1, NULL, NULL, NULL), ··· 1465 1452 LANG_SET_BOOL_YES, LANG_SET_BOOL_NO, NULL), 1466 1453 1467 1454 #ifdef HAVE_TAGCACHE 1468 - #if CONFIG_CODEC == SWCODEC 1469 1455 BOOL_SETTING(0, autoresume_enable, LANG_AUTORESUME, false, 1470 1456 "autoresume enable", off_on, 1471 1457 LANG_SET_BOOL_YES, LANG_SET_BOOL_NO, NULL), ··· 1478 1464 ID2P(LANG_AUTORESUME_CUSTOM)), 1479 1465 TEXT_SETTING(0, autoresume_paths, "autoresume next track paths", 1480 1466 "/podcast:/podcasts", NULL, NULL), 1481 - #endif 1482 1467 1483 1468 OFFON_SETTING(0, runtimedb, LANG_RUNTIMEDB_ACTIVE, false, 1484 1469 "gather runtime data", NULL), ··· 1486 1471 DEFAULT_TAGCACHE_SCAN_PATHS, NULL, NULL), 1487 1472 #endif 1488 1473 1489 - #if CONFIG_CODEC == SWCODEC 1490 1474 /* replay gain */ 1491 1475 CHOICE_SETTING(F_SOUNDSETTING, replaygain_settings.type, 1492 1476 LANG_REPLAYGAIN_MODE, REPLAYGAIN_SHUFFLE, "replaygain type", ··· 1747 1731 LANG_COMPRESSOR_RELEASE, 500, 1748 1732 "compressor release time", UNIT_MS, 100, 1000, 1749 1733 100, NULL, NULL, compressor_set), 1750 - #endif /* CONFIG_CODEC == SWCODEC */ 1751 1734 1752 1735 #ifdef AUDIOHW_HAVE_BASS_CUTOFF 1753 1736 SOUND_SETTING(F_NO_WRAP, bass_cutoff, LANG_BASS_CUTOFF, ··· 2023 2006 3, "list_accel_wait", UNIT_SEC, 1, 10, 1, 2024 2007 scanaccel_formatter, NULL, NULL), 2025 2008 #endif /* HAVE_WHEEL_ACCELERATION */ 2026 - #if CONFIG_CODEC == SWCODEC 2027 2009 /* keyclick */ 2028 2010 #ifdef HAVE_HARDWARE_CLICK 2029 2011 CHOICE_SETTING(0, keyclick, LANG_KEYCLICK_SOFTWARE, 0, ··· 2042 2024 OFFON_SETTING(0, keyclick_repeats, LANG_KEYCLICK_REPEATS, false, 2043 2025 "keyclick repeats", NULL), 2044 2026 #endif 2045 - #endif /* CONFIG_CODEC == SWCODEC */ 2046 2027 TEXT_SETTING(0, playlist_catalog_dir, "playlist catalog directory", 2047 2028 PLAYLIST_CATALOG_DEFAULT_DIR, NULL, NULL), 2048 2029 INT_SETTING(F_TIME_SETTING, sleeptimer_duration, LANG_SLEEP_TIMER_DURATION, ··· 2117 2098 #ifdef HAVE_PITCHCONTROL 2118 2099 OFFON_SETTING(0, pitch_mode_semitone, LANG_SEMITONE, false, 2119 2100 "Semitone pitch change", NULL), 2120 - #if CONFIG_CODEC == SWCODEC 2121 2101 OFFON_SETTING(0, pitch_mode_timestretch, LANG_TIMESTRETCH, false, 2122 2102 "Timestretch mode", NULL), 2123 2103 #endif 2124 - #endif 2125 2104 2126 2105 #ifdef USB_ENABLE_HID 2127 2106 OFFON_SETTING(0, usb_hid, LANG_USB_HID, true, "usb hid", usb_set_hid), ··· 2187 2166 HOTKEY_OPEN_WITH, HOTKEY_DELETE, HOTKEY_INSERT, HOTKEY_INSERT_SHUFFLED), 2188 2167 #endif 2189 2168 2190 - #if CONFIG_CODEC == SWCODEC 2191 2169 INT_SETTING(F_TIME_SETTING, resume_rewind, LANG_RESUME_REWIND, 0, 2192 2170 "resume rewind", UNIT_SEC, 0, 60, 5, 2193 2171 formatter_time_unit_0_is_off, getlang_time_unit_0_is_off, NULL), 2194 - #endif 2195 2172 CUSTOM_SETTING(0, root_menu_customized, 2196 2173 LANG_ROCKBOX_TITLE, /* lang string here is never actually used */ 2197 2174 NULL, "root menu order",
+1 -3
apps/tagcache.c
··· 1779 1779 if (id3->bitrate == 0) 1780 1780 id3->bitrate = 1; 1781 1781 1782 - #if CONFIG_CODEC == SWCODEC 1783 1782 if (global_settings.autoresume_enable) 1784 1783 { 1785 1784 id3->elapsed = get_tag_numeric(entry, tag_lastelapsed, idx_id); ··· 1790 1789 logf("tagcache_fill_tags: Set offset for %s to %lX\n", 1791 1790 id3->title, id3->offset); 1792 1791 } 1793 - #endif 1794 - 1792 + 1795 1793 return true; 1796 1794 } 1797 1795 #endif /* defined(HAVE_TC_RAMCACHE) && defined(HAVE_DIRCACHE) */
-10
apps/tagtree.c
··· 879 879 logf("-> %ld/%ld", id3->playcount, id3->playtime); 880 880 } 881 881 882 - #if CONFIG_CODEC == SWCODEC 883 882 if (autoresume) 884 883 { 885 884 /* Load current file resume info if not already defined (by ··· 900 899 str_or_empty(id3->title), id3->offset); 901 900 } 902 901 } 903 - #endif 904 902 905 903 /* Store our tagcache index pointer. */ 906 904 id3->tagcache_idx = tcs.idx_id+1; ··· 922 920 } 923 921 tagcache_idx--; 924 922 925 - #if CONFIG_CODEC == SWCODEC /* HWCODEC doesn't have automatic_skip */ 926 923 bool auto_skip = te->flags & TEF_AUTO_SKIP; 927 - #endif 928 924 bool runtimedb = global_settings.runtimedb; 929 925 bool autoresume = global_settings.autoresume_enable; 930 926 931 927 /* Don't process unplayed tracks, or tracks interrupted within the 932 928 first 15 seconds but always process autoresume point */ 933 929 if (runtimedb && (id3->elapsed == 0 934 - #if CONFIG_CODEC == SWCODEC 935 930 || (id3->elapsed < 15 * 1000 && !auto_skip) 936 - #endif 937 931 )) 938 932 { 939 933 logf("not db logging unplayed or skipped track"); 940 934 runtimedb = false; 941 935 } 942 936 943 - #if CONFIG_CODEC == SWCODEC 944 937 /* 3s because that is the threshold the WPS uses to rewind instead 945 938 of skip backwards */ 946 939 if (autoresume && (id3->elapsed == 0 ··· 949 942 logf("not logging autoresume"); 950 943 autoresume = false; 951 944 } 952 - #endif 953 945 954 946 /* Do not gather data unless proper setting has been enabled and at least 955 947 one is still slated to be recorded */ ··· 987 979 tagcache_update_numeric(tagcache_idx, tag_lastplayed, lastplayed); 988 980 } 989 981 990 - #if CONFIG_CODEC == SWCODEC 991 982 if (autoresume) 992 983 { 993 984 unsigned long elapsed = auto_skip ? 0 : id3->elapsed; ··· 998 989 logf("tagtree_track_finish_event: Save resume for %s: %lX %lX", 999 990 str_or_empty(id3->title), elapsed, offset); 1000 991 } 1001 - #endif 1002 992 } 1003 993 1004 994 int tagtree_export(void)
+6 -99
apps/talk.c
··· 32 32 #include "settings.h" 33 33 #include "settings_list.h" 34 34 #include "splash.h" 35 - #if CONFIG_CODEC == SWCODEC 36 35 #include "voice_thread.h" 37 - #else 38 - #include "mp3_playback.h" 39 - #endif 40 36 #include "audio.h" 41 37 #include "lang.h" 42 38 #include "talk.h" ··· 107 103 108 104 /***************** Globals *****************/ 109 105 110 - #if (CONFIG_CODEC == SWCODEC && MEMORYSIZE <= 2) 106 + #if MEMORYSIZE <= 2 111 107 /* On low memory swcodec targets the entire voice file wouldn't fit in memory 112 108 * together with codecs, so we load clips each time they are accessed. */ 113 109 #define TALK_PROGRESSIVE_LOAD ··· 131 127 static int queue_write; /* write index of queue, by application */ 132 128 static int queue_read; /* read index of queue, by ISR context */ 133 129 static enum talk_status talk_status = TALK_STATUS_OK; 134 - #if CONFIG_CODEC == SWCODEC 135 130 /* protects queue_read, queue_write and thumbnail_buf_used */ 136 131 static struct mutex queue_mutex SHAREDBSS_ATTR; 137 132 #define talk_queue_lock() ({ mutex_lock(&queue_mutex); }) 138 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 */ 143 134 static int sent; /* how many bytes handed over to playback, owned by ISR */ 144 135 static unsigned char curr_hd[3]; /* current frame header, for re-sync */ 145 136 static unsigned char last_lang[MAX_FILENAME+1]; /* name of last used lang file (in talk_init) */ ··· 186 177 187 178 static struct mutex read_buffer_mutex; 188 179 189 - 190 - /* on HWCODEC only voice xor audio can be active at a time */ 191 - static bool check_audio_status(void) 180 + static inline 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 182 return true; 200 183 } 201 184 ··· 670 653 return true; 671 654 } 672 655 673 - /* Use a static buffer to avoid difficulties with buflib during DMA 674 - * (hwcodec)/buffer passing to the voice_thread (swcodec). Clips 675 - * can be played in chunks so the size is not that important */ 656 + /* Use a static buffer to avoid difficulties with buflib during 657 + * buffer passing to the voice_thread (swcodec). Clips can be played 658 + in chunks so the size is not that important */ 676 659 static unsigned char commit_buffer[2<<10]; 677 660 678 661 static void* commit_transfer(struct queue_entry *qe, size_t *size) 679 662 { 680 663 void *buf = NULL; /* shut up gcc */ 681 664 static unsigned char *bufpos = commit_buffer; 682 - #if CONFIG_CODEC != SWCODEC 683 - sent = MIN(qe->remaining, 0xFFFF); 684 - #else 685 665 sent = qe->remaining; 686 - #endif 687 666 sent = MIN((size_t)sent, sizeof(commit_buffer)); 688 667 buf = buflib_get_data(&clip_ctx, qe->handle); 689 668 /* adjust buffer position to what has been played already */ ··· 706 685 static void mp3_callback(const void** start, size_t* size) 707 686 { 708 687 struct queue_entry *qe = &queue[queue_read]; 709 - #if CONFIG_CODEC == SWCODEC 710 688 /* voice_thread.c hints us how many of the buffer we provided it actually 711 689 * consumed. Because buffers have to be frame-aligned for speex 712 690 * it might be less than what we presented */ 713 691 if (*size) 714 692 sent = *size; 715 - #endif 716 693 qe->remaining -= sent; /* we completed this */ 717 694 718 695 if (qe->remaining > 0) /* current clip not finished? */ ··· 757 734 /* stop the playback and the pending clips */ 758 735 void talk_force_shutup(void) 759 736 { 760 - /* Most of this is MAS only */ 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) */ 737 + /* Had nothing to do (was frame boundary or not our clip) */ 809 738 mp3_play_stop(); 810 739 talk_queue_lock(); 811 740 queue_write = queue_read = 0; /* reset the queue */ ··· 885 814 886 815 if(!talk_initialized) 887 816 { 888 - #if CONFIG_CODEC == SWCODEC 889 817 mutex_init(&queue_mutex); 890 - #endif /* CONFIG_CODEC == SWCODEC */ 891 818 mutex_init(&read_buffer_mutex); 892 819 } 893 820 ··· 957 884 958 885 load_voicefile_data(filehandle); 959 886 960 - #if CONFIG_CODEC == SWCODEC 961 887 /* Initialize the actual voice clip playback engine as well */ 962 888 if (talk_voice_required()) 963 889 voice_thread_init(); 964 - #endif 965 890 966 891 out: 967 892 close(filehandle); /* close again, this was just to detect presence */ ··· 1062 987 int fd; 1063 988 int size; 1064 989 int handle, oldest = -1; 1065 - #if CONFIG_CODEC != SWCODEC 1066 - struct mp3entry info; 1067 - #endif 1068 990 1069 991 /* reload needed? */ 1070 992 if (talk_temp_disable_count > 0) ··· 1080 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 1005 if (!enqueue) 1091 1006 /* shutup now to free the thumbnail buffer */ 1092 1007 talk_shutup(); ··· 1098 1013 } 1099 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 1016 /* free clips from cache until this one succeeds to allocate */ 1106 1017 while ((handle = buflib_alloc(&clip_ctx, size)) < 0) 1107 1018 oldest = free_oldest_clip(); ··· 1116 1027 struct queue_entry clip; 1117 1028 clip.handle = handle; 1118 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 1030 if(prefix_ids) 1124 1031 /* prefix thumbnail by speaking these ids, but only now 1125 1032 that we know there's actually a thumbnail to be
-12
apps/tree.c
··· 650 650 if (tc.dirlevel < 0) 651 651 tc.dirlevel = 0; /* shouldnt be needed.. this code needs work! */ 652 652 653 - #if CONFIG_CODEC == SWCODEC 654 653 keyclick_set_callback(gui_synclist_keyclick_callback, &tree_lists); 655 - #endif 656 654 button = get_action(CONTEXT_TREE, 657 655 list_do_action_timeout(&tree_lists, HZ/2)); 658 656 #ifdef HAVE_LCD_BITMAP ··· 1175 1173 1176 1174 static 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 1176 return talk_file(tc.currdir, name, dir_thumbnail_name, NULL, 1184 1177 global_settings.talk_filetype ? 1185 1178 TALK_IDARRAY(VOICE_DIR) : NULL, ··· 1188 1181 1189 1182 static 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 1184 if (strlen(file) >= strlen(file_thumbnail_ext) 1197 1185 && strcasecmp(&file[strlen(file) - strlen(file_thumbnail_ext)], 1198 1186 file_thumbnail_ext))
+3 -5
docs/MAINTAINERS
··· 76 76 :DSP: Michael Sevakis,Thom Johansen 77 77 :LCD/Graphics API: Jens Arnold 78 78 :Buffering engine: Nicolas Pennequin 79 - :Playback engine (HWCODEC): 80 - :Playback engine (SWCODEC): Michael Sevakis, Nicolas Pennequin 81 - :PCM playback API (SWCODEC): Michael Sevakis 82 - :PCM recording API (SWCODEC): Michael Sevakis 83 - :Recording API (HWCODEC): 79 + :Playback engine: Michael Sevakis, Nicolas Pennequin 80 + :PCM playback API: Michael Sevakis 81 + :PCM recording API: Michael Sevakis 84 82 :Fonts and Unicode: 85 83 :Replaygain: Magnus Holmgren 86 84 :Profiling:
+10 -67
docs/PLUGIN_API
··· 111 111 112 112 void audio_set_input_source(int source, unsigned flags) 113 113 \group sound 114 - \conditions (CONFIG_CODEC == SWCODEC) && (INPUT_SRC_CAPS != 0) 114 + \conditions (INPUT_SRC_CAPS != 0) 115 115 \param source 116 116 \param flags 117 117 \description 118 118 119 119 void audio_set_output_source(int monitor) 120 120 \group sound 121 - \conditions (CONFIG_CODEC == SWCODEC) && (INPUT_SRC_CAPS != 0) 121 + \conditions (INPUT_SRC_CAPS != 0) 122 122 \param monitor 123 123 \description 124 124 125 125 void audio_set_recording_gain(int left, int right, int type) 126 126 \group sound 127 - \conditions (CONFIG_CODEC == SWCODEC) && (defined(HAVE_RECORDING)) 127 + \conditions (defined(HAVE_RECORDING)) 128 128 \param left 129 129 \param right 130 130 \param type ··· 191 191 \return 192 192 \description 193 193 194 - void 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 - 201 194 int bufadvance(int handle_id, off_t offset) 202 195 \group buffering API 203 - \conditions ((CONFIG_CODEC == SWCODEC)) 204 196 \param handle_id 205 197 \param offset 206 198 \return ··· 208 200 209 201 int bufalloc(const void *src, size_t size, enum data_type type) 210 202 \group buffering API 211 - \conditions ((CONFIG_CODEC == SWCODEC)) 212 203 \param src 213 204 \param size 214 205 \param type ··· 217 208 218 209 bool bufclose(int handle_id) 219 210 \group buffering API 220 - \conditions ((CONFIG_CODEC == SWCODEC)) 221 211 \param handle_id 222 212 \return 223 213 \description 224 214 225 215 ssize_t bufcuttail(int handle_id, size_t size) 226 216 \group buffering API 227 - \conditions ((CONFIG_CODEC == SWCODEC)) 228 217 \param handle_id 229 218 \param size 230 219 \return ··· 232 221 233 222 ssize_t bufgetdata(int handle_id, size_t size, void **data) 234 223 \group buffering API 235 - \conditions ((CONFIG_CODEC == SWCODEC)) 236 224 \param handle_id 237 225 \param size 238 226 \param data ··· 241 229 242 230 ssize_t bufgettail(int handle_id, size_t size, void **data) 243 231 \group buffering API 244 - \conditions ((CONFIG_CODEC == SWCODEC)) 245 232 \param handle_id 246 233 \param size 247 234 \param data ··· 250 237 251 238 int bufopen(const char *file, size_t offset, enum data_type type) 252 239 \group buffering API 253 - \conditions ((CONFIG_CODEC == SWCODEC)) 254 240 \param file 255 241 \param offset 256 242 \param type ··· 259 245 260 246 ssize_t bufread(int handle_id, size_t size, void *dest) 261 247 \group buffering API 262 - \conditions ((CONFIG_CODEC == SWCODEC)) 263 248 \param handle_id 264 249 \param size 265 250 \param dest ··· 268 253 269 254 int bufseek(int handle_id, size_t newpos) 270 255 \group buffering API 271 - \conditions ((CONFIG_CODEC == SWCODEC)) 272 256 \param handle_id 273 257 \param newpos 274 258 \return 275 259 \description 276 260 277 261 ssize_t buf_get_offset(int handle_id, void *ptr) 278 - \conditions ((CONFIG_CODEC == SWCODEC)) 279 262 \param handle_id 280 263 \param ptr 281 264 \return 282 265 \description 283 266 284 267 ssize_t buf_handle_offset(int handle_id) 285 - \conditions ((CONFIG_CODEC == SWCODEC)) 286 268 \param handle_id 287 269 \return 288 270 \description 289 271 290 272 void buf_request_buffer_handle(int handle_id) 291 - \conditions ((CONFIG_CODEC == SWCODEC)) 292 273 \param handle_id 293 274 \description 294 275 295 276 void buf_set_base_handle(int handle_id) 296 - \conditions ((CONFIG_CODEC == SWCODEC)) 297 277 \param handle_id 298 278 \description 299 279 300 280 size_t buf_used(void) 301 - \conditions ((CONFIG_CODEC == SWCODEC)) 302 281 \return 303 282 \description 304 283 ··· 410 389 411 390 int codec_load_file(const char* codec, struct codec_api *api) 412 391 \group misc 413 - \conditions (CONFIG_CODEC == SWCODEC) 414 392 \param codec 415 393 \param api 416 394 \return ··· 540 518 541 519 intptr_t dsp_configure(struct dsp_config *dsp, int setting, intptr_t value) 542 520 \group sound 543 - \conditions (CONFIG_CODEC == SWCODEC) 544 521 \param dsp 545 522 \param setting 546 523 \param value ··· 549 526 550 527 void dsp_dither_enable(bool enable) 551 528 \group sound 552 - \conditions (CONFIG_CODEC == SWCODEC) 553 529 \param enable 554 530 \description 555 531 556 532 int dsp_process(struct dsp_config *dsp, char *dest, const char *src[], int count) 557 533 \group sound 558 - \conditions (CONFIG_CODEC == SWCODEC) 559 534 \param dsp 560 535 \param dest 561 536 \param src[] ··· 565 540 566 541 void dsp_set_crossfeed(bool enable) 567 542 \group sound 568 - \conditions (CONFIG_CODEC == SWCODEC) 569 543 \param enable 570 544 \description 571 545 572 546 void dsp_set_eq(bool enable) 573 547 \group sound 574 - \conditions (CONFIG_CODEC == SWCODEC) 575 548 \param enable 576 549 \description 577 550 ··· 666 639 667 640 const char *get_codec_filename(int cod_spec) 668 641 \group misc 669 - \conditions (CONFIG_CODEC == SWCODEC) 670 642 \param cod_spec 671 643 \return 672 644 \description ··· 681 653 682 654 bool get_metadata(struct mp3entry* id3, int fd, const char* trackname) 683 655 \group misc 684 - \conditions (CONFIG_CODEC == SWCODEC) 685 656 \param id3 686 657 \param fd 687 658 \param trackname ··· 1342 1313 1343 1314 const unsigned long *audio_master_sampr_list 1344 1315 \group sound 1345 - \conditions (CONFIG_CODEC == SWCODEC) 1346 1316 \return 1347 1317 \description 1348 1318 1349 1319 const unsigned long *hw_freq_sampr 1350 1320 \group sound 1351 - \conditions (CONFIG_CODEC == SWCODEC) 1352 1321 \return 1353 1322 \description 1354 1323 1355 1324 const unsigned long *rec_freq_sampr 1356 1325 \group sound 1357 - \conditions (CONFIG_CODEC == SWCODEC) && (defined(HAVE_RECORDING)) 1326 + \conditions defined(HAVE_RECORDING) 1358 1327 \return 1359 1328 \description 1360 1329 ··· 1443 1412 \conditions (!defined(SIMULATOR)) 1444 1413 \description Stops playback 1445 1414 1446 - unsigned long mpeg_get_last_header(void) 1447 - \group playback control 1448 - \conditions (!defined(SIMULATOR) && (CONFIG_CODEC != SWCODEC)) 1449 - \return 1450 - \description 1451 - 1452 1415 void mutex_init(struct mutex *m) 1453 1416 \group kernel/ system 1454 - \conditions (CONFIG_CODEC == SWCODEC) 1455 1417 \param m 1456 1418 \description 1457 1419 1458 1420 void mutex_lock(struct mutex *m) 1459 1421 \group kernel/ system 1460 - \conditions (CONFIG_CODEC == SWCODEC) 1461 1422 \param m 1462 1423 \description 1463 1424 1464 1425 void mutex_unlock(struct mutex *m) 1465 1426 \group kernel/ system 1466 - \conditions (CONFIG_CODEC == SWCODEC) 1467 1427 \param m 1468 1428 \description 1469 1429 ··· 1484 1444 1485 1445 void pcm_apply_settings(void) 1486 1446 \group sound 1487 - \conditions (CONFIG_CODEC == SWCODEC) 1488 1447 \description 1489 1448 1490 1449 void pcm_calculate_peaks(int *left, int *right) 1491 1450 \group sound 1492 - \conditions (CONFIG_CODEC == SWCODEC) 1493 1451 \param left 1494 1452 \param right 1495 1453 \description 1496 1454 1497 1455 void pcm_calculate_rec_peaks(int *left, int *right) 1498 1456 \group sound 1499 - \conditions (CONFIG_CODEC == SWCODEC) && (defined(HAVE_RECORDING)) 1457 + \conditions defined(HAVE_RECORDING) 1500 1458 \param left 1501 1459 \param right 1502 1460 \description 1503 1461 1504 1462 void pcm_close_recording(void) 1505 1463 \group sound 1506 - \conditions (CONFIG_CODEC == SWCODEC) && (defined(HAVE_RECORDING)) 1464 + \conditions defined(HAVE_RECORDING) 1507 1465 \description 1508 1466 1509 1467 size_t pcm_get_bytes_waiting(void) 1510 1468 \group sound 1511 - \conditions (CONFIG_CODEC == SWCODEC) 1512 1469 \return 1513 1470 \description 1514 1471 1515 1472 void pcm_init_recording(void) 1516 1473 \group sound 1517 - \conditions (CONFIG_CODEC == SWCODEC) && (defined(HAVE_RECORDING)) 1474 + \conditions defined(HAVE_RECORDING) 1518 1475 \description 1519 1476 1520 1477 bool pcm_is_paused(void) 1521 1478 \group sound 1522 - \conditions (CONFIG_CODEC == SWCODEC) 1523 1479 \return true if playback is paused, else false 1524 1480 \description 1525 1481 1526 1482 bool pcm_is_playing(void) 1527 1483 \group sound 1528 - \conditions (CONFIG_CODEC == SWCODEC) 1529 1484 \return true unless playback is paused 1530 1485 \description 1531 1486 1532 1487 void pcm_play_data(pcm_more_callback_type get_more, unsigned char* start, size_t size) 1533 1488 \group sound 1534 - \conditions (CONFIG_CODEC == SWCODEC) 1535 1489 \param get_more Optional callback 1536 1490 \param start is the address of raw 16-16, interleaved PCM data 1537 1491 \param size is the size of the data to play ··· 1539 1493 1540 1494 void pcm_play_lock(void) 1541 1495 \group sound 1542 - \conditions (CONFIG_CODEC == SWCODEC) 1543 1496 \description 1544 1497 1545 1498 void pcm_play_pause(bool play) 1546 1499 \group sound 1547 - \conditions (CONFIG_CODEC == SWCODEC) 1548 1500 \param play 1549 1501 \description Pauses or unpauses the playback depending on the truth value of =play= 1550 1502 1551 1503 void pcm_play_stop(void) 1552 1504 \group sound 1553 - \conditions (CONFIG_CODEC == SWCODEC) 1554 1505 \description Stops the playback and empties the audio buffer unlike [F[pcm_play_pause]] 1555 1506 1556 1507 void pcm_play_unlock(void) 1557 1508 \group sound 1558 - \conditions (CONFIG_CODEC == SWCODEC) 1559 1509 \description 1560 1510 1561 1511 void pcm_record_data(pcm_more_callback_type2 more_ready, void *start, size_t size) 1562 1512 \group sound 1563 - \conditions (CONFIG_CODEC == SWCODEC) && (defined(HAVE_RECORDING)) 1513 + \conditions defined(HAVE_RECORDING) 1564 1514 \param more_ready 1565 1515 \param start 1566 1516 \param size ··· 1568 1518 1569 1519 void pcm_record_more(void *start, size_t size) 1570 1520 \group sound 1571 - \conditions (CONFIG_CODEC == SWCODEC) && (defined(HAVE_RECORDING)) 1521 + \conditions defined(HAVE_RECORDING) 1572 1522 \param start 1573 1523 \param size 1574 1524 \description 1575 1525 1576 1526 void pcm_set_frequency(unsigned int frequency) 1577 1527 \group sound 1578 - \conditions (CONFIG_CODEC == SWCODEC) 1579 1528 \param frequency 1580 1529 \description 1581 1530 1582 1531 void pcm_stop_recording(void) 1583 1532 \group sound 1584 - \conditions (CONFIG_CODEC == SWCODEC) && (defined(HAVE_RECORDING)) 1533 + \conditions defined(HAVE_RECORDING) 1585 1534 \description 1586 1535 1587 1536 int playlist_amount(void) ··· 1757 1706 \description 1758 1707 1759 1708 bool queue_empty(const struct event_queue *q) 1760 - \conditions (CONFIG_CODEC == SWCODEC) 1761 1709 \param q 1762 1710 \return 1763 1711 \description 1764 1712 1765 1713 void queue_enable_queue_send(struct event_queue *q, struct queue_sender_list *send, struct thread_entry *owner) 1766 - \conditions (CONFIG_CODEC == SWCODEC) 1767 1714 \param q 1768 1715 \param send 1769 1716 \param owner ··· 1781 1728 \description 1782 1729 1783 1730 void queue_reply(struct event_queue *q, intptr_t retval) 1784 - \conditions (CONFIG_CODEC == SWCODEC) 1785 1731 \param q 1786 1732 \param retval 1787 1733 \description 1788 1734 1789 1735 intptr_t queue_send(struct event_queue *q, long id, intptr_t data) 1790 - \conditions (CONFIG_CODEC == SWCODEC) 1791 1736 \param q 1792 1737 \param id 1793 1738 \param data ··· 1795 1740 \description 1796 1741 1797 1742 void queue_wait(struct event_queue *q, struct queue_event *ev) 1798 - \conditions (CONFIG_CODEC == SWCODEC) 1799 1743 \param q 1800 1744 \param ev 1801 1745 \description ··· 2066 2010 2067 2011 void sound_set_pitch(int pitch) 2068 2012 \group playback control 2069 - \conditions (CONFIG_CODEC == SWCODEC) 2070 2013 \param pitch 2071 2014 \description 2072 2015
+2 -5
firmware/SOURCES
··· 425 425 /* Sound */ 426 426 sound.c 427 427 428 - #if CONFIG_CODEC == SWCODEC 429 - 430 428 #ifndef BOOTLOADER 431 429 pcm_sampr.c 432 430 pcm.c ··· 440 438 441 439 drivers/audio/audiohw-swcodec.c 442 440 #endif /* BOOTLOADER */ 443 - #endif /* SWCODEC */ 444 441 445 442 /* Audio codec */ 446 443 #if (CONFIG_PLATFORM & PLATFORM_NATIVE) && !defined(BOOTLOADER) ··· 505 502 drivers/audio/xduoolinux_codec.c 506 503 #elif defined(HAVE_SDL_AUDIO) 507 504 drivers/audio/sdl.c 508 - #if CONFIG_CODEC == SWCODEC 505 + 509 506 #if (CONFIG_PLATFORM & PLATFORM_MAEMO5) 510 507 target/hosted/maemo/pcm-gstreamer.c 511 508 #else 512 509 target/hosted/sdl/pcm-sdl.c 513 510 #endif /* (CONFIG_PLATFORM & PLATFORM_MAEMO) */ 514 - #endif /* CONFIG_CODEC == SWCODEC */ 511 + 515 512 #endif 516 513 #endif /* (CONFIG_PLATFORM & PLATFORM_NATIVE) && !defined(BOOTLOADER) */ 517 514
+1 -9
firmware/drivers/audio/sdl.c
··· 48 48 #ifdef HAVE_SW_VOLUME_CONTROL 49 49 volume = sdl_volume_level(volume); 50 50 pcm_set_master_volume(volume, volume); 51 - #elif CONFIG_CODEC == SWCODEC 51 + #else 52 52 extern void pcm_set_mixer_volume(int volume); 53 53 pcm_set_mixer_volume(volume); 54 54 #endif ··· 87 87 void audiohw_set_treble(int value) { (void)value; } 88 88 #endif 89 89 #endif /* HAVE_SW_TONE_CONTROLS */ 90 - #if CONFIG_CODEC != SWCODEC 91 - void audiohw_set_channel(int value) { (void)value; } 92 - void audiohw_set_stereo_width(int value){ (void)value; } 93 - #ifdef HAVE_PITCHCONTROL 94 - void audiohw_set_pitch(int32_t value) { (void)value; } 95 - int32_t audiohw_get_pitch(void) { return PITCH_SPEED_100; } 96 - #endif 97 - #endif /* CONFIG_CODEC != SWCODEC */ 98 90 #if defined(AUDIOHW_HAVE_BASS_CUTOFF) 99 91 void audiohw_set_bass_cutoff(int value) { (void)value; } 100 92 #endif
+3 -96
firmware/export/audio.h
··· 18 18 * KIND, either express or implied. 19 19 * 20 20 ****************************************************************************/ 21 - #ifndef AUDIO_H 22 - #define AUDIO_H 21 + #ifndef __AUDIO_H 22 + #define __AUDIO_H 23 23 24 24 #include <stdbool.h> 25 25 #include <string.h> /* size_t */ ··· 27 27 /* These must always be included with audio.h for this to compile under 28 28 cetain conditions. Do it here or else spread the complication around to 29 29 many files. */ 30 - #if CONFIG_CODEC == SWCODEC 31 30 #include "pcm_sampr.h" 32 31 #include "pcm.h" 33 32 #ifdef HAVE_RECORDING 34 33 #include "enc_base.h" 35 34 #endif /* HAVE_RECORDING */ 36 - #endif /* CONFIG_CODEC == SWCODEC */ 37 35 38 36 #define AUDIO_STATUS_PLAY 0x0001 39 37 #define AUDIO_STATUS_PAUSE 0x0002 ··· 75 73 int audio_get_file_pos(void); 76 74 void audio_beep(int duration); 77 75 78 - #if CONFIG_CODEC == SWCODEC 79 76 void audio_next_dir(void); 80 77 void audio_prev_dir(void); 81 78 82 - #else /* hwcodec only */ 83 - struct 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 - 107 - void audio_get_debugdata(struct audio_debug *dbgdata); 108 - /* unsigned int audio_error(void); - unused function */ 109 - void audio_init_playback(void); 110 - 111 - #define audio_next_dir() ({ }) 112 - #define audio_prev_dir() ({ }) 113 - 114 - #endif 115 - 116 79 /* channel modes */ 117 80 enum rec_channel_modes 118 81 { ··· 124 87 CHN_NUM_MODES 125 88 }; 126 89 127 - #if CONFIG_CODEC == SWCODEC 128 90 /* channel mode capability bits */ 129 91 #define CHN_CAP_STEREO (1 << CHN_MODE_STEREO) 130 92 #define CHN_CAP_MONO (1 << CHN_MODE_MONO) 131 93 #define CHN_CAP_ALL (CHN_CAP_STEREO | CHN_CAP_MONO) 132 - #endif /* CONFIG_CODEC == SWCODEC */ 133 94 134 95 /* the enums below must match prestr[] in recording.c */ 135 96 enum audio_sources ··· 164 125 }; 165 126 #endif /* HAVE_RECORDING */ 166 127 167 - #if CONFIG_CODEC == SWCODEC 168 128 /* selects a source to monitor for recording or playback */ 169 129 #define SRCF_PLAYBACK 0x0000 /* default */ 170 130 #define SRCF_RECORDING 0x1000 ··· 173 133 #define SRCF_FMRADIO_PLAYING 0x0000 /* default */ 174 134 #define SRCF_FMRADIO_PAUSED 0x2000 175 135 #endif 176 - #endif 177 136 178 137 #ifdef HAVE_RECORDING 179 138 /* parameters for audio_set_recording_options */ ··· 183 142 int rec_frequency; 184 143 int rec_channels; 185 144 int rec_prerecord_time; 186 - #if CONFIG_CODEC == SWCODEC 187 145 int rec_mono_mode; 188 146 int rec_source_flags; /* for rec_set_source */ 189 147 struct encoder_config enc_config; 190 - #else 191 - int rec_quality; 192 - bool rec_editable; 193 - #endif 194 148 }; 195 149 196 150 /* audio recording functions */ ··· 206 160 unsigned long audio_recorded_time(void); 207 161 unsigned long audio_num_recorded_bytes(void); 208 162 209 - #if CONFIG_CODEC == SWCODEC 210 - /* SWCODEC recording functions */ 211 163 unsigned long audio_prerecorded_time(void); 212 - #endif /* CONFIG_CODEC == SWCODEC */ 213 164 214 165 #endif /* HAVE_RECORDING */ 215 166 216 - #if CONFIG_CODEC == SWCODEC 217 - /* SWCODEC misc. audio functions */ 218 167 #if INPUT_SRC_CAPS != 0 219 168 /* audio.c */ 220 169 void audio_set_input_source(int source, unsigned flags); ··· 223 172 void audio_input_mux(int source, unsigned flags); 224 173 void audio_set_output_source(int source); 225 174 #endif /* INPUT_SRC_CAPS */ 226 - #endif /* CONFIG_CODEC == SWCODEC */ 227 175 228 176 #ifdef HAVE_SPDIF_IN 229 177 /* returns index into rec_master_sampr_list */ ··· 247 195 { 248 196 TEF_NONE = 0x0, /* no flags are set */ 249 197 TEF_CURRENT = 0x1, /* event is for the current track */ 250 - #if CONFIG_CODEC == SWCODEC 251 198 TEF_AUTO_SKIP = 0x2, /* event is sent in context of auto skip */ 252 199 TEF_REWIND = 0x4, /* interpret as rewind, id3->elapsed is the 253 200 position before the seek back to 0 */ 254 - #endif /* CONFIG_CODEC == SWCODEC */ 255 201 }; 256 202 257 203 struct track_event ··· 260 206 struct mp3entry *id3; /* pointer to mp3entry describing track */ 261 207 }; 262 208 263 - #if CONFIG_CODEC != SWCODEC 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 - 269 - typedef int (*AUDIO_EVENT_HANDLER)(unsigned short event, unsigned long data); 270 - 271 - void 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 209 + #endif /* __AUDIO_H */
+2 -11
firmware/export/config.h
··· 53 53 #define RDA5802 0x80 /* RDA Microelectronics */ 54 54 #define STFM1000 0x100 /* Sigmatel */ 55 55 56 - /* CONFIG_CODEC */ 57 - #define SWCODEC 1 /* if codec is done by SW */ 58 - 59 56 /* CONFIG_CPU */ 60 57 #define MCF5249 5249 61 58 #define MCF5250 5250 ··· 903 900 #define HAVE_PICTUREFLOW_INTEGRATION 904 901 #endif 905 902 906 - #if (CONFIG_CODEC == SWCODEC) 907 903 #ifdef BOOTLOADER 908 904 909 905 #ifdef HAVE_BOOTLOADER_USB_MODE ··· 974 970 #if MEMORYSIZE > 2 975 971 #define HAVE_CROSSFADE 976 972 #endif 977 - 978 - #endif /* (CONFIG_CODEC == SWCODEC) */ 979 973 980 974 /* Determine if accesses should be strictly long aligned. */ 981 975 #if defined(CPU_ARM) || defined(CPU_MIPS) ··· 1248 1242 #define HAVE_PCM_FULL_DUPLEX 1249 1243 #endif 1250 1244 1251 - #if (CONFIG_CODEC == SWCODEC) 1252 1245 #define HAVE_PITCHCONTROL 1253 - #endif 1254 1246 1255 1247 /* enable logging messages to disk*/ 1256 - #if !defined(BOOTLOADER) && !defined(__PCTOOL__) && (CONFIG_CODEC == SWCODEC) 1248 + #if !defined(BOOTLOADER) && !defined(__PCTOOL__) 1257 1249 #define ROCKBOX_HAS_LOGDISKF 1258 1250 #endif 1259 1251 1260 1252 #if defined(HAVE_SDL_AUDIO) \ 1261 1253 && !(CONFIG_PLATFORM & PLATFORM_MAEMO5) \ 1262 - && !defined(HAVE_SW_VOLUME_CONTROL) \ 1263 - && CONFIG_CODEC == SWCODEC 1254 + && !defined(HAVE_SW_VOLUME_CONTROL) 1264 1255 /* SW volume is needed for accurate control and no double buffering should be 1265 1256 * required. If target uses SW volume, then its definitions are used instead 1266 1257 * so things are as on target. */
+2 -2
firmware/export/config/agptekrocker.h
··· 75 75 /* The number of bytes reserved for loadable plugins */ 76 76 #define PLUGIN_BUFFER_SIZE 0x100000 77 77 78 - /* Define this if you do software codec */ 79 - #define CONFIG_CODEC SWCODEC 78 + 79 + 80 80 #define HAVE_ROCKER_CODEC 81 81 82 82 #define HAVE_HEADPHONE_DETECTION
+2 -2
firmware/export/config/android.h
··· 67 67 68 68 #define AB_REPEAT_ENABLE 69 69 70 - /* Define this if you do software codec */ 71 - #define CONFIG_CODEC SWCODEC 70 + 71 + 72 72 73 73 #define HAVE_MULTIMEDIA_KEYS 74 74 #define CONFIG_KEYPAD ANDROID_PAD
+2 -2
firmware/export/config/cowond2.h
··· 107 107 108 108 #define AB_REPEAT_ENABLE 109 109 110 - /* Define this if you do software codec */ 111 - #define CONFIG_CODEC SWCODEC 110 + 111 + 112 112 113 113 /* The D2 uses a WM8985 codec */ 114 114 #define HAVE_WM8985
+2 -2
firmware/export/config/creativezen.h
··· 89 89 /* Define this to enable morse code input */ 90 90 #define HAVE_MORSE_INPUT 91 91 92 - /* Define this if you do software codec */ 93 - #define CONFIG_CODEC SWCODEC 92 + 93 + 94 94 95 95 /* LCD dimensions */ 96 96 #define LCD_WIDTH 320
+2 -2
firmware/export/config/creativezenmozaic.h
··· 90 90 /* Define this to enable morse code input */ 91 91 #define HAVE_MORSE_INPUT 92 92 93 - /* Define this if you do software codec */ 94 - #define CONFIG_CODEC SWCODEC 93 + 94 + 95 95 96 96 /* LCD dimensions */ 97 97 #define LCD_WIDTH 128
+2 -2
firmware/export/config/creativezenv.h
··· 87 87 /* Define this to enable morse code input */ 88 88 #define HAVE_MORSE_INPUT 89 89 90 - /* Define this if you do software codec */ 91 - #define CONFIG_CODEC SWCODEC 90 + 91 + 92 92 93 93 /* LCD dimensions */ 94 94 #define LCD_WIDTH 132
+2 -2
firmware/export/config/creativezenxfi.h
··· 94 94 /* Define this to enable morse code input */ 95 95 #define HAVE_MORSE_INPUT 96 96 97 - /* Define this if you do software codec */ 98 - #define CONFIG_CODEC SWCODEC 97 + 98 + 99 99 100 100 /* LCD dimensions */ 101 101 #define LCD_WIDTH 320
+2 -2
firmware/export/config/creativezenxfi2.h
··· 97 97 /* Define this to enable morse code input */ 98 98 #define HAVE_MORSE_INPUT 99 99 100 - /* Define this if you do software codec */ 101 - #define CONFIG_CODEC SWCODEC 100 + 101 + 102 102 103 103 /* LCD dimensions */ 104 104 #define LCD_WIDTH 240
+2 -2
firmware/export/config/creativezenxfi3.h
··· 97 97 /* Define this to enable morse code input */ 98 98 #define HAVE_MORSE_INPUT 99 99 100 - /* Define this if you do software codec */ 101 - #define CONFIG_CODEC SWCODEC 100 + 101 + 102 102 103 103 /* Define this if you have a speaker */ 104 104 #define HAVE_SPEAKER
+2 -2
firmware/export/config/creativezenxfistyle.h
··· 94 94 /* Define this to enable morse code input */ 95 95 #define HAVE_MORSE_INPUT 96 96 97 - /* Define this if you do software codec */ 98 - #define CONFIG_CODEC SWCODEC 97 + 98 + 99 99 100 100 /* LCD dimensions */ 101 101 #define LCD_WIDTH 320
+2 -2
firmware/export/config/creativezv.h
··· 80 80 /* Define this to enable morse code input */ 81 81 #define HAVE_MORSE_INPUT 82 82 83 - /* Define this if you do software codec */ 84 - #define CONFIG_CODEC SWCODEC 83 + 84 + 85 85 86 86 /* define this if you have a real-time clock */ 87 87 //#define CONFIG_RTC RTC_RX5X348AB
+2 -2
firmware/export/config/gigabeatfx.h
··· 69 69 /* Define this to enable morse code input */ 70 70 #define HAVE_MORSE_INPUT 71 71 72 - /* Define this if you do software codec */ 73 - #define CONFIG_CODEC SWCODEC 72 + 73 + 74 74 75 75 /* define this if you have a real-time clock */ 76 76 #define CONFIG_RTC RTC_S3C2440
+2 -2
firmware/export/config/gigabeats.h
··· 59 59 /* Define this to enable morse code input */ 60 60 #define HAVE_MORSE_INPUT 61 61 62 - /* Define this if you do software codec */ 63 - #define CONFIG_CODEC SWCODEC 62 + 63 + 64 64 65 65 /* define this if you have a real-time clock */ 66 66 #define CONFIG_RTC RTC_MC13783
+2 -2
firmware/export/config/gogearhdd1630.h
··· 85 85 /* define this if the target has volume keys which can be used in the lists */ 86 86 #define HAVE_VOLUME_IN_LIST 87 87 88 - /* Define this if you do software codec */ 89 - #define CONFIG_CODEC SWCODEC 88 + 89 + 90 90 91 91 /* define this if you have a real-time clock. The HDD16x0 has a PCF8563 RTC, 92 92 but it's register compatible with the E8564. */
+2 -2
firmware/export/config/gogearhdd6330.h
··· 85 85 /* define this if the target has volume keys which can be used in the lists */ 86 86 #define HAVE_VOLUME_IN_LIST 87 87 88 - /* Define this if you do software codec */ 89 - #define CONFIG_CODEC SWCODEC 88 + 89 + 90 90 91 91 /* define this if you have a real-time clock. The HDD16x0 has a PCF8563 RTC, 92 92 but it's register compatible with the E8564. */
+2 -2
firmware/export/config/gogearsa9200.h
··· 68 68 /* define this if the target has volume keys which can be used in the lists */ 69 69 #define HAVE_VOLUME_IN_LIST 70 70 71 - /* Define this if you do software codec */ 72 - #define CONFIG_CODEC SWCODEC 71 + 72 + 73 73 74 74 /* There is no hardware tone control */ 75 75 #define HAVE_SW_TONE_CONTROLS
+2 -2
firmware/export/config/hifietma8.h
··· 75 75 /* Define this to enable morse code input */ 76 76 #define HAVE_MORSE_INPUT 77 77 78 - /* Define this if you do software codec */ 79 - #define CONFIG_CODEC SWCODEC 78 + 79 + 80 80 81 81 #define CONFIG_LCD LCD_ILI9342 82 82
+2 -2
firmware/export/config/hifietma8c.h
··· 75 75 /* Define this to enable morse code input */ 76 76 #define HAVE_MORSE_INPUT 77 77 78 - /* Define this if you do software codec */ 79 - #define CONFIG_CODEC SWCODEC 78 + 79 + 80 80 81 81 #define CONFIG_LCD LCD_ILI9342C 82 82
+2 -2
firmware/export/config/hifietma9.h
··· 75 75 /* Define this to enable morse code input */ 76 76 #define HAVE_MORSE_INPUT 77 77 78 - /* Define this if you do software codec */ 79 - #define CONFIG_CODEC SWCODEC 78 + 79 + 80 80 81 81 #define CONFIG_LCD LCD_ILI9342 82 82
+2 -2
firmware/export/config/hifietma9c.h
··· 75 75 /* Define this to enable morse code input */ 76 76 #define HAVE_MORSE_INPUT 77 77 78 - /* Define this if you do software codec */ 79 - #define CONFIG_CODEC SWCODEC 78 + 79 + 80 80 81 81 #define CONFIG_LCD LCD_ILI9342C 82 82
+2 -2
firmware/export/config/hifimanhm60x.h
··· 90 90 /* Define this to enable morse code input */ 91 91 #define HAVE_MORSE_INPUT 92 92 93 - /* Define this if you do software codec */ 94 - #define CONFIG_CODEC SWCODEC 93 + 94 + 95 95 96 96 /* define this if you have a real-time clock */ 97 97 /* #define CONFIG_RTC RTC_NANO2G */
+2 -2
firmware/export/config/hifimanhm801.h
··· 87 87 /* Define this to enable morse code input */ 88 88 #define HAVE_MORSE_INPUT 89 89 90 - /* Define this if you do software codec */ 91 - #define CONFIG_CODEC SWCODEC 90 + 91 + 92 92 93 93 #define CONFIG_LCD LCD_HX8340B 94 94
+2 -2
firmware/export/config/iaudio7.h
··· 107 107 108 108 #define AB_REPEAT_ENABLE 109 109 110 - /* Define this if you do software codec */ 111 - #define CONFIG_CODEC SWCODEC 110 + 111 + 112 112 113 113 /* The iaudio7 uses built-in WM8731 codec */ 114 114 #define HAVE_WM8731
+2 -2
firmware/export/config/iaudiom3.h
··· 73 73 #define AB_REPEAT_ENABLE 74 74 #define ACTION_WPSAB_SINGLE ACTION_WPS_BROWSE 75 75 76 - /* Define this if you do software codec */ 77 - #define CONFIG_CODEC SWCODEC 76 + 77 + 78 78 79 79 /* define this if you have a real-time clock */ 80 80 /* #define CONFIG_RTC FIXME: most probably none */
+2 -2
firmware/export/config/iaudiom5.h
··· 92 92 #define AB_REPEAT_ENABLE 93 93 #define ACTION_WPSAB_SINGLE ACTION_WPS_BROWSE 94 94 95 - /* Define this if you do software codec */ 96 - #define CONFIG_CODEC SWCODEC 95 + 96 + 97 97 98 98 /* define this if you have a real-time clock */ 99 99 #define CONFIG_RTC RTC_PCF50606
+2 -2
firmware/export/config/iaudiox5.h
··· 94 94 #define AB_REPEAT_ENABLE 95 95 #define ACTION_WPSAB_SINGLE ACTION_WPS_BROWSE 96 96 97 - /* Define this if you do software codec */ 98 - #define CONFIG_CODEC SWCODEC 97 + 98 + 99 99 100 100 /* define this if you have a real-time clock */ 101 101 #define CONFIG_RTC RTC_PCF50606
+2 -2
firmware/export/config/ibassodx50.h
··· 95 95 /* Which backlight fading type? */ 96 96 #define CONFIG_BACKLIGHT_FADING BACKLIGHT_FADING_SW_SETTING 97 97 98 - /* Define this if you do software codec */ 99 - #define CONFIG_CODEC SWCODEC 98 + 99 + 100 100 #define HAVE_SW_TONE_CONTROLS 101 101 #define HAVE_SW_VOLUME_CONTROL 102 102 #define HW_SAMPR_CAPS SAMPR_CAP_ALL
+2 -2
firmware/export/config/ibassodx90.h
··· 94 94 /* Which backlight fading type? */ 95 95 #define CONFIG_BACKLIGHT_FADING BACKLIGHT_FADING_SW_SETTING 96 96 97 - /* Define this if you do software codec */ 98 - #define CONFIG_CODEC SWCODEC 97 + 98 + 99 99 #define HAVE_SW_TONE_CONTROLS 100 100 #define HAVE_SW_VOLUME_CONTROL 101 101 #define HW_SAMPR_CAPS SAMPR_CAP_ALL
+2 -2
firmware/export/config/ihifi760.h
··· 90 90 /* Define this to enable morse code input */ 91 91 #define HAVE_MORSE_INPUT 92 92 93 - /* Define this if you do software codec */ 94 - #define CONFIG_CODEC SWCODEC 93 + 94 + 95 95 96 96 /* define this if you have a real-time clock */ 97 97 /* #define CONFIG_RTC RTC_NANO2G */
+2 -2
firmware/export/config/ihifi770.h
··· 91 91 /* Define this if a programmable hotkey is mapped */ 92 92 /* #define HAVE_HOTKEY */ 93 93 94 - /* Define this if you do software codec */ 95 - #define CONFIG_CODEC SWCODEC 94 + 95 + 96 96 97 97 /* define this if you have a real-time clock */ 98 98 /* #define CONFIG_RTC RTC_NANO2G */
+2 -2
firmware/export/config/ihifi770c.h
··· 91 91 /* Define this if a programmable hotkey is mapped */ 92 92 /* #define HAVE_HOTKEY */ 93 93 94 - /* Define this if you do software codec */ 95 - #define CONFIG_CODEC SWCODEC 94 + 95 + 96 96 97 97 /* define this if you have a real-time clock */ 98 98 /* #define CONFIG_RTC RTC_NANO2G */
+2 -2
firmware/export/config/ihifi800.h
··· 91 91 /* Define this if a programmable hotkey is mapped */ 92 92 /* #define HAVE_HOTKEY */ 93 93 94 - /* Define this if you do software codec */ 95 - #define CONFIG_CODEC SWCODEC 94 + 95 + 96 96 97 97 /* define this if you have a real-time clock */ 98 98 /* #define CONFIG_RTC RTC_NANO2G */
+2 -2
firmware/export/config/ihifi960.h
··· 90 90 /* Define this to enable morse code input */ 91 91 #define HAVE_MORSE_INPUT 92 92 93 - /* Define this if you do software codec */ 94 - #define CONFIG_CODEC SWCODEC 93 + 94 + 95 95 96 96 /* define this if you have a real-time clock */ 97 97 /* #define CONFIG_RTC RTC_NANO2G */
+2 -2
firmware/export/config/ipod1g2g.h
··· 92 92 /* Define this to enable morse code input */ 93 93 #define HAVE_MORSE_INPUT 94 94 95 - /* Define this if you do software codec */ 96 - #define CONFIG_CODEC SWCODEC 95 + 96 + 97 97 98 98 /* Define this if you have a software controlled poweroff */ 99 99 #define HAVE_SW_POWEROFF
+2 -2
firmware/export/config/ipod3g.h
··· 92 92 /* Define this to enable morse code input */ 93 93 #define HAVE_MORSE_INPUT 94 94 95 - /* Define this if you do software codec */ 96 - #define CONFIG_CODEC SWCODEC 95 + 96 + 97 97 98 98 /* define this if you have a real-time clock */ 99 99 #define CONFIG_RTC RTC_PCF50605
+2 -2
firmware/export/config/ipod4g.h
··· 84 84 /* Define this to enable morse code input */ 85 85 #define HAVE_MORSE_INPUT 86 86 87 - /* Define this if you do software codec */ 88 - #define CONFIG_CODEC SWCODEC 87 + 88 + 89 89 90 90 /* define this if you have a real-time clock */ 91 91 #define CONFIG_RTC RTC_PCF50605
+2 -2
firmware/export/config/ipod6g.h
··· 110 110 /* Define this to enable morse code input */ 111 111 #define HAVE_MORSE_INPUT 112 112 113 - /* Define this if you do software codec */ 114 - #define CONFIG_CODEC SWCODEC 113 + 114 + 115 115 116 116 /* define this if you have a real-time clock */ 117 117 #define CONFIG_RTC RTC_NANO2G
+2 -2
firmware/export/config/ipodcolor.h
··· 71 71 /* Define this to enable morse code input */ 72 72 #define HAVE_MORSE_INPUT 73 73 74 - /* Define this if you do software codec */ 75 - #define CONFIG_CODEC SWCODEC 74 + 75 + 76 76 77 77 /* define this if you have a real-time clock */ 78 78 #define CONFIG_RTC RTC_PCF50605
+2 -2
firmware/export/config/ipodmini1g.h
··· 93 93 /* Define this to enable morse code input */ 94 94 #define HAVE_MORSE_INPUT 95 95 96 - /* Define this if you do software codec */ 97 - #define CONFIG_CODEC SWCODEC 96 + 97 + 98 98 99 99 /* define this if you have a real-time clock */ 100 100 #define CONFIG_RTC RTC_PCF50605
+2 -2
firmware/export/config/ipodmini2g.h
··· 85 85 /* Define this to enable morse code input */ 86 86 #define HAVE_MORSE_INPUT 87 87 88 - /* Define this if you do software codec */ 89 - #define CONFIG_CODEC SWCODEC 88 + 89 + 90 90 91 91 /* define this if you have a real-time clock */ 92 92 #define CONFIG_RTC RTC_PCF50605
+2 -2
firmware/export/config/ipodnano1g.h
··· 74 74 /* Define this to enable morse code input */ 75 75 #define HAVE_MORSE_INPUT 76 76 77 - /* Define this if you do software codec */ 78 - #define CONFIG_CODEC SWCODEC 77 + 78 + 79 79 80 80 /* define this if you have a real-time clock */ 81 81 #define CONFIG_RTC RTC_PCF50605
+2 -2
firmware/export/config/ipodnano2g.h
··· 111 111 /* Define this to enable morse code input */ 112 112 #define HAVE_MORSE_INPUT 113 113 114 - /* Define this if you do software codec */ 115 - #define CONFIG_CODEC SWCODEC 114 + 115 + 116 116 117 117 /* define this if you have a real-time clock */ 118 118 #define CONFIG_RTC RTC_NANO2G
+2 -2
firmware/export/config/ipodvideo.h
··· 70 70 /* Define this to enable morse code input */ 71 71 #define HAVE_MORSE_INPUT 72 72 73 - /* Define this if you do software codec */ 74 - #define CONFIG_CODEC SWCODEC 73 + 74 + 75 75 76 76 /* define this if you have a real-time clock */ 77 77 #define CONFIG_RTC RTC_PCF50605
+2 -2
firmware/export/config/iriverh10.h
··· 79 79 /* Define this to enable morse code input */ 80 80 #define HAVE_MORSE_INPUT 81 81 82 - /* Define this if you do software codec */ 83 - #define CONFIG_CODEC SWCODEC 82 + 83 + 84 84 85 85 /* define this if you have a real-time clock */ 86 86 #ifndef BOOTLOADER
+2 -2
firmware/export/config/iriverh100.h
··· 73 73 /* Define this to enable morse code input */ 74 74 #define HAVE_MORSE_INPUT 75 75 76 - /* Define this if you do software codec */ 77 - #define CONFIG_CODEC SWCODEC 76 + 77 + 78 78 79 79 /* Define this if you have an remote lcd */ 80 80 #define HAVE_REMOTE_LCD
+2 -2
firmware/export/config/iriverh10_5gb.h
··· 62 62 /* Define this to enable morse code input */ 63 63 #define HAVE_MORSE_INPUT 64 64 65 - /* Define this if you do software codec */ 66 - #define CONFIG_CODEC SWCODEC 65 + 66 + 67 67 68 68 /* define this if you have a real-time clock */ 69 69 #ifndef BOOTLOADER
+2 -2
firmware/export/config/iriverh120.h
··· 73 73 /* Define this to enable morse code input */ 74 74 #define HAVE_MORSE_INPUT 75 75 76 - /* Define this if you do software codec */ 77 - #define CONFIG_CODEC SWCODEC 76 + 77 + 78 78 79 79 /* define this if you have a disk storage, i.e. something 80 80 that needs spinups and can cause skips when shaked */
+2 -2
firmware/export/config/iriverh300.h
··· 66 66 /* Define this to enable morse code input */ 67 67 #define HAVE_MORSE_INPUT 68 68 69 - /* Define this if you do software codec */ 70 - #define CONFIG_CODEC SWCODEC 69 + 70 + 71 71 72 72 /* define this if you have a real-time clock */ 73 73 #define CONFIG_RTC RTC_PCF50606
+2 -2
firmware/export/config/iriverifp7xx.h
··· 41 41 42 42 #define HAVE_FAT16SUPPORT 43 43 44 - /* Define this if you do software codec */ 45 - #define CONFIG_CODEC SWCODEC 44 + 45 + 46 46 47 47 /* Define this if you have a software controlled poweroff */ 48 48 #define HAVE_SW_POWEROFF
+2 -2
firmware/export/config/logikdax.h
··· 80 80 81 81 #define AB_REPEAT_ENABLE 82 82 83 - /* Define this if you do software codec */ 84 - #define CONFIG_CODEC SWCODEC 83 + 84 + 85 85 86 86 /* The DAX uses built-in WM8731 codec */ 87 87 #define HAVE_WM8731
+2 -2
firmware/export/config/lyreproto1.h
··· 61 61 62 62 #define CONFIG_KEYPAD LYRE_PROTO1_PAD 63 63 64 - /* Define this if you do software codec */ 65 - #define CONFIG_CODEC SWCODEC 64 + 65 + 66 66 67 67 /* The number of bytes reserved for loadable codecs */ 68 68 #define CODEC_SIZE 0x100000
+2 -2
firmware/export/config/meizum3.h
··· 77 77 //#define AB_REPEAT_ENABLE 78 78 //#define ACTION_WPSAB_SINGLE ACTION_WPS_BROWSE 79 79 80 - /* Define this if you do software codec */ 81 - #define CONFIG_CODEC SWCODEC 80 + 81 + 82 82 83 83 /* define this if you have a real-time clock */ 84 84 //#define CONFIG_RTC RTC_S5L8700
+2 -2
firmware/export/config/meizum6sl.h
··· 77 77 //#define AB_REPEAT_ENABLE 78 78 //#define ACTION_WPSAB_SINGLE ACTION_WPS_BROWSE 79 79 80 - /* Define this if you do software codec */ 81 - #define CONFIG_CODEC SWCODEC 80 + 81 + 82 82 83 83 /* define this if you have a real-time clock */ 84 84 #define CONFIG_RTC RTC_S5L8700
+2 -2
firmware/export/config/meizum6sp.h
··· 83 83 //#define AB_REPEAT_ENABLE 84 84 //#define ACTION_WPSAB_SINGLE ACTION_WPS_BROWSE 85 85 86 - /* Define this if you do software codec */ 87 - #define CONFIG_CODEC SWCODEC 86 + 87 + 88 88 89 89 /* define this if you have a real-time clock */ 90 90 #define CONFIG_RTC RTC_S5L8700
+2 -2
firmware/export/config/mini2440.h
··· 114 114 /* define this if you have a real-time clock */ 115 115 #define CONFIG_RTC RTC_S3C2440 116 116 117 - /* Define this if you do software codec */ 118 - #define CONFIG_CODEC SWCODEC 117 + 118 + 119 119 120 120 /* The number of bytes reserved for loadable codecs */ 121 121 #define CODEC_SIZE 0x100000
+2 -2
firmware/export/config/mpiohd200.h
··· 67 67 68 68 #define CONFIG_KEYPAD MPIO_HD200_PAD 69 69 70 - /* Define this if you do software codec */ 71 - #define CONFIG_CODEC SWCODEC 70 + 71 + 72 72 73 73 #define CONFIG_LCD LCD_TL0350A 74 74 #define HAVE_LCD_SHUTDOWN
+2 -2
firmware/export/config/mpiohd300.h
··· 67 67 68 68 #define CONFIG_KEYPAD MPIO_HD300_PAD 69 69 70 - /* Define this if you do software codec */ 71 - #define CONFIG_CODEC SWCODEC 70 + 71 + 72 72 73 73 /* Define this if you have RTC */ 74 74 #define CONFIG_RTC RTC_S35380A
+2 -2
firmware/export/config/mrobe100.h
··· 67 67 /* Define this to enable morse code input */ 68 68 #define HAVE_MORSE_INPUT 69 69 70 - /* Define this if you do software codec */ 71 - #define CONFIG_CODEC SWCODEC 70 + 71 + 72 72 73 73 /* define this if you have a real-time clock */ 74 74 #ifndef BOOTLOADER
+2 -2
firmware/export/config/mrobe500.h
··· 143 143 /* define this if the target has volume keys which can be used in the lists */ 144 144 #define HAVE_VOLUME_IN_LIST 145 145 146 - /* Define this if you do software codec */ 147 - #define CONFIG_CODEC SWCODEC 146 + 147 + 148 148 149 149 //#define HAVE_HARDWARE_BEEP 150 150
+2 -2
firmware/export/config/nokian8xx.h
··· 57 57 58 58 #define AB_REPEAT_ENABLE 59 59 60 - /* Define this if you do software codec */ 61 - #define CONFIG_CODEC SWCODEC 60 + 61 + 62 62 63 63 /* Work around debug macro expansion of strncmp in scratchbox */ 64 64 #define _HAVE_STRING_ARCH_strncmp
+2 -2
firmware/export/config/nokian900.h
··· 57 57 58 58 #define AB_REPEAT_ENABLE 59 59 60 - /* Define this if you do software codec */ 61 - #define CONFIG_CODEC SWCODEC 60 + 61 + 62 62 63 63 /* Work around debug macro expansion of strncmp in scratchbox */ 64 64 #define _HAVE_STRING_ARCH_strncmp
+2 -2
firmware/export/config/ondavx747.h
··· 87 87 #define HAVE_TOUCHSCREEN 88 88 #define HAVE_BUTTON_DATA 89 89 90 - /* Define this if you do software codec */ 91 - #define CONFIG_CODEC SWCODEC 90 + 91 + 92 92 93 93 /* define this if you have a real-time clock */ 94 94 #define CONFIG_RTC RTC_JZ4740
+2 -2
firmware/export/config/ondavx767.h
··· 76 76 77 77 #define CONFIG_KEYPAD ONDAVX767_PAD 78 78 79 - /* Define this if you do software codec */ 80 - #define CONFIG_CODEC SWCODEC 79 + 80 + 81 81 82 82 /* define this if you have a real-time clock */ 83 83 #define CONFIG_RTC RTC_JZ4740
+2 -2
firmware/export/config/ondavx777.h
··· 81 81 #define HAVE_TOUCHSCREEN 82 82 #define HAVE_BUTTON_DATA 83 83 84 - /* Define this if you do software codec */ 85 - #define CONFIG_CODEC SWCODEC 84 + 85 + 86 86 87 87 /* define this if you have a real-time clock */ 88 88 #define CONFIG_RTC RTC_JZ4740
+2 -2
firmware/export/config/pandora.h
··· 57 57 58 58 #define AB_REPEAT_ENABLE 59 59 60 - /* Define this if you do software codec */ 61 - #define CONFIG_CODEC SWCODEC 60 + 61 + 62 62 63 63 /* Work around debug macro expansion of strncmp in scratchbox */ 64 64 #define _HAVE_STRING_ARCH_strncmp
+2 -2
firmware/export/config/rk27generic.h
··· 95 95 /* Define this to enable morse code input */ 96 96 #define HAVE_MORSE_INPUT 97 97 98 - /* Define this if you do software codec */ 99 - #define CONFIG_CODEC SWCODEC 98 + 99 + 100 100 101 101 /* define this if you have a real-time clock */ 102 102 /* #define CONFIG_RTC RTC_NANO2G */
+2 -2
firmware/export/config/samsungyh820.h
··· 102 102 /* Define this to enable morse code input */ 103 103 #define HAVE_MORSE_INPUT 104 104 105 - /* Define this if you do software codec */ 106 - #define CONFIG_CODEC SWCODEC 105 + 106 + 107 107 108 108 /* define this if you have a disk storage, i.e. something 109 109 that needs spinups and can cause skips when shaked */
+2 -2
firmware/export/config/samsungyh920.h
··· 95 95 /* Define this to enable morse code input */ 96 96 #define HAVE_MORSE_INPUT 97 97 98 - /* Define this if you do software codec */ 99 - #define CONFIG_CODEC SWCODEC 98 + 99 + 100 100 101 101 /* define this if you have a real-time clock */ 102 102 #ifndef BOOTLOADER
+2 -2
firmware/export/config/samsungyh925.h
··· 92 92 /* Define this to enable morse code input */ 93 93 #define HAVE_MORSE_INPUT 94 94 95 - /* Define this if you do software codec */ 96 - #define CONFIG_CODEC SWCODEC 95 + 96 + 97 97 98 98 /* define this if you have a real-time clock */ 99 99 #ifndef BOOTLOADER
+2 -2
firmware/export/config/samsungypr0.h
··· 84 84 #define AB_REPEAT_ENABLE 85 85 #define ACTION_WPSAB_SINGLE ACTION_WPS_HOTKEY 86 86 87 - /* Define this if you do software codec */ 88 - #define CONFIG_CODEC SWCODEC 87 + 88 + 89 89 90 90 /* R0 KeyPad configuration for plugins */ 91 91 #define CONFIG_KEYPAD SAMSUNG_YPR0_PAD
+2 -2
firmware/export/config/samsungypr1.h
··· 89 89 90 90 #define AB_REPEAT_ENABLE 91 91 92 - /* Define this if you do software codec */ 93 - #define CONFIG_CODEC SWCODEC 92 + 93 + 94 94 95 95 /* R1 KeyPad configuration for plugins */ 96 96 #define CONFIG_KEYPAD SAMSUNG_YPR1_PAD
+2 -2
firmware/export/config/samsungyps3.h
··· 80 80 //#define AB_REPEAT_ENABLE 81 81 //#define ACTION_WPSAB_SINGLE ACTION_WPS_BROWSE 82 82 83 - /* Define this if you do software codec */ 84 - #define CONFIG_CODEC SWCODEC 83 + 84 + 85 85 86 86 /* define this if you have a real-time clock */ 87 87 #define CONFIG_RTC RTC_S35390A
+2 -2
firmware/export/config/samsungypz5.h
··· 94 94 /* Define this to enable morse code input */ 95 95 #define HAVE_MORSE_INPUT 96 96 97 - /* Define this if you do software codec */ 98 - #define CONFIG_CODEC SWCODEC 97 + 98 + 99 99 100 100 /* LCD dimensions */ 101 101 #define LCD_WIDTH 128
+2 -2
firmware/export/config/sansac100.h
··· 68 68 69 69 #define AB_REPEAT_ENABLE 70 70 71 - /* Define this if you do software codec */ 72 - #define CONFIG_CODEC SWCODEC 71 + 72 + 73 73 74 74 /* Define this if you have the TLV320 audio codec */ 75 75 #define HAVE_TLV320
+2 -2
firmware/export/config/sansac200.h
··· 84 84 /* define this if the target has volume keys which can be used in the lists */ 85 85 #define HAVE_VOLUME_IN_LIST 86 86 87 - /* Define this if you do software codec */ 88 - #define CONFIG_CODEC SWCODEC 87 + 88 + 89 89 90 90 /* There is no hardware tone control */ 91 91 #define HAVE_SW_TONE_CONTROLS
+2 -2
firmware/export/config/sansac200v2.h
··· 88 88 /* define this if the target has volume keys which can be used in the lists */ 89 89 #define HAVE_VOLUME_IN_LIST 90 90 91 - /* Define this if you do software codec */ 92 - #define CONFIG_CODEC SWCODEC 91 + 92 + 93 93 94 94 /* There is no hardware tone control */ 95 95 #define HAVE_SW_TONE_CONTROLS
+2 -2
firmware/export/config/sansaclip.h
··· 93 93 /* define this if the target has volume keys which can be used in the lists */ 94 94 #define HAVE_VOLUME_IN_LIST 95 95 96 - /* Define this if you do software codec */ 97 - #define CONFIG_CODEC SWCODEC 96 + 97 + 98 98 /* There is no hardware tone control */ 99 99 #define HAVE_SW_TONE_CONTROLS 100 100
+2 -2
firmware/export/config/sansaclipplus.h
··· 103 103 104 104 #define HAVE_GUI_BOOST 105 105 106 - /* Define this if you do software codec */ 107 - #define CONFIG_CODEC SWCODEC 106 + 107 + 108 108 /* There is no hardware tone control */ 109 109 #define HAVE_SW_TONE_CONTROLS 110 110
+2 -2
firmware/export/config/sansaclipv2.h
··· 97 97 98 98 #define HAVE_GUI_BOOST 99 99 100 - /* Define this if you do software codec */ 101 - #define CONFIG_CODEC SWCODEC 100 + 101 + 102 102 /* There is no hardware tone control */ 103 103 #define HAVE_SW_TONE_CONTROLS 104 104
+2 -2
firmware/export/config/sansaclipzip.h
··· 98 98 99 99 #define HAVE_GUI_BOOST 100 100 101 - /* Define this if you do software codec */ 102 - #define CONFIG_CODEC SWCODEC 101 + 102 + 103 103 /* There is no hardware tone control */ 104 104 #define HAVE_SW_TONE_CONTROLS 105 105
+2 -2
firmware/export/config/sansaconnect.h
··· 101 101 102 102 #define HAVE_MORSE_INPUT 103 103 104 - /* Define this if you do software codec */ 105 - #define CONFIG_CODEC SWCODEC 104 + 105 + 106 106 107 107 //#define HAVE_HARDWARE_BEEP 108 108
+2 -2
firmware/export/config/sansae200.h
··· 82 82 /* Define this to enable morse code input */ 83 83 #define HAVE_MORSE_INPUT 84 84 85 - /* Define this if you do software codec */ 86 - #define CONFIG_CODEC SWCODEC 85 + 86 + 87 87 /* There is no hardware tone control */ 88 88 #define HAVE_SW_TONE_CONTROLS 89 89 /* The PP5024 has a built-in AustriaMicrosystems AS3514 */
+2 -2
firmware/export/config/sansae200v2.h
··· 84 84 /* Define this to have CPU boosted while scrolling in the UI */ 85 85 #define HAVE_GUI_BOOST 86 86 87 - /* Define this if you do software codec */ 88 - #define CONFIG_CODEC SWCODEC 87 + 88 + 89 89 90 90 /* There is no hardware tone control */ 91 91 #define HAVE_SW_TONE_CONTROLS
+2 -2
firmware/export/config/sansafuze.h
··· 91 91 /* Define this to enable morse code input */ 92 92 #define HAVE_MORSE_INPUT 93 93 94 - /* Define this if you do software codec */ 95 - #define CONFIG_CODEC SWCODEC 94 + 95 + 96 96 97 97 98 98 /* LCD dimensions */
+2 -2
firmware/export/config/sansafuzeplus.h
··· 95 95 /* Define this to enable morse code input */ 96 96 #define HAVE_MORSE_INPUT 97 97 98 - /* Define this if you do software codec */ 99 - #define CONFIG_CODEC SWCODEC 98 + 99 + 100 100 101 101 /* LCD dimensions */ 102 102 #define LCD_WIDTH 240
+2 -2
firmware/export/config/sansafuzev2.h
··· 102 102 /* Define this to enable morse code input */ 103 103 #define HAVE_MORSE_INPUT 104 104 105 - /* Define this if you do software codec */ 106 - #define CONFIG_CODEC SWCODEC 105 + 106 + 107 107 108 108 109 109 /* LCD dimensions */
+2 -2
firmware/export/config/sansam200.h
··· 77 77 78 78 #define AB_REPEAT_ENABLE 79 79 80 - /* Define this if you do software codec */ 81 - #define CONFIG_CODEC SWCODEC 80 + 81 + 82 82 83 83 /* Define this if you have the TLV320 audio codec */ 84 84 #define HAVE_TLV320
+2 -2
firmware/export/config/sansam200v4.h
··· 92 92 #define CONFIG_TUNER TEA5767 93 93 #define CONFIG_TUNER_XTAL 32768 94 94 95 - /* Define this if you do software codec */ 96 - #define CONFIG_CODEC SWCODEC 95 + 96 + 97 97 98 98 /* Define this if you have the TLV320 audio codec */ 99 99 /*#define HAVE_TLV320*/
+2 -2
firmware/export/config/sansaview.h
··· 71 71 /* Define this to enable morse code input */ 72 72 #define HAVE_MORSE_INPUT 73 73 74 - /* Define this if you do software codec */ 75 - #define CONFIG_CODEC SWCODEC 74 + 75 + 76 76 /* There is no hardware tone control */ 77 77 /* #define HAVE_SW_TONE_CONTROLS*/ 78 78 #define HAVE_WM8731
+2 -2
firmware/export/config/sdlapp.h
··· 65 65 66 66 #define AB_REPEAT_ENABLE 67 67 68 - /* Define this if you do software codec */ 69 - #define CONFIG_CODEC SWCODEC 68 + 69 + 70 70 71 71 #define HAVE_SCROLLWHEEL 72 72 #define CONFIG_KEYPAD SDL_PAD
+2 -2
firmware/export/config/sonynwze360.h
··· 83 83 /* Define this to enable morse code input */ 84 84 #define HAVE_MORSE_INPUT 85 85 86 - /* Define this if you do software codec */ 87 - #define CONFIG_CODEC SWCODEC 86 + 87 + 88 88 89 89 /* LCD dimensions */ 90 90 #define LCD_WIDTH 240
+2 -2
firmware/export/config/sonynwze370.h
··· 80 80 /* Define this to enable morse code input */ 81 81 #define HAVE_MORSE_INPUT 82 82 83 - /* Define this if you do software codec */ 84 - #define CONFIG_CODEC SWCODEC 83 + 84 + 85 85 86 86 /* LCD dimensions */ 87 87 #define LCD_WIDTH 128
+2 -2
firmware/export/config/sonynwzlinux.h
··· 59 59 /* The number of bytes reserved for loadable plugins */ 60 60 #define PLUGIN_BUFFER_SIZE 0x100000 61 61 62 - /* Define this if you do software codec */ 63 - #define CONFIG_CODEC SWCODEC 62 + 63 + 64 64 65 65 #define CONFIG_TUNER SI4700 66 66
+2 -2
firmware/export/config/tatungtpj1022.h
··· 45 45 46 46 #define CONFIG_KEYPAD TATUNG_TPJ1022_PAD 47 47 48 - /* Define this if you do software codec */ 49 - #define CONFIG_CODEC SWCODEC 48 + 49 + 50 50 51 51 /* define this if you have a real-time clock */ 52 52 #ifndef BOOTLOADER
+2 -2
firmware/export/config/vibe500.h
··· 75 75 /* Define this to enable morse code input */ 76 76 #define HAVE_MORSE_INPUT 77 77 78 - /* Define this if you do software codec */ 79 - #define CONFIG_CODEC SWCODEC 78 + 79 + 80 80 81 81 /* define this if you have a real-time clock */ 82 82 /* Philips 8563T - E8564 is a clone of it */
+2 -2
firmware/export/config/xduoox20.h
··· 72 72 /* The number of bytes reserved for loadable plugins */ 73 73 #define PLUGIN_BUFFER_SIZE 0x100000 74 74 75 - /* Define this if you do software codec */ 76 - #define CONFIG_CODEC SWCODEC 75 + 76 + 77 77 78 78 #define HAVE_HEADPHONE_DETECTION 79 79
+2 -2
firmware/export/config/xduoox3.h
··· 81 81 /* Define this if a programmable hotkey is mapped */ 82 82 #define HAVE_HOTKEY 83 83 84 - /* Define this if you do software codec */ 85 - #define CONFIG_CODEC SWCODEC 84 + 85 + 86 86 87 87 #ifndef BOOTLOADER 88 88 /* define this if you have a real-time clock */
+2 -2
firmware/export/config/xduoox3ii.h
··· 72 72 /* The number of bytes reserved for loadable plugins */ 73 73 #define PLUGIN_BUFFER_SIZE 0x100000 74 74 75 - /* Define this if you do software codec */ 76 - #define CONFIG_CODEC SWCODEC 75 + 76 + 77 77 78 78 #define HAVE_HEADPHONE_DETECTION 79 79
+2 -2
firmware/export/config/zenvisionm30gb.h
··· 81 81 /* Define this to enable morse code input */ 82 82 #define HAVE_MORSE_INPUT 83 83 84 - /* Define this if you do software codec */ 85 - #define CONFIG_CODEC SWCODEC 84 + 85 + 86 86 87 87 /* define this if you have a real-time clock */ 88 88 //#define CONFIG_RTC RTC_RX5X348AB
+2 -2
firmware/export/config/zenvisionm60gb.h
··· 80 80 /* Define this to enable morse code input */ 81 81 #define HAVE_MORSE_INPUT 82 82 83 - /* Define this if you do software codec */ 84 - #define CONFIG_CODEC SWCODEC 83 + 84 + 85 85 86 86 /* define this if you have a real-time clock */ 87 87 //#define CONFIG_RTC RTC_RX5X348AB
-2
firmware/export/general.h
··· 26 26 #include <stddef.h> 27 27 #include "config.h" 28 28 29 - #if CONFIG_CODEC == SWCODEC 30 29 /* round a signed/unsigned 32bit value to the closest of a list of values */ 31 30 /* returns the index of the closest value */ 32 31 int round_value_to_list32(unsigned long value, ··· 38 37 const unsigned long *src_list, 39 38 unsigned long caps_mask, 40 39 unsigned long *caps_list); 41 - #endif /* CONFIG_CODEC == SWCODEC */ 42 40 43 41 /* Create a filename with a number part in a way that the number is 1 44 42 * higher than the highest numbered file matching the same pattern.
-51
firmware/export/mp3_playback.h
··· 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 32 - typedef void (*mp3_play_callback_t)(const void **start, size_t* size); 33 - #endif 34 - 35 - /* functions formerly in mpeg.c */ 36 - void 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 - 42 - void mp3_play_data(const void* start, size_t size, 43 - mp3_play_callback_t get_more); 44 - void mp3_play_pause(bool play); 45 - bool mp3_pause_done(void); 46 - void mp3_play_stop(void); 47 - bool mp3_is_playing(void); 48 - unsigned char* mp3_get_pos(void); 49 - void mp3_shutdown(void); 50 - 51 - #endif /* #ifndef _MP3_PLAYBACK_H_ */
-2
firmware/general.c
··· 31 31 #include "time.h" 32 32 #include "timefuncs.h" 33 33 34 - #if CONFIG_CODEC == SWCODEC 35 34 int round_value_to_list32(unsigned long value, 36 35 const unsigned long list[], 37 36 int count, ··· 87 86 88 87 return count; 89 88 } /* make_list_from_caps32 */ 90 - #endif /* CONFIG_CODEC == SWCODEC */ 91 89 92 90 /* Create a filename with a number part in a way that the number is 1 93 91 * higher than the highest numbered file matching the same pattern.
-4
firmware/kernel/include/thread.h
··· 66 66 #define IO_PRIORITY_IMMEDIATE 0 67 67 #define IO_PRIORITY_BACKGROUND 32 68 68 69 - #if CONFIG_CODEC == SWCODEC 70 69 # ifdef HAVE_HARDWARE_CLICK 71 70 # define BASETHREADS 17 72 71 # else 73 72 # define BASETHREADS 16 74 73 # endif 75 - #else 76 - # define BASETHREADS 11 77 - #endif /* CONFIG_CODE == * */ 78 74 79 75 #ifndef TARGET_EXTRA_THREADS 80 76 #define TARGET_EXTRA_THREADS 0
-5
firmware/powermgmt.c
··· 31 31 #include "storage.h" 32 32 #include "power.h" 33 33 #include "audio.h" 34 - #include "mp3_playback.h" 35 34 #include "usb.h" 36 35 #include "powermgmt.h" 37 36 #include "backlight.h" ··· 770 769 storage_spindown(1); 771 770 } 772 771 773 - #if CONFIG_CODEC == SWCODEC 774 772 audiohw_close(); 775 - #else 776 - mp3_shutdown(); 777 - #endif 778 773 779 774 /* If HD is still active we try to wait for spindown, otherwise the 780 775 shutdown_timeout in power_thread_step will force a power off */
-4
firmware/target/hosted/maemo/pcm-gstreamer.c
··· 65 65 extern bool debug_audio; 66 66 #endif 67 67 68 - #if CONFIG_CODEC == SWCODEC 69 - 70 68 /* Declarations for libplayblack */ 71 69 pb_playback_t *playback = NULL; 72 70 void playback_state_req_handler(pb_playback_t *pb, ··· 481 479 #endif 482 480 483 481 #endif /* HAVE_RECORDING */ 484 - 485 - #endif /* CONFIG_CODEC == SWCODEC */
-3
firmware/target/hosted/sdl/pcm-sdl.c
··· 51 51 extern bool debug_audio; 52 52 #endif 53 53 54 - #if CONFIG_CODEC == SWCODEC 55 54 static int cvt_status = -1; 56 55 57 56 static const void *pcm_data; ··· 411 410 void pcm_play_dma_postinit(void) 412 411 { 413 412 } 414 - 415 - #endif /* CONFIG_CODEC == SWCODEC */
-2
lib/rbcodec/SOURCES
··· 2 2 metadata/id3tags.c 3 3 metadata/mp3.c 4 4 metadata/mp3data.c 5 - #if CONFIG_CODEC == SWCODEC 6 5 dsp/channel_mode.c 7 6 dsp/compressor.c 8 7 dsp/crossfeed.c ··· 64 63 metadata/wave.c 65 64 metadata/wavpack.c 66 65 metadata/aac.c 67 - #endif
+4 -6
lib/rbcodec/codecs/codecs.h
··· 34 34 #include "profile.h" 35 35 #include "thread.h" 36 36 #endif 37 - #if (CONFIG_CODEC == SWCODEC) 38 37 #ifdef HAVE_RECORDING 39 38 #include "enc_base.h" 40 39 #endif 41 40 #include "dsp_core.h" 42 41 #include "dsp_misc.h" 43 42 #include "dsp-util.h" 44 - #endif 45 43 46 44 #include "gcc_extensions.h" 47 45 #include "load_code.h" ··· 281 279 int codec_load_file(const char* codec, struct codec_api *api); 282 280 int codec_run_proc(void); 283 281 int codec_close(void); 284 - #if CONFIG_CODEC == SWCODEC && defined(HAVE_RECORDING) 282 + #if defined(HAVE_RECORDING) 285 283 enc_callback_t codec_get_enc_callback(void); 286 - #else 287 - #define codec_get_enc_callback() NULL 288 284 #endif 289 285 290 286 /* defined by the codec */ 291 287 enum codec_status codec_start(enum codec_entry_call_reason reason); 292 288 enum codec_status codec_main(enum codec_entry_call_reason reason); 293 289 enum codec_status codec_run(void); 294 - #if CONFIG_CODEC == SWCODEC && defined(HAVE_RECORDING) 290 + #if defined(HAVE_RECORDING) 295 291 int enc_callback(enum enc_callback_reason reason, void *params); 292 + #else 293 + #define codec_get_enc_callback() NULL 296 294 #endif 297 295 298 296 #endif /* _CODECS_H_ */
+1 -2
lib/rbcodec/codecs/lib/SOURCES
··· 1 - #if CONFIG_CODEC == SWCODEC /* software codec platforms */ 2 1 codeclib.c 3 2 ffmpeg_bitstream.c 4 3 ··· 6 5 fft-ffmpeg.c 7 6 mdct.c 8 7 9 - #elif (CONFIG_PLATFORM & PLATFORM_HOSTED) && defined(__APPLE__) 8 + #if (CONFIG_PLATFORM & PLATFORM_HOSTED) && defined(__APPLE__) 10 9 osx.dummy.c 11 10 #endif
+3 -21
lib/rbcodec/metadata/id3tags.c
··· 43 43 44 44 #include "metadata.h" 45 45 #include "mp3data.h" 46 - #if CONFIG_CODEC == SWCODEC 47 46 #include "metadata_common.h" 48 - #endif 49 47 #include "metadata_parsers.h" 50 48 #include "misc.h" 51 49 ··· 91 89 "Synthpop" 92 90 }; 93 91 94 - #if CONFIG_CODEC != SWCODEC 95 - static 96 - #endif 97 92 char* id3_get_num_genre(unsigned int genre_num) 98 93 { 99 94 if (genre_num < ARRAYLEN(genres)) ··· 376 371 /* At least part of the value was read, so we can safely try to 377 372 * parse it */ 378 373 value = tag + desc_len + 1; 379 - 374 + 380 375 if (!strcasecmp(tag, "ALBUM ARTIST")) { 381 376 length = strlen(value) + 1; 382 377 strlcpy(tag, value, length); 383 378 entry->albumartist = tag; 384 - #if CONFIG_CODEC == SWCODEC 385 379 } else { 386 380 /* Call parse_replaygain(). */ 387 381 parse_replaygain(tag, value, entry); 388 - #endif 389 382 } 390 383 } 391 384 392 385 return tag - entry->id3v2buf + length; 393 386 } 394 387 395 - #if CONFIG_CODEC == SWCODEC 396 388 /* parse RVA2 binary data and convert to replaygain information. */ 397 389 static int parserva2( struct mp3entry* entry, char* tag, int bufferpos) 398 390 { ··· 452 444 return start_pos; 453 445 } 454 446 } 455 - 447 + 456 448 parse_replaygain_int(album, gain, peak * 2, entry); 457 449 } 458 450 459 451 return start_pos; 460 452 } 461 - #endif 462 453 463 454 static int parsembtid( struct mp3entry* entry, char* tag, int bufferpos ) 464 455 { ··· 514 505 { "PIC", 3, 0, &parsealbumart, true }, 515 506 #endif 516 507 { "TXXX", 4, 0, &parseuser, false }, 517 - #if CONFIG_CODEC == SWCODEC 518 508 { "RVA2", 4, 0, &parserva2, true }, 519 - #endif 520 509 { "UFID", 4, 0, &parsembtid, false }, 521 510 }; 522 511 ··· 738 727 bool unsynch = false; 739 728 int i, j; 740 729 int rc; 741 - #if CONFIG_CODEC == SWCODEC 742 730 bool itunes_gapless = false; 743 - #endif 744 731 745 732 #ifdef HAVE_ALBUMART 746 733 entry->has_embedded_albumart = false; ··· 984 971 (tr->tag_length == 3 && !memcmp( header, "COM", 3))) { 985 972 int offset; 986 973 if(bytesread >= 8 && !strncmp(tag+4, "iTun", 4)) { 987 - #if CONFIG_CODEC == SWCODEC 988 974 /* check for iTunes gapless information */ 989 975 if(bytesread >= 12 && !strncmp(tag+4, "iTunSMPB", 8)) 990 976 itunes_gapless = true; 991 977 else 992 - #endif 993 - /* ignore other with iTunes tags */ 994 - break; 978 + break; /* ignore other with iTunes tags */ 995 979 } 996 980 997 981 offset = 3 + unicode_len(*tag, tag + 4); ··· 1071 1055 tag[bytesread] = 0; 1072 1056 bufferpos += bytesread + 1; 1073 1057 1074 - #if CONFIG_CODEC == SWCODEC 1075 1058 /* parse the tag if it contains iTunes gapless info */ 1076 1059 if (itunes_gapless) 1077 1060 { ··· 1079 1062 entry->lead_trim = get_itunes_int32(tag, 1); 1080 1063 entry->tail_trim = get_itunes_int32(tag, 2); 1081 1064 } 1082 - #endif 1083 1065 1084 1066 /* Note that parser functions sometimes set *ptag to NULL, so 1085 1067 * the "!*ptag" check here doesn't always have the desired
+3 -20
lib/rbcodec/metadata/metadata.c
··· 29 29 30 30 #include "metadata_parsers.h" 31 31 32 - #if CONFIG_CODEC == SWCODEC 33 - 34 32 /* For trailing tag stripping and base audio data types */ 35 33 #include "buffering.h" 36 34 ··· 53 51 id3->genre_string = id3_get_num_genre(36); 54 52 return true; 55 53 } 56 - #endif /* CONFIG_CODEC == SWCODEC */ 57 54 bool write_metadata_log = false; 58 55 59 56 const struct afmt_entry audio_formats[AFMT_NUM_CODECS] = ··· 66 63 [AFMT_MPA_L2] = 67 64 AFMT_ENTRY("MP2", "mpa", NULL, get_mp3_metadata, "mpa\0mp2\0"), 68 65 69 - #if CONFIG_CODEC != SWCODEC 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 */ 66 + /* MPEG Audio layer 3 */ 76 67 [AFMT_MPA_L3] = 77 68 AFMT_ENTRY("MP3", "mpa", "mp3_enc", get_mp3_metadata, "mp3\0"), 78 69 ··· 238 229 /* AAC bitstream format */ 239 230 [AFMT_AAC_BSF] = 240 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 235 /* get REC_FORMAT_* corresponding AFMT_* */ 246 236 const int rec_format_afmt[REC_NUM_FORMATS] = 247 237 { ··· 267 257 [AFMT_PCM_WAV] = REC_FORMAT_PCM_WAV, 268 258 }; 269 259 #endif 270 - #endif /* CONFIG_CODEC == SWCODEC && defined (HAVE_RECORDING) */ 260 + #endif /* defined (HAVE_RECORDING) */ 271 261 272 - #if CONFIG_CODEC == SWCODEC 273 262 /* Get the canonical AFMT type */ 274 263 int get_audio_base_codec_type(int type) 275 264 { ··· 357 346 return false; 358 347 } 359 348 } 360 - #endif /* CONFIG_CODEC == SWCODEC */ 361 - 362 349 363 350 /* Simple file type probing by looking at the filename extension. */ 364 351 unsigned int probe_file_format(const char *filename) ··· 464 451 } 465 452 466 453 #ifndef __PCTOOL__ 467 - #if CONFIG_CODEC == SWCODEC 468 454 void strip_tags(int handle_id) 469 455 { 470 456 static const unsigned char tag[] = "TAG"; ··· 500 486 logf("Cutting off APE tag (%ldB)", len); 501 487 bufcuttail(handle_id, len); 502 488 } 503 - #endif /* CONFIG_CODEC == SWCODEC */ 504 489 #endif /* ! __PCTOOL__ */ 505 490 506 491 #define MOVE_ENTRY(x) if (x) x += offset; ··· 544 529 memset(id3, 0, sizeof (struct mp3entry)); 545 530 } 546 531 547 - #if CONFIG_CODEC == SWCODEC 548 532 /* Glean what is possible from the filename alone - does not parse metadata */ 549 533 void fill_metadata_from_path(struct mp3entry *id3, const char *trackname) 550 534 { ··· 574 558 /* Copy the path info */ 575 559 strlcpy(id3->path, trackname, sizeof (id3->path)); 576 560 } 577 - #endif /* CONFIG_CODEC == SWCODEC */
+2 -17
lib/rbcodec/metadata/metadata.h
··· 37 37 AFMT_MPA_L2, /* MPEG Audio layer 2 */ 38 38 AFMT_MPA_L3, /* MPEG Audio layer 3 */ 39 39 40 - #if CONFIG_CODEC == SWCODEC 41 40 AFMT_AIFF, /* Audio Interchange File Format */ 42 41 AFMT_PCM_WAV, /* Uncompressed PCM in a WAV file */ 43 42 AFMT_OGG_VORBIS, /* Ogg Vorbis */ ··· 91 90 AFMT_KSS, /* KSS (MSX computer KSS Music File) */ 92 91 AFMT_OPUS, /* Opus (see http://www.opus-codec.org ) */ 93 92 AFMT_AAC_BSF, 94 - #endif 95 93 96 94 /* add new formats at any index above this line to have a sensible order - 97 95 specified array index inits are used */ ··· 99 97 100 98 AFMT_NUM_CODECS, 101 99 102 - #if CONFIG_CODEC == SWCODEC && defined(HAVE_RECORDING) 100 + #if defined(HAVE_RECORDING) 103 101 /* masks to decompose parts */ 104 102 CODEC_AFMT_MASK = 0x0fff, 105 103 CODEC_TYPE_MASK = 0x7000, ··· 107 105 /* switch for specifying codec type when requesting a filename */ 108 106 CODEC_TYPE_DECODER = (0 << 12), /* default */ 109 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 111 #if (CONFIG_PLATFORM & PLATFORM_ANDROID) 115 112 #define CODEC_EXTENSION "so" 116 113 #define CODEC_PREFIX "lib" ··· 157 154 { label, root_fname, func, ext_list } 158 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 157 /** Database of audio formats **/ 167 158 /* record describing the audio format */ 168 159 struct mp3entry; 169 160 struct afmt_entry 170 161 { 171 162 const char *label; /* format label */ 172 - #if CONFIG_CODEC == SWCODEC 173 163 const char *codec_root_fn; /* root codec filename (sans _enc and .codec) */ 174 164 #ifdef HAVE_RECORDING 175 165 const char *codec_enc_root_fn; /* filename of encoder codec */ 176 - #endif 177 166 #endif 178 167 bool (*parse_func)(int fd, struct mp3entry *id3); /* return true on success */ 179 168 const char *ext_list; /* NULL terminated extension ··· 305 294 #endif 306 295 307 296 /* replaygain support */ 308 - #if CONFIG_CODEC == SWCODEC 309 297 long track_level; /* holds the level in dB * (1<<FP_BITS) */ 310 298 long album_level; 311 299 long track_gain; /* s19.12 signed fixed point. 0 for no gain. */ 312 300 long album_gain; 313 301 long track_peak; /* s19.12 signed fixed point. 0 for no peak. */ 314 302 long album_peak; 315 - #endif 316 303 317 304 #ifdef HAVE_ALBUMART 318 305 bool has_embedded_albumart; ··· 335 322 void copy_mp3entry(struct mp3entry *dest, const struct mp3entry *orig); 336 323 void wipe_mp3entry(struct mp3entry *id3); 337 324 338 - #if CONFIG_CODEC == SWCODEC 339 325 void fill_metadata_from_path(struct mp3entry *id3, const char *trackname); 340 326 int get_audio_base_codec_type(int type); 341 327 void strip_tags(int handle_id); 342 328 bool rbcodec_format_is_atomic(int afmt); 343 329 bool format_buffers_with_offset(int afmt); 344 - #endif 345 330 346 331 #endif 347 332
-4
lib/rbcodec/metadata/metadata_parsers.h
··· 19 19 * 20 20 ****************************************************************************/ 21 21 22 - #if CONFIG_CODEC == SWCODEC 23 22 char* id3_get_num_genre(unsigned int genre_num); 24 - #endif 25 23 int getid3v1len(int fd); 26 24 int getid3v2len(int fd); 27 25 bool setid3v1title(int fd, struct mp3entry *entry); 28 26 void setid3v2title(int fd, struct mp3entry *entry); 29 27 bool get_mp3_metadata(int fd, struct mp3entry* id3); 30 - #if CONFIG_CODEC == SWCODEC 31 28 bool get_adx_metadata(int fd, struct mp3entry* id3); 32 29 bool get_aiff_metadata(int fd, struct mp3entry* id3); 33 30 bool get_flac_metadata(int fd, struct mp3entry* id3); ··· 58 55 bool get_vgm_metadata(int fd, struct mp3entry* id3); 59 56 bool get_kss_metadata(int fd, struct mp3entry* id3); 60 57 bool get_aac_metadata(int fd, struct mp3entry* id3); 61 - #endif /* CONFIG_CODEC == SWCODEC */
-4
lib/rbcodec/metadata/mp3.c
··· 108 108 entry->frequency = info.frequency; 109 109 entry->layer = info.layer; 110 110 switch(entry->layer) { 111 - #if CONFIG_CODEC==SWCODEC 112 111 case 0: 113 112 entry->codectype=AFMT_MPA_L1; 114 113 break; 115 - #endif 116 114 case 1: 117 115 entry->codectype=AFMT_MPA_L2; 118 116 break; ··· 143 141 entry->vbr = info.is_vbr; 144 142 entry->has_toc = info.has_toc; 145 143 146 - #if CONFIG_CODEC==SWCODEC 147 144 if (!entry->lead_trim) 148 145 entry->lead_trim = info.enc_delay; 149 146 if (!entry->tail_trim) 150 147 entry->tail_trim = info.enc_padding; 151 - #endif 152 148 153 149 memcpy(entry->toc, info.toc, sizeof(info.toc)); 154 150
+2 -11
lib/rbcodec/metadata/mp3data.c
··· 115 115 return false; 116 116 if (!(head & LAYER_MASK)) /* no layer? */ 117 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 118 if ((head & BITRATE_MASK) == BITRATE_MASK) /* bad bitrate? */ 124 119 return false; 125 120 if (!(head & BITRATE_MASK)) /* no bitrate? */ ··· 454 449 /* We don't care about this, but need to skip it */ 455 450 i += 4; 456 451 } 457 - #if CONFIG_CODEC==SWCODEC 458 452 i += 21; 459 453 info->enc_delay = ((int)buf[i ] << 4) | (buf[i+1] >> 4); 460 454 info->enc_padding = ((int)(buf[i+1]&0xF) << 8) | buf[i+2]; ··· 467 461 info->enc_delay = -1; 468 462 info->enc_padding = -1; 469 463 } 470 - #endif 471 464 } 472 465 473 466 /* Extract information from a 'VBRI' header. */ ··· 541 534 /* Initialize info and frame */ 542 535 memset(info, 0, sizeof(struct mp3info)); 543 536 memset(frame, 0, sizeof(frame)); 544 - 545 - #if CONFIG_CODEC==SWCODEC 537 + 546 538 /* These two are needed for proper LAME gapless MP3 playback */ 547 539 info->enc_delay = -1; 548 540 info->enc_padding = -1; 549 - #endif 550 541 551 542 /* Get the very first single MPEG frame. */ 552 543 result = get_next_header_info(fd, &bytecount, info, true); 553 544 if(result) 554 545 return result; 555 - 546 + 556 547 /* Read the amount of frame data to the buffer that is required for the 557 548 * vbr tag parsing. Skip the rest. */ 558 549 buf_size = MIN(info->frame_size-4, (int)sizeof(frame));
+1 -3
lib/rbcodec/rbcodec.make
··· 22 22 $(RBCODECLIB): $(RBCODECLIB_OBJ) 23 23 $(call PRINTS,AR $(@F))$(AR) rcs $@ $^ >/dev/null 24 24 25 - ifdef SOFTWARECODECS 26 - include $(RBCODECLIB_DIR)/codecs/codecs.make 27 - endif 25 + include $(RBCODECLIB_DIR)/codecs/codecs.make
+1 -1
lib/skin_parser/tag_table.h
··· 256 256 SKIN_TOKEN_IS_RECORDING, 257 257 SKIN_TOKEN_REC_FREQ, 258 258 SKIN_TOKEN_REC_ENCODER, 259 - SKIN_TOKEN_REC_BITRATE, /* SWCODEC: MP3 bitrate, HWCODEC: MP3 "quality" */ 259 + SKIN_TOKEN_REC_BITRATE, 260 260 SKIN_TOKEN_REC_MONO, 261 261 SKIN_TOKEN_REC_SECONDS, 262 262 SKIN_TOKEN_REC_MINUTES,
-1
manual/configure_rockbox/recording_settings.tex
··· 91 91 Choose the source of the recording. The options are: 92 92 \opt{recording_digital}{\setting{Digital} (SPDIF), }% 93 93 \opt{recording_mic}{\setting{Microphone}}% 94 - \opt{recording_hwcodec}{ and \setting{Line~In}.}% 95 94 \opt{recording_swcodec}{% 96 95 \nopt{radio}{\opt{recording_linein}{ and \setting{Line~In}.}}% 97 96 \opt{radio}{%
+2 -6
manual/getting_started/installation.tex
··· 243 243 various important aspects of Rockbox, such as the different versions 244 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 246 \opt{swcodec} { 249 247 \opt{HAVE_RB_BL_ON_DISK}{There are three separate components, 250 248 two of which need to be installed in order to run Rockbox:} ··· 690 688 data partition.\\} 691 689 } 692 690 693 - \nopt{hwcodec}{ 694 - The bootloader only changes rarely, and should not normally 695 - need to be updated.\\ 696 - } 691 + The bootloader only changes rarely, and should not normally 692 + need to be updated.\\ 697 693 698 694 \note{If you use Rockbox Utility be aware that it cannot detect manually 699 695 installed components.}
-1
manual/main_menu/recording_screen.tex
··· 22 22 the peak meters to freeze in the process. This is expected behaviour, and 23 23 nothing to worry about. The recording continues during the spin up.\\*}}} 24 24 25 - \opt{recording_hwcodec}{The frequency, channels and quality} 26 25 \opt{recording_swcodec}{The frequency and channels} settings are shown in the 27 26 status bar.\\* 28 27
-5
manual/plugins/pictureflow.tex
··· 5 5 album from PictureFlow. Playback will start from the selected track. The 6 6 PictureFlow 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 10 - play music. Also, using this plugin will cause playback to stop.} 11 - } 12 - 13 8 \subsubsection{Requirements} 14 9 PictureFlow uses both the album art (see \reference{ref:album_art}) and 15 10 database (see \reference{ref:database}) features of Rockbox.
+16 -28
tools/buildzip.pl
··· 92 92 print "cp $path $destination\n" if $verbose; 93 93 copy($path, $destination); 94 94 chmod(0755, $destination.'/'.$path); 95 - } 95 + } 96 96 } 97 97 } 98 98 } ··· 266 266 Icon Width: CONFIG_DEFAULT_ICON_WIDTH 267 267 Icon Height: CONFIG_DEFAULT_ICON_HEIGHT 268 268 #endif 269 - Codec: CONFIG_CODEC 270 269 #ifdef HAVE_REMOTE_LCD 271 270 Remote Depth: LCD_REMOTE_DEPTH 272 271 Remote Icon Width: CONFIG_REMOTE_DEFAULT_ICON_WIDTH ··· 287 286 288 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 290 my ($remote_depth, $remote_icon_h, $remote_icon_w); 292 291 my ($recording); 293 292 my $icon_count = 1; ··· 311 310 elsif($_ =~ /^Icon Height: (\d*)/) { 312 311 $icon_h = $1; 313 312 } 314 - elsif($_ =~ /^Codec: (\d*)/) { 315 - # SWCODEC is 1, the others are HWCODEC 316 - $swcodec = ($1 == 1); 317 - } 318 313 elsif($_ =~ /^Remote Depth: (\d*)/) { 319 314 $remote_depth = $1; 320 315 } ··· 332 327 unlink("gcctemp"); 333 328 334 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 338 333 sub filesize { ··· 345 340 346 341 347 342 sub buildzip { 348 - my ($image, $fonts)=@_; 343 + my ($image, $fonts)=@_; 349 344 my $libdir = $install; 350 345 my $temp_dir = ".rockbox"; 351 346 352 347 print "buildzip: image=$image fonts=$fonts\n" if $verbose; 353 - 348 + 354 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 351 &gettargetinfo(); 357 352 358 - # print "Bitmap: $bitmap\nDepth: $depth\nSwcodec: $swcodec\n"; 353 + # print "Bitmap: $bitmap\nDepth: $depth\n"; 359 354 360 355 # remove old traces 361 356 rmtree($temp_dir); ··· 406 401 glob_mkdir("$temp_dir/recpresets"); 407 402 } 408 403 409 - if($swcodec) { 410 - glob_mkdir("$temp_dir/eqs"); 411 - 412 - glob_copy("$ROOT/lib/rbcodec/dsp/eqs/*.cfg", "$temp_dir/eqs/"); # equalizer presets 413 - } 404 + glob_mkdir("$temp_dir/eqs"); 405 + glob_copy("$ROOT/lib/rbcodec/dsp/eqs/*.cfg", "$temp_dir/eqs/"); # equalizer presets 414 406 415 407 glob_mkdir("$temp_dir/wps"); 416 408 glob_mkdir("$temp_dir/icons"); ··· 556 548 if( filesize("rombox.ucl") > 1000) { 557 549 copy("rombox.ucl", "$temp_dir/rombox.ucl"); # UCL for flashing 558 550 } 559 - 551 + 560 552 # Check for rombox.target 561 553 if ($image=~/(.*)\.(\w+)$/) 562 554 { ··· 596 588 else { 597 589 print STDERR "No wps module present, can't do the WPS magic!\n"; 598 590 } 599 - 591 + 600 592 # until buildwps.pl is fixed, manually copy the classic_statusbar theme across 601 593 mkdir "$temp_dir/wps/classic_statusbar", 0777; 602 594 glob_copy("$ROOT/wps/classic_statusbar/*.bmp", "$temp_dir/wps/classic_statusbar"); 603 - if ($swcodec) { 604 - if ($depth == 16) { 605 - copy("$ROOT/wps/classic_statusbar.sbs", "$temp_dir/wps"); 606 - } elsif ($depth > 1) { 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 - } 595 + if ($depth == 16) { 596 + copy("$ROOT/wps/classic_statusbar.sbs", "$temp_dir/wps"); 597 + } elsif ($depth > 1) { 598 + copy("$ROOT/wps/classic_statusbar.grey.sbs", "$temp_dir/wps/classic_statusbar.sbs"); 611 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 602 if ($remote_depth != $depth) { 615 603 copy("$ROOT/wps/classic_statusbar.mono.sbs", "$temp_dir/wps/classic_statusbar.rsbs");
+3 -132
tools/configure
··· 1268 1268 echo "$TTS_ENGINE options set to $TTS_OPTS" 1269 1269 fi 1270 1270 1271 - if [ "$swcodec" = "yes" ]; then 1272 - ENCODER="rbspeexenc" 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 1271 + ENCODER="rbspeexenc" 1272 + ENC_OPTS="-q 7 -c 10" 1284 1273 1285 1274 echo "Using $ENCODER for encoding voice clips" 1286 1275 ··· 1650 1639 # plugins: set to 'yes' to build the plugins. Early development builds can 1651 1640 # set this to no in the early stages to have an easier life for a 1652 1641 # while 1653 - # swcodec: set 'yes' on swcodec targets 1654 1642 # toolset: lists what particular tools in the tools/ directory that this 1655 1643 # target needs to have built prior to building Rockbox 1656 1644 # ··· 1677 1665 appextra="recorder:gui:radio" 1678 1666 flash="$pwd/rombox.iriver" 1679 1667 plugins="yes" 1680 - swcodec="yes" 1681 1668 # toolset is the tools within the tools directory that we build for 1682 1669 # this particular target. 1683 1670 toolset=$iriverbitmaptools ··· 1700 1687 output="rockbox.iriver" 1701 1688 appextra="recorder:gui:radio" 1702 1689 plugins="yes" 1703 - swcodec="yes" 1704 1690 # toolset is the tools within the tools directory that we build for 1705 1691 # this particular target. 1706 1692 toolset=$iriverbitmaptools ··· 1725 1711 appextra="recorder:gui:radio" 1726 1712 flash="$pwd/rombox.iriver" 1727 1713 plugins="yes" 1728 - swcodec="yes" 1729 1714 # toolset is the tools within the tools directory that we build for 1730 1715 # this particular target. 1731 1716 toolset=$iriverbitmaptools ··· 1746 1731 output="rockbox.wma" 1747 1732 appextra="recorder:gui:radio" 1748 1733 plugins="yes" 1749 - swcodec="yes" 1750 1734 # toolset is the tools within the tools directory that we build for 1751 1735 # this particular target. 1752 1736 toolset=$genericbitmaptools ··· 1767 1751 output="rockbox.mi4" 1768 1752 appextra="recorder:gui:radio" 1769 1753 plugins="yes" 1770 - swcodec="yes" 1771 1754 boottool="$rootdir/tools/scramble -mi4v3 -model=h10 -type=RBBL" 1772 1755 bootoutput="H10_20GC.mi4" 1773 1756 # toolset is the tools within the tools directory that we build for ··· 1792 1775 output="rockbox.mi4" 1793 1776 appextra="recorder:gui:radio" 1794 1777 plugins="yes" 1795 - swcodec="yes" 1796 1778 boottool="$rootdir/tools/scramble -mi4v2 -model=h105 -type=RBBL" 1797 1779 bootoutput="H10.mi4" 1798 1780 # toolset is the tools within the tools directory that we build for ··· 1817 1799 output="rockbox.ipod" 1818 1800 appextra="recorder:gui:radio" 1819 1801 plugins="yes" 1820 - swcodec="yes" 1821 1802 bootoutput="bootloader-$modelname.ipod" 1822 1803 # toolset is the tools within the tools directory that we build for 1823 1804 # this particular target. ··· 1841 1822 output="rockbox.ipod" 1842 1823 appextra="recorder:gui:radio" 1843 1824 plugins="yes" 1844 - swcodec="yes" 1845 1825 bootoutput="bootloader-$modelname.ipod" 1846 1826 # toolset is the tools within the tools directory that we build for 1847 1827 # this particular target. ··· 1865 1845 output="rockbox.ipod" 1866 1846 appextra="recorder:gui:radio" 1867 1847 plugins="yes" 1868 - swcodec="yes" 1869 1848 bootoutput="bootloader-$modelname.ipod" 1870 1849 # toolset is the tools within the tools directory that we build for 1871 1850 # this particular target. ··· 1889 1868 output="rockbox.ipod" 1890 1869 appextra="recorder:gui:radio" 1891 1870 plugins="yes" 1892 - swcodec="yes" 1893 1871 bootoutput="bootloader-$modelname.ipod" 1894 1872 # toolset is the tools within the tools directory that we build for 1895 1873 # this particular target. ··· 1913 1891 output="rockbox.ipod" 1914 1892 appextra="recorder:gui:radio" 1915 1893 plugins="yes" 1916 - swcodec="yes" 1917 1894 bootoutput="bootloader-$modelname.ipod" 1918 1895 # toolset is the tools within the tools directory that we build for 1919 1896 # this particular target. ··· 1937 1914 output="rockbox.ipod" 1938 1915 appextra="recorder:gui:radio" 1939 1916 plugins="yes" 1940 - swcodec="yes" 1941 1917 bootoutput="bootloader-$modelname.ipod" 1942 1918 # toolset is the tools within the tools directory that we build for 1943 1919 # this particular target. ··· 1961 1937 output="rockbox.ipod" 1962 1938 appextra="recorder:gui:radio" 1963 1939 plugins="yes" 1964 - swcodec="yes" 1965 1940 bootoutput="bootloader-$modelname.ipod" 1966 1941 # toolset is the tools within the tools directory that we build for 1967 1942 # this particular target. ··· 1985 1960 output="rockbox.ipod" 1986 1961 appextra="recorder:gui:radio" 1987 1962 plugins="yes" 1988 - swcodec="yes" 1989 1963 bootoutput="bootloader-$modelname.ipod" 1990 1964 # toolset is the tools within the tools directory that we build for 1991 1965 # this particular target. ··· 2009 1983 output="rockbox.ipod" 2010 1984 appextra="recorder:gui:radio" 2011 1985 plugins="yes" 2012 - swcodec="yes" 2013 1986 bootoutput="bootloader-$modelname.ipod" 2014 1987 # toolset is the tools within the tools directory that we build for 2015 1988 # this particular target. ··· 2032 2005 output="rockbox.ipod" 2033 2006 appextra="recorder:gui:radio" 2034 2007 plugins="yes" 2035 - swcodec="yes" 2036 2008 bootoutput="bootloader-$modelname.ipod" 2037 2009 # toolset is the tools within the tools directory that we build for 2038 2010 # this particular target. ··· 2059 2031 bootoutput="x5_fw.bin" 2060 2032 appextra="recorder:gui:radio" 2061 2033 plugins="yes" 2062 - swcodec="yes" 2063 2034 # toolset is the tools within the tools directory that we build for 2064 2035 # this particular target. 2065 2036 toolset="$iaudiobitmaptools" ··· 2085 2056 bootoutput="m5_fw.bin" 2086 2057 appextra="recorder:gui:radio" 2087 2058 plugins="yes" 2088 - swcodec="yes" 2089 2059 # toolset is the tools within the tools directory that we build for 2090 2060 # this particular target. 2091 2061 toolset="$iaudiobitmaptools" ··· 2108 2078 output="rockbox.iaudio" 2109 2079 appextra="recorder:gui:radio" 2110 2080 plugins="yes" 2111 - swcodec="yes" 2112 2081 bootoutput="I7_FW.BIN" 2113 2082 # toolset is the tools within the tools directory that we build for 2114 2083 # this particular target. ··· 2133 2102 bootoutput="bootloader-cowond2.bin" 2134 2103 appextra="recorder:gui:radio" 2135 2104 plugins="yes" 2136 - swcodec="yes" 2137 2105 toolset="$tccbitmaptools" 2138 2106 # architecture, manufacturer and model for the target-tree build 2139 2107 t_cpu="arm" ··· 2155 2123 bootoutput="cowon_m3.bin" 2156 2124 appextra="recorder:gui:radio" 2157 2125 plugins="yes" 2158 - swcodec="yes" 2159 2126 # toolset is the tools within the tools directory that we build for 2160 2127 # this particular target. 2161 2128 toolset="$iaudiobitmaptools" ··· 2177 2144 output="rockbox.gigabeat" 2178 2145 appextra="recorder:gui:radio" 2179 2146 plugins="yes" 2180 - swcodec="yes" 2181 2147 toolset=$gigabeatbitmaptools 2182 2148 boottool="$rootdir/tools/scramble -gigabeat" 2183 2149 bootoutput="FWIMG01.DAT" ··· 2199 2165 output="rockbox.gigabeat" 2200 2166 appextra="recorder:gui:radio" 2201 2167 plugins="yes" 2202 - swcodec="yes" 2203 2168 toolset="$gigabeatbitmaptools" 2204 2169 boottool="$rootdir/tools/scramble -gigabeats" 2205 2170 bootoutput="nk.bin" ··· 2223 2188 output="rockbox.mrobe500" 2224 2189 appextra="recorder:gui:radio" 2225 2190 plugins="yes" 2226 - swcodec="yes" 2227 2191 toolset=$gigabeatbitmaptools 2228 2192 boottool="cp " 2229 2193 bootoutput="rockbox.mrboot" ··· 2247 2211 output="rockbox.mi4" 2248 2212 appextra="recorder:gui:radio" 2249 2213 plugins="yes" 2250 - swcodec="yes" 2251 2214 boottool="$rootdir/tools/scramble -mi4v2 -model=m100 -type=RBBL" 2252 2215 bootoutput="pp5020.mi4" 2253 2216 # toolset is the tools within the tools directory that we build for ··· 2274 2237 output="rockbox.logik" 2275 2238 appextra="recorder:gui:radio" 2276 2239 plugins="" 2277 - swcodec="yes" 2278 2240 # toolset is the tools within the tools directory that we build for 2279 2241 # this particular target. 2280 2242 toolset=$tccbitmaptools ··· 2296 2258 bootoutput="bootloader-zenxfistyle.creative" 2297 2259 appextra="gui:recorder:radio" 2298 2260 plugins="yes" 2299 - swcodec="yes" 2300 2261 toolset=$scramblebitmaptools 2301 2262 t_cpu="arm" 2302 2263 t_manufacturer="imx233" ··· 2317 2278 output="rockbox.zvm" 2318 2279 appextra="recorder:gui:radio" 2319 2280 plugins="yes" 2320 - swcodec="yes" 2321 2281 toolset=$ipodbitmaptools 2322 2282 boottool="$rootdir/tools/scramble -creative=zvm -no-ciff" 2323 2283 bootoutput="rockbox.zvmboot" ··· 2340 2300 output="rockbox.zvm60" 2341 2301 appextra="recorder:gui:radio" 2342 2302 plugins="yes" 2343 - swcodec="yes" 2344 2303 toolset=$ipodbitmaptools 2345 2304 boottool="$rootdir/tools/scramble -creative=zvm60" 2346 2305 bootoutput="rockbox.zvm60boot" ··· 2363 2322 output="rockbox.zv" 2364 2323 appextra="recorder:gui:radio" 2365 2324 plugins="" 2366 - swcodec="yes" 2367 2325 toolset=$ipodbitmaptools 2368 2326 boottool="$rootdir/tools/scramble -creative=zenvision" 2369 2327 bootoutput="rockbox.zvboot" ··· 2385 2343 bootoutput="bootloader-zenxfi2.creative" 2386 2344 appextra="gui:recorder:radio" 2387 2345 plugins="yes" 2388 - swcodec="yes" 2389 2346 toolset=$scramblebitmaptools 2390 2347 t_cpu="arm" 2391 2348 t_manufacturer="imx233" ··· 2405 2362 bootoutput="bootloader-zenxfi3.creative" 2406 2363 appextra="gui:recorder:radio" 2407 2364 plugins="yes" 2408 - swcodec="yes" 2409 2365 toolset=$scramblebitmaptools 2410 2366 t_cpu="arm" 2411 2367 t_manufacturer="imx233" ··· 2425 2381 bootoutput="bootloader-zenv.creative" 2426 2382 appextra="radio:gui:recorder" 2427 2383 plugins="" 2428 - swcodec="yes" 2429 2384 toolset=$scramblebitmaptools 2430 2385 t_cpu="arm" 2431 2386 t_manufacturer="imx233" ··· 2445 2400 bootoutput="bootloader-zenxfi.creative" 2446 2401 appextra="gui:recorder:radio" 2447 2402 plugins="yes" 2448 - swcodec="yes" 2449 2403 toolset=$scramblebitmaptools 2450 2404 t_cpu="arm" 2451 2405 t_manufacturer="imx233" ··· 2465 2419 bootoutput="bootloader-zenmozaic.creative" 2466 2420 appextra="gui:recorder:radio" 2467 2421 plugins="yes" 2468 - swcodec="yes" 2469 2422 toolset=$scramblebitmaptools 2470 2423 t_cpu="arm" 2471 2424 t_manufacturer="imx233" ··· 2485 2438 bootoutput="bootloader-zen.creative" 2486 2439 appextra="gui:recorder:radio" 2487 2440 plugins="yes" 2488 - swcodec="yes" 2489 2441 toolset=$scramblebitmaptools 2490 2442 t_cpu="arm" 2491 2443 t_manufacturer="imx233" ··· 2506 2458 output="rockbox.mi4" 2507 2459 appextra="recorder:gui:radio" 2508 2460 plugins="yes" 2509 - swcodec="yes" 2510 2461 boottool="$rootdir/tools/scramble -mi4v3 -model=e200 -type=RBBL" 2511 2462 bootoutput="PP5022.mi4" 2512 2463 # toolset is the tools within the tools directory that we build for ··· 2534 2485 output="rockbox.mi4" 2535 2486 appextra="recorder:gui:radio" 2536 2487 plugins="yes" 2537 - swcodec="yes" 2538 2488 boottool="$rootdir/tools/scramble -mi4r -model=e20r -type=RBBL" 2539 2489 bootoutput="pp5022.mi4" 2540 2490 # toolset is the tools within the tools directory that we build for ··· 2559 2509 output="rockbox.mi4" 2560 2510 appextra="recorder:gui:radio" 2561 2511 plugins="yes" 2562 - swcodec="yes" 2563 2512 boottool="$rootdir/tools/scramble -mi4v3 -model=c200 -type=RBBL" 2564 2513 bootoutput="firmware.mi4" 2565 2514 # toolset is the tools within the tools directory that we build for ··· 2586 2535 output="rockbox.m200" 2587 2536 appextra="recorder:gui:radio" 2588 2537 plugins="" 2589 - swcodec="yes" 2590 2538 # toolset is the tools within the tools directory that we build for 2591 2539 # this particular target. 2592 2540 toolset=$tccbitmaptools ··· 2610 2558 output="rockbox.c100" 2611 2559 appextra="recorder:gui:radio" 2612 2560 plugins="" 2613 - swcodec="yes" 2614 2561 # toolset is the tools within the tools directory that we build for 2615 2562 # this particular target. 2616 2563 toolset=$tccbitmaptools ··· 2632 2579 bootoutput="bootloader-clip.sansa" 2633 2580 appextra="recorder:gui:radio" 2634 2581 plugins="yes" 2635 - swcodec="yes" 2636 2582 toolset=$scramblebitmaptools 2637 2583 t_cpu="arm" 2638 2584 t_manufacturer="as3525" ··· 2655 2601 bootoutput="bootloader-e200v2.sansa" 2656 2602 appextra="recorder:gui:radio" 2657 2603 plugins="yes" 2658 - swcodec="yes" 2659 2604 toolset=$scramblebitmaptools 2660 2605 t_cpu="arm" 2661 2606 t_manufacturer="as3525" ··· 2676 2621 bootoutput="bootloader-m200v4.sansa" 2677 2622 appextra="recorder:gui:radio" 2678 2623 plugins="yes" 2679 - swcodec="yes" 2680 2624 toolset=$scramblebitmaptools 2681 2625 t_cpu="arm" 2682 2626 t_manufacturer="as3525" ··· 2699 2643 bootoutput="bootloader-fuze.sansa" 2700 2644 appextra="recorder:gui:radio" 2701 2645 plugins="yes" 2702 - swcodec="yes" 2703 2646 toolset=$scramblebitmaptools 2704 2647 t_cpu="arm" 2705 2648 t_manufacturer="as3525" ··· 2720 2663 bootoutput="bootloader-c200v2.sansa" 2721 2664 appextra="recorder:gui:radio" 2722 2665 plugins="yes" 2723 - swcodec="yes" 2724 2666 # toolset is the tools within the tools directory that we build for 2725 2667 # this particular target. 2726 2668 toolset=$scramblebitmaptools ··· 2745 2687 bootoutput="bootloader-clipv2.sansa" 2746 2688 appextra="recorder:gui:radio" 2747 2689 plugins="yes" 2748 - swcodec="yes" 2749 2690 toolset=$scramblebitmaptools 2750 2691 t_cpu="arm" 2751 2692 t_manufacturer="as3525" ··· 2764 2705 output="rockbox.mi4" 2765 2706 appextra="gui" 2766 2707 plugins="" 2767 - swcodec="yes" 2768 2708 boottool="$rootdir/tools/scramble -mi4v3 -model=view -type=RBBL" 2769 2709 bootoutput="firmware.mi4" 2770 2710 # toolset is the tools within the tools directory that we build for ··· 2788 2728 bootoutput="bootloader-clipplus.sansa" 2789 2729 appextra="recorder:gui:radio" 2790 2730 plugins="yes" 2791 - swcodec="yes" 2792 2731 toolset=$scramblebitmaptools 2793 2732 t_cpu="arm" 2794 2733 t_manufacturer="as3525" ··· 2808 2747 bootoutput="bootloader-fuzev2.sansa" 2809 2748 appextra="recorder:gui:radio" 2810 2749 plugins="yes" 2811 - swcodec="yes" 2812 2750 toolset=$scramblebitmaptools 2813 2751 t_cpu="arm" 2814 2752 t_manufacturer="as3525" ··· 2828 2766 bootoutput="bootloader-fuzeplus.sansa" 2829 2767 appextra="gui:recorder:radio" 2830 2768 plugins="yes" 2831 - swcodec="yes" 2832 2769 toolset=$scramblebitmaptools 2833 2770 t_cpu="arm" 2834 2771 t_manufacturer="imx233" ··· 2848 2785 bootoutput="bootloader-clipzip.sansa" 2849 2786 appextra="recorder:gui:radio" 2850 2787 plugins="yes" 2851 - swcodec="yes" 2852 2788 toolset=$scramblebitmaptools 2853 2789 t_cpu="arm" 2854 2790 t_manufacturer="as3525" ··· 2868 2804 bootoutput="bootloader-connect.sansa" 2869 2805 appextra="recorder:gui" 2870 2806 plugins="yes" 2871 - swcodec="yes" 2872 2807 toolset=$scramblebitmaptools 2873 2808 t_cpu="arm" 2874 2809 t_manufacturer="tms320dm320" ··· 2888 2823 output="rockbox.elio" 2889 2824 appextra="recorder:gui:radio" 2890 2825 plugins="yes" 2891 - swcodec="yes" 2892 2826 boottool="$rootdir/tools/scramble -mi4v2" 2893 2827 bootoutput="pp5020.mi4" 2894 2828 # toolset is the tools within the tools directory that we build for ··· 2913 2847 output="rockbox.mi4" 2914 2848 appextra="recorder:gui:radio" 2915 2849 plugins="yes" 2916 - swcodec="yes" 2917 2850 boottool="$rootdir/tools/scramble -mi4v3 -model=9200 -type=RBBL" 2918 2851 bootoutput="FWImage.ebn" 2919 2852 # toolset is the tools within the tools directory that we build for ··· 2938 2871 output="rockbox.mi4" 2939 2872 appextra="recorder:gui:radio" 2940 2873 plugins="yes" 2941 - swcodec="yes" 2942 2874 boottool="$rootdir/tools/scramble -mi4v3 -model=1630 -type=RBBL" 2943 2875 bootoutput="FWImage.ebn" 2944 2876 # toolset is the tools within the tools directory that we build for ··· 2963 2895 output="rockbox.mi4" 2964 2896 appextra="recorder:gui:radio" 2965 2897 plugins="yes" 2966 - swcodec="yes" 2967 2898 boottool="$rootdir/tools/scramble -mi4v3 -model=6330 -type=RBBL" 2968 2899 bootoutput="FWImage.ebn" 2969 2900 # toolset is the tools within the tools directory that we build for ··· 2988 2919 output="rockbox.meizu" 2989 2920 appextra="recorder:gui:radio" 2990 2921 plugins="no" #FIXME 2991 - swcodec="yes" 2992 2922 toolset=$genericbitmaptools 2993 2923 boottool="cp" 2994 2924 bootoutput="rockboot.ebn" ··· 3010 2940 output="rockbox.meizu" 3011 2941 appextra="recorder:gui:radio" 3012 2942 plugins="no" #FIXME 3013 - swcodec="yes" 3014 2943 toolset=$genericbitmaptools 3015 2944 boottool="cp" 3016 2945 bootoutput="rockboot.ebn" ··· 3032 2961 output="rockbox.meizu" 3033 2962 appextra="recorder:gui:radio" 3034 2963 plugins="no" #FIXME 3035 - swcodec="yes" 3036 2964 toolset=$genericbitmaptools 3037 2965 boottool="cp" 3038 2966 bootoutput="rockboot.ebn" ··· 3054 2982 output="rockbox.vx747" 3055 2983 appextra="recorder:gui:radio" 3056 2984 plugins="yes" 3057 - swcodec="yes" 3058 2985 toolset=$genericbitmaptools 3059 2986 boottool="$rootdir/tools/scramble -ccpmp" 3060 2987 bootoutput="ccpmp.bin" ··· 3076 3003 output="rockbox.vx767" 3077 3004 appextra="recorder:gui:radio" 3078 3005 plugins="" #FIXME 3079 - swcodec="yes" 3080 3006 toolset=$genericbitmaptools 3081 3007 boottool="$rootdir/tools/scramble -ccpmp" 3082 3008 bootoutput="ccpmp.bin" ··· 3098 3024 output="rockbox.vx747p" 3099 3025 appextra="recorder:gui:radio" 3100 3026 plugins="yes" 3101 - swcodec="yes" 3102 3027 toolset=$genericbitmaptools 3103 3028 boottool="$rootdir/tools/scramble -ccpmp" 3104 3029 bootoutput="ccpmp.bin" ··· 3120 3045 output="rockbox.vx777" 3121 3046 appextra="recorder:gui:radio" 3122 3047 plugins="yes" 3123 - swcodec="yes" 3124 3048 toolset=$genericbitmaptools 3125 3049 boottool="$rootdir/tools/scramble -ccpmp" 3126 3050 bootoutput="ccpmp.bin" ··· 3142 3066 output="rockbox.lyre" 3143 3067 appextra="recorder:gui:radio" 3144 3068 plugins="" 3145 - swcodec="yes" 3146 3069 toolset=$scramblebitmaptools 3147 3070 boottool="cp" 3148 3071 bootoutput="bootloader-proto1.lyre" ··· 3164 3087 output="rockbox.mini2440" 3165 3088 appextra="recorder:gui:radio" 3166 3089 plugins="" 3167 - swcodec="yes" 3168 3090 toolset=$scramblebitmaptools 3169 3091 boottool="cp" 3170 3092 bootoutput="bootloader-mini2440.lyre" ··· 3186 3108 output="rockbox.mi4" 3187 3109 appextra="recorder:gui:radio" 3188 3110 plugins="yes" 3189 - swcodec="yes" 3190 3111 boottool="$rootdir/tools/scramble -mi4v2 -model=y820 -type=RBBL" 3191 3112 bootoutput="FW_YH820.mi4" 3192 3113 # toolset is the tools within the tools directory that we build for ··· 3211 3132 output="rockbox.mi4" 3212 3133 appextra="recorder:gui:radio" 3213 3134 plugins="yes" 3214 - swcodec="yes" 3215 3135 boottool="$rootdir/tools/scramble -mi4v2 -model=y920 -type=RBBL" 3216 3136 bootoutput="PP5020.mi4" 3217 3137 # toolset is the tools within the tools directory that we build for ··· 3236 3156 output="rockbox.mi4" 3237 3157 appextra="recorder:gui:radio" 3238 3158 plugins="yes" 3239 - swcodec="yes" 3240 3159 boottool="$rootdir/tools/scramble -mi4v2 -model=y925 -type=RBBL" 3241 3160 bootoutput="FW_YH925.mi4" 3242 3161 # toolset is the tools within the tools directory that we build for ··· 3261 3180 output="rockbox.yps3" 3262 3181 appextra="recorder:gui:radio" 3263 3182 plugins="no" #FIXME 3264 - swcodec="yes" 3265 3183 toolset=$genericbitmaptools 3266 3184 boottool="cp" 3267 3185 bootoutput="rockboot.ebn" ··· 3283 3201 bootoutput="bootloader-ypz5.samsung" 3284 3202 appextra="gui:recorder:radio" 3285 3203 plugins="" 3286 - swcodec="yes" 3287 3204 toolset=$scramblebitmaptools 3288 3205 t_cpu="arm" 3289 3206 t_manufacturer="imx233" ··· 3303 3220 output="rockbox.mi4" 3304 3221 appextra="recorder:gui:radio" 3305 3222 plugins="yes" 3306 - swcodec="yes" 3307 3223 boottool="$rootdir/tools/scramble -mi4v3 -model=v500 -type=RBBL" 3308 3224 bootoutput="jukebox.mi4" 3309 3225 # toolset is the tools within the tools directory that we build for ··· 3329 3245 bootoutput="bootloader.mpio" 3330 3246 appextra="recorder:gui:radio" 3331 3247 plugins="yes" 3332 - swcodec="yes" 3333 3248 # toolset is the tools within the tools directory that we build for 3334 3249 # this particular target. 3335 3250 toolset="$genericbitmaptools" ··· 3352 3267 bootoutput="bootloader.mpio" 3353 3268 appextra="recorder:gui:radio" 3354 3269 plugins="yes" 3355 - swcodec="yes" 3356 3270 # toolset is the tools within the tools directory that we build for 3357 3271 # this particular target. 3358 3272 toolset="$genericbitmaptools" ··· 3375 3289 bootoutput="bootloader.rkw" 3376 3290 appextra="recorder:gui:radio" 3377 3291 plugins="" 3378 - swcodec="yes" 3379 3292 # toolset is the tools within the tools directory that we build for 3380 3293 # this particular target. 3381 3294 toolset="$genericbitmaptools" ··· 3398 3311 bootoutput="bootloader.rkw" 3399 3312 appextra="recorder:gui" 3400 3313 plugins="yes" 3401 - swcodec="yes" 3402 3314 # toolset is the tools within the tools directory that we build for 3403 3315 # this particular target. 3404 3316 toolset="$genericbitmaptools" ··· 3421 3333 bootoutput="bootloader.rkw" 3422 3334 appextra="recorder:gui" 3423 3335 plugins="yes" 3424 - swcodec="yes" 3425 3336 # toolset is the tools within the tools directory that we build for 3426 3337 # this particular target. 3427 3338 toolset="$genericbitmaptools" ··· 3449 3360 bootoutput="rockbox" 3450 3361 appextra="recorder:gui:radio" 3451 3362 plugins="yes" 3452 - swcodec="yes" 3453 3363 # architecture, manufacturer and model for the target-tree build 3454 3364 t_cpu="hosted" 3455 3365 t_manufacturer="sdl" ··· 3477 3387 bootoutput="librockbox.so" 3478 3388 appextra="recorder:gui:radio:hosted/android" 3479 3389 plugins="yes" 3480 - swcodec="yes" 3481 3390 # architecture, manufacturer and model for the target-tree build 3482 3391 t_cpu="hosted" 3483 3392 t_manufacturer="android" ··· 3504 3413 bootoutput="rockbox" 3505 3414 appextra="recorder:gui:radio" 3506 3415 plugins="yes" 3507 - swcodec="yes" 3508 3416 # architecture, manufacturer and model for the target-tree build 3509 3417 t_cpu="hosted" 3510 3418 t_manufacturer="maemo" ··· 3531 3439 bootoutput="rockbox" 3532 3440 appextra="recorder:gui:radio" 3533 3441 plugins="yes" 3534 - swcodec="yes" 3535 3442 # architecture, manufacturer and model for the target-tree build 3536 3443 t_cpu="hosted" 3537 3444 t_manufacturer="maemo" ··· 3558 3465 bootoutput="rockbox" 3559 3466 appextra="recorder:gui:radio" 3560 3467 plugins="yes" 3561 - swcodec="yes" 3562 3468 # architecture, manufacturer and model for the target-tree build 3563 3469 t_cpu="hosted" 3564 3470 t_manufacturer="pandora" ··· 3581 3487 bootoutput="rockbox" 3582 3488 appextra="recorder:gui:radio" 3583 3489 plugins="yes" 3584 - swcodec="yes" 3585 3490 # architecture, manufacturer and model for the target-tree build 3586 3491 t_cpu="hosted" 3587 3492 t_manufacturer="samsungypr" ··· 3609 3514 bootoutput="librockbox.so" 3610 3515 appextra="recorder:gui:radio:hosted/android" 3611 3516 plugins="yes" 3612 - swcodec="yes" 3613 3517 # architecture, manufacturer and model for the target-tree build 3614 3518 t_cpu="hosted" 3615 3519 t_manufacturer="android" ··· 3637 3541 bootoutput="librockbox.so" 3638 3542 appextra="recorder:gui:radio:hosted/android" 3639 3543 plugins="yes" 3640 - swcodec="yes" 3641 3544 # architecture, manufacturer and model for the target-tree build 3642 3545 t_cpu="hosted" 3643 3546 t_manufacturer="android" ··· 3661 3564 bootoutput="rockbox" 3662 3565 appextra="recorder:gui:radio" 3663 3566 plugins="yes" 3664 - swcodec="yes" 3665 3567 # architecture, manufacturer and model for the target-tree build 3666 3568 t_cpu="hosted" 3667 3569 t_manufacturer="samsungypr" ··· 3681 3583 bootoutput="bootloader.rkw" 3682 3584 appextra="recorder:gui" 3683 3585 plugins="" 3684 - swcodec="yes" 3685 3586 # toolset is the tools within the tools directory that we build for 3686 3587 # this particular target. 3687 3588 toolset="$genericbitmaptools" ··· 3704 3605 bootoutput="bootloader.rkw" 3705 3606 appextra="recorder:gui" 3706 3607 plugins="" 3707 - swcodec="yes" 3708 3608 # toolset is the tools within the tools directory that we build for 3709 3609 # this particular target. 3710 3610 toolset="$genericbitmaptools" ··· 3727 3627 bootoutput="bootloader.rkw" 3728 3628 appextra="recorder:gui" 3729 3629 plugins="" 3730 - swcodec="yes" 3731 3630 # toolset is the tools within the tools directory that we build for 3732 3631 # this particular target. 3733 3632 toolset="$genericbitmaptools" ··· 3750 3649 bootoutput="bootloader.rkw" 3751 3650 appextra="recorder:gui" 3752 3651 plugins="" 3753 - swcodec="yes" 3754 3652 # toolset is the tools within the tools directory that we build for 3755 3653 # this particular target. 3756 3654 toolset="$genericbitmaptools" ··· 3774 3672 bootoutput="bootloader-nwze350.sony" 3775 3673 appextra="gui:recorder:radio" 3776 3674 plugins="yes" 3777 - swcodec="yes" 3778 3675 toolset=$genericbitmaptools 3779 3676 t_cpu="hosted" 3780 3677 t_manufacturer="sonynwz" ··· 3795 3692 bootoutput="bootloader-nwze370.sony" 3796 3693 appextra="gui:recorder:radio" 3797 3694 plugins="yes" 3798 - swcodec="yes" 3799 3695 toolset=$scramblebitmaptools 3800 3696 t_cpu="arm" 3801 3697 t_manufacturer="imx233" ··· 3815 3711 bootoutput="bootloader-nwze360.sony" 3816 3712 appextra="gui:recorder:radio" 3817 3713 plugins="yes" 3818 - swcodec="yes" 3819 3714 toolset=$scramblebitmaptools 3820 3715 t_cpu="arm" 3821 3716 t_manufacturer="imx233" ··· 3837 3732 bootoutput="bootloader-nwze450.sony" 3838 3733 appextra="gui:recorder:radio" 3839 3734 plugins="yes" 3840 - swcodec="yes" 3841 3735 toolset=$genericbitmaptools 3842 3736 t_cpu="hosted" 3843 3737 t_manufacturer="sonynwz" ··· 3860 3754 bootoutput="bootloader-nwze460.sony" 3861 3755 appextra="gui:recorder:radio" 3862 3756 plugins="yes" 3863 - swcodec="yes" 3864 3757 toolset=$genericbitmaptools 3865 3758 t_cpu="hosted" 3866 3759 t_manufacturer="sonynwz" ··· 3883 3776 bootoutput="bootloader-nwze470.sony" 3884 3777 appextra="gui:recorder:radio" 3885 3778 plugins="yes" 3886 - swcodec="yes" 3887 3779 toolset=$genericbitmaptools 3888 3780 t_cpu="hosted" 3889 3781 t_manufacturer="sonynwz" ··· 3906 3798 bootoutput="bootloader-nwze580.sony" 3907 3799 appextra="gui:recorder:radio" 3908 3800 plugins="yes" 3909 - swcodec="yes" 3910 3801 toolset=$genericbitmaptools 3911 3802 t_cpu="hosted" 3912 3803 t_manufacturer="sonynwz" ··· 3929 3820 bootoutput="bootloader-nwza10.sony" 3930 3821 appextra="gui:recorder:radio" 3931 3822 plugins="yes" 3932 - swcodec="yes" 3933 3823 toolset=$genericbitmaptools 3934 3824 t_cpu="hosted" 3935 3825 t_manufacturer="sonynwz" ··· 3952 3842 bootoutput="bootloader-nwa20.sony" 3953 3843 appextra="gui:recorder:radio" 3954 3844 plugins="yes" 3955 - swcodec="yes" 3956 3845 toolset=$genericbitmaptools 3957 3846 t_cpu="hosted" 3958 3847 t_manufacturer="sonynwz" ··· 3975 3864 bootoutput="bootloader-nwza860.sony" 3976 3865 appextra="gui:recorder:radio" 3977 3866 plugins="" 3978 - swcodec="yes" 3979 3867 toolset=$genericbitmaptools 3980 3868 t_cpu="hosted" 3981 3869 t_manufacturer="sonynwz" ··· 3998 3886 bootoutput="bootloader-nwzs750.sony" 3999 3887 appextra="gui:recorder:radio" 4000 3888 plugins="yes" 4001 - swcodec="yes" 4002 3889 toolset=$genericbitmaptools 4003 3890 t_cpu="hosted" 4004 3891 t_manufacturer="sonynwz" ··· 4020 3907 bootoutput="bootloader.rkw" 4021 3908 appextra="recorder:gui" 4022 3909 plugins="" 4023 - swcodec="yes" 4024 3910 # toolset is the tools within the tools directory that we build for 4025 3911 # this particular target. 4026 3912 toolset="$genericbitmaptools" ··· 4043 3929 bootoutput="bootloader.rkw" 4044 3930 appextra="recorder:gui" 4045 3931 plugins="" 4046 - swcodec="yes" 4047 3932 # toolset is the tools within the tools directory that we build for 4048 3933 # this particular target. 4049 3934 toolset="$genericbitmaptools" ··· 4072 3957 bootoutput="rockbox" 4073 3958 appextra="recorder:gui:hosted" 4074 3959 plugins="yes" 4075 - swcodec="yes" 4076 3960 # architecture, manufacturer and model for the target-tree build 4077 3961 t_cpu="hosted" 4078 3962 t_manufacturer="ibasso" ··· 4097 3981 bootoutput="rockbox" 4098 3982 appextra="recorder:gui:hosted" 4099 3983 plugins="yes" 4100 - swcodec="yes" 4101 3984 # architecture, manufacturer and model for the target-tree build 4102 3985 t_cpu="hosted" 4103 3986 t_manufacturer="ibasso" ··· 4119 4002 bootoutput="bootloader.rocker" 4120 4003 appextra="recorder:gui:hosted" 4121 4004 plugins="yes" 4122 - swcodec="yes" 4123 4005 # architecture, manufacturer and model for the target-tree build 4124 4006 t_cpu="hosted" 4125 4007 t_manufacturer="agptek" ··· 4139 4021 output="rockbox.x3" 4140 4022 appextra="recorder:gui:radio" 4141 4023 plugins="yes" 4142 - swcodec="yes" 4143 4024 toolset=$genericbitmaptools 4144 4025 boottool="cp" 4145 4026 bootoutput="bootloader-x3.bin" ··· 4165 4046 bootoutput="bootloader.x3ii" 4166 4047 appextra="recorder:gui:hosted" 4167 4048 plugins="yes" 4168 - swcodec="yes" 4169 4049 # architecture, manufacturer and model for the target-tree build 4170 4050 t_cpu="hosted" 4171 4051 t_manufacturer="xduoo" ··· 4188 4068 bootoutput="bootloader.x20" 4189 4069 appextra="recorder:gui:hosted" 4190 4070 plugins="yes" 4191 - swcodec="yes" 4192 4071 # architecture, manufacturer and model for the target-tree build 4193 4072 t_cpu="hosted" 4194 4073 t_manufacturer="xduoo" ··· 4208 4087 bootoutput="bootloader.rkw" 4209 4088 appextra="recorder:gui" 4210 4089 plugins="yes" 4211 - swcodec="yes" 4212 4090 # toolset is the tools within the tools directory that we build for 4213 4091 # this particular target. 4214 4092 toolset="$genericbitmaptools" ··· 4231 4109 bootoutput="bootloader.rkw" 4232 4110 appextra="recorder:gui" 4233 4111 plugins="yes" 4234 - swcodec="yes" 4235 4112 # toolset is the tools within the tools directory that we build for 4236 4113 # this particular target. 4237 4114 toolset="$genericbitmaptools" ··· 4254 4131 bootoutput="bootloader.rkw" 4255 4132 appextra="recorder:gui" 4256 4133 plugins="yes" 4257 - swcodec="yes" 4258 4134 # toolset is the tools within the tools directory that we build for 4259 4135 # this particular target. 4260 4136 toolset="$genericbitmaptools" ··· 4793 4669 GCCOPTS="$GCCOPTS" 4794 4670 fi 4795 4671 4796 - if test "$swcodec" = "yes"; then 4797 - voicetoolset="rbspeexenc voicefont wavtrim" 4798 - else 4799 - voicetoolset="voicefont wavtrim" 4800 - fi 4672 + voicetoolset="rbspeexenc voicefont wavtrim" 4801 4673 4802 4674 if test "$apps" = "apps"; then 4803 4675 # only when we build "real" apps we build the .lng files ··· 4853 4725 export BINARY=${output} 4854 4726 export APPEXTRA=${appextra} 4855 4727 export ENABLEDPLUGINS=${plugins} 4856 - export SOFTWARECODECS=${swcodec} 4857 4728 export EXTRA_DEFINES=${extradefines} 4858 4729 export HOSTCC=${HOSTCC} 4859 4730 export HOSTAR=${HOSTAR}
-6
tools/database/SOURCES
··· 20 20 #else /* !APPLICATION */ 21 21 ../../uisimulator/common/filesystem-sim.c 22 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 23 /* Caution. metadata files do not add!! */
+1 -3
tools/database/database.make
··· 38 38 -I$(ROOTDIR)/lib/rbcodec/dsp \ 39 39 -I$(APPSDIR) \ 40 40 -I$(BUILDDIR) 41 - 42 - ifdef SOFTWARECODECS 41 + 43 42 OTHERLIBS := $(FIXEDPOINTLIB) 44 - endif 45 43 46 44 .SECONDEXPANSION: # $$(OBJ) is not populated until after this 47 45
-69
uisimulator/common/stubs.c
··· 35 35 36 36 static bool storage_spinning = false; 37 37 38 - #if CONFIG_CODEC != SWCODEC 39 - #include "mp3_playback.h" 40 - 41 - void 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 - 50 - static bool paused; /* playback is paused */ 51 - static bool playing; /* We are playing an MP3 stream */ 52 - 53 - bool audio_is_initialized = false; 54 - 55 - void 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 - 81 - void mp3_play_pause(bool play) 82 - { 83 - (void)play; 84 - } 85 - 86 - void mp3_play_stop(void) 87 - { 88 - } 89 - 90 - unsigned char* mp3_get_pos(void) 91 - { 92 - return NULL; 93 - } 94 - 95 - void 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 - 101 - void mp3_shutdown(void) 102 - { 103 - } 104 - 105 - #endif /* CODEC != SWCODEC */ 106 - 107 38 int fat_startsector(void) 108 39 { 109 40 return 63;