• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*----------------------------------------------------------------------------
2  *
3  * File:
4  * eas_otadata.h
5  *
6  * Contents and purpose:
7  * OTA File Parser
8  *
9  * This file contains data declarations for the OTA parser.
10  *
11  * Copyright Sonic Network Inc. 2005
12 
13  * Licensed under the Apache License, Version 2.0 (the "License");
14  * you may not use this file except in compliance with the License.
15  * You may obtain a copy of the License at
16  *
17  *      http://www.apache.org/licenses/LICENSE-2.0
18  *
19  * Unless required by applicable law or agreed to in writing, software
20  * distributed under the License is distributed on an "AS IS" BASIS,
21  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22  * See the License for the specific language governing permissions and
23  * limitations under the License.
24  *
25  *----------------------------------------------------------------------------
26  * Revision Control:
27  *   $Revision: 82 $
28  *   $Date: 2006-07-10 11:45:19 -0700 (Mon, 10 Jul 2006) $
29  *----------------------------------------------------------------------------
30 */
31 
32 #ifndef EAS_OTADATA_H
33 #define EAS_OTADATA_H
34 
35 #include "eas_data.h"
36 
37 /* definition for state flags */
38 #define OTA_FLAGS_UNICODE           0x01    /* unicode text */
39 
40 /*----------------------------------------------------------------------------
41  *
42  * S_OTA_DATA
43  *
44  * This structure contains the state data for the OTA parser
45  *----------------------------------------------------------------------------
46 */
47 
48 typedef struct
49 {
50     EAS_I32         fileOffset;             /* offset to location in file */
51     EAS_U8          patternLen;             /* length of current pattern */
52     EAS_U8          dataByte;               /* previous char from file */
53     EAS_U8          bitCount;               /* bit count in char */
54 } S_OTA_LOC;
55 
56 typedef struct
57 {
58     EAS_FILE_HANDLE fileHandle;             /* file handle */
59     S_SYNTH *pSynth;                /* synth handle */
60     EAS_I32         fileOffset;             /* offset to start of data */
61     EAS_I32         time;                   /* current time in 256ths of a msec */
62     EAS_U32         tick;                   /* length of 32nd note in 256th of a msec */
63     EAS_U32         restTicks;              /* ticks to rest after current note */
64     S_OTA_LOC       patterns[4];            /* pattern locations */
65     S_OTA_LOC       current;                /* current location */
66     S_OTA_LOC       restore;                /* previous location */
67     S_METADATA_CB   metadata;               /* metadata callback */
68     EAS_U8          flags;                  /* bit flags */
69     EAS_U8          numPatterns;            /* number of patterns left in song */
70     EAS_U8          currentPattern;         /* current pattern for loop */
71     EAS_U8          note;                   /* MIDI note number */
72     EAS_U8          octave;                 /* octave modifier */
73     EAS_U8          style;                  /* from STYLE */
74     EAS_U8          velocity;               /* current volume */
75     EAS_U8          state;                  /* current state EAS_STATE_XXXX */
76     EAS_U8          loopCount;              /* loop count for pattern */
77 } S_OTA_DATA;
78 
79 #endif
80 
81 
82