Sophie

Sophie

distrib > Mandriva > 8.2 > i586 > media > contrib > by-pkgid > 2c9d30f3cf217a6cae41860ebc0d6704 > files > 236

libid3lib3.8_0-devel-3.8.0-0.pre2.1.1mdk.i586.rpm

#ifdef HAVE_CONFIG_H
#  include <config.h>
#endif

#include <iostream.h>
#include <id3/tag.h>
#include <id3/misc_support.h>

int main(unsigned argc, char* argv[])
{
  ID3D_INIT_DOUT();
  ID3D_INIT_WARNING();
  ID3D_INIT_NOTICE();

  if (argc != 2)
  {
    cout << "Usage: findstr <tagfile>" << endl;
    exit(1);
  }
  ID3_Tag tag(argv[1]);
  ID3_Frame* first = NULL, *frame = NULL;
  while(NULL != (frame = tag.Find(ID3FID_COMMENT, ID3FN_DESCRIPTION, "")))
  {
    if (frame == first)
    {
      break;
    }
    if (first == NULL)
    {
      first = frame;
    }
    char* comment = ID3_GetString(frame, ID3FN_TEXT);
    cout << "*** Found comment w/o description: " << comment << endl;
    delete [] comment;
  }
  return 0;
}