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

cMenuMediaItem::cMenuMediaItem(int i, char *t, int p, int f, char *s)
: id(i)
, title(0)	
, playtime(p)
, fsk(f)	
, slot(0)	
{_
  if(t) title = strdup(t);
  if(s) slot = strdup(s);  
}	

cMenuMediaItem::~cMenuMediaItem()
{_
  SLDEBUG("# destructor of cMenuMediaItem: %s", title);
  if(title) free(title);
  if(slot) free(slot);
}

void cMenuMediaItem::Compile()
{_
  char * tmp;
  
  asprintf(&tmp, "%s\t%d\t%d'\t%s", slot, fsk, playtime, title);
  SetText(tmp, false);  
}
