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

📄 jvqid3v2types.pas

📁 East make Tray Icon in delphi
💻 PAS
📖 第 1 页 / 共 4 页
字号:
    (S: 'sog'; L: 'Sogdian'),
    (S: 'som'; L: 'Somali'),
    (S: 'son'; L: 'Songhai'),
    (S: 'sot'; L: 'Sotho, Southern'),
    (S: 'spa'; L: 'Spanish; Castilian'),
    (S: 'sqi'; L: 'Albanian'), // Also 'alb'
    (S: 'srd'; L: 'Sardinian'),
    (S: 'srp'; L: 'Serbian'), // Also 'scc'
    {400}(S: 'srr'; L: 'Serer'),
    (S: 'ssa'; L: 'Nilo-Saharan (Other)'),
    (S: 'ssw'; L: 'Swati'),
    (S: 'suk'; L: 'Sukuma'),
    (S: 'sun'; L: 'Sundanese'),
    (S: 'sus'; L: 'Susu'),
    (S: 'sux'; L: 'Sumerian'),
    (S: 'swa'; L: 'Swahili'),
    (S: 'swe'; L: 'Swedish'),
    (S: 'syr'; L: 'Syriac'),
    {410}(S: 'tah'; L: 'Tahitian'),
    (S: 'tai'; L: 'Tai (Other)'),
    (S: 'tam'; L: 'Tamil'),
    (S: 'tat'; L: 'Tatar'),
    (S: 'tel'; L: 'Telugu'),
    (S: 'tem'; L: 'Timne'),
    (S: 'ter'; L: 'Tereno'),
    (S: 'tet'; L: 'Tetum'),
    (S: 'tgk'; L: 'Tajik'),
    (S: 'tgl'; L: 'Tagalog'),
    {420}(S: 'tha'; L: 'Thai'),
    (S: 'tib'; L: 'Tibetan'), // Also 'bod'
    (S: 'tig'; L: 'Tigre'),
    (S: 'tir'; L: 'Tigrinya'),
    (S: 'tiv'; L: 'Tiv'),
    (S: 'tkl'; L: 'Tokelau'),
    (S: 'tli'; L: 'Tlingit'),
    (S: 'tmh'; L: 'Tamashek'),
    (S: 'tog'; L: 'Tonga (Nyasa)'),
    (S: 'ton'; L: 'Tonga (Tonga Islands)'),
    {430}(S: 'tpi'; L: 'Tok Pisin'),
    (S: 'tsi'; L: 'Tsimshian'),
    (S: 'tsn'; L: 'Tswana'),
    (S: 'tso'; L: 'Tsonga'),
    (S: 'tuk'; L: 'Turkmen'),
    (S: 'tum'; L: 'Tumbuka'),
    (S: 'tup'; L: 'Tupi languages'),
    (S: 'tur'; L: 'Turkish'),
    (S: 'tut'; L: 'Altaic (Other)'),
    (S: 'tvl'; L: 'Tuvalu'),
    {440}(S: 'twi'; L: 'Twi'),
    (S: 'tyv'; L: 'Tuvinian'),
    (S: 'uga'; L: 'Ugaritic'),
    (S: 'uig'; L: 'Uighur'),
    (S: 'ukr'; L: 'Ukrainian'),
    (S: 'umb'; L: 'Umbundu'),
    (S: 'und'; L: 'Undetermined'),
    (S: 'urd'; L: 'Urdu'),
    (S: 'uzb'; L: 'Uzbek'),
    (S: 'vai'; L: 'Vai'),
    {450}(S: 'ven'; L: 'Venda'),
    (S: 'vie'; L: 'Vietnamese'),
    (S: 'vol'; L: 'Volap黭'),
    (S: 'vot'; L: 'Votic'),
    (S: 'wak'; L: 'Wakashan languages'),
    (S: 'wal'; L: 'Walamo'),
    (S: 'war'; L: 'Waray'),
    (S: 'was'; L: 'Washo'),
    (S: 'wel'; L: 'Welsh'), // Also 'cym'
    (S: 'wen'; L: 'Sorbian languages'),
    {460}(S: 'wln'; L: 'Walloon'),
    (S: 'wol'; L: 'Wolof'),
    (S: 'xho'; L: 'Xhosa'),
    (S: 'yao'; L: 'Yao'),
    (S: 'yap'; L: 'Yapese'),
    (S: 'yid'; L: 'Yiddish'),
    (S: 'yor'; L: 'Yoruba'),
    (S: 'ypk'; L: 'Yupik languages'),
    (S: 'zap'; L: 'Zapotec'),
    (S: 'zen'; L: 'Zenaga'),
    {470}(S: 'zha'; L: 'Zhuang; Chuang'),
    (S: 'zho'; L: 'Chinese'), // Also 'chi'
    (S: 'znd'; L: 'Zande'),
    (S: 'zul'; L: 'Zulu'),
    (S: 'zun'; L: 'Zuni')
    );

  CID3Genres: array[0..147] of PChar = (

    { The following genres are defined in ID3v1 }

    {0}'Blues',
    'Classic Rock',
    'Country',
    'Dance',
    'Disco',
    'Funk',
    'Grunge',
    'Hip-Hop',
    'Jazz',
    'Metal',
    {10}'New Age',
    'Oldies',
    'Other',     { <= Default }
    'Pop',
    'R&B',
    'Rap',
    'Reggae',
    'Rock',
    'Techno',
    'Industrial',
    {20}'Alternative',
    'Ska',
    'Death Metal',
    'Pranks',
    'Soundtrack',
    'Euro-Techno',
    'Ambient',
    'Trip-Hop',
    'Vocal',
    'Jazz+Funk',
    {30}'Fusion',
    'Trance',
    'Classical',
    'Instrumental',
    'Acid',
    'House',
    'Game',
    'Sound Clip',
    'Gospel',
    'Noise',
    {40}'AlternRock',
    'Bass',
    'Soul',
    'Punk',
    'Space',
    'Meditative',
    'Instrumental Pop',
    'Instrumental Rock',
    'Ethnic',
    'Gothic',
    {50}'Darkwave',
    'Techno-Industrial',
    'Electronic',
    'Pop-Folk',
    'Eurodance',
    'Dream',
    'Southern Rock',
    'Comedy',
    'Cult',
    'Gangsta',
    {60}'Top 40',
    'Christian Rap',
    'Pop/Funk',
    'Jungle',
    'Native American',
    'Cabaret',
    'New Wave',
    'Psychedelic', // = 'Psychadelic' in ID3 docs, 'Psychedelic' in winamp.
    'Rave',
    'Showtunes',
    {70}'Trailer',
    'Lo-Fi',
    'Tribal',
    'Acid Punk',
    'Acid Jazz',
    'Polka',
    'Retro',
    'Musical',
    'Rock & Roll',
    'Hard Rock',

    { The following genres are Winamp extensions }

    {80}'Folk',
    'Folk-Rock',
    'National Folk',
    'Swing',
    'Fast Fusion',
    'Bebob',
    'Latin',
    'Revival',
    'Celtic',
    'Bluegrass',
    {90}'Avantgarde',
    'Gothic Rock',
    'Progressive Rock',
    'Psychedelic Rock',
    'Symphonic Rock',
    'Slow Rock',           
    'Big Band',
    'Chorus',
    'Easy Listening',
    'Acoustic',
    {100}'Humour',
    'Speech',
    'Chanson',
    'Opera',
    'Chamber Music',
    'Sonata',
    'Symphony',
    'Booty Bass',
    'Primus',
    'Porn Groove',
    {110}'Satire',
    'Slow Jam',
    'Club',
    'Tango',
    'Samba',
    'Folklore',
    'Ballad',
    'Power Ballad',
    'Rhythmic Soul',
    'Freestyle',
    {120}'Duet',
    'Punk Rock',
    'Drum Solo',
    'A capella', // A Capella
    'Euro-House',
    'Dance Hall',

    { winamp ?? genres }

    'Goa',
    'Drum & Bass',
    'Club-House',
    'Hardcore',
    {130}'Terror',
    'Indie',
    'BritPop',
    'Negerpunk',
    'Polsk Punk',
    'Beat',
    'Christian Gangsta Rap',
    'Heavy Metal',
    'Black Metal',
    'Crossover',
    {140}'Contemporary Christian',
    'Christian Rock',

    { winamp 1.91 genres }

    'Merengue',
    'Salsa',
    'Trash Metal',

    { winamp 1.92 genres }

    'Anime',
    'JPop',
    'SynthPop'
   );

  CGenre_HighV1 = 79;
  CGenre_DefaultID = 12;

