亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? mmwave.pas

?? P2P即時通訊源碼(DELPHI編寫)
?? PAS
?? 第 1 頁 / 共 5 頁
字號:
         if FPWAVEIOCB^.hmmio <> 0 then
            if wioSetIOBufferSize(FPWAVEIOCB,FIOBufSize) <> 0 then
               raise EMMWaveError.Create(LoadResStr(IDS_WFIOBUFERROR));
   end;
end;

{-- TMMWave --------------------------------------------------------------}
Procedure TMMWave.OpenFile;
begin
   if (FPWAVEIOCB <> Nil) then
   begin
      if wioWaveOpen(FPWAVEIOCB) <> 0 then
         raise EMMWaveError.Create(LoadResStr(IDS_WFOPENERROR));

      if wioSetIOBufferSize(FPWAVEIOCB,FIOBufSize) <> 0 then
         raise EMMWaveError.Create(LoadResStr(IDS_WFIOBUFERROR));

      { build the region list }
      InitRegionList;

      { build the fade list }
      InitPlayFadeList(False);

      FOpen := True;

      { update the position }
      Position := GetPosition;
   end;
end;

{-- TMMWave --------------------------------------------------------------}
procedure TMMWave.CloseFile;
begin
   if (FPWAVEIOCB <> Nil) then wioWaveClose(FPWAVEIOCB);
   FOpen := False;
   FPosition := 0;
   FBytesLeft := 0;
end;

{-- TMMWave --------------------------------------------------------------}
procedure TMMWave.ResetFile;
begin
end;

{-- TMMWave --------------------------------------------------------------}
function TMMWave.GetBytesLeft: LongInt;
begin
   Result := FBytesLeft;
end;

{$IFDEF BCB}
{-- TMMWave --------------------------------------------------------------}
procedure TMMWave.CreateFileC(const FileName: TFileName; pwfx: PWaveFormatEx);
begin
   { bug fix for C++ Builder }
   CreateFile(FileName,pwfx);
end;
{$ENDIF}

{-- TMMWave --------------------------------------------------------------}
{ TODO: Exceptions und bessere Fehlermeldungen, FreeSpace testen !!!!     }
procedure TMMWave.CreateFile(const FileName: TFileName; pwfx: PWaveFormatEx);
Label ERROR_CREATE;
Var
   aResult : Boolean;
   DestFile: PChar;
   lpwioDst: PWaveIOCB;

begin
   aResult := False;

   if (FMemoryWave <> nil) then
      raise EMMWaveError.Create(LoadResStr(IDS_WFMEMFILEERROR));

   if (pwfx = Nil) or (FileName = '') then exit;

   DestFile := StrAlloc(MAX_PATH+1);
   StrPCopy(DestFile, ExpandUNCFileName(FileName));

   if not wioGetFullPathName(DestFile) then
      goto ERROR_CREATE;

   { delete the real destination file (if exits) }
   if wioFileExists(DestFile) then wioFileDelete(DestFile);

   { create the header for the new file }
   if wioCreateFileInfo(lpwioDst, pwfx) <> 0 then
      goto ERROR_CREATE;

   { write the new Header to disc }
   if wioWriteFileInfo(lpwioDst, DestFile) <> 0 then
      goto ERROR_CREATE;

   { set the structure }
   PWaveIOInfo := lpwioDst;

   if (FMemoryWave = nil) then
      { set the FileName }
      FFileName := StrPas(DestFile);

   if wioSetIOBufferSize(FPWAVEIOCB,FIOBufSize) <> 0 then
      raise EMMWaveError.Create(LoadResStr(IDS_WFIOBUFERROR));

   aResult := True;

ERROR_CREATE:

   StrDispose(DestFile);
   if not aResult then
   begin
      wioWaveClose(lpwioDst);
      wioFreeFileInfo(lpwioDst);
      raise EMMWaveError.Create(LoadResStr(IDS_WFCREATEERROR));
   end;
end;

{-- TMMWave --------------------------------------------------------------}
procedure TMMWave.SaveToFile(const Filename: TFileName);
Label ERROR_SAVE;
Var
   Result : Boolean;
   Cancel: Boolean;
   TmpFile, DestFile: PChar;
   lpwioDst: PWAVEIOCB;
   pData: PChar;
   BufSize, CurByte, NumBytes, NumRead: DWORD;

