Exemplo n.º 1
0
ID3_Frame* ID3_AddAlbum(ID3_Tag *tag, const char *text, bool bReplace)
{
  ID3_Frame* pFrame = NULL;
  if (NULL != tag && NULL != text && strlen(text) > 0)
  {
    if (bReplace)
    {
      ID3_RemoveAlbums(tag);
    }
    if (bReplace || tag->Find(ID3FID_ALBUM) == NULL)
    {
      pFrame = new ID3_Frame(ID3FID_ALBUM);
      if (pFrame)
      {
        pFrame->Field(ID3FN_TEXT) = text;
        tag->AttachFrame(pFrame);
      }
    }
  }
  
  return pFrame;
}
Exemplo n.º 2
0
ID3_Frame* ID3_AddAlbum(ID3_Tag *tag, const char *text, bool replace)
{
  ID3_Frame* frame = NULL;
  if (NULL != tag && NULL != text && strlen(text) > 0)
  {
    if (replace)
    {
      ID3_RemoveAlbums(tag);
    }
    if (replace || tag->Find(ID3FID_ALBUM) == NULL)
    {
      frame = new ID3_Frame(ID3FID_ALBUM);
      if (frame)
      {
        frame->GetField(ID3FN_TEXT)->Set(text);
        tag->AttachFrame(frame);
      }
    }
  }

  return frame;
}