bool Dvr::AddDontRecordSchedule(int nChanId, const QDateTime &dStartTime, bool bNeverRecord) { bool bResult = true; if (nChanId <= 0 || !dStartTime.isValid()) throw QString("Program does not exist."); ProgramInfo *pi = LoadProgramFromProgram(nChanId, dStartTime.toUTC()); if (!pi) throw QString("Program does not exist."); // Why RecordingInfo instead of ProgramInfo? Good question ... RecordingInfo recInfo = RecordingInfo(*pi); delete pi; if (bNeverRecord) { recInfo.ApplyNeverRecord(); } else recInfo.ApplyRecordStateChange(kDontRecord); return bResult; }
DTC::Program* Guide::GetProgramDetails( int nChanId, const QDateTime &rawStartTime ) { if (!(nChanId > 0)) throw( "Channel ID is invalid" ); if (!rawStartTime.isValid()) throw( "StartTime is invalid" ); QDateTime dtStartTime = rawStartTime.toUTC(); // ---------------------------------------------------------------------- // -=>TODO: Add support for getting Recorded Program Info // ---------------------------------------------------------------------- // Build Response DTC::Program *pProgram = new DTC::Program(); ProgramInfo *pInfo = LoadProgramFromProgram(nChanId, dtStartTime); FillProgramInfo( pProgram, pInfo, true, true, true ); delete pInfo; return pProgram; }