www.pudn.com > Roulette.rar > Kbgm.pas


// H to Pas Converter Ver.0.20.23.1 
//     Date : 17 10 1999 
//   Source : Kbgm.h 
 
{ 
 注意!上のヘッダは絶対に削除・変更しないでください。 
 それを守っていただける限り、このpasファイルをKbgm32.dllの 
 使用のために使ってくださっても構いません。 
 
 基本的にはKr.Shinさん配布のKbgm.hをそのまま移植しましたが、 
 一部識別子を変更しています。 
} 
 
unit Kbgm; 
 
{$X+}{$Z2}{$A-} 
 
interface 
 
uses Windows; 
 
const 
  KBGMVER	= $008; 
 
type 
  PHDATA	= ^THDATA; 
  THDATA	= HGLOBAL; 
 
const 
  ONCE	= 0; 
  REPEATPlay    = 1; 
  ENDLESS	= 0; 
 
  GM_RESET	= 0; 
  GS_RESET	= 1; 
  VL_RESET1	= 2; 
  VL_RESET2	= 3; 
  XG_RESET	= 4; 
 
  KBGM_ERROR_BASE	= $1000; 
  KBGM_NOERROR	= 0; 
 
  KBGM_WRONGID	=  KBGM_ERROR_BASE + 0; 
  KBGM_NOMEM	=  KBGM_ERROR_BASE + 1; 
  KBGM_UNKNOWNERROR	=  KBGM_ERROR_BASE + 2; 
  KBGM_STILLPLAYING	=  KBGM_ERROR_BASE + 3; 
  KBGM_WAIT	=  KBGM_ERROR_BASE + 4; 
  KBGM_NOTIMERRES	=  KBGM_ERROR_BASE + 5; 
  KBGM_TIMERERROR	=  KBGM_ERROR_BASE + 6; 
  KBGM_NOFILE	=  KBGM_ERROR_BASE + 7; 
  KBGM_READERROR	=  KBGM_ERROR_BASE + 8; 
  KBGM_WRONGFILE	=  KBGM_ERROR_BASE + 9; 
  KBGM_PAGELOCKFAILED	=  KBGM_ERROR_BASE + 10; 
  KBGM_NOBUFFER	=  KBGM_ERROR_BASE + 11; 
  KBGM_NOTIME	=  KBGM_ERROR_BASE + 12; 
  KBGM_NOTPLAYING	=  KBGM_ERROR_BASE + 13; 
  KBGM_NORESOURCE	=  KBGM_ERROR_BASE + 14; 
  KBGM_WRONGCH	=  KBGM_ERROR_BASE + 15; 
 
type 
  TSMFINFO = record 
	Tempo	 : UINT;	//テンポ 
	Playing	 : BOOL;	//演奏フラグ 
	Timebase : DWORD;	//タイムベース 
	Volume	 : UINT;	//マスターボリューム 
	T_Global : HGLOBAL; 
	Title	 : PByte;	//タイトル格納用 
	T_Length : DWORD;	//タイトルの長さ 
	SongPtr	 : DWORD;	//ソングポインタ 
	Times	 : DWORD;	//何回演奏したか 
	Note	 : array[0..15,0..127] of BOOL;	//音が鳴っているか否か 
  end; 
 
  PSMFINFO	= ^TSMFINFO; 
 
  function KBGMOpen(nTimerRes: UINT; IDDevice: UINT): UINT; stdcall; 
  function KBGMClose: UINT; stdcall; 
  function KBGMPlay(hData: THDATA; theType: UINT): UINT; stdcall; 
  function KBGMResume(hData: THDATA): UINT; stdcall; 
  function KBGMStop: UINT; stdcall; 
  function KBGMPause: UINT; stdcall; 
  function KBGMFree(hData: THDATA): UINT; stdcall; 
//  function KBGMLoadRes(lphData: PHDATA; hInstApp: HINSTANCE; resname: LPCSTR; restype: LPCSTR): UINT; stdcall; 
//extern	UINT WINFARPROC KBGMLoadResVB( LPHDATA lphData, LPBYTE data); 
  function KBGMLoadFile(hData: PHDATA; filename: LPSTR): UINT; stdcall; 
  function KBGMInit(hData: THDATA): UINT; stdcall; 
  function KBGMGetInfo(hData: THDATA; lpSmfInfo: PSMFINFO): UINT; stdcall; 
  function KBGMSetVolume(hData: THDATA; Volume: UINT): UINT; stdcall; 
  function KBGMSendSysx(theType: UINT): UINT; stdcall; 
  function KBGMFadeIn(hData: THDATA; Sec: UINT): UINT; stdcall; 
  function KBGMFadeOut(hData: THDATA; Sec: UINT): UINT; stdcall; 
  function KBGMSetTempo(hData: THDATA; Beat: UINT): UINT; stdcall; 
  function KBGMSeek(hData: THDATA; Tick: LongInt): UINT; stdcall; 
  function KBGMSetRepeat(hData: THDATA; Times: DWORD; Seek: DWORD): UINT; stdcall; 
  function KBGMNoteOn(ChNum: BYTE; Note: BYTE; Vel: BYTE): UINT; stdcall; 
  function KBGMSetCtrl(ChNum: BYTE; Data1: BYTE; Data2: BYTE): UINT; stdcall; 
  function KBGMSetPrg(ChNum: BYTE; Pnum: BYTE): UINT; stdcall; 
 
implementation 
 
const 
  Kbgm32 = 'Kbgm32.dll'; 
 
  function KBGMOpen; external Kbgm32 name 'KBGMOpen'; 
  function KBGMClose; external Kbgm32 name 'KBGMClose'; 
  function KBGMPlay; external Kbgm32 name 'KBGMPlay'; 
  function KBGMResume; external Kbgm32 name 'KBGMResume'; 
  function KBGMStop; external Kbgm32 name 'KBGMStop'; 
  function KBGMPause; external Kbgm32 name 'KBGMPause'; 
  function KBGMFree; external Kbgm32 name 'KBGMFree'; 
//  function KBGMLoadRes; external Kbgm32 name 'KBGMLoadRes'; 
  function KBGMLoadFile; external Kbgm32 name 'KBGMLoadFile'; 
  function KBGMInit; external Kbgm32 name 'KBGMInit'; 
  function KBGMGetInfo; external Kbgm32 name 'KBGMGetInfo'; 
  function KBGMSetVolume; external Kbgm32 name 'KBGMSetVolume'; 
  function KBGMSendSysx; external Kbgm32 name 'KBGMSendSysx'; 
  function KBGMFadeIn; external Kbgm32 name 'KBGMFadeIn'; 
  function KBGMFadeOut; external Kbgm32 name 'KBGMFadeOut'; 
  function KBGMSetTempo; external Kbgm32 name 'KBGMSetTempo'; 
  function KBGMSeek; external Kbgm32 name 'KBGMSeek'; 
  function KBGMSetRepeat; external Kbgm32 name 'KBGMSetRepeat'; 
  function KBGMNoteOn; external Kbgm32 name 'KBGMNoteOn'; 
  function KBGMSetCtrl; external Kbgm32 name 'KBGMSetCtrl'; 
  function KBGMSetPrg; external Kbgm32 name 'KBGMSetPrg'; 
 
end.