Fix Some Absolute Directory Path Issues(WIP); #261

This commit is contained in:
lwvmobile
2024-05-19 16:32:27 -04:00
parent 2c55a9caab
commit 5d3b2ec56f
2 changed files with 13 additions and 13 deletions

View File

@@ -580,7 +580,7 @@ initOpts (dsd_opts * opts)
opts->split = 0; opts->split = 0;
opts->playoffset = 0; opts->playoffset = 0;
opts->playoffsetR = 0; opts->playoffsetR = 0;
sprintf (opts->wav_out_dir, "%s", "WAV"); sprintf (opts->wav_out_dir, "%s", "./WAV");
opts->mbe_out_dir[0] = 0; opts->mbe_out_dir[0] = 0;
opts->mbe_out_file[0] = 0; opts->mbe_out_file[0] = 0;
opts->mbe_out_fileR[0] = 0; //second slot on a TDMA system opts->mbe_out_fileR[0] = 0; //second slot on a TDMA system
@@ -2064,8 +2064,8 @@ main (int argc, char **argv)
mkdir(wav_file_directory, 0700); //user read write execute, needs execute for some reason or segfault mkdir(wav_file_directory, 0700); //user read write execute, needs execute for some reason or segfault
} }
fprintf (stderr,"AUTO and NXDN Per Call Wav File Saving Enabled. (NCurses Terminal Only)\n"); fprintf (stderr,"AUTO and NXDN Per Call Wav File Saving Enabled. (NCurses Terminal Only)\n");
sprintf (opts.wav_out_file, "./%s/DSD-FME-X1.wav", opts.wav_out_dir); sprintf (opts.wav_out_file, "%s/DSD-FME-X1.wav", opts.wav_out_dir);
sprintf (opts.wav_out_fileR, "./%s/DSD-FME-X2.wav", opts.wav_out_dir); sprintf (opts.wav_out_fileR, "%s/DSD-FME-X2.wav", opts.wav_out_dir);
opts.dmr_stereo_wav = 1; opts.dmr_stereo_wav = 1;
openWavOutFileL (&opts, &state); openWavOutFileL (&opts, &state);
openWavOutFileR (&opts, &state); openWavOutFileR (&opts, &state);

View File

