diff options
author | Peter D'Hoye <peter.dhoye@gmail.com> | 2007-12-07 00:28:16 +0000 |
---|---|---|
committer | Peter D'Hoye <peter.dhoye@gmail.com> | 2007-12-07 00:28:16 +0000 |
commit | 327d78eb6e4ad5e380de021d64a02c31e95384a8 (patch) | |
tree | 258f98919c1607e31ed09b3fd67f92f4826871c3 /apps | |
parent | a007b558b3d088644e2b2b38fa51c52cae14007d (diff) | |
download | rockbox-327d78eb6e4ad5e380de021d64a02c31e95384a8.tar.gz rockbox-327d78eb6e4ad5e380de021d64a02c31e95384a8.zip |
Code police
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15889 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r-- | apps/recorder/recording.c | 148 |
1 files changed, 79 insertions, 69 deletions
diff --git a/apps/recorder/recording.c b/apps/recorder/recording.c index 069c689321..7b81b3da58 100644 --- a/apps/recorder/recording.c +++ b/apps/recorder/recording.c | |||
@@ -164,9 +164,9 @@ enum rec_status_flags | |||
164 | static int rec_status = 0; | 164 | static int rec_status = 0; |
165 | 165 | ||
166 | bool in_recording_screen(void) | 166 | bool in_recording_screen(void) |
167 | { | 167 | { |
168 | return (rec_status & RCSTAT_IN_RECSCREEN) != 0; | 168 | return (rec_status & RCSTAT_IN_RECSCREEN) != 0; |
169 | } | 169 | } |
170 | 170 | ||
171 | #define PM_HEIGHT ((LCD_HEIGHT >= 72) ? 2 : 1) | 171 | #define PM_HEIGHT ((LCD_HEIGHT >= 72) ? 2 : 1) |
172 | 172 | ||
@@ -297,7 +297,7 @@ static bool read_peak_levels(int *peak_l, int *peak_r, int *balance) | |||
297 | ((*peak_l < 32767) | 297 | ((*peak_l < 32767) |
298 | #ifndef SIMULATOR | 298 | #ifndef SIMULATOR |
299 | || ata_disk_is_active() | 299 | || ata_disk_is_active() |
300 | #endif | 300 | #endif |
301 | )) | 301 | )) |
302 | return false; | 302 | return false; |
303 | 303 | ||
@@ -379,7 +379,7 @@ static void auto_gain_control(int *peak_l, int *peak_r, int *balance) | |||
379 | else | 379 | else |
380 | agc_right -= (agc_right - *peak_r + 3) >> 2; | 380 | agc_right -= (agc_right - *peak_r + 3) >> 2; |
381 | agc_mono = (agc_left + agc_right) / 2; | 381 | agc_mono = (agc_left + agc_right) / 2; |
382 | 382 | ||
383 | agc_mode = abs(agc_preset) - 1; | 383 | agc_mode = abs(agc_preset) - 1; |
384 | if (agc_mode < 0) { | 384 | if (agc_mode < 0) { |
385 | agc_enable = false; | 385 | agc_enable = false; |
@@ -475,7 +475,7 @@ static void auto_gain_control(int *peak_l, int *peak_r, int *balance) | |||
475 | agc_droptime++; | 475 | agc_droptime++; |
476 | else | 476 | else |
477 | agc_droptime += !(peak_time % 2); | 477 | agc_droptime += !(peak_time % 2); |
478 | 478 | ||
479 | if (agc_droptime >= agc_tdrop[agc_mode]) | 479 | if (agc_droptime >= agc_tdrop[agc_mode]) |
480 | { | 480 | { |
481 | change_recording_gain(false, true, true); | 481 | change_recording_gain(false, true, true); |
@@ -493,7 +493,7 @@ static void auto_gain_control(int *peak_l, int *peak_r, int *balance) | |||
493 | agc_risetime += 2; | 493 | agc_risetime += 2; |
494 | else | 494 | else |
495 | agc_risetime++; | 495 | agc_risetime++; |
496 | 496 | ||
497 | if (agc_risetime >= agc_trise[agc_mode]) { | 497 | if (agc_risetime >= agc_trise[agc_mode]) { |
498 | if ((agc_mode != AGC_SAFETY_MODE) && | 498 | if ((agc_mode != AGC_SAFETY_MODE) && |
499 | (!agc_gain_is_max(true, true))) { | 499 | (!agc_gain_is_max(true, true))) { |
@@ -534,7 +534,7 @@ static char *fmt_gain(int snd, int val, char *str, int len) | |||
534 | } | 534 | } |
535 | numdec = sound_numdecimals(snd); | 535 | numdec = sound_numdecimals(snd); |
536 | unit = sound_unit(snd); | 536 | unit = sound_unit(snd); |
537 | 537 | ||
538 | if(numdec) | 538 | if(numdec) |
539 | { | 539 | { |
540 | i = val / (10*numdec); | 540 | i = val / (10*numdec); |
@@ -543,7 +543,7 @@ static char *fmt_gain(int snd, int val, char *str, int len) | |||
543 | } | 543 | } |
544 | else | 544 | else |
545 | snprintf(str, len, fmtstr[numdec], sign, val, unit); | 545 | snprintf(str, len, fmtstr[numdec], sign, val, unit); |
546 | 546 | ||
547 | return str; | 547 | return str; |
548 | } | 548 | } |
549 | 549 | ||
@@ -552,7 +552,7 @@ static int cursor; | |||
552 | static void adjust_cursor(void) | 552 | static void adjust_cursor(void) |
553 | { | 553 | { |
554 | int max_cursor; | 554 | int max_cursor; |
555 | 555 | ||
556 | if(cursor < 0) | 556 | if(cursor < 0) |
557 | cursor = 0; | 557 | cursor = 0; |
558 | 558 | ||
@@ -615,7 +615,7 @@ char *rec_create_filename(char *buffer) | |||
615 | } | 615 | } |
616 | 616 | ||
617 | strcpy(buffer, global_settings.rec_directory); | 617 | strcpy(buffer, global_settings.rec_directory); |
618 | 618 | ||
619 | snprintf(ext, sizeof(ext), ".%s", | 619 | snprintf(ext, sizeof(ext), ".%s", |
620 | REC_FILE_ENDING(global_settings.rec_format)); | 620 | REC_FILE_ENDING(global_settings.rec_format)); |
621 | 621 | ||
@@ -653,7 +653,7 @@ int rec_create_directory(void) | |||
653 | while (action_userabort(HZ) == false) | 653 | while (action_userabort(HZ) == false) |
654 | { | 654 | { |
655 | gui_syncsplash(0, "%s %s", | 655 | gui_syncsplash(0, "%s %s", |
656 | str(LANG_REC_DIR_NOT_WRITABLE), | 656 | str(LANG_REC_DIR_NOT_WRITABLE), |
657 | str(LANG_OFF_ABORT)); | 657 | str(LANG_OFF_ABORT)); |
658 | } | 658 | } |
659 | } | 659 | } |
@@ -961,7 +961,7 @@ bool recording_screen(bool no_source) | |||
961 | { | 961 | { |
962 | screens[1].clear_display(); | 962 | screens[1].clear_display(); |
963 | snprintf(buf, sizeof(buf), str(LANG_REMOTE_LCD_ON)); | 963 | snprintf(buf, sizeof(buf), str(LANG_REMOTE_LCD_ON)); |
964 | screens[1].puts((screens[1].width/w - strlen(buf))/2 + 1, | 964 | screens[1].puts((screens[1].width/w - strlen(buf))/2 + 1, |
965 | screens[1].height/(h*2) + 1, buf); | 965 | screens[1].height/(h*2) + 1, buf); |
966 | screens[1].update(); | 966 | screens[1].update(); |
967 | gui_syncsplash(0, str(LANG_REMOTE_LCD_OFF)); | 967 | gui_syncsplash(0, str(LANG_REMOTE_LCD_OFF)); |
@@ -971,7 +971,7 @@ bool recording_screen(bool no_source) | |||
971 | while(!done) | 971 | while(!done) |
972 | { | 972 | { |
973 | audio_stat = audio_status(); | 973 | audio_stat = audio_status(); |
974 | 974 | ||
975 | #if (CONFIG_LED == LED_REAL) | 975 | #if (CONFIG_LED == LED_REAL) |
976 | 976 | ||
977 | /* | 977 | /* |
@@ -1020,7 +1020,8 @@ bool recording_screen(bool no_source) | |||
1020 | #endif /* CONFIG_LED */ | 1020 | #endif /* CONFIG_LED */ |
1021 | 1021 | ||
1022 | /* Wait for a button a while (HZ/10) drawing the peak meter */ | 1022 | /* Wait for a button a while (HZ/10) drawing the peak meter */ |
1023 | button = peak_meter_draw_get_btn(pm_x, pm_y, h * PM_HEIGHT, screen_update); | 1023 | button = peak_meter_draw_get_btn(pm_x, pm_y, h * PM_HEIGHT, |
1024 | screen_update); | ||
1024 | 1025 | ||
1025 | if (last_audio_stat != audio_stat) | 1026 | if (last_audio_stat != audio_stat) |
1026 | { | 1027 | { |
@@ -1049,8 +1050,8 @@ bool recording_screen(bool no_source) | |||
1049 | screen_update = 1; | 1050 | screen_update = 1; |
1050 | screens[1].clear_display(); | 1051 | screens[1].clear_display(); |
1051 | snprintf(buf, sizeof(buf), str(LANG_REMOTE_LCD_ON)); | 1052 | snprintf(buf, sizeof(buf), str(LANG_REMOTE_LCD_ON)); |
1052 | screens[1].puts((screens[1].width/w - strlen(buf))/2 + 1, | 1053 | screens[1].puts((screens[1].width/w - strlen(buf))/2 + 1, |
1053 | screens[1].height/(h*2) + 1, buf); | 1054 | screens[1].height/(h*2) + 1, buf); |
1054 | screens[1].update(); | 1055 | screens[1].update(); |
1055 | gui_syncsplash(0, str(LANG_REMOTE_LCD_OFF)); | 1056 | gui_syncsplash(0, str(LANG_REMOTE_LCD_OFF)); |
1056 | } | 1057 | } |
@@ -1075,7 +1076,7 @@ bool recording_screen(bool no_source) | |||
1075 | #if CONFIG_CODEC != SWCODEC | 1076 | #if CONFIG_CODEC != SWCODEC |
1076 | peak_meter_playback(true); | 1077 | peak_meter_playback(true); |
1077 | peak_meter_enabled = false; | 1078 | peak_meter_enabled = false; |
1078 | #endif | 1079 | #endif |
1079 | done = true; | 1080 | done = true; |
1080 | } | 1081 | } |
1081 | update_countdown = 1; /* Update immediately */ | 1082 | update_countdown = 1; /* Update immediately */ |
@@ -1150,7 +1151,7 @@ bool recording_screen(bool no_source) | |||
1150 | adjust_cursor(); | 1151 | adjust_cursor(); |
1151 | update_countdown = 1; /* Update immediately */ | 1152 | update_countdown = 1; /* Update immediately */ |
1152 | break; | 1153 | break; |
1153 | 1154 | ||
1154 | case ACTION_SETTINGS_INC: | 1155 | case ACTION_SETTINGS_INC: |
1155 | case ACTION_SETTINGS_INCREPEAT: | 1156 | case ACTION_SETTINGS_INCREPEAT: |
1156 | switch(cursor) | 1157 | switch(cursor) |
@@ -1217,7 +1218,7 @@ bool recording_screen(bool no_source) | |||
1217 | set_gain(); | 1218 | set_gain(); |
1218 | update_countdown = 1; /* Update immediately */ | 1219 | update_countdown = 1; /* Update immediately */ |
1219 | break; | 1220 | break; |
1220 | 1221 | ||
1221 | case ACTION_SETTINGS_DEC: | 1222 | case ACTION_SETTINGS_DEC: |
1222 | case ACTION_SETTINGS_DECREPEAT: | 1223 | case ACTION_SETTINGS_DECREPEAT: |
1223 | switch(cursor) | 1224 | switch(cursor) |
@@ -1284,7 +1285,7 @@ bool recording_screen(bool no_source) | |||
1284 | set_gain(); | 1285 | set_gain(); |
1285 | update_countdown = 1; /* Update immediately */ | 1286 | update_countdown = 1; /* Update immediately */ |
1286 | break; | 1287 | break; |
1287 | 1288 | ||
1288 | case ACTION_STD_MENU: | 1289 | case ACTION_STD_MENU: |
1289 | #if CONFIG_CODEC == SWCODEC | 1290 | #if CONFIG_CODEC == SWCODEC |
1290 | if(!(audio_stat & AUDIO_STATUS_RECORD)) | 1291 | if(!(audio_stat & AUDIO_STATUS_RECORD)) |
@@ -1415,7 +1416,7 @@ bool recording_screen(bool no_source) | |||
1415 | #endif | 1416 | #endif |
1416 | } | 1417 | } |
1417 | break; | 1418 | break; |
1418 | 1419 | ||
1419 | default: | 1420 | default: |
1420 | default_event_handler(button); | 1421 | default_event_handler(button); |
1421 | break; | 1422 | break; |
@@ -1433,11 +1434,11 @@ bool recording_screen(bool no_source) | |||
1433 | auto_gain_control(&peak_l, &peak_r, &balance); | 1434 | auto_gain_control(&peak_l, &peak_r, &balance); |
1434 | #endif | 1435 | #endif |
1435 | 1436 | ||
1436 | FOR_NB_SCREENS(i) | 1437 | FOR_NB_SCREENS(i) |
1437 | screens[i].setfont(FONT_SYSFIXED); | 1438 | screens[i].setfont(FONT_SYSFIXED); |
1438 | 1439 | ||
1439 | seconds = audio_recorded_time() / HZ; | 1440 | seconds = audio_recorded_time() / HZ; |
1440 | 1441 | ||
1441 | update_countdown--; | 1442 | update_countdown--; |
1442 | if(update_countdown == 0 || seconds > last_seconds) | 1443 | if(update_countdown == 0 || seconds > last_seconds) |
1443 | { | 1444 | { |
@@ -1451,7 +1452,7 @@ bool recording_screen(bool no_source) | |||
1451 | dseconds = rec_timesplit_seconds(); | 1452 | dseconds = rec_timesplit_seconds(); |
1452 | dsize = rec_sizesplit_bytes(); | 1453 | dsize = rec_sizesplit_bytes(); |
1453 | num_recorded_bytes = audio_num_recorded_bytes(); | 1454 | num_recorded_bytes = audio_num_recorded_bytes(); |
1454 | 1455 | ||
1455 | for(i = 0; i < screen_update; i++) | 1456 | for(i = 0; i < screen_update; i++) |
1456 | screens[i].clear_display(); | 1457 | screens[i].clear_display(); |
1457 | 1458 | ||
@@ -1477,7 +1478,8 @@ bool recording_screen(bool no_source) | |||
1477 | } | 1478 | } |
1478 | else | 1479 | else |
1479 | #endif /* CONFIG_CODEC == SWCODEC */ | 1480 | #endif /* CONFIG_CODEC == SWCODEC */ |
1480 | if ((global_settings.rec_sizesplit) && (global_settings.rec_split_method)) | 1481 | if ((global_settings.rec_sizesplit) && |
1482 | (global_settings.rec_split_method)) | ||
1481 | { | 1483 | { |
1482 | dmb = dsize/1024/1024; | 1484 | dmb = dsize/1024/1024; |
1483 | snprintf(buf, sizeof(buf), "%s %dMB", | 1485 | snprintf(buf, sizeof(buf), "%s %dMB", |
@@ -1491,19 +1493,21 @@ bool recording_screen(bool no_source) | |||
1491 | str(LANG_SYSFONT_RECORDING_TIME), | 1493 | str(LANG_SYSFONT_RECORDING_TIME), |
1492 | hours, minutes, seconds%60); | 1494 | hours, minutes, seconds%60); |
1493 | } | 1495 | } |
1494 | 1496 | ||
1495 | for(i = 0; i < screen_update; i++) | 1497 | for(i = 0; i < screen_update; i++) |
1496 | screens[i].puts(0, 0, buf); | 1498 | screens[i].puts(0, 0, buf); |
1497 | 1499 | ||
1498 | if(audio_stat & AUDIO_STATUS_PRERECORD) | 1500 | if(audio_stat & AUDIO_STATUS_PRERECORD) |
1499 | { | 1501 | { |
1500 | snprintf(buf, sizeof(buf), "%s...", str(LANG_SYSFONT_RECORD_PRERECORD)); | 1502 | snprintf(buf, sizeof(buf), "%s...", |
1503 | str(LANG_SYSFONT_RECORD_PRERECORD)); | ||
1501 | } | 1504 | } |
1502 | else | 1505 | else |
1503 | { | 1506 | { |
1504 | /* Display the split interval if the record timesplit | 1507 | /* Display the split interval if the record timesplit |
1505 | is active */ | 1508 | is active */ |
1506 | if ((global_settings.rec_timesplit) && !(global_settings.rec_split_method)) | 1509 | if ((global_settings.rec_timesplit) && |
1510 | !(global_settings.rec_split_method)) | ||
1507 | { | 1511 | { |
1508 | /* Display the record timesplit interval rather | 1512 | /* Display the record timesplit interval rather |
1509 | than the file size if the record timer is | 1513 | than the file size if the record timer is |
@@ -1547,14 +1551,15 @@ bool recording_screen(bool no_source) | |||
1547 | /* We will do file splitting regardless, either at the end of | 1551 | /* We will do file splitting regardless, either at the end of |
1548 | a split interval, or when the filesize approaches the 2GB | 1552 | a split interval, or when the filesize approaches the 2GB |
1549 | FAT file size (compatibility) limit. */ | 1553 | FAT file size (compatibility) limit. */ |
1550 | if ((audio_stat && !(global_settings.rec_split_method) | 1554 | if ((audio_stat && !(global_settings.rec_split_method) |
1551 | && global_settings.rec_timesplit && (seconds >= dseconds)) | 1555 | && global_settings.rec_timesplit && (seconds >= dseconds)) |
1552 | || (audio_stat && global_settings.rec_split_method | 1556 | || (audio_stat && global_settings.rec_split_method |
1553 | && global_settings.rec_sizesplit && (num_recorded_bytes >= dsize)) | 1557 | && global_settings.rec_sizesplit |
1554 | || (num_recorded_bytes >= MAX_FILE_SIZE)) | 1558 | && (num_recorded_bytes >= dsize)) |
1559 | || (num_recorded_bytes >= MAX_FILE_SIZE)) | ||
1555 | { | 1560 | { |
1556 | if (!(global_settings.rec_split_type) | 1561 | if (!(global_settings.rec_split_type) |
1557 | || (num_recorded_bytes >= MAX_FILE_SIZE)) | 1562 | || (num_recorded_bytes >= MAX_FILE_SIZE)) |
1558 | { | 1563 | { |
1559 | rec_command(RECORDING_CMD_START_NEWFILE); | 1564 | rec_command(RECORDING_CMD_START_NEWFILE); |
1560 | last_seconds = 0; | 1565 | last_seconds = 0; |
@@ -1577,9 +1582,9 @@ bool recording_screen(bool no_source) | |||
1577 | { | 1582 | { |
1578 | if(PM_HEIGHT > 1) | 1583 | if(PM_HEIGHT > 1) |
1579 | screens[i].puts(0, 2 + filename_offset[i], | 1584 | screens[i].puts(0, 2 + filename_offset[i], |
1580 | str(LANG_SYSFONT_PM_CLIPCOUNT)); | 1585 | str(LANG_SYSFONT_PM_CLIPCOUNT)); |
1581 | screens[i].puts(0, 1 + PM_HEIGHT + filename_offset[i], | 1586 | screens[i].puts(0, 1 + PM_HEIGHT + filename_offset[i], |
1582 | clpstr); | 1587 | clpstr); |
1583 | } | 1588 | } |
1584 | } | 1589 | } |
1585 | 1590 | ||
@@ -1587,18 +1592,18 @@ bool recording_screen(bool no_source) | |||
1587 | fmt_gain(SOUND_VOLUME, | 1592 | fmt_gain(SOUND_VOLUME, |
1588 | global_settings.volume, | 1593 | global_settings.volume, |
1589 | buf2, sizeof(buf2))); | 1594 | buf2, sizeof(buf2))); |
1590 | 1595 | ||
1591 | if (global_settings.cursor_style && (pos++ == cursor)) | 1596 | if (global_settings.cursor_style && (pos++ == cursor)) |
1592 | { | 1597 | { |
1593 | for(i = 0; i < screen_update; i++) | 1598 | for(i = 0; i < screen_update; i++) |
1594 | screens[i].puts_style_offset(0, filename_offset[i] + | 1599 | screens[i].puts_style_offset(0, filename_offset[i] + |
1595 | PM_HEIGHT + 2, buf, style,0); | 1600 | PM_HEIGHT + 2, buf, style,0); |
1596 | } | 1601 | } |
1597 | else | 1602 | else |
1598 | { | 1603 | { |
1599 | for(i = 0; i < screen_update; i++) | 1604 | for(i = 0; i < screen_update; i++) |
1600 | screens[i].puts(0, filename_offset[i] + PM_HEIGHT + 2, buf); | 1605 | screens[i].puts(0, filename_offset[i] + PM_HEIGHT + 2, buf); |
1601 | } | 1606 | } |
1602 | 1607 | ||
1603 | if(global_settings.rec_source == AUDIO_SRC_MIC) | 1608 | if(global_settings.rec_source == AUDIO_SRC_MIC) |
1604 | { | 1609 | { |
@@ -1621,9 +1626,11 @@ bool recording_screen(bool no_source) | |||
1621 | } | 1626 | } |
1622 | } | 1627 | } |
1623 | else if(0 | 1628 | else if(0 |
1624 | HAVE_LINE_REC_( || global_settings.rec_source == AUDIO_SRC_LINEIN) | 1629 | HAVE_LINE_REC_( || global_settings.rec_source == |
1625 | HAVE_FMRADIO_REC_( || global_settings.rec_source == AUDIO_SRC_FMRADIO) | 1630 | AUDIO_SRC_LINEIN) |
1626 | ) | 1631 | HAVE_FMRADIO_REC_( || global_settings.rec_source == |
1632 | AUDIO_SRC_FMRADIO) | ||
1633 | ) | ||
1627 | { | 1634 | { |
1628 | /* Draw LINE or FMRADIO recording gain */ | 1635 | /* Draw LINE or FMRADIO recording gain */ |
1629 | snprintf(buf, sizeof(buf), "%s:%s", | 1636 | snprintf(buf, sizeof(buf), "%s:%s", |
@@ -1640,7 +1647,7 @@ bool recording_screen(bool no_source) | |||
1640 | if(global_settings.cursor_style && ((1==cursor)||(2==cursor))) | 1647 | if(global_settings.cursor_style && ((1==cursor)||(2==cursor))) |
1641 | { | 1648 | { |
1642 | for(i = 0; i < screen_update; i++) | 1649 | for(i = 0; i < screen_update; i++) |
1643 | screens[i].puts_style_offset(0, filename_offset[i] + | 1650 | screens[i].puts_style_offset(0, filename_offset[i] + |
1644 | PM_HEIGHT + 3, buf, style,0); | 1651 | PM_HEIGHT + 3, buf, style,0); |
1645 | } | 1652 | } |
1646 | else | 1653 | else |
@@ -1648,7 +1655,7 @@ bool recording_screen(bool no_source) | |||
1648 | for(i = 0; i < screen_update; i++) | 1655 | for(i = 0; i < screen_update; i++) |
1649 | screens[i].puts(0, filename_offset[i] + | 1656 | screens[i].puts(0, filename_offset[i] + |
1650 | PM_HEIGHT + 3, buf); | 1657 | PM_HEIGHT + 3, buf); |
1651 | } | 1658 | } |
1652 | 1659 | ||
1653 | snprintf(buf, sizeof(buf), "%s:%s", | 1660 | snprintf(buf, sizeof(buf), "%s:%s", |
1654 | str(LANG_SYSFONT_RECORDING_RIGHT), | 1661 | str(LANG_SYSFONT_RECORDING_RIGHT), |
@@ -1672,7 +1679,7 @@ bool recording_screen(bool no_source) | |||
1672 | for(i = 0; i < screen_update; i++) | 1679 | for(i = 0; i < screen_update; i++) |
1673 | screens[i].puts(0, filename_offset[i] + | 1680 | screens[i].puts(0, filename_offset[i] + |
1674 | PM_HEIGHT + 4, buf); | 1681 | PM_HEIGHT + 4, buf); |
1675 | } | 1682 | } |
1676 | } | 1683 | } |
1677 | #ifdef HAVE_LCD_COLOR | 1684 | #ifdef HAVE_LCD_COLOR |
1678 | /* special action for gradient - back to single line gradient */ | 1685 | /* special action for gradient - back to single line gradient */ |
@@ -1703,7 +1710,8 @@ bool recording_screen(bool no_source) | |||
1703 | break; | 1710 | break; |
1704 | } /* end switch */ | 1711 | } /* end switch */ |
1705 | #ifdef HAVE_AGC | 1712 | #ifdef HAVE_AGC |
1706 | if (screens[i].height < h * (2 + filename_offset[i] + PM_HEIGHT + line[i])) | 1713 | if (screens[i].height < h * (2 + filename_offset[i] + |
1714 | PM_HEIGHT + line[i])) | ||
1707 | { | 1715 | { |
1708 | line[i] -= 1; | 1716 | line[i] -= 1; |
1709 | display_agc[i] = false; | 1717 | display_agc[i] = false; |
@@ -1749,23 +1757,24 @@ bool recording_screen(bool no_source) | |||
1749 | agc_maxgain - | 1757 | agc_maxgain - |
1750 | (global_settings.rec_left_gain + | 1758 | (global_settings.rec_left_gain + |
1751 | global_settings.rec_right_gain)/2, | 1759 | global_settings.rec_right_gain)/2, |
1752 | buf2, sizeof(buf2))); | 1760 | buf2, sizeof(buf2))); |
1753 | 1761 | ||
1754 | if(global_settings.cursor_style && ((cursor==4) || (cursor==5))) | 1762 | if(global_settings.cursor_style && ((cursor==4) || (cursor==5))) |
1755 | { | 1763 | { |
1756 | for(i = 0; i < screen_update; i++) | 1764 | for(i = 0; i < screen_update; i++) |
1757 | screens[i].puts_style_offset(0, filename_offset[i] + | 1765 | screens[i].puts_style_offset(0, filename_offset[i] + |
1758 | PM_HEIGHT + line[i], buf, style,0); | 1766 | PM_HEIGHT + line[i], buf, style,0); |
1759 | } | 1767 | } |
1760 | else if ( | 1768 | else if (global_settings.rec_source == AUDIO_SRC_MIC |
1761 | global_settings.rec_source == AUDIO_SRC_MIC | 1769 | HAVE_LINE_REC_(|| global_settings.rec_source == |
1762 | HAVE_LINE_REC_(|| global_settings.rec_source == AUDIO_SRC_LINEIN) | 1770 | AUDIO_SRC_LINEIN) |
1763 | HAVE_FMRADIO_REC_(|| global_settings.rec_source == AUDIO_SRC_FMRADIO) | 1771 | HAVE_FMRADIO_REC_(|| global_settings.rec_source == |
1764 | ) | 1772 | AUDIO_SRC_FMRADIO) |
1773 | ) | ||
1765 | { | 1774 | { |
1766 | for(i = 0; i < screen_update; i++) { | 1775 | for(i = 0; i < screen_update; i++) { |
1767 | if (display_agc[i]) { | 1776 | if (display_agc[i]) { |
1768 | screens[i].puts(0, filename_offset[i] + | 1777 | screens[i].puts(0, filename_offset[i] + |
1769 | PM_HEIGHT + line[i], buf); | 1778 | PM_HEIGHT + line[i], buf); |
1770 | } | 1779 | } |
1771 | } | 1780 | } |
@@ -1792,7 +1801,7 @@ bool recording_screen(bool no_source) | |||
1792 | { | 1801 | { |
1793 | case 1: | 1802 | case 1: |
1794 | for(i = 0; i < screen_update; i++) | 1803 | for(i = 0; i < screen_update; i++) |
1795 | screen_put_cursorxy(&screens[i], 0, | 1804 | screen_put_cursorxy(&screens[i], 0, |
1796 | filename_offset[i] + | 1805 | filename_offset[i] + |
1797 | PM_HEIGHT + 3, true); | 1806 | PM_HEIGHT + 3, true); |
1798 | 1807 | ||
@@ -1807,13 +1816,13 @@ bool recording_screen(bool no_source) | |||
1807 | case 2: | 1816 | case 2: |
1808 | for(i = 0; i < screen_update; i++) | 1817 | for(i = 0; i < screen_update; i++) |
1809 | screen_put_cursorxy(&screens[i], 0, | 1818 | screen_put_cursorxy(&screens[i], 0, |
1810 | filename_offset[i] + | 1819 | filename_offset[i] + |
1811 | PM_HEIGHT + 3, true); | 1820 | PM_HEIGHT + 3, true); |
1812 | break; | 1821 | break; |
1813 | case 3: | 1822 | case 3: |
1814 | for(i = 0; i < screen_update; i++) | 1823 | for(i = 0; i < screen_update; i++) |
1815 | screen_put_cursorxy(&screens[i], 0, | 1824 | screen_put_cursorxy(&screens[i], 0, |
1816 | filename_offset[i] + | 1825 | filename_offset[i] + |
1817 | PM_HEIGHT + 4, true); | 1826 | PM_HEIGHT + 4, true); |
1818 | break; | 1827 | break; |
1819 | #ifdef HAVE_AGC | 1828 | #ifdef HAVE_AGC |
@@ -1821,14 +1830,14 @@ bool recording_screen(bool no_source) | |||
1821 | case 5: | 1830 | case 5: |
1822 | for(i = 0; i < screen_update; i++) | 1831 | for(i = 0; i < screen_update; i++) |
1823 | screen_put_cursorxy(&screens[i], 0, | 1832 | screen_put_cursorxy(&screens[i], 0, |
1824 | filename_offset[i] + | 1833 | filename_offset[i] + |
1825 | PM_HEIGHT + line[i], true); | 1834 | PM_HEIGHT + line[i], true); |
1826 | break; | 1835 | break; |
1827 | #endif /* HAVE_AGC */ | 1836 | #endif /* HAVE_AGC */ |
1828 | default: | 1837 | default: |
1829 | for(i = 0; i < screen_update; i++) | 1838 | for(i = 0; i < screen_update; i++) |
1830 | screen_put_cursorxy(&screens[i], 0, | 1839 | screen_put_cursorxy(&screens[i], 0, |
1831 | filename_offset[i] + | 1840 | filename_offset[i] + |
1832 | PM_HEIGHT + 2, true); | 1841 | PM_HEIGHT + 2, true); |
1833 | } | 1842 | } |
1834 | } | 1843 | } |
@@ -1841,7 +1850,7 @@ bool recording_screen(bool no_source) | |||
1841 | { | 1850 | { |
1842 | gui_statusbar_draw(&(statusbars.statusbars[i]), true); | 1851 | gui_statusbar_draw(&(statusbars.statusbars[i]), true); |
1843 | peak_meter_screen(&screens[i], pm_x, pm_y[i], h*PM_HEIGHT); | 1852 | peak_meter_screen(&screens[i], pm_x, pm_y[i], h*PM_HEIGHT); |
1844 | screens[i].update(); | 1853 | screens[i].update(); |
1845 | } | 1854 | } |
1846 | 1855 | ||
1847 | /* draw the trigger status */ | 1856 | /* draw the trigger status */ |
@@ -1853,7 +1862,8 @@ bool recording_screen(bool no_source) | |||
1853 | trig_xpos[i] = screens[i].width - trig_width[i]; | 1862 | trig_xpos[i] = screens[i].width - trig_width[i]; |
1854 | trig_ypos[i] = ((screens[i].height < 72) && (PM_HEIGHT > 1)) ? | 1863 | trig_ypos[i] = ((screens[i].height < 72) && (PM_HEIGHT > 1)) ? |
1855 | h*2 : | 1864 | h*2 : |
1856 | h*(1 + filename_offset[i] + PM_HEIGHT + line[i] | 1865 | h*(1 + filename_offset[i] + PM_HEIGHT + |
1866 | line[i] | ||
1857 | #ifdef HAVE_AGC | 1867 | #ifdef HAVE_AGC |
1858 | + 1 | 1868 | + 1 |
1859 | #endif | 1869 | #endif |
@@ -1882,10 +1892,10 @@ bool recording_screen(bool no_source) | |||
1882 | { | 1892 | { |
1883 | gui_syncsplash(0, str(LANG_SYSFONT_DISK_FULL)); | 1893 | gui_syncsplash(0, str(LANG_SYSFONT_DISK_FULL)); |
1884 | gui_syncstatusbar_draw(&statusbars, true); | 1894 | gui_syncstatusbar_draw(&statusbars, true); |
1885 | 1895 | ||
1886 | FOR_NB_SCREENS(i) | 1896 | FOR_NB_SCREENS(i) |
1887 | screens[i].update(); | 1897 | screens[i].update(); |
1888 | 1898 | ||
1889 | audio_error_clear(); | 1899 | audio_error_clear(); |
1890 | 1900 | ||
1891 | while(1) | 1901 | while(1) |
@@ -1937,7 +1947,7 @@ rec_abort: | |||
1937 | ata_set_led_enabled(true); | 1947 | ata_set_led_enabled(true); |
1938 | #endif | 1948 | #endif |
1939 | 1949 | ||
1940 | settings_save(); | 1950 | settings_save(); |
1941 | 1951 | ||
1942 | return (rec_status & RCSTAT_BEEN_IN_USB_MODE) != 0; | 1952 | return (rec_status & RCSTAT_BEEN_IN_USB_MODE) != 0; |
1943 | } /* recording_screen */ | 1953 | } /* recording_screen */ |
@@ -1979,7 +1989,7 @@ static bool f2_rec_screen(void) | |||
1979 | screens[i].putsxy(0, LCD_HEIGHT/2 - h*2, | 1989 | screens[i].putsxy(0, LCD_HEIGHT/2 - h*2, |
1980 | str(LANG_SYSFONT_RECORDING_QUALITY)); | 1990 | str(LANG_SYSFONT_RECORDING_QUALITY)); |
1981 | } | 1991 | } |
1982 | 1992 | ||
1983 | snprintf(buf, sizeof(buf), "%d", global_settings.rec_quality); | 1993 | snprintf(buf, sizeof(buf), "%d", global_settings.rec_quality); |
1984 | FOR_NB_SCREENS(i) | 1994 | FOR_NB_SCREENS(i) |
1985 | { | 1995 | { |
@@ -2022,7 +2032,7 @@ static bool f2_rec_screen(void) | |||
2022 | str(LANG_SYSFONT_MODE)); | 2032 | str(LANG_SYSFONT_MODE)); |
2023 | screens[i].getstringsize(ptr, &w, &h); | 2033 | screens[i].getstringsize(ptr, &w, &h); |
2024 | screens[i].putsxy(LCD_WIDTH - w, LCD_HEIGHT/2, ptr); | 2034 | screens[i].putsxy(LCD_WIDTH - w, LCD_HEIGHT/2, ptr); |
2025 | screens[i].mono_bitmap(bitmap_icons_7x8[Icon_FastForward], | 2035 | screens[i].mono_bitmap(bitmap_icons_7x8[Icon_FastForward], |
2026 | LCD_WIDTH/2 + 8, LCD_HEIGHT/2 - 4, 7, 8); | 2036 | LCD_WIDTH/2 + 8, LCD_HEIGHT/2 - 4, 7, 8); |
2027 | 2037 | ||
2028 | screens[i].update(); | 2038 | screens[i].update(); |
@@ -2075,7 +2085,7 @@ static bool f2_rec_screen(void) | |||
2075 | rec_set_recording_options(&rec_options); | 2085 | rec_set_recording_options(&rec_options); |
2076 | 2086 | ||
2077 | set_gain(); | 2087 | set_gain(); |
2078 | 2088 | ||
2079 | settings_save(); | 2089 | settings_save(); |
2080 | FOR_NB_SCREENS(i) | 2090 | FOR_NB_SCREENS(i) |
2081 | screens[i].setfont(FONT_UI); | 2091 | screens[i].setfont(FONT_UI); |
@@ -2102,7 +2112,7 @@ static bool f3_rec_screen(void) | |||
2102 | screens[i].setfont(FONT_SYSFIXED); | 2112 | screens[i].setfont(FONT_SYSFIXED); |
2103 | screens[i].getstringsize("A",&w,&h); | 2113 | screens[i].getstringsize("A",&w,&h); |
2104 | } | 2114 | } |
2105 | 2115 | ||
2106 | while (!exit) { | 2116 | while (!exit) { |
2107 | char* ptr=NULL; | 2117 | char* ptr=NULL; |
2108 | ptr = src_str[global_settings.rec_source]; | 2118 | ptr = src_str[global_settings.rec_source]; |
@@ -2116,7 +2126,7 @@ static bool f3_rec_screen(void) | |||
2116 | 2126 | ||
2117 | screens[i].getstringsize(ptr, &w, &h); | 2127 | screens[i].getstringsize(ptr, &w, &h); |
2118 | screens[i].putsxy(0, LCD_HEIGHT/2-h, ptr); | 2128 | screens[i].putsxy(0, LCD_HEIGHT/2-h, ptr); |
2119 | screens[i].mono_bitmap(bitmap_icons_7x8[Icon_FastBackward], | 2129 | screens[i].mono_bitmap(bitmap_icons_7x8[Icon_FastBackward], |
2120 | LCD_WIDTH/2 - 16, LCD_HEIGHT/2 - 4, 7, 8); | 2130 | LCD_WIDTH/2 - 16, LCD_HEIGHT/2 - 4, 7, 8); |
2121 | } | 2131 | } |
2122 | 2132 | ||