samp_gen.h
上传用户:super_houu
上传日期:2008-09-21
资源大小:4099k
文件大小:8k
- /*******************************************************************************
- * Copyright(c) Philips Consumer Electronics B.V. 2001
- * The attached material and the information contained therein is proprietary
- * to Philips and is issued only under strict confidentiality arrangements.
- * It shall not be used, reproduced, copied in whole or in part, adapted,
- * modified, or disseminated without a written license of Philips.
- * It must be returned to Philips upon its first request.
- *
- * Project: SA-MP ( Super Audio Media Player )
- * File %name: samp_gen.h %
- * %version: 14 %
- * %date_modified: Wed Oct 23 14:27:05 2002 %
- * %derived_by: potm %
- * Creation date: Thu Aug 23 11:09:44 2001
- * First author: klerxm
- *
- * Advanced Systems and Applications Lab - Eindhoven
- *
- * Continuus %full_filespec: samp_gen.h~14:incl:1 %
- *
- * Description: Global type definitions
- *
- * Change history:
- *
- * Rev Date Who Comments
- * ---- ---------- -------- -----------------------------------------------------
- * 1 2001-08-23 klerxm This version includes all definitions previously in
- * samp_local.h and sacd.h
- * Definitions for GUARDED and FATAL have been moved to
- * a separate header file
- * 2 2001-08-23 klerxm Added include files <stddefs.h> and <limits.h>
- * 3 2001-10-08 coenen Added SACD_ChannelsDef
- * 4 2001-11-05 klerxm Added general function prototypes
- * 5 2001-11-06 klerxm Changed prototype of SAMP_Activate to match prototype
- * of SDI_Activate
- * 6 2001-11-22 novosadt Added Hybrid argument to SAMP_Activate
- * 7 2002-01-22 potm Added SAMP_SACDDiscRec prototype
- * 8 2002-01-30 potm Added discRecognised parameter to SAMP_Activate
- * enabling activation without reading the master TOC
- * if it has already been read during recognition
- * (CR284)
- * 9 2002-02-13 novosadt Added SACD_InputModeDef (CR321)
- * 10 2002-02-21 potm Changed type SACD_ChannelsDef to
- * SACD_ChannelsConfigDef (CR260)
- * 11 2002-05-24 potm Removed unused type definitions SACD_Index,
- * SACD_PhyTrack and SACD_LogTrack
- * 12 2002-06-07 klerxm Added 'extern "C"'
- * 13 2002-10-23 novosadt Added SACD_ActivateErrorDef (CR423)
- * 14 2002-12-16 potm Removed SAMP_ERR_REQ_INTERFACE from
- * SACD_ActivateErrorDef (CR442)
- *
- *******************************************************************************/
- #ifndef _SAMP_GEN_H
- #define _SAMP_GEN_H
- /*******************************************************************************
- * Include Files
- *******************************************************************************/
- #include <stddef.h>
- #include <limits.h>
- #ifdef __cplusplus
- extern "C" {
- #endif
- #ifdef TEST_HARNASS ///////////// for test only.
- #define THGNAV
- #define THGAPM
- #define THGSAMP
- //#define THGSDI
- #define THGSDM
- #define THGGLUE
- #endif//TEST_HARNASS ////////////
- /*******************************************************************************
- * Macro Definitions
- *******************************************************************************/
- #define SAMP(name) SAMP_##name
- #define SAMP_EXP(name) SAMP_EXP_##name
- #ifndef FALSE
- #define FALSE 0
- #endif
- #ifndef TRUE
- #define TRUE 1
- #endif
- #define SAMP_ACTIVATED (1 << 0)
- #define SAMP_NOT_ACTIVATED (1 << 1)
- #ifdef SACD_AREA_INFO_INSDRAM
- #define SACD_MAX_TRACK_NUMBER 255
- #else
- #define SACD_MAX_TRACK_NUMBER 25
- #endif
- /*
- * Bitmask definitions to be used for SACD_ChannelsConfigDef
- */
- #define SACD_CHANNELS_FRONT (1 << 0)
- #define SACD_CHANNELS_CENTER (1 << 1)
- #define SACD_CHANNELS_LFE (1 << 2)
- #define SACD_CHANNELS_REAR (1 << 3)
- /*******************************************************************************
- * Type Definitions
- *******************************************************************************/
- typedef unsigned char SAMP(Byte);
- typedef unsigned short SAMP(Word);
- typedef unsigned long SAMP(Quad);
- typedef unsigned char SAMP(UInt8);
- typedef unsigned short SAMP(UInt16);
- typedef unsigned long SAMP(UInt32);
- typedef signed char SAMP(Int8);
- typedef signed short SAMP(Int16);
- typedef signed long SAMP(Int32);
- typedef unsigned char SAMP(BitSet8);
- typedef unsigned short SAMP(BitSet16);
- typedef unsigned long SAMP(BitSet32);
- typedef unsigned char SAMP(Bool);
- typedef SAMP(BitSet8) SAMP(SACD_ChannelsConfigDef);
- typedef enum
- { SAMP(ERR_OK) = 0
- , SAMP(ERR_FAILED)
- , SAMP(ERR_UNKNOWN)
- , SAMP(ERR_INVALID_PARAM)
- , SAMP(ERR_INVALID_STATE)
- , SAMP(ERR_NO_RESOURCES)
- , SAMP(ERR_ERROR_STATE)
- , SAMP(ERR_NOT_IMPLEMENTED)
- } SAMP(ErrCode);
- typedef struct
- { SAMP(Byte) min;
- SAMP(Byte) sec;
- SAMP(Byte) fr;
- } SAMP(SACD_TimeCode);
- typedef enum
- { SAMP(SACD_AREA_STEREO)
- , SAMP(SACD_AREA_MULTICHANNEL)
- } SAMP(SACD_Area);
- typedef enum
- { SAMP(SACD_AUDIO_2_CHANNEL_PLAIN)
- , SAMP(SACD_AUDIO_2_CHANNEL_PACKED)
- , SAMP(SACD_AUDIO_5_CHANNEL_PACKED)
- , SAMP(SACD_AUDIO_6_CHANNEL_PACKED)
- } SAMP(SACD_AudioMode);
- typedef enum
- { SAMP(SACD_IN_DSD)
- , SAMP(SACD_IN_PCM_44)
- , SAMP(SACD_IN_PCM_88)
- , SAMP(SACD_IN_PCM_176)
- , SAMP(SACD_IN_PCM_48)
- , SAMP(SACD_IN_PCM_96)
- , SAMP(SACD_IN_PCM_192)
- } SAMP(SACD_InputModeDef);
- typedef SAMP(UInt32) SAMP(SACD_Frame);
- typedef SAMP(UInt32) SAMP(SACD_PhyPosition);
- typedef SAMP(UInt32) SAMP(SACD_LogPosition);
- typedef enum
- { SAMP(SACD_DATA_RESERVED)
- , SAMP(SACD_DATA_AUDIO)
- , SAMP(SACD_DATA_SUPDATA)
- , SAMP(SACD_DATA_STUFFING)
- } SAMP(SACD_DataType);
- typedef struct
- { SAMP(Int16) NumberOfTracks;
- SAMP(Int16) TrackOffset;
- SAMP(SACD_TimeCode) TotalAreaTime;
- SAMP(SACD_TimeCode) TrackStart[SACD_MAX_TRACK_NUMBER]; // ARNO, MUST LATER BE SET TO SACD_MAX_TRACK_NUMBER
- SAMP(SACD_TimeCode) TrackLength[SACD_MAX_TRACK_NUMBER]; // ARNO, MUST LATER BE SET TO SACD_MAX_TRACK_NUMBER
- } SAMP(SAMP_AreaInfoDef);
- //todo: check if track no is 0 based.
- #define TRACK_START_INFO_LOCATION(x) (5 + 3*x) //(7 + 3*x) todo: check with Philips.
- //not correct #define TRACK_LEN_INFO_LOCATION(x) (5 + 3*SACD_MAX_TRACK_NUMBER + 3*x) //(7 + 3*20 + 3*x) todo: check with Philips.
- typedef enum {
- SAMP(SAMP_ERR_STANDARD_VIOLATION),
- SAMP(SAMP_ERR_READ_ERROR),
- SAMP(SAMP_ERR_NO_PSP),
- SAMP(SAMP_ERR_UNKNOWN)
- } SAMP(SAMP_ActivateErrorDef);
- typedef void (*SAMP(SAMP_CallbackDef))(SAMP(BitSet32) Event, void* EventData);
- /*******************************************************************************
- * Functions Prototypes
- *******************************************************************************/
- SAMP(ErrCode) SAMP(SAMP_Init)(void);
- SAMP(ErrCode) SAMP(SAMP_Term)(void);
- SAMP(ErrCode) SAMP(SAMP_SACDDiscRec)( SAMP(Bool) *pSACD, SAMP(Bool) *pHybrid );
- SAMP(ErrCode) SAMP(SAMP_Activate)( SAMP(Bool) discRecognised,
- SAMP(SAMP_AreaInfoDef) *pST_Info,
- SAMP(SAMP_AreaInfoDef) *pMC_Info,
- SAMP(Bool) *pHybrid );
- SAMP(ErrCode) SAMP(SAMP_Deactivate)(void);
- SAMP(ErrCode) SAMP(SAMP_Reactivate)(void);
- SAMP(ErrCode) SAMP(SAMP_Subscribe)(SAMP(SAMP_CallbackDef) Callback, SAMP(BitSet32) Events);
- #ifdef __cplusplus
- }
- #endif
- #endif /* _SAMP_GEN_H */
- /*******************************************************************************
- * End of File
- *******************************************************************************/