@@ -718,8 +718,8 @@ void ncursesMenu (dsd_opts * opts, dsd_state * state)
} }
opts->dmr_stereo_wav = 1; opts->dmr_stereo_wav = 1;
//catch all in case of no file name set, won't crash or something //catch all in case of no file name set, won't crash or something
sprintf (opts->wav_out_file, "./%s/DSD-FME-X1.wav", opts->wav_out_dir); // sprintf (opts->wav_out_file, "%s/DSD-FME-X1.wav", opts->wav_out_dir); //
sprintf (opts->wav_out_fileR, "./%s/DSD-FME-X2.wav", opts->wav_out_dir); // sprintf (opts->wav_out_fileR, "%s/DSD-FME-X2.wav", opts->wav_out_dir); //
openWavOutFileL (opts, state); openWavOutFileL (opts, state);
openWavOutFileR (opts, state); openWavOutFileR (opts, state);
@@ -2150,7 +2150,7 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state)
{ {
//close old first, assign name based on time and radio, open wav file //close old first, assign name based on time and radio, open wav file
closeWavOutFileL (opts, state); closeWavOutFileL (opts, state);
sprintf (opts->wav_out_file, "./%s/%s %s NXDN - RAN %d - TGT %d - SRC %d.wav", opts->wav_out_dir, datestr, timestr, rn, tgn, src); sprintf (opts->wav_out_file, "%s/%s %s NXDN - RAN %d - TGT %d - SRC %d.wav", opts->wav_out_dir, datestr, timestr, rn, tgn, src);
openWavOutFileL (opts, state); //testing for now, will want to move to per call later openWavOutFileL (opts, state); //testing for now, will want to move to per call later
} }
@@ -2195,7 +2195,7 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state)
{ {
//close old first, assign name based on time and radio, open wav file //close old first, assign name based on time and radio, open wav file
closeWavOutFileL (opts, state); closeWavOutFileL (opts, state);
sprintf (opts->wav_out_file, "./%s/%s %s MS - CC %d - TG %d - RD %d.wav", opts->wav_out_dir, datestr, timestr, dcc, tg, rd); sprintf (opts->wav_out_file, "%s/%s %s MS - CC %d - TG %d - RD %d.wav", opts->wav_out_dir, datestr, timestr, dcc, tg, rd);
openWavOutFileL (opts, state); //testing for now, will want to move to per call later openWavOutFileL (opts, state); //testing for now, will want to move to per call later
} }
@@ -2238,7 +2238,7 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state)
//close old first, assign name based on time and radio, open wav file //close old first, assign name based on time and radio, open wav file
closeWavOutFileL (opts, state); closeWavOutFileL (opts, state);
sprintf (opts->wav_out_file, "./%s/%s %s CC %d - TG %d - RD %d.wav", opts->wav_out_dir, datestr, timestr, dcc, tg, rd); sprintf (opts->wav_out_file, "%s/%s %s CC %d - TG %d - RD %d.wav", opts->wav_out_dir, datestr, timestr, dcc, tg, rd);
openWavOutFileL (opts, state); //testing for now, will want to move to per call later openWavOutFileL (opts, state); //testing for now, will want to move to per call later
} }
@@ -2280,7 +2280,7 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state)
{ {
//close old first, assign name based on time and radio, open wav file //close old first, assign name based on time and radio, open wav file
closeWavOutFileR (opts, state); closeWavOutFileR (opts, state);
sprintf (opts->wav_out_fileR, "./%s/%s %s CC %d - TG %d - RD %d.wav", opts->wav_out_dir, datestr, timestr, dcc, tgR, rdR); sprintf (opts->wav_out_fileR, "%s/%s %s CC %d - TG %d - RD %d.wav", opts->wav_out_dir, datestr, timestr, dcc, tgR, rdR);
openWavOutFileR (opts, state); //testing for now, will want to move to per call later openWavOutFileR (opts, state); //testing for now, will want to move to per call later
} }
@@ -2321,7 +2321,7 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state)
{ {
//close old first, assign name based on time and radio, open wav file //close old first, assign name based on time and radio, open wav file
closeWavOutFileL (opts, state); closeWavOutFileL (opts, state);
sprintf (opts->wav_out_file, "./%s/%s %s P1 - NAC %X - TGT %d - SRC %d.wav", opts->wav_out_dir, datestr, timestr, nc, tg, rd); sprintf (opts->wav_out_file, "%s/%s %s P1 - NAC %X - TGT %d - SRC %d.wav", opts->wav_out_dir, datestr, timestr, nc, tg, rd);
openWavOutFileL (opts, state); //testing for now, will want to move to per call later openWavOutFileL (opts, state); //testing for now, will want to move to per call later
} }
@@ -4344,7 +4344,7 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state)
if (c == 80) //'P' key - start per call wav files if (c == 80) //'P' key - start per call wav files
{ {
char wav_file_directory[1024]; char wav_file_directory[1024];
sprintf (wav_file_directory, "./%s", opts->wav_out_dir); sprintf (wav_file_directory, "%s", opts->wav_out_dir);
wav_file_directory[1023] = '\0'; wav_file_directory[1023] = '\0';
if (stat(wav_file_directory, &st_wav) == -1) if (stat(wav_file_directory, &st_wav) == -1)
{ {
@@ -4354,8 +4354,8 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state)
} }
opts->dmr_stereo_wav = 1; opts->dmr_stereo_wav = 1;
//catch all in case of no file name set, won't crash or something //catch all in case of no file name set, won't crash or something
sprintf (opts->wav_out_file, "./%s/DSD-FME-T1.wav", opts->wav_out_dir); sprintf (opts->wav_out_file, "%s/DSD-FME-T1.wav", opts->wav_out_dir);
sprintf (opts->wav_out_fileR, "./%s/DSD-FME-T2.wav", opts->wav_out_dir); sprintf (opts->wav_out_fileR, "%s/DSD-FME-T2.wav", opts->wav_out_dir);
openWavOutFileL (opts, state); openWavOutFileL (opts, state);
openWavOutFileR (opts, state); openWavOutFileR (opts, state);
} }