~ubuntu-branches/ubuntu/karmic/me-tv/karmic

« back to all changes in this revision

Viewing changes to src/recording_manager.h

  • Committer: Bazaar Package Importer
  • Author(s): Michael Lamothe
  • Date: 2007-12-19 23:30:16 UTC
  • Revision ID: james.westby@ubuntu.com-20071219233016-2ng2clfh00xtlevc
Tags: upstream-0.4.19
ImportĀ upstreamĀ versionĀ 0.4.19

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (C) 2007 Michael Lamothe
 
3
 *
 
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.
 
8
 * 
 
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.
 
13
 * 
 
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
 
17
 */
 
18
 
 
19
#ifndef __RECORDING_MANAGER_H__
 
20
#define __RECORDING_MANAGER_H__
 
21
 
 
22
#include <glibmm/ustring.h>
 
23
#include "xml.h"
 
24
#include "channel.h"
 
25
#include "epg.h"
 
26
#include "configuration.h"
 
27
#include "scheduled_recording.h"
 
28
 
 
29
class ScheduledRecordingConfigurationSection : public ConfigurationSection
 
30
{
 
31
public:
 
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);
 
37
};
 
38
 
 
39
class RecordingManager
 
40
{
 
41
private:
 
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;
 
48
                
 
49
public:
 
50
        RecordingManager();
 
51
        
 
52
        void check();
 
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();
 
57
        
 
58
        gboolean get_is_recording() const { return is_recording; }
 
59
        gboolean has_scheduled_recordings();
 
60
};
 
61
 
 
62
#endif