begin
   Result := False;
   Cancel := False;
   if (FPWAVEIOCB = Nil) or (FileName = '') then
      raise EMMWaveError.Create(LoadResStr(IDS_WFINVALIDPARAMS));

   pData := nil;
   lpwioDst := nil;
   TmpFile := StrAlloc(MAX_PATH+1);
   DestFile := StrAlloc(MAX_PATH+1);

   { open the source file and set position to 0 }
   Position := 0;
   OpenFile;

   { how many bytes we have to save }
   NumBytes := BytesLeft;

   { create the dest. WAVEIOINFO }
   if wioCreateFileInfo(lpwioDst, PWaveFormat) <> 0 then
      goto ERROR_SAVE;

   { copy all known chunks to the destination }
   if wioCopyFileInfo(lpwioDst, FPWaveIOCB) <> 0 then
      goto ERROR_SAVE;

   {$IFDEF WIN32}
   {$IFDEF TRIAL}
   {$DEFINE _HACK3}
   {$I MMHACK.INC}
   {$ENDIF}
   {$ENDIF}

   { first create a temporary file for the destination file }
   StrPCopy(TmpFile, ExpandUNCFileName(FileName));
   if Not wioFileCreateTemp(TmpFile) then
      goto ERROR_SAVE;

   { write the new Header to disc }
   if wioWriteFileInfo(lpwioDst, TmpFile) <> 0 then
      goto ERROR_SAVE;

   { compute source bytes to read (round down to nearest }
   { block for one second of data)                       }
   with PWaveFormat^ do
   BufSize := nAvgBytesPerSec-(nAvgBytesPerSec mod nBlockAlign);

   { allocate the data buffer for reading/writing data }
   pData := GlobalAllocMem(BufSize);
   if (pData = Nil) then goto ERROR_SAVE;

   CurByte := 0;
   while CurByte < NumBytes do
   begin
      { read the data }
      NumRead := min(BufSize, NumBytes - CurByte);
      NumRead := ReadDataBytes(pData, NumRead);
      if (NumRead <= 0) then break;

      inc(CurByte, NumRead);

      { have we space on the drive ? }
      if not GetDiskFree(TmpFile, NumRead+DWORD(IOBufferSize)+10240) then
         goto ERROR_SAVE;

      { write the data out as we go... }
      if wioWaveWriteData(lpwioDst, pData, NumRead) <> NumRead then
         goto ERROR_SAVE;

      { let the user have some time }
      Application.ProcessMessages;
      Progress(CurByte, NumBytes, Cancel);
      if Cancel then goto ERROR_SAVE;
   end;

   { close source and temp file }
   CloseFile;
   wioWaveClose(lpwioDst);

   StrPCopy(DestFile, ExpandUNCFileName(FileName));

   { delete the real destination file (if exits) }
   if wioFileExists(DestFile) then wioFileDelete(DestFile);

   { rename the temp file to the destination file }
   if mmioRename(TmpFile, DestFile, Nil, 0) <> 0 then
      goto ERROR_SAVE;

   Result := True;

ERROR_SAVE:

   GlobalFreeMem(Pointer(pData));
   CloseFile;
   wioWaveClose(lpwioDst);
   wioFreeFileInfo(lpwioDst);
   { make sure we delete the temp file }
   if wioFileExists(TmpFile) then wioFileDelete(TmpFile);
   StrDispose(TmpFile);
   StrDispose(DestFile);
   if not Result then
      if not Cancel then
         raise EMMWaveError.Create(LoadResStr(IDS_WFSAVEERROR))
      else
         raise EMMWaveError.Create(LoadResStr(IDS_WFSAVEABORTED))
end;

{-- TMMWave --------------------------------------------------------------}
{ TODO: Exceptions und bessere Fehlermeldungen, FreeSpace testen !!!!     }
procedure TMMWave.ConvertFile(const FileName: TFileName; pwfxDst: PWaveFormatEx);
Label ERROR_CONVERT;
Var
   aResult: Boolean;
   Cancel: Boolean;
   TmpFile, DestFile: PChar;
   lpwioDst: PWAVEIOCB;
   pwfDst: PPCMWaveFormat;
   SrcBufSize, DstBufSize: Longint;
   pSrc, pDst: PChar;
   CurByte, NumBytes, NumRead: DWORD;

