MP3.h
上传用户:super_houu
上传日期:2008-09-21
资源大小:4099k
文件大小:5k
- /****************************************************************************************
- * Copyright (c) 2000 ZORAN Corporation, All Rights Reserved
- * THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF ZORAN CORPORATION
- *
- * File: $Workfile: MP3.h $
- *
- * Description:
- * ============
- * Management of MP3 Clips
- *
- * Log:
- * ====
- ****************************************************************************************
- * Updates:
- ****************************************************************************************
- * $Log: /SourceCode/I64_Common/I64_Reference/Playcore/Nav_Clips/MP3.h $
- *
- * 8 8/19/03 4:11p Leonh
- *
- * 8 8/19/03 4:10p Leonh
- * Support getting mp3 VBR total time
- *
- * 7 8/18/03 4:41p Leonh
- * implement fuction to get accurate time with MP3 VBR
- *
- * 6 03-05-28 22:40 Leonh
- * support mepg 1 layer 2
- *
- * 5 03-04-11 14:05 Janeg
- * JerryC : Add MP3_Time_To_Address() prototype.
- *
- * 4 03-01-10 12:21 Leslie
- * Add wide-character strings support
- *
- * 3 10/30/02 17:49 Rond
- *
- * 3 11/09/02 15:48 Atai
- * Vaddis 5e production update
- *
- * 4 15/08/02 0:20 Nirm
- * - Documentation.
- *
- * 3 30/07/02 20:35 Nirm
- * - Integrated Multi-Standard support for Clips.
- *
- * 2 23/04/02 9:32 Nirm
- * - Added dependency in "Config.h".
- *
- * 1 18/02/02 11:31 Nirm
- * Added MP3-ID3v1 support.
- *
- * 6 15/04/01 20:02 Nirm
- * Added Sampling-Rate information into ClipInfo;
- * Updated the prototypre for MP3_getMPEGInfo().
- *
- * 5 11/04/01 12:24 Nirm
- * Added support for MPEG-info extraction.
- *
- * 4 9/04/01 11:51 Nirm
- * Removed enumeration (unused).
- *
- * 3 4/04/01 17:36 Nirm
- * Wotk in progress.
- *
- * 2 2/04/01 16:05 Nirm
- * work in progress.
- *
- * 1 1/04/01 20:05 Nirm
- * Initial Version, unoperational.
- ****************************************************************************************/
- #include "Config.h" // Global Configuration - do not remove!
- #ifndef __MP3_H_
- #define __MP3_H_
- #include "IncludeSysDefs.h"
- #include "PlaycoreFileSysFileSystem.h"
- /////////////////////////////////////////////////////////////////////////////
- // General MP3
- /////////////////////////////////////////////////////////////////////////////
- /////////////////////////////////////////////////////////////////////////////
- // Constants and Enumerations
- #define ID3V1_SIZE 128
- #define ID3V1_TEXT_LENGTH 30
- #define IS_LAYER_II 2
- typedef enum { eStereo=0, eJointStereo, eDualChannel, eSingleChannel } enStereoMode;
- /////////////////////////////////////////////////////////////////////////////
- // Common Structures
- // The Header found in any MPEG Audio stream
- struct MPEG_Header {
- UINT sSyncword : 12;
- UINT uMPEGVersion : 1;
- UINT uLayer : 2;
- UINT bCRCPresent : 1;
- UINT uBitrateInd : 4;
- UINT uSamplingFreq: 2;
- UINT bPadding : 1;
- UINT bPrivate : 1;
- UINT uMode : 2;
- UINT uModeExt : 2;
- UINT bCopyright : 1;
- UINT bOriginal : 1;
- UINT uEmphasis : 2;
- };
- // MP3-ID3 Tag Information
- typedef struct MP3_ID3v1Tag_TAG {
- WCHAR szSongName[ID3V1_TEXT_LENGTH+1];
- WCHAR szArtist[ID3V1_TEXT_LENGTH+1];
- WCHAR szAlbum[ID3V1_TEXT_LENGTH+1];
- WCHAR szYear[5];
- WCHAR szComment[ID3V1_TEXT_LENGTH+1];
- UINT8 uTrackNum;
- LPCWSTR pszGenre;
- } MP3_ID3v1Tag;
- //<<<LeonH_0818_2003_A :For Get mp3 VBR total time
- typedef struct
- {
- int h_id; // from MPEG header, 0=MPEG2, 1=MPEG1
- int flags; // from Xing header data
- int frames; // total bit stream frames from Xing header data
- int bytes; // total bit stream bytes from Xing header data
- } XHEADDATA;
- // MPEG Information
- typedef struct MPEGInfo_TAG {
- UINT8 uLayer;
- BOOL isXingHeaderOn;
- } MPEGInfo;
- //>>>LeonH_0818_2003_A
- /////////////////////////////////////////////////////////////////////////////
- // Public Services
- void MP3_setPresentationTime(UINT8 uPresentationTime);
- BOOL MP3_getMPEGInfo(DWORD dwClipStartAddr, DWORD cbClipSize,
- MPEGInfo *o_pMPEGInfo);
- BOOL MP3_getID3v1Tag(DWORD dwClipStartAddr, DWORD cbClipSize,
- WORD i_pExtInfo_sc_handle);
- /////////////////////////////////////////////////////////////////////////////
- // MP3 Clip
- /////////////////////////////////////////////////////////////////////////////
- /////////////////////////////////////////////////////////////////////////////
- // Public Services
- BOOL MP3Clip_isKindOf(LPCWSTR i_pszFilename);
- void MP3Clip_construct(struct Clip_TAG *o_pThis, const FindData *i_pFileInfo);
- DWORD MP3_Time_To_Address(WORD uTime);
- #endif //__MP3_H_