annotate chipsetsw/layer1/audio_cust0/l1audio_cust.c @ 284:33b35965b4a0

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