本文整理汇总了C#中TvDatabase.Schedule.ReferencedChannel方法的典型用法代码示例。如果您正苦于以下问题:C# Schedule.ReferencedChannel方法的具体用法?C# Schedule.ReferencedChannel怎么用?C# Schedule.ReferencedChannel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TvDatabase.Schedule
的用法示例。
在下文中一共展示了Schedule.ReferencedChannel方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UpdateCurrentProgramTitle
private static void UpdateCurrentProgramTitle(ref Schedule recNew)
{
TvBusinessLayer layer = new TvBusinessLayer();
IList<Program> programs = layer.GetPrograms(recNew.ReferencedChannel(), recNew.StartTime, recNew.EndTime);
if (programs != null && programs.Count > 0)
{
recNew.ProgramName = programs[0].Title;
}
}
示例2: GetRecordingTimes
public List<Schedule> GetRecordingTimes(Schedule rec, int days)
{
TvBusinessLayer layer = new TvBusinessLayer();
List<Schedule> recordings = new List<Schedule>();
DateTime dtDay = DateTime.Now;
if (rec.ScheduleType == (int)ScheduleRecordingType.Once)
{
recordings.Add(rec);
return recordings;
}
if (rec.ScheduleType == (int)ScheduleRecordingType.Daily)
{
for (int i = 0; i < days; ++i)
{
Schedule recNew = rec.Clone();
recNew.ScheduleType = (int)ScheduleRecordingType.Once;
recNew.StartTime = new DateTime(dtDay.Year, dtDay.Month, dtDay.Day, rec.StartTime.Hour, rec.StartTime.Minute,
0);
if (rec.EndTime.Day > rec.StartTime.Day)
{
dtDay = dtDay.AddDays(1);
}
recNew.EndTime = new DateTime(dtDay.Year, dtDay.Month, dtDay.Day, rec.EndTime.Hour, rec.EndTime.Minute, 0);
if (rec.EndTime.Day > rec.StartTime.Day)
{
dtDay = dtDay.AddDays(-1);
}
recNew.Series = true;
if (recNew.StartTime >= DateTime.Now)
{
if (rec.IsSerieIsCanceled(recNew.StartTime))
{
recNew.Canceled = recNew.StartTime;
}
recordings.Add(recNew);
}
dtDay = dtDay.AddDays(1);
}
return recordings;
}
if (rec.ScheduleType == (int)ScheduleRecordingType.WorkingDays)
{
for (int i = 0; i < days; ++i)
{
if (WeekEndTool.IsWorkingDay(dtDay.DayOfWeek))
{
Schedule recNew = rec.Clone();
recNew.ScheduleType = (int)ScheduleRecordingType.Once;
recNew.StartTime = new DateTime(dtDay.Year, dtDay.Month, dtDay.Day, rec.StartTime.Hour, rec.StartTime.Minute,
0);
if (rec.EndTime.Day > rec.StartTime.Day)
{
dtDay = dtDay.AddDays(1);
}
recNew.EndTime = new DateTime(dtDay.Year, dtDay.Month, dtDay.Day, rec.EndTime.Hour, rec.EndTime.Minute, 0);
if (rec.EndTime.Day > rec.StartTime.Day)
{
dtDay = dtDay.AddDays(-1);
}
recNew.Series = true;
if (rec.IsSerieIsCanceled(recNew.StartTime))
{
recNew.Canceled = recNew.StartTime;
}
if (recNew.StartTime >= DateTime.Now)
{
recordings.Add(recNew);
}
}
dtDay = dtDay.AddDays(1);
}
return recordings;
}
if (rec.ScheduleType == (int)ScheduleRecordingType.Weekends)
{
IList<Program> progList = layer.SearchMinimalPrograms(dtDay, dtDay.AddDays(days), rec.ProgramName,
rec.ReferencedChannel());
foreach (Program prog in progList)
{
if ((rec.IsRecordingProgram(prog, false)) &&
(WeekEndTool.IsWeekend(prog.StartTime.DayOfWeek)))
{
Schedule recNew = rec.Clone();
recNew.ScheduleType = (int)ScheduleRecordingType.Once;
recNew.StartTime = prog.StartTime;
recNew.EndTime = prog.EndTime;
recNew.Series = true;
if (rec.IsSerieIsCanceled(recNew.StartTime))
{
recNew.Canceled = recNew.StartTime;
}
recordings.Add(recNew);
}
}
//.........这里部分代码省略.........
示例3: isSameTransponder
/// <summary>
/// checks if 2 schedules have a common Transponder
/// depending on tuningdetails of their respective channels
/// </summary>
/// <param name="schedule"></param>
/// <returns>True if a common transponder exists</returns>
public bool isSameTransponder(Schedule schedule)
{
IList<TuningDetail> tuningList1 = ReferencedChannel().ReferringTuningDetail();
IList<TuningDetail> tuningList2 = schedule.ReferencedChannel().ReferringTuningDetail();
foreach (TuningDetail tun1 in tuningList1)
{
foreach (TuningDetail tun2 in tuningList2)
{
if (tun1.Frequency == tun2.Frequency)
{
return true;
}
}
}
return false;
}
示例4: GetProgramsForSchedule
public static IList<Program> GetProgramsForSchedule(Schedule schedule)
{
IList<Program> progs = null;
switch (schedule.scheduleType)
{
case (int)ScheduleRecordingType.Once:
var prgOnce = Program.RetrieveOnce(schedule.programName, schedule.startTime, schedule.endTime,
schedule.ReferencedChannel().IdChannel);
progs = new List<Program>();
if (prgOnce != null)
{
progs.Add(prgOnce);
}
break;
case (int)ScheduleRecordingType.Daily:
progs = Program.RetrieveDaily(schedule.startTime, schedule.endTime,schedule.ReferencedChannel().IdChannel);
break;
case (int)ScheduleRecordingType.EveryTimeOnEveryChannel:
progs = Program.RetrieveEveryTimeOnEveryChannel(schedule.programName);
break;
case (int)ScheduleRecordingType.EveryTimeOnThisChannel:
progs = Program.RetrieveEveryTimeOnThisChannel(schedule.programName, schedule.ReferencedChannel().IdChannel);
break;
case (int)ScheduleRecordingType.WeeklyEveryTimeOnThisChannel:
progs = Program.RetrieveWeeklyEveryTimeOnThisChannel(schedule.startTime, schedule.endTime, schedule.programName, schedule.ReferencedChannel().IdChannel);
break;
case (int)ScheduleRecordingType.Weekends:
progs = Program.RetrieveWeekends(schedule.startTime, schedule.endTime, schedule.ReferencedChannel().IdChannel);
break;
case (int)ScheduleRecordingType.Weekly:
progs = Program.RetrieveWeekly(schedule.startTime, schedule.endTime, schedule.ReferencedChannel().IdChannel);
break;
case (int)ScheduleRecordingType.WorkingDays:
progs = Program.RetrieveWorkingDays(schedule.startTime, schedule.endTime, schedule.ReferencedChannel().IdChannel);
break;
}
return progs;
}
示例5: OnQuickRecord
private void OnQuickRecord()
{
GUIDialogMenu dlg = (GUIDialogMenu)GUIWindowManager.GetWindow((int)Window.WINDOW_DIALOG_MENU);
if (dlg == null)
{
return;
}
dlg.Reset();
dlg.SetHeading(GUILocalizeStrings.Get(891)); //Select TV Channel
IList<GroupMap> channels = TVHome.Navigator.CurrentGroup.ReferringGroupMap();
foreach (GroupMap chan in channels)
{
GUIListItem item = new GUIListItem(chan.ReferencedChannel().DisplayName);
string strLogo = Utils.GetCoverArt(Thumbs.TVChannel, chan.ReferencedChannel().DisplayName);
if (string.IsNullOrEmpty(strLogo))
{
strLogo = "defaultVideoBig.png";
}
item.ThumbnailImage = strLogo;
item.IconImageBig = strLogo;
item.IconImage = strLogo;
dlg.Add(item);
}
dlg.DoModal(GetID);
if (dlg.SelectedLabel < 0)
{
return;
}
Channel selectedChannel = (channels[dlg.SelectedLabel]).ReferencedChannel();
dlg.Reset();
dlg.SetHeading(616); //select recording type
for (int i = 611; i <= 615; ++i)
{
dlg.Add(GUILocalizeStrings.Get(i));
}
dlg.Add(GUILocalizeStrings.Get(WeekEndTool.GetText(DayType.Record_WorkingDays)));
dlg.Add(GUILocalizeStrings.Get(WeekEndTool.GetText(DayType.Record_WeekendDays)));
Schedule rec = new Schedule(selectedChannel.IdChannel, "", Schedule.MinSchedule, Schedule.MinSchedule);
TvBusinessLayer layer = new TvBusinessLayer();
rec.PreRecordInterval = Int32.Parse(layer.GetSetting("preRecordInterval", "5").Value);
rec.PostRecordInterval = Int32.Parse(layer.GetSetting("postRecordInterval", "5").Value);
rec.ScheduleType = (int)ScheduleRecordingType.Once;
DateTime dtNow = DateTime.Now;
int day;
day = 0;
dlg.Reset();
dlg.SetHeading(142); //select time
dlg.ShowQuickNumbers = false;
//time
//int no = 0;
int hour, minute, steps;
steps = 15;
dlg.Add("00:00");
for (hour = 0; hour <= 23; hour++)
{
for (minute = 0; minute < 60; minute += steps)
{
if (hour == 0 && minute == 0)
{
continue;
}
string time;
if (hour < 10)
{
time = "0" + hour;
}
else
{
time = hour.ToString();
}
time += ":";
if (minute < 10)
{
time = time + "0" + minute;
}
else
{
time += minute.ToString();
}
//if (hour < 1) time = String.Format("{0} {1}", minute, GUILocalizeStrings.Get(3004));
dlg.Add(time);
}
}
// pre-select the current time
dlg.SelectedLabel = (DateTime.Now.Hour * (60 / steps)) + (Convert.ToInt16(DateTime.Now.Minute / steps));
dlg.DoModal(GetID);
if (dlg.SelectedLabel == -1)
{
return;
}
int mins = (dlg.SelectedLabel) * steps;
hour = (mins) / 60;
minute = ((mins) % 60);
//.........这里部分代码省略.........
示例6: TsCopier
private void TsCopier(object itemlist, Recording rec, Schedule newSchedule)
{
string[] bufferListObject;
bufferListObject = new string[3];
List<string[]> _itemlist = (List<string[]>)itemlist;
bool foundHeader = false;
bufferListObject = _itemlist[0];
string targetTs = Path.GetDirectoryName(bufferListObject[2]) + "\\" + Path.GetFileNameWithoutExtension(bufferListObject[2]) + "_buffer.ts";
try
{
Log.Info("TsCopier: targetTs {0}", targetTs);
using (FileStream writer = new FileStream(targetTs, FileMode.CreateNew, FileAccess.Write))
{
for (int i = 0; i < _itemlist.Count; i++)
{
bufferListObject = _itemlist[i];
try
{
if (File.Exists(bufferListObject[0]))
{
using (FileStream reader = new FileStream(bufferListObject[0], FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
{
Log.Info("TsCopier: TSfilename {0}", bufferListObject[0]);
Log.Debug("TsCopier: TSfilename filesize {0}", bufferListObject[1]);
if (!foundHeader)
{
byte[] prebuf = new byte[1024 * 1024];
int bytesPreRead;
bytesPreRead = reader.Read(prebuf, 0, 1024 * 1024);
long position = 0;
// find TS packet header
while (bytesPreRead > 0 && !foundHeader)
{
for (int x = 0; x < 1024 * 1024 - 376; x++)
{
if (prebuf[x] == 0x47 && prebuf[x + 188] == 0x47 && prebuf[x + 376] == 0x47)
{
Log.Debug("TsCopier: TS packet header found at {0} pos in {1}.", x, bufferListObject[0]);
position = x;
foundHeader = true;
break;
}
}
bytesPreRead = reader.Read(prebuf, 0, 1024 * 1024);
}
reader.Position = position;
if (!foundHeader)
{
Log.Debug("TsCopier: TS packet header not found in {0}.", bufferListObject[0]);
break;
}
}
byte[] buf = new byte[1024 * 1024];
int bytesRead = reader.Read(buf, 0, 1024 * 1024);
while (bytesRead > 0)
{
if (reader.Position > Convert.ToInt64(bufferListObject[1]))
bytesRead -= (int)(reader.Position - Convert.ToInt64(bufferListObject[1]));
if (bytesRead <= 0)
break;
writer.Write(buf, 0, bytesRead);
bytesRead = reader.Read(buf, 0, 1024 * 1024);
Thread.Sleep(100);
}
reader.Close();
}
}
}
catch (Exception ex)
{
Log.Error("TsCopier exception: {0}", ex);
}
}
writer.Flush();
writer.Close();
Log.Info("TsCopier: Done {0}", targetTs);
}
}
catch (Exception ex)
{
Log.Error("TsCopier Exception: {0}", ex);
}
try
{
Log.Debug("TsCopier: Creating Recording entry for {0}", targetTs);
RecordingDetail recDetail = new RecordingDetail(newSchedule, newSchedule.ReferencedChannel(), DateTime.Now, false);
recDetail.Recording = new Recording(recDetail.Schedule.IdChannel, recDetail.Schedule.IdSchedule, false,
//.........这里部分代码省略.........
示例7: Schedule2ListItem
private GUIListItem Schedule2ListItem(Schedule schedule)
{
GUIListItem item = new GUIListItem();
if (schedule == null)
{
return item;
}
item.Label = schedule.ProgramName;
item.TVTag = schedule;
string strLogo = Utils.GetCoverArt(Thumbs.TVChannel, schedule.ReferencedChannel().DisplayName);
if (string.IsNullOrEmpty(strLogo))
{
strLogo = "defaultVideoBig.png";
}
item.PinImage = Thumbs.TvConflictRecordingIcon;
item.ThumbnailImage = strLogo;
item.IconImageBig = strLogo;
item.IconImage = strLogo;
return item;
}
示例8: isSameTransponder
/// <summary>
/// checks if 2 schedules have a common Transponder
/// depending on tuningdetails of their respective channels
/// </summary>
/// <param name="schedule"></param>
/// <returns>True if a common transponder exists</returns>
public bool isSameTransponder(Schedule schedule1, Schedule schedule2)
{
IList<TuningDetail> tuningDetailList1 = schedule1.ReferencedChannel().ReferringTuningDetail();
IList<TuningDetail> tuningDetailList2 = schedule2.ReferencedChannel().ReferringTuningDetail();
foreach (TuningDetail td1 in tuningDetailList1)
{
IChannel c1 = GetTuningChannel(td1);
foreach (TuningDetail td2 in tuningDetailList2)
{
if (!c1.IsDifferentTransponder(GetTuningChannel(td2)))
{
return true;
}
}
}
return false;
}
示例9: SetProperties
public void SetProperties(Schedule schedule, Program prog)
{
GUIPropertyManager.SetProperty("#TV.Scheduled.Title", String.Empty);
GUIPropertyManager.SetProperty("#TV.Scheduled.Genre", String.Empty);
GUIPropertyManager.SetProperty("#TV.Scheduled.Time", String.Empty);
GUIPropertyManager.SetProperty("#TV.Scheduled.Description", String.Empty);
GUIPropertyManager.SetProperty("#TV.Scheduled.thumb", String.Empty);
GUIPropertyManager.SetProperty("#TV.Scheduled.Channel", String.Empty);
string strTime = String.Format("{0} {1} - {2}",
Utils.GetShortDayString(schedule.StartTime),
schedule.StartTime.ToString("t", CultureInfo.CurrentCulture.DateTimeFormat),
schedule.EndTime.ToString("t", CultureInfo.CurrentCulture.DateTimeFormat));
GUIPropertyManager.SetProperty("#TV.Scheduled.Title", prog.Title);
GUIPropertyManager.SetProperty("#TV.Scheduled.Time", strTime);
if (prog != null)
{
GUIPropertyManager.SetProperty("#TV.Scheduled.Channel", prog.ReferencedChannel().DisplayName);
GUIPropertyManager.SetProperty("#TV.Scheduled.Description", prog.Description);
GUIPropertyManager.SetProperty("#TV.Scheduled.Genre", prog.Genre);
}
else
{
GUIPropertyManager.SetProperty("#TV.Scheduled.Description", String.Empty);
GUIPropertyManager.SetProperty("#TV.Scheduled.Genre", String.Empty);
}
string logo = Utils.GetCoverArt(Thumbs.TVChannel, schedule.ReferencedChannel().DisplayName);
if (string.IsNullOrEmpty(logo))
{
GUIPropertyManager.SetProperty("#TV.Scheduled.thumb", "defaultVideoBig.png");
}
else
{
GUIPropertyManager.SetProperty("#TV.Scheduled.thumb", logo);
}
}
示例10: UpdateDescription
private void UpdateDescription()
{
TvBusinessLayer layer = new TvBusinessLayer();
Schedule rec = new Schedule(1, "", Schedule.MinSchedule, Schedule.MinSchedule);
rec.PreRecordInterval = Int32.Parse(layer.GetSetting("preRecordInterval", "5").Value);
rec.PostRecordInterval = Int32.Parse(layer.GetSetting("postRecordInterval", "5").Value);
SetProperties(rec);
GUIListItem pItem = GetItem(GetSelectedItemNo());
if (pItem == null)
{
return;
}
rec = pItem.TVTag as Schedule;
if (rec == null)
{
return;
}
Program prog = rec.ReferencedChannel().GetProgramAt(rec.StartTime.AddMinutes(1));
SetProperties(rec, prog);
}
示例11: RecordingDetail
/// <summary>
/// constructor
/// </summary>
/// <param name="schedule">Schedule of this recording</param>
/// <param name="channel">Channel on which the recording is done</param>
/// <param name="endTime">Date/Time the recording should start without pre-record interval</param>
/// <param name="endTime">Date/Time the recording should stop with post record interval</param>
/// <param name="isSerie">Is serie recording</param>
///
///
public RecordingDetail(Schedule schedule, Channel channel, DateTime endTime, bool isSerie)
{
_user = UserFactory.CreateSchedulerUser(schedule.IdSchedule);
/*User.Name = string.Format("scheduler{0}", schedule.IdSchedule);
User.CardId = -1;
User.SubChannel = -1;
User.IsAdmin = true;
User.Priority = UserFactory.SCHEDULER_PRIORITY;*/
_schedule = schedule;
_channel = channel;
_endTime = endTime;
_program = null;
_isSerie = isSerie;
DateTime startTime = DateTime.MinValue;
if (isSerie)
{
DateTime now = DateTime.Now.AddMinutes(schedule.PreRecordInterval);
startTime = new DateTime(now.Year, now.Month, now.Day, schedule.StartTime.Hour, schedule.StartTime.Minute, 0);
}
else
{
startTime = schedule.StartTime;
}
_program = schedule.ReferencedChannel().GetProgramAt(startTime);
//no program? then treat this as a manual recording
if (_program == null)
{
_program = new TvDatabase.Program(0, DateTime.Now, endTime, "manual", "", "",
TvDatabase.Program.ProgramState.None,
System.Data.SqlTypes.SqlDateTime.MinValue.Value, string.Empty, string.Empty,
string.Empty, string.Empty, -1, string.Empty, 0);
}
}
示例12: CreateNewRecordingDetail
private RecordingDetail CreateNewRecordingDetail(Schedule schedule, DateTime currentTime)
{
RecordingDetail newRecording = null;
DateTime start = new DateTime(currentTime.Year, currentTime.Month, currentTime.Day, schedule.StartTime.Hour,
schedule.StartTime.Minute, schedule.StartTime.Second);
DateTime end = new DateTime(currentTime.Year, currentTime.Month, currentTime.Day, schedule.EndTime.Hour,
schedule.EndTime.Minute, schedule.EndTime.Second);
if (start > end)
end = end.AddDays(1);
if (currentTime >= start.AddMinutes(-schedule.PreRecordInterval) &&
currentTime <= end.AddMinutes(schedule.PostRecordInterval))
{
if (!schedule.IsSerieIsCanceled(start))
{
VirtualCard vCard = null;
bool isRecordingSchedule = IsRecordingSchedule(schedule.IdSchedule, out vCard);
if (!isRecordingSchedule)
{
newRecording = new RecordingDetail(schedule, schedule.ReferencedChannel(), end, true);
}
}
}
return newRecording;
}
示例13: IsTimeToRecordOnce
private RecordingDetail IsTimeToRecordOnce(Schedule schedule, DateTime currentTime, out bool isTimeToRecord)
{
isTimeToRecord = false;
RecordingDetail newRecording = null;
if (currentTime >= schedule.StartTime.AddMinutes(-schedule.PreRecordInterval) &&
currentTime <= schedule.EndTime.AddMinutes(schedule.PostRecordInterval))
{
VirtualCard vCard = null;
bool isRecordingSchedule = IsRecordingSchedule(schedule.IdSchedule, out vCard);
if (!isRecordingSchedule)
{
newRecording = new RecordingDetail(schedule, schedule.ReferencedChannel(), schedule.EndTime, schedule.Series);
isTimeToRecord = true;
}
}
return newRecording;
}
示例14: IsTimeToRecordEveryTimeOnThisChannel
private bool IsTimeToRecordEveryTimeOnThisChannel(Schedule schedule, DateTime currentTime)
{
bool isTimeToRecord = false;
TvDatabase.Program current =
schedule.ReferencedChannel().GetProgramAt(currentTime.AddMinutes(schedule.PreRecordInterval),
schedule.ProgramName);
if (current != null)
{
if (currentTime >= current.StartTime.AddMinutes(-schedule.PreRecordInterval) &&
currentTime <= current.EndTime.AddMinutes(schedule.PostRecordInterval))
{
if (!schedule.IsSerieIsCanceled(current.StartTime))
{
bool createSpawnedOnceSchedule = CreateSpawnedOnceSchedule(schedule, current);
if (createSpawnedOnceSchedule)
{
ResetTimer(); //lets process the spawned once schedule at once.
}
}
}
}
return isTimeToRecord;
}