MMWEDIT.INT 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. {========================================================================}
  2. {= (c) 1995-98 SwiftSoft Ronald Dittrich =}
  3. {========================================================================}
  4. {= All Rights Reserved =}
  5. {========================================================================}
  6. {= D 01099 Dresden = Tel.: +0351-8012255 =}
  7. {= Loewenstr.7a = info@swiftsoft.de =}
  8. {========================================================================}
  9. {= Actual versions on http://www.swiftsoft.de/mmtools.html =}
  10. {========================================================================}
  11. {= This code is for reference purposes only and may not be copied or =}
  12. {= distributed in any format electronic or otherwise except one copy =}
  13. {= for backup purposes. =}
  14. {= =}
  15. {= No Delphi Component Kit or Component individually or in a collection=}
  16. {= subclassed or otherwise from the code in this unit, or associated =}
  17. {= .pas, .dfm, .dcu, .asm or .obj files may be sold or distributed =}
  18. {= without express permission from SwiftSoft. =}
  19. {= =}
  20. {= For more licence informations please refer to the associated =}
  21. {= HelpFile. =}
  22. {========================================================================}
  23. {= $Date: 20.01.1998 - 18:00:00 $ =}
  24. {========================================================================}
  25. unit MMWEdit;
  26. {$I COMPILER.INC}
  27. {$IFDEF WIN32}
  28. {.$DEFINE USEMEMMAPFILE}
  29. {$ENDIF}
  30. interface
  31. uses
  32. {$IFDEF WIN32}
  33. Windows,
  34. {$ELSE}
  35. WinTypes,
  36. WinProcs,
  37. {$ENDIF}
  38. SysUtils,
  39. Messages,
  40. Classes,
  41. Graphics,
  42. Controls,
  43. Forms,
  44. Dialogs,
  45. ExtCtrls,
  46. Menus,
  47. MMSystem,
  48. MMObj,
  49. MMRegs,
  50. MMUtils,
  51. MMString,
  52. MMNotify,
  53. MMMath,
  54. MMMulDiv,
  55. MMWave,
  56. MMWaveIO,
  57. MMPCMSup,
  58. MMDIBCv,
  59. MMPanel,
  60. MMEnvelp;
  61. type
  62. EMMWaveEditError = class(Exception);
  63. TMMWaveEditorKind = (ekLines,ekSpikes);
  64. TMMGenerateEvent = procedure(Sender: TObject; Percent: integer) of object;
  65. TDisplayRec = record
  66. LeftMin : SmallInt;
  67. RightMin: SmallInt;
  68. LeftMax : SmallInt;
  69. RightMax: SmallInt;
  70. end;
  71. PDisplayData = ^TDisplayData;
  72. TDisplayData = array[0..0] of TDisplayRec;
  73. {-- TMMWaveEditor ------------------------------------------------------}
  74. TMMWaveEditor = class(TMMCustomWaveEditor)
  75. public
  76. constructor Create(AOwner: TComponent); override;
  77. destructor Destroy; override;
  78. function IsSelectStart(X: integer): Boolean;
  79. function IsSelectEnd(X: integer): Boolean;
  80. function IsInSelection(X: integer): Boolean;
  81. function IsGridX(X: integer; var Value: Longint): Boolean; override;
  82. procedure RefreshData(Min,Max: Longint);
  83. procedure ResetData;
  84. procedure Mark(mkStart, mkEnd: Longint; Redraw: Boolean);
  85. procedure Select(sStart, sEnd: Longint; Redraw: Boolean);
  86. property DetailZoom: Boolean read FDetailZoom;
  87. published
  88. property OnSelecting: TRangeChangeEvent read FOnSelecting write FOnSelecting;
  89. property OnSelectEnd: TRangeChangeEvent read FOnSelectEnd write FOnSelectEnd;
  90. property OnZooming: TRangeChangeEvent read FOnZooming write FOnZooming;
  91. property OnZoomEnd: TRangeChangeEvent read FOnZoomEnd write FOnZoomEnd;
  92. property OnGenerate: TMMGenerateEvent read FOnGenerate write FOnGenerate;
  93. property Height default 90;
  94. property Width default 194;
  95. property Zoom: Boolean read FZoom write FZoom default False;
  96. property AutoZoom: Boolean read FAutoZoom write FAutoZoom default True;
  97. property DeleteDisplayFile: Boolean read FDelDataFile write FDelDataFile default True;
  98. property DrawMidLine: Boolean read FDrawMidLine write SetDrawMidLine default True;
  99. property Kind: TMMWaveEditorKind read FKind write SetKind default ekLines;
  100. property ForegroundColor: TColor index 0 read FForeColor write SetColors default clAqua;
  101. property InactiveColor: TColor index 1 read FInactColor write SetColors default clTeal;
  102. property MidLineColor: TColor index 2 read FMidLineColor write SetColors default clGray;
  103. property SelectColor: TColor index 3 read FSelectColor write SetColors default clRed;
  104. property ZoomColor: TColor index 4 read FZoomColor write SetColors default clWhite;
  105. property Envelope: TMMEnvelope read FEnvelope write SetEnvelope;
  106. property Wave: TMMWave read GetWave write SetWave;
  107. end;
  108. function GetDataFileName(FName: TFileName): TFileName;
  109. function CheckDisplayData(Wave: TMMWave; DataFile: TFileName): Boolean;
  110. procedure CreateDisplayData(Wave: TMMWave; Callback: TMMGenerateEvent);
  111. procedure GenerateDisplayData(Wave: TMMWave; Callback: TMMGenerateEvent);
  112. function ZoomData(Wave: TMMWave; Min, Max: Longint; Pixels: integer;
  113. Data: PDisplayData; Callback: TMMGenerateEvent): Boolean;
  114. implementation