MMMIXBLK.INT 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401
  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 MMMixBlk;
  26. {$I COMPILER.INC}
  27. {$DEFINE _MMDEBUG}
  28. interface
  29. uses
  30. {$IFDEF WIN32}
  31. Windows,
  32. {$ELSE}
  33. WinTypes,
  34. WinProcs,
  35. {$ENDIF}
  36. Forms,
  37. Messages,
  38. StdCtrls,
  39. ExtCtrls,
  40. SysUtils,
  41. Controls,
  42. Classes,
  43. Graphics,
  44. MMObj,
  45. MMObsrv,
  46. MMLevel,
  47. MMUtils,
  48. MMMixer,
  49. MMMixCtl,
  50. MMSlider,
  51. MMScale;
  52. const
  53. MM_SETPARENT = WM_USER + 1;
  54. type
  55. TMMSetParentAction = (saInsert,saInsNoRole,saRemove,saUpdate);
  56. TMMSetParent = record
  57. Msg : Cardinal;
  58. Action : Cardinal;
  59. Control : TControl;
  60. Result : LongInt;
  61. end;
  62. type
  63. TMMBlockSliderStyle = (ssWin95);
  64. TMMBlockSliderRole = (srPan,srLeftVolume,srRightVolume);
  65. {-- TMMCustomBlockSlider -----------------------------------------------}
  66. TMMCustomBlockSlider = class(TMMCustomMixerSlider)
  67. protected
  68. procedure SetParent(Value: TWinControl); override;
  69. procedure UpdateStyle; virtual;
  70. public
  71. constructor Create(AOwner: TComponent); override;
  72. protected
  73. property Style: TMMBlockSliderStyle read FStyle write SetStyle default ssWin95;
  74. property Role: TMMBlockSliderRole read FRole write SetRole default srPan;
  75. property GrooveSize nodefault;
  76. property ScalePosition nodefault;
  77. property Logarithmic nodefault;
  78. end;
  79. {-- TMMMixerBlockSlider ---------------------------------------------}
  80. TMMMixerBlockSlider = class(TMMCustomBlockSlider)
  81. published
  82. property OnEnter;
  83. property OnExit;
  84. property OnKeyDown;
  85. property OnKeyPress;
  86. property OnKeyUp;
  87. property OnChange;
  88. property OnTrack;
  89. property OnTrackEnd;
  90. property OnDrawThumb;
  91. property OnDrawGroove;
  92. property Style;
  93. property Role;
  94. property Logarithmic;
  95. property Sensitivity;
  96. property Enabled;
  97. property Visible;
  98. property Color;
  99. property ParentShowHint;
  100. property PopupMenu;
  101. property ShowHint;
  102. property TabStop;
  103. property TabOrder;
  104. property Width;
  105. property Height;
  106. property Bevel;
  107. property Groove;
  108. property FocusAction;
  109. property FocusColor;
  110. property GrooveColor;
  111. property ThumbColor;
  112. property DisabledColor;
  113. property HandCursor;
  114. property Orientation;
  115. property GrooveSize;
  116. property ThumbWidth;
  117. property ThumbHeight;
  118. property ThumbStyle;
  119. property Scale;
  120. property ScalePosition;
  121. property ScaleDistance;
  122. property PicLeft;
  123. property PicRight;
  124. end;
  125. TMMBlockLevelStyle = (lsWin95);
  126. TMMBlockLevelRole = (lrLeftLevel,lrRightLevel);
  127. {-- TMMCustomBlockLevel ------------------------------------------------}
  128. TMMCustomBlockLevel = class(TMMCustomLevel)
  129. protected
  130. procedure UpdateStyle; virtual;
  131. procedure SetParent(Value: TWinControl); override;
  132. public
  133. constructor Create(AOwner: TComponent); override;
  134. protected
  135. property Style: TMMBlockLevelStyle read FStyle write SetStyle default lsWin95;
  136. property Role: TMMBlockLevelRole read FRole write SetRole default lrLeftLevel;
  137. property Color nodefault;
  138. property SpotWidth nodefault;
  139. property Bar1Color nodefault;
  140. property Bar2Color nodefault;
  141. property Bar3Color nodefault;
  142. property Inactive1Color nodefault;
  143. property Inactive2Color nodefault;
  144. property Inactive3Color nodefault;
  145. property Point1 nodefault;
  146. property Point2 nodefault;
  147. property LogAmp nodefault;
  148. property NumPeaks nodefault;
  149. end;
  150. {-- TMMMixerBlockLevel ----------------------------------------------}
  151. TMMMixerBlockLevel = class(TMMCustomBlockLevel)
  152. published
  153. property OnClick;
  154. property OnDblClick;
  155. property OnMouseDown;
  156. property OnMouseMove;
  157. property OnMouseUp;
  158. property OnGainOverflow;
  159. property OnPcmOverflow;
  160. property Style;
  161. property Role;
  162. property Align;
  163. property Bevel;
  164. property ParentShowHint;
  165. property ParentColor;
  166. property ShowHint;
  167. property Visible;
  168. property Color;
  169. property Enabled;
  170. property Kind;
  171. property Height;
  172. property Width;
  173. property SpotSpace;
  174. property SpotWidth;
  175. property Bar1Color;
  176. property Bar2Color;
  177. property Bar3Color;
  178. property Inactive1Color;
  179. property Inactive2Color;
  180. property Inactive3Color;
  181. property InactiveDoted;
  182. property ActiveDoted;
  183. property Point1;
  184. property Point2;
  185. property Direction;
  186. property BitLength;
  187. property Channel;
  188. property Mode;
  189. property Gain;
  190. property Samples;
  191. property Sensitivy;
  192. property LogAmp;
  193. property NumPeaks;
  194. property PeakHold;
  195. property PeakDelay;
  196. property DecayMode;
  197. property Decay;
  198. property Value;
  199. end;
  200. {-- TMMCustomBlockCheck ----------------------------------------------}
  201. TMMCustomBlockCheck = class(TMMCustomMixerCheckBox)
  202. protected
  203. procedure SetParent(Value: TWinControl); override;
  204. end;
  205. {-- TMMMixerBlockCheck -----------------------------------------------}
  206. TMMMixerBlockCheck = class(TMMCustomBlockCheck)
  207. published
  208. property OnDragDrop;
  209. property OnDragOver;
  210. property OnEndDrag;
  211. property OnEnter;
  212. property OnExit;
  213. property OnKeyDown;
  214. property OnKeyPress;
  215. property OnKeyUp;
  216. property OnMouseDown;
  217. property OnMouseMove;
  218. property OnMouseUp;
  219. property OnStartDrag;
  220. property AutoCaption;
  221. property Short;
  222. property Enabled;
  223. property Caption;
  224. property Alignment;
  225. property Color;
  226. property Ctl3D;
  227. property DragCursor;
  228. property DragMode;
  229. property Font;
  230. property ParentColor;
  231. property ParentCtl3D;
  232. property ParentFont;
  233. property ParentShowHint;
  234. property PopupMenu;
  235. property ShowHint;
  236. property TabOrder;
  237. property TabStop;
  238. property Visible;
  239. end;
  240. TMMBlockLabelRole = (lrLineTitle,lrPanTitle,lrVolumeTitle);
  241. {-- TMMCustomMixerLabel ----------------------------------------------}
  242. TMMCustomBlockLabel = class(TCustomLabel)
  243. protected
  244. procedure SetParent(Value: TWinControl); override;
  245. protected
  246. property Role: TMMBlockLabelRole read FRole write SetRole default lrLineTitle;
  247. end;
  248. {-- TMMMixerBlockLabel ----------------------------------------------}
  249. TMMMixerBlockLabel = class(TMMCustomBlockLabel)
  250. published
  251. property OnClick;
  252. property OnDblClick;
  253. property OnDragDrop;
  254. property OnDragOver;
  255. property OnEndDrag;
  256. property OnMouseDown;
  257. property OnMouseMove;
  258. property OnMouseUp;
  259. property OnStartDrag;
  260. property Role;
  261. property Align;
  262. property Alignment;
  263. property AutoSize;
  264. property Caption;
  265. property Color;
  266. property DragCursor;
  267. property DragMode;
  268. property Enabled;
  269. property FocusControl;
  270. property Font;
  271. property ParentColor;
  272. property ParentFont;
  273. property ParentShowHint;
  274. property PopupMenu;
  275. property ShowAccelChar;
  276. property ShowHint;
  277. property Transparent;
  278. property Visible;
  279. property WordWrap;
  280. end;
  281. EMMBlockError = class(Exception);
  282. TMMBlockStyle = (bsWin95);
  283. TMMMuteKind = (mkMute,mkSelect);
  284. {-- TMMCustomMixerBlock ------------------------------------------------}
  285. TMMCustomMixerBlock = class(TMMCustomPanel)
  286. protected
  287. procedure UpdateBlock; virtual;
  288. procedure Notification(AComponent: TComponent; Operation: TOperation); override;
  289. procedure InsertCtl(C: TComponent); virtual;
  290. procedure Loaded; override;
  291. procedure ArrangeControls; virtual;
  292. procedure SetBounds(ALeft, ATop, AWidth, AHeight: Integer); override;
  293. procedure ConnectLine;
  294. procedure DisconnectLine;
  295. procedure ConnectControls;
  296. procedure MMSetParent(var Msg: TMMSetParent); message MM_SETPARENT;
  297. procedure CollectControls;
  298. public
  299. constructor Create(AOwner: TComponent); override;
  300. destructor Destroy; override;
  301. function GetMuteKind: TMMMuteKind;
  302. property Pan: TMMCustomBlockSlider read FPan;
  303. property Mute: TMMCustomBlockCheck read FMute;
  304. property VolumeLeft: TMMCustomBlockSlider read FVolumeLeft;
  305. property VolumeRight: TMMCustomBlockSlider read FVolumeRight;
  306. property LevelLeft: TMMCustomBlockLevel read FLevelLeft;
  307. property LevelRight: TMMCustomBlockLevel read FLevelRight;
  308. property LineTitle: TMMCustomBlockLabel read FLineTitle;
  309. property PanTitle: TMMCustomBlockLabel read FPanTitle;
  310. property VolumeTitle: TMMCustomBlockLabel read FVolumeTitle;
  311. protected
  312. property Line: TMMAudioLine read FLine write SetLine;
  313. property AutoArrange : Boolean read FAutoArrange write SetAutoArrange default True;
  314. property AutoSize : Boolean read FAutoSize write SetAutoSize default True;
  315. property Style: TMMBlockStyle read FStyle write SetStyle default bsWin95;
  316. property Mixer: TMMCustomMixerControl read FMixer write SetMixer;
  317. property Item: TMMItemIndex read FItem write SetItem default NoItem;
  318. property MuteKind: TMMMuteKind read GetMuteKind write FKDummy stored False;
  319. end;
  320. {-- TMMMixerBlock ------------------------------------------------------}
  321. TMMMixerBlock = class(TMMCustomMixerBlock)
  322. published
  323. property OnClick;
  324. property OnDblClick;
  325. property OnDragDrop;
  326. property OnDragOver;
  327. property OnEndDrag;
  328. property OnEnter;
  329. property OnExit;
  330. property OnMouseDown;
  331. property OnMouseMove;
  332. property OnMouseUp;
  333. property OnResize;
  334. {$IFDEF WIN32}
  335. property OnStartDrag;
  336. {$ENDIF}
  337. property Align;
  338. property Bevel;
  339. property DragCursor;
  340. property DragMode;
  341. property Enabled;
  342. property Color;
  343. property Ctl3D;
  344. property Font;
  345. property ParentColor;
  346. property ParentCtl3D;
  347. property ParentFont;
  348. property ParentShowHint;
  349. property PopupMenu;
  350. property ShowHint;
  351. property TabOrder;
  352. property TabStop;
  353. property Visible;
  354. property Line;
  355. property AutoArrange;
  356. property AutoSize;
  357. property Style;
  358. property Mixer;
  359. property Item;
  360. property MuteKind;
  361. end;
  362. implementation