eas_parser.h revision e442bb7cd6a085b33a4dd52c0e20a157ada7feb1
1/*----------------------------------------------------------------------------
2 *
3 * File:
4 * eas_parser.h
5 *
6 * Contents and purpose:
7 * Interface declarations for the generic parser interface
8 *
9 * This header only contains declarations that are specific
10 * to this implementation.
11 *
12 * Copyright Sonic Network Inc. 2005
13
14 * Licensed under the Apache License, Version 2.0 (the "License");
15 * you may not use this file except in compliance with the License.
16 * You may obtain a copy of the License at
17 *
18 *      http://www.apache.org/licenses/LICENSE-2.0
19 *
20 * Unless required by applicable law or agreed to in writing, software
21 * distributed under the License is distributed on an "AS IS" BASIS,
22 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
23 * See the License for the specific language governing permissions and
24 * limitations under the License.
25 *
26 *----------------------------------------------------------------------------
27 * Revision Control:
28 *   $Revision: 767 $
29 *   $Date: 2007-07-19 13:47:31 -0700 (Thu, 19 Jul 2007) $
30 *----------------------------------------------------------------------------
31*/
32
33#ifndef _EAS_PARSER_H
34#define _EAS_PARSER_H
35
36#include "eas_types.h"
37
38
39/* metadata callback */
40typedef struct s_metadata_cb_tag
41{
42	EAS_METADATA_CBFUNC		callback;
43	char					*buffer;
44	EAS_VOID_PTR			pUserData;
45	EAS_I32					bufferSize;
46} S_METADATA_CB;
47
48/* generic parser interface */
49typedef struct
50{
51	EAS_RESULT (* EAS_CONST pfCheckFileType)(struct s_eas_data_tag *pEASData, EAS_FILE_HANDLE fileHandle, EAS_VOID_PTR *ppHandle, EAS_I32 offset);
52	EAS_RESULT (* EAS_CONST pfPrepare)(struct s_eas_data_tag *pEASData, EAS_VOID_PTR pInstData);
53	EAS_RESULT (* EAS_CONST pfTime)(struct s_eas_data_tag *pEASData, EAS_VOID_PTR pInstData, EAS_U32 *pTime);
54	EAS_RESULT (* EAS_CONST pfEvent)(struct s_eas_data_tag *pEASData, EAS_VOID_PTR pInstData, EAS_INT parseMode);
55	EAS_RESULT (* EAS_CONST pfState)(struct s_eas_data_tag *pEASData, EAS_VOID_PTR pInstData, EAS_STATE *pState);
56	EAS_RESULT (* EAS_CONST pfClose)(struct s_eas_data_tag *pEASData, EAS_VOID_PTR pInstData);
57	EAS_RESULT (* EAS_CONST pfReset)(struct s_eas_data_tag *pEASData, EAS_VOID_PTR pInstData);
58	EAS_RESULT (* EAS_CONST pfPause)(struct s_eas_data_tag *pEASData, EAS_VOID_PTR pInstData);
59	EAS_RESULT (* EAS_CONST pfResume)(struct s_eas_data_tag *pEASData, EAS_VOID_PTR pInstData);
60	EAS_RESULT (* EAS_CONST pfLocate)(struct s_eas_data_tag *pEASData, EAS_VOID_PTR pInstData, EAS_I32 time, EAS_BOOL *pParserLocate);
61	EAS_RESULT (* EAS_CONST pfSetData)(struct s_eas_data_tag *pEASData, EAS_VOID_PTR pInstData, EAS_I32 param, EAS_I32 value);
62	EAS_RESULT (* EAS_CONST pfGetData)(struct s_eas_data_tag *pEASData, EAS_VOID_PTR pInstData, EAS_I32 param, EAS_I32 *pValue);
63	EAS_RESULT (* EAS_CONST pfGetMetaData)(struct s_eas_data_tag *pEASData, EAS_VOID_PTR pInstData, EAS_I32 *pMediaLength);
64} S_FILE_PARSER_INTERFACE;
65
66typedef enum
67{
68	eParserModePlay,
69	eParserModeLocate,
70	eParserModeMute,
71	eParserModeMetaData
72} E_PARSE_MODE;
73
74typedef enum
75{
76	PARSER_DATA_FILE_TYPE,
77	PARSER_DATA_PLAYBACK_RATE,
78	PARSER_DATA_TRANSPOSITION,
79	PARSER_DATA_VOLUME,
80	PARSER_DATA_SYNTH_HANDLE,
81	PARSER_DATA_METADATA_CB,
82	PARSER_DATA_DLS_COLLECTION,
83	PARSER_DATA_EAS_LIBRARY,
84	PARSER_DATA_POLYPHONY,
85	PARSER_DATA_PRIORITY,
86	PARSER_DATA_FORMAT,
87	PARSER_DATA_MEDIA_LENGTH,
88	PARSER_DATA_JET_CB,
89	PARSER_DATA_MUTE_FLAGS,
90	PARSER_DATA_SET_MUTE,
91	PARSER_DATA_CLEAR_MUTE,
92	PARSER_DATA_NOTE_COUNT,
93	PARSER_DATA_MAX_PCM_STREAMS,
94	PARSER_DATA_GAIN_OFFSET,
95	PARSER_DATA_PLAY_MODE
96} E_PARSER_DATA;
97
98#endif /* #ifndef _EAS_PARSER_H */
99