Exemple #1
0
        protected virtual RecordingStatus?GetRecordingStatus(IProgram program)
        {
            IScheduleControl scheduleControl = _tvHandler.ScheduleControl;

            if (scheduleControl == null)
            {
                return(null);
            }

            RecordingStatus recordingStatus;

            if (scheduleControl.GetRecordingStatus(program, out recordingStatus))
            {
                return(recordingStatus);
            }
            return(null);
        }
Exemple #2
0
        private UPnPError OnGetRecordingStatus(DvAction action, IList <object> inParams, out IList <object> outParams, CallContext context)
        {
            outParams = new List <object>();
            IProgramInfo     programInfo     = ServiceRegistration.Get <ITvProvider>() as IProgramInfo;
            IScheduleControl scheduleControl = ServiceRegistration.Get <ITvProvider>() as IScheduleControl;

            if (programInfo == null || scheduleControl == null)
            {
                return(new UPnPError(500, "IProgramInfo or IScheduleControl service not available"));
            }

            int             programId = (int)inParams[0];
            IProgram        program;
            RecordingStatus recordingStatus = RecordingStatus.None;
            bool            result          = programInfo.GetProgram(programId, out program) && scheduleControl.GetRecordingStatus(program, out recordingStatus);

            outParams = new List <object> {
                result, recordingStatus.ToString()
            };
            return(null);
        }