begin
   aResult := False;
   Cancel := False;

   if (FPWAVEIOCB = Nil) or (pwfxDst = Nil) or (FileName = '') then
      raise EMMWaveError.Create(LoadResStr(IDS_WFINVALIDPARAMS));

   pwfDst := PPCMWaveFormat(pwfxDst);

   if Not pcmIsValidFormat(PWaveFormatEx(PWaveFormat)) or
      Not pcmIsValidFormat(PWaveFormatEx(pwfDst)) then
      raise EMMWaveError.Create(LoadResStr(IDS_WFCONVERTINVALID));

   pSrc := nil;
   pDst := nil;
   lpwioDst := nil;
   TmpFile := StrAlloc(MAX_PATH+1);
   DestFile := StrAlloc(MAX_PATH+1);

   { open the source file and set position to 0 }
   Position := 0;
   OpenFile;

   { set the bytes we have to convert }
   NumBytes := BytesLeft;

   { create the dest. WAVEIOINFO }
   if wioCreateFileInfo(lpwioDst, PWaveFormatEx(pwfDst)) <> 0 then
      goto ERROR_CONVERT;

   { copy all known chunks to the destination }
   if wioCopyFileInfo(lpwioDst, FPWaveIOCB) <> 0 then
      goto ERROR_CONVERT;

   { first create a temporary file for the destination file }
   StrPCopy(TmpFile, ExpandUNCFileName(FileName));
   if Not wioFileCreateTemp(TmpFile) then
      goto ERROR_CONVERT;

   { write the new Header to disc }
   if wioWriteFileInfo(lpwioDst, TmpFile) <> 0 then
      goto ERROR_CONVERT;

{$IFDEF WIN32}
   { compute source bytes to read (round down to nearest }
   { block for one second of data)                       }
   with PWaveFormat^ do
   SrcBufSize := nAvgBytesPerSec-(nAvgBytesPerSec mod nBlockAlign);
{$ELSE}
   { make sure the DstBufSize can not exceed 64 K ! }
   SrcBufSize := Min($FF0, NumBytes * 4 div 4);
{$ENDIF}
   DstBufSize := pcmConvertSizeOutputData(pwfDst, PPCMWaveFormat(PWaveFormat), SrcBufSize);

   { allocate the src and dst buffers for reading/converting data }
   pSrc := GlobalAllocMem(SrcBufSize);
   if (pSrc = Nil) then goto ERROR_CONVERT;
   pDst := GlobalAllocMem(DstBufSize);
   if (pDst = Nil) then goto ERROR_CONVERT;

   CurByte := 0;
   while CurByte < NumBytes do
   begin
      { read the data to convert }
      NumRead := min(SrcBufSize, NumBytes - CurByte);
      NumRead := ReadDataBytes(pSrc, NumRead);
      if (NumRead <= 0) then break;

      inc(CurByte, NumRead);

      { convert data }
      NumRead := pcmConvert(pwfDst, pDst, PPCMWaveFormat(PWaveFormat), pSrc, NumRead);
      if (NumRead <= 0) then break;

      { have we space on the drive ? }
      if not GetDiskFree(TmpFile, NumRead+DWORD(IOBufferSize)+10240) then
         goto ERROR_CONVERT;

      { write the data out as we go... }
      if wioWaveWriteData(lpwioDst, pDst, NumRead) <> NumRead then
         goto ERROR_CONVERT;

      { let the user have some time }
      Application.ProcessMessages;
      Progress(CurByte, NumBytes, Cancel);
      if Cancel then goto ERROR_CONVERT;
   end;

   { close source and temp file }
   CloseFile;
   wioWaveClose(lpwioDst);

   StrPCopy(DestFile, ExpandUNCFileName(FileName));

   { delete the real destination file (if exits) }
   if wioFileExists(DestFile) then wioFileDelete(DestFile);

   { rename the temp file to the destination file }
   if mmioRename(TmpFile, DestFile, Nil, 0) <> 0 then
      goto ERROR_CONVERT;

   aResult := True;

ERROR_CONVERT:

   CloseFile;
   wioWaveClose(lpwioDst);
   wioFreeFileInfo(lpwioDst);
   GlobalFreeMem(Pointer(pSrc));
   GlobalFreeMem(Pointer(pDst));
   { make sure we delete the temp file }
   if wioFileExists(TmpFile) then wioFileDelete(TmpFile);
   StrDispose(TmpFile);
   StrDispose(DestFile);
   if not aResult then
      if not Cancel then
         raise EMMWaveError.Create(LoadResStr(IDS_WFCONVERTERROR))
      else
         raise EMMWaveError.Create(LoadResStr(IDS_WFCONVERTABORTED));
