| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130 |
- {========================================================================}
- {= (c) 1995-98 SwiftSoft Ronald Dittrich =}
- {========================================================================}
- {= All Rights Reserved =}
- {========================================================================}
- {= D 01099 Dresden = Fax.: +49(0)351-8037944 =}
- {= Loewenstr.7a = info@swiftsoft.de =}
- {========================================================================}
- {= Actual versions on http://www.swiftsoft.de/index.html =}
- {========================================================================}
- {= This code is for reference purposes only and may not be copied or =}
- {= distributed in any format electronic or otherwise except one copy =}
- {= for backup purposes. =}
- {= =}
- {= No Delphi Component Kit or Component individually or in a collection=}
- {= subclassed or otherwise from the code in this unit, or associated =}
- {= .pas, .dfm, .dcu, .asm or .obj files may be sold or distributed =}
- {= without express permission from SwiftSoft. =}
- {= =}
- {= For more licence informations please refer to the associated =}
- {= HelpFile. =}
- {========================================================================}
- {= $Date: 10.01.99 - 01:19:04 $ =}
- {========================================================================}
- unit MMAPlay;
- {$I COMPILER.INC}
- interface
- {$DEFINE _USEDS_}
- uses
- {$IFDEF WIN32}
- Windows,
- {$ELSE}
- WinTypes,
- WinProcs,
- {$ENDIF}
- SysUtils,
- Classes,
- Controls,
- Dialogs,
- MMSystem,
- MMObj,
- MMMath,
- MMMulDiv,
- MMDSPobj,
- MMRegs,
- MMUtils,
- MMAudio,
- MMPitch,
- MMWavOut,
- MMMPType
- {$IFDEF _USEDS_}
- ,MMDSWOut,
- MMDSound
- {$ENDIF}
- ;
- type
- EMMAudioPlayerError = class(Exception);
- {-- TMMAudioPlayer --------------------------------------------------------}
- TMMAudioPlayer = class(TMMBaseAudioFile)
- public
- constructor Create(aOwner: TComponent); override;
- destructor Destroy; override;
- function SelectFile: Boolean;
- procedure LoadFromFile(const aFileName: String);
- procedure FreeFile;
- procedure SetDecodeCallback(Callback: TMpegDecodeProc; dwInstance: Longint);
- procedure SetDecodeMode(Mode: TMpegDecodeMode);
- procedure ScanFile(SaveInfo: Boolean; dwInstance: DWORD; Callback: TMpegScanProc);
- procedure EncryptFile(DestFile: string; dwInstance: DWORD; lpEncodeCB: TMpegDecodeProc; lpProcessCB: TMpegScanProc);
- function ReadID3Tag(var Info: TTAGInfo): Boolean;
- procedure Play;
- procedure Stop;
- procedure StopFade(Duration: Longint);
- procedure Pause;
- procedure Restart;
- property PWaveFormat;
- property State: TMMWaveOutState read GetState;
- property Position: Longint read GetPosition write SetPosition;
- property Empty: Boolean read GetEmpty;
- property SampleRate: Longint read GetSampleRate;
- property Channels: integer read GetChannels;
- property BitRate: integer read GetBitRate;
- property ChannelMode: TMMMode read GetChannelMode;
- property Layer: integer read GetLayer;
- property FileLength: Longint read GetFileLength;
- property PlayLength: Longint read GetPlayLength write SetPlayLength;
- property FadeInDuration: Longint read GetFadeInDuration write SetFadeInDuration;
- property FadeOutDuration: Longint read GetFadeOutDuration write SetFadeOutDuration;
- property FadeOutPosition: LongInt read GetFadeOutPosition write SetFadeOutPosition;
- published
- property OnStart: TNotifyEvent read FOnStart write FOnStart;
- property OnStop: TNotifyEvent read FOnStop write FOnStop;
- property OnPause: TNotifyEvent read FOnPause write FOnPause;
- property OnRestart: TNotifyEvent read FOnRestart write FOnRestart;
- property OnData: TMMBufferEvent read FOnData write FOnData;
- property OnChange: TNotifyEvent read FOnChange write FOnChange;
- property Output;
- property FileName;
- property FileType: TMMAudioFileType read GetFileType write SetFileType stored False;
- property BufferSize: Longint read GetBufferSize write SetBufferSize;
- property NumBuffers: integer read GetNumBuffers write SetNumBuffers;
- property DeviceID: TMMDeviceID read GetDeviceID write SetDeviceID;
- property ProductName: string read GetProductName write SetProductName stored False;
- property CallBackMode: TMMCBMode read GetCallBackMode write SetCallBackMode;
- property ResetPosition: Boolean read FResetPos write FResetPos default True;
- property Volume: Longint read FVolume write SetVolume default VOLUMEBASE;
- property Panning: Longint read FPanning write SetPanning default 0;
- property Pitch: Float read FPitchVal write SetPitch;
- {$IFDEF _USEDS_}
- property UseDSound: Boolean read FUseDSound write SetUseDSound default False;
- {$ENDIF}
- end;
- implementation
|