/*
 * (c) 2005 Research Group Dr. Fuhrmann, University of Karlsruhe, Germany
 * All rights reserved.
 *
 * Author:
 *         Roman Krenicky
 *
 * $Id: osdmenu_dvdrepg.cpp,v 1.5 2005/11/23 17:51:35 kutzner Exp $
 *
 */

/*
  osdmenu_dvdrepg.cpp
  created: 11.6.2005
  last change: 12.6.2005
*/
/*! @file
    an OSD menu for the plugin
*/


#include "globalheader.h"

#include <interface.h>
#include "osdmenu_dvdrepg.h"


/*! @brief just a contructor
    @param init_central  the controller, internal requests (i.e. some sort of
                         notifications) are sent to
*/
cOsdMenuIgorepg::cOsdMenuIgorepg (controller &init_central)
      :  cOsdMenu(""), central(init_central)
{
   Set();
} // cOsdMenuIgorepg()


/*! @brief initialises the menu
*/
void cOsdMenuIgorepg::Set (void)
{
   Clear();
   SetTitle ("EPG-IGOR interactions");
   Add (new cOsdItem("scan for EPG data", osUser1));
   Add (new cOsdItem("reconnect", osUser2));
} // Set()


/*! @brief reactions on the user's key hits
*/
eOSState cOsdMenuIgorepg::ProcessKey (eKeys Key)
{
   eOSState state = cOsdMenu::ProcessKey(Key);

   switch (state)
   {
      case osUser1:
         central.controller_request (controller::ir_scan);
         Interface->Confirm("triggered scan", 1);
         return osContinue;
      case osUser2:
         central.controller_request (controller::ir_reconnect);
         Interface->Confirm("triggered reconnection", 1);
         return osContinue;
      default:
         return state;
   } // switch (state)

   return state;
} // ProcessKey (...)
