sony srp-x351 232控制程序
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;
用户评论