| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135 |
- {========================================================================}
- {= (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/mmtools.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: 14.04.98 - 13:59:29 $ =}
- {========================================================================}
- unit MMMPEG;
- {$I COMPILER.INC}
- {$DEFINE USEMPEGDLL}
- interface
- uses
- Windows,
- SysUtils,
- Classes,
- Dialogs,
- Consts,
- DsgnIntf,
- MMSystem,
- MMObj,
- MMDSPObj,
- MMRegs,
- MMUtils,
- MMString,
- MMPCMSup,
- MMMPType
- {$IFNDEF USEMPEGDLL}
- ,Wrapper
- {$ENDIF}
- ;
- type
- EMMMpegError = class(Exception);
- {-- TMMMpeg -----------------------------------------------------------------}
- TMMMpeg = class(TMMObject)
- public
- constructor Create; virtual;
- destructor Destroy; override;
- procedure FreeMpeg;
- procedure Assign(Source: TPersistent); override;
- procedure LoadFromFile(const AFilename: string);
- property Empty: Boolean read GetEmpty;
- property Done: Boolean read GetDone;
- property TimePerFrame: Longint read GetTimePerFrame;
- property Position: Longint read GetPosition write SetPosition;
- property PWaveFormat: PWaveFormatEx read GetPWaveFormat;
- procedure OpenFile;
- procedure ResetFile;
- procedure CloseFile;
- function ReadDataBytes(Buffer: PChar; NumBytes: Longint): Longint;
- published
- property OnChange: TNotifyEvent read FOnChange write FOnChange;
- property TrailingHeader: Longint read FTrailing write SetTrailingHeader;
- property FileName: TFileName read GetFileName write SetFileName;
- property Version: TMpegVersion read GetVersion write SetVersion;
- property Layer: integer read GetLayer write SetLayer;
- property Mode: TSampleMode read GetMode write SetMode;
- property BitRate: integer read GetBitRate write SetBitRate;
- property SampleRate: Longint read GetSampleRate write SetLongint;
- property PlayBackRate: Longint read GetPlayBackRate write SetLongint;
- property Frames: Longint read GetFrames write SetLongint;
- property Time: Longint read GetTime write SetLongint;
- property ChannelMode: TChannelMode read GetChannelMode write SetChannelMode;
- end;
- {-- TMMMpegFile -------------------------------------------------------}
- TMMMPEGFile = class(TMMDSPComponent)
- public
- constructor Create(AOwner: TComponent); override;
- destructor Destroy; override;
- procedure SetDecodeCallback(Callback: TMpegDecodeProc);
- procedure FreeMpeg;
- procedure Assign(Source: TPersistent); override;
- procedure LoadFromFile(const AFilename: string);
- property Empty: Boolean read GetEmpty;
- property TimePerFrame: Longint read GetTimePerFrame;
- property Position: Longint read GetPosition write SetPosition;
- procedure OpenFile;
- procedure CloseFile;
- function ReadDataBytes(Buffer: PChar; NumBytes: Longint): Longint;
- published
- property OnChange: TNotifyEvent read FOnChange write FOnChange;
- property Output;
- property Enabled: Boolean read FEnabled write FEnabled default True;
- property TrailingHeader: Longint read GetTrailingHeader write SetTrailingHeader;
- property FileName: TFileName read GetFileName write SetFileName;
- property Version: TMpegVersion read GetVersion write SetVersion;
- property Layer: integer read GetLayer write SetLayer;
- property Mode: TSampleMode read GetMode write SetMode;
- property BitRate: integer read GetBitRate write SetBitRate;
- property SampleRate: Longint read GetSampleRate write SetLongint;
- property PlayBackRate: Longint read GetPlayBackRate write SetLongint;
- property Frames: Longint read GetFrames write SetLongint;
- property Time: Longint read GetTime write SetLongint;
- property ChannelMode: TChannelMode read GetChannelMode write SetChannelMode;
- end;
- function IsMpegFile(aFileName: TFileName): Boolean;
- function GetMpegFileInfo(aFileName: TFileName; var Info: TMpegFileInfo): Boolean;
- implementation
|