/*
 * mediatypeitem.c: cMenuMediaTypeItem is a class that holds MediaType data for display
 *
 * See the README file for copyright information and how to reach the author.
 *
 * $Id$
 */
#include "mediatypeitem.h"
#include "tools.h"

cMenuMediaTypeItem::cMenuMediaTypeItem(int i, char *p, int c) 
: id(i)
, name(0)	
, count(c)	
{_
  if(p) name = strdup(p);	
}

cMenuMediaTypeItem::~cMenuMediaTypeItem() 
{_
  SLDEBUG("# destructor of cMenuMediaTypeItem: %s", name);
  if(name) free(name);
}

void cMenuMediaTypeItem::Compile()
{_
  char * tmp;

  asprintf(&tmp, "%s\t%d", name, count);
  SetText(tmp, false);
}

