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

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

?? mmwave.pas

?? 一套及時通訊的原碼
?? PAS
?? 第 1 頁 / 共 5 頁
字號:
{========================================================================}
{=                (c) 1995-98 SwiftSoft Ronald Dittrich                 =}
{========================================================================}
{=                          All Rights Reserved                         =}
{========================================================================}
{=  D 01099 Dresden             = Fax.: +49(0)351-8037944               =}
{=  Loewenstr.7a                = info@swiftsoft.de                     =}
{========================================================================}
{=  Actual versions on http://www.swiftsoft.de/index.html               =}
{========================================================================}
{=  This code is for reference purposes only and may not be copied or   =}
{=  distributed in any format electronic or otherwise except one copy   =}
{=  for backup purposes.                                                =}
{=                                                                      =}
{=  No Delphi Component Kit or Component individually or in a collection=}
{=  subclassed or otherwise from the code in this unit, or associated   =}
{=  .pas, .dfm, .dcu, .asm or .obj files may be sold or distributed     =}
{=  without express permission from SwiftSoft.                          =}
{=                                                                      =}
{=  For more licence informations please refer to the associated        =}
{=  HelpFile.                                                           =}
{========================================================================}
{=  $Date: 05.11.98 - 23:05:51 $                                        =}
{========================================================================}
unit MMWave;

{$I COMPILER.INC}

interface

uses
{$IFDEF WIN32}
    Windows,
{$ELSE}
    WinTypes,
    WinProcs,
{$ENDIF}
    SysUtils,
    Messages,
    Classes,
    Graphics,
    Controls,
    Forms,
    Dialogs,
    MMSystem,
    MMUtils,
    MMObj,
    MMString,
    MMObsrv,
    MMDSPObj,
    MMRegs,
    MMRIFF,
    MMWaveIO,
    MMPCMSup,
    MMFade,
    MMPanel,
    MMDIB,
    MMCutLst;

type
  EMMWaveError    = class(Exception);
  TMMPlayMode     = (pmSync, pmAsync, pmLoop);
  TMMWaveProgress = procedure(Sender: TObject; CurByte, NumBytes: Longint;
                              Var Cancel: Boolean) of Object;

  {-- TMMWave ------------------------------------------------------------}
  TMMWave = class(TMMObject)
  private
    FMemoryWave   : TMemoryStream;
    FPWaveIOCB    : PWAVEIOCB;
    FFileName     : TFileName;
    FFileMustExist: Boolean;        { create new file or not              }
    FIOBufSize    : Longint;        { file IO buffersize                  }
    FTimeFormat   : TMMTimeFormats; { the actual time format for Position }
    FStartPos     : Longint;
    FEndPos       : Longint;
    FPosition     : Longint;
    FBytesLeft    : Longint;
    FTotalBytes   : Longint;
    FCutList      : TMMCutList;
    FRegions      : TMMCutList;
    FCurRegion    : integer;
    FRegionLeft   : Longint;
    FOpen         : Boolean;
    FNoChange     : Boolean;
    FNeedChange   : Boolean;
    FPlayFadeList : TMMFadeList;
    FIgnoreFades  : Boolean;
    FObservable   : TMMObservable;
    FOnProgress   : TMMWaveProgress;

    procedure SetDummy(aValue: Longint);
    function  GetEmpty: Boolean;
    function  GetFileSize: LongInt;
    function  GetDataSize: LongInt;
    function  GetDataOffset: Longint;
    procedure SetFormatTag(aValue: Word);
    function  GetFormatTag: Word;
    procedure SetFormatString(aValue: String);
    function  GetFormatString: String;
    procedure SetBits(aValue: Word);
    function  GetBits: Word;
    procedure SetMode(aValue: TMMMode);
    function  GetMode: TMMMode;
    function  GetSampleRate: Longint;
    procedure SetFileMustExist(aValue: Boolean);
    procedure SetTimeFormat(aValue: TMMTimeFormats);
    procedure SetIOBufSize(aValue: Longint);
    procedure SetStartPos(aPosition: Longint);
    function  GetStartPos: Longint;
    procedure SetEndPos(aPosition: Longint);
    function  GetEndPos: Longint;
    function  GetPosition: Longint;
    function  GetBytesLeft: Longint;
    function  GetLength: Longint;
    function  GetLengthBytes: Longint;
    function  GetLengthSamples: Longint;
    procedure SetPWaveFormat(lpwfx: PWaveFormatEx);
    procedure SetPWaveIOCB(lpWaveIO: PWaveIOCB);
    procedure FreeWaveIOCB(Var lpwio: PWAVEIOCB);
    procedure ClearWave;
    function  GetStreamWaveIOCB(Stream: TMemoryStream; Var lpwio: PWAVEIOCB): Word;
    function  GetPWaveData: Pointer;
    procedure SetIgnoreFades(aValue: Boolean);

  protected
    function  ReadInternal(Buffer: PChar; NumBytes: Longint): Longint; virtual;
    function  GetPWaveFormat: PWaveFormatEx; virtual;
    procedure SetPosition(aPosition: Longint); virtual;
    function  SamplesToBytes(Samples: Longint): Longint; virtual;
    function  BytesToSamples(Bytes: Longint): Longint; virtual;
    function  RealSamplesToSamples(aValue: Longint): Longint; virtual;
    function  SamplesToRealSamples(aValue: Longint): Longint; virtual;
    function  SamplesToTimeFormat(Samples: Longint): Longint; virtual;
    function  TimeFormatToSamples(aValue: Longint): Longint; virtual;
    procedure SetCutList(aValue: TMMCutList); virtual;
    procedure SetFileName(aValue: TFileName); virtual;
    procedure Changed; override;
    procedure DefineProperties(Filer: TFiler); override;
    procedure ReadData(Stream: TStream); virtual;
    procedure WriteData(Stream: TStream); virtual;
    procedure InitPlayFadeList(Playing: Boolean); virtual;
    property  PlayFadeList: TMMFadeList read FPlayFadeList write FPlayFadeList;

  public
    { internal use but must be public, don't touch this }
    procedure Progress(CurByte, NumBytes: Longint; Var Cancel: Boolean); dynamic;
    procedure InitRegionList;
    property  Regions: TMMCutList read FRegions;
    property  CutList: TMMCutList read FCutList write SetCutList;

    procedure AddObserver(O: TMMObserver);
    procedure RemoveObserver(O: TMMObserver);

    constructor Create; virtual;
    destructor  Destroy; override;

    function    IsMemWave: Boolean;

    procedure   Assign(Source: TPersistent); override;
    procedure   FreeWave;

    function    PlaySound(aValue: TMMPlayMode): Boolean;
    procedure   StopSound;

    procedure   LoadFromStream(Stream: TStream); virtual;
    procedure   SaveToStream(Stream: TStream); virtual;

    procedure   LoadFromFile(const FileName: TFileName);
    procedure   SaveToFile(const Filename: TFileName);

    procedure   ImportFromRaw(const FileName: TFileName; BitLength,
                              Channels, SampleRate: Cardinal);

    property    IsOpen: Boolean read FOpen;
    
    procedure   OpenFile; virtual;
    procedure   CloseFile; virtual;
    procedure   ResetFile; virtual;
    procedure   CreateFile(const FileName: TFileName; pwfx: PWaveFormatEx);
    {$IFDEF BCB}
    procedure   CreateFileC(const FileName: TFileName; pwfx: PWaveFormatEx);
    {$ENDIF}
    procedure   ConvertFile(const FileName: TFileName; pwfxDst: PWaveFormatEx);

    function    GetInfoChunk(fcc: String): String;
    procedure   SetInfoChunk(fcc, Text: String);
    procedure   SetDispChunk(Text: string; aBitmap: TBitmap);

    function    ReadDataBytes(Buffer: PChar; NumBytes: Longint): Longint;
    function    ReadDataSamples(Buffer: PChar; NumSamples: Longint): Longint;
    function    WriteDataBytes(Buffer: PChar; NumBytes: Longint): Longint;
    function    WriteDataSamples(Buffer: PChar; NumSamples: Longint): Longint;

    property    StartPos: Longint read GetStartPos write SetStartPos;
    property    EndPos: Longint read GetEndPos write SetEndPos;
    property    Position: Longint read GetPosition write SetPosition;

    property    Length: Longint read GetLength;
    property    LengthBytes: Longint read GetLengthBytes;
    property    LengthSamples: Longint read GetLengthSamples;

    property    Empty: Boolean read GetEmpty;
    property    PWaveFormat: PWaveFormatEx read GetPWaveFormat write SetPWaveFormat;
    property    PWaveIOInfo: PWaveIOCB read FPWAVEIOCB write SetPWaveIOCB;
    property    PWaveData: Pointer read GetPWaveData;
    property    BytesLeft: Longint read GetBytesLeft;
    property    DataOffset: Longint read GetDataOffset;
    property    IgnoreFades: Boolean read FIgnoreFades write SetIgnoreFades default False;

  published
    property OnProgress: TMMWaveProgress read FOnProgress write FOnProgress;
    property TimeFormat: TMMTimeFormats read FTimeFormat write SetTimeFormat default tfSample;
    property FileMustExist: Boolean read FFileMustExist write SetFileMustExist default True; { must come before FileName ! }
    property FileName: TFileName read FFileName write SetFileName;
    property BitLength: Word read GetBits write SetBits stored False;
    property Mode: TMMMode read GetMode write SetMode stored False;
    property FormatTag: Word read GetFormatTag write SetFormatTag stored False;
    property FormatString: String read GetFormatString write SetFormatString stored False;
    property SampleRate: Longint read GetSampleRate write SetDummy stored False;
    property FileSize: LongInt read GetFileSize write SetDummy stored False;
    property DataSize: Longint read GetDataSize write SetDummy stored False;
    property IOBufferSize: Longint read FIOBufSize write SetIOBufSize default 32768;
  end;

  {-- TMMCustomWaveFile --------------------------------------------------}
  TMMCustomWaveFile = class(TMMDSPComponent)
  private
    FWave        : TMMWave;
    FOldStart    : Longint;
    FSilence     : SmallInt;      { silence value 0 or 128               }
    FEnabled     : Boolean;
    FOpen        : Boolean;
    FStarted     : Boolean;
    FOverwrite   : Boolean;
    FObserver    : TMMObserver;

    FOnOpen      : TNotifyEvent;  { wave succ openend                    }
    FOnClose     : TNotifyEvent;  { wave succ closed (disk full ?)       }
    FOnChange    : TNotifyEvent;
    FOnChanged   : TNotifyEvent;
    FOnLooping   : TNotifyEvent;  { Wave was at end and is looped        }

    procedure SetWave(aValue: TMMWave);
    procedure WaveChanged(Sender, Data: TObject);

  protected
    procedure SetWaveEx(aValue: TMMWave);
    procedure DoChanged; dynamic;
    procedure DoOpen; dynamic;
    procedure DoClose; dynamic;

    procedure SetPWaveFormat(aValue: PWaveFormatEx); override;

  public
    procedure Opened; override;
    procedure Closed; override;
    procedure Reseting; override;
    procedure Started; override;
    procedure Stopped; override;
    procedure BufferReady(lpwh: PWaveHdr); override;
    procedure BufferLoad(lpwh: PWaveHdr; var MoreBuffers: Boolean); override;

    constructor Create(AOwner: TComponent); override;
    destructor  Destroy; override;

    procedure LoadFromFile(const FileName: String);
    procedure SaveToFile(const FileName: String);

    function  PlaySound(aValue: TMMPlayMode): Boolean;
    procedure StopSound;

  protected
    property OnOpen: TNotifyEvent read FOnOpen write FOnOpen;
    property OnClose: TNotifyEvent read FOnClose write FOnClose;
    property OnChange: TNotifyEvent read FOnChange write FOnChange;
    property OnChanged: TNotifyEvent read FonChanged write FOnChanged;
    property OnLooping: TNotifyEvent read FOnLooping write FOnLooping;

    property Enabled: Boolean read FEnabled write FEnabled default True;
    property OverwriteExisting: Boolean read FOverwrite write FOverwrite default True;
  published
    property Wave: TMMWave read FWave write SetWave;
  end;

  {-- TMMWaveFile --------------------------------------------------------}
  TMMWaveFile = class(TMMCustomWaveFile)
  published
    property OnOpen;
    property OnClose;
    property OnChange;
    property OnChanged;
    property OnLooping;

    property Input;
    property Output;
    property Enabled;
    property OverwriteExisting;
  end;

  {-- TMMCustomMemoryWave ------------------------------------------------}
  TMMCustomMemoryWave = class(TMMCustomWaveFile)
  public
    constructor Create(AOwner: TComponent); override;
    destructor  Destroy; override;
  end;

  {-- TMMMemoryWave ------------------------------------------------------}
  TMMMemoryWave = class(TMMCustomMemoryWave)
  published
    property OnOpen;
    property OnClose;
    property OnChange;
    property OnChanged;
    property OnLooping;

    property Output;
    property Enabled;
  end;

  { TODO: ableiten von TMMCustomMarkerPanel und verschiedene Eigenschaften ver鰂fentlichen }
  {-- TMMCustomWaveEditor ------------------------------------------------}
  TMMCustomWaveEditor = class(TMMMarkerPanel)
  protected
    function  GetWave: TMMWave; virtual; abstract;
  public
    property Wave: TMMWave read GetWave;
  end;

implementation

{== TMMWave ==============================================================}
constructor TMMWave.Create;
begin
   inherited Create;

   FMemoryWave := nil;
   FPWaveIOCB := nil;
   FFileName := '';
   FFileMustExist:= True;
   FTimeFormat := tfSample;
   FIOBufSize := 32768;
   FStartPos := 0;
   FEndPos := 0;
   FPosition := 0;
   FBytesLeft := 0;
   FTotalBytes := 0;
   FOpen := False;
   FNoChange := False;
   FNeedChange := False;
   FCutList := nil;
   FPlayFadeList:= nil;
   FIgnoreFades := False;
   FRegions := TMMCutList.Create;
   FObservable := TMMObservable.Create;
end;

{-- TMMWave --------------------------------------------------------------}
Destructor TMMWave.Destroy;
begin
   { free the wave }
   ClearWave;

   FRegions.Free;

   if (FPlayFadeList <> nil) then FPlayFadeList.Free;

   FObservable.Free;
   FObservable:= nil;

   inherited Destroy;
end;

{-- TMMWave --------------------------------------------------------------}
procedure TMMWave.AddObserver(O: TMMObserver);
begin
   FObservable.AddObserver(O);
end;

{-- TMMWave --------------------------------------------------------------}
procedure TMMWave.RemoveObserver(O: TMMObserver);
begin
   if (FObservable <> nil) then
       FObservable.RemoveObserver(O);
end;

{-- TMMWave --------------------------------------------------------------}
procedure TMMWave.SetCutList(aValue: TMMCutList);
begin
   FCutList := aValue;
   InitRegionList;
end;

{-- TMMWave --------------------------------------------------------------}
procedure TMMWave.InitRegionList;
var
   Region: TMMCutRegion;
   i: integer;
   SPos,EPos,Start, Length: Longint;
begin
   FRegions.Clear;

   if (PWaveFormat = nil) then exit;

   SPos := RealSamplesToSamples(FStartPos);
   EPos := RealSamplesToSamples(FEndPos);

   Region.dwLoops := 0;

   if (FCutList <> nil) and (FCutList.Count > 0) then
   begin
      i := 0;
      while (i < FCutList.Count) and
            (FCutList[i].dwStartPos+FCutList[i].dwLength < SPos) do inc(i);

      if (i >= FCutList.Count) or (SPos < FCutList[i].dwStartPos) then
         Start := SPos
      else
         Start := Max(SPos, FCutList[i].dwStartPos+FCutList[i].dwLength);

      while i <= FCutList.Count do
      begin
         if (i < FCutList.Count) and (EPos > FCutList[i].dwStartPos) then
            Length := FCutList[i].dwStartPos-Start
         else
         begin
            if (i >= FCutList.Count) or (EPos < FCutList[i].dwStartPos) then
                Length := EPos-Start
            else
              Length := FCutList[i].dwStartPos-Start;
            i := FCutList.Count;
         end;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产成人av一区二区| 国产91精品一区二区麻豆网站| 国产精品理论片| 国产三级一区二区| 久久久99久久| 国产欧美日韩一区二区三区在线观看| 久久伊99综合婷婷久久伊| 色妹子一区二区| 97久久超碰国产精品电影| 99久久婷婷国产综合精品| 成人av午夜影院| 91免费版在线| 欧美午夜精品一区| 欧美猛男超大videosgay| 欧美久久久久久久久久 | 欧洲一区在线观看| 免费看日韩a级影片| 国产一区免费电影| 精品中文字幕一区二区| 日韩国产欧美三级| 日韩电影免费在线观看网站| xvideos.蜜桃一区二区| 日韩一区二区视频在线观看| 欧美一区国产二区| 91麻豆精品国产自产在线观看一区| 欧美婷婷六月丁香综合色| 欧美色爱综合网| 欧美无乱码久久久免费午夜一区 | 欧美剧情电影在线观看完整版免费励志电影 | 亚洲精品大片www| 国产精品久久久久久久久快鸭| 久久久久久免费| 欧美一区二区三区在线| 一卡二卡欧美日韩| 亚洲国产日韩a在线播放性色| 亚洲小说春色综合另类电影| 午夜国产不卡在线观看视频| 亚洲va欧美va人人爽| 日韩高清在线观看| 久久国产精品72免费观看| 男女视频一区二区| 国产精一品亚洲二区在线视频| 国产精品77777| 暴力调教一区二区三区| av资源站一区| 91免费看视频| 91福利国产成人精品照片| 亚洲一区二区三区精品在线| 国产精品久久久久久久久久免费看| 国产精品乱码妇女bbbb| 亚洲婷婷国产精品电影人久久| 中文字幕乱码日本亚洲一区二区 | 亚洲国产成人自拍| 91麻豆精品国产91久久久| 日韩欧美激情一区| 欧美经典一区二区三区| 日韩精品三区四区| 青青青爽久久午夜综合久久午夜| 性做久久久久久久免费看| 视频在线观看国产精品| 蜜臀av性久久久久蜜臀aⅴ流畅 | 欧美一区二区在线免费观看| 精品国产一区二区在线观看| 亚洲欧洲日韩综合一区二区| 五月婷婷另类国产| 国v精品久久久网| 欧美在线一二三| 精品国产亚洲在线| 国产视频一区二区在线| 久久成人羞羞网站| 成人激情午夜影院| 美国十次综合导航| 午夜精品一区二区三区免费视频| 欧美日韩成人综合在线一区二区| 国产精品国模大尺度视频| 亚洲影院在线观看| 欧美精品一区在线观看| 国产精品毛片a∨一区二区三区| 一区二区三区四区蜜桃| 久久91精品国产91久久小草| 欧美又粗又大又爽| 国产精品美女视频| 久久亚洲春色中文字幕久久久| 欧美电影免费观看高清完整版在 | av成人老司机| 久久麻豆一区二区| 精品影视av免费| 欧美成va人片在线观看| 6080国产精品一区二区| 成人爽a毛片一区二区免费| 久久超碰97中文字幕| 一区二区视频在线看| 欧美亚洲国产bt| 亚洲国产精品一区二区久久恐怖片| 成人久久18免费网站麻豆 | 欧美在线观看你懂的| 久久蜜臀中文字幕| 亚洲成av人片一区二区梦乃| 日韩免费一区二区三区在线播放| 日韩成人伦理电影在线观看| 国产亚洲婷婷免费| 欧美精品在线观看一区二区| 精品制服美女丁香| 久久综合久久综合久久| 成人涩涩免费视频| 精品在线观看免费| 亚洲大片精品永久免费| 中文字幕日韩一区二区| 色老汉av一区二区三区| 亚洲与欧洲av电影| 欧美在线观看一区| 婷婷夜色潮精品综合在线| 欧美熟乱第一页| 国产91富婆露脸刺激对白| 91麻豆精品国产91久久久使用方法 | 精品理论电影在线观看| 日韩高清不卡一区二区| xnxx国产精品| 欧美精品在线一区二区| 国产成人免费视频一区| 日本亚洲天堂网| 精品成人一区二区三区四区| 欧美视频你懂的| 精品在线播放免费| 国产一区二三区| 成人看片黄a免费看在线| 国产成人福利片| 国产福利一区在线| 免费在线一区观看| 亚洲国产成人av| 日本一区二区三区四区在线视频 | 综合久久一区二区三区| 国产欧美日韩精品a在线观看| 日韩丝袜美女视频| 久久精品综合网| 国产精品一区二区免费不卡| 日韩精品一区二区三区视频| 国产一区二区三区免费| 国产亚洲综合在线| 成a人片国产精品| 亚洲午夜一二三区视频| 777亚洲妇女| 国产精品一区二区久久精品爱涩 | 99r精品视频| 亚洲国产视频一区二区| 6080亚洲精品一区二区| 国产精品夜夜嗨| 亚洲精品成a人| 色成年激情久久综合| 免费观看日韩av| 欧美韩日一区二区三区四区| 日本高清不卡一区| 日韩欧美电影一二三| 99vv1com这只有精品| 亚洲一区二区精品视频| 精品国产一区二区三区久久久蜜月 | 久久精品亚洲一区二区三区浴池| 99国产精品久| 日韩中文字幕亚洲一区二区va在线| 久久日韩精品一区二区五区| youjizz国产精品| 亚洲 欧美综合在线网络| 国产欧美综合在线观看第十页 | 欧美日韩视频专区在线播放| 国产精品一二三在| 一级中文字幕一区二区| 国产视频一区二区在线观看| 一本久久精品一区二区| 久久99精品久久久久久国产越南 | 中文字幕综合网| 欧美日韩一卡二卡三卡 | 国产馆精品极品| 亚洲精品欧美专区| 91精品一区二区三区在线观看| 99免费精品视频| 日韩成人一区二区| 亚洲综合色在线| 久久日韩粉嫩一区二区三区| 欧美伦理电影网| 成人午夜碰碰视频| 亚洲午夜精品在线| 中文字幕欧美一| 欧美大度的电影原声| 欧美日韩久久久久久| 国产不卡在线播放| 另类欧美日韩国产在线| 亚洲综合视频网| 椎名由奈av一区二区三区| 精品噜噜噜噜久久久久久久久试看 | 免费在线观看不卡| 久久免费视频一区| 欧美日韩免费一区二区三区| 国产福利精品一区| 看电影不卡的网站| 亚洲制服丝袜一区| 亚洲女爱视频在线| 综合在线观看色| 欧美一级专区免费大片| 99久久精品一区二区| 国产成人午夜99999|