捕捉 midi 输入消息的基本程序
作者:互联网
捕捉 midi 输入消息的基本程序
uses MMSystem; var hMidiIn: Integer; procedure midiCallBack(hdrvr: HDRVR; uMsg: UINT; dwUser: DWORD; dw1, dw2: DWORD) stdcall; begin case uMsg of MIM_OPEN: ; MIM_CLOSE: ; MIM_DATA: Form1.Memo1.Lines.Add(IntToStr(dw1)); MIM_LONGDATA: ; MIM_ERROR: ; MIM_LONGERROR: ; end; end; procedure TForm1.Button1Click(Sender: TObject); begin midiInOpen(@hMidiIn, 0, Cardinal(@midiCallBack), 0, CALLBACK_FUNCTION); midiInStart(hMidiIn); Caption := IntToStr(hMidiIn); end; procedure TForm1.Button2Click(Sender: TObject); begin midiInStop(hMidiIn); midiInClose(hMidiIn); Caption := '0' end;
标签:hMidiIn,begin,end,midi,TObject,捕捉,procedure,MIM,输入 来源: https://blog.51cto.com/u_14617575/2748302