urecordcenter.pas
来自「自己写的用delphi封装东劲板卡api.」· PAS 代码 · 共 63 行
PAS
63 行
unit uRecordcenter;
interface
uses DjBase,SysUtils;
type
TRecordCenter = class
private
CountNum:array[0..MaxChannel-1] of integer;
protected
public
RecordPath:string;
constructor Create;
destructor Destroy;override;
function GetRecordFileName(ChnlID:integer):string;
end;
var
RecordCenter:TRecordCenter ;
implementation
{ TRecordCenter }
constructor TRecordCenter.Create;
var
i:integer;
begin
for i := low(CountNum) to high(CountNum) do
CountNum[i] := 0;
end;
destructor TRecordCenter.Destroy;
begin
inherited;
end;
function TRecordCenter.GetRecordFileName(ChnlID: integer): string;
var
FilePath:string;
FileName:string;
begin
Result := '';
FilePath := RecordPath + IntToStr(ChnlID);
if not DirectoryExists(FilePath) then
CreateDir(FilePath);
FilePath := FilePath + '\' + FormatDateTime('YYYY',now) ;
if not DirectoryExists(FilePath) then
CreateDir(FilePath) ;
FilePath := FilePath + '\' + FormatDateTime('MM',now) ;
if not DirectoryExists(FilePath) then
CreateDir(FilePath) ;
inc(CountNum[ChnlID]);
FileName := FormatDateTime('YYMMDDHHNNSS',now)+'_'+IntToStr(ChnlID) +'_'+ IntToStr(CountNum[ChnlID])+'.pcm';
Result := FilePath + '\' + FileName ;
end;
end.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?