1. 首页
  2. 编程语言
  3. C
  4. sony srp-x351 232控制程序

sony srp-x351 232控制程序

上传者: 2019-03-31 21:57:06上传 RAR文件 224.64KB 热度 25次
sony 351的控制程序 procedure TForm1.btnExeClick(Sender: TObject); begin SwitchInput(cmbInput.Text[1]); end; procedure TForm1.btnSoundUpClick(Sender: TObject); begin IncSound(); end; procedure TForm1.btnSoundDownClick(Sender: TObject); begin DecSound(); end; procedure TForm1.btnMuteOnClick(Sender: TObject); begin MuteON() ; end; procedure TForm1.btnMuteOffClick(Sender: TObject); begin MuteOFF(); end; procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction); begin if mscomm1.PortOpen then begin mscomm1.PortOpen:=false; end; end; procedure TForm1.MSComm1Comm(Sender: TObject); begin case mscomm1.CommEvent of comEvReceive: bzw := true; end; end; procedure TForm1.btnStopClick(Sender: TObject); begin StopChangeSound(); end; procedure TForm1.SwitchInput(pi_char: Char); var senddata:array of byte; begin Log('SwitchInput'); Setlength(senddata,4); senddata[0]:=$11; //要发送的数据 senddata[1]:=$80; senddata[3]:=$B1; case pi_char of 'A': senddata[2]:=$20; 'B': senddata[2]:=$21; 'C': senddata[2]:=$22; 'D': senddata[2]:=$23; end; OutputToCom(senddata); end; ; end; procedure TForm1.btnMuteOffClick(Sender: TObject); begin MuteOFF(); end; procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction); begin if mscomm1.PortOpen then begin mscomm1.PortOpen:=false; end; end; procedure TForm1.MSComm1Comm(Sender: TObject); begin case mscomm1.CommEvent of comEvReceive: bzw := true; end; end; procedure TForm1.btnStopClick(Sender: TObject); begin StopChangeSound(); end; procedure TForm1.SwitchInput(pi_char: Char); var senddata:array of byte; begin Log('SwitchInput'); Setlength(senddata,4); senddata[0]:=$11; //要发送的数据 senddata[1]:=$80; senddata[3]:=$B1; case pi_char of 'A': senddata[2]:=$20; 'B': senddata[2]:=$21; 'C': senddata[2]:=$22; 'D': senddata[2]:=$23; end; OutputToCom(senddata); end;
用户评论