2
* Copyright (C) 2007 Michael Lamothe
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License as published by
6
* the Free Software Foundation; either version 2 of the License, or
7
* (at your option) any later version.
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU Library General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301, USA
19
#ifndef __RECORDING_MANAGER_H__
20
#define __RECORDING_MANAGER_H__
22
#include <glibmm/ustring.h>
26
#include "configuration.h"
27
#include "scheduled_recording.h"
29
class ScheduledRecordingConfigurationSection : public ConfigurationSection
32
ScheduledRecordingConfigurationSection(Configuration& configuration);
33
void save(const ScheduledRecording& scheduled_recording);
34
void remove(const Glib::ustring& description);
35
xmlXPathObjectPtr get_scheduled_recordings();
36
xmlNodePtr get_scheduled_recording(const Glib::ustring& description);
39
class RecordingManager
42
static gboolean is_in(int value, int start, int end);
43
static gboolean is_overlapped(int a, int b, int c, int d);
44
static gboolean check_conflict(const ScheduledRecording& a, const ScheduledRecording& b);
45
gboolean is_scheduled_recording;
46
gboolean is_recording;
47
ScheduledRecordingConfigurationSection* scheduled_recording_configuration_section;
53
void save_scheduled_recording(const ScheduledRecording& scheduled_recording);
54
void remove_scheduled_recording(const Glib::ustring& description);
55
xmlNodePtr get_scheduled_recording(const Glib::ustring& description);
56
xmlXPathObjectPtr get_scheduled_recordings();
58
gboolean get_is_recording() const { return is_recording; }
59
gboolean has_scheduled_recordings();