var
  GInstance: TJvID3TermFinder = nil;

//=== Local procedures =======================================================

function IndexOfLongString(Strings: TStrings; const ALongText: string): Integer;
{ Searches for a string in Strings that is a prefix of ALongText, this is used
  by the ID3 genres; problem is that some strings may have the same prefix, ie

  Pop
  Pop/Funk
  Pop-Folk

  If we search for a prefix for 'Pop/Funk or something' the binary search
  may return 'Pop', thus we use FindFrom to search some more

  Note:

  'Rock'      => Result = 17
  'Rocks'     => Result = 255 (nothing found)
  'Rock Rock' => Result = 17
}

  function IsPrefix(const S: string): Boolean;
  begin
    Result := (AnsiStrLIComp(PChar(S), PChar(ALongText), Length(S)) = 0);
  end;

  function HasSpaceAfterPrefix(const Prefix: string): Boolean;
  { PRE: IsPrefix(Prefix) = True }
  var
    C: Integer;
  begin
    C := Length(Prefix) - Length(ALongText);
    Result := (C = 0) or ((C < 0) and (ALongText[Length(Prefix) + 1] = ' '));
  end;

  function FindFrom(const Index: Integer): Integer;
  begin
    { Try to find I with IsPrefix(Strings[I]) and HasSpaceAfterPrefix(Strings[i]) }

    if Length(Strings[Index]) < Length(ALongText) then
    begin
      { Now is valid: IsPrefix(Strings[Result]) }

      Result := Index + 1;

      { Strings is sorted thus it's only usefull to look at higher indexes than
        Index ie only at higher indexes are possibly longer prefixes of ALongText }
      while (Result < Strings.Count) and IsPrefix(Strings[Result]) do
        Inc(Result);

      { Strings[Result] is not ok, Strings[Result-1] is ok }
      Dec(Result);

      { Now is valid: IsPrefix(Strings[Result]) }
    end
    else
    if Length(ALongText) < Length(Strings[Index]) then
    begin
      Result := Index - 1;

      while (Result >= 0) and (Length(Strings[Result]) > Length(ALongText)) do
        if AnsiStrLIComp(PChar(Strings[Result]), PChar(ALongText), Length(ALongText)) = 0 then
          Dec(Result)
        else
        begin
          { Not found }
          Result := -1;
          Exit;
        end;

      if (Result < 0) or not IsPrefix(Strings[Result]) then
      begin
        { Not found }
        Result := -1;
        Exit;
      end;

      { Now is valid: IsPrefix(Strings[Result]) }
    end
    else
    begin
      { Found }
      Result := Index;
      Exit;
    end;

    { Now is valid: IsPrefix(Strings[Result]) }

    if HasSpaceAfterPrefix(Strings[Result]) then
      { Found }
      Exit;

    Dec(Result);

    { Now go down until we find a string X with X + some separator is a prefix
      of ALongText }
    while Result >= 0 do
      if IsPrefix(Strings[Result]) then
      begin
        if HasSpaceAfterPrefix(Strings[Result]) then
          { Found }
          Exit
        else
          Dec(Result);
      end
      else
      begin
        { Not found }
        Result := -1;
        Exit;
      end;
  end;
var
  Top, Mid, C: Integer;
begin
  Result := 0;
  Top := Strings.Count - 1;
  while Result <= Top do
  begin
    Mid := (Result + Top) shr 1;
    C := AnsiStrLIComp(PChar(Strings[Mid]), PChar(ALongText),
      Min(Length(Strings[Mid]), Length(ALongText)));
    if C < 0 then
      Result := Mid + 1
    else
    if C = 0 then
    begin
      Result := FindFrom(Mid);
      Exit;
    end
    else { C > 0 }
      Top := Mid - 1;
  end;

  { Nothing found }
  Result := -1;
end;

//=== Global procedures ======================================================

function ID3_FrameIDToString(const ID: TJvID3FrameID; const Size: Integer): string;
begin
  case Size of
    3:
      Result := CID3FrameDefs[ID].ShortTextID;
    4:
      Result := CID3FrameDefs[ID].LongTextID;
  else

⌨️ 快捷键说明

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