コード例 #1
0
ファイル: misc_support.cpp プロジェクト: Daij-Djan/DDID3
ID3_Frame* ID3_AddLyrics(ID3_Tag *tag, const char *text, const char* desc,
                         const char* lang, bool replace)
{
  ID3_Frame* frame = NULL;
  if (NULL != tag && strlen(text) > 0)
  {
    if (replace)
    {
      ID3_RemoveLyrics(tag);
    }
    if (replace || tag->Find(ID3FID_UNSYNCEDLYRICS) == NULL)
    {
      frame = new ID3_Frame(ID3FID_UNSYNCEDLYRICS);
      if (NULL != frame)
      {
        frame->GetField(ID3FN_LANGUAGE)->Set(lang);
        frame->GetField(ID3FN_DESCRIPTION)->Set(desc);
        frame->GetField(ID3FN_TEXT)->Set(text);
        tag->AttachFrame(frame);
      }
    }
  }

  return frame;
}
コード例 #2
0
ファイル: misc_support.cpp プロジェクト: cmjonze/faad
ID3_Frame* ID3_AddLyrics(ID3_Tag *tag, const char *text, bool bReplace)
{
  ID3_Frame* pFrame = NULL;
  if (NULL != tag && strlen(text) > 0)
  {
    if (bReplace)
    {
      ID3_RemoveLyrics(tag);
    }
    if (bReplace || tag->Find(ID3FID_UNSYNCEDLYRICS) == NULL)
    {
      pFrame = new ID3_Frame(ID3FID_UNSYNCEDLYRICS);
      if (NULL != pFrame)
      {
        pFrame->Field(ID3FN_LANGUAGE) = "eng";
        pFrame->Field(ID3FN_TEXT) = text;
        tag->AttachFrame(pFrame);
      }
    }
  }
  
  return pFrame;
}