| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145 |
- {========================================================================}
- {= (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 MMOscope;
- {$I COMPILER.INC}
- interface
- uses
- {$IFDEF WIN32}
- Windows,
- {$ELSE}
- WinTypes,
- WinProcs,
- {$ENDIF}
- SysUtils,
- Messages,
- Classes,
- Graphics,
- Controls,
- Forms,
- Dialogs,
- ExtCtrls,
- MMUtils,
- MMString,
- MMObj,
- MMRegs,
- MMPCMSup,
- MMWaveIO,
- MMDIBCv;
- const
- SCALEHEIGHT = 40;
- SCALEWIDTH = 32;
- SCALEFONT = 'ARIAL';
- SCALEFONTSIZE : integer = 10;
- INFOCOLOR : TCOLOR = clWhite;
- EFFECTLIMIT : integer = 3;
- MAX_FFTLEN = 4096; { Define the maximum FFT buffer length. }
- type
- EMMOscopeError = class(Exception);
- TMMOscopeKind = (okDots,okConLines,okVertLines,okMirLines,okSpikes);
- TMMOscopeEffect = (efNone,efPeak,efSplit);
- TMMOscopeDrawLine= procedure(Sender: TObject; DIB: TMMDIBCanvas; Rect: TRect; Data: PSmallArray)of object;
- {-- TMMOscope --------------------------------------------------------}
- TMMOscope = class(TMMDIBGraphicControl)
- public
- constructor Create(AOwner: TComponent); override;
- destructor Destroy; override;
- procedure RefreshPCMData(PCMData: Pointer);
- procedure ResetData;
- function GetAmplitude(Pos: TPoint): Float;
- function GetTime(Pos: TPoint): Float;
- property BytesPerScope: Longint read FBytes;
- procedure Marked(mkBegin, mkEnd: integer; Redraw: Boolean);
- property PCMWaveFormat: TPCMWaveFormat read GetPCMWaveFormat write SetPCMWaveFormat;
- published
- { Events }
- property OnClick;
- property OnDblClick;
- property OnMouseDown;
- property OnMouseMove;
- property OnMouseUp;
- property OnGainOverflow: TNotifyEvent read FOnGainOverflow write FOnGainOverflow;
- property OnPcmOverflow: TNotifyEvent read FOnPcmOverflow write FOnPcmOverflow;
- property OnDrawLine: TMMOscopeDrawLine read FOnDrawLine write FOnDrawLine;
- property OnPostPaint: TNotifyEvent read FOnPostPaint write FOnPostPaint;
- property Align;
- property Bevel;
- property BackGroundDIB;
- property UseBackGroundDIB;
- property PaletteRealize;
- property PaletteMapped;
- property Color default clBlack;
- property Cursor default crCross;
- property ParentShowHint;
- property ParentColor default False;
- property Visible;
- property ShowHint;
- property ShowInfo: Boolean read FShowInfo write FShowInfo default True;
- property Enabled: Boolean read FEnabled write SetEnabled default True;
- property Height default 90;
- property Width default 194;
- property Accelerate: Boolean read FAccelerate write SetAccelerate default True;
- property Scroll: Boolean read FScroll write SetScroll default False;
- property DrawMidLine: Boolean read FDrawMidLine write SetDrawMidLine default False;
- property Kind: TMMOscopeKind read FKind write SetKind default okDots;
- property ForegroundColor: TColor index 0 read FForeColor write SetColors default clAqua;
- property InactiveColor: TColor index 1 read FInactColor write SetColors default clTeal;
- property EffectColor: TColor index 2 read FEffectColor write SetColors default clRed;
- property DisabledColor: TColor index 3 read FOffColor write SetColors default clGray;
- Property ScaleTextColor: TColor index 4 read FScaleTextColor write SetColors default clBlack;
- Property ScaleLineColor: TColor index 5 read FScaleLineColor write SetColors default clBlack;
- Property GridColor: TColor index 6 read FGridColor write SetColors default clGray;
- property BarColor: TColor index 7 read FBarColor write SetColors default clGray;
- property BarTickColor: TColor index 8 read FBarTickColor write SetColors default clWhite;
- property BarWidth: integer read FBarWidth write SetBarWidth default 5;
- property BitLength: TMMBits read FBits write SetBits default b8bit;
- property Channel: TMMChannel read FChannel write SetChannel default chBoth;
- property SampleRate: Longint read FSampleRate write SetSampleRate default 11025;
- property Mode: TMMMode read FMode write SetMode default mMono;
- property Steps: Integer read FSteps write SetSteps default 1;
- property Zoom: Integer read FZoom write SetZoom default 1;
- property Gain: Integer read GetGain write SetGain default 0;
- property Effect: TMMOscopeEffect read FEffect write SetEffect default efNone;
- property DrawAmpScale: Boolean read FDrawAmpScale write SetDrawAmpScale default False;
- property DrawTimeScale: Boolean read FDrawTimeScale write SetDrawTimeScale default False;
- property DrawGrid: Boolean read FDrawGrid write SetDrawGrid default False;
- property FFTLength: integer read FFTLen write SetFFTLen default 128;
- end;
- implementation
|