📄 pntypes.pas
字号:
unit PnTypes;
interface
(****************************************************************************
*
* $Id: pntypes.h,v 1.120 2000/05/15 20:51:19 smpatel Exp $
*
* Copyright (C) 1995-1999 RealNetworks, Inc. All rights reserved.
*
* http://www.real.com/devzone
*
* This program contains proprietary
* information of Progressive Networks, Inc, and is licensed
* subject to restrictions on use and distribution.
*
* This file defines data types that are too be used in all cross-platform
* Progressive Networks modules.
*
*)
type
PPChar = ^PChar;
{$NODEFINE PPChar}
PByte = ^Byte;
{$NODEFINE PByte}
type
INT8 = Shortint;
{$EXTERNALSYM INT8}
UINT8 = Byte;
{$EXTERNALSYM UINT8}
INT16 = Smallint;
{$EXTERNALSYM INT16}
UINT16 = Word;
{$EXTERNALSYM UINT16}
INT32 = Longint;
{$EXTERNALSYM INT32}
PINT32 = ^INT32;
{$NODEFINE PINT32}
UINT32 = Longword;
{$EXTERNALSYM UINT32}
UINT = Cardinal;
{$EXTERNALSYM UINT}
BOOL = Integer;
{$EXTERNALSYM BOOL}
PN_BITFIELD = Byte;
{$EXTERNALSYM PN_BITFIELD}
type
LONG32 = INT32; // signed 32 bit value
{$EXTERNALSYM LONG32}
ULONG32 = UINT32; // unsigned 32 bit value
{$EXTERNALSYM ULONG32}
UCHAR = UINT8; // unsigned 8 bit value
{$EXTERNALSYM UCHAR}
PUCHAR = ^UCHAR;
{$NODEFINE PUCHAR}
U_LONG32 = UINT32;
{$EXTERNALSYM U_LONG32}
U_INT8 = UINT8;
{$EXTERNALSYM U_INT8}
U_INT16 = UINT16;
{$EXTERNALSYM U_INT16}
U_INT32 = UINT32;
{$EXTERNALSYM U_INT32}
UFIXED32 = ULONG32; // FIXED point value
{$EXTERNALSYM UFIXED32}
(*
* UFIXED32 is a 32 value where the upper 16 bits are the unsigned integer
* portion of value, and the lower 16 bits are the fractional part of the
* value
*)
const
LANGUAGE_CODE = 'EN';
{$EXTERNALSYM LANGUAGE_CODE}
PRODUCT_ID = 'play32';
{$EXTERNALSYM PRODUCT_ID}
PLUS_PRODUCT_ID = 'plus32';
{$EXTERNALSYM PLUS_PRODUCT_ID}
MAX_DISPLAY_NAME = 256;
{$EXTERNALSYM MAX_DISPLAY_NAME}
PN_INVALID_VALUE = ULONG32($ffffffff);
{$EXTERNALSYM PN_INVALID_VALUE}
RA_FILE_MAGIC_NUMBER = $2E7261FD; // RealAudio File Identifier
{$EXTERNALSYM RA_FILE_MAGIC_NUMBER}
RM_FILE_MAGIC_NUMBER = $2E524D46; // RealMedia File Identifier
{$EXTERNALSYM RM_FILE_MAGIC_NUMBER}
RIFF_FILE_MAGIC_NUMBER = $52494646; // RIFF (AVI etc.) File Identifier
{$EXTERNALSYM RIFF_FILE_MAGIC_NUMBER}
type
PCSTR = PChar;
{$EXTERNALSYM PCSTR}
(*
* FOURCC's are 32bit codes used in Tagged File formats like
* the RealMedia file format.
*)
type
FOURCC = UINT32;
{$EXTERNALSYM FOURCC}
function PN_FOURCC(ch0, ch1, ch2, ch3: UINT8): UINT32;
{$EXTERNALSYM PN_FOURCC}
type
PrefKey = UINT16;
{$EXTERNALSYM PrefKey}
(*
/////////////////////////////////////////////////////////////////////////////
// PNEXPORT needed for RA.H and RAGUI.H, should be able to be defined
// and used in cross platform code...
/////////////////////////////////////////////////////////////////////////////
*)
type
RANOTIFYPROC = procedure (P: Pointer);
{$EXTERNALSYM RANOTIFYPROC}
(*
/////////////////////////////////////////////////////////////////////////////
//
// Macro:
//
// PN_GET_MAJOR_VERSION()
//
// Purpose:
//
// Returns the Major version portion of the encoded product version
// of the RealAudio application interface DLL previously returned from
// a call to RaGetProductVersion().
//
// Parameters:
//
// prodVer
// The encoded product version of the RealAudio application interface
// DLL previously returned from a call to RaGetProductVersion().
//
// Return:
//
// The major version number of the RealAudio application interface DLL
//
//
*)
function PN_GET_MAJOR_VERSION(prodVer: ULONG32): ULONG32;
{$EXTERNALSYM PN_GET_MAJOR_VERSION}
(*
/////////////////////////////////////////////////////////////////////////////
//
// Macro:
//
// PN_GET_MINOR_VERSION()
//
// Purpose:
//
// Returns the minor version portion of the encoded product version
// of the RealAudio application interface DLL previously returned from
// a call to RaGetProductVersion().
//
// Parameters:
//
// prodVer
// The encoded product version of the RealAudio application interface
// DLL previously returned from a call to RaGetProductVersion().
//
// Return:
//
// The minor version number of the RealAudio application interface DLL
//
//
*)
function PN_GET_MINOR_VERSION(prodVer: ULONG32): ULONG32;
{$EXTERNALSYM PN_GET_MINOR_VERSION}
(*
/////////////////////////////////////////////////////////////////////////////
//
// Macro:
//
// PN_GET_RELEASE_NUMBER()
//
// Purpose:
//
// Returns the release number portion of the encoded product version
// of the RealAudio application interface DLL previously returned from
// a call to RaGetProductVersion().
//
// Parameters:
//
// prodVer
// The encoded product version of the RealAudio application interface
// DLL previously returned from a call to RaGetProductVersion().
//
// Return:
//
// The release number of the RealAudio application interface DLL
//
//
*)
function PN_GET_RELEASE_NUMBER(prodVer: ULONG32): ULONG32;
{$EXTERNALSYM PN_GET_RELEASE_NUMBER}
(*
/////////////////////////////////////////////////////////////////////////////
//
// Macro:
//
// PN_GET_BUILD_NUMBER()
//
// Purpose:
//
// Returns the build number portion of the encoded product version
// of the RealAudio application interface DLL previously returned from
// a call to RaGetProductVersion().
//
// Parameters:
//
// prodVer
// The encoded product version of the RealAudio application interface
// DLL previously returned from a call to RaGetProductVersion().
//
// Return:
//
// The build number of the RealAudio application interface DLL
//
//
*)
function PN_GET_BUILD_NUMBER(prodVer: ULONG32): ULONG32;
{$EXTERNALSYM PN_GET_BUILD_NUMBER}
(*
/////////////////////////////////////////////////////////////////////////////
//
// Macro:
//
// PN_ENCODE_PROD_VERSION()
//
// Purpose:
//
// Encodes a major version, minor version, release number, and build
// number into a product version for testing against the product version
// of the RealAudio application interface DLL returned from a call to
// RaGetProductVersion().
//
// Parameters:
//
// major
// The major version number to encode.
//
// mimor
// The minor version number to encode.
//
// release
// The release number to encode.
//
// build
// The build number to encode.
//
// Return:
//
// The encoded product version.
//
// NOTES:
//
// Macintosh DEVELOPERS especially, make sure when using the PN_ENCODE_PROD_VERSION
// that you are passing a ULONG32 or equivalent for each of the parameters.
// By default a number passed in as a constant is a short unless it requires more room,
// so designate the constant as a long by appending a L to the end of it.
// Example:
// WORKS:
// PN_ENCODE_VERSION(2L,1L,1L,0L);
//
// DOES NOT WORK:
// PN_ENCODE_VERSION(2,1,1,0);
//
*)
function PN_ENCODE_PROD_VERSION(Major, Minor, Release, Build: ULONG32): ULONG32;
{$EXTERNALSYM PN_ENCODE_PROD_VERSION}
function PN_ENCODE_ADD_PRIVATE_FIELD(ulVersion, ulPrivate: UINT32): ULONG32;
{$EXTERNALSYM PN_ENCODE_ADD_PRIVATE_FIELD}
function PN_EXTRACT_PRIVATE_FIELD(ulVersion: ULONG32): ULONG32;
{$EXTERNALSYM PN_EXTRACT_PRIVATE_FIELD}
function PN_EXTRACT_MAJOR_VERSION(ulVersion: ULONG32): ULONG32;
{$EXTERNALSYM PN_EXTRACT_MAJOR_VERSION}
function PN_EXTRACT_MINOR_VERSION(ulVersion: ULONG32): ULONG32;
{$EXTERNALSYM PN_EXTRACT_MINOR_VERSION}
type
tv_sec_t = INT32;
{$EXTERNALSYM tv_sec_t}
tv_usec_t = INT32;
{$EXTERNALSYM tv_usec_t}
type
PNXRESOURCE = ULONG32;
{$EXTERNALSYM PNXRESOURCE}
PNXHANDLE = ULONG32;
{$EXTERNALSYM PNXHANDLE}
PNXIMAGE = ULONG32;
{$EXTERNALSYM PNXIMAGE}
implementation
function PN_FOURCC(ch0, ch1, ch2, ch3: UINT8): UINT32;
begin
Result := ch0 or (ch1 shl 8) or (ch2 shl 16) or (ch3 shl 24);
end;
function PN_GET_MAJOR_VERSION(prodVer: ULONG32): ULONG32;
begin
Result := ((prodVer shr 28) and $F);
end;
function PN_GET_MINOR_VERSION(prodVer: ULONG32): ULONG32;
begin
Result := ((prodVer shr 20) and $FF);
end;
function PN_GET_RELEASE_NUMBER(prodVer: ULONG32): ULONG32;
begin
Result := (prodVer shr 12) and $FF;
end;
function PN_GET_BUILD_NUMBER(prodVer: ULONG32): ULONG32;
begin
Result := prodVer and $FFF;
end;
function PN_ENCODE_PROD_VERSION(Major, Minor, Release, Build: ULONG32): ULONG32;
begin
Result := (Major shl 28) or (Minor shl 20) or (Release shl 12) or Build;
end;
function PN_ENCODE_ADD_PRIVATE_FIELD(ulVersion, ulPrivate: UINT32): ULONG32;
begin
Result := (ulVersion and ULONG32($FFFFFF00)) or ulPrivate;
end;
function PN_EXTRACT_PRIVATE_FIELD(ulVersion: ULONG32): ULONG32;
begin
Result := (ulversion and UINT32($FF));
end;
function PN_EXTRACT_MAJOR_VERSION(ulVersion: ULONG32): ULONG32;
begin
Result := ulVersion shr 28;
end;
function PN_EXTRACT_MINOR_VERSION(ulVersion: ULONG32): ULONG32;
begin
Result := (ulVersion shr 20) and UINT32($FF);
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -