diff options
Diffstat (limited to 'p2pvr/ice')
-rw-r--r-- | p2pvr/ice/common.ice | 8 | ||||
-rw-r--r-- | p2pvr/ice/commonHelpers.cpp | 2 | ||||
-rw-r--r-- | p2pvr/ice/commonHelpers.h | 12 | ||||
-rw-r--r-- | p2pvr/ice/converters.cpp | 12 | ||||
-rw-r--r-- | p2pvr/ice/dvb.ice | 14 | ||||
-rw-r--r-- | p2pvr/ice/dvbsi.ice | 26 | ||||
-rw-r--r-- | p2pvr/ice/p2pvr.ice | 65 |
7 files changed, 98 insertions, 41 deletions
diff --git a/p2pvr/ice/common.ice b/p2pvr/ice/common.ice index 14ca155..3dc309c 100644 --- a/p2pvr/ice/common.ice +++ b/p2pvr/ice/common.ice @@ -1,7 +1,10 @@ #ifndef COMMON_ICE #define COMMON_ICE +[["cpp:include:boost/date_time/posix_time/posix_time_types.hpp"]] + module Common { + [ "slicer:conversion:boost.posix_time.ptime:ptimeToDateTime:dateTimeToPTime" ] struct DateTime { short Year; short Month; @@ -10,9 +13,10 @@ module Common { short Minute; }; + [ "slicer:conversion:boost.posix_time.time_duration:timedurationToDuration:durationToTimeDuration" ] struct Duration { - short Hour; - short Minute; + short Hours = 0; + short Minutes = 0; }; }; diff --git a/p2pvr/ice/commonHelpers.cpp b/p2pvr/ice/commonHelpers.cpp index 46c7fad..6ad120b 100644 --- a/p2pvr/ice/commonHelpers.cpp +++ b/p2pvr/ice/commonHelpers.cpp @@ -12,7 +12,7 @@ namespace Common { boost::posix_time::time_duration operator*(const Common::Duration & d) { - return boost::posix_time::time_duration(d.Hour, d.Minute, 0); + return boost::posix_time::time_duration(d.Hours, d.Minutes, 0); } } diff --git a/p2pvr/ice/commonHelpers.h b/p2pvr/ice/commonHelpers.h index cc3cac1..3f7e57d 100644 --- a/p2pvr/ice/commonHelpers.h +++ b/p2pvr/ice/commonHelpers.h @@ -18,6 +18,18 @@ namespace Common { << ":" << std::setw(2) << std::setfill('0') << dt.Minute; return o; } + + template<typename C, typename T> + std::basic_ostream<C, T> & + operator<<(std::basic_ostream<C, T> & o, const Common::Duration & d) + { + if (d.Hours) { + o << d.Hours << "hrs "; + } + o << d.Minutes << "min"; + return o; + } + boost::posix_time::ptime operator*(const Common::DateTime &); boost::posix_time::time_duration operator*(const Common::Duration &); } diff --git a/p2pvr/ice/converters.cpp b/p2pvr/ice/converters.cpp index 23861f8..2a6b3c2 100644 --- a/p2pvr/ice/converters.cpp +++ b/p2pvr/ice/converters.cpp @@ -43,5 +43,17 @@ namespace Slicer { { return *c; } + + Common::Duration + timedurationToDuration(const boost::posix_time::time_duration & td) + { + return *td; + } + + boost::posix_time::time_duration + durationToTimeDuration(const Common::Duration & td) + { + return *td; + } } diff --git a/p2pvr/ice/dvb.ice b/p2pvr/ice/dvb.ice index 00ba64b..7565d33 100644 --- a/p2pvr/ice/dvb.ice +++ b/p2pvr/ice/dvb.ice @@ -25,11 +25,11 @@ module P2PVR { idempotent int GetStatus(); idempotent long GetLastUsedTime(); - idempotent void SendNetworkInformation(RawDataClient * client) throws DeviceError; - idempotent void SendBouquetAssociations(RawDataClient * client) throws DeviceError; - idempotent void SendServiceDescriptions(RawDataClient * client) throws DeviceError; - idempotent void SendProgramAssociationTable(RawDataClient * client) throws DeviceError; - idempotent void SendProgramMap(int pid, RawDataClient * client) throws DeviceError; + idempotent void SendNetworkInformation(RawDataClient * client) throws DeviceError, DataHandlingException; + idempotent void SendBouquetAssociations(RawDataClient * client) throws DeviceError, DataHandlingException; + idempotent void SendServiceDescriptions(RawDataClient * client) throws DeviceError, DataHandlingException; + idempotent void SendProgramAssociationTable(RawDataClient * client) throws DeviceError, DataHandlingException; + idempotent void SendProgramMap(int pid, RawDataClient * client) throws DeviceError, DataHandlingException; idempotent void SendEventInformation(RawDataClient * client) throws DeviceError; int StartSendingTS(PacketIds pids, RawDataClient * client); @@ -39,7 +39,7 @@ module P2PVR { interface PrivateTuner extends Tuner { idempotent void TuneTo(DVBSI::Delivery d) throws DeviceError; - idempotent void ScanAndSendNetworkInformation(RawDataClient * client) throws DeviceError; + idempotent void ScanAndSendNetworkInformation(RawDataClient * client) throws DeviceError, DataHandlingException; }; exception NoSuitableDeviceAvailable { }; @@ -48,7 +48,7 @@ module P2PVR { // Get a tuner that is tuned to <del>, acquire and tune to <del> if required. Tuner * GetTunerSpecific(DVBSI::Delivery del); // Get any tuner that is tuned, acquire and tune to <del> if required. - Tuner * GetTunerAny(short type, DVBSI::Delivery del); + Tuner * GetTunerAny(DVBSI::Delivery del); // Get a private tuner, not shared or sharable PrivateTuner * GetPrivateTuner(short type); // Release a tuner when no longer required. diff --git a/p2pvr/ice/dvbsi.ice b/p2pvr/ice/dvbsi.ice index 29e5396..aae3fd2 100644 --- a/p2pvr/ice/dvbsi.ice +++ b/p2pvr/ice/dvbsi.ice @@ -1,8 +1,6 @@ #ifndef DVISI_ICE #define DVISI_ICE -[["cpp:include:boost/date_time/posix_time/posix_time_types.hpp"]] - #include "common.ice" // This attempts to define an ICE representation of domain objects contained @@ -12,6 +10,7 @@ module DVBSI { // Descriptors class Delivery { + [ "slicer:merge:key" ] int TransportStreamId; long Frequency; }; @@ -49,45 +48,60 @@ module DVBSI { }; struct NetworkService { + [ "slicer:merge:key" ] int ServiceId; int TransportStreamId; - short ServiceType; + short Type; }; sequence<NetworkService> NetworkServiceList; class NetworkTransportStream { int NetworkId; + [ "slicer:merge:key" ] int TransportStreamId; int OriginalNetworkId; + [ "slicer:merge:omit" ] SatelliteDelivery Satellite; + [ "slicer:merge:omit" ] CableDelivery Cable; + [ "slicer:merge:omit" ] TerrestrialDelivery Terrestrial; + [ "slicer:merge:omit" ] NetworkServiceList Services; }; sequence<NetworkTransportStream> NetworkTransportStreams; class Network { + [ "slicer:merge:key" ] int NetworkId; optional(1) string Name; + [ "slicer:merge:omit" ] NetworkTransportStreams TransportStreams; }; + sequence<Network> Networks; class BouquetTransportStream { + [ "slicer:merge:key" ] int TransportStreamId; + [ "slicer:merge:key" ] int OriginalNetworkId; }; sequence <BouquetTransportStream> BouquetTransportStreamList; class Bouquet { + [ "slicer:merge:key" ] int BouquetId; optional(1) string Name; optional(2) string DefaultAuthority; + [ "slicer:merge:omit" ] BouquetTransportStreamList Streams; }; ["project2:type"] class Service { + [ "slicer:merge:key" ] int ServiceId; + [ "slicer:merge:key" ] int TransportStreamId; bool EitSchedule; bool EitPresentFollowing; @@ -101,8 +115,10 @@ module DVBSI { sequence<Service> ServiceList; class TransportStream { + [ "slicer:merge:key" ] int TransportStreamId; int OriginalNetworkId; + [ "slicer:merge:omit" ] ServiceList Services; }; @@ -126,16 +142,16 @@ module DVBSI { ["project2:type"] class Event { + [ "slicer:merge:key" ] int ServiceId; + [ "slicer:merge:key" ] int EventId; string Title; string TitleLang; optional(1) string Subtitle; optional(2) string Description; optional(3) string DescriptionLang; - [ "slicer:conversion:boost.posix_time.ptime:ptimeToDateTime:dateTimeToPTime" ] Common::DateTime StartTime; - [ "slicer:conversion:boost.posix_time.ptime:ptimeToDateTime:dateTimeToPTime" ] Common::DateTime StopTime; optional(4) short Episode; optional(5) short Episodes; diff --git a/p2pvr/ice/p2pvr.ice b/p2pvr/ice/p2pvr.ice index eb4ebbf..8f746d1 100644 --- a/p2pvr/ice/p2pvr.ice +++ b/p2pvr/ice/p2pvr.ice @@ -7,6 +7,13 @@ 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. @@ -15,44 +22,47 @@ module P2PVR { int RecordingId; string StorageAddress; string Guid; - optional(1) int ScheduleId; - string Title; - optional(2) string Subtitle; - optional(3) string Description; - Common::DateTime StartTime; - Common::Duration Duration; + int ScheduleId; + int EventUid; }; sequence<Recording> RecordingList; // Something that defines what we would like to record. ["project2:type"] class Schedule { - int ScheduleId; + int ScheduleId = 0; optional(1) int ServiceId; - optional(2) int EventId; + optional(2) int EventUid; optional(3) string Title; optional(4) string Search; - int Priority; + int Priority = 0; Common::Duration Early; Common::Duration Late; - bool Repeats; + 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; - int ServiceId; - int EventId; }; sequence<ScheduledToRecord> ScheduledToRecordList; interface Maintenance { idempotent void UpdateAll(); idempotent void UpdateNetwork(short type); - idempotent void UpdateServices(short type); - idempotent void UpdateEvents(short type); + idempotent void UpdateServices(); + idempotent void UpdateEvents(); }; ["project2:type"] @@ -62,7 +72,6 @@ module P2PVR { }; interface Storage { - idempotent string CreateForEventRecording(string ext, Schedule sc, DVBSI::Service se, DVBSI::Event ev) throws StorageException; idempotent RawDataClient * OpenForWrite(string guid) throws StorageException; idempotent void Close(RawDataClient * file) throws StorageException; idempotent void Delete(string guid) throws StorageException; @@ -77,7 +86,7 @@ module P2PVR { ["project2:rows"] idempotent RecordingList GetRecordings(); }; - + interface Schedules { ["project2:task"] idempotent void DeleteSchedule(int scheduleId); @@ -91,13 +100,16 @@ module P2PVR { ["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(short type); - idempotent DVBSI::Delivery GetDeliveryForService(int id); - idempotent DVBSI::Delivery GetDeliveryForTransport(int id); + 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"] @@ -105,18 +117,19 @@ module P2PVR { ["project2:rows"] idempotent DVBSI::Service GetService(int id) throws NotFound; // Get events + idempotent Events GetEvents(IntSequence eventUids) throws NotFound; ["project2:rows"] - idempotent DVBSI::Event GetEvent(int serviceId, int eventId) throws NotFound; + idempotent Event GetEvent(int serviceId, int eventId) throws NotFound; ["project2:rows"] - idempotent DVBSI::Events EventsOnNow(); + idempotent Events EventsOnNow(); ["project2:rows"] - idempotent DVBSI::Events EventsInSchedules(); + idempotent Events EventsInSchedules(); ["project2:rows"] - idempotent DVBSI::Events EventsInSchedule(int scheduleId); + idempotent Events EventsInSchedule(int scheduleId); ["project2:rows"] - idempotent DVBSI::Events EventsInRange(Common::DateTime from, Common::DateTime to); + idempotent Events EventsInRange(Common::DateTime from, Common::DateTime to); ["project2:rows"] - idempotent DVBSI::Events EventSearch(optional(1) string keywords, optional(2) int serviceId, optional(3) Common::DateTime from, optional(4) Common::DateTime to); + idempotent Events EventSearch(optional(1) string keywords, optional(2) int serviceId, optional(3) Common::DateTime from, optional(4) Common::DateTime to); }; interface Recorder { |