| 1 |
/* |
| 2 |
* Copyright (C) 2005-2021 Team Kodi (https://kodi.tv) |
| 3 |
* Copyright (C) 2013 Marcel Groothuis |
| 4 |
* |
| 5 |
* SPDX-License-Identifier: GPL-2.0-or-later |
| 6 |
* See LICENSE.md for more information. |
| 7 |
*/ |
| 8 |
|
| 9 |
#pragma once |
| 10 |
|
| 11 |
#include "timers.h" |
| 12 |
|
| 13 |
#include <kodi/addon-instance/pvr/Timers.h> |
| 14 |
#include <kodi/gui/Window.h> |
| 15 |
#include <kodi/gui/controls/Spin.h> |
| 16 |
|
| 17 |
class CGUIDialogRecordSettings : public kodi::gui::CWindow |
| 18 |
{ |
| 19 |
public: |
| 20 |
CGUIDialogRecordSettings(const kodi::addon::PVRTimer& timerinfo, cTimer& timer, const std::string& channelName); |
| 21 |
virtual ~CGUIDialogRecordSettings() = default; |
| 22 |
|
| 23 |
bool Show(); |
| 24 |
void Close(); |
| 25 |
int DoModal(); // returns -1 => load failed, 0 => cancel, 1 => ok |
| 26 |
|
| 27 |
private: |
| 28 |
int m_retVal; // -1 => load failed, 0 => cancel, 1 => ok |
| 29 |
|
| 30 |
bool OnClick(int controlId) override; |
| 31 |
bool OnFocus(int controlId) override; |
| 32 |
bool OnInit() override; |
| 33 |
bool OnAction(ADDON_ACTION actionId) override; |
| 34 |
|
| 35 |
// Specific for this dialog: |
| 36 |
std::shared_ptr<kodi::gui::controls::CSpin> m_spinFrequency; |
| 37 |
std::shared_ptr<kodi::gui::controls::CSpin> m_spinAirtime; |
| 38 |
std::shared_ptr<kodi::gui::controls::CSpin> m_spinChannels; |
| 39 |
std::shared_ptr<kodi::gui::controls::CSpin> m_spinKeep; |
| 40 |
std::shared_ptr<kodi::gui::controls::CSpin> m_spinPreRecord; |
| 41 |
std::shared_ptr<kodi::gui::controls::CSpin> m_spinPostRecord; |
| 42 |
|
| 43 |
void UpdateTimerSettings(void); |
| 44 |
|
| 45 |
/* Enumerated types corresponding with the spincontrol values */ |
| 46 |
enum RecordingFrequency |
| 47 |
{ |
| 48 |
Once = 0, |
| 49 |
Daily = 1, |
| 50 |
Weekly = 2, |
| 51 |
Weekends = 3, |
| 52 |
WeekDays = 4 |
| 53 |
}; |
| 54 |
|
| 55 |
enum RecordingAirtime |
| 56 |
{ |
| 57 |
ThisTime = 0, |
| 58 |
AnyTime = 1 |
| 59 |
}; |
| 60 |
|
| 61 |
enum RecordingChannels |
| 62 |
{ |
| 63 |
ThisChannel = 0, |
| 64 |
AnyChannel = 1 |
| 65 |
}; |
| 66 |
|
| 67 |
/* Private members */ |
| 68 |
std::string m_channel; |
| 69 |
std::string m_startTime; |
| 70 |
std::string m_startDate; |
| 71 |
std::string m_endTime; |
| 72 |
std::string m_title; |
| 73 |
|
| 74 |
RecordingFrequency m_frequency; |
| 75 |
RecordingAirtime m_airtime; |
| 76 |
RecordingChannels m_channels; |
| 77 |
|
| 78 |
const kodi::addon::PVRTimer& m_timerinfo; |
| 79 |
cTimer& m_timer; |
| 80 |
}; |
| 81 |
|