/*
 * menu.c: class for osd-menu display
 *
 * See the README file for copyright information and how to reach the author.
 *
 * $Id$
 */
#include "menu.h"
#include "menuitems.h"
#include "tools.h"

cXmsMenu::cXmsMenu(void)
: cOsdMenu("")
, menu(cMenuData::xmsMain)
{_
  AddSubMenu(new cOsdGenreList(menu)); 
}

cXmsMenu::~cXmsMenu()
{_
  SLDEBUG("# destructor of cXmsMenu");
}

eOSState cXmsMenu::ProcessKey(eKeys Key)
{
  eOSState state = cOsdMenu::ProcessKey(Key);
  if(Key != kNone) {_
 	  menu.DumpKey(Key);
     if(menu.Active() == cMenuData::xmsCategory && Key == kOk) {
		  SLDEBUG("category may have changed, rebuild genre list.");
		  AddSubMenu(new cOsdGenreList(menu)); 
	     }
	  else if(menu.Active() == cMenuData::xmsMain && Key == kBack) {
		  state = osBack;
	     }
     }
  return state;
}
  
