Index: apps/action.h =================================================================== --- apps/action.h (revision 15123) +++ apps/action.h (working copy) @@ -151,6 +151,16 @@ ACTION_FM_PREV_PRESET, /* recording screen */ + +/********************************************************* MY CHANGE ********************/ + ACTION_VOICEREC_SELECT, + ACTION_VOICEREC_STEALTH, + ACTION_VOICEREC_DIR, + ACTION_VOICEREC_REC_LONG, + ACTION_VOICEREC_START_DIR, + ACTION_STOP_AFTER_REC, +/********************************************************* MY CHANGE ********************/ + ACTION_REC_LCD, ACTION_REC_PAUSE, ACTION_REC_NEWFILE, Index: apps/recorder/recording.c =================================================================== --- apps/recorder/recording.c (revision 15123) +++ apps/recorder/recording.c (working copy) @@ -89,6 +89,12 @@ 24L*60*60 /* 24:00 */ }; +/********************************************************* MY CHANGE ********************/ +int VOICEREC_global_settings_start_dir; +int VOICEREC_global_settings_stop_after_rec = 1; +int VOICEREC_dir_current = 0; +/********************************************************* MY CHANGE ********************/ + static unsigned int rec_timesplit_seconds(void) { return rec_timer_seconds[global_settings.rec_timesplit]; @@ -152,6 +158,7 @@ trigger_times[global_settings.rec_stop_gap] ); } + /* recording screen status flags */ enum rec_status_flags { @@ -590,6 +597,43 @@ cursor = max_cursor; } +/********************************************************* MY CHANGE ********************/ +char *VOICEREC_DIR (int VOICEREC_dir_num) +{ + switch( VOICEREC_dir_num ) + { + case 0: + return "default"; + break; + case 1: + return "PragmaticU"; + break; + case 2: + return "Photo"; + break; + case 3: + return "program"; + break; + case 4: + return "NB"; + break; + case 5: + return "TEST"; + break; + case 6: + return "Topped Up"; + break; + case 7: + return "Clinic"; + break; + + default: + return "NONE!!!"; + break; + } +} +/********************************************************* MY CHANGE ********************/ + static bool check_dir(char *folder) { DIR *dir = opendir(folder); @@ -616,9 +660,42 @@ char *rec_create_filename(char *buffer) { char ext[16]; + +/********************************************************* MY CHANGE ********************/ + strncpy(buffer, "/stl" , MAX_PATH); + check_dir(buffer); + + switch(VOICEREC_dir_current) + { + case 0: + strncpy(buffer, "/recording", MAX_PATH); + break; + case 1: + strncpy(buffer, "/stl/PragmaticU" , MAX_PATH); + break; + case 2: + strncpy(buffer, "/stl/photo" , MAX_PATH); + break; + case 3: + strncpy(buffer, "/stl/program" , MAX_PATH); + break; + case 4: + strncpy(buffer, "/stl/NB" , MAX_PATH); + break; + case 5: + strncpy(buffer, "/stl/test" , MAX_PATH); + break; + case 6: + strncpy(buffer, "/stl/topup" , MAX_PATH); + break; + case 7: + strncpy(buffer, "/stl/clinic" , MAX_PATH); + break; + } +/********************************************************* MY CHANGE ********************/ + const char *pref = "R_"; - strcpy(buffer,global_settings.rec_directory); if (!check_dir(buffer)) return NULL; @@ -813,6 +890,18 @@ char buf[32]; char buf2[32]; int w, h; + +/********************************************************* MY CHANGE ********************/ + bool done1 = false; + long button1; + int voicefont; + voicefont = FONT_UI; + int VOICEREC_oldRecdir = VOICEREC_dir_current; + bool VOICEREC_SELECT_AGAIN = true; + char *VOICEREC_start_dir; + char *VOICEREC_stop_after_rec; +/********************************************************* MY CHANGE ********************/ + int update_countdown = 1; unsigned int seconds; int hours, minutes; @@ -941,7 +1030,7 @@ FOR_NB_SCREENS(i) { - screens[i].setfont(FONT_SYSFIXED); + screens[i].setfont(voicefont); screens[i].getstringsize("M", &w, &h); screens[i].setmargins(global_settings.cursor_style ? 0 : w, 8); filename_offset[i] = ((screens[i].height >= 80) ? 1 : 0); @@ -960,6 +1049,12 @@ } #endif +/********************************************************* MY CHANGE ********************/ + peak_meter_enabled = false; + if (!(VOICEREC_global_settings_start_dir)) + VOICEREC_dir_current = VOICEREC_oldRecdir = 0; +/********************************************************* MY CHANGE ********************/ + while(!done) { audio_stat = audio_status(); @@ -1070,11 +1165,267 @@ #endif done = true; } + +/********************************************************* MY CHANGE ********************/ + peak_meter_enabled = false; + VOICEREC_dir_current = VOICEREC_oldRecdir; update_countdown = 1; /* Update immediately */ break; - case ACTION_REC_PAUSE: + case ACTION_VOICEREC_DIR: + if(!(audio_stat & AUDIO_STATUS_RECORD)) + { + if (VOICEREC_dir_current == 7) + { + VOICEREC_dir_current = 0; + } + else (VOICEREC_dir_current++); + VOICEREC_oldRecdir = VOICEREC_dir_current; + } + break; + + case ACTION_VOICEREC_SELECT: + if(audio_stat & AUDIO_STATUS_RECORD) + { + /* turn off the trigger */ + peak_meter_trigger(false); + peak_meter_set_trigger_listener(NULL); + seconds = audio_recorded_time() / HZ; + hours = seconds / 3600; + minutes = (seconds - (hours * 3600)) / 60; + gui_syncsplash(HZ * 2, "%02d:%02d:%02d SAVED", hours, minutes, seconds%60); + yield(); + audio_stop_recording(); + peak_meter_enabled = false; + VOICEREC_dir_current = VOICEREC_oldRecdir; + update_countdown = 1; /* Update immediately */ + VOICEREC_SELECT_AGAIN = true; + if (VOICEREC_global_settings_stop_after_rec) + { + done = true; + } + } + else + { + audio_close_recording(); + audio_init_recording(0); + rec_init_recording_options(&rec_options); + rec_set_recording_options(&rec_options); + +#ifdef HAVE_AGC + if (global_settings.rec_source == AUDIO_SRC_MIC) + { + agc_preset = global_settings.rec_agc_preset_mic; + agc_maxgain = global_settings.rec_agc_maxgain_mic; + } + else + { + agc_preset = global_settings.rec_agc_preset_line; + agc_maxgain = global_settings.rec_agc_maxgain_line; + } +#endif + adjust_cursor(); + set_gain(); + + if (VOICEREC_SELECT_AGAIN) + { + /* VOICEREC_SELECT_AGAIN = false; Change here to cont to next loop */ + } + else + { + if (VOICEREC_dir_current >= 1 ) + (VOICEREC_dir_current--); + /* VOICEREC_oldRecdir = VOICEREC_dir_current;*/ + } + + peak_meter_enabled = false; + update_countdown = 1; /* Update immediately */ + } + + break; + + case ACTION_VOICEREC_STEALTH: + done = false; + hours = 0; + minutes = 0; + seconds = 0; + + while(!done) + { + audio_stat = audio_status(); + if((audio_stat & AUDIO_STATUS_RECORD)) + { + FOR_NB_SCREENS(i) + { + screens[i].clear_display(); + snprintf(buf, sizeof(buf), "%s", "RECORDING"); + screens[i].puts(0, 0, buf); + seconds = audio_recorded_time() / HZ; + hours = seconds / 3600; + minutes = (seconds - (hours * 3600)) / 60; + snprintf(buf, sizeof(buf), " %02d:%02d:%02d", hours, minutes, seconds%60); + screens[i].puts(0, 1, buf); + } + } + else + { + screens[i].clear_display(); + snprintf(buf, sizeof(buf), " %02d:%02d:%02d", hours, minutes, seconds%60); + screens[i].puts(0, 1, buf); + snprintf(buf, sizeof(buf), "%s", "LOCKED"); + screens[i].puts(0, 3, buf); + snprintf(buf, sizeof(buf), "%s", "up, right, then left "); + screens[i].puts(0, 5, buf); + snprintf(buf, sizeof(buf), "%s", "to unlock"); + screens[i].puts(0, 7, buf); + } + + lcd_update(); + + sleep(1); + button = button_get(true); + switch(button) + { + case BUTTON_UP: /*Escape sequence*/ + done1 = false; + while(!done1) + { + sleep(1); + button1 = button_get(true); + if (button1 == BUTTON_RIGHT) + { + while(!done1) + { + sleep(1); + button1 = button_get(true); + if (button1 == BUTTON_LEFT) + { + done1 = true; + done = true; + } + else if ((button1 == BUTTON_RIGHT)||(button1 == BUTTON_DOWN)||(button1 == BUTTON_UP)||(button1 == BUTTON_SCROLL_UP)||(button1 == BUTTON_SCROLL_DOWN)) + { + done1 = true; + } + else if ((button1 == BUTTON_SELECT)) + { + audio_close_recording(); + audio_init_recording(0); + rec_init_recording_options(&rec_options); + rec_set_recording_options(&rec_options); + done1 = true; + } + else if (button1 == BUTTON_REC) + { + if(!(audio_stat & AUDIO_STATUS_RECORD)) + { + rec_status |= RCSTAT_HAVE_RECORDED; + rec_command(RECORDING_CMD_START); + last_seconds = 0; + } + else + { + rec_command(RECORDING_CMD_START_NEWFILE); + last_seconds = 0; + } + update_countdown = 1; /* Update immediately */ + done1 = true; + break; + } + } + } + else if ((button1 == BUTTON_RIGHT)||(button1 == BUTTON_DOWN)||(button1 == BUTTON_UP)||(button1 == BUTTON_SCROLL_UP)||(button1 == BUTTON_SCROLL_DOWN)) + { + done1 = true; + } + else if ((button1 == BUTTON_SELECT)) + { + audio_close_recording(); + audio_init_recording(0); + rec_init_recording_options(&rec_options); + rec_set_recording_options(&rec_options); + done1 = true; + } + else if (button1 == BUTTON_REC) + { + if(!(audio_stat & AUDIO_STATUS_RECORD)) + { + rec_status |= RCSTAT_HAVE_RECORDED; + rec_command(RECORDING_CMD_START); + last_seconds = 0; + } + else + { + rec_command(RECORDING_CMD_START_NEWFILE); + last_seconds = 0; + } + update_countdown = 1; /* Update immediately */ + done1 = true; + break; + } + } /*End Escape sequence*/ + break; + + case BUTTON_SELECT: + if(audio_stat & AUDIO_STATUS_RECORD) + { + /* turn off the trigger */ + peak_meter_trigger(false); + peak_meter_set_trigger_listener(NULL); + seconds = audio_recorded_time() / HZ; + hours = seconds / 3600; + minutes = (seconds - (hours * 3600)) / 60; + VOICEREC_dir_current = VOICEREC_oldRecdir; + audio_stop_recording(); + } + else + { + audio_close_recording(); + audio_init_recording(0); + rec_init_recording_options(&rec_options); + rec_set_recording_options(&rec_options); + } + lcd_enable(false); + break; + + case BUTTON_REC: + if(!(audio_stat & AUDIO_STATUS_RECORD)) + { + rec_status |= RCSTAT_HAVE_RECORDED; + rec_command(RECORDING_CMD_START); + last_seconds = 0; + } + else + { + rec_command(RECORDING_CMD_START_NEWFILE); + last_seconds = 0; + } + update_countdown = 1; /* Update immediately */ + break; + } /*End Switch*/ + } /*End Done*/ + + if(audio_stat & AUDIO_STATUS_RECORD) + { + peak_meter_enabled = true; + } + else + { + peak_meter_enabled = false; + } + + done = false; + break; + + case ACTION_VOICEREC_REC_LONG: + if (VOICEREC_dir_current != 6) /*8888*/ + VOICEREC_dir_current = 4; +/********************************************************* MY CHANGE ********************/ + + case ACTION_REC_PAUSE: case ACTION_REC_NEWFILE: + peak_meter_enabled = true; + /* Only act if the mpeg is stopped */ if(!(audio_stat & AUDIO_STATUS_RECORD)) { @@ -1105,7 +1456,7 @@ else { /*if new file button pressed, start new file */ - if (button == ACTION_REC_NEWFILE) + if ((button == ACTION_REC_NEWFILE)||(button == ACTION_VOICEREC_REC_LONG)) { rec_command(RECORDING_CMD_START_NEWFILE); last_seconds = 0; @@ -1131,17 +1482,55 @@ update_countdown = 1; /* Update immediately */ break; +/********************************************************* MY CHANGE ********************/ + case ACTION_VOICEREC_START_DIR: + if (VOICEREC_global_settings_start_dir) + VOICEREC_global_settings_start_dir = false; + else + VOICEREC_global_settings_start_dir = true; + break; + + case ACTION_STOP_AFTER_REC: + if (VOICEREC_global_settings_stop_after_rec) + VOICEREC_global_settings_stop_after_rec = false; + else + VOICEREC_global_settings_stop_after_rec = true; + break; + case ACTION_STD_PREV: cursor--; adjust_cursor(); update_countdown = 1; /* Update immediately */ + + /* global_settings.volume--; + setvol();*/ + /* if (global_settings.rec_prerecord_time >= 1) + { + (global_settings.rec_prerecord_time--); + rec_init_recording_options(&rec_options); + rec_set_recording_options(&rec_options); + +or options->rec_prerecord_time = global_settings.rec_prerecord_time; + }*/ +/*8888*/ + /* update_countdown = 1; *//* Update immediately */ break; case ACTION_STD_NEXT: cursor++; adjust_cursor(); update_countdown = 1; /* Update immediately */ + + /* global_settings.volume++; + setvol();*/ + /* if (global_settings.rec_prerecord_time <= 60)*/ + /* {*/ + /* (global_settings.rec_prerecord_time++);*/ + /* rec_init_recording_options(&rec_options);*/ + /* }*/ + break; +/********************************************************* MY CHANGE ********************/ case ACTION_SETTINGS_INC: switch(cursor) @@ -1342,7 +1731,7 @@ FOR_NB_SCREENS(i) { - screens[i].setfont(FONT_SYSFIXED); + screens[i].setfont(voicefont); screens[i].setmargins( global_settings.cursor_style ? 0 : w, 8); } @@ -1422,7 +1811,7 @@ #endif FOR_NB_SCREENS(i) - screens[i].setfont(FONT_SYSFIXED); + screens[i].setfont(voicefont); seconds = audio_recorded_time() / HZ; @@ -1473,14 +1862,45 @@ } for(i = 0; i < screen_update; i++) - screens[i].puts(0, 0, buf); + screens[i].puts(0, 0, buf); + if (VOICEREC_global_settings_start_dir) + VOICEREC_start_dir = "st-"; + else + VOICEREC_start_dir = ""; + if (VOICEREC_global_settings_stop_after_rec) + VOICEREC_stop_after_rec = "OUT "; + else + VOICEREC_stop_after_rec = ""; + if(audio_stat & AUDIO_STATUS_PRERECORD) { - snprintf(buf, sizeof(buf), "%s...", str(LANG_SYSFONT_RECORD_PRERECORD)); + +/********************************************************* MY CHANGE ********************/ + FOR_NB_SCREENS(i) + { + snprintf(buf, sizeof(buf), "%s%s%s", VOICEREC_stop_after_rec, VOICEREC_start_dir, VOICEREC_DIR(VOICEREC_dir_current)); + screens[i].puts(0, filename_offset[i] + PM_HEIGHT + 6, buf); + } + snprintf(buf, sizeof(buf), "%s %d", str(LANG_SYSFONT_RECORD_PRERECORD) , global_settings.rec_prerecord_time); } else { + FOR_NB_SCREENS(i) + { + if (VOICEREC_oldRecdir == VOICEREC_dir_current) + { + snprintf(buf, sizeof(buf), "%s%s%s", VOICEREC_stop_after_rec, VOICEREC_start_dir, VOICEREC_DIR(VOICEREC_dir_current)); + screens[i].puts(0, filename_offset[i] + PM_HEIGHT + 6, buf); + } + else + { + snprintf(buf, sizeof(buf), "%s%s%s->%s", VOICEREC_stop_after_rec, VOICEREC_start_dir, VOICEREC_DIR(VOICEREC_oldRecdir), VOICEREC_DIR(VOICEREC_dir_current)); + screens[i].puts(0, filename_offset[i] + PM_HEIGHT + 6, buf); + } + } +/********************************************************* MY CHANGE ********************/ + /* Display the split interval if the record timesplit is active */ if ((global_settings.rec_timesplit) && !(global_settings.rec_split_method)) @@ -1518,8 +1938,10 @@ filename[12]='\0'; } - snprintf(buf, sizeof(buf), "%s %s", - str(LANG_SYSFONT_RECORDING_FILENAME), filename); +/********************************************************* MY CHANGE ********************/ + snprintf(buf, sizeof(buf), "%s %s", "File:" , filename); +/********************************************************* MY CHANGE ********************/ + screens[i].puts(0, 2, buf); } } @@ -1925,7 +2347,7 @@ FOR_NB_SCREENS(i) { - screens[i].setfont(FONT_SYSFIXED); + screens[i].setfont(voicefont); screens[i].getstringsize("A",&w,&h); } @@ -2060,7 +2482,7 @@ FOR_NB_SCREENS(i) { - screens[i].setfont(FONT_SYSFIXED); + screens[i].setfont(voicefont); screens[i].getstringsize("A",&w,&h); } Index: apps/keymaps/keymap-e200.c =================================================================== --- apps/keymaps/keymap-e200.c (revision 15123) +++ apps/keymaps/keymap-e200.c (working copy) @@ -206,13 +206,23 @@ /** Recording Screen **/ static const struct button_mapping button_context_recscreen[] = { - { ACTION_REC_PAUSE, BUTTON_UP|BUTTON_REL, BUTTON_UP }, + +/********************************************************* MY CHANGE ********************/ + { ACTION_VOICEREC_SELECT, BUTTON_SELECT, BUTTON_NONE }, + { ACTION_VOICEREC_STEALTH, BUTTON_UP|BUTTON_REL, BUTTON_UP }, + { ACTION_VOICEREC_DIR, BUTTON_DOWN|BUTTON_REL, BUTTON_DOWN }, + { ACTION_VOICEREC_REC_LONG, BUTTON_REC|BUTTON_REPEAT, BUTTON_REC }, + { ACTION_VOICEREC_START_DIR, BUTTON_RIGHT, BUTTON_NONE }, + { ACTION_STOP_AFTER_REC, BUTTON_LEFT, BUTTON_NONE }, +/********************************************************* MY CHANGE ********************/ + +/* { ACTION_REC_PAUSE, BUTTON_UP|BUTTON_REL, BUTTON_UP },*/ { ACTION_STD_CANCEL, BUTTON_POWER|BUTTON_REL, BUTTON_POWER }, { ACTION_REC_NEWFILE, BUTTON_REC|BUTTON_REL, BUTTON_REC }, { ACTION_STD_MENU, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_SETTINGS_INC, BUTTON_RIGHT, BUTTON_NONE }, +/* { ACTION_SETTINGS_INC, BUTTON_RIGHT, BUTTON_NONE },*/ { ACTION_SETTINGS_INC, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_SETTINGS_DEC, BUTTON_LEFT, BUTTON_NONE }, +/* { ACTION_SETTINGS_DEC, BUTTON_LEFT, BUTTON_NONE },*/ { ACTION_SETTINGS_DEC, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, { ACTION_STD_PREV, BUTTON_SCROLL_UP, BUTTON_NONE }, { ACTION_STD_PREV, BUTTON_SCROLL_UP|BUTTON_REPEAT, BUTTON_NONE },