| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119 |
- {========================================================================}
- {= (c) 1995-98 SwiftSoft Ronald Dittrich =}
- {========================================================================}
- {= All Rights Reserved =}
- {========================================================================}
- {= D 01099 Dresden = Tel.: +0351-8012255 =}
- {= Loewenstr.7a = info@swiftsoft.de =}
- {========================================================================}
- {= Actual versions on http://www.swiftsoft.de/mmtools.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: 20.01.1998 - 18:00:00 $ =}
- {========================================================================}
- unit MMFade;
- {$I COMPILER.INC}
- interface
- uses
- {$IFDEF WIN32}
- Windows,
- {$ELSE}
- WinProcs,
- WinTypes,
- {$ENDIF}
- SysUtils,
- Messages,
- Classes,
- Controls,
- MMObj,
- MMutils,
- MMMulDiv,
- MMRegs,
- MMPCMSup;
- const
- Overflow : Boolean = False;
- type
- PMMFadePoint = ^TMMFadePoint;
- TMMFadePoint = record
- Offset : Longint;
- Volume : Longint;
- VolumeL : Longint;
- VolumeR : Longint;
- Selected : LongBool;
- end;
- PMMFadeSeg = ^TMMFadeSeg;
- TMMFadeSeg = record
- ptStart : TMMFadePoint;
- ptEnd : TMMFadePoint;
- end;
- const
- { Maximum List size }
- MaxListSize = Maxint div (sizeOf(TMMFadePoint)*sizeOf(TMMFadePoint));
- type
- PMMFadeArray = ^TMMFadeArray;
- TMMFadeArray = array[0..MaxListSize-1] of TMMFadePoint;
- {-- TMMFadeList -----------------------------------------------------}
- TMMFadeList = class(TMMObject)
- public
- destructor Destroy; override;
- procedure Clear;
- procedure Sort;
- function Add(Point: TMMFadePoint): Integer;
- procedure Insert(Index: Integer; Point: TMMFadePoint);
- procedure Delete(Index: Integer);
- function Selected(Index: Integer): Boolean;
- function QueryFadePoint(Point: TMMFadePoint): Boolean;
- function AddFadePoint(Point: TMMFadePoint; Align: Boolean): Boolean;
- function LocateFadePoint(Offset: Longint): integer;
- function FindFadePoint(Offset: Longint): integer;
- function CalcFadeVolume(Offset: Longint): Longint;
- procedure Assign(Source: TPersistent); virtual;
- procedure AssignEnvelope(Source: TPersistent); virtual;
- procedure AssignToEnvelope(Dest: TPersistent); virtual;
- function First: PMMFadePoint;
- function Last: PMMFadePoint;
- function Expand: TMMFadeList;
- property Capacity: Integer read FCapacity write SetCapacity;
- property Count: Integer read FCount write SetCount;
- property Points[Index: Integer]: PMMFadePoint read Get write Put; default;
- property List: PMMFadeArray read FList;
- property CurIndex: Longint read FCurIndex write FCurIndex;
- property StartOffset: Longint read FStartOffset write FStartOffset;
- property StartVolumeL: Longint read FStartVolumeL write FStartVolumeL;
- property StartVolumeR: Longint read FStartVolumeR write FStartVolumeR;
- end;
- function pcmVolumeFade8(pwfx: PWaveFormatEx; lpData: PChar;
- dwSrcLen: TDataSize; FadeList: TMMFadeList): Boolean;
- function pcmVolumeFade16(pwfx: PWaveFormatEx; lpData: PChar;
- dwSrcLen: TDataSize; FadeList: TMMFadeList): Boolean;
- implementation
|