MMTRIGG.INT 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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 MMTrigg;
  26. {$C FIXED PRELOAD PERMANENT}
  27. {$I COMPILER.INC}
  28. {.$DEFINE _MMDEBUG}
  29. interface
  30. uses
  31. {$IFDEF WIN32}
  32. Windows,
  33. {$ELSE}
  34. WinTypes,
  35. WinProcs,
  36. {$ENDIF}
  37. SysUtils,
  38. Messages,
  39. Classes,
  40. Graphics,
  41. Controls,
  42. Forms,
  43. Dialogs,
  44. MMSystem,
  45. MMUtils,
  46. MMString,
  47. MMObj,
  48. MMDSPObj,
  49. MMRegs,
  50. MMPCMSup,
  51. MMWaveIO;
  52. const
  53. {$IFDEF WIN32}
  54. TRIGGER_PRIORITY : integer = Thread_Priority_Normal;
  55. {$ENDIF}
  56. MINBUFFERSIZE = 32;
  57. type
  58. TMMTriggerStates = (trClose, trOpen, trPlay, trPause);
  59. TMMTriggerState = set of TMMTriggerStates;
  60. EMMTriggerError = class(Exception);
  61. {$IFDEF WIN32}
  62. TMMTrigger = class;
  63. {-- TMMTrigger ---------------------------------------------------------}
  64. TMMTrigger = class(TMMCustomSoundComponent)
  65. public
  66. constructor Create(AOwner: TComponent); override;
  67. destructor Destroy; override;
  68. procedure Open; virtual;
  69. procedure Close; virtual;
  70. procedure Start; virtual;
  71. procedure Pause; virtual;
  72. procedure Restart; virtual;
  73. procedure Stop; virtual;
  74. {$IFDEF WIN32}
  75. procedure SynchronizeVCL(VCLProc: TThreadMethod);
  76. {$ENDIF}
  77. property State: TMMTriggerState read FState;
  78. property Position: Longint read GetPosition;
  79. published
  80. { Events }
  81. property OnError: TNotifyEvent read FOnError write FOnError;
  82. property OnOpen: TNotifyEvent read FOnOpen write FOnOpen;
  83. property OnStart: TNotifyEvent read FOnStart write FOnStart;
  84. property OnPause: TNotifyEvent read FOnPause write FOnPause;
  85. property OnRestart: TNotifyEvent read FOnRestart write FOnRestart;
  86. property OnStop: TNotifyEvent read FOnStop write FOnStop;
  87. property OnClose: TNotifyEvent read FOnClose write FOnClose;
  88. property OnBufferFilled: TMMBufferEvent read FOnBufferFilled write FOnBufferFilled;
  89. property OnBufferReady;
  90. property OnBufferLoad;
  91. property Input;
  92. property Output;
  93. property BufferSize;
  94. property Interval: integer read FInterval write SetInterval default 1;
  95. property TimeFormat: TMMTimeFormats read FTimeFormat write SetTimeFormat default tfByte;
  96. end;
  97. implementation