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