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

📄 jvqid3v2base.pas

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

    procedure CheckCanAddFrame(FrameID: TJvID3FrameID);

    procedure Read; override;
    procedure Write; override;
    procedure Reset; override;

    function GetCount: Integer;
    function GetFrame(Index: Integer): TJvID3Frame;
    procedure SetFrame(Index: Integer; Value: TJvID3Frame);
    procedure SetFrameIndex(Frame: TJvID3Frame; Value: Integer);
  public
    procedure AfterConstruction; override;
    procedure BeforeDestruction; override;

    procedure Assign(Source: TPersistent); override;

    procedure Add(Frame: TJvID3Frame);
    procedure Clear;
    function FindFrame(const FrameName: string): TJvID3Frame; overload;
    function FindFrame(const FrameID: TJvID3FrameID): TJvID3Frame; overload;
    function FrameByName(const FrameName: string): TJvID3Frame;
    function FrameByID(const FrameID: TJvID3FrameID): TJvID3Frame;
    procedure GetFrameNames(List: TStrings);
    function GetFrameIDs: TJvID3FrameIDs;

    procedure ChangeToVersion(const ANewVersion: TJvID3Version); override;
    function IndexOf(Frame: TJvID3Frame): Integer;
    function CheckIsUnique(Frame: TJvID3Frame): Boolean;
    function CheckFrames(const HandleError: TJvID3HandleError): Boolean;
    procedure RemoveEmptyFrames;
    procedure Remove(Frame: TJvID3Frame);
    property Count: Integer read GetCount;
    property Frames[Index: Integer]: TJvID3Frame read GetFrame write SetFrame; default;
  end;

  { MCDI - fiCDID - Music CD identifier

    There may only be one 'MCDI' frame in each tag.
  }

  TJvID3BinaryFrame = class(TJvID3Frame)
  private
    FData: PChar;
    FDataSize: Cardinal;
  protected
    procedure ReadData(ASize: Cardinal); virtual;
    procedure WriteData; virtual;

    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): TJvID3BinaryFrame;
    class function FindOrCreate(AController: TJvID3Controller; const AFrameID: TJvID3FrameID): TJvID3BinaryFrame;

    procedure AfterConstruction; override;
    procedure BeforeDestruction; override;

    function SetData(P: Pointer; const Size: Cardinal): Boolean;
    function GetData(P: Pointer; const Size: Cardinal): Boolean;

    procedure LoadFromFile(const FileName: string); virtual;
    procedure SaveToFile(const FileName: string); virtual;
    procedure LoadFromStream(Stream: TStream); virtual;
    procedure SaveToStream(Stream: TStream); virtual;

    property DataSize: Cardinal read FDataSize;
  end;

  TJvID3SkipFrame = class(TJvID3BinaryFrame)
  protected
    procedure ChangeToVersion(const ANewVersion: TJvID3Version); override;
  end;

  { IPLS - fiInvolvedPeople - Involved people list

    There may only be one "IPLS" frame in each tag.

    TIPL - fiInvolvedPeople2 - Involved people list
    TMCL - fiMusicianCreditList - Musician credits list

    There may only be one text information frame of its kind in an tag
  }

  TJvID3DoubleListFrame = class(TJvID3Frame)
  private
    FList: TStringList;
    FListW: TWideStringList;
    function GetNameA(Index: Integer): string;
    function GetNameW(Index: Integer): string;
    function GetValueA(Index: Integer): string;
    function GetValueW(Index: Integer): string;
    function GetList: TStrings;
    function GetListW: TWideStrings;
    procedure SetList(const Value: TStrings);
    procedure SetListW(const Value: TWideStrings);
    procedure ListChanged(Sender: TObject);
  protected
    procedure ReadFrame; override;
    procedure WriteFrame; override;

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

    procedure ChangeToVersion(const ANewVersion: TJvID3Version); 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; const AFrameID: TJvID3FrameID): TJvID3DoubleListFrame;
    class function FindOrCreate(AController: TJvID3Controller; const AFrameID: TJvID3FrameID): TJvID3DoubleListFrame;

    procedure AfterConstruction; override;
    procedure BeforeDestruction; override;

    property Names[Index: Integer]: string read GetNameA;
    property NamesW[Index: Integer]: string read GetNameW;
    property Values[Index: Integer]: string read GetValueA;
    property ValuesW[Index: Integer]: string read GetValueW;
  published
    property List: TStrings read GetList write SetList;
    property ListW: TWideStrings read GetListW write SetListW;
  end;

  { COMM - fiComment - Comments

    There may be more than one comment frame in each tag, but only one with
    the same language and content descriptor.

    USLT - fiUnsyncedLyrics - Unsynchronized lyric/text transcription

    There may be more than one 'Unsynchronised lyrics/text transcription' frame
    in each tag, but only one with the same language and content descriptor.
  }

  TJvID3ContentFrame = class(TJvID3Frame)
  private
    FLanguage: string;
    FText: TJvID3StringPair;
    FDescription: TJvID3StringPair;
    procedure SetText(const Value: string);
    procedure SetTextW(const Value: WideString);
    procedure SetLanguage(const Value: string);
    procedure SetDescription(const Value: string);
    procedure SetDescriptionW(const Value: WideString);
  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): TJvID3ContentFrame;
    class function FindOrCreate(AController: TJvID3Controller; const AFrameID: TJvID3FrameID): TJvID3ContentFrame;
  published
    property Language: string read FLanguage write SetLanguage;
    property Description: string read FDescription.SA write SetDescription;
    property DescriptionW: WideString read FDescription.SW write SetDescriptionW;
    property Text: string read FText.SA write SetText;
    property TextW: WideString read FText.SW write SetTextW;
  end;

  { GEOB - fiGeneralObject - General encapsulated object

    There may be more than one "GEOB" frame in each tag, but only one with the
    same content descriptor
  }

  TJvID3GeneralObjFrame = class(TJvID3BinaryFrame)
  private
    FContentDescription: TJvID3StringPair;
    FMIMEType: string;
    FFileName: TJvID3StringPair;
    procedure SetContentDescription(const Value: string);
    procedure SetContentDescriptionW(const Value: WideString);
    procedure SetFileName(const Value: string);
    procedure SetFileNameW(const Value: WideString);
    procedure SetMIMEType(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): TJvID3GeneralObjFrame; overload;
    class function Find(AController: TJvID3Controller; const AContentDescription: string): TJvID3GeneralObjFrame;
      overload;
    class function FindW(AController: TJvID3Controller; const AContentDescription: WideString): TJvID3GeneralObjFrame;
    class function FindOrCreate(AController: TJvID3Controller): TJvID3GeneralObjFrame; overload;
    class function FindOrCreate(AController: TJvID3Controller; const AContentDescription: string):
      TJvID3GeneralObjFrame; overload;
    class function FindOrCreateW(AController: TJvID3Controller; const AContentDescription: WideString):
      TJvID3GeneralObjFrame;
  published
    property MIMEType: string read FMIMEType write SetMIMEType;
    property FileName: string read FFileName.SA write SetFileName;
    property FileNameW: WideString read FFileName.SW write SetFileNameW;
    property ContentDescription: string read FContentDescription.SA write SetContentDescription;
    property ContentDescriptionW: WideString read FContentDescription.SW write SetContentDescriptionW;
  end;

  { POPM - fiPopularimeter - Popularimeter

    There may be more than one "POPM" frame in each tag, but only one with the
    same email address.
  }

  TJvID3PopularimeterFrame = class(TJvID3Frame)
  private
    FRating: Byte;
    FCounter: Cardinal;
    FEMailAddress: string;
    procedure SetCounter(const Value: Cardinal);
    procedure SetEMailAddress(const Value: string);
    procedure SetRating(const Value: Byte);
  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): TJvID3PopularimeterFrame; overload;
    class function Find(AController: TJvID3Controller; const AEmailAddress: string): TJvID3PopularimeterFrame; overload;
    class function FindOrCreate(AController: TJvID3Controller): TJvID3PopularimeterFrame; overload;
    class function FindOrCreate(AController: TJvID3Controller; const AEmailAddress: string): TJvID3PopularimeterFrame; overload;
  published
    property EMailAddress: string read FEMailAddress write SetEMailAddress;
    property Rating: Byte read FRating write SetRating;
    property Counter: Cardinal read FCounter write SetCounter;
  end;

  { PCNT - fiPlayCounter - Play counter

    There may only be one "PCNT" frame in each tag.
  }

  TJvID3PlayCounterFrame = class(TJvID3Frame)
  private
    FCounter: Cardinal;
    procedure SetCounter(const Value: Cardinal);
  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): TJvID3PlayCounterFrame;
    class function FindOrCreate(AController: TJvID3Controller): TJvID3PlayCounterFrame;
  published
    property Counter: Cardinal read FCounter write SetCounter;
  end;

  { AENC - fiAudioCrypto - Audio encryption

    There may be more than one "AENC" frames in a tag, but only one with
    the same 'Owner identifier'.
  }

  TJvID3AudioEncryptionFrame = class(TJvID3BinaryFrame)
  private
    FOwnerID: string;
    FPreviewStart: Word;
    FPreviewLength: Word;
    procedure SetOwnerID(const Value: string);
    procedure SetPreviewLength(const Value: Word);
    procedure SetPreviewStart(const Value: Word);
  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 AOwnerID: string): TJvID3AudioEncryptionFrame;
    class function FindOrCreate(AController: TJvID3Controller; const AOwnerID: string): TJvID3AudioEncryptionFrame;
  published
    property OwnerID: string read FOwnerID write SetOwnerID;
    property PreviewStart: Word read FPreviewStart write SetPreviewStart;
    property PreviewLength: Word read FPreviewLength write SetPreviewLength;

⌨️ 快捷键说明

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