annotate src/cs/layer1/audio_cust0/l1audio_cust.c @ 699:f12872b7eb21

l1_init.c: sync with Tourmaline: L1 recovery ABB init fix
author Mychaela Falconia <falcon@freecalypso.org>
date Wed, 09 Jun 2021 18:04:26 +0000
parents b870b6a44d31
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
234
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1 /************* Revision Controle System Header *************
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2 * GSM Layer 1 software
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
3 * L1AUDIO_CUST.C
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
4 *
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
5 * Filename l1audio_cust.c
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
6 * Copyright 2003 (C) Texas Instruments
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
7 *
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
8 ************* Revision Controle System Header *************/
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
9
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
10 /************************************/
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
11 /* Include files... */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
12 /************************************/
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
13
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
14 #include "l1_macro.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
15 #include "l1_confg.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
16
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
17 #if (AUDIO_TASK == 1)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
18
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
19 #include "l1_types.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
20 #include "sys_types.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
21
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
22 #if (CODE_VERSION == SIMULATION) && (AUDIO_SIMULATION)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
23
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
24 #include "tc_defs.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
25
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
26 #include <stdlib.h>
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
27 #include <string.h>
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
28
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
29 #include "iq.h" // Debug / Init hardware ("eva3.lib")
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
30 #include "l1_ver.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
31 #include "l1_const.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
32 #include "l1_signa.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
33
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
34 #if TESTMODE
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
35 #include "l1tm_defty.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
36 #endif
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
37
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
38 #include "l1audio_const.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
39 #include "l1audio_cust.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
40 #include "l1audio_defty.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
41 #include "l1audio_msgty.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
42 #include "l1audio_varex.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
43 #include "l1audio_signa.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
44
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
45 #if (L1_GTT == 1)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
46 #include "l1gtt_const.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
47 #include "l1gtt_defty.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
48 #endif
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
49
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
50 #if (L1_MP3 == 1)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
51 #include "l1mp3_defty.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
52 #endif
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
53
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
54 #if (L1_MIDI == 1)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
55 #include "l1midi_defty.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
56 #endif
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
57
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
58 #if (L1_AAC == 1)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
59 #include "l1aac_defty.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
60 #endif
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
61 #include "l1_defty.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
62 #include "cust_os.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
63 #include "l1_msgty.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
64 #include "l1_varex.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
65
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
66 #include "l1_mftab.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
67 #include "l1_tabs.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
68 #include "l1_ctl.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
69
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
70
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
71 #include "l1_time.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
72 #include "l1_scen.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
73
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
74 #if L1_GPRS
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
75 #include "l1p_cons.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
76 #include "l1p_msgt.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
77 #include "l1p_deft.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
78 #include "l1p_vare.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
79 #include "l1p_tabs.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
80 #include "l1p_macr.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
81 #include "l1p_sign.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
82 #endif
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
83
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
84 #include "sim_cfg.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
85 #include "sim_cons.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
86 #include "sim_def.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
87 #include "sim_var.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
88 #include "sim_prot.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
89
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
90 #include "audio_sim_cons.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
91 #include "audio_sim_def.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
92 #include "mmi_simul.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
93 #include "audio_sim_var.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
94
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
95 #else
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
96 // Layer1 and debug include files.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
97
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
98 #include <ctype.h>
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
99 #include <string.h>
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
100 #include <math.h>
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
101 #include "l1_ver.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
102 #include "l1_const.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
103 #include "l1_signa.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
104
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
105 #if TESTMODE
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
106 #include "l1tm_defty.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
107 #endif
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
108
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
109 #include "l1audio_const.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
110 #include "l1audio_cust.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
111 #include "l1audio_defty.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
112 #include "l1audio_msgty.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
113 #include "l1audio_varex.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
114 #include "l1audio_signa.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
115
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
116 #if (L1_GTT == 1)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
117 #include "l1gtt_const.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
118 #include "l1gtt_defty.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
119 #endif
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
120
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
121 #if (L1_MP3 == 1)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
122 #include "l1mp3_defty.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
123 #endif
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
124
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
125 #if (L1_MIDI == 1)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
126 #include "l1midi_defty.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
127 #endif
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
128
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
129 #include "l1_defty.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
130 #include "cust_os.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
131 #include "l1_msgty.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
132 #include "tpudrv.h" // TPU drivers. ("eva3.lib")
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
133 #include "l1_varex.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
134
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
135 #include "l1_proto.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
136 #include "l1_mftab.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
137 #include "l1_tabs.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
138 #include "mem.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
139 #include "armio.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
140 #include "timer.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
141 #include "timer1.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
142 #include "dma.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
143 #include "inth.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
144 #include "ulpd.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
145 #include "rhea_arm.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
146 #include "clkm.h" // Clockm ("eva3.lib")
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
147 #include "l1_ctl.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
148
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
149 #include "l1_time.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
150 #if L2_L3_SIMUL
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
151 #include "l1_scen.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
152 #endif
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
153 #if (AUDIO_L1_STANDALONE)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
154 #include "mmi_simul.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
155 #endif
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
156
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
157 #if (OP_RIV_AUDIO == 1)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
158 #if (MELODY_E1) || (VOICE_MEMO) || (SPEECH_RECO) || (L1_EXT_AUDIO_MGT) || (MELODY_E2)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
159 #include "rv_general.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
160 #include "audio_api.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
161 #include "audio_structs_i.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
162 #include "audio_var_i.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
163 #include "audio_ffs_i.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
164 #include "audio_const_i.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
165 #include "audio_error_hdlr_i.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
166 #include "ffs/ffs_api.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
167 #include "audio_macro_i.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
168 #endif
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
169 #endif
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
170
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
171 #endif
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
172
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
173 #include "l1_trace.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
174 //extern void L1_trace_string(char *s);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
175 //extern void L1_trace_char (char s);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
176
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
177 /**************************************/
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
178 /* Prototypes for L1 ASYNCH task */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
179 /**************************************/
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
180 #if (SPEECH_RECO)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
181 void Cust_srback_save_model (UWORD8 database, UWORD8 index, API *RAM_address);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
182 void Cust_srback_save_speech (UWORD8 database, UWORD8 index, UWORD16 *start_buffer, UWORD16 *stop_buffer, UWORD16 *start_speech, UWORD16 *stop_speech);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
183 void Cust_srback_load_model (UWORD8 database, UWORD8 index, API *RAM_address);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
184 #endif
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
185 UWORD8 Cust_get_pointer (UWORD16 **ptr, UWORD16 *buffer_size, UWORD8 session_id);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
186
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
187 #if (L1_EXT_AUDIO_MGT)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
188 void Cust_ext_audio_mgt_hisr(void);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
189 #endif
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
190 void l1a_bt_audio_noti_process(void);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
191
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
192 /**************************************/
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
193 /* External prototypes */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
194 /**************************************/
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
195 #if (OP_RIV_AUDIO == 1)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
196 #if (SPEECH_RECO)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
197 extern void audio_sr_error_trace(UINT8 error_id);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
198 #endif
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
199 #endif
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
200
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
201
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
202 /***************************************/
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
203 /* Global variables for MP3 management */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
204 /***************************************/
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
205 #if (L1_MP3 == 1)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
206 UWORD8 mp3_tempbuf_idx;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
207 UWORD16 Cust_get_pointer_mp3_last_buffer_size;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
208 BOOL Cust_get_pointer_mp3_buffer_last;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
209 #endif
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
210
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
211 /***************************************/
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
212 /* Global variables for AAC management */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
213 /***************************************/
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
214 #if (L1_AAC == 1)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
215 UWORD8 aac_tempbuf_idx;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
216 UWORD16 Cust_get_pointer_aac_last_buffer_size;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
217 BOOL Cust_get_pointer_aac_buffer_last;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
218 #endif
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
219
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
220 /*
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
221 * FreeCalypso TCS211 reconstruction: the following unused trivial
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
222 * function has been reconstruction in order to aid the diffing
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
223 * of the functions that follow.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
224 */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
225 void audio_test_callback(void *buffer)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
226 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
227 rvf_free_buf(buffer);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
228 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
229
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
230 #if (SPEECH_RECO)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
231 /*-------------------------------------------------------*/
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
232 /* Cust_srback_save_model() */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
233 /*-------------------------------------------------------*/
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
234 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
235 /* Parameters : database */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
236 /* index */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
237 /* RAM_address */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
238 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
239 /* Return : none */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
240 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
241 /* Description : save the model into a database. */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
242 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
243 /*-------------------------------------------------------*/
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
244 void Cust_srback_save_model (UWORD8 database, UWORD8 index, API *RAM_address)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
245 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
246 #if (AUDIO_SIMULATION) || (AUDIO_L1_STANDALONE)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
247 UWORD16 model_size;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
248 UWORD16 *ptr_dst;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
249 UWORD8 frame_size;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
250
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
251 // initialize the pointer to the database
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
252 ptr_dst = sr_mmi_database[database][index].model;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
253
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
254 // look the size of the model in model frame unit (16 words unit)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
255 model_size = *RAM_address++;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
256
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
257 // save the header of the model
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
258 *ptr_dst++ = model_size;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
259
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
260 while( (model_size != 0) &&
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
261 (l1_srback_com.emergency_stop == FALSE) )
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
262 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
263 frame_size = SC_SR_MODEL_FRAME_SIZE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
264
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
265 while ( (frame_size != 0) &&
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
266 (l1_srback_com.emergency_stop == FALSE) )
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
267 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
268 *ptr_dst++ = *RAM_address++;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
269 frame_size--;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
270 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
271
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
272 model_size--;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
273 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
274 #endif
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
275
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
276 #if (OP_RIV_AUDIO == 1)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
277 T_FFS_FD ffs_fd;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
278 UWORD16 model_size;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
279 UWORD8 i;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
280 char *p_model_path;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
281
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
282 if (p_audio_gbl_var->speech_reco.sr_enroll.state != AUDIO_SR_ENROLL_IDLE)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
283 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
284 ffs_fd = p_audio_gbl_var->speech_reco.sr_enroll.sr_ffs_fd;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
285 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
286 else
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
287 if (p_audio_gbl_var->speech_reco.sr_update.state != AUDIO_SR_UPDATE_IDLE)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
288 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
289 /* reach the path of the corresponding model */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
290 p_model_path = p_audio_gbl_var->speech_reco.sr_update.p_database;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
291 for (i=0; i<index; i++)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
292 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
293 p_model_path += AUDIO_PATH_NAME_MAX_SIZE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
294 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
295
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
296 ffs_fd = ffs_open(p_model_path,
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
297 FFS_O_CREATE | FFS_O_WRONLY | FFS_O_TRUNC | FFS_O_APPEND);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
298 if ( ffs_fd <= 0)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
299 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
300 audio_sr_error_trace(AUDIO_ENTITY_MODEL_NO_SAVED);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
301 return;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
302 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
303 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
304
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
305 /* look the size of the model in model frame unit (16 words unit) */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
306 model_size = ((*RAM_address)<<1);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
307 model_size *= SC_SR_MODEL_FRAME_SIZE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
308
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
309 /* save the model in flash */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
310 if (ffs_write(ffs_fd, (void *)RAM_address, model_size) <= EFFS_OK)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
311 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
312 audio_sr_error_trace(AUDIO_ENTITY_MODEL_NO_SAVED);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
313 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
314
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
315 /* close the model file flash */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
316 if (ffs_close(ffs_fd) != EFFS_OK)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
317 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
318 audio_sr_error_trace(AUDIO_ENTITY_MODEL_NO_SAVED);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
319 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
320 #endif // OP_RIV_AUDIO
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
321 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
322
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
323 /*-------------------------------------------------------*/
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
324 /* Cust_srback_save_speech() */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
325 /*-------------------------------------------------------*/
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
326 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
327 /* Parameters : database */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
328 /* index */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
329 /* start_buffer */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
330 /* stop_buffer */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
331 /* start_speech */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
332 /* stop_speech */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
333 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
334 /* Return : none */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
335 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
336 /* Description : save the speech from a circular buffer */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
337 /* to a database. And add the end VM mask */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
338 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
339 /*-------------------------------------------------------*/
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
340 void Cust_srback_save_speech (UWORD8 database, UWORD8 index, UWORD16 *start_buffer, UWORD16 *stop_buffer, UWORD16 *start_speech, UWORD16 *stop_speech)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
341 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
342 #if (AUDIO_SIMULATION) || (AUDIO_L1_STANDALONE)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
343 UWORD16 *ptr_dst;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
344
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
345 // initialize the pointer to the database
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
346 ptr_dst = sr_mmi_database[database][index].speech;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
347
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
348 // The speech samples can be in two positions in the circular buffer:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
349
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
350 // Position 1:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
351 // [.............XXXXXXXXXXXXX.............]
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
352 // ^ ^ ^ ^
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
353 // | | | |
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
354 // start_buffer start_speech stop_speech stop_buffer
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
355 if (start_speech < stop_speech)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
356 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
357 while ( (start_speech < stop_speech) &&
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
358 (l1_srback_com.emergency_stop == FALSE) )
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
359 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
360 *ptr_dst++ = *start_speech++;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
361 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
362
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
363 // Write the end VM mask
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
364 *ptr_dst = SC_VM_END_MASK;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
365 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
366 else
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
367 // Position 2:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
368 // [XXXXXXXXXXXX..............XXXXXXXXXXXXX]
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
369 // ^ ^ ^ ^
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
370 // | | | |
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
371 // start_buffer stop_speech start_speech stop_buffer
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
372 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
373 while ( (start_speech < stop_buffer) &&
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
374 (l1_srback_com.emergency_stop == FALSE) )
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
375 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
376 *ptr_dst++ = *start_speech++;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
377 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
378
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
379 while ( (start_buffer < stop_speech) &&
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
380 (l1_srback_com.emergency_stop == FALSE) )
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
381 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
382 *ptr_dst++ = *start_buffer++;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
383 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
384
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
385 // Write the end VM mask
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
386 *ptr_dst = SC_VM_END_MASK;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
387 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
388 #endif
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
389
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
390 #if (OP_RIV_AUDIO == 1)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
391 T_FFS_FD ffs_fd;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
392 UWORD16 speech_size;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
393 char *p_model_path,
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
394 sr_speech_path[AUDIO_SR_PATH_NAME_MAX_SIZE];
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
395 UWORD8 i;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
396
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
397 if (p_audio_gbl_var->speech_reco.sr_enroll.state !=AUDIO_SR_ENROLL_IDLE )
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
398 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
399 ffs_fd = p_audio_gbl_var->speech_reco.sr_enroll.voice_ffs_fd;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
400 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
401 else
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
402 if (p_audio_gbl_var->speech_reco.sr_update.state != AUDIO_SR_UPDATE_IDLE)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
403 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
404 /* reach the path of the corresponding model */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
405 p_model_path = p_audio_gbl_var->speech_reco.sr_update.p_database;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
406 for (i=0; i<index; i++)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
407 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
408 p_model_path += AUDIO_PATH_NAME_MAX_SIZE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
409 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
410
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
411 /* build the speech path name */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
412 speech_size = ( strlen(p_model_path)- 3);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
413 strncpy(sr_speech_path, p_model_path, speech_size);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
414 sr_speech_path[speech_size] = 0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
415
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
416 ffs_fd = ffs_open(sr_speech_path,
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
417 FFS_O_CREATE | FFS_O_WRONLY | FFS_O_TRUNC | FFS_O_APPEND);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
418 if (ffs_fd <= 0)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
419 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
420 audio_sr_error_trace(AUDIO_ENTITY_SPEECH_NO_SAVED);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
421 return;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
422 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
423 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
424
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
425 // The speech samples can be in two positions in the circular buffer:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
426
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
427 // Position 1:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
428 // [.............XXXXXXXXXXXXX.............]
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
429 // ^ ^ ^ ^
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
430 // | | | |
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
431 // start_buffer start_speech stop_speech stop_buffer
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
432 if (start_speech < stop_speech)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
433 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
434 /* Calculate the size of the speech file */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
435 speech_size = (stop_speech - start_speech)<<1;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
436
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
437 /* save the model in flash */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
438 if (ffs_write(ffs_fd, (void *)start_speech, speech_size) <= EFFS_OK)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
439 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
440 audio_sr_error_trace(AUDIO_ENTITY_SPEECH_NO_SAVED);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
441 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
442 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
443 else
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
444 // Position 2:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
445 // [XXXXXXXXXXXX..............XXXXXXXXXXXXX]
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
446 // ^ ^ ^ ^
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
447 // | | | |
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
448 // start_buffer stop_speech start_speech stop_buffer
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
449 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
450 /* Calculate the size of the speech file */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
451 speech_size = (stop_buffer - start_speech)<<1;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
452
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
453 /* save the model in flash */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
454 if (ffs_write(ffs_fd, (void *)start_speech, speech_size) <= EFFS_OK)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
455 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
456 audio_sr_error_trace(AUDIO_ENTITY_SPEECH_NO_SAVED);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
457 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
458
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
459 /* Calculate the size of the speech file */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
460 speech_size = (stop_speech - start_buffer)<<1;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
461
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
462 /* save the model in flash */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
463 if (ffs_write(ffs_fd, (void *)start_speech, speech_size) <= EFFS_OK)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
464 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
465 audio_sr_error_trace(AUDIO_ENTITY_SPEECH_NO_SAVED);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
466 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
467 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
468 // Write the end VM mask
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
469 speech_size = SC_VM_END_MASK;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
470 if (ffs_write(ffs_fd, (void *)(&speech_size), 2) <= EFFS_OK)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
471 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
472 audio_sr_error_trace(AUDIO_ENTITY_MODEL_NO_SAVED);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
473 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
474
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
475 /* close the speech file flash */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
476 if (ffs_close(ffs_fd) != EFFS_OK)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
477 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
478 audio_sr_error_trace(AUDIO_ENTITY_MODEL_NO_SAVED);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
479 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
480 #endif // OP_RIV_AUDIO
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
481 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
482
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
483 /*-------------------------------------------------------*/
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
484 /* Cust_srback_load_model() */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
485 /*-------------------------------------------------------*/
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
486 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
487 /* Parameters : database */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
488 /* index */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
489 /* RAM_address */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
490 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
491 /* Return : none */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
492 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
493 /* Description : load the model into the API. */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
494 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
495 /*-------------------------------------------------------*/
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
496 void Cust_srback_load_model (UWORD8 database, UWORD8 index, API *RAM_address)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
497 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
498 #if (AUDIO_SIMULATION) || (AUDIO_L1_STANDALONE)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
499 UWORD16 model_size;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
500 UWORD16 *ptr_src;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
501 UWORD8 frame_size;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
502
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
503 // initialize the pointer to the database
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
504 ptr_src = sr_mmi_database[database][index].model;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
505
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
506 // look the size of the model in model frame unit (16 words unit)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
507 model_size = *ptr_src++;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
508
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
509 // save the header of the model
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
510 *RAM_address++ = model_size;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
511
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
512 while( (model_size != 0) &&
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
513 (l1_srback_com.emergency_stop == FALSE) )
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
514 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
515 frame_size = SC_SR_MODEL_FRAME_SIZE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
516 while ( (frame_size != 0) &&
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
517 (l1_srback_com.emergency_stop == FALSE) )
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
518 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
519 *RAM_address++ = *ptr_src++;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
520 frame_size--;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
521 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
522 model_size--;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
523 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
524 #endif
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
525
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
526 #if (OP_RIV_AUDIO == 1)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
527 char *p_model_path;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
528 T_FFS_FD ffs_fd;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
529 UWORD8 i;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
530
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
531 if (p_audio_gbl_var->speech_reco.sr_reco.state !=AUDIO_SR_RECO_IDLE )
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
532 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
533 p_model_path = p_audio_gbl_var->speech_reco.sr_reco.p_database;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
534 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
535 else
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
536 if (p_audio_gbl_var->speech_reco.sr_update.state != AUDIO_SR_UPDATE_IDLE)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
537 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
538 p_model_path = p_audio_gbl_var->speech_reco.sr_update.p_database;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
539 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
540
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
541 /* reach the path of the corresponding model */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
542 for (i=0; i<index; i++)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
543 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
544 p_model_path += AUDIO_PATH_NAME_MAX_SIZE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
545 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
546
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
547 /* open the model file flash */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
548 ffs_fd = ffs_open(p_model_path, FFS_O_RDONLY);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
549 if ( ffs_fd <= 0)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
550 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
551 audio_sr_error_trace(AUDIO_ENTITY_MODEL_NO_LOAD);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
552 return;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
553 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
554
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
555 /* download the model to the API buffer */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
556 if (ffs_read(ffs_fd, (void *)RAM_address, (SC_SR_MODEL_API_SIZE<<1)) <= EFFS_OK)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
557 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
558 audio_sr_error_trace(AUDIO_ENTITY_MODEL_NO_LOAD);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
559 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
560
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
561 /* close the model file flash */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
562 if (ffs_close(ffs_fd) != EFFS_OK)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
563 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
564 audio_sr_error_trace(AUDIO_ENTITY_MODEL_NO_LOAD);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
565 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
566 #endif // OP_RIV_AUDIO
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
567 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
568 #endif // SPEECH_RECO
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
569
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
570 /*-------------------------------------------------------*/
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
571 /* Cust_get_pointer */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
572 /*-------------------------------------------------------*/
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
573 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
574 /* Parameters : ptr */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
575 /* buffer_size */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
576 /* session_id */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
577 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
578 /* Return : error_id : */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
579 /* DATA_AVAILABLE: 0, no error occured */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
580 /* SESSION_ERROR: 1, wrong session id */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
581 /* POINTER_ERROR: 2, wrong ptr */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
582 /* DATA_AVAIL_ERROR: 3, no more data */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
583 /* available */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
584 /* DATA_LAST: 4, last buffer available */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
585 /* buffer_size */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
586 /* ptr */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
587 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
588 /* Description : */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
589 /* The L1 calls this function to request new data buffer */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
590 /* (requested size: buffer_size). This function returns */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
591 /* the description of the new data buffer */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
592 /* (start address: ptr and the size: buffer_size) */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
593 /* Moreover, the L1 indicates the position of the last */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
594 /* data used via the ptr argument. */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
595 /* Note that this function can be returns an error. */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
596 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
597 /*-------------------------------------------------------*/
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
598 UWORD8 Cust_get_pointer (UWORD16 **ptr, UWORD16 *buffer_size, UWORD8 session_id)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
599 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
600 #if (AUDIO_SIMULATION) || (AUDIO_L1_STANDALONE)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
601
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
602 UWORD8 database_id, word_index;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
603
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
604 switch (session_id & 0x0F)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
605 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
606 #if (MELODY_E1)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
607 // Melody E1 0
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
608 case 0:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
609 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
610 if (*ptr == NULL)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
611 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
612 *ptr = (UWORD16 *)&melody_0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
613 *buffer_size = SC_MELODY_0_SCORE_SIZE>>1;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
614 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
615 else
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
616 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
617 *buffer_size = SC_MELODY_0_SCORE_SIZE>>1;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
618 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
619
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
620 return(DATA_AVAILABLE);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
621 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
622 //omaps00090550 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
623
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
624 // Melody E1 1
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
625 case 1:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
626 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
627 if (*ptr == NULL)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
628 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
629 *ptr = (UWORD16 *)&melody_1;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
630 *buffer_size = SC_MELODY_1_SCORE_SIZE>>1;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
631 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
632 else
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
633 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
634 *buffer_size = SC_MELODY_1_SCORE_SIZE>>1;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
635 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
636
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
637 return(DATA_AVAILABLE);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
638 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
639 //omaps00090550 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
640 #endif // MELODY_E1
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
641 #if (VOICE_MEMO)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
642 // Voice memo play
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
643 case 2:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
644 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
645 if (*ptr == NULL)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
646 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
647 *ptr = (UWORD16 *)&voice_memo_buffer;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
648 *buffer_size = SC_VM_BUFFER_SIZE>>1;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
649 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
650 else
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
651 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
652 *buffer_size = (SC_VM_BUFFER_SIZE>>1) + 1;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
653 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
654
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
655 return(DATA_AVAILABLE);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
656 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
657 //omaps00090550 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
658
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
659 // Voice memo record
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
660 case 3:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
661 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
662 if (*ptr == NULL)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
663 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
664 *ptr = (UWORD16 *)&voice_memo_buffer;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
665 *buffer_size = SC_VM_BUFFER_SIZE>>1;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
666 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
667 else
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
668 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
669 *buffer_size = (SC_VM_BUFFER_SIZE>>1) + 1;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
670 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
671
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
672 return(DATA_AVAILABLE);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
673 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
674 //omaps00090550 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
675 #endif // VOICE_MEMO
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
676 #if (SPEECH_RECO)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
677 case 4:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
678 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
679 database_id = 0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
680 word_index = (session_id & 0xF0)>>4;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
681 *ptr = (UWORD16 *)&(sr_mmi_database[database_id][word_index].speech);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
682
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
683 *buffer_size = SC_SR_MMI_DB_SPEECH_SIZE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
684
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
685 return(DATA_AVAILABLE);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
686 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
687 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
688
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
689 case 5:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
690 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
691 database_id = 1;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
692 word_index = (session_id & 0xF0)>>4;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
693 *ptr = (UWORD16 *)&(sr_mmi_database[database_id][word_index].speech);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
694
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
695 *buffer_size = SC_SR_MMI_DB_SPEECH_SIZE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
696
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
697 return(DATA_AVAILABLE);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
698 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
699 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
700 #endif // SPEECH_RECO
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
701 #if (MELODY_E2 && FIR)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
702 // Melody E2
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
703 // Tchaikowski
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
704 case 6:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
705 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
706 if (*ptr == NULL)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
707 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
708 *ptr = (UWORD16 *)&Tchaikowski_danse_russe;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
709 *buffer_size = TCHAIKOWSKI_DANSE_RUSSE>>1;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
710 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
711 else
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
712 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
713 *buffer_size = TCHAIKOWSKI_DANSE_RUSSE>>1;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
714 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
715
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
716 return(DATA_AVAILABLE);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
717 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
718 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
719
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
720 // Small melody
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
721 case 7:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
722 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
723 if (*ptr == NULL)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
724 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
725 *ptr = (UWORD16 *)&Small_melody_E2;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
726 *buffer_size = SMALL_MELODY_E2>>1;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
727 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
728 else
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
729 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
730 *buffer_size = SMALL_MELODY_E2>>1;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
731 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
732
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
733 return(DATA_AVAILABLE);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
734 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
735 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
736
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
737 // CPU load
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
738 case 8:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
739 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
740 if (*ptr == NULL)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
741 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
742 *ptr = (UWORD16 *)&Cpu_load_E2;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
743 *buffer_size = CPU_LOAD_E2>>1;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
744 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
745 else
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
746 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
747 *buffer_size = CPU_LOAD_E2>>1;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
748 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
749
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
750 return(DATA_AVAILABLE);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
751 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
752 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
753
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
754 // USA hymn
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
755 case 9:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
756 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
757 if (*ptr == NULL)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
758 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
759 *ptr = (UWORD16 *)&Usa_E2;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
760 *buffer_size = USA_E2>>1;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
761 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
762 else
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
763 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
764 *buffer_size = USA_E2>>1;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
765 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
766
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
767 return(DATA_AVAILABLE);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
768 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
769 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
770 #endif // MELODY_E2
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
771 #if (L1_VOICE_MEMO_AMR)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
772 // Voice memo amr play
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
773 case 10:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
774 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
775 if (*ptr == NULL)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
776 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
777 *ptr = (UWORD16 *)&voice_memo_buffer;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
778 *buffer_size = SC_VM_BUFFER_SIZE>>1;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
779 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
780 else
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
781 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
782 *buffer_size = (SC_VM_BUFFER_SIZE>>1) + 1;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
783 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
784
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
785 return(DATA_AVAILABLE);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
786 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
787 //omaps00090550 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
788
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
789 // Voice memo record
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
790 case 11:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
791 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
792 if (*ptr == NULL)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
793 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
794 *ptr = (UWORD16 *)&voice_memo_buffer;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
795 *buffer_size = SC_VM_BUFFER_SIZE>>1;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
796 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
797 else
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
798 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
799 *buffer_size = (SC_VM_BUFFER_SIZE>>1) + 1;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
800 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
801
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
802 return(DATA_AVAILABLE);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
803 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
804 //omaps00090550 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
805 #endif // L1_VOICE_MEMO_AMR
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
806
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
807 #if (L1_MIDI == 1)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
808 // MIDI
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
809 case 12:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
810 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
811 extern struct MIDI_FILE midi_file;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
812 UWORD8 **ptr_char=(UWORD8 **)ptr;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
813 static UWORD8 *last_ptr;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
814
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
815 if(*ptr_char==NULL)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
816 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
817 midi_file_offset=0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
818 *ptr_char=&(midi_file.midi_file_buffer[0]);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
819 last_ptr=*ptr_char;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
820
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
821 // All MIDI file available due to SMF1 format constraints
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
822 // For SMF0, *buffer_size should be set to MIDI_BUFFER_SIZE
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
823 *buffer_size=midi_file.midi_file_size;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
824 return DATA_LAST;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
825 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
826 else
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
827 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
828 *buffer_size=MIDI_BUFFER_SIZE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
829 *ptr_char=last_ptr+MIDI_BUFFER_SIZE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
830
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
831 // Check if pointer is out of bounds
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
832 if(*ptr_char > &(midi_file.midi_file_buffer[0])+midi_file.midi_file_size-1)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
833 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
834 *ptr_char=&(midi_file.midi_file_buffer[0]);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
835 return DATA_AVAIL_ERROR;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
836 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
837
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
838 // Check if it's the last valid buffer
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
839 if((*ptr_char+*buffer_size) > &(midi_file.midi_file_buffer[0])+midi_file.midi_file_size-1)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
840 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
841 *buffer_size=MIDI_BUFFER_SIZE-(UWORD16)(*ptr_char+MIDI_BUFFER_SIZE-&(midi_file.midi_file_buffer[0])-midi_file.midi_file_size+1);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
842
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
843 // Update offset in the MIDI file
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
844 midi_file_offset+=*ptr_char-last_ptr;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
845
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
846 last_ptr=*ptr_char;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
847
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
848 return DATA_LAST;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
849 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
850 else
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
851 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
852 // Update offset in the MIDI file
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
853 midi_file_offset+=*ptr_char-last_ptr;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
854
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
855 last_ptr=*ptr_char;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
856
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
857 return DATA_AVAILABLE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
858 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
859 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
860 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
861 #endif // L1_MIDI
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
862
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
863 #if L1_PCM_EXTRACTION
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
864 case 13:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
865 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
866 *ptr = (UWORD16 *)&pcm_download_buffer;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
867 *buffer_size = SC_PCM_DOWNLOAD_BUFFER_SIZE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
868 return DATA_AVAILABLE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
869 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
870 //omaps00090550 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
871
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
872 case 14:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
873 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
874 *ptr = (UWORD16 *)&pcm_upload_buffer;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
875 *buffer_size = SC_PCM_UPLOAD_BUFFER_SIZE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
876 return DATA_AVAILABLE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
877 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
878 //omaps00090550 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
879 #endif /* L1_PCM_EXTRACTION */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
880 default:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
881 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
882 return(SESSION_ERROR);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
883 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
884 //omaps00090550 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
885 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
886 #endif
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
887
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
888 #if (OP_RIV_AUDIO == 1)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
889
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
890 #if (MELODY_E1) || (VOICE_MEMO) || (MELODY_E2) || (L1_VOICE_MEMO_AMR) || (L1_EXT_AUDIO_MGT)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
891 UWORD8 index_l1, *current_ptr_8;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
892 UWORD16 *current_ptr, *size_ptr, *end_ptr;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
893 UWORD32 current, end;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
894 T_AUDIO_FFS_SESSION *p_session;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
895
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
896 #if (L1_AUDIO_DRIVER == 1)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
897 T_AUDIO_DRIVER_SESSION *p_driver_session;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
898 UINT8 channel_id;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
899 xSignalHeaderRec *msg;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
900
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
901 /* special handling for features in driver */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
902 if ((session_id == AUDIO_VM_AMR_RECORD_SESSION_ID) ||
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
903 (session_id == AUDIO_VM_AMR_PLAY_SESSION_ID))
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
904 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
905 channel_id = 0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
906 /* find active channel_id associated to session_id */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
907 while ( (channel_id < AUDIO_DRIVER_MAX_CHANNEL)&&
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
908 ((p_audio_gbl_var->audio_driver_session[channel_id].session_info.state == AUDIO_DRIVER_CHANNEL_WAIT_INIT)||
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
909 (p_audio_gbl_var->audio_driver_session[channel_id].session_req.session_id != session_id)) )
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
910 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
911 channel_id++;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
912 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
913 /* get driver session */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
914 p_driver_session = &(p_audio_gbl_var->audio_driver_session[channel_id]);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
915
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
916 /* first buffer, index_l1 = 0 */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
917 if (*ptr == NULL)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
918 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
919 *ptr = (UWORD16 *)(p_driver_session->session_info.buffer[0].p_start_pointer);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
920 *buffer_size = (p_driver_session->session_info.buffer[0].size >> 1);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
921
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
922 return(DATA_AVAILABLE);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
923 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
924 /* following buffers */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
925 else
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
926 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
927 /* prepare notification */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
928 msg = os_alloc_sig(sizeof(T_L1_AUDIO_DRIVER_IND));
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
929 DEBUGMSG(status,NU_ALLOC_ERR)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
930 msg->SignalCode = L1_AUDIO_DRIVER_IND;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
931 ((T_L1_AUDIO_DRIVER_IND *)msg->SigP)->channel_id = channel_id;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
932 ((T_L1_AUDIO_DRIVER_IND *)msg->SigP)->p_buffer = NULL;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
933
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
934 /* fill message with current buffer for record */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
935 index_l1 = p_driver_session->session_info.index_l1;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
936 if (session_id == AUDIO_VM_AMR_RECORD_SESSION_ID)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
937 ((T_L1_AUDIO_DRIVER_IND *)msg->SigP)->p_buffer =
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
938 (UWORD16 *)p_driver_session->session_info.buffer[index_l1].p_start_pointer;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
939
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
940 /* give new buffer = index_l1++ % nb_buffer */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
941 p_driver_session->session_info.index_l1++;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
942 if ((p_driver_session->session_info.index_l1) == (p_driver_session->session_req.nb_buffer))
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
943 p_driver_session->session_info.index_l1 =(UINT8)( 0);//omaps
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
944
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
945 /* Update new current buffer parameters */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
946 index_l1 = (UWORD8)(p_driver_session->session_info.index_l1);//oamps
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
947 *ptr = (UWORD16 *)(p_driver_session->session_info.buffer[index_l1].p_start_pointer);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
948 *buffer_size = (p_driver_session->session_info.buffer[index_l1].size >> 1);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
949
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
950 // Send confirmation message...
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
951 os_send_sig(msg, L1C1_QUEUE);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
952 DEBUGMSG(status,NU_SEND_QUEUE_ERR)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
953
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
954 return (DATA_AVAILABLE);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
955 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
956 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
957 /* Other features */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
958 else
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
959 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
960 #endif // L1_AUDIO_DRIVER
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
961 p_session = &(p_audio_gbl_var->audio_ffs_session[session_id]);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
962
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
963 switch (p_session->session_info.cust_get_pointer_state)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
964 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
965 case AUDIO_CUST_GET_POINTER_INIT:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
966 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
967 /* the first buffer, the index_l1 is already OK so the index_l1 doesn't change */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
968 index_l1 =
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
969 p_session->session_info.index_l1;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
970 *ptr =
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
971 (UWORD16 *)(p_session->session_info.buffer[index_l1].p_start_pointer);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
972 *buffer_size =
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
973 (p_session->session_info.buffer[index_l1].size>>1);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
974
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
975
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
976 p_session->session_info.cust_get_pointer_state =
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
977 AUDIO_CUST_GET_POINTER_NORMAL;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
978 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
979 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
980 case AUDIO_CUST_GET_POINTER_NORMAL:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
981 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
982 /* in loopback mode, when the melody restarts, the L1 pointer management is different */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
983 if ( (*buffer_size == 0) &&
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
984 (p_session->session_req.loop_mode == TRUE) )
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
985 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
986 p_session->session_info.cust_get_pointer_state =
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
987 AUDIO_CUST_GET_POINTER_LOOP;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
988 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
989 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
990
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
991 /* The index_l1 needs to be changed */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
992 p_session->session_info.index_l1++;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
993 if (p_session->session_info.index_l1
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
994 == AUDIO_MAX_FFS_BUFFER_PER_SESSION)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
995 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
996 p_session->session_info.index_l1 = 0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
997 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
998
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
999 index_l1 =
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1000 p_session->session_info.index_l1;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1001 *ptr =
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1002 (UWORD16 *)(p_session->session_info.buffer[index_l1].p_start_pointer);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1003 *buffer_size =
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1004 (p_session->session_info.buffer[index_l1].size>>1);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1005
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1006 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1007 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1008 case AUDIO_CUST_GET_POINTER_LOOP:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1009 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1010 /* in loopback mode, the next melody data is contiguous to the first */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1011 /* if it's the end of the buffer , we use the next buffer */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1012 index_l1 =
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1013 p_session->session_info.index_l1;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1014
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1015 current_ptr = (UWORD16 *)(*ptr);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1016 current_ptr_8 = (UWORD8 *)(*ptr);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1017 end_ptr = (UWORD16 *)(p_session->session_info.buffer[index_l1].p_stop_pointer);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1018
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1019 if ( current_ptr >= end_ptr )
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1020 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1021 p_session->session_info.index_l1++;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1022 if (p_session->session_info.index_l1
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1023 == AUDIO_MAX_FFS_BUFFER_PER_SESSION)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1024 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1025 p_session->session_info.index_l1 = 0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1026 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1027
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1028 index_l1 =
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1029 p_session->session_info.index_l1;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1030 *ptr =
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1031 (UWORD16 *)(p_session->session_info.buffer[index_l1].p_start_pointer);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1032 *buffer_size =
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1033 (p_session->session_info.buffer[index_l1].size>>1);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1034 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1035 else
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1036 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1037 // Realign the pointer to the next 16 bit in case of melody E2
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1038 current = (UWORD32)current_ptr_8;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1039 if (current & 0x01)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1040 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1041 current_ptr_8++;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1042 *ptr = (UWORD16 *)current_ptr_8;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1043 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1044
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1045 end = (UWORD32)end_ptr;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1046 current = (UWORD32)current_ptr;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1047
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1048 *buffer_size = (UWORD16)((end-current)>>1);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1049 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1050
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1051 p_session->session_info.cust_get_pointer_state =
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1052 AUDIO_CUST_GET_POINTER_NORMAL;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1053 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1054 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1055 } /* switch(p_session->session_info.cust_get_pointer_state) */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1056
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1057 return(DATA_AVAILABLE);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1058 #if (L1_AUDIO_DRIVER == 1)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1059 } // added
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1060 #endif
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1061 #endif // MELODY_E1 || VOICE_MEMO || MELODY_E2
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1062 #endif // OP_RIV_AUDIO
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1063 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1064
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1065 #if (AUDIO_SIMULATION) || (AUDIO_L1_STANDALONE)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1066 /*-------------------------------------------------------*/
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1067 /* Cust_get_next_buffer_status */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1068 /*-------------------------------------------------------*/
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1069 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1070 /* Parameters : */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1071 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1072 /* Return : */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1073 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1074 /* Description : */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1075 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1076 /*-------------------------------------------------------*/
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1077 UWORD8 Cust_get_next_buffer_status(void)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1078 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1079 return (FALSE);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1080 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1081
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1082 #endif
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1083
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1084 #if (AUDIO_SIMULATION) || (AUDIO_L1_STANDALONE)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1085 /*-------------------------------------------------------*/
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1086 /* Cust_get_pointer_next_buffer */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1087 /*-------------------------------------------------------*/
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1088 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1089 /* Parameters : ptr */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1090 /* buffer_size */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1091 /* session_id */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1092 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1093 /* Return : error_id : */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1094 /* DATA_AVAILABLE: 0, no error occured */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1095 /* SESSION_ERROR: 1, wrong session id */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1096 /* POINTER_ERROR: 2, wrong ptr */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1097 /* DATA_AVAIL_ERROR: 3, no more data */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1098 /* available */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1099 /* DATA_LAST: 4, returned buffer is the */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1100 /* last */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1101 /* buffer_size */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1102 /* ptr */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1103 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1104 /* Description : */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1105 /* This function acts the same as Cust_get_pointer() but */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1106 /* does not send notification to upper layers to free */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1107 /* current buffer */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1108 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1109 /*-------------------------------------------------------*/
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1110 UWORD8 Cust_get_pointer_next_buffer(UWORD16 **ptr,
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1111 UWORD16 *buffer_size,
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1112 UWORD8 session_id)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1113 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1114 #if (L1_MP3 == 1)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1115 extern UWORD32 mp3_file_size;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1116 #endif
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1117 #if (L1_AAC == 1)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1118 extern UWORD32 aac_file_size;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1119 #endif
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1120
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1121 switch(session_id&0x0F)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1122 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1123 #if (L1_MP3 == 1)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1124 case 13:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1125 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1126 if(*ptr==NULL)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1127 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1128 // Reset flag
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1129 Cust_get_pointer_mp3_buffer_last=FALSE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1130
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1131 // Set pointer to first buffer with corresponding size
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1132 mp3_tempbuf_idx=0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1133 *ptr=mp3_tempbuf0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1134 *buffer_size=C_MP3_L1STANDALONE_BUFFER_SIZE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1135
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1136 Cust_get_pointer_mp3_last_buffer_size=C_MP3_L1STANDALONE_BUFFER_SIZE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1137
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1138 #if (CODE_VERSION == NOT_SIMULATION)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1139 if(mp3_file_size<C_MP3_L1STANDALONE_BUFFER_SIZE)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1140 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1141 *buffer_size=(UWORD16)mp3_file_size;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1142 Cust_get_pointer_mp3_buffer_last=TRUE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1143 return DATA_LAST;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1144 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1145 #endif
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1146
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1147 return DATA_AVAILABLE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1148 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1149 else
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1150 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1151 switch(mp3_tempbuf_idx)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1152 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1153 case 0:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1154 *ptr=mp3_tempbuf1;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1155 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1156
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1157 case 1:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1158 *ptr=mp3_tempbuf0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1159 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1160 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1161
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1162 // Swap buffer index
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1163 mp3_tempbuf_idx^=1;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1164
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1165 *buffer_size=Cust_get_pointer_mp3_last_buffer_size;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1166
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1167 if(Cust_get_pointer_mp3_buffer_last==FALSE)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1168 return DATA_AVAILABLE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1169 else
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1170 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1171 if(l1a_l1s_com.mp3_task.parameters.loopback==TRUE)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1172 Cust_get_pointer_mp3_buffer_last=FALSE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1173
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1174 return DATA_LAST;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1175 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1176 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1177 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1178 //omaps00090550 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1179 #endif // L1_MP3
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1180
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1181 #if (L1_AAC == 1)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1182 case 14: // session id for AAC
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1183 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1184 if(*ptr==NULL)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1185 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1186 // Reset flag
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1187 Cust_get_pointer_aac_buffer_last=FALSE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1188
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1189 // Set pointer to first buffer with corresponding size
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1190 aac_tempbuf_idx=0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1191 *ptr=aac_tempbuf0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1192 *buffer_size=C_AAC_L1STANDALONE_BUFFER_SIZE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1193
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1194 Cust_get_pointer_aac_last_buffer_size=C_AAC_L1STANDALONE_BUFFER_SIZE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1195
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1196 #if (CODE_VERSION == NOT_SIMULATION)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1197 if(aac_file_size<C_AAC_L1STANDALONE_BUFFER_SIZE)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1198 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1199 *buffer_size=(UWORD16)aac_file_size;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1200 Cust_get_pointer_aac_buffer_last=TRUE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1201 return DATA_LAST;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1202 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1203 #endif
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1204
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1205 return DATA_AVAILABLE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1206 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1207 else
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1208 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1209 switch(aac_tempbuf_idx)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1210 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1211 case 0:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1212 *ptr=aac_tempbuf1;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1213 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1214
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1215 case 1:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1216 *ptr=aac_tempbuf0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1217 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1218 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1219
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1220 // Swap buffer index
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1221 aac_tempbuf_idx^=1;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1222
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1223 *buffer_size=Cust_get_pointer_aac_last_buffer_size;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1224
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1225 if(Cust_get_pointer_aac_buffer_last==FALSE)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1226 return DATA_AVAILABLE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1227 else
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1228 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1229 if(l1a_l1s_com.aac_task.parameters.loopback==TRUE)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1230 Cust_get_pointer_aac_buffer_last=FALSE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1231
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1232 return DATA_LAST;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1233 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1234 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1235 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1236 //omaps00090550 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1237 #endif // L1_AAC
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1238
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1239 default:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1240 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1241 return SESSION_ERROR;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1242 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1243 //omaps00090550 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1244 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1245 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1246 #endif // (AUDIO_SIMULATION) || (AUDIO_L1_STANDALONE)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1247
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1248
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1249 #if (AUDIO_SIMULATION) || (AUDIO_L1_STANDALONE)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1250 /*------------------------------------------------------------------*/
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1251 /* Cust_get_pointer_notify */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1252 /*------------------------------------------------------------------*/
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1253 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1254 /* Parameters : ptr */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1255 /* session_id */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1256 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1257 /* Return : n/a */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1258 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1259 /* Description : */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1260 /* This function sends notification to upper layers to */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1261 /* fill next buffer. */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1262 /* This function should be used with Cust_get_pointer_next_buffer() */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1263 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1264 /*------------------------------------------------------------------*/
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1265 void Cust_get_pointer_notify(UWORD8 session_id)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1266 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1267 switch(session_id&0x0F)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1268 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1269 #if (L1_MP3 == 1)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1270 case 13:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1271 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1272 #if (CODE_VERSION == NOT_SIMULATION)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1273 UWORD32 size;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1274 UWORD8 *dst;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1275 extern UWORD32 mp3_file_size;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1276
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1277 // Check if file is ending
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1278 if(mp3_file_offset+C_MP3_L1STANDALONE_BUFFER_SIZE > mp3_file_size)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1279 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1280 size=mp3_file_size-mp3_file_offset;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1281 Cust_get_pointer_mp3_buffer_last=TRUE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1282 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1283 else
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1284 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1285 size=C_MP3_L1STANDALONE_BUFFER_SIZE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1286 Cust_get_pointer_mp3_buffer_last=FALSE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1287 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1288
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1289 switch(mp3_tempbuf_idx)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1290 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1291 case 0:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1292 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1293 // L1 is working on buffer 0 -> fill buffer 1
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1294 dst=(UWORD8 *)mp3_tempbuf1;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1295 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1296 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1297
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1298 case 1:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1299 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1300 // L1 is working on buffer 1 -> fill buffer 0
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1301 dst=(UWORD8 *)mp3_tempbuf0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1302 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1303 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1304 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1305
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1306 memcpy(dst,(UWORD8 *)mp3_file+mp3_file_offset,size);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1307
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1308 // Update MP3 read offset
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1309 mp3_file_offset+=C_MP3_L1STANDALONE_BUFFER_SIZE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1310
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1311 // Rewind if loopback mode is on
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1312 if((l1a_l1s_com.mp3_task.parameters.loopback==TRUE) &&
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1313 (Cust_get_pointer_mp3_buffer_last==TRUE))
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1314 mp3_file_offset=0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1315
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1316 // Keep track of buffer size
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1317 Cust_get_pointer_mp3_last_buffer_size=(UWORD16)size;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1318
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1319 #else // CODE_VERSION == NOT_SIMULATION
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1320 UWORD16 i;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1321 UWORD8 *dst;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1322 switch(mp3_tempbuf_idx)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1323 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1324 case 0:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1325 dst=(UWORD8 *)mp3_tempbuf1;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1326 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1327 case 1:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1328 dst=(UWORD8 *)mp3_tempbuf0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1329 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1330 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1331 for(i=0; i<C_MP3_L1STANDALONE_BUFFER_SIZE/2; i++)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1332 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1333 dst[2*i] =0x12;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1334 dst[2*i+1]=0x24;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1335 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1336 #endif
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1337 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1338 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1339 #endif // L1_MP3
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1340
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1341 #if (L1_AAC == 1)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1342 case 14:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1343 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1344 #if (CODE_VERSION == NOT_SIMULATION)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1345 UWORD32 size;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1346 UWORD8 *dst;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1347 extern UWORD32 aac_file_size;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1348
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1349 // Check if file is ending
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1350 if(aac_file_offset+C_AAC_L1STANDALONE_BUFFER_SIZE > aac_file_size)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1351 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1352 size=aac_file_size-aac_file_offset;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1353 Cust_get_pointer_aac_buffer_last=TRUE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1354 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1355 else
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1356 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1357 size=C_AAC_L1STANDALONE_BUFFER_SIZE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1358 Cust_get_pointer_aac_buffer_last=FALSE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1359 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1360
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1361 switch(aac_tempbuf_idx)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1362 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1363 case 0:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1364 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1365 // L1 is working on buffer 0 -> fill buffer 1
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1366 dst=(UWORD8 *)aac_tempbuf1;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1367 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1368 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1369
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1370 case 1:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1371 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1372 // L1 is working on buffer 1 -> fill buffer 0
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1373 dst=(UWORD8 *)aac_tempbuf0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1374 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1375 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1376 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1377
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1378 memcpy(dst,(UWORD8 *)aac_file+aac_file_offset,size);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1379
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1380 // Update AAC read offset
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1381 aac_file_offset+=C_AAC_L1STANDALONE_BUFFER_SIZE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1382
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1383 // Rewind if loopback mode is on
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1384 if((l1a_l1s_com.aac_task.parameters.loopback==TRUE) &&
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1385 (Cust_get_pointer_aac_buffer_last==TRUE))
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1386 aac_file_offset=0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1387
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1388 // Keep track of buffer size
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1389 Cust_get_pointer_aac_last_buffer_size=(UWORD16)size;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1390
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1391 #else // CODE_VERSION == NOT_SIMULATION
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1392 UWORD16 i;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1393 UWORD8 *dst;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1394 switch(aac_tempbuf_idx)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1395 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1396 case 0:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1397 dst=(UWORD8 *)aac_tempbuf1;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1398 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1399 case 1:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1400 dst=(UWORD8 *)aac_tempbuf0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1401 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1402 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1403 for(i=0; i<C_AAC_L1STANDALONE_BUFFER_SIZE/2; i++)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1404 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1405 dst[2*i] =0x10;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1406 dst[2*i+1]=0x20;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1407 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1408 #endif
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1409 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1410 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1411 #endif // L1_AAC
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1412
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1413 } // switch(session_id&0x0F)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1414 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1415 #endif // (AUDIO_SIMULATION) || (AUDIO_L1_STANDALONE)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1416
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1417
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1418 #if (MELODY_E2 && FIR)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1419 /*-------------------------------------------------------*/
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1420 /* Cust_audio_melody_E2_load_instrument */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1421 /*-------------------------------------------------------*/
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1422 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1423 /* Parameters : customer_instrument_id: */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1424 /* Identifier of the instrument */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1425 /* API_address */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1426 /* address where the insturment */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1427 /* is downloaded */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1428 /* allowed_size */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1429 /* maximum size of the instrument */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1430 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1431 /* Return : instrument_size : */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1432 /* size of the insturment downloaded in */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1433 /* 16-bit word */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1434 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1435 /* Description : */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1436 /* The audio background task calls this function to */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1437 /* request to the MMI to download a new instrument */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1438 /* description at the API_address. */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1439 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1440 /*-------------------------------------------------------*/
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1441 UWORD16 Cust_audio_melody_E2_load_instrument (UWORD8 customer_instrument_id,
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1442 API *API_address,
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1443 UWORD16 allowed_size)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1444 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1445 #if (AUDIO_SIMULATION) || (AUDIO_L1_STANDALONE)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1446 UWORD16 instrument_size = 0, i, *instrument_ptr;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1447
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1448 // default.lsi file:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1449 // 0 piano31 0x0
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1450 // 1 piano15 0x1
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1451 // 2 pia_811 0x2
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1452 // 3 eba_2536 0x3
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1453 // 4 tsax_255 0x4
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1454 // 5 asax_124 0x5
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1455 // 6 clar_121 0x6
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1456 // 7 clar_130 0x7
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1457 // 8 stdr_515 0x8
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1458 // 9 timp_661 0x9
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1459 // 10 agog_406 0xA
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1460 // 11 wood_110 0xB
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1461 // 12 vib_3836 0xC
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1462 // 13 xylo_120 0xD
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1463 // 14 xylo_315 0xE
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1464 // 15 xylo_516 0xF
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1465 // 16 kali_215 0x10
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1466 // 17 viol_231 0x11
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1467 // 18 viol_215 0x12
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1468 // 19 viol_211 0x13
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1469 // 20 viol_108 0x14
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1470 // 21 flut_436 0x15
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1471 // 22 flut_308 0x16
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1472 // 23 porg_131 0x17
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1473 // 24 acco_211 0x18
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1474 // 25 stng_231 0x19
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1475 // 26 stng_058 0x1A
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1476 // 27 ldsa_131 0x1B
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1477 // 28 sin7 0x1C
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1478 // 29 egu_3036 0x1D
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1479 // 30 jgui_215 0x1E
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1480 // 31 banj_315 0x1F
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1481 // 32 trum_231 0x20
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1482 // 33 tromb31 0x21
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1483 // 34 cho_2116 0x22
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1484 // 35 vooh_331 0x23
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1485 // 36 crc_1210 0x24
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1486 // 37 chc_1210 0x25
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1487 // 38 ohc_1610 0x26
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1488 // 39 lbon_121 0x27
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1489 // 40 esn_0210 0x28
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1490 // 41 crc_0210 0x29
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1491 // 42 ric_0210 0x2A
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1492 // 43 bdm_0122 0x2B
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1493 // 44 vib_0415 0x2C
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1494 // 45 ngu_0343 0x2D
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1495 // 46 sgu_0230 0x2E
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1496 // 47 xyl_0315 0x2F
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1497
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1498 switch (customer_instrument_id)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1499 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1500 case 0:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1501 // Piano31.mwa
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1502 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1503 instrument_size = MELODY_E2_PIANO31_MWA_SIZE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1504 instrument_ptr = (UWORD16 *)(&melody_E2_piano31[0]);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1505 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1506 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1507 case 1:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1508 // Piano15.mwa
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1509 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1510 instrument_size = MELODY_E2_PIANO15_MWA_SIZE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1511 instrument_ptr = (UWORD16 *)(&melody_E2_piano15[0]);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1512 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1513 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1514 case 2:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1515 // Pia_811.mwa
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1516 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1517 instrument_size = MELODY_E2_PIA_811_MWA_SIZE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1518 instrument_ptr = (UWORD16 *)(&melody_E2_pia_811[0]);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1519 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1520 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1521 case 3:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1522 // eba_2536.mwa
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1523 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1524 instrument_size = MELODY_E2_EBA_2536_MWA_SIZE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1525 instrument_ptr = (UWORD16 *)(&melody_E2_eba_2536[0]);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1526 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1527 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1528 case 4:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1529 // tsax_255.mwa
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1530 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1531 instrument_size = MELODY_E2_TSAX_255_MWA_SIZE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1532 instrument_ptr = (UWORD16 *)(&melody_E2_tsax_255[0]);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1533 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1534 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1535 case 5:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1536 // asax_124.mwa
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1537 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1538 instrument_size = MELODY_E2_ASAX_124_MWA_SIZE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1539 instrument_ptr = (UWORD16 *)(&melody_E2_asax_124[0]);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1540 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1541 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1542 case 6:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1543 // clar_121.mwa
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1544 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1545 instrument_size = MELODY_E2_CLAR_121_MWA_SIZE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1546 instrument_ptr = (UWORD16 *)(&melody_E2_clar_121[0]);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1547 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1548 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1549 case 7:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1550 // clar_130.mwa
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1551 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1552 instrument_size = MELODY_E2_CLAR_130_MWA_SIZE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1553 instrument_ptr = (UWORD16 *)(&melody_E2_clar_130[0]);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1554 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1555 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1556 case 8:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1557 // stdr_515.mwa
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1558 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1559 instrument_size = MELODY_E2_STDR_515_MWA_SIZE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1560 instrument_ptr = (UWORD16 *)(&melody_E2_stdr_515[0]);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1561 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1562 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1563 case 9:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1564 // timp_661.mwa
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1565 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1566 instrument_size = MELODY_E2_TIMP_661_MWA_SIZE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1567 instrument_ptr = (UWORD16 *)(&melody_E2_timp_661[0]);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1568 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1569 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1570 case 10:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1571 // agog_406.mwa
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1572 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1573 instrument_size = MELODY_E2_AGOG_406_MWA_SIZE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1574 instrument_ptr = (UWORD16 *)(&melody_E2_agog_406[0]);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1575 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1576 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1577 case 11:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1578 // wood_110.mwa
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1579 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1580 instrument_size = MELODY_E2_WOOD_110_MWA_SIZE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1581 instrument_ptr = (UWORD16 *)(&melody_E2_wood_110[0]);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1582 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1583 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1584 case 12:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1585 // vib_3836.mwa
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1586 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1587 instrument_size = MELODY_E2_VIB_3836_MWA_SIZE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1588 instrument_ptr = (UWORD16 *)(&melody_E2_vib_3836[0]);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1589 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1590 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1591 case 13:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1592 // xylo_120.mwa
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1593 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1594 instrument_size = MELODY_E2_XYLO_120_MWA_SIZE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1595 instrument_ptr = (UWORD16 *)(&melody_E2_xylo_120[0]);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1596 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1597 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1598 case 14:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1599 // xylo_315.mwa
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1600 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1601 instrument_size = MELODY_E2_XYLO_315_MWA_SIZE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1602 instrument_ptr = (UWORD16 *)(&melody_E2_xylo_315[0]);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1603 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1604 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1605 case 15:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1606 // xylo_516.mwa
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1607 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1608 instrument_size = MELODY_E2_XYLO_516_MWA_SIZE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1609 instrument_ptr = (UWORD16 *)(&melody_E2_xylo_516[0]);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1610 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1611 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1612 case 16:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1613 // kali_215.mwa
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1614 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1615 instrument_size = MELODY_E2_KALI_215_MWA_SIZE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1616 instrument_ptr = (UWORD16 *)(&melody_E2_kali_215[0]);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1617 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1618 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1619 case 17:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1620 // viol_231
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1621 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1622 instrument_size = MELODY_E2_VIOL_231_MWA_SIZE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1623 instrument_ptr = (UWORD16 *)(&melody_E2_viol_231[0]);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1624 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1625 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1626 case 18:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1627 // viol_215.mwa
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1628 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1629 instrument_size = MELODY_E2_VIOL_215_MWA_SIZE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1630 instrument_ptr = (UWORD16 *)(&melody_E2_viol_215[0]);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1631 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1632 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1633 case 19:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1634 // viol_211.mwa
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1635 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1636 instrument_size = MELODY_E2_VIOL_211_MWA_SIZE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1637 instrument_ptr = (UWORD16 *)(&melody_E2_viol_211[0]);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1638 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1639 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1640 case 20:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1641 // viol_108.mwa
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1642 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1643 instrument_size = MELODY_E2_VIOL_108_MWA_SIZE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1644 instrument_ptr = (UWORD16 *)(&melody_E2_viol_108[0]);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1645 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1646 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1647 case 21:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1648 // flut_436
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1649 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1650 instrument_size = MELODY_E2_FLUT_436_MWA_SIZE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1651 instrument_ptr = (UWORD16 *)(&melody_E2_flut_436[0]);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1652 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1653 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1654 case 22:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1655 // flut_308.mwa
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1656 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1657 instrument_size = MELODY_E2_FLUT_308_MWA_SIZE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1658 instrument_ptr = (UWORD16 *)(&melody_E2_flut_308[0]);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1659 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1660 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1661 case 23:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1662 // porg_131
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1663 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1664 instrument_size = MELODY_E2_PORG_131_MWA_SIZE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1665 instrument_ptr = (UWORD16 *)(&melody_E2_porg_131[0]);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1666 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1667 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1668 case 24:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1669 // acco_211.mwa
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1670 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1671 instrument_size = MELODY_E2_ACCO_211_MWA_SIZE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1672 instrument_ptr = (UWORD16 *)(&melody_E2_acco_211[0]);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1673 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1674 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1675 case 25:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1676 // stng_231
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1677 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1678 instrument_size = MELODY_E2_STNG_231_MWA_SIZE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1679 instrument_ptr = (UWORD16 *)(&melody_E2_stng_231[0]);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1680 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1681 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1682 case 26:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1683 // stng_058.mwa
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1684 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1685 instrument_size = MELODY_E2_STNG_058_MWA_SIZE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1686 instrument_ptr = (UWORD16 *)(&melody_E2_stng_058[0]);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1687 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1688 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1689 case 27:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1690 // ldsa_131
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1691 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1692 instrument_size = MELODY_E2_LDSA_131_MWA_SIZE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1693 instrument_ptr = (UWORD16 *)(&melody_E2_ldsa_131[0]);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1694 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1695 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1696 case 28:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1697 // sin7.mwa
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1698 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1699 instrument_size = MELODY_E2_SIN7_MWA_SIZE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1700 instrument_ptr = (UWORD16 *)(&melody_E2_sin7[0]);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1701 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1702 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1703 case 29:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1704 // Egu_3036.mwa
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1705 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1706 instrument_size = MELODY_E2_EGU_3036_MWA_SIZE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1707 instrument_ptr = (UWORD16 *)(&melody_E2_egu_3036[0]);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1708 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1709 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1710 case 30:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1711 // Jgui_215.mwa
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1712 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1713 instrument_size = MELODY_E2_JGUI_215_MWA_SIZE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1714 instrument_ptr = (UWORD16 *)(&melody_E2_jgui_215[0]);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1715 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1716 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1717 case 31:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1718 // Banj_315.mwa
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1719 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1720 instrument_size = MELODY_E2_BANJ_315_MWA_SIZE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1721 instrument_ptr = (UWORD16 *)(&melody_E2_banj_315[0]);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1722 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1723 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1724
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1725 case 32:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1726 // trum_231
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1727 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1728 instrument_size = MELODY_E2_TRUM_231_MWA_SIZE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1729 instrument_ptr = (UWORD16 *)(&melody_E2_trum_231[0]);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1730 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1731 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1732 case 33:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1733 // tromb31
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1734 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1735 instrument_size = MELODY_E2_TROMB31_MWA_SIZE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1736 instrument_ptr = (UWORD16 *)(&melody_E2_tromb31[0]);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1737 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1738 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1739 case 34:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1740 // cho_2116
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1741 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1742 instrument_size = MELODY_E2_CHO_2116_MWA_SIZE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1743 instrument_ptr = (UWORD16 *)(&melody_E2_cho_2116[0]);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1744 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1745 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1746 case 35:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1747 // vooh_331.mwa
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1748 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1749 instrument_size = MELODY_E2_VOOH_331_MWA_SIZE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1750 instrument_ptr = (UWORD16 *)(&melody_E2_vooh_331[0]);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1751 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1752 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1753 case 36:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1754 // crc_1210.mwa
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1755 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1756 instrument_size = MELODY_E2_CRC_1210_MWA_SIZE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1757 instrument_ptr = (UWORD16 *)(&melody_E2_crc_1210[0]);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1758 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1759 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1760 case 37:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1761 // chc_1210.mwa
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1762 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1763 instrument_size = MELODY_E2_CHC_1210_MWA_SIZE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1764 instrument_ptr = (UWORD16 *)(&melody_E2_chc_1210[0]);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1765 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1766 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1767 case 38:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1768 // ohc_1610
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1769 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1770 instrument_size = MELODY_E2_OHC_1610_MWA_SIZE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1771 instrument_ptr = (UWORD16 *)(&melody_E2_ohc_1610[0]);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1772 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1773 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1774 case 39:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1775 // lbon_121
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1776 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1777 instrument_size = MELODY_E2_LBON_121_MWA_SIZE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1778 instrument_ptr = (UWORD16 *)(&melody_E2_lbon_121[0]);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1779 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1780 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1781 case 40:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1782 // esn_0210
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1783 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1784 instrument_size = MELODY_E2_ESN_0210_MWA_SIZE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1785 instrument_ptr = (UWORD16 *)(&melody_E2_esn_0210[0]);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1786 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1787 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1788 case 41:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1789 // crc_0210
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1790 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1791 instrument_size = MELODY_E2_CRC_0210_MWA_SIZE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1792 instrument_ptr = (UWORD16 *)(&melody_E2_crc_0210[0]);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1793 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1794 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1795 case 42:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1796 // ric_0210
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1797 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1798 instrument_size = MELODY_E2_RIC_0210_MWA_SIZE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1799 instrument_ptr = (UWORD16 *)(&melody_E2_ric_0210[0]);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1800 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1801 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1802 case 43:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1803 // bdm_0122
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1804 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1805 instrument_size = MELODY_E2_BDM_0122_MWA_SIZE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1806 instrument_ptr = (UWORD16 *)(&melody_E2_bdm_0122[0]);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1807 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1808 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1809 case 44:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1810 // vib_0415
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1811 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1812 instrument_size = MELODY_E2_VIB_0415_MWA_SIZE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1813 instrument_ptr = (UWORD16 *)(&melody_E2_vib_0415[0]);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1814 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1815 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1816 case 45:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1817 // ngu_0343
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1818 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1819 instrument_size = MELODY_E2_NGU_0343_MWA_SIZE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1820 instrument_ptr = (UWORD16 *)(&melody_E2_ngu_0343[0]);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1821 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1822 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1823 case 46:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1824 // sgu_0230
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1825 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1826 instrument_size = MELODY_E2_SGU_0230_MWA_SIZE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1827 instrument_ptr = (UWORD16 *)(&melody_E2_sgu_0230[0]);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1828 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1829 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1830 case 47:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1831 // xyl_0315
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1832 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1833 instrument_size = MELODY_E2_XYL_0315_MWA_SIZE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1834 instrument_ptr = (UWORD16 *)(&melody_E2_xyl_0315[0]);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1835 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1836 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1837 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1838
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1839 i = instrument_size;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1840 while ( (i != 0) &&
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1841 (l1a_l1s_com.melody0_e2_task.parameters.emergency_stop == FALSE) )
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1842 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1843 *API_address++ = *instrument_ptr++;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1844 i--;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1845 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1846
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1847 return(instrument_size);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1848 #endif // (AUDIO_SIMULATION) || (AUDIO_L1_STANDALONE)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1849
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1850 #if (OP_RIV_AUDIO == 1)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1851 #ifndef _WINDOWS
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1852 T_FFS_FD ffs_fd_1, ffs_fd_2;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1853 T_FFS_STAT stat;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1854
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1855 /* Nb of instruments in the .lsi file */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1856 INT8 i = 0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1857 INT16 instrument_id = -1;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1858
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1859 /* basic structure of the .lsi file */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1860 T_AUDIO_MELODY_E2_ID_NAME file_E2;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1861
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1862 /**** Find the size of the .lsi file ****/
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1863 /* the .lsi file is stores into the flash */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1864 /* check if the .lsi file exists */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1865
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1866 ffs_fd_1 = ffs_open(p_audio_gbl_var->melody_E2_load_file_instruments.instrument_file_name,
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1867 FFS_O_RDONLY );
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1868
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1869 if (ffs_fd_1 < EFFS_OK)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1870 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1871 audio_melody_E2_error_trace(AUDIO_ENTITY_LOAD_FILE_INSTR_ERROR);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1872 return (0);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1873 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1874
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1875 /* find the .mwa file */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1876 while ( (i < p_audio_gbl_var->melody_E2_load_file_instruments.nb_of_instruments) &&
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1877 (customer_instrument_id != instrument_id))
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1878 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1879 /* Load the instruments file from the FFS */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1880 if ( (ffs_read ( ffs_fd_1,
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1881 (&file_E2),
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1882 (sizeof(INT8) + AUDIO_PATH_NAME_MAX_SIZE))) < EFFS_OK )
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1883 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1884 AUDIO_SEND_TRACE("AUDIO MELODY E2: impossible to load the .lsi file", RV_TRACE_LEVEL_ERROR);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1885
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1886 /* Close the file */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1887 ffs_close(ffs_fd_1);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1888
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1889 return (0);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1890 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1891
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1892 instrument_id = file_E2.id;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1893 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1894 /* Close the file */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1895 ffs_close(ffs_fd_1);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1896
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1897 if (i == p_audio_gbl_var->melody_E2_load_file_instruments.nb_of_instruments)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1898 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1899 AUDIO_SEND_TRACE("AUDIO MELODY E2: the instrument doesn't exist in the .lsi file", RV_TRACE_LEVEL_ERROR);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1900
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1901 return (0);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1902 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1903
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1904 /* Open the corresponding .mwa file */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1905 ffs_fd_2 = ffs_open( file_E2.melody_name,
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1906 FFS_O_RDONLY );
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1907 if (ffs_fd_2 < EFFS_OK)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1908 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1909 AUDIO_SEND_TRACE("AUDIO MELODY E2: impossible to open the .mwa file instruments", RV_TRACE_LEVEL_ERROR);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1910
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1911 /* Close the .mwa file */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1912 ffs_close(ffs_fd_2);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1913
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1914 return (0);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1915 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1916
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1917 /* download the instrument description */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1918 ffs_stat(file_E2.melody_name,&stat);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1919
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1920 /* check if the file contains some data */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1921 if (stat.size ==0)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1922 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1923 /* the file doesn't contains data */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1924 /* an error is generated */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1925 audio_melody_E2_error_trace(AUDIO_ENTITY_FILE_ERROR);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1926
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1927 /* Close the .mwa file */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1928 ffs_close(ffs_fd_2);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1929
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1930 return(0);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1931 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1932
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1933 /* check if there's enough memory in the API for this instrument */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1934 if (allowed_size < (stat.size>>1))
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1935 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1936 /* an error is generated */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1937 audio_melody_E2_error_trace(AUDIO_ERROR_INSTRUMENT_SIZE);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1938
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1939 /* Close the .mwa file */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1940 ffs_close(ffs_fd_2);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1941
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1942 return(0);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1943 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1944
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1945 ffs_read ( ffs_fd_2,
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1946 (void *)API_address,
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1947 stat.size );
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1948
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1949 /* Close the file */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1950 ffs_close(ffs_fd_2);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1951
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1952 return((stat.size>>1));
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1953 #endif //_WINDOWS
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1954 #endif // OP_RIV_AUDIO
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1955 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1956 #endif // MELODY_E2
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1957
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1958 #if (L1_EXT_AUDIO_MGT)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1959 /*-------------------------------------------------------*/
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1960 /* Cust_ext_audio_mgt_hisr */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1961 /*-------------------------------------------------------*/
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1962 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1963 /* Parameters : none */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1964 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1965 /* Return : none */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1966 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1967 /* Description : */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1968 /* handle the DMA interrupt in order to request a new */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1969 /* buffer */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1970 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1971 /*-------------------------------------------------------*/
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1972 void Cust_ext_audio_mgt_hisr()
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1973 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1974 UWORD8 error_id = 0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1975 UWORD16 requested_size = l1a_l1s_com.stereopath_drv_task.parameters.frame_number*2;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1976
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1977 error_id = Cust_get_pointer((UWORD16 **)&l1a_l1s_com.stereopath_drv_task.parameters.source_buffer_address,
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1978 &requested_size,
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1979 l1s.ext_audio_mgt.session_id);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1980
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1981 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1982 #endif
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1983
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1984 #if 0 /* FreeCalypso: removing functions not present in TCS211 */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1985 void l1a_bt_audio_noti_process()
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1986 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1987 UINT8 channel_id=0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1988 void *p_message = NULL; //omaps00090550
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1989 T_RVF_MB_STATUS mb_status; //omaps00090550
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1990 T_AUDIO_DRIVER_SESSION *p_session;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1991 T_RV_RETURN *return_path;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1992 /* find active channel_id associated to session_id */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1993 while ( (channel_id < AUDIO_DRIVER_MAX_CHANNEL)&&
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1994 ((p_audio_gbl_var->audio_driver_session[channel_id].session_info.state == AUDIO_DRIVER_CHANNEL_WAIT_INIT)||
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1995 (p_audio_gbl_var->audio_driver_session[channel_id].session_req.session_id != AUDIO_EXT_MIDI_SESSION_ID)) )
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1996 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1997 channel_id++;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1998 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1999 /* get driver session */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2000
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2001 p_session = &(p_audio_gbl_var->audio_driver_session[channel_id]);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2002 p_session->session_info.index_l1=1-p_session->session_info.index_l1;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2003 return_path = &(p_session->session_req.return_path);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2004
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2005 /* Translate the l1 message into the Riviera compliant message */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2006 /* Allocate the Riviera buffer */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2007 mb_status = rvf_get_buf ( p_audio_gbl_var->mb_external,
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2008 sizeof (T_AUDIO_DRIVER_NOTIFICATION),
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2009 (T_RVF_BUFFER **) (&p_message));
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2010 /* If insufficient resources, then report a memory error and abort. */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2011 if (mb_status == RVF_RED)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2012 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2013 /* the memory is insufficient to continue the non regression test */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2014 AUDIO_SEND_TRACE("AUDIO entity has no memory for driver notification",RV_TRACE_LEVEL_ERROR);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2015 return;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2016 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2017
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2018 /* Fill the message ID + parameters */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2019 ((T_AUDIO_DRIVER_NOTIFICATION *)p_message)->header.msg_id = AUDIO_DRIVER_NOTIFICATION_MSG;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2020 ((T_AUDIO_DRIVER_NOTIFICATION *)p_message)->channel_id = channel_id;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2021 ((T_AUDIO_DRIVER_NOTIFICATION *)p_message)->p_buffer = NULL;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2022
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2023 /* send answer */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2024 if (return_path->callback_func == NULL)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2025 rvf_send_msg (return_path->addr_id, p_message);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2026 else
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2027 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2028 (*return_path->callback_func)((void *)(p_message));
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2029 rvf_free_buf((T_RVF_BUFFER *)p_message);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2030 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2031
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2032 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2033 //NAVC start/stop/read energy
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2034 // Parameters :d_navc_start_stop_read // 1=start,2=stop,3=read energy
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2035 // UWORD32 d_navc_ctrl_status_energy_val
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2036 // 0=action not performed,1=action perf, xxx-value
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2037 // Description : this function will called to start/stop the NAVC and also to read the energy value during call
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2038 //The bit map of d_navc_ctrl_status is as follows.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2039 // Bit 0: Start command: If 1 NAVC start. Set to 1 by MCU , Reset by DSp after module start Bit 1: Stop command :
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2040 // If 1 NAVC stop. Set to 1 by MCU , Reset by DSP after module stop. Bit 15: Status: Set and reset by DSP. If 1
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2041 // module is active. If 0 module is not active.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2042
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2043
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2044 UWORD32 Cust_navc_ctrl_status(UWORD8 d_navc_start_stop_read)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2045 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2046 UWORD32 d_navc_ctrl_status_energy_val=0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2047
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2048 switch (d_navc_start_stop_read)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2049 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2050 case 1: /* Start NAVC */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2051 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2052 if((l1s_dsp_com.dsp_ndb_ptr->d_navc_ctrl_status & 0x8000)==0)l1s_dsp_com.dsp_ndb_ptr->d_navc_ctrl_status |= 0x01; //check 15th bit and if not active-put the last bit to 1 to start
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2053 d_navc_ctrl_status_energy_val=1; //indicates action performed
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2054 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2055 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2056 case 2: /* Stop NAVC */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2057 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2058 if((l1s_dsp_com.dsp_ndb_ptr->d_navc_ctrl_status & 0x8000)==0x8000)l1s_dsp_com.dsp_ndb_ptr->d_navc_ctrl_status |= 0x02; //check 15th bit and if active-put the last bit to 1 to start
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2059 d_navc_ctrl_status_energy_val=1; //indicates action performed
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2060 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2061 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2062 case 3: /* NAVC read energy */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2063 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2064 if((l1s_dsp_com.dsp_ndb_ptr->d_navc_ctrl_status & 0x8000) == 0x8000)//check 15th bit and if active- read the value--
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2065 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2066 d_navc_ctrl_status_energy_val = l1s_dsp_com.dsp_ndb_ptr->d_vad_noise_ene_ndb[0]; //MSB part
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2067 d_navc_ctrl_status_energy_val= (d_navc_ctrl_status_energy_val<<16)|(l1s_dsp_com.dsp_ndb_ptr->d_vad_noise_ene_ndb[1]); //MSB <<16 | LSB - indicates the energy value
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2068 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2069 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2070 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2071 /*intended fall through */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2072 default:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2073 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2074
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2075
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2076 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2077 #if (L1_NAVC_TRACE == 1) //to see the NAVC trace
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2078 l1_trace_navc(d_navc_start_stop_read,d_navc_ctrl_status_energy_val);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2079 #endif
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2080
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2081 return (d_navc_ctrl_status_energy_val);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2082 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2083 #endif
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2084
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2085 #endif // AUDIO_TASK== 1