mmaplay.int 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. {========================================================================}
  2. {= (c) 1995-98 SwiftSoft Ronald Dittrich =}
  3. {========================================================================}
  4. {= All Rights Reserved =}
  5. {========================================================================}
  6. {= D 01099 Dresden = Fax.: +49(0)351-8037944 =}
  7. {= Loewenstr.7a = info@swiftsoft.de =}
  8. {========================================================================}
  9. {= Actual versions on http://www.swiftsoft.de/index.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: 10.01.99 - 01:19:04 $ =}
  24. {========================================================================}
  25. unit MMAPlay;
  26. {$I COMPILER.INC}
  27. interface
  28. {$DEFINE _USEDS_}
  29. uses
  30. {$IFDEF WIN32}
  31. Windows,
  32. {$ELSE}
  33. WinTypes,
  34. WinProcs,
  35. {$ENDIF}
  36. SysUtils,
  37. Classes,
  38. Controls,
  39. Dialogs,
  40. MMSystem,
  41. MMObj,
  42. MMMath,
  43. MMMulDiv,
  44. MMDSPobj,
  45. MMRegs,
  46. MMUtils,
  47. MMAudio,
  48. MMPitch,
  49. MMWavOut,
  50. MMMPType
  51. {$IFDEF _USEDS_}
  52. ,MMDSWOut,
  53. MMDSound
  54. {$ENDIF}
  55. ;
  56. type
  57. EMMAudioPlayerError = class(Exception);
  58. {-- TMMAudioPlayer --------------------------------------------------------}
  59. TMMAudioPlayer = class(TMMBaseAudioFile)
  60. public
  61. constructor Create(aOwner: TComponent); override;
  62. destructor Destroy; override;
  63. function SelectFile: Boolean;
  64. procedure LoadFromFile(const aFileName: String);
  65. procedure FreeFile;
  66. procedure SetDecodeCallback(Callback: TMpegDecodeProc; dwInstance: Longint);
  67. procedure SetDecodeMode(Mode: TMpegDecodeMode);
  68. procedure ScanFile(SaveInfo: Boolean; dwInstance: DWORD; Callback: TMpegScanProc);
  69. procedure EncryptFile(DestFile: string; dwInstance: DWORD; lpEncodeCB: TMpegDecodeProc; lpProcessCB: TMpegScanProc);
  70. function ReadID3Tag(var Info: TTAGInfo): Boolean;
  71. procedure Play;
  72. procedure Stop;
  73. procedure StopFade(Duration: Longint);
  74. procedure Pause;
  75. procedure Restart;
  76. property PWaveFormat;
  77. property State: TMMWaveOutState read GetState;
  78. property Position: Longint read GetPosition write SetPosition;
  79. property Empty: Boolean read GetEmpty;
  80. property SampleRate: Longint read GetSampleRate;
  81. property Channels: integer read GetChannels;
  82. property BitRate: integer read GetBitRate;
  83. property ChannelMode: TMMMode read GetChannelMode;
  84. property Layer: integer read GetLayer;
  85. property FileLength: Longint read GetFileLength;
  86. property PlayLength: Longint read GetPlayLength write SetPlayLength;
  87. property FadeInDuration: Longint read GetFadeInDuration write SetFadeInDuration;
  88. property FadeOutDuration: Longint read GetFadeOutDuration write SetFadeOutDuration;
  89. property FadeOutPosition: LongInt read GetFadeOutPosition write SetFadeOutPosition;
  90. published
  91. property OnStart: TNotifyEvent read FOnStart write FOnStart;
  92. property OnStop: TNotifyEvent read FOnStop write FOnStop;
  93. property OnPause: TNotifyEvent read FOnPause write FOnPause;
  94. property OnRestart: TNotifyEvent read FOnRestart write FOnRestart;
  95. property OnData: TMMBufferEvent read FOnData write FOnData;
  96. property OnChange: TNotifyEvent read FOnChange write FOnChange;
  97. property Output;
  98. property FileName;
  99. property FileType: TMMAudioFileType read GetFileType write SetFileType stored False;
  100. property BufferSize: Longint read GetBufferSize write SetBufferSize;
  101. property NumBuffers: integer read GetNumBuffers write SetNumBuffers;
  102. property DeviceID: TMMDeviceID read GetDeviceID write SetDeviceID;
  103. property ProductName: string read GetProductName write SetProductName stored False;
  104. property CallBackMode: TMMCBMode read GetCallBackMode write SetCallBackMode;
  105. property ResetPosition: Boolean read FResetPos write FResetPos default True;
  106. property Volume: Longint read FVolume write SetVolume default VOLUMEBASE;
  107. property Panning: Longint read FPanning write SetPanning default 0;
  108. property Pitch: Float read FPitchVal write SetPitch;
  109. {$IFDEF _USEDS_}
  110. property UseDSound: Boolean read FUseDSound write SetUseDSound default False;
  111. {$ENDIF}
  112. end;
  113. implementation