/*
 * castitem.c: cMenuCastItem is a class that holds a cast of a media for display
 *
 * See the README file for copyright information and how to reach the author.
 *
 * $Id$
 */
#include "castitem.h"
#include "tools.h"

cMenuCastItem::cMenuCastItem(char *r, char *fn, char *n) 
: role(0)
, fname(0)
, name(0)	
{_
  if(r) role = strdup(r);	
  if(fn) fname = strdup(fn);	
  if(n) name = strdup(n);	
}

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

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

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