summaryrefslogtreecommitdiff
path: root/p2pvr/ice/p2pvr.ice
blob: 8f746d1f25cc3c63b639167cc0464caf99a92133 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
#ifndef P2PVR_ICE
#define P2PVR_ICE

#include "common.ice"
#include "dvb.ice"
#include "dvbsi.ice"

module P2PVR {
	["project2:type"]
	class Event extends DVBSI::Event {
		int EventUid;
		bool Current = true;
	};
	sequence<Event> Events;

	["project2:type"]
	exception NotFound { };

	// Something that we have recorded.
	["project2:type"]
	class Recording {
		int RecordingId;
		string StorageAddress;
		string Guid;
		int ScheduleId;
		int EventUid;
	};
	sequence<Recording> RecordingList;

	// Something that defines what we would like to record.
	["project2:type"]
	class Schedule {
		int ScheduleId = 0;
		optional(1) int ServiceId;
		optional(2) int EventUid;
		optional(3) string Title;
		optional(4) string Search;
		int Priority = 0;
		Common::Duration Early;
		Common::Duration Late;
		bool Repeats = false;
	};
	sequence<Schedule> ScheduleList;

	enum RecordStatuses {
		WillRecordThisShowing = 0,
		WillRecordOtherShowing = 1,
		CannotRecordAnyShowing = 2
	};

	// Ids for something to record
	["project2:type"]
	class ScheduledToRecord {
		[ "slicer:merge:key" ]
		int EventUid;
		RecordStatuses RecordStatus;
		int ScheduleId;
	};
	sequence<ScheduledToRecord> ScheduledToRecordList;

	interface Maintenance {
		idempotent void UpdateAll();
		idempotent void UpdateNetwork(short type);
		idempotent void UpdateServices();
		idempotent void UpdateEvents();
	};

	["project2:type"]
	exception StorageException {
		string path;
		string message;
	};

	interface Storage {
		idempotent RawDataClient * OpenForWrite(string guid) throws StorageException;
		idempotent void Close(RawDataClient * file) throws StorageException;
		idempotent void Delete(string guid) throws StorageException;
		idempotent long FileSize(string guid) throws StorageException;
		void Send(string guid, RawDataClient * target, long start, long len) throws StorageException;
	};

	interface Recordings {
		idempotent int NewRecording(Recording rec);
		["project2:task"]
		idempotent void DeleteRecording(int recordingId);
		["project2:rows"]
		idempotent RecordingList GetRecordings();
	};

	interface Schedules {
		["project2:task"]
		idempotent void DeleteSchedule(int scheduleId);
		["project2:rows"]
		idempotent Schedule GetSchedule(int scheduleId) throws NotFound;
		["project2:rows"]
		idempotent ScheduleList GetSchedules();
		["project2:rows"]
		idempotent ScheduledToRecordList GetScheduledToRecord();
		idempotent int UpdateSchedule(Schedule newSchedule);
		["project2:task"]
		idempotent void DoReschedule();
	};

	sequence<DVBSI::Delivery> Deliveries;
	sequence<int> IntSequence;
	interface SI {
		// Get networks
		idempotent DVBSI::Networks GetNetworks();
		// Get delivery methods
		idempotent Deliveries GetAllDeliveries();
		idempotent DVBSI::Delivery GetDeliveryForService(int id) throws NotFound;
		idempotent DVBSI::Delivery GetDeliveryForTransport(int id) throws NotFound;
		idempotent DVBSI::Delivery GetDeliveryForSi();
		// Get services
		["project2:rows"]
		idempotent DVBSI::ServiceList GetServices();
		["project2:rows"]
		idempotent DVBSI::Service GetService(int id) throws NotFound;
		// Get events
		idempotent Events GetEvents(IntSequence eventUids) throws NotFound;
		["project2:rows"]
		idempotent Event GetEvent(int serviceId, int eventId) throws NotFound;
		["project2:rows"]
		idempotent Events EventsOnNow();
		["project2:rows"]
		idempotent Events EventsInSchedules();
		["project2:rows"]
		idempotent Events EventsInSchedule(int scheduleId);
		["project2:rows"]
		idempotent Events EventsInRange(Common::DateTime from, Common::DateTime to);
		["project2:rows"]
		idempotent Events EventSearch(optional(1) string keywords, optional(2) int serviceId, optional(3) Common::DateTime from, optional(4) Common::DateTime to);
	};

	interface Recorder {
		["project2:task"]
		idempotent void RefreshSchedules();
	};
};

#endif