| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130 |
- {========================================================================}
- {= (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 MMWEdit;
- {$I COMPILER.INC}
- {$IFDEF WIN32}
- {.$DEFINE USEMEMMAPFILE}
- {$ENDIF}
- interface
- uses
- {$IFDEF WIN32}
- Windows,
- {$ELSE}
- WinTypes,
- WinProcs,
- {$ENDIF}
- SysUtils,
- Messages,
- Classes,
- Graphics,
- Controls,
- Forms,
- Dialogs,
- ExtCtrls,
- Menus,
- MMSystem,
- MMObj,
- MMRegs,
- MMUtils,
- MMString,
- MMNotify,
- MMMath,
- MMMulDiv,
- MMWave,
- MMWaveIO,
- MMPCMSup,
- MMDIBCv,
- MMPanel,
- MMEnvelp;
- type
- EMMWaveEditError = class(Exception);
- TMMWaveEditorKind = (ekLines,ekSpikes);
- TMMGenerateEvent = procedure(Sender: TObject; Percent: integer) of object;
- TDisplayRec = record
- LeftMin : SmallInt;
- RightMin: SmallInt;
- LeftMax : SmallInt;
- RightMax: SmallInt;
- end;
- PDisplayData = ^TDisplayData;
- TDisplayData = array[0..0] of TDisplayRec;
- {-- TMMWaveEditor ------------------------------------------------------}
- TMMWaveEditor = class(TMMCustomWaveEditor)
- public
- constructor Create(AOwner: TComponent); override;
- destructor Destroy; override;
- function IsSelectStart(X: integer): Boolean;
- function IsSelectEnd(X: integer): Boolean;
- function IsInSelection(X: integer): Boolean;
- function IsGridX(X: integer; var Value: Longint): Boolean; override;
- procedure RefreshData(Min,Max: Longint);
- procedure ResetData;
- procedure Mark(mkStart, mkEnd: Longint; Redraw: Boolean);
- procedure Select(sStart, sEnd: Longint; Redraw: Boolean);
- property DetailZoom: Boolean read FDetailZoom;
- published
- property OnSelecting: TRangeChangeEvent read FOnSelecting write FOnSelecting;
- property OnSelectEnd: TRangeChangeEvent read FOnSelectEnd write FOnSelectEnd;
- property OnZooming: TRangeChangeEvent read FOnZooming write FOnZooming;
- property OnZoomEnd: TRangeChangeEvent read FOnZoomEnd write FOnZoomEnd;
- property OnGenerate: TMMGenerateEvent read FOnGenerate write FOnGenerate;
- property Height default 90;
- property Width default 194;
- property Zoom: Boolean read FZoom write FZoom default False;
- property AutoZoom: Boolean read FAutoZoom write FAutoZoom default True;
- property DeleteDisplayFile: Boolean read FDelDataFile write FDelDataFile default True;
- property DrawMidLine: Boolean read FDrawMidLine write SetDrawMidLine default True;
- property Kind: TMMWaveEditorKind read FKind write SetKind default ekLines;
- property ForegroundColor: TColor index 0 read FForeColor write SetColors default clAqua;
- property InactiveColor: TColor index 1 read FInactColor write SetColors default clTeal;
- property MidLineColor: TColor index 2 read FMidLineColor write SetColors default clGray;
- property SelectColor: TColor index 3 read FSelectColor write SetColors default clRed;
- property ZoomColor: TColor index 4 read FZoomColor write SetColors default clWhite;
- property Envelope: TMMEnvelope read FEnvelope write SetEnvelope;
- property Wave: TMMWave read GetWave write SetWave;
- end;
- function GetDataFileName(FName: TFileName): TFileName;
- function CheckDisplayData(Wave: TMMWave; DataFile: TFileName): Boolean;
- procedure CreateDisplayData(Wave: TMMWave; Callback: TMMGenerateEvent);
- procedure GenerateDisplayData(Wave: TMMWave; Callback: TMMGenerateEvent);
- function ZoomData(Wave: TMMWave; Min, Max: Longint; Pixels: integer;
- Data: PDisplayData; Callback: TMMGenerateEvent): Boolean;
- implementation
|