eas_parser.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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. * 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: 767 $
  28. * $Date: 2007-07-19 13:47:31 -0700 (Thu, 19 Jul 2007) $
  29. *----------------------------------------------------------------------------
  30. */
  31. #ifndef _EAS_PARSER_H
  32. #define _EAS_PARSER_H
  33. #include "eas_types.h"
  34. /* metadata callback */
  35. typedef struct s_metadata_cb_tag
  36. {
  37. EAS_METADATA_CBFUNC callback;
  38. char *buffer;
  39. EAS_VOID_PTR pUserData;
  40. EAS_I32 bufferSize;
  41. } S_METADATA_CB;
  42. /* generic parser interface */
  43. typedef struct
  44. {
  45. EAS_RESULT (* EAS_CONST pfCheckFileType)(struct s_eas_data_tag *pEASData, EAS_FILE_HANDLE fileHandle, EAS_VOID_PTR *ppHandle, EAS_I32 offset);
  46. EAS_RESULT (* EAS_CONST pfPrepare)(struct s_eas_data_tag *pEASData, EAS_VOID_PTR pInstData);
  47. EAS_RESULT (* EAS_CONST pfTime)(struct s_eas_data_tag *pEASData, EAS_VOID_PTR pInstData, EAS_U32 *pTime);
  48. EAS_RESULT (* EAS_CONST pfEvent)(struct s_eas_data_tag *pEASData, EAS_VOID_PTR pInstData, EAS_INT parseMode);
  49. EAS_RESULT (* EAS_CONST pfState)(struct s_eas_data_tag *pEASData, EAS_VOID_PTR pInstData, EAS_STATE *pState);
  50. EAS_RESULT (* EAS_CONST pfClose)(struct s_eas_data_tag *pEASData, EAS_VOID_PTR pInstData);
  51. EAS_RESULT (* EAS_CONST pfReset)(struct s_eas_data_tag *pEASData, EAS_VOID_PTR pInstData);
  52. EAS_RESULT (* EAS_CONST pfPause)(struct s_eas_data_tag *pEASData, EAS_VOID_PTR pInstData);
  53. EAS_RESULT (* EAS_CONST pfResume)(struct s_eas_data_tag *pEASData, EAS_VOID_PTR pInstData);
  54. EAS_RESULT (* EAS_CONST pfLocate)(struct s_eas_data_tag *pEASData, EAS_VOID_PTR pInstData, EAS_I32 time, EAS_BOOL *pParserLocate);
  55. EAS_RESULT (* EAS_CONST pfSetData)(struct s_eas_data_tag *pEASData, EAS_VOID_PTR pInstData, EAS_I32 param, EAS_I32 value);
  56. EAS_RESULT (* EAS_CONST pfGetData)(struct s_eas_data_tag *pEASData, EAS_VOID_PTR pInstData, EAS_I32 param, EAS_I32 *pValue);
  57. EAS_RESULT (* EAS_CONST pfGetMetaData)(struct s_eas_data_tag *pEASData, EAS_VOID_PTR pInstData, EAS_I32 *pMediaLength);
  58. } S_FILE_PARSER_INTERFACE;
  59. typedef enum
  60. {
  61. eParserModePlay,
  62. eParserModeLocate,
  63. eParserModeMute,
  64. eParserModeMetaData
  65. } E_PARSE_MODE;
  66. typedef enum
  67. {
  68. PARSER_DATA_FILE_TYPE,
  69. PARSER_DATA_PLAYBACK_RATE,
  70. PARSER_DATA_TRANSPOSITION,
  71. PARSER_DATA_VOLUME,
  72. PARSER_DATA_SYNTH_HANDLE,
  73. PARSER_DATA_METADATA_CB,
  74. PARSER_DATA_DLS_COLLECTION,
  75. PARSER_DATA_EAS_LIBRARY,
  76. PARSER_DATA_POLYPHONY,
  77. PARSER_DATA_PRIORITY,
  78. PARSER_DATA_FORMAT,
  79. PARSER_DATA_MEDIA_LENGTH,
  80. PARSER_DATA_JET_CB,
  81. PARSER_DATA_MUTE_FLAGS,
  82. PARSER_DATA_SET_MUTE,
  83. PARSER_DATA_CLEAR_MUTE,
  84. PARSER_DATA_NOTE_COUNT,
  85. PARSER_DATA_MAX_PCM_STREAMS,
  86. PARSER_DATA_GAIN_OFFSET,
  87. PARSER_DATA_PLAY_MODE
  88. } E_PARSER_DATA;
  89. #endif /* #ifndef _EAS_PARSER_H */