end;

{-- TMMWave --------------------------------------------------------------}
procedure TMMWave.SetTimeFormat(aValue: TMMTimeFormats);
begin
   if (aValue <> FTimeFormat) then
   begin
      FTimeFormat := aValue;
      InitRegionList;
   end;
end;

{-- TMMWave --------------------------------------------------------------}
procedure TMMWave.SetStartPos(aPosition: Longint);
begin
   if (FPWAVEIOCB <> Nil) then
   begin
      FStartPos := MinMax(TimeFormatToSamples(aPosition),0,FEndPos);
      InitRegionList;
   end;
end;

{-- TMMWave --------------------------------------------------------------}
function TMMWave.GetStartPos: Longint;
begin
   if (FPWAVEIOCB <> Nil) then
       Result := SamplesToTimeFormat(FStartPos)
   else
       Result := -1;
end;

{-- TMMWave --------------------------------------------------------------}
procedure TMMWave.SetEndPos(aPosition: Longint);
begin
   if (FPWAVEIOCB <> Nil) then
   with FPWAVEIOCB^ do
   begin
      FEndPos := MinMax(TimeFormatToSamples(aPosition),FStartPos,dwDataSamples);
      InitRegionList;
   end;
end;

{-- TMMWave --------------------------------------------------------------}
function TMMWave.GetEndPos: Longint;
begin
   if (FPWAVEIOCB <> Nil) then
      Result := SamplesToTimeFormat(FEndPos)
   else
      Result := -1;
end;

{-- TMMWave --------------------------------------------------------------}
procedure TMMWave.SetPosition(aPosition: Longint);
var
   SampleCount,aPos: Longint;
   i: integer;
begin
   if (FPWAVEIOCB <> Nil) then
   with FPWAVEIOCB^ do
   begin
      FPosition := TimeFormatToSamples(aPosition);
      if FOpen then
      begin
         aPos := MinMax(RealSamplesToSamples(FPosition),0,LengthSamples);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美精品一区二区蜜臀亚洲| 成人av综合在线| 亚洲精品免费在线观看| 日本一区二区视频在线观看| 国产免费久久精品| 视频在线观看91| 日本三级亚洲精品| 精品无码三级在线观看视频| 精品一区二区三区的国产在线播放| 丁香桃色午夜亚洲一区二区三区| 日本欧美肥老太交大片| 成人av集中营| 精品久久久久久综合日本欧美 | 91视频国产观看| 色狠狠av一区二区三区| 欧美一级一级性生活免费录像| 欧美精品一区男女天堂| 亚洲高清一区二区三区| 精品一区二区三区av| 91精品国产综合久久久久| 精品国产乱码久久久久久久久 | 国产精品三级av| 一区二区三区免费网站| 久久99久久久久久久久久久| 成人综合激情网| wwww国产精品欧美| 亚洲主播在线观看| 国产一区二区不卡老阿姨| 99热99精品| 欧美成人在线直播| 麻豆91在线观看| 99久久99久久精品免费看蜜桃| 91精品国产综合久久精品图片| 亚洲影院理伦片| 欧美色网站导航| 国产欧美一区二区精品性色| 国产精品18久久久久久vr| 99久久夜色精品国产网站| 久久尤物电影视频在线观看| 久久av资源站| 欧美成人国产一区二区| 麻豆91在线观看| 欧美xingq一区二区| 麻豆国产一区二区| 久久综合中文字幕| 国产不卡免费视频| 中文字幕一区二区日韩精品绯色| 国产精品久久久久久久久久久免费看 | 日韩色在线观看| 亚洲精品国产精品乱码不99| 亚洲一区在线看| 久草在线在线精品观看| 日韩三级免费观看| 国产在线播放一区二区三区| 26uuu国产在线精品一区二区| 国产精品99久久久| 综合自拍亚洲综合图不卡区| 亚洲主播在线播放| 91精品国产麻豆国产自产在线 | 久久久久久久久久久久久女国产乱| 亚洲宅男天堂在线观看无病毒| 欧美日韩精品欧美日韩精品一| 亚洲美女在线国产| 99在线精品视频| 亚洲综合色婷婷| 日韩欧美在线不卡| 日韩精品五月天| 精品国产凹凸成av人网站| 懂色av中文字幕一区二区三区| 亚洲精品欧美二区三区中文字幕| 欧美一区日韩一区| 99精品视频在线观看| 午夜av区久久| 欧美日韩亚洲国产综合| 亚洲一区在线观看视频| 精品国产乱码91久久久久久网站| www.日韩精品| 久久精品国产精品亚洲红杏| 中文字幕一区二区在线观看| 日韩视频免费直播| 在线国产亚洲欧美| 亚洲综合视频在线| 国产亚洲欧美日韩俺去了| 成人动漫中文字幕| 蜜臀久久久久久久| 久久久青草青青国产亚洲免观| 91美女片黄在线| 国产精品一区二区三区四区| 亚洲成a人v欧美综合天堂| 欧美一区二区三区视频在线观看| 成人丝袜18视频在线观看| 日本 国产 欧美色综合| 亚洲一区二区三区自拍| 国产精品午夜免费| 久久综合国产精品| 日韩视频免费观看高清完整版| 日本道色综合久久| 91亚洲永久精品| 国产成人啪免费观看软件| 久久精品国产99国产| 日日夜夜精品视频天天综合网| 亚洲精品你懂的| 综合中文字幕亚洲| 国产精品久久午夜夜伦鲁鲁| 欧美激情一区二区三区在线| 色综合色综合色综合| 日本女人一区二区三区| 亚洲图片欧美色图| 亚洲午夜久久久久久久久电影网| 日韩一区在线免费观看| 欧美激情综合网| 欧美激情在线一区二区| 欧美激情在线观看视频免费| 国产日韩欧美一区二区三区综合 | 亚洲欧美国产毛片在线| 中文字幕巨乱亚洲| 国产精品午夜免费| 中文字幕中文乱码欧美一区二区| 国产精品美女久久久久久久网站| 国产女人18水真多18精品一级做| 国产午夜精品一区二区三区视频| 国产亚洲精品福利| 国产三级精品三级在线专区| 色婷婷久久综合| 一本久久a久久精品亚洲 | 国产精品久久久久久久久快鸭 | 亚洲人成亚洲人成在线观看图片 | 青草国产精品久久久久久| 天堂蜜桃91精品| 看国产成人h片视频| 国产在线视频一区二区三区| 国产无人区一区二区三区| 久久精品在线免费观看| 欧美国产精品v| 亚洲激情图片小说视频| 亚洲va欧美va人人爽| 蜜臀91精品一区二区三区| 国产精品99久久久久久久vr| 93久久精品日日躁夜夜躁欧美| 欧美中文字幕一区二区三区 | 国产剧情一区在线| 免费高清不卡av| 国模冰冰炮一区二区| 国产精品18久久久久久久久| 99r国产精品| 这里只有精品视频在线观看| 国产无遮挡一区二区三区毛片日本| 国产精品色噜噜| 五月婷婷激情综合| 国产一区二区三区高清播放| 91麻豆精品一区二区三区| 3atv一区二区三区| 国产精品丝袜一区| 奇米精品一区二区三区在线观看 | 色偷偷久久一区二区三区| 在线91免费看| 欧美国产欧美亚州国产日韩mv天天看完整 | 欧美一级国产精品| 精品少妇一区二区| 亚洲三级免费电影| 免费的国产精品| 91在线高清观看| 日韩一区二区免费视频| 日韩美女啊v在线免费观看| 日韩电影网1区2区| 99精品视频一区二区| 欧美一级精品大片| 亚洲精品中文字幕乱码三区| 久久国产精品99精品国产| 99精品视频一区二区三区| 精品国产乱码久久久久久闺蜜| 一区二区三区四区乱视频| 国产福利一区二区三区视频| 欧美日韩一区精品| 国产精品成人免费在线| 久久91精品国产91久久小草| 欧美日本在线观看| 亚洲乱码日产精品bd| 成人动漫一区二区三区| 精品国偷自产国产一区| 青草国产精品久久久久久| 国产精品伊人色| 69精品人人人人| 一区二区三区在线播放| 99久久精品国产精品久久| 国产偷v国产偷v亚洲高清| 日本欧美一区二区在线观看| 欧美亚一区二区| 亚洲欧美日韩成人高清在线一区| 国产伦精一区二区三区| 欧美大胆一级视频| 欧美美女bb生活片| 久久久国产综合精品女国产盗摄| 亚瑟在线精品视频| 欧美日韩久久不卡| 午夜成人免费电影| 7777精品伊人久久久大香线蕉的 | 欧美日韩国产精选| 亚洲一区在线视频观看| 91福利社在线观看|