83 lines
1.8 KiB
C++
83 lines
1.8 KiB
C++
/***************************************************************************
|
|
|
|
source::worx raDIYo
|
|
Copyright © 2020-2022 c.holzheuer
|
|
chris@sourceworx.org
|
|
|
|
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.
|
|
|
|
***************************************************************************/
|
|
|
|
|
|
#ifndef SWALARMCONTROL_H
|
|
#define SWALARMCONTROL_H
|
|
|
|
|
|
#include <QSettings>
|
|
#include <QTimer>
|
|
#include <swbuttongroup.h>
|
|
|
|
#include <ui_swalarmcontrol.h>
|
|
#include <swdialcontrol.h>
|
|
#include <swurl.h>
|
|
|
|
|
|
/**
|
|
* @brief Das 'Wecker'-Control des RaDIYos.
|
|
*/
|
|
|
|
class SWAlarmControl : public SWDialControl, private Ui_SWAlarmControl
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
explicit SWAlarmControl( QWidget* parent, QSettings* settings );
|
|
virtual ~SWAlarmControl() = default;
|
|
|
|
signals:
|
|
|
|
void playCurrentUrl();
|
|
|
|
public slots:
|
|
|
|
void onShow() override;
|
|
void onHide() override;
|
|
void onWakeUp();
|
|
|
|
void setAlarm();
|
|
|
|
public slots:
|
|
|
|
void onWidgetClicked( SWDialWidget* ) override;
|
|
|
|
protected slots:
|
|
|
|
void onMinuteOverflow( int value );
|
|
void onHourOverflow( int value );
|
|
|
|
protected:
|
|
|
|
const char* SWAlarmOn = "Alarm:";
|
|
const char* SWAlarmOff = "Alarm off";
|
|
const char* SWAlarmOnce = "Only once";
|
|
const char* SWAlarmRepeat = "Repeat Alarm daily";
|
|
const char* SWAlarmWeekdays = "Weekdays only";
|
|
const char* SWAlarmAlldays = "Alldays";
|
|
|
|
static const int SecsPerDay = 86400;
|
|
|
|
bool _alarmEnabled = false;
|
|
bool _alarmRepeat = false;
|
|
bool _alarmWeekdays = false;
|
|
|
|
QTimer _alarmTimer;
|
|
|
|
};
|
|
|
|
#endif // SWALARMCONTROL_H
|