summaryrefslogtreecommitdiff
path: root/apps/recorder/recording.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/recorder/recording.c')
-rw-r--r--apps/recorder/recording.c64
1 files changed, 57 insertions, 7 deletions
diff --git a/apps/recorder/recording.c b/apps/recorder/recording.c
index 6a053cd12e..d38856db23 100644
--- a/apps/recorder/recording.c
+++ b/apps/recorder/recording.c
@@ -801,9 +801,16 @@ static void trigger_listener(int trigger_status)
801 /* if we're already recording this is a retrigger */ 801 /* if we're already recording this is a retrigger */
802 else 802 else
803 { 803 {
804 rec_new_file(); 804 if((audio_status() & AUDIO_STATUS_PAUSE) &&
805 /* tell recording_screen to reset the time */ 805 (global_settings.rec_trigger_type == 1))
806 last_seconds = 0; 806 audio_resume_recording();
807 /* New file on trig start*/
808 else if (global_settings.rec_trigger_type != 2)
809 {
810 rec_new_file();
811 /* tell recording_screen to reset the time */
812 last_seconds = 0;
813 }
807 } 814 }
808 break; 815 break;
809 816
@@ -811,7 +818,27 @@ static void trigger_listener(int trigger_status)
811 case TRIG_READY: 818 case TRIG_READY:
812 if(audio_status() & AUDIO_STATUS_RECORD) 819 if(audio_status() & AUDIO_STATUS_RECORD)
813 { 820 {
814 audio_stop(); 821 switch(global_settings.rec_trigger_type)
822 {
823 case 0: /* Stop */
824#if CONFIG_CODEC == SWCODEC
825 audio_stop_recording();
826#else
827 audio_stop();
828#endif
829 break;
830
831 case 1: /* Pause */
832 audio_pause_recording();
833 break;
834
835 case 2: /* New file on trig stop*/
836 rec_new_file();
837 /* tell recording_screen to reset the time */
838 last_seconds = 0;
839 break;
840 }
841
815 if (global_settings.rec_trigger_mode != TRIG_MODE_REARM) 842 if (global_settings.rec_trigger_mode != TRIG_MODE_REARM)
816 { 843 {
817 peak_meter_set_trigger_listener(NULL); 844 peak_meter_set_trigger_listener(NULL);
@@ -861,6 +888,9 @@ bool recording_screen(bool no_source)
861 int i; 888 int i;
862 int filename_offset[NB_SCREENS]; 889 int filename_offset[NB_SCREENS];
863 int pm_y[NB_SCREENS]; 890 int pm_y[NB_SCREENS];
891 int trig_xpos[NB_SCREENS];
892 int trig_ypos[NB_SCREENS];
893 int trig_width[NB_SCREENS];
864 894
865 static const unsigned char *byte_units[] = { 895 static const unsigned char *byte_units[] = {
866 ID2P(LANG_BYTE), 896 ID2P(LANG_BYTE),
@@ -1602,6 +1632,10 @@ bool recording_screen(bool no_source)
1602 line[i] = 3; 1632 line[i] = 3;
1603 break; 1633 break;
1604#endif 1634#endif
1635 default:
1636 line[i] = 5; /* to prevent uninitialisation
1637 warnings for line[0] */
1638 break;
1605 } /* end switch */ 1639 } /* end switch */
1606#ifdef HAVE_AGC 1640#ifdef HAVE_AGC
1607 if (screens[i].height < h * (2 + filename_offset[i] + PM_HEIGHT + line[i])) 1641 if (screens[i].height < h * (2 + filename_offset[i] + PM_HEIGHT + line[i]))
@@ -1747,12 +1781,28 @@ bool recording_screen(bool no_source)
1747 } 1781 }
1748 1782
1749 /* draw the trigger status */ 1783 /* draw the trigger status */
1784 FOR_NB_SCREENS(i)
1785 {
1786 trig_width[i] = ((screens[i].height < 64) ||
1787 ((screens[i].height < 72) && (PM_HEIGHT > 1))) ?
1788 screens[i].width - 14 * w : screens[i].width;
1789 trig_xpos[i] = screens[i].width - trig_width[i];
1790 trig_ypos[i] = ((screens[i].height < 72) && (PM_HEIGHT > 1)) ?
1791 h*2 :
1792 h*(1 + filename_offset[i] + PM_HEIGHT + line[i]
1793#ifdef HAVE_AGC
1794 + 1
1795#endif
1796 );
1797 }
1798
1750 if (peak_meter_trigger_status() != TRIG_OFF) 1799 if (peak_meter_trigger_status() != TRIG_OFF)
1751 { 1800 {
1752 peak_meter_draw_trig(LCD_WIDTH - TRIG_WIDTH, 4 * h); 1801 peak_meter_draw_trig(trig_xpos, trig_ypos, trig_width,
1802 screen_update);
1753 for(i = 0; i < screen_update; i++){ 1803 for(i = 0; i < screen_update; i++){
1754 screens[i].update_rect(LCD_WIDTH - (TRIG_WIDTH + 2), 4 * h, 1804 screens[i].update_rect(trig_xpos[i], trig_ypos[i],
1755 TRIG_WIDTH + 2, TRIG_HEIGHT); 1805 trig_width[i] + 2, TRIG_HEIGHT);
1756 } 1806 }
1757 } 1807 }
1758 } 1808 }