diff options
author | Solomon Peachy <pizza@shaftnet.org> | 2020-07-15 19:40:55 -0400 |
---|---|---|
committer | Solomon Peachy <pizza@shaftnet.org> | 2020-07-24 21:20:13 +0000 |
commit | 092c340a2062fa98b7387fc5fd63578ddae7d0b6 (patch) | |
tree | 98ec96946eeb2ae709cb0528cc6998e21bb9b290 /apps/recorder/recording.c | |
parent | 17f7cc92c258bc456a27c3e7c5a19c9409851879 (diff) | |
download | rockbox-092c340a2062fa98b7387fc5fd63578ddae7d0b6.tar.gz rockbox-092c340a2062fa98b7387fc5fd63578ddae7d0b6.zip |
[1/4] Remove SH support and all archos targets
This removes all code specific to SH targets
Change-Id: I7980523785d2596e65c06430f4638eec74a06061
Diffstat (limited to 'apps/recorder/recording.c')
-rw-r--r-- | apps/recorder/recording.c | 286 |
1 files changed, 0 insertions, 286 deletions
diff --git a/apps/recorder/recording.c b/apps/recorder/recording.c index b67436839c..553f815e52 100644 --- a/apps/recorder/recording.c +++ b/apps/recorder/recording.c | |||
@@ -145,11 +145,6 @@ bool in_recording_screen(void) | |||
145 | return (rec_status & RCSTAT_IN_RECSCREEN) != 0; | 145 | return (rec_status & RCSTAT_IN_RECSCREEN) != 0; |
146 | } | 146 | } |
147 | 147 | ||
148 | #if CONFIG_KEYPAD == RECORDER_PAD | ||
149 | static bool f2_rec_screen(void); | ||
150 | static bool f3_rec_screen(void); | ||
151 | #endif | ||
152 | |||
153 | #define MAX_FILE_SIZE 0x7F800000 /* 2 GB - 4 MB */ | 148 | #define MAX_FILE_SIZE 0x7F800000 /* 2 GB - 4 MB */ |
154 | 149 | ||
155 | #ifndef HAVE_REMOTE_LCD | 150 | #ifndef HAVE_REMOTE_LCD |
@@ -1574,47 +1569,6 @@ bool recording_screen(bool no_source) | |||
1574 | } | 1569 | } |
1575 | break; | 1570 | break; |
1576 | 1571 | ||
1577 | #if CONFIG_KEYPAD == RECORDER_PAD | ||
1578 | case ACTION_REC_F2: | ||
1579 | if(audio_stat != AUDIO_STATUS_RECORD) | ||
1580 | { | ||
1581 | #if (CONFIG_LED == LED_REAL) | ||
1582 | /* led is restored at begin of loop / end of function */ | ||
1583 | led(false); | ||
1584 | #endif | ||
1585 | if (f2_rec_screen()) | ||
1586 | { | ||
1587 | rec_status |= RCSTAT_HAVE_RECORDED; | ||
1588 | done = true; | ||
1589 | } | ||
1590 | else | ||
1591 | update_countdown = 0; /* Update immediately */ | ||
1592 | } | ||
1593 | break; | ||
1594 | |||
1595 | case ACTION_REC_F3: | ||
1596 | if(audio_stat & AUDIO_STATUS_RECORD) | ||
1597 | { | ||
1598 | rec_command(RECORDING_CMD_START_NEWFILE); | ||
1599 | last_seconds = 0; | ||
1600 | } | ||
1601 | else | ||
1602 | { | ||
1603 | #if (CONFIG_LED == LED_REAL) | ||
1604 | /* led is restored at begin of loop / end of function */ | ||
1605 | led(false); | ||
1606 | #endif | ||
1607 | if (f3_rec_screen()) | ||
1608 | { | ||
1609 | rec_status |= RCSTAT_HAVE_RECORDED; | ||
1610 | done = true; | ||
1611 | } | ||
1612 | else | ||
1613 | update_countdown = 0; /* Update immediately */ | ||
1614 | } | ||
1615 | break; | ||
1616 | #endif /* CONFIG_KEYPAD == RECORDER_PAD */ | ||
1617 | |||
1618 | case SYS_POWEROFF: | 1572 | case SYS_POWEROFF: |
1619 | default_event_handler(SYS_POWEROFF); | 1573 | default_event_handler(SYS_POWEROFF); |
1620 | done = true; | 1574 | done = true; |
@@ -1941,246 +1895,6 @@ rec_abort: | |||
1941 | return (rec_status & RCSTAT_BEEN_IN_USB_MODE) != 0; | 1895 | return (rec_status & RCSTAT_BEEN_IN_USB_MODE) != 0; |
1942 | } /* recording_screen */ | 1896 | } /* recording_screen */ |
1943 | 1897 | ||
1944 | #if CONFIG_KEYPAD == RECORDER_PAD | ||
1945 | static bool f2_rec_screen(void) | ||
1946 | { | ||
1947 | static const char* const freq_str[6] = | ||
1948 | { | ||
1949 | "44.1kHz", | ||
1950 | "48kHz", | ||
1951 | "32kHz", | ||
1952 | "22.05kHz", | ||
1953 | "24kHz", | ||
1954 | "16kHz" | ||
1955 | }; | ||
1956 | |||
1957 | bool exit = false; | ||
1958 | bool used = false; | ||
1959 | int w, h; | ||
1960 | char buf[32]; | ||
1961 | int button; | ||
1962 | struct audio_recording_options rec_options; | ||
1963 | |||
1964 | FOR_NB_SCREENS(i) | ||
1965 | { | ||
1966 | screens[i].set_viewport(NULL); | ||
1967 | screens[i].setfont(FONT_SYSFIXED); | ||
1968 | screens[i].getstringsize("A",&w,&h); | ||
1969 | } | ||
1970 | |||
1971 | while (!exit) { | ||
1972 | const char* ptr; | ||
1973 | |||
1974 | FOR_NB_SCREENS(i) | ||
1975 | { | ||
1976 | screens[i].clear_display(); | ||
1977 | |||
1978 | /* Recording quality */ | ||
1979 | screens[i].putsxy(0, LCD_HEIGHT/2 - h*2, | ||
1980 | str(LANG_SYSFONT_RECORDING_QUALITY)); | ||
1981 | } | ||
1982 | |||
1983 | snprintf(buf, sizeof(buf), "%d", global_settings.rec_quality); | ||
1984 | FOR_NB_SCREENS(i) | ||
1985 | { | ||
1986 | screens[i].putsxy(0, LCD_HEIGHT/2-h, buf); | ||
1987 | screens[i].mono_bitmap(bitmap_icons_7x8[Icon_FastBackward], | ||
1988 | LCD_WIDTH/2 - 16, LCD_HEIGHT/2 - 4, 7, 8); | ||
1989 | } | ||
1990 | |||
1991 | /* Frequency */ | ||
1992 | snprintf(buf, sizeof buf, "%s:", str(LANG_SYSFONT_RECORDING_FREQUENCY)); | ||
1993 | ptr = freq_str[global_settings.rec_frequency]; | ||
1994 | FOR_NB_SCREENS(i) | ||
1995 | { | ||
1996 | screens[i].getstringsize(buf,&w,&h); | ||
1997 | screens[i].putsxy((LCD_WIDTH-w)/2, LCD_HEIGHT - h*2, buf); | ||
1998 | screens[i].getstringsize(ptr, &w, &h); | ||
1999 | screens[i].putsxy((LCD_WIDTH-w)/2, LCD_HEIGHT - h, ptr); | ||
2000 | screens[i].mono_bitmap(bitmap_icons_7x8[Icon_DownArrow], | ||
2001 | LCD_WIDTH/2 - 3, LCD_HEIGHT - h*3, 7, 8); | ||
2002 | } | ||
2003 | |||
2004 | /* Channel mode */ | ||
2005 | switch ( global_settings.rec_channels ) { | ||
2006 | case 0: | ||
2007 | ptr = str(LANG_SYSFONT_CHANNEL_STEREO); | ||
2008 | break; | ||
2009 | |||
2010 | case 1: | ||
2011 | ptr = str(LANG_SYSFONT_CHANNEL_MONO); | ||
2012 | break; | ||
2013 | } | ||
2014 | |||
2015 | FOR_NB_SCREENS(i) | ||
2016 | { | ||
2017 | screens[i].getstringsize(str(LANG_SYSFONT_CHANNELS), &w, &h); | ||
2018 | screens[i].putsxy(LCD_WIDTH - w, LCD_HEIGHT/2 - h*2, | ||
2019 | str(LANG_SYSFONT_CHANNELS)); | ||
2020 | screens[i].getstringsize(str(LANG_SYSFONT_MODE), &w, &h); | ||
2021 | screens[i].putsxy(LCD_WIDTH - w, LCD_HEIGHT/2 - h, | ||
2022 | str(LANG_SYSFONT_MODE)); | ||
2023 | screens[i].getstringsize(ptr, &w, &h); | ||
2024 | screens[i].putsxy(LCD_WIDTH - w, LCD_HEIGHT/2, ptr); | ||
2025 | screens[i].mono_bitmap(bitmap_icons_7x8[Icon_FastForward], | ||
2026 | LCD_WIDTH/2 + 8, LCD_HEIGHT/2 - 4, 7, 8); | ||
2027 | |||
2028 | screens[i].update(); | ||
2029 | } | ||
2030 | |||
2031 | button = button_get(true); | ||
2032 | switch (button) { | ||
2033 | case BUTTON_LEFT: | ||
2034 | case BUTTON_F2 | BUTTON_LEFT: | ||
2035 | global_settings.rec_quality++; | ||
2036 | if(global_settings.rec_quality > 7) | ||
2037 | global_settings.rec_quality = 0; | ||
2038 | used = true; | ||
2039 | break; | ||
2040 | |||
2041 | case BUTTON_DOWN: | ||
2042 | case BUTTON_F2 | BUTTON_DOWN: | ||
2043 | global_settings.rec_frequency++; | ||
2044 | if(global_settings.rec_frequency > 5) | ||
2045 | global_settings.rec_frequency = 0; | ||
2046 | used = true; | ||
2047 | break; | ||
2048 | |||
2049 | case BUTTON_RIGHT: | ||
2050 | case BUTTON_F2 | BUTTON_RIGHT: | ||
2051 | global_settings.rec_channels++; | ||
2052 | if(global_settings.rec_channels > 1) | ||
2053 | global_settings.rec_channels = 0; | ||
2054 | used = true; | ||
2055 | break; | ||
2056 | |||
2057 | case BUTTON_F2 | BUTTON_REL: | ||
2058 | if ( used ) | ||
2059 | exit = true; | ||
2060 | used = true; | ||
2061 | break; | ||
2062 | |||
2063 | case BUTTON_F2 | BUTTON_REPEAT: | ||
2064 | used = true; | ||
2065 | break; | ||
2066 | |||
2067 | default: | ||
2068 | if(default_event_handler(button) == SYS_USB_CONNECTED) | ||
2069 | return true; | ||
2070 | break; | ||
2071 | } | ||
2072 | } | ||
2073 | |||
2074 | rec_init_recording_options(&rec_options); | ||
2075 | rec_set_recording_options(&rec_options); | ||
2076 | |||
2077 | set_gain(); | ||
2078 | |||
2079 | settings_save(); | ||
2080 | FOR_NB_SCREENS(i) | ||
2081 | screens[i].setfont(FONT_UI); | ||
2082 | |||
2083 | return false; | ||
2084 | } | ||
2085 | |||
2086 | static bool f3_rec_screen(void) | ||
2087 | { | ||
2088 | bool exit = false; | ||
2089 | bool used = false; | ||
2090 | int w, h; | ||
2091 | int button; | ||
2092 | const char *src_str[] = | ||
2093 | { | ||
2094 | str(LANG_SYSFONT_RECORDING_SRC_MIC), | ||
2095 | str(LANG_SYSFONT_LINE_IN), | ||
2096 | str(LANG_SYSFONT_RECORDING_SRC_DIGITAL) | ||
2097 | }; | ||
2098 | struct audio_recording_options rec_options; | ||
2099 | |||
2100 | FOR_NB_SCREENS(i) | ||
2101 | { | ||
2102 | screens[i].set_viewport(NULL); | ||
2103 | screens[i].setfont(FONT_SYSFIXED); | ||
2104 | screens[i].getstringsize("A",&w,&h); | ||
2105 | } | ||
2106 | |||
2107 | while (!exit) { | ||
2108 | const char* ptr = src_str[global_settings.rec_source]; | ||
2109 | FOR_NB_SCREENS(i) | ||
2110 | { | ||
2111 | screens[i].clear_display(); | ||
2112 | |||
2113 | /* Recording source */ | ||
2114 | screens[i].putsxy(0, LCD_HEIGHT/2 - h*2, | ||
2115 | str(LANG_SYSFONT_RECORDING_SOURCE)); | ||
2116 | |||
2117 | screens[i].getstringsize(ptr, &w, &h); | ||
2118 | screens[i].putsxy(0, LCD_HEIGHT/2-h, ptr); | ||
2119 | screens[i].mono_bitmap(bitmap_icons_7x8[Icon_FastBackward], | ||
2120 | LCD_WIDTH/2 - 16, LCD_HEIGHT/2 - 4, 7, 8); | ||
2121 | } | ||
2122 | |||
2123 | /* trigger setup */ | ||
2124 | ptr = str(LANG_SYSFONT_RECORD_TRIGGER); | ||
2125 | FOR_NB_SCREENS(i) | ||
2126 | { | ||
2127 | screens[i].getstringsize(ptr,&w,&h); | ||
2128 | screens[i].putsxy((LCD_WIDTH-w)/2, LCD_HEIGHT - h*2, ptr); | ||
2129 | screens[i].mono_bitmap(bitmap_icons_7x8[Icon_DownArrow], | ||
2130 | LCD_WIDTH/2 - 3, LCD_HEIGHT - h*3, 7, 8); | ||
2131 | |||
2132 | screens[i].update(); | ||
2133 | } | ||
2134 | |||
2135 | button = button_get(true); | ||
2136 | switch (button) { | ||
2137 | case BUTTON_DOWN: | ||
2138 | case BUTTON_F3 | BUTTON_DOWN: | ||
2139 | #ifndef SIMULATOR | ||
2140 | rectrigger(); | ||
2141 | settings_apply_trigger(); | ||
2142 | #endif | ||
2143 | exit = true; | ||
2144 | break; | ||
2145 | |||
2146 | case BUTTON_LEFT: | ||
2147 | case BUTTON_F3 | BUTTON_LEFT: | ||
2148 | global_settings.rec_source++; | ||
2149 | if(global_settings.rec_source > AUDIO_SRC_MAX) | ||
2150 | global_settings.rec_source = 0; | ||
2151 | used = true; | ||
2152 | break; | ||
2153 | |||
2154 | case BUTTON_F3 | BUTTON_REL: | ||
2155 | if ( used ) | ||
2156 | exit = true; | ||
2157 | used = true; | ||
2158 | break; | ||
2159 | |||
2160 | case BUTTON_F3 | BUTTON_REPEAT: | ||
2161 | used = true; | ||
2162 | break; | ||
2163 | |||
2164 | default: | ||
2165 | if(default_event_handler(button) == SYS_USB_CONNECTED) | ||
2166 | return true; | ||
2167 | break; | ||
2168 | } | ||
2169 | } | ||
2170 | |||
2171 | rec_init_recording_options(&rec_options); | ||
2172 | rec_set_recording_options(&rec_options); | ||
2173 | |||
2174 | set_gain(); | ||
2175 | |||
2176 | settings_save(); | ||
2177 | FOR_NB_SCREENS(i) | ||
2178 | screens[i].setfont(FONT_UI); | ||
2179 | |||
2180 | return false; | ||
2181 | } | ||
2182 | #endif /* CONFIG_KEYPAD == RECORDER_PAD */ | ||
2183 | |||
2184 | #if CONFIG_CODEC == SWCODEC | 1898 | #if CONFIG_CODEC == SWCODEC |
2185 | void audio_beep(int duration) | 1899 | void audio_beep(int duration) |
2186 | { | 1900 | { |