summaryrefslogtreecommitdiffstats
path: root/pico/lib/picodefs.h
blob: 8c24039f8744e71a25d7c8c5eb4789bd58602178 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
/*
 * Copyright (C) 2008-2009 SVOX AG, Baslerstr. 30, 8048 Zuerich, Switzerland
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/**
 * @file picodefs.h
 *
 * SVOX Pico definitions
 * (SVOX Pico version 1.0 and later)
 *
 * Copyright (C) 2008-2009 SVOX AG, Baslerstr. 30, 8048 Zuerich, Switzerland
 * All rights reserved.
 *
 * History:
 * - 2009-04-20 -- initial version
 */


#ifndef PICODEFS_H_
#define PICODEFS_H_

#ifdef __cplusplus
extern "C" {
#endif


/* ********************************************************************/
/* SVOX Pico limits                                                   */
/* ********************************************************************/
/* maximum size of a voice name, including the terminating null
   character */
#define PICO_MAX_VOICE_NAME_SIZE        32

/* maximum size of a resource name, incl. the terminating null
   character */
#define PICO_MAX_RESOURCE_NAME_SIZE     32

/* maximum size of a data path name, incl. the terminating null
   character */
#define PICO_MAX_DATAPATH_NAME_SIZE    128

/* maximum size of a file name, incl. the terminating null
   character */
#define PICO_MAX_FILE_NAME_SIZE         64

/* maximum number of resources */
#define PICO_MAX_NUM_RESOURCES          64

/* maximum number of voice definitions */
#define PICO_MAX_NUM_VOICE_DEFINITIONS  64

/* maximum number of resources per voice */
#define PICO_MAX_NUM_RSRC_PER_VOICE     16

/* maximum length of foreign header prepended to PICO resource files
   (header length must be a multiple of 4 bytes) */
#define PICO_MAX_FOREIGN_HEADER_LEN     64



/* ********************************************************************/
/* SVOX PICO status codes                                             */
/* ********************************************************************/

typedef signed int pico_Status;


/* Okay ***************************************************************/
/* functions return PICO_OK if all is okay */

#define PICO_OK                         (pico_Status)     0


/* Exceptions and error codes *****************************************/

/* in case of exceptional events and errors (e.g. unexpected user
   input) that disrupt the normal flow of operation, PICO_EXC_* or
   PICO_ERR_* are returned. */

#define PICO_EXC_NUMBER_FORMAT          (pico_Status)   -10
#define PICO_EXC_MAX_NUM_EXCEED         (pico_Status)   -11
#define PICO_EXC_NAME_CONFLICT          (pico_Status)   -12
#define PICO_EXC_NAME_UNDEFINED         (pico_Status)   -13
#define PICO_EXC_NAME_ILLEGAL           (pico_Status)   -14

/* buffer interaction */
#define PICO_EXC_BUF_OVERFLOW           (pico_Status)   -20
#define PICO_EXC_BUF_UNDERFLOW          (pico_Status)   -21
#define PICO_EXC_BUF_IGNORE             (pico_Status)   -22

/* internal memory handling */
#define PICO_EXC_OUT_OF_MEM             (pico_Status)   -30

/* files */
#define PICO_EXC_CANT_OPEN_FILE         (pico_Status)   -40
#define PICO_EXC_UNEXPECTED_FILE_TYPE   (pico_Status)   -41
#define PICO_EXC_FILE_CORRUPT           (pico_Status)   -42
#define PICO_EXC_FILE_NOT_FOUND         (pico_Status)   -43

/* resources */
#define PICO_EXC_RESOURCE_BUSY          (pico_Status)   -50
#define PICO_EXC_RESOURCE_MISSING       (pico_Status)   -51

/* knowledge bases */
#define PICO_EXC_KB_MISSING             (pico_Status)   -60

/* runtime exceptions */
#define PICO_ERR_NULLPTR_ACCESS         (pico_Status)  -100
#define PICO_ERR_INVALID_HANDLE         (pico_Status)  -101
#define PICO_ERR_INVALID_ARGUMENT       (pico_Status)  -102
#define PICO_ERR_INDEX_OUT_OF_RANGE     (pico_Status)  -103

/* other errors ("external" errors, e.g. hardware failure). */
#define PICO_ERR_OTHER                  (pico_Status)  -999


/* Warnings ***********************************************************/

/* general */
#define PICO_WARN_INCOMPLETE            (pico_Status)    10
#define PICO_WARN_FALLBACK              (pico_Status)    11
#define PICO_WARN_OTHER                 (pico_Status)    19

/* resources */
#define PICO_WARN_KB_OVERWRITE          (pico_Status)    50
#define PICO_WARN_RESOURCE_DOUBLE_LOAD  (pico_Status)    51

/* classifiers */
#define PICO_WARN_INVECTOR              (pico_Status)    60
#define PICO_WARN_CLASSIFICATION        (pico_Status)    61
#define PICO_WARN_OUTVECTOR             (pico_Status)    62

/* processing units */
#define PICO_WARN_PU_IRREG_ITEM         (pico_Status)    70
#define PICO_WARN_PU_DISCARD_BUF        (pico_Status)    71



/* ********************************************************************/
/* Engine getData return values                                       */
/* ********************************************************************/

#define PICO_STEP_IDLE                  (pico_Status)   200
#define PICO_STEP_BUSY                  (pico_Status)   201

#define PICO_STEP_ERROR                 (pico_Status)  -200

/* Engine reset modes ***********************************************************/

/* general */
#define PICO_RESET_FULL                 (pico_Status)    0
#define PICO_RESET_SOFT                 (pico_Status)    0x10


/* ********************************************************************/
/* Engine getData outDataType values                                  */
/* ********************************************************************/

/* 16 bit PCM samples, native endianness of platform */
#define PICO_DATA_PCM_16BIT             (pico_Int16)  1

#ifdef __cplusplus
}
#endif


#endif /*PICODEFS_H_*/