MMAVICTL.INT 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  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 MMAVICtl;
  26. {$I COMPILER.INC}
  27. interface
  28. uses
  29. SysUtils,
  30. Windows,
  31. Classes,
  32. StdCtrls,
  33. ExtCtrls,
  34. Controls,
  35. Graphics,
  36. Forms,
  37. MMSystem,
  38. MMObj,
  39. MMDSPObj,
  40. MMScale,
  41. MMRegs,
  42. MMUtils,
  43. MMPanel,
  44. MMLEDs,
  45. MMSlider,
  46. MMLevel,
  47. MMButton,
  48. MMHTimer,
  49. MMConect,
  50. MMWavOut,
  51. MMPcmCvt,
  52. MMAVI;
  53. const
  54. defWidth = 225;
  55. defHeight = 65;
  56. type
  57. {-- TMMAVIVideoDisplay ----------------------------------------------------}
  58. TMMAVIVideoDisplay = class(TMMGraphicControl)
  59. public
  60. constructor Create(aOwner: TComponent); override;
  61. destructor Destroy; override;
  62. function GetVideoSize(Frame: Longint): TRect;
  63. procedure AddStream(S: TMMAVIStream);
  64. procedure AddFile(F: TMMCustomAVIFile);
  65. procedure FreeStreams;
  66. property StreamCount: Integer read GetStreamCount;
  67. property Streams[i: Integer]: TMMAVIStream read GetStreams;
  68. published
  69. property OnClick;
  70. property OnDblClick;
  71. property OnMouseDown;
  72. property OnMouseMove;
  73. property OnMouseUp;
  74. property Width default 100;
  75. property Height default 100;
  76. property Align;
  77. property Bevel;
  78. property Enabled;
  79. property PopupMenu;
  80. property ParentShowHint;
  81. property ShowHint;
  82. property Visible;
  83. property StreamIdx: integer read FStreamIdx write SetStreamIndex;
  84. property FrameIdx: Longint read FFrameIdx write SetFrameIndex;
  85. end;
  86. {-- TMMAVIControl ---------------------------------------------------------}
  87. TMMAVIControl = class(TMMCustomPanel)
  88. public
  89. constructor Create(aOwner: TComponent); override;
  90. destructor Destroy; override;
  91. procedure FreeStreams;
  92. procedure AddStream(S: TMMAVIStream);
  93. procedure AddFile(F: TMMCustomAVIFile);
  94. function hasAudio: Boolean;
  95. function hasVideo: Boolean;
  96. property PWaveFormat: PWaveFormatEx read GetPWaveFormat;
  97. procedure Play;
  98. procedure Pause;
  99. procedure Stop;
  100. property Playing: Boolean read FPlaying;
  101. property Paused: Boolean read FPaused;
  102. property StreamCount: Integer read GetStreamCount;
  103. property Streams[i: Integer]: TMMAVIStream read GetStreams;
  104. property TypedStreams[st: TMMAVIStreamType; i: LongInt]: TMMAVIStream read GetTypedStreams;
  105. property TypedStreamCount[st: TMMAVIStreamType]: LongInt read GetTypedStreamCount;
  106. property MaxPlayTime: Longint read GetMaxPlaytime;
  107. property MinWidth: integer read GetMinWidth;
  108. property MinHeight: integer read GetMinHeight;
  109. published
  110. property OnClick;
  111. property OnDblClick;
  112. property OnMouseDown;
  113. property OnMouseMove;
  114. property OnMouseUp;
  115. property Align;
  116. property Bevel;
  117. property Height default defHeight;
  118. property Width default defWidth;
  119. property ParentShowHint;
  120. property ShowHint;
  121. property PopupMenu;
  122. property Enabled;
  123. property Visible;
  124. property VideoDisplay: TMMAVIVideoDisplay read FVideoDisplay write SetVideoDisplay;
  125. property AudioStreamIdx: integer read FAudioStreamIdx write SetAudioStreamIndex;
  126. property VideoStreamIdx: integer read FVideoStreamIdx write SetVideoStreamIndex;
  127. property CurrentTime: Longint read FCurTime write SetCurrentTime;
  128. property ShowDisplay: Boolean read FShowDisplay write SetShowDisplay default True;
  129. property ShowControls: Boolean read FShowControls write SetShowControls default True;
  130. property LEDColor: TColor read FLEDColor write SetLEDColor default clWhite;
  131. property DeviceID: integer read FDeviceID write FDeviceID default -1;
  132. property NumBuffers: integer read FNumBuffers write FNumBuffers default 25;
  133. property BufferSize: integer read FBufferSize write FBufferSize default 4096;
  134. property CallbackMode: TMMCBMode read FCBMode write FCBMode default cmWindow;
  135. property Decay: integer read FDecay write FDecay default 10;
  136. end;
  137. implementation