public static string BuildRecordingInfoToolTip(ActiveRecording activeRecording, string onText) { return BuildRecordingInfoToolTip(activeRecording.ActualStartTime, activeRecording.ActualStopTime, activeRecording.CardChannelAllocation, onText); }
private bool OnAbortActiveRecording(ActiveRecording rec) { using (ControlServiceAgent tvControlAgent = new ControlServiceAgent()) { if (rec == null) return false; bool aborted = false; GUIDialogMenu dlg = (GUIDialogMenu)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_MENU); if (dlg == null) return false; dlg.Reset(); dlg.SetHeading(rec.Program.Title); dlg.AddLocalizedString(1449); //Stop recording dlg.AddLocalizedString(979); //Play recorded from beginning dlg.AddLocalizedString(980); //Play recorded from live point Recording recording = tvControlAgent.GetRecordingById(rec.RecordingId); if (recording != null && recording.LastWatchedPosition.HasValue) { dlg.AddLocalizedString(900);//play from last point } dlg.DoModal(GetID); switch (dlg.SelectedId) { case 979: if (recording != null) { RecordedBase.PlayFromPreRecPoint(recording); } break; case 980: RecordedBase.PlayFromLivePoint(rec); break; case 900: if (recording != null) { RecordedBase.PlayRecording(recording, recording.LastWatchedPosition.Value); } break; case 1449: // Abort GUIDialogYesNo dlgYesNo = (GUIDialogYesNo)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_YES_NO); if (dlgYesNo != null) { dlgYesNo.Reset(); dlgYesNo.SetHeading(Utility.GetLocalizedText(TextId.StopRecording)); dlgYesNo.SetLine(1, rec.Program.Channel.DisplayName); dlgYesNo.SetLine(2, rec.Program.Title); dlgYesNo.SetLine(3, string.Empty); dlgYesNo.SetDefaultToYes(false); dlgYesNo.DoModal(GetID); if (dlgYesNo.IsConfirmed) { tvControlAgent.AbortActiveRecording(rec); aborted = true; } } break; } return aborted; } }
internal static string GetIconImageFileName(ActiveRecording activeRecording) { return GetIconImageFileName(ScheduleType.Recording, activeRecording.Program.IsPartOfSeries, activeRecording.Program.CancellationReason, true, activeRecording.CardChannelAllocation, activeRecording.ConflictingPrograms); }
public void Show(Point location, ServerStatus serverStatus, ActiveRecording[] activeRecordings, LiveStream[] liveStreams, UpcomingRecording upcomingRecording) { _serverStatus = serverStatus; _activeRecordings = activeRecordings; _liveStreams = liveStreams; _upcomingRecording = upcomingRecording; int fontHeight = SystemFonts.MessageBoxFont.Height; int height = _programsTop; if (_serverStatus != ServerStatus.NotConnected) { if (activeRecordings.Length > 0) { height += fontHeight; height += (2 * fontHeight + _programsGap) * activeRecordings.Length; if (liveStreams.Length > 0 || upcomingRecording != null) { height += _programsExtraGap; } } if (liveStreams.Length > 0) { height += fontHeight; height += (fontHeight + _programsGap) * liveStreams.Length; if (upcomingRecording != null) { height += _programsExtraGap; } } if (upcomingRecording != null) { height += 2 * fontHeight + _programsGap; } } height += fontHeight; height += 10; this.Size = new Size(this.Width, height); int left = location.X; int top; Rectangle workArea = Screen.GetWorkingArea(location); if (workArea.Contains(location)) { top = location.Y - 12 - this.Height; } else { top = int.MaxValue; } this.Opacity = 0.0; SetBounds(Math.Min(left, workArea.Width - this.Width - 1), Math.Min(top, workArea.Height - this.Height), this.Width, this.Height); this.Show(); }
private void SetTarget(Channel channel, Guid? guideProgramId, string title, string subTitle, string episodeNumberDisplay, DateTime startTime, ScheduleType? scheduleType, UpcomingProgram upcomingProgram, UpcomingGuideProgram upcomingGuideProgram, ActiveRecording activeRecording) { _channel = channel; _guideProgramId = guideProgramId; _title = title; _subTitle = subTitle; _episodeNumberDisplay = episodeNumberDisplay; _startTime = startTime; _scheduleType = scheduleType; _upcomingProgram = upcomingProgram; _activeRecording = activeRecording; _upcomingGuideProgram = upcomingGuideProgram; }
private static ServerStatus GetServerStatus(ActiveRecording[] activeRecordings, LiveStream[] liveStreams) { if (activeRecordings.Length > 0) { return ServerStatus.Recording; } else if (liveStreams.Length > 0) { return ServerStatus.Streaming; } return ServerStatus.Idle; }
public void SetTarget(ActiveRecording activeRecording) { SetTarget(activeRecording.Program.Channel, activeRecording.Program.GuideProgramId, activeRecording.Program.Title, activeRecording.Program.SubTitle, activeRecording.Program.EpisodeNumberDisplay, activeRecording.Program.StartTime, ScheduleType.Recording, activeRecording.Program, null, activeRecording); }
/// <summary> /// Abort an active recording. /// </summary> /// <param name="activeRecording">The active recording to abort.</param> public async Task AbortActiveRecording(ActiveRecording activeRecording) { var request = NewRequest(HttpMethod.Post, "AbortActiveRecording"); request.AddBody(activeRecording); await ExecuteAsync(request).ConfigureAwait(false); }
public UpcomingOrActiveProgramView(ActiveRecording activeRecording) { _activeRecording = activeRecording; _upcomingProgram = activeRecording.Program; }
internal static bool IsActiveRecording(Guid channelId, GuideProgram guideProgram, out ActiveRecording activeRecording) { Guid upcomingProgramId = guideProgram.GetUniqueUpcomingProgramId(channelId); foreach (ActiveRecording recording in ActiveRecordings) { if (recording.Program.UpcomingProgramId == upcomingProgramId) { activeRecording = recording; return true; } } activeRecording = null; return false; }
internal static bool IsChannelRecording(Guid channelId, out ActiveRecording activeRecording) { foreach (ActiveRecording recording in ActiveRecordings) { if (recording.CardChannelAllocation.ChannelId == channelId) { activeRecording = recording; return true; } } activeRecording = null; return false; }