⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 jvqid3v2base.pas

📁 East make Tray Icon in delphi
💻 PAS
📖 第 1 页 / 共 5 页
字号:
  end;

  { USER - fiTermsOfUse - Terms of use

    There may only be one "USER" frame in a tag.
  }

  TJvID3TermsOfUseFrame = class(TJvID3Frame)
  private
    FText: TJvID3StringPair;
    FLanguage: string;
    procedure SetLanguage(const Value: string);
    procedure SetText(const Value: string);
    procedure SetTextW(const Value: WideString);
  protected
    procedure ReadFrame; override;
    procedure WriteFrame; override;

    function GetFrameSize(const ToEncoding: TJvID3Encoding): Cardinal; override;
    function GetIsEmpty: Boolean; override;

    function SupportsVersion(const AVersion: TJvID3Version): Boolean; override;
    function SameUniqueIDAs(const Frame: TJvID3Frame): Boolean; override;
  public
    class function CanAddFrame(AController: TJvID3Controller; AFrameID: TJvID3FrameID): Boolean; override;
    function CheckFrame(const HandleError: TJvID3HandleError): Boolean; override;

    procedure Assign(Source: TPersistent); override;
    procedure Clear; override;

    class function Find(AController: TJvID3Controller): TJvID3TermsOfUseFrame;
    class function FindOrCreate(AController: TJvID3Controller): TJvID3TermsOfUseFrame;
  published
    property Language: string read FLanguage write SetLanguage;
    property Text: string read FText.SA write SetText;
    property TextW: WideString read FText.SW write SetTextW;
  end;

  { OWNE - fiOwnership - Ownership frame

    There may only be one "OWNE" frame in a tag.
  }

  TJvID3OwnershipFrame = class(TJvID3Frame)
  private
    FPricePayed: string;
    FSeller: TJvID3StringPair;
    FDateOfPurch: TDateTime;
    procedure SetDateOfPurch(const Value: TDateTime);
    procedure SetPricePayed(const Value: string);
    procedure SetSeller(const Value: string);
    procedure SetSellerW(const Value: WideString);
  protected
    procedure ReadFrame; override;
    procedure WriteFrame; override;

    function GetFrameSize(const ToEncoding: TJvID3Encoding): Cardinal; override;
    function GetIsEmpty: Boolean; override;

    function SupportsVersion(const AVersion: TJvID3Version): Boolean; override;
    function SameUniqueIDAs(const Frame: TJvID3Frame): Boolean; override;
  public
    class function CanAddFrame(AController: TJvID3Controller; AFrameID: TJvID3FrameID): Boolean; override;
    function CheckFrame(const HandleError: TJvID3HandleError): Boolean; override;

    procedure Assign(Source: TPersistent); override;
    procedure Clear; override;

    class function Find(AController: TJvID3Controller): TJvID3OwnershipFrame;
    class function FindOrCreate(AController: TJvID3Controller): TJvID3OwnershipFrame;
  published
    property PricePayed: string read FPricePayed write SetPricePayed;
    property DateOfPurch: TDateTime read FDateOfPurch write SetDateOfPurch;
    property Seller: string read FSeller.SA write SetSeller;
    property SellerW: WideString read FSeller.SW write SetSellerW;
  end;

  { APIC - fiPicture - Attached picture

    There may be several pictures attached to one file, each in their individual
    "APIC" frame, but only one with the same content descriptor(*). There may only
    be one picture with the picture type declared as picture type $01 and $02 (**)
    respectively.

    (*) content descriptor = FPictureType, FDescription
    (**) $01 = ptFileIcon; $02 = ptOtherFileIcon
  }

  TJvID3PictureFrame = class(TJvID3BinaryFrame)
  private
    FMIMEType: string;
    FPictureType: TJvID3PictureType;
    FDescription: TJvID3StringPair;
    FURL: string;
    procedure SetDescription(const Value: string);
    procedure SetDescriptionW(const Value: WideString);
    procedure SetMIMEType(const Value: string);
    procedure SetURL(const Value: string);
  protected
    procedure ReadFrame; override;
    procedure WriteFrame; override;

    function GetFrameSize(const ToEncoding: TJvID3Encoding): Cardinal; override;
    function GetIsEmpty: Boolean; override;

    function SameUniqueIDAs(const Frame: TJvID3Frame): Boolean; override;

    procedure AssignTo(Dest: TPersistent); override;
  public
    class function CanAddFrame(AController: TJvID3Controller; AFrameID: TJvID3FrameID): Boolean; override;
    function CheckFrame(const HandleError: TJvID3HandleError): Boolean; override;

    procedure Assign(Source: TPersistent); override;
    procedure Clear; override;

    class function Find(AController: TJvID3Controller; const AType: TJvID3PictureType): TJvID3PictureFrame;
    class function FindOrCreate(AController: TJvID3Controller; const AType: TJvID3PictureType): TJvID3PictureFrame;
  published
    property MIMEType: string read FMIMEType write SetMIMEType;
    property PictureType: TJvID3PictureType read FPictureType write FPictureType;
    property Description: string read FDescription.SA write SetDescription;
    property DescriptionW: WideString read FDescription.SW write SetDescriptionW;
    { Only used when MIMEType = '-->' }
    property URL: string read FURL write SetURL;
  end;

  TJvID3CustomTextFrame = class(TJvID3Frame)
  protected
    procedure GetText(var AText: TJvID3StringPair); virtual; abstract;
    procedure NewText(const ANewText: TJvID3StringPair); virtual; abstract;

    procedure ReadFrame; override;
    procedure WriteFrame; override;

    function GetFrameSize(const ToEncoding: TJvID3Encoding): Cardinal; override;
    function GetIsEmpty: Boolean; override;

    function SupportsVersion(const AVersion: TJvID3Version): Boolean; override;
    function SameUniqueIDAs(const Frame: TJvID3Frame): Boolean; override;
  public
    class function CanAddFrame(AController: TJvID3Controller; AFrameID: TJvID3FrameID): Boolean; override;

    procedure Assign(Source: TPersistent); override;
    procedure Clear; override;
  end;

  TJvID3SimpleListFrame = class(TJvID3CustomTextFrame)
  private
    FList: TStringList;
    FListW: TWideStringList;
    function GetList: TStrings;
    function GetListW: TWideStrings;
    procedure SetList(const Value: TStrings);
    procedure SetListW(const Value: TWideStrings);
    function GetSeparator: Char;
    function GetSeparatorW: WideChar;
    function GetFixedStringLength: Integer;
    procedure ListChanged(Sender: TObject);
  protected
    procedure GetText(var AText: TJvID3StringPair); override;
    procedure NewText(const ANewText: TJvID3StringPair); override;

    function GetFrameSize(const ToEncoding: TJvID3Encoding): Cardinal; override;
  public
    function CheckFrame(const HandleError: TJvID3HandleError): Boolean; override;
    class function Find(AController: TJvID3Controller; const AFrameID: TJvID3FrameID): TJvID3SimpleListFrame;
    class function FindOrCreate(AController: TJvID3Controller; const AFrameID: TJvID3FrameID): TJvID3SimpleListFrame;

    procedure AfterConstruction; override;
    procedure BeforeDestruction; override;

    property FixedStringLength: Integer read GetFixedStringLength;
    property Separator: Char read GetSeparator;
    property SeparatorW: WideChar read GetSeparatorW;
  published
    property List: TStrings read GetList write SetList;
    property ListW: TWideStrings read GetListW write SetListW;
  end;

  TJvID3NumberFrame = class(TJvID3CustomTextFrame)
  private
    FValue: Cardinal;
    procedure SetValue(const Value: Cardinal);
  protected
    procedure GetText(var AText: TJvID3StringPair); override;
    procedure NewText(const ANewText: TJvID3StringPair); override;
    procedure ChangeToVersion(const ANewVersion: TJvID3Version); override;
    function GetIsEmpty: Boolean; override;
  public
    function CheckFrame(const HandleError: TJvID3HandleError): Boolean; override;
    class function Find(AController: TJvID3Controller; const AFrameID: TJvID3FrameID): TJvID3NumberFrame;
    class function FindOrCreate(AController: TJvID3Controller; const AFrameID: TJvID3FrameID): TJvID3NumberFrame;
  published
    property Value: Cardinal read FValue write SetValue;
  end;

  TJvID3TimestampFrame = class(TJvID3CustomTextFrame)
  private
    FValue: TDateTime;
    procedure SetValue(const Value: TDateTime);
  protected
    procedure GetText(var AText: TJvID3StringPair); override;
    procedure NewText(const ANewText: TJvID3StringPair); override;
    procedure ChangeToVersion(const ANewVersion: TJvID3Version); override;
  public
    function CheckFrame(const HandleError: TJvID3HandleError): Boolean; override;
    class function Find(AController: TJvID3Controller; const AFrameID: TJvID3FrameID): TJvID3TimestampFrame;
    class function FindOrCreate(AController: TJvID3Controller; const AFrameID: TJvID3FrameID): TJvID3TimestampFrame;
  published
    property Value: TDateTime read FValue write SetValue;
  end;

  TJvID3TextFrame = class(TJvID3CustomTextFrame)
  private
    FText: TJvID3StringPair;
    procedure SetText(const Value: string);
    procedure SetTextW(const Value: WideString);
  protected
    procedure GetText(var AText: TJvID3StringPair); override;
    procedure NewText(const ANewText: TJvID3StringPair); override;
    procedure ChangeToVersion(const ANewVersion: TJvID3Version); override;
  public
    function CheckFrame(const HandleError: TJvID3HandleError): Boolean; override;
    class function Find(AController: TJvID3Controller; const AFrameID: TJvID3FrameID): TJvID3TextFrame;
    class function FindOrCreate(AController: TJvID3Controller; const AFrameID: TJvID3FrameID): TJvID3TextFrame;
  published
    property Text: string read FText.SA write SetText;
    property TextW: WideString read FText.SW write SetTextW;
  end;

  TJvID3URLFrame = class(TJvID3Frame)
  private
    FURL: string;
    procedure SetURL(const Value: string);
  protected
    procedure ReadFrame; override;
    procedure WriteFrame; override;

    function GetFrameSize(const ToEncoding: TJvID3Encoding): Cardinal; override;
    function GetIsEmpty: Boolean; override;

    function SameUniqueIDAs(const Frame: TJvID3Frame): Boolean; override;
  public
    class function CanAddFrame(AController: TJvID3Controller; AFrameID: TJvID3FrameID): Boolean; override;
    function CheckFrame(const HandleError: TJvID3HandleError): Boolean; override;

    procedure Assign(Source: TPersistent); override;
    procedure Clear; override;

    class function Find(AController: TJvID3Controller; const AFrameID: TJvID3FrameID): TJvID3URLFrame;
    class function FindOrCreate(AController: TJvID3Controller; const AFrameID: TJvID3FrameID): TJvID3URLFrame;
  published
    property URL: string read FURL write SetURL;
  end;

  { TXXX - fiUserText - User defined text information
  }

  TJvID3UserFrame = class(TJvID3Frame)
  private
    FValue: TJvID3StringPair;
    FDescription: TJvID3StringPair;
    procedure SetDescription(const Value: string);
    procedure SetDescriptionW(const Value: WideString);
    procedure SetValue(const Value: string);
    procedure SetValueW(const Value: WideString);
  protected
    procedure ReadFrame; override;
    procedure WriteFrame; override;

    function GetFrameSize(const ToEncoding: TJvID3Encoding): Cardinal; override;
    function GetIsEmpty: Boolean; override;
  public
    class function CanAddFrame(AController: TJvID3Controller; AFrameID: TJvID3FrameID): Boolean; override;
    function CheckFrame(const HandleError: TJvID3HandleError): Boolean; override;

    procedure Assign(Source: TPersistent); override;
    procedure Clear; override;

    class function Find(AController: TJvID3Controller; const Index: Integer): TJvID3UserFrame;
    class function FindOrCreate(AController: TJvID3Controller; const Index: Integer): TJvID3UserFrame;
  published
    property Description: string read FDescription.SA write SetDescription;
    property DescriptionW: WideString read FDescription.SW write SetDescriptionW;
    property Value: string read FValue.SA write SetValue;
    property ValueW: WideString read FValue.SW write SetValueW;
  end;

  { WXXX - fiWWWUser - User defined URL link
  }

  TJvID3URLUserFrame = class(TJvID3Frame)
  private
    FDescription: TJvID3StringPair;
    FURL: string;
    procedure SetDescription(const Value: string);
    procedure SetDescriptionW(const Value: WideString);
    procedure SetURL(const Value: string);
  protected
    procedure ReadFrame; override;
    procedure WriteFrame; override;

    function GetFrameSize(const ToEncoding: TJvID3Encoding): Cardinal; override;
    function GetIsEmpty: Boolean; override;
  public
    class function CanAddFrame(AController: TJvID3Controller; AFrameID: TJvID3FrameID): Boolean; override;
    function CheckFrame(const HandleError: TJvID3HandleError): Boolean; override;

    procedure Assign(Source: TPersistent); override;
    procedure Clear; override;

    class function Find(AController: TJvID3Controller; const Index: Integer): TJvID3URLUserFrame;
    class function FindOrCreate(AController: TJvID3Controller; const Index: Integer): TJvID3URLUserFrame;
  published
    property Description: string read FDescription.SA write SetDescription;
    property DescriptionW: WideString read FDescription.SW write SetDescriptionW;
    property URL: string read FURL write SetURL;
  end;

  TJvID3FileInfo = class(TPersistent)
  private
    FAudioSize: Int64;
    FBitrate: Integer;
    FBits: TJvMPEGBits;
    FChannelMode: TJvMPEGChannelMode;
    FEmphasis: TJvMPEGEmphasis;
    FFileSize: Int64;
    FFrameCount: Integer;
    FFrameLengthInBytes: Integer;
    FHasID3v1Tag: Boolean;
    FHeaderFoundAt: Int64;
    FIsVBR: Boolean;
    FLayer: TJvMPEGLayer;
    FLengthInSec: Integer;
    FModeExtension: TJvMPEGModeExtension;
    FPaddingLength: Integer;
    FSamplingRateFrequency: Integer;
    FVersion: TJvMPEGVersion;
    function GetIsValid: Boolean;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -