xref: /aosp_15_r20/external/sonivox/arm-wt-22k/lib_src/eas_imelodydata.h (revision f81fb7c475c4b71ff83bdcc517de2a8c174e4e5c)
1*f81fb7c4SAndroid Build Coastguard Worker /*----------------------------------------------------------------------------
2*f81fb7c4SAndroid Build Coastguard Worker  *
3*f81fb7c4SAndroid Build Coastguard Worker  * File:
4*f81fb7c4SAndroid Build Coastguard Worker  * eas_imelodydata.h
5*f81fb7c4SAndroid Build Coastguard Worker  *
6*f81fb7c4SAndroid Build Coastguard Worker  * Contents and purpose:
7*f81fb7c4SAndroid Build Coastguard Worker  * SMF File Parser
8*f81fb7c4SAndroid Build Coastguard Worker  *
9*f81fb7c4SAndroid Build Coastguard Worker  * This file contains data declarations for the iMelody parser.
10*f81fb7c4SAndroid Build Coastguard Worker  *
11*f81fb7c4SAndroid Build Coastguard Worker  * Copyright Sonic Network Inc. 2005
12*f81fb7c4SAndroid Build Coastguard Worker 
13*f81fb7c4SAndroid Build Coastguard Worker  * Licensed under the Apache License, Version 2.0 (the "License");
14*f81fb7c4SAndroid Build Coastguard Worker  * you may not use this file except in compliance with the License.
15*f81fb7c4SAndroid Build Coastguard Worker  * You may obtain a copy of the License at
16*f81fb7c4SAndroid Build Coastguard Worker  *
17*f81fb7c4SAndroid Build Coastguard Worker  *      http://www.apache.org/licenses/LICENSE-2.0
18*f81fb7c4SAndroid Build Coastguard Worker  *
19*f81fb7c4SAndroid Build Coastguard Worker  * Unless required by applicable law or agreed to in writing, software
20*f81fb7c4SAndroid Build Coastguard Worker  * distributed under the License is distributed on an "AS IS" BASIS,
21*f81fb7c4SAndroid Build Coastguard Worker  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22*f81fb7c4SAndroid Build Coastguard Worker  * See the License for the specific language governing permissions and
23*f81fb7c4SAndroid Build Coastguard Worker  * limitations under the License.
24*f81fb7c4SAndroid Build Coastguard Worker  *
25*f81fb7c4SAndroid Build Coastguard Worker  *----------------------------------------------------------------------------
26*f81fb7c4SAndroid Build Coastguard Worker  * Revision Control:
27*f81fb7c4SAndroid Build Coastguard Worker  *   $Revision: 778 $
28*f81fb7c4SAndroid Build Coastguard Worker  *   $Date: 2007-07-23 16:45:17 -0700 (Mon, 23 Jul 2007) $
29*f81fb7c4SAndroid Build Coastguard Worker  *----------------------------------------------------------------------------
30*f81fb7c4SAndroid Build Coastguard Worker */
31*f81fb7c4SAndroid Build Coastguard Worker 
32*f81fb7c4SAndroid Build Coastguard Worker #ifndef EAS_IMELODYDATA_H
33*f81fb7c4SAndroid Build Coastguard Worker #define EAS_IMELODYDATA_H
34*f81fb7c4SAndroid Build Coastguard Worker 
35*f81fb7c4SAndroid Build Coastguard Worker #include "eas_data.h"
36*f81fb7c4SAndroid Build Coastguard Worker 
37*f81fb7c4SAndroid Build Coastguard Worker /* maximum line size as specified in iMelody V1.2 spec */
38*f81fb7c4SAndroid Build Coastguard Worker #define MAX_LINE_SIZE           75
39*f81fb7c4SAndroid Build Coastguard Worker 
40*f81fb7c4SAndroid Build Coastguard Worker /*----------------------------------------------------------------------------
41*f81fb7c4SAndroid Build Coastguard Worker  *
42*f81fb7c4SAndroid Build Coastguard Worker  * S_IMELODY_DATA
43*f81fb7c4SAndroid Build Coastguard Worker  *
44*f81fb7c4SAndroid Build Coastguard Worker  * This structure contains the state data for the iMelody parser
45*f81fb7c4SAndroid Build Coastguard Worker  *----------------------------------------------------------------------------
46*f81fb7c4SAndroid Build Coastguard Worker */
47*f81fb7c4SAndroid Build Coastguard Worker 
48*f81fb7c4SAndroid Build Coastguard Worker typedef struct
49*f81fb7c4SAndroid Build Coastguard Worker {
50*f81fb7c4SAndroid Build Coastguard Worker     EAS_FILE_HANDLE fileHandle;                 /* file handle */
51*f81fb7c4SAndroid Build Coastguard Worker     S_SYNTH         *pSynth;                    /* pointer to synth */
52*f81fb7c4SAndroid Build Coastguard Worker     EAS_I32         fileOffset;                 /* offset to start of data */
53*f81fb7c4SAndroid Build Coastguard Worker     EAS_I32         time;                       /* current time in 256ths of a msec */
54*f81fb7c4SAndroid Build Coastguard Worker     EAS_I32         tickBase;                   /* basline length of 32nd note in 256th of a msec */
55*f81fb7c4SAndroid Build Coastguard Worker     EAS_I32         tick;                       /* actual length of 32nd note in 256th of a msec */
56*f81fb7c4SAndroid Build Coastguard Worker     EAS_I32         restTicks;                  /* ticks to rest after current note */
57*f81fb7c4SAndroid Build Coastguard Worker     EAS_I32         startLine;                  /* file offset at start of line (for repeats) */
58*f81fb7c4SAndroid Build Coastguard Worker     EAS_I32         repeatOffset;               /* file offset to start of repeat section */
59*f81fb7c4SAndroid Build Coastguard Worker     EAS_I32         repeatTime;                 /* time at start of repeat section */
60*f81fb7c4SAndroid Build Coastguard Worker     S_METADATA_CB   metadata;                   /* metadata callback */
61*f81fb7c4SAndroid Build Coastguard Worker     EAS_I16         repeatCount;                /* repeat counter */
62*f81fb7c4SAndroid Build Coastguard Worker     EAS_U8          state;                      /* current state EAS_STATE_XXXX */
63*f81fb7c4SAndroid Build Coastguard Worker     EAS_U8          style;                      /* from STYLE */
64*f81fb7c4SAndroid Build Coastguard Worker     EAS_U8          index;                      /* index into buffer */
65*f81fb7c4SAndroid Build Coastguard Worker     EAS_U8          octave;                     /* octave prefix */
66*f81fb7c4SAndroid Build Coastguard Worker     EAS_U8          volume;                     /* current volume */
67*f81fb7c4SAndroid Build Coastguard Worker     EAS_U8          note;                       /* MIDI note number */
68*f81fb7c4SAndroid Build Coastguard Worker     EAS_I8          noteModifier;               /* sharp or flat */
69*f81fb7c4SAndroid Build Coastguard Worker     EAS_I8          buffer[MAX_LINE_SIZE+1];    /* buffer for ASCII data */
70*f81fb7c4SAndroid Build Coastguard Worker } S_IMELODY_DATA;
71*f81fb7c4SAndroid Build Coastguard Worker 
72*f81fb7c4SAndroid Build Coastguard Worker #endif
73*f81fb7c4SAndroid Build Coastguard Worker 
74*f81fb7c4SAndroid Build Coastguard Worker 
75