📄 globals.h
字号:
//****************************************************************************//// GLOBALS.H - Contains global definitions and function prototypes for the// Internet audio player application.//// Copyright (c) 1999,2000,2001 Cirrus Logic, Inc.////****************************************************************************#include "buffer/buffer.h"#include "fat/fat.h"#include "../config.h"//****************************************************************************//// The maximum number of tracks supported by the player.////****************************************************************************#define MAX_TRACKS 100//****************************************************************************//// The following values define the flags contained in the system flags// variable.////****************************************************************************#define SYSFLAG_KEYBOARD_COUNT_MASK 0x00000007#define SYSFLAG_PROCESS_OUTPUT 0x00000008#define SYSFLAG_START_DOWNLOAD 0x00000010#define SYSFLAG_INPUT_ENABLED 0x00000020#define SYSFLAG_OUTPUT_ENABLED 0x00000040#define SYSFLAG_MEDIA_INSERT 0x00000080#define SYSFLAG_MEDIA_REMOVE 0x00000100#define SYSFLAG_REPEAT_MASK 0x00000600#define SYSFLAG_REPEAT_OFF 0x00000000#define SYSFLAG_REPEAT_ONE 0x00000200#define SYSFLAG_REPEAT_ALL 0x00000400#define SYSFLAG_REPEAT_SHIFT 9//****************************************************************************//// The following values are the IOCTLs which are sent to the individual codec// drivers.////****************************************************************************enum{ IOCTL_CODEC_GETNAME, IOCTL_CODEC_GETARTIST, IOCTL_CODEC_GETTITLE, IOCTL_CODEC_GETBITRATE, IOCTL_CODEC_GETSAMPLERATE, IOCTL_CODEC_GETCHANNELS, IOCTL_CODEC_GETLENGTH, IOCTL_CODEC_GETTIME, IOCTL_CODEC_QUERY, IOCTL_CODEC_OPEN, IOCTL_CODEC_GETCAPTUREBUFFER, IOCTL_CODEC_SETBUFFER, IOCTL_CODEC_CAN_DECODE, IOCTL_CODEC_DECODE, IOCTL_CODEC_CAN_ENCODE, IOCTL_CODEC_ENCODE, IOCTL_CODEC_SEEK, IOCTL_CODEC_CLOSE};//****************************************************************************//// The following are the flags passed to CodecOpen.////****************************************************************************#define CODEC_OPEN_ENCODE 0x00000001#define CODEC_OPEN_DECODE 0x00000002//****************************************************************************//// The following values are the IOCTLs which are sent to the individual// file system drivers.////****************************************************************************enum{ IOCTL_FS_INIT, IOCTL_FS_GETMEDIAID, IOCTL_FS_GETMEDIANAME, IOCTL_FS_OPEN, IOCTL_FS_CREATE, IOCTL_FS_READ, IOCTL_FS_READ_BS, IOCTL_FS_WRITE, IOCTL_FS_SEEK, IOCTL_FS_TELL, IOCTL_FS_LENGTH, IOCTL_FS_GETDATE, IOCTL_FS_CLOSE, IOCTL_FS_DELETE, IOCTL_FS_OPENDIR, IOCTL_FS_READDIR, IOCTL_FS_CLOSEDIR, IOCTL_FS_MAKEDIR, IOCTL_FS_REMOVEDIR, IOCTL_FS_TOTALSPACE, IOCTL_FS_FREESPACE, IOCTL_FS_FORMAT};//****************************************************************************//// The following are the flags passed to FSOpen.////****************************************************************************#define FS_OPEN_READ 0x00000001#define FS_OPEN_WRITE 0x00000002#define FS_OPEN_CREATE 0x00000004#define FS_OPEN_DECRYPT 0x00000008//****************************************************************************//// The following are the types passed to FSReadDir.////****************************************************************************#define FS_TYPE_FILE 0x00000001#define FS_TYPE_SUBDIR 0x00000002//****************************************************************************//// The following structure contains the persistent state of an opened file.// Only the file system specific state for the file system(s) actually used// need to be defined in the union uInternal.////****************************************************************************typedef struct{ unsigned char ucDrive; unsigned char ucFlags; unsigned short usUnused;#ifdef SUPPORT_RIGHTS_PD unsigned long ulHeaderSize; void *pvRPDUS; void *pvRPDCS; void *pvRPDRD;#endif union { tFATFile sFATFile; } uInternal;} tFile;//****************************************************************************//// The following structure contains the persistent state of an opened// directory. Only the file system specific state for the file system(s)// actually used need to be defined in union uInternal.////****************************************************************************typedef struct{ unsigned char ucDrive; unsigned char ucUnused1, ucUnused2, ucUnused3; union { tFATDir sFATDir; } uInternal;} tDir;//****************************************************************************//// The following are the various modes which can be passed to UISetMode.////****************************************************************************enum{ MODE_POWER_OFF, MODE_POWER_ON, MODE_DOWNLOAD, MODE_STOP, MODE_PLAY, MODE_PAUSE, MODE_RECORD, MODE_LOOPBACK};//****************************************************************************//// The following are the bitmasks for the logical buttons which can be// returned by UIGetButtons.////****************************************************************************#define BUTTON_PLAY 0x00000001#define BUTTON_PAUSE 0x00000002#define BUTTON_STOP 0x00000004#define BUTTON_FFWD 0x00000008#define BUTTON_REW 0x00000010#define BUTTON_NEXT 0x00000020#define BUTTON_PREV 0x00000040#define BUTTON_POWER 0x00000080#define BUTTON_RECORD 0x00000100#define BUTTON_LOOPBACK 0x00000200#define BUTTON_SEEK_RATE_ACC1 0x01000000#define BUTTON_SEEK_RATE_ACC2 0x02000000#define BUTTON_SEEK_RATE_ACC3 0x04000000//****************************************************************************//// Definitions for the bit fields of each entry of the pusTracks array.////****************************************************************************#define TRACK_FILE_MASK 0x03ff#define TRACK_CODEC_MASK 0x7c00#define TRACK_DRIVE_MASK 0x8000#define TRACK_FILE_SHIFT 0#define TRACK_CODEC_SHIFT 10#define TRACK_DRIVE_SHIFT 15//****************************************************************************//// Function prototypes and global variables.////****************************************************************************//// From aac.c//extern unsigned long AACIoctl(unsigned long ulIoctl, unsigned long ulParam1, unsigned long ulParam2, unsigned long ulParam3, unsigned long ulParam4);//// From acelpnet.c//extern unsigned long ACELPnetIoctl(unsigned long ulIoctl, unsigned long ulParam1, unsigned long ulParam2, unsigned long ulParam3, unsigned long ulParam4);//// From audible.c//extern void AudibleLoadMetaData(unsigned long ulDrive, const unsigned short *pusFileName);extern void AudibleUpdateMetaData(unsigned char *pucBuffer, unsigned long ulNewPosition);extern unsigned long AudibleIsAudibleProgram(void);extern const unsigned short *AudibleGetTitle(void);extern unsigned long AudibleGetNumSections(void);extern unsigned long AudibleGetPreviousSection(unsigned long ulTime);extern unsigned long AudibleGetNextSection(unsigned long ulTime);extern void AudibleSetPlayedThrough(void);//// From codec.c//extern unsigned long CodecFindRIFFChunk(unsigned char *pucData, unsigned long ulLength, unsigned long ulIdx, char *pcName);extern unsigned long CodecIsASFFile(tFile *pFile, unsigned char *pucData);extern unsigned long CodecFindASFChunk(tFile *pFile, unsigned char *pucData, const unsigned char *pucChunkGUID);extern unsigned long CodecQuery(unsigned long ulCodec, tFile *pFile, unsigned char *pucScratch);extern unsigned long CodecOpen(unsigned long ulCodec, unsigned long ulFlags, tFile *pFile);extern unsigned long CodecGetIndex(unsigned long *pulIndex);extern unsigned long CodecGetName(const unsigned short **ppusName);extern unsigned long CodecGetNameByIndex(unsigned long ulIndex, const unsigned short **ppusName);extern unsigned long CodecGetArtist(const unsigned short **ppusName);extern unsigned long CodecGetTitle(const unsigned short **ppusName);extern unsigned long CodecGetBitRate(unsigned long *pulBitRate);extern unsigned long CodecGetSampleRate(unsigned long *pulSampleRate);extern unsigned long CodecGetChannels(unsigned long *pulChannels);extern unsigned long CodecGetLength(unsigned long *pulLength);extern unsigned long CodecGetTime(unsigned long *pulTime);extern unsigned long CodecGetCaptureBuffer(short **ppsBuffer, long *plLength);extern unsigned long CodecSetBuffer(BufferState *psBuffer);extern unsigned long CodecCanDecode(void);extern unsigned long CodecDecode(void);extern unsigned long CodecCanEncode(void);extern unsigned long CodecEncode(void);extern unsigned long CodecSeek(unsigned long ulTime);extern unsigned long CodecClose(void);//// From dai.c//extern void DAIInit(void);extern void DAIEnable(void);extern void DAIDisable(void);extern BufferState *DAIGetPlayBuffer(void);extern BufferState *DAIGetRecordBuffer(void);//// From fatfs.c//extern unsigned long FATIoctl(tFAT *pFAT, unsigned char *pucScratch, unsigned char *pucWriteBuffer, unsigned long ulIoctl, unsigned long ulInstance, unsigned long ulParam1, unsigned long ulParam2);//// From fs.c//extern void FSInit(void);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -