1 /*-------------- Telecommunications & Signal Processing Lab ---------------
2                              McGill University
3 
4 Routine:
5   void AOsetFOopt (const struct AO_FOpar *FO)
6 
7 Purpose:
8   Set output file options
9 
10 Description:
11   This routine sets the input file options in the audio file options structure
12   from the input file parameter structure.
13 
14 Parameters:
15    -> const struct AO_FOpar *FO
16       Output file parameters
17 
18 Author / revision:
19   P. Kabal  Copyright (C) 2003
20   $Revision: 1.5 $  $Date: 2003/11/04 12:50:46 $
21 
22 -------------------------------------------------------------------------*/
23 
24 #include <string.h>
25 
26 #include <libtsp.h>
27 #include <libtsp/AFpar.h>
28 #include <AO.h>
29 
30 
31 void
AOsetFOopt(const struct AO_FOpar * FO)32 AOsetFOopt (const struct AO_FOpar *FO)
33 
34 {
35   int N;
36   struct AF_opt *AFopt;
37 
38   AFopt = AFoptions ();
39 
40   AFopt->Nframe = FO->Nframe;
41   AFopt->NbS = FO->DFormat.NbS;
42 
43   UTfree (AFopt->SpkrConfig);
44   if (FO->SpkrConfig != NULL) {
45     N = strlen ((const char *) FO->SpkrConfig);
46     AFopt->SpkrConfig = (unsigned char *) UTmalloc (N+1);
47     strcpy ((char *) AFopt->SpkrConfig, (const char *) FO->SpkrConfig);
48   }
49 
50   AFsetInfo (NULL);	/* Reset the info string */
51   AFsetInfo (FO->Info);
52 
53   return;
54 }
55