0139c353f71a4716ecf36571dd9676a7611bf710
[Faustine.git] / interpretor / libsndfile-1.0.25 / src / GSM610 / gsm_option.c
1 /*
2 * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische
3 * Universitaet Berlin. See the accompanying file "COPYRIGHT" for
4 * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE.
5 */
6
7 #include "gsm610_priv.h"
8
9 #include "gsm.h"
10
11 int gsm_option (gsm r, int opt, int * val)
12 {
13 int result = -1;
14
15 switch (opt) {
16 case GSM_OPT_LTP_CUT:
17 #ifdef LTP_CUT
18 result = r->ltp_cut;
19 if (val) r->ltp_cut = *val;
20 #endif
21 break;
22
23 case GSM_OPT_VERBOSE:
24 #ifndef NDEBUG
25 result = r->verbose;
26 if (val) r->verbose = *val;
27 #endif
28 break;
29
30 case GSM_OPT_FAST:
31
32 #if defined(FAST) && defined(USE_FLOAT_MUL)
33 result = r->fast;
34 if (val) r->fast = !!*val;
35 #endif
36 break;
37
38 case GSM_OPT_FRAME_CHAIN:
39
40 #ifdef WAV49
41 result = r->frame_chain;
42 if (val) r->frame_chain = *val;
43 #endif
44 break;
45
46 case GSM_OPT_FRAME_INDEX:
47
48 #ifdef WAV49
49 result = r->frame_index;
50 if (val) r->frame_index = *val;
51 #endif
52 break;
53
54 case GSM_OPT_WAV49:
55
56 #ifdef WAV49
57 result = r->wav_fmt;
58 if (val) r->wav_fmt = !!*val;
59 #endif
60 break;
61
62 default:
63 break;
64 }
65 return result;
66 }