summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/recorder/recording.c31
-rw-r--r--apps/settings.c28
-rw-r--r--apps/settings.h5
-rw-r--r--apps/sound_menu.c6
4 files changed, 12 insertions, 58 deletions
diff --git a/apps/recorder/recording.c b/apps/recorder/recording.c
index fd9ea34be5..c51569ad31 100644
--- a/apps/recorder/recording.c
+++ b/apps/recorder/recording.c
@@ -491,8 +491,12 @@ void adjust_cursor(void)
491 491
492char *rec_create_filename(char *buffer) 492char *rec_create_filename(char *buffer)
493{ 493{
494 strncpy(buffer, global_settings.rec_path, MAX_PATH); 494 if(global_settings.rec_directory)
495 495 getcwd(buffer, MAX_PATH);
496 else
497 strncpy(buffer, rec_base_directory, MAX_PATH);
498
499
496#ifdef CONFIG_RTC 500#ifdef CONFIG_RTC
497 create_datetime_filename(buffer, buffer, "R", 501 create_datetime_filename(buffer, buffer, "R",
498 REC_FILE_ENDING(global_settings.rec_quality)); 502 REC_FILE_ENDING(global_settings.rec_quality));
@@ -506,16 +510,7 @@ char *rec_create_filename(char *buffer)
506int rec_create_directory(void) 510int rec_create_directory(void)
507{ 511{
508 int rc; 512 int rc;
509 DIR* dir; 513
510
511 dir = opendir(global_settings.rec_path);
512 if (dir == NULL)
513 {
514 strncpy(global_settings.rec_path, rec_base_directory, MAX_PATH);
515 global_settings.rec_directory = false;
516 }
517 else
518 closedir(dir);
519 /* Try to create the base directory if needed */ 514 /* Try to create the base directory if needed */
520 if(global_settings.rec_directory == 0) 515 if(global_settings.rec_directory == 0)
521 { 516 {
@@ -833,10 +828,6 @@ bool recording_screen(bool no_source)
833 828
834 global_settings.recscreen_on = true; 829 global_settings.recscreen_on = true;
835 cursor = 0; 830 cursor = 0;
836
837 if (strlen(global_settings.rec_path) == 0)
838 strncpy(global_settings.rec_path, rec_base_directory, MAX_PATH);
839
840#if (CONFIG_LED == LED_REAL) && !defined(SIMULATOR) 831#if (CONFIG_LED == LED_REAL) && !defined(SIMULATOR)
841 ata_set_led_enabled(false); 832 ata_set_led_enabled(false);
842#endif 833#endif
@@ -1729,12 +1720,10 @@ bool recording_screen(bool no_source)
1729 /* draw the trigger status */ 1720 /* draw the trigger status */
1730 if (peak_meter_trigger_status() != TRIG_OFF) 1721 if (peak_meter_trigger_status() != TRIG_OFF)
1731 { 1722 {
1732 peak_meter_draw_trig(LCD_WIDTH - TRIG_WIDTH, filename_offset[0] + 1723 peak_meter_draw_trig(LCD_WIDTH - TRIG_WIDTH, 4 * h);
1733 PM_HEIGHT + line[0]);
1734 for(i = 0; i < screen_update; i++){ 1724 for(i = 0; i < screen_update; i++){
1735 screens[i].update_rect(LCD_WIDTH - (TRIG_WIDTH + 2), 1725 screens[i].update_rect(LCD_WIDTH - (TRIG_WIDTH + 2), 4 * h,
1736 filename_offset[0] + PM_HEIGHT + 1726 TRIG_WIDTH + 2, TRIG_HEIGHT);
1737 line[0], + 2, TRIG_HEIGHT);
1738 } 1727 }
1739 } 1728 }
1740 } 1729 }
diff --git a/apps/settings.c b/apps/settings.c
index 87d0724b48..ee7fa36d39 100644
--- a/apps/settings.c
+++ b/apps/settings.c
@@ -74,7 +74,6 @@
74#ifdef HAVE_LCD_COLOR 74#ifdef HAVE_LCD_COLOR
75#include "backdrop.h" 75#include "backdrop.h"
76#endif 76#endif
77#include "tree.h"
78 77
79#ifdef CONFIG_TUNER 78#ifdef CONFIG_TUNER
80#include "radio.h" 79#include "radio.h"
@@ -1014,11 +1013,6 @@ int settings_save( void )
1014 MAX_FILENAME); 1013 MAX_FILENAME);
1015 i+= MAX_FILENAME; 1014 i+= MAX_FILENAME;
1016#endif 1015#endif
1017#ifdef HAVE_RECORDING
1018 strncpy((char *)&config_block[i], (char *)global_settings.rec_path,
1019 MAX_PATH);
1020 i+= MAX_PATH;
1021#endif
1022 1016
1023 if(save_config_buffer()) 1017 if(save_config_buffer())
1024 { 1018 {
@@ -1416,11 +1410,6 @@ void settings_load(int which)
1416 MAX_FILENAME); 1410 MAX_FILENAME);
1417 i+= MAX_FILENAME; 1411 i+= MAX_FILENAME;
1418#endif 1412#endif
1419#ifdef HAVE_RECORDING
1420 strncpy((char *)global_settings.rec_path, (char *)&config_block[i],
1421 MAX_PATH);
1422 i+= MAX_PATH;
1423#endif
1424 } 1413 }
1425} 1414}
1426 1415
@@ -1780,11 +1769,6 @@ bool settings_save_config(void)
1780 global_settings.kbd_file); 1769 global_settings.kbd_file);
1781#endif 1770#endif
1782 1771
1783#ifdef HAVE_RECORDING
1784 if (global_settings.rec_path[0] != 0)
1785 fdprintf(fd, "recording path: %s\r\n", global_settings.rec_path);
1786#endif
1787
1788 /* here's the action: write values to file, specified via table */ 1772 /* here's the action: write values to file, specified via table */
1789 save_cfg_table(rtc_bits, sizeof(rtc_bits)/sizeof(rtc_bits[0]), fd); 1773 save_cfg_table(rtc_bits, sizeof(rtc_bits)/sizeof(rtc_bits[0]), fd);
1790 save_cfg_table(hd_bits, sizeof(hd_bits)/sizeof(hd_bits[0]), fd); 1774 save_cfg_table(hd_bits, sizeof(hd_bits)/sizeof(hd_bits[0]), fd);
@@ -1879,9 +1863,6 @@ void settings_reset(void) {
1879#ifdef HAVE_LCD_BITMAP 1863#ifdef HAVE_LCD_BITMAP
1880 global_settings.kbd_file[0] = '\0'; 1864 global_settings.kbd_file[0] = '\0';
1881#endif 1865#endif
1882#ifdef HAVE_RECORDING
1883 global_settings.rec_path[0] = '\0';
1884#endif
1885 global_settings.hold_lr_for_scroll_in_list = true; 1866 global_settings.hold_lr_for_scroll_in_list = true;
1886} 1867}
1887 1868
@@ -2167,12 +2148,3 @@ void settings_apply_trigger(void)
2167 ); 2148 );
2168} 2149}
2169#endif 2150#endif
2170#ifdef HAVE_RECORDING
2171void set_recpath(void)
2172{
2173 if(global_settings.rec_directory)
2174 getcwd(global_settings.rec_path, MAX_PATH);
2175 else
2176 strncpy(global_settings.rec_path, rec_base_directory, MAX_PATH);
2177}
2178#endif
diff --git a/apps/settings.h b/apps/settings.h
index 59de1642e7..3e0b8fcd11 100644
--- a/apps/settings.h
+++ b/apps/settings.h
@@ -242,9 +242,7 @@ struct user_settings
242 unsigned char font_file[MAX_FILENAME+1]; /* last font */ 242 unsigned char font_file[MAX_FILENAME+1]; /* last font */
243 unsigned char wps_file[MAX_FILENAME+1]; /* last wps */ 243 unsigned char wps_file[MAX_FILENAME+1]; /* last wps */
244 unsigned char lang_file[MAX_FILENAME+1]; /* last language */ 244 unsigned char lang_file[MAX_FILENAME+1]; /* last language */
245#ifdef HAVE_RECORDING 245
246 unsigned char rec_path[MAX_PATH+1]; /* path for recorded files */
247#endif
248 /* misc options */ 246 /* misc options */
249 247
250 int repeat_mode; /* 0=off 1=repeat all 2=repeat one 3=shuffle 4=ab */ 248 int repeat_mode; /* 0=off 1=repeat all 2=repeat one 3=shuffle 4=ab */
@@ -534,7 +532,6 @@ void set_file(char* filename, char* setting, int maxlen);
534unsigned int rec_timesplit_seconds(void); 532unsigned int rec_timesplit_seconds(void);
535unsigned long rec_sizesplit_bytes(void); 533unsigned long rec_sizesplit_bytes(void);
536void settings_apply_trigger(void); 534void settings_apply_trigger(void);
537void set_recpath(void);
538 535
539/* global settings */ 536/* global settings */
540extern struct user_settings global_settings; 537extern struct user_settings global_settings;
diff --git a/apps/sound_menu.c b/apps/sound_menu.c
index da779d9a30..e80c2c0a3b 100644
--- a/apps/sound_menu.c
+++ b/apps/sound_menu.c
@@ -520,17 +520,13 @@ static bool recprerecord(void)
520 520
521static bool recdirectory(void) 521static bool recdirectory(void)
522{ 522{
523 bool ret;
524 static const struct opt_items names[] = { 523 static const struct opt_items names[] = {
525 { rec_base_directory, -1 }, 524 { rec_base_directory, -1 },
526 { STR(LANG_RECORD_CURRENT_DIR) } 525 { STR(LANG_RECORD_CURRENT_DIR) }
527 }; 526 };
528 ret = set_option(str(LANG_RECORD_DIRECTORY), 527 return set_option(str(LANG_RECORD_DIRECTORY),
529 &global_settings.rec_directory, INT, 528 &global_settings.rec_directory, INT,
530 names, 2, NULL ); 529 names, 2, NULL );
531 set_recpath();
532
533 return ret;
534} 530}
535 531
536static bool reconstartup(void) 532static bool reconstartup(void)