/**
 *  beep plugin for the Video Disk Recorder 
 *
 *  menu.c  -  setup menu class
 *
 *  (c) 2004 Andreas Brachold <vdr04 AT deltab de>
 **/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program;                                              *
 *   if not, write to the Free Software Foundation, Inc.,                  *
 *   59 Temple Place, Suite 330, Boston, MA  02111-1307  USA               *
 *                                                                         *
 ***************************************************************************/

#include "menu.h"

cSetupMenuNotifyBeep::cSetupMenuNotifyBeep()
{
  static const char allowed[] = { "abcdefghijklmnopqrstuvwxyz0123456789-_/" };

  newNotifyBeepSetup = NotifyBeepSetup;

  Add(new cMenuEditBoolItem( tr("Setup.Beep$Plugin active"),           &newNotifyBeepSetup.active, tr("no"), tr("yes")));
  Add(new cMenuEditIntItem ( tr("Setup.Beep$Audio frequency [Hz]"),    &newNotifyBeepSetup.freq, NotifyBeepSetup.freq_min,NotifyBeepSetup.freq_max));
  Add(new cMenuEditIntItem ( tr("Setup.Beep$Audio duration [ms]"),     &newNotifyBeepSetup.duration, NotifyBeepSetup.duration_min,NotifyBeepSetup.duration_max));
  Add(new cMenuEditStrItem ( tr("Setup.Beep$Output console"), 		   newNotifyBeepSetup.console, sizeof(newNotifyBeepSetup.console), allowed));
  Add(new cMenuEditBoolItem( tr("Setup.Beep$Beep before shutdown"),    &newNotifyBeepSetup.onshutdown, tr("no"), tr("yes")));
  Add(new cMenuEditBoolItem( tr("Setup.Beep$Beep after cutting process"), &newNotifyBeepSetup.oneditprocess, tr("no"), tr("yes")));
  Add(new cMenuEditBoolItem( tr("Setup.Beep$Beep on any message"),        &newNotifyBeepSetup.onanymessage, tr("no"), tr("yes")));
}

void cSetupMenuNotifyBeep::Store()
{
  NotifyBeepSetup = newNotifyBeepSetup;
  SetupStore("active",        NotifyBeepSetup.active);
  SetupStore("freq",          NotifyBeepSetup.freq);
  SetupStore("duration",      NotifyBeepSetup.duration);
  SetupStore("console",       NotifyBeepSetup.console);
  SetupStore("onshutdown",    NotifyBeepSetup.onshutdown);
  SetupStore("oneditprocess", NotifyBeepSetup.oneditprocess);
  SetupStore("onanymessage",  NotifyBeepSetup.onanymessage);
}
