本文整理汇总了C#中TvControl.TvServer.OnNewSchedule方法的典型用法代码示例。如果您正苦于以下问题:C# TvServer.OnNewSchedule方法的具体用法?C# TvServer.OnNewSchedule怎么用?C# TvServer.OnNewSchedule使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TvControl.TvServer
的用法示例。
在下文中一共展示了TvServer.OnNewSchedule方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnPreRecordInterval
private void OnPreRecordInterval()
{
Schedule rec = currentSchedule;
if (currentSchedule == null && !IsRecordingProgram(CurrentProgram, out rec, false))
{
return;
}
GUIDialogMenu dlg = (GUIDialogMenu)GUIWindowManager.GetWindow((int)Window.WINDOW_DIALOG_MENU);
if (dlg != null)
{
dlg.Reset();
dlg.ShowQuickNumbers = false;
dlg.SetHeading(GUILocalizeStrings.Get(1444)); //pre-record
foreach (int interval in RecordingIntervalValues)
{
if (interval == 1)
{
if (interval == _preRec)
{
dlg.Add(String.Format("{0} {1}", interval,
GUILocalizeStrings.Get(3003) + " (" + GUILocalizeStrings.Get(886) + ")"));
// minute (default)
}
else
{
dlg.Add(String.Format("{0} {1}", interval, GUILocalizeStrings.Get(3003))); // minute
}
}
else
{
if (interval == _preRec)
{
dlg.Add(String.Format("{0} {1}", interval,
GUILocalizeStrings.Get(3004) + " (" + GUILocalizeStrings.Get(886) + ")"));
// minutes (default)
}
else
{
dlg.Add(String.Format("{0} {1}", interval, GUILocalizeStrings.Get(3004))); // minutes
}
}
}
if (rec.PreRecordInterval < 0)
{
dlg.SelectedLabel = 0;
}
else if (RecordingIntervalValues.IndexOf(rec.PreRecordInterval) == -1)
{
RecordingIntervalValues.IndexOf(_preRec); // select default if the value is not part of the list
}
else
{
dlg.SelectedLabel = RecordingIntervalValues.IndexOf(rec.PreRecordInterval);
}
dlg.DoModal(GetID);
if (dlg.SelectedLabel < 0)
{
return;
}
rec.PreRecordInterval = RecordingIntervalValues[dlg.SelectedLabel];
rec.Persist();
currentSchedule = rec;
Schedule assocSchedule = Schedule.RetrieveSpawnedSchedule(rec.IdSchedule, rec.StartTime);
if (assocSchedule != null)
{
assocSchedule.PreRecordInterval = rec.PreRecordInterval;
assocSchedule.Persist();
}
TvServer server = new TvServer();
server.OnNewSchedule();
}
Update();
}
示例2: CreateProgram
//.........这里部分代码省略.........
item.Label2 = GetRecordingDateTime(conflict);
Channel channel = Channel.Retrieve(conflict.IdChannel);
if (channel != null && !string.IsNullOrEmpty(channel.DisplayName))
{
item.Label3 = channel.DisplayName;
}
else
{
item.Label3 = conflict.IdChannel.ToString();
}
item.TVTag = conflict;
dlg.AddConflictRecording(item);
}
dlg.ConflictingEpisodes = (scheduleType != (int)ScheduleRecordingType.Once);
dlg.DoModal(dialogId);
switch (dlg.SelectedLabel)
{
case 0: // Skip new Recording
{
Log.Debug("TVProgramInfo.CreateProgram: Skip new recording");
return;
}
case 1: // Don't record the already scheduled one(s)
{
Log.Debug("TVProgramInfo.CreateProgram: Skip old recording(s)");
foreach (Schedule conflict in conflicts)
{
Program prog =
new Program(conflict.IdChannel, conflict.StartTime, conflict.EndTime, conflict.ProgramName, "-", "-",
Program.ProgramState.None,
DateTime.MinValue, string.Empty, string.Empty, string.Empty, string.Empty, -1,
string.Empty, -1);
CancelProgram(prog, Schedule.Retrieve(conflict.IdSchedule), dialogId);
}
break;
}
case 2: // keep conflict
{
Log.Debug("TVProgramInfo.CreateProgram: Keep Conflict");
break;
}
case 3: // Skip for conflicting episodes
{
Log.Debug("TVProgramInfo.CreateProgram: Skip conflicting episode(s)");
skipConflictingEpisodes = true;
break;
}
default: // Skipping new Recording
{
Log.Debug("TVProgramInfo.CreateProgram: Default => Skip new recording");
return;
}
}
}
}
if (saveSchedule != null)
{
Log.Debug("TVProgramInfo.CreateProgram - UnCancleSerie at {0}", program.StartTime);
saveSchedule.UnCancelSerie(program.StartTime, program.IdChannel);
//saveSchedule.UnCancelSerie();
saveSchedule.Persist();
currentSchedule = saveSchedule;
}
else
{
Log.Debug("TVProgramInfo.CreateProgram - create schedule = {0}", schedule.ToString());
schedule.Persist();
if (currentSchedule == null || (currentSchedule.ScheduleType > 0 && schedule.ScheduleType != (int)ScheduleRecordingType.Once))
{
currentSchedule = schedule;
}
}
if (skipConflictingEpisodes)
{
List<Schedule> episodes = layer.GetRecordingTimes(schedule);
foreach (Schedule episode in episodes)
{
if (DateTime.Now > episode.EndTime)
{
continue;
}
if (episode.IsSerieIsCanceled(episode.StartTime, program.IdChannel))
{
continue;
}
foreach (Schedule conflict in conflicts)
{
if (episode.IsOverlapping(conflict))
{
Log.Debug("TVProgramInfo.CreateProgram - skip episode = {0}", episode.ToString());
CanceledSchedule canceledSchedule = new CanceledSchedule(schedule.IdSchedule, program.IdChannel, episode.StartTime);
canceledSchedule.Persist();
}
}
}
}
server.OnNewSchedule();
}
示例3: OnKeep
private void OnKeep()
{
Schedule rec = currentSchedule;
if (currentSchedule == null && !IsRecordingProgram(CurrentProgram, out rec, false))
{
return;
}
GUIDialogMenu dlg = (GUIDialogMenu)GUIWindowManager.GetWindow((int)Window.WINDOW_DIALOG_MENU);
if (dlg == null)
{
return;
}
dlg.Reset();
dlg.SetHeading(1042);
dlg.AddLocalizedString(1043); //Until watched
dlg.AddLocalizedString(1044); //Until space needed
dlg.AddLocalizedString(1045); //Until date
dlg.AddLocalizedString(1046); //Always
switch (rec.KeepMethod)
{
case (int)KeepMethodType.UntilWatched:
dlg.SelectedLabel = 0;
break;
case (int)KeepMethodType.UntilSpaceNeeded:
dlg.SelectedLabel = 1;
break;
case (int)KeepMethodType.TillDate:
dlg.SelectedLabel = 2;
break;
case (int)KeepMethodType.Always:
dlg.SelectedLabel = 3;
break;
}
dlg.DoModal(GetID);
if (dlg.SelectedLabel == -1)
{
return;
}
switch (dlg.SelectedId)
{
case 1043:
rec.KeepMethod = (int)KeepMethodType.UntilWatched;
break;
case 1044:
rec.KeepMethod = (int)KeepMethodType.UntilSpaceNeeded;
break;
case 1045:
rec.KeepMethod = (int)KeepMethodType.TillDate;
dlg.Reset();
dlg.ShowQuickNumbers = false;
dlg.SetHeading(1045);
for (int iDay = 1; iDay <= 100; iDay++)
{
DateTime dt = CurrentProgram.StartTime.AddDays(iDay);
dlg.Add(dt.ToLongDateString());
}
TimeSpan ts = (rec.KeepDate - CurrentProgram.StartTime);
int days = (int)ts.TotalDays;
if (days >= 100)
{
days = 30;
}
dlg.SelectedLabel = days - 1;
dlg.DoModal(GetID);
if (dlg.SelectedLabel < 0)
{
return;
}
rec.KeepDate = CurrentProgram.StartTime.AddDays(dlg.SelectedLabel + 1);
break;
case 1046:
rec.KeepMethod = (int)KeepMethodType.Always;
break;
}
rec.Persist();
currentSchedule = rec;
TvServer server = new TvServer();
server.OnNewSchedule();
}
示例4: StopRecAndDeleteEntireSchedule
private static bool StopRecAndDeleteEntireSchedule(Schedule schedule, Schedule parentSchedule, DateTime canceledStartTime)
{
int idChannel = schedule.IdChannel;
CancelEpisode(canceledStartTime, parentSchedule, idChannel);
TvServer server = new TvServer();
bool wasRecStopped = StopRecording(schedule);
bool wasDeleted = DeleteEntireOrOnceSchedule(schedule, parentSchedule);
server.OnNewSchedule();
return wasRecStopped || wasDeleted;
}
示例5: StartRecordingSchedule
public static void StartRecordingSchedule(Channel channel, bool manual)
{
TvBusinessLayer layer = new TvBusinessLayer();
TvServer server = new TvServer();
if (manual) // until manual stop
{
Schedule newSchedule = new Schedule(channel.IdChannel,
GUILocalizeStrings.Get(413) + " (" + channel.DisplayName + ")",
DateTime.Now, DateTime.Now.AddDays(1));
newSchedule.PreRecordInterval = Int32.Parse(layer.GetSetting("preRecordInterval", "5").Value);
newSchedule.PostRecordInterval = Int32.Parse(layer.GetSetting("postRecordInterval", "5").Value);
newSchedule.Persist();
server.OnNewSchedule();
}
else // current program
{
// lets find any canceled episodes that match this one we want to create, if found uncancel it.
Schedule existingParentSchedule = Schedule.RetrieveSeries(channel.IdChannel, channel.CurrentProgram.Title,
channel.CurrentProgram.StartTime,
channel.CurrentProgram.EndTime);
if (existingParentSchedule != null)
{
foreach (CanceledSchedule cancelSched in existingParentSchedule.ReferringCanceledSchedule())
{
if (cancelSched.CancelDateTime == channel.CurrentProgram.StartTime)
{
existingParentSchedule.UnCancelSerie(channel.CurrentProgram.StartTime, channel.CurrentProgram.IdChannel);
server.OnNewSchedule();
return;
}
}
}
// ok, no existing schedule found with matching canceled schedules found. proceeding to add the schedule normally
Schedule newSchedule = new Schedule(channel.IdChannel, channel.CurrentProgram.Title,
channel.CurrentProgram.StartTime, channel.CurrentProgram.EndTime);
newSchedule.PreRecordInterval = Int32.Parse(layer.GetSetting("preRecordInterval", "5").Value);
newSchedule.PostRecordInterval = Int32.Parse(layer.GetSetting("postRecordInterval", "5").Value);
newSchedule.Persist();
server.OnNewSchedule();
}
GUIMessage msgManualRecord = new GUIMessage(GUIMessage.MessageType.GUI_MSG_MANUAL_RECORDING_STARTED, 0, 0, 0, 0, 0, null);
GUIWindowManager.SendMessage(msgManualRecord);
}
示例6: OnQuickRecord
//.........这里部分代码省略.........
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);
dlg.Reset();
dlg.SetHeading(180); //select time
dlg.ShowQuickNumbers = false;
//duration
for (float hours = 0.5f; hours <= 24f; hours += 0.5f)
{
dlg.Add(String.Format("{0} {1}", hours.ToString("f2"), GUILocalizeStrings.Get(3002)));
}
dlg.DoModal(GetID);
if (dlg.SelectedLabel == -1)
{
return;
}
int duration = (dlg.SelectedLabel + 1) * 30;
dtNow = DateTime.Now.AddDays(day);
rec.StartTime = new DateTime(dtNow.Year, dtNow.Month, dtNow.Day, hour, minute, 0, 0);
rec.EndTime = rec.StartTime.AddMinutes(duration);
rec.ProgramName = GUILocalizeStrings.Get(413) + " (" + rec.ReferencedChannel().DisplayName + ")";
rec.Persist();
TvServer server = new TvServer();
server.OnNewSchedule();
GUIWindowManager.ShowPreviousWindow();
}
示例7: StopRecAndDeleteSchedule
private static bool StopRecAndDeleteSchedule(Schedule schedule, Schedule parentSchedule, int idChannel, DateTime canceledStartTime)
{
bool wasCanceled = CancelEpisode(canceledStartTime, parentSchedule, idChannel);
bool wasDeleted = false;
if (canceledStartTime == schedule.StartTime)
{
bool isScheduleTypeOnce = IsScheduleTypeOnce(schedule.IdSchedule);
wasDeleted = StopRecording(schedule);
if (isScheduleTypeOnce && !wasDeleted)
{
wasDeleted = DeleteSchedule(schedule.IdSchedule);
}
}
TvServer server = new TvServer();
server.OnNewSchedule();
return wasDeleted || wasCanceled;
}
示例8: OnSetQuality
//.........这里部分代码省略.........
case 0: // Not Set
_newBitRate = VIDEOENCODER_BITRATE_MODE.NotSet;
break;
case 1: // CBR
_newBitRate = VIDEOENCODER_BITRATE_MODE.ConstantBitRate;
break;
case 2: // VBR
_newBitRate = VIDEOENCODER_BITRATE_MODE.VariableBitRateAverage;
break;
case 3: // VBR Peak
_newBitRate = VIDEOENCODER_BITRATE_MODE.VariableBitRatePeak;
break;
}
rec.BitRateMode = _newBitRate;
rec.Persist();
dlg.Reset();
dlg.SetHeading(882);
dlg.ShowQuickNumbers = true;
dlg.AddLocalizedString(968);
dlg.AddLocalizedString(886); //Default
dlg.AddLocalizedString(993); // Custom
dlg.AddLocalizedString(893); //Portable
dlg.AddLocalizedString(883); //Low
dlg.AddLocalizedString(884); //Medium
dlg.AddLocalizedString(885); //High
QualityType _newQuality = rec.QualityType;
switch (_newQuality)
{
case QualityType.NotSet:
dlg.SelectedLabel = 0;
break;
case QualityType.Default:
dlg.SelectedLabel = 1;
break;
case QualityType.Custom:
dlg.SelectedLabel = 2;
break;
case QualityType.Portable:
dlg.SelectedLabel = 3;
break;
case QualityType.Low:
dlg.SelectedLabel = 4;
break;
case QualityType.Medium:
dlg.SelectedLabel = 5;
break;
case QualityType.High:
dlg.SelectedLabel = 6;
break;
}
dlg.DoModal(GUIWindowManager.ActiveWindow);
if (dlg.SelectedLabel == -1)
{
return;
}
switch (dlg.SelectedLabel)
{
case 0: // Not Set
_newQuality = QualityType.NotSet;
break;
case 1: // Default
_newQuality = QualityType.Default;
break;
case 2: // Custom
_newQuality = QualityType.Custom;
break;
case 3: // Protable
_newQuality = QualityType.Portable;
break;
case 4: // Low
_newQuality = QualityType.Low;
break;
case 5: // Medium
_newQuality = QualityType.Medium;
break;
case 6: // High
_newQuality = QualityType.High;
break;
}
rec.QualityType = _newQuality;
rec.Persist();
}
TvServer server = new TvServer();
server.OnNewSchedule();
}
示例9: OnClick
private void OnClick(int iItem)
{
m_iSelectedItem = GetSelectedItemNo();
GUIListItem item = GetItem(iItem);
if (item == null)
{
return;
}
if (item.IsFolder)
{
if (item.Label == "..")
{
if (selectedItem != null)
{
selectedItem = null;
}
LoadDirectory();
return;
}
if (selectedItem == null)
{
selectedItem = item;
}
LoadDirectory();
return;
}
Schedule schedule = item.TVTag as Schedule;
if (schedule == null)
{
return;
}
if (schedule.ScheduleType == (int)ScheduleRecordingType.Once)
{
GUIDialogYesNo dlgYesNo = (GUIDialogYesNo)GUIWindowManager.GetWindow((int)Window.WINDOW_DIALOG_YES_NO);
if (null != dlgYesNo)
{
dlgYesNo.SetHeading(GUILocalizeStrings.Get(653)); //Delete this recording?
dlgYesNo.SetLine(1, schedule.ReferencedChannel().DisplayName);
dlgYesNo.SetLine(2, schedule.ProgramName);
dlgYesNo.SetLine(3, GUILocalizeStrings.Get(732)); //are you sure
dlgYesNo.DoModal(GUIWindowManager.ActiveWindow);
if (dlgYesNo.IsConfirmed)
{
if (schedule.ScheduleType == (int)ScheduleRecordingType.Once)
{
schedule.Delete();
selectedItem = null;
}
}
}
}
else // advanced recording
{
GUIDialogMenu dlg = (GUIDialogMenu)GUIWindowManager.GetWindow((int)Window.WINDOW_DIALOG_MENU);
if (dlg != null)
{
dlg.Reset();
dlg.SetHeading(schedule.ProgramName);
dlg.AddLocalizedString(981); //Delete this recording
dlg.AddLocalizedString(982); //Delete series recording
dlg.DoModal(GetID);
if (dlg.SelectedLabel == -1)
{
return;
}
switch (dlg.SelectedId)
{
case 981: //delete specific series
CanceledSchedule canceledSchedule = new CanceledSchedule(schedule.IdSchedule, schedule.IdChannel, schedule.StartTime);
canceledSchedule.Persist();
selectedItem = null;
TvServer server = new TvServer();
server.OnNewSchedule();
break;
case 982: //Delete entire recording
schedule.Delete();
selectedItem = null;
break;
}
}
}
LoadDirectory();
}
示例10: OnSetEpisodesToKeep
public static void OnSetEpisodesToKeep(Schedule rec)
{
Schedule schedule = Schedule.Retrieve(rec.IdSchedule);
GUIDialogMenu dlg = (GUIDialogMenu)GUIWindowManager.GetWindow((int)Window.WINDOW_DIALOG_MENU);
if (dlg == null)
{
return;
}
dlg.Reset();
dlg.SetHeading(887); //quality settings
dlg.ShowQuickNumbers = false;
dlg.AddLocalizedString(889); //All episodes
for (int i = 1; i < 40; ++i)
{
dlg.Add(i.ToString() + " " + GUILocalizeStrings.Get(874));
}
if (schedule.MaxAirings == Int32.MaxValue)
{
dlg.SelectedLabel = 0;
}
else
{
dlg.SelectedLabel = schedule.MaxAirings;
}
dlg.DoModal(GUIWindowManager.ActiveWindow);
if (dlg.SelectedLabel == -1)
{
return;
}
if (dlg.SelectedLabel == 0)
{
schedule.MaxAirings = Int32.MaxValue;
}
else
{
schedule.MaxAirings = dlg.SelectedLabel;
}
schedule.Persist();
TvServer server = new TvServer();
server.OnNewSchedule();
}
示例11: OnMoveUp
private void OnMoveUp(int item)
{
if (item == 0)
{
return;
}
m_iSelectedItem = item - 1;
GUIListItem pItem = GetItem(GetSelectedItemNo());
if (pItem == null)
{
return;
}
Schedule rec = pItem.TVTag as Schedule;
if (rec == null)
{
return;
}
GUIListItem tmpItem;
Schedule tmprec;
for (int i = 0; i < item - 1; ++i)
{
tmpItem = GetItem(i);
tmprec = tmpItem.TVTag as Schedule;
tmprec.Priority = Schedule.HighestPriority - i;
}
for (int i = item - 1; i < GetItemCount(); ++i)
{
if (item == i)
{
continue;
}
tmpItem = GetItem(i);
tmprec = tmpItem.TVTag as Schedule;
tmprec.Priority = Schedule.HighestPriority - i - 1;
}
rec.Priority = Schedule.HighestPriority - item + 1;
rec.Persist();
TvServer server = new TvServer();
server.OnNewSchedule();
LoadDirectory();
}
示例12: OnMoveDown
private void OnMoveDown(int item)
{
if (item == GetItemCount() - 1)
{
return;
}
m_iSelectedItem = item + 1;
GUIListItem pItem = GetItem(GetSelectedItemNo());
if (pItem == null)
{
return;
}
Schedule rec = pItem.TVTag as Schedule;
if (rec == null)
{
return;
}
GUIListItem tmpItem;
Schedule tmprec;
//0
//1
//2 ---->3
//3 ----
//4
//5
int tempPriority;
for (int i = 0; i < item; ++i)
{
tmpItem = GetItem(i);
tmprec = tmpItem.TVTag as Schedule;
tempPriority = tmprec.Priority;
tmprec.Priority = Schedule.HighestPriority - i;
if (tempPriority != tmprec.Priority)
{
tmprec.Persist();
}
}
tmpItem = GetItem(item + 1);
tmprec = tmpItem.TVTag as Schedule;
tempPriority = tmprec.Priority;
tmprec.Priority = Schedule.HighestPriority - item;
if (tempPriority != tmprec.Priority)
{
tmprec.Persist();
}
for (int i = item + 2; i < GetItemCount(); ++i)
{
tmpItem = GetItem(i);
tmprec = tmpItem.TVTag as Schedule;
tempPriority = tmprec.Priority;
tmprec.Priority = Schedule.HighestPriority - i;
if (tempPriority != tmprec.Priority)
{
tmprec.Persist();
}
}
rec.Priority = Schedule.HighestPriority - item - 1;
rec.Persist();
TvServer server = new TvServer();
server.OnNewSchedule();
LoadDirectory();
}
示例13: ChangeType
private void ChangeType(Schedule rec)
{
GUIDialogMenu dlg = (GUIDialogMenu)GUIWindowManager.GetWindow((int)Window.WINDOW_DIALOG_MENU);
if (dlg != null)
{
dlg.Reset();
dlg.SetHeading(GUILocalizeStrings.Get(616)); //616=Select Recording type
//611=Record once
//612=Record everytime on this channel
//613=Record everytime on every channel
//614=Record every week at this time
//615=Record every day at this time
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)));
dlg.Add(GUILocalizeStrings.Get(990000));// 990000=Weekly everytime on this channel
switch ((ScheduleRecordingType)rec.ScheduleType)
{
case ScheduleRecordingType.Once:
dlg.SelectedLabel = 0;
break;
case ScheduleRecordingType.EveryTimeOnThisChannel:
dlg.SelectedLabel = 1;
break;
case ScheduleRecordingType.EveryTimeOnEveryChannel:
dlg.SelectedLabel = 2;
break;
case ScheduleRecordingType.Weekly:
dlg.SelectedLabel = 3;
break;
case ScheduleRecordingType.Daily:
dlg.SelectedLabel = 4;
break;
case ScheduleRecordingType.WorkingDays:
dlg.SelectedLabel = 5;
break;
case ScheduleRecordingType.Weekends:
dlg.SelectedLabel = 6;
break;
case ScheduleRecordingType.WeeklyEveryTimeOnThisChannel:
dlg.SelectedLabel = 7;
break;
}
dlg.DoModal(GetID);
if (dlg.SelectedLabel == -1)
{
return;
}
switch (dlg.SelectedLabel)
{
case 0: //once
rec.ScheduleType = (int)ScheduleRecordingType.Once;
rec.Canceled = Schedule.MinSchedule;
break;
case 1: //everytime, this channel
rec.ScheduleType = (int)ScheduleRecordingType.EveryTimeOnThisChannel;
rec.Canceled = Schedule.MinSchedule;
break;
case 2: //everytime, all channels
rec.ScheduleType = (int)ScheduleRecordingType.EveryTimeOnEveryChannel;
rec.Canceled = Schedule.MinSchedule;
break;
case 3: //weekly
rec.ScheduleType = (int)ScheduleRecordingType.Weekly;
rec.Canceled = Schedule.MinSchedule;
break;
case 4: //daily
rec.ScheduleType = (int)ScheduleRecordingType.Daily;
rec.Canceled = Schedule.MinSchedule;
break;
case 5: //WorkingDays
rec.ScheduleType = (int)ScheduleRecordingType.WorkingDays;
rec.Canceled = Schedule.MinSchedule;
break;
case 6: //Weekends
rec.ScheduleType = (int)ScheduleRecordingType.Weekends;
rec.Canceled = Schedule.MinSchedule;
break;
case 7://weekly everytime, this channel
rec.ScheduleType = (int)ScheduleRecordingType.WeeklyEveryTimeOnThisChannel;
rec.Canceled = Schedule.MinSchedule;
break;
}
rec.Persist();
TvServer server = new TvServer();
server.OnNewSchedule();
LoadDirectory();
}
}
示例14: OnClick
private void OnClick(int iItem)
{
m_iSelectedItem = GetSelectedItemNo();
GUIListItem item = GetItem(iItem);
if (item == null)
{
return;
}
Schedule rec = (Schedule)item.TVTag;
GUIDialogMenu dlg = (GUIDialogMenu)GUIWindowManager.GetWindow((int)Window.WINDOW_DIALOG_MENU);
if (dlg == null)
{
return;
}
dlg.Reset();
dlg.SetHeading(rec.ProgramName);
if (rec.Series == false)
{
dlg.AddLocalizedString(618); //delete
}
else
{
dlg.AddLocalizedString(981); //Delete this recording
dlg.AddLocalizedString(982); //Delete series recording
dlg.AddLocalizedString(888); //Episodes management
}
VirtualCard card;
TvServer server = new TvServer();
if (server.IsRecordingSchedule(rec.IdSchedule, out card))
{
dlg.AddLocalizedString(979); //Play recording from beginning
dlg.AddLocalizedString(980); //Play recording from live point
}
else
{
IList<TuningDetail> details = Channel.Retrieve(rec.IdChannel).ReferringTuningDetail();
foreach (TuningDetail detail in details)
{
if (detail.ChannelType == 0)
{
dlg.AddLocalizedString(882); //Quality settings
break;
}
}
}
dlg.DoModal(GetID);
if (dlg.SelectedLabel == -1)
{
return;
}
switch (dlg.SelectedId)
{
case 888: ////Episodes management
OnSetEpisodesToKeep(rec);
break;
case 882:
OnSetQuality(rec);
break;
case 981: //Delete this recording only
{
if (server.IsRecordingSchedule(rec.IdSchedule, out card))
{
GUIDialogYesNo dlgYesNo = (GUIDialogYesNo)GUIWindowManager.GetWindow((int)Window.WINDOW_DIALOG_YES_NO);
if (null != dlgYesNo)
{
dlgYesNo.SetHeading(GUILocalizeStrings.Get(653)); //Delete this recording?
dlgYesNo.SetLine(1, GUILocalizeStrings.Get(730)); //This schedule is recording. If you delete
dlgYesNo.SetLine(2, GUILocalizeStrings.Get(731)); //the schedule then the recording is stopped.
dlgYesNo.SetLine(3, GUILocalizeStrings.Get(732)); //are you sure
dlgYesNo.DoModal(GUIWindowManager.ActiveWindow);
if (dlgYesNo.IsConfirmed)
{
server.StopRecordingSchedule(rec.IdSchedule);
CanceledSchedule schedule = new CanceledSchedule(rec.IdSchedule, rec.IdChannel, rec.StartTime);
rec.Persist();
server.OnNewSchedule();
}
}
}
else
{
server.StopRecordingSchedule(rec.IdSchedule);
CanceledSchedule schedule = new CanceledSchedule(rec.IdSchedule, rec.IdChannel, rec.StartTime);
rec.Persist();
server.OnNewSchedule();
}
LoadDirectory();
}
break;
case 982: //Delete series recording
goto case 618;
case 618: // delete entire recording
//.........这里部分代码省略.........