public RecordingThread(Guid recorderTunerId, string serverHostName, int tcpPort, CardChannelAllocation channelAllocation, DateTime startTimeUtc, DateTime stopTimeUtc, UpcomingProgram recordingProgram, string suggestedBaseFileName, TvDatabase.Card recordOnCard, TvDatabase.Channel channel) : base(recorderTunerId, serverHostName, tcpPort, channelAllocation, startTimeUtc, stopTimeUtc, recordingProgram, true) { _suggestedBaseFileName = suggestedBaseFileName; _recordOnCard = recordOnCard; _channel = channel; }
public RecordingThread(Guid recorderId, string schedulerBaseUrl, CardChannelAllocation channelAllocation, DateTime startTimeUtc, DateTime stopTimeUtc, UpcomingProgram recordingProgram, string suggestedBaseFileName, TvDatabase.Card recordOnCard, TvDatabase.Channel channel) : base(recorderId, schedulerBaseUrl, channelAllocation, startTimeUtc, stopTimeUtc, recordingProgram, true) { _suggestedBaseFileName = suggestedBaseFileName; _recordOnCard = recordOnCard; _channel = channel; }
public async Task StartRecordingFailed(CardChannelAllocation channelAllocation, UpcomingProgram recordingProgram, string reason) { var request = NewRequest(HttpMethod.Put, "RecorderCallback/Recording/StartFailed"); request.AddBody(new { Allocation = channelAllocation, RecordingProgram = recordingProgram, Reason = reason }); await ExecuteAsync(request).ConfigureAwait(false); }
public async Task AddNewRecording(UpcomingProgram recordingProgram, DateTime recordingStartTimeUtc, string recordingFileName) { var request = NewRequest(HttpMethod.Post, "RecorderCallback/Recording/New"); request.AddBody(new { RecordingProgram = recordingProgram, RecordingStartTimeUtc = recordingStartTimeUtc, RecordingFileName = recordingFileName }); await ExecuteAsync(request).ConfigureAwait(false); }
public void AddNewRecording(UpcomingProgram recordingProgram, DateTime recordingStartTimeUtc, string recordingFileName) { var request = NewRequest("/RecorderCallback/Recording/New", Method.POST); request.AddBody(new { RecordingProgram = recordingProgram, RecordingStartTimeUtc = recordingStartTimeUtc, RecordingFileName = recordingFileName }); Execute(request); }
public RecordingThreadBase(Guid recorderId, string schedulerBaseUrl, CardChannelAllocation channelAllocation, DateTime startTimeUtc, DateTime stopTimeUtc, UpcomingProgram recordingProgram, bool okToRenameRecordedFiles) : base("Record") { _recorderId = recorderId; _schedulerBaseUrl = schedulerBaseUrl; _channelAllocation = channelAllocation; _startTimeUtc = startTimeUtc; _stopTimeUtc = stopTimeUtc; _recordingProgram = recordingProgram; _okToRenameRecordedFiles = okToRenameRecordedFiles; }
public RecordingThreadBase(Guid recorderTunerId, string serverHostName, int serverTcpPort, CardChannelAllocation channelAllocation, DateTime startTimeUtc, DateTime stopTimeUtc, UpcomingProgram recordingProgram, bool okToRenameRecordedFiles) : base("Record") { _recorderTunerId = recorderTunerId; _serverHostName = serverHostName; _serverTcpPort = serverTcpPort; _channelAllocation = channelAllocation; _startTimeUtc = startTimeUtc; _stopTimeUtc = stopTimeUtc; _recordingProgram = recordingProgram; _okToRenameRecordedFiles = okToRenameRecordedFiles; }
public static string BuildRecordingBaseFileName(string recordingsPath, UpcomingProgram program) { StringBuilder filePath = new StringBuilder(); if (recordingsPath != null) { filePath.Append(recordingsPath); if (filePath[filePath.Length - 1] != Path.DirectorySeparatorChar) { filePath.Append(Path.DirectorySeparatorChar); } filePath.Append(MakeValidFileName(program.Title)).Append(Path.DirectorySeparatorChar); } string programTitle = program.CreateProgramTitle(); if (programTitle.Length > 80) { programTitle = programTitle.Substring(0, 80); } filePath.Append(MakeValidFileName(programTitle)); filePath.Append("_"); filePath.AppendFormat(MakeValidFileName(program.Channel.DisplayName)); filePath.Append("_"); filePath.AppendFormat(CultureInfo.InvariantCulture, @"{0:yyyy-MM-dd_HH-mm}", program.StartTime); return filePath.ToString(); }
private float DrawProgramText(Graphics g, SolidBrush textBrush, float left, float top, UpcomingProgram program, bool showDate) { left = DrawAndMeasureString(g, SystemFonts.MessageBoxFont, textBrush, left, top, "• "); string times = program.StartTime.ToShortTimeString() + "-" + program.StopTime.ToShortTimeString() + " "; float titleLeft = DrawAndMeasureString(g, SystemFonts.MessageBoxFont, Brushes.Black, left, top, times); StringFormat trimmedFormat = (StringFormat)StringFormat.GenericTypographic.Clone(); trimmedFormat.Trimming = StringTrimming.EllipsisCharacter; using (Font boldFont = new Font(SystemFonts.MessageBoxFont, FontStyle.Bold)) { g.DrawString(program.CreateProgramTitle(), boldFont, Brushes.Black, new RectangleF(titleLeft, top, this.Width - titleLeft - 8, boldFont.Height), trimmedFormat); top += boldFont.Height; } float onLeft = DrawAndMeasureString(g, SystemFonts.MessageBoxFont, textBrush, left, top, "on "); string onText = program.Channel.DisplayName; if (showDate) { onText += ", " + program.StartTime.Date.ToLongDateString(); } g.DrawString(onText, SystemFonts.MessageBoxFont, Brushes.Black, new RectangleF(onLeft, top, this.Width - onLeft - 8, SystemFonts.MessageBoxFont.Height), trimmedFormat); return top + SystemFonts.MessageBoxFont.Height + _programsGap; }
public abstract bool StartRecording(string schedulerBaseUrl, CardChannelAllocation channelAllocation, DateTime startTimeUtc, DateTime stopTimeUtc, UpcomingProgram recordingProgram, string suggestedBaseFileName);
/// <summary> /// Tell the recorder to abort the recording of a program. The implementation must call /// /Recording/End on the Recorder callback service. /// </summary> /// <param name="schedulerBaseUrl">The callback URL for the Recorder to communicate with the Scheduler.</param> /// <param name="recordingProgram">The program that is being recorded.</param> /// <returns>True if the recording was found and aborted.</returns> public async Task<bool> AbortRecording(string schedulerBaseUrl, UpcomingProgram recordingProgram) { var request = NewRequest(HttpMethod.Put, "Recording/Abort"); request.AddBody(new { schedulerBaseUrl = schedulerBaseUrl, recordingProgram = recordingProgram }); return await ExecuteResult<bool>(request).ConfigureAwait(false); }
private static IMBotMessage FindUpcomingRecording(SchedulerServiceAgent tvSchedulerAgent, IMBotConversation conversation, IList<string> arguments, out UpcomingProgram upcomingRecording) { upcomingRecording = null; IProgramSummary program = null; Channel channel = null; Guid? upcomingProgramId = null; int programNumber; if (!int.TryParse(arguments[0], out programNumber)) { return new IMBotMessage("Bad program number.", IMBotMessage.ErrorColor); } Session.Programs sessionPrograms = null; if (conversation.Session.ContainsKey(SessionKey.Programs)) { sessionPrograms = conversation.Session[SessionKey.Programs] as Session.Programs; } if (sessionPrograms != null) { program = sessionPrograms.GetProgramAt(programNumber, out channel, out upcomingProgramId); if (program == null) { return new IMBotMessage("Bad program number.", IMBotMessage.ErrorColor); } } else { return new IMBotMessage("No programs.", IMBotMessage.ErrorColor); } UpcomingProgram[] upcomingPrograms = tvSchedulerAgent.GetAllUpcomingPrograms(ScheduleType.Recording, true); foreach (UpcomingProgram upcomingProgram in upcomingPrograms) { bool idMatches = upcomingProgramId.HasValue && upcomingProgram.UpcomingProgramId == upcomingProgramId.Value; if ((idMatches || upcomingProgram.Title == program.Title) && upcomingProgram.Channel.ChannelId == channel.ChannelId && upcomingProgram.StartTime == program.StartTime) { upcomingRecording = upcomingProgram; return null; } } return new IMBotMessage("Program not found in upcoming recordings.", IMBotMessage.ErrorColor); }
private bool IsRecentlyAlerted(UpcomingProgram upcomingAlert) { bool result = false; List<UpcomingProgram> alertsToRemove = new List<UpcomingProgram>(); foreach (UpcomingProgram recentlyAlerted in _recentlyAlerted) { if (recentlyAlerted.UpcomingProgramId == upcomingAlert.UpcomingProgramId) { result = true; } else if (recentlyAlerted.StopTime < DateTime.Now.AddMinutes(-_alertMinutes)) { alertsToRemove.Add(recentlyAlerted); } } foreach (UpcomingProgram alertToRemove in alertsToRemove) { _recentlyAlerted.Remove(alertToRemove); } return result; }
/// <summary> /// Beendet eine Aufzeichnung. /// </summary> /// <param name="serverHostName">Der Name des Rechners mit dem ArgusTV Scheduler.</param> /// <param name="tcpPort">Die Adresse des Schedulers.</param> /// <param name="recordingProgram">Das zu beendende Programm.</param> /// <returns>Gesetzt, wenn der Aufruf erfolgreich war.</returns> public bool AbortRecording( string serverHostName, int tcpPort, UpcomingProgram recordingProgram ) { // Locate var activity = m_activities.Get( recordingProgram.UpcomingProgramId ); if (activity == null) return false; // Forward return activity.Abort(); }
private void SetLabels(UpcomingProgram program) { //set program description if (_currentProgram == null) return; Channel _channel = Channel; if (program != null && program.GuideProgramId.HasValue) { if (_ProgramToShow != null && _ProgramToShow.GuideProgramId == program.GuideProgramId.Value) { return; } _ProgramToShow = Proxies.GuideService.GetProgramById(program.GuideProgramId.Value).Result; _channel = program.Channel; } else { _ProgramToShow = _currentProgram; } string strTime = String.Format("{0} {1} - {2}", Utility.GetShortDayDateString(_ProgramToShow.StartTime), _ProgramToShow.StartTime.ToString("t", CultureInfo.CurrentCulture.DateTimeFormat), _ProgramToShow.StopTime.ToString("t", CultureInfo.CurrentCulture.DateTimeFormat)); if (_ProgramToShow.Category != null) _categoryLabel.Label = _ProgramToShow.Category; else _categoryLabel.Label = string.Empty; _programChannelFadeLabel.Label = _channel.DisplayName; _programTimeLabel.Label = strTime; _descriptionScrollUp.Label = _ProgramToShow.CreateCombinedDescription(true); _programTitleFadeLabel.Label = _ProgramToShow.Title; }
public void AddRemoveHistoryUpcomingProgram(UpcomingProgram upcomingProgram, bool addToHistory) { if (addToHistory) { Proxies.ControlService.AddToPreviouslyRecordedHistory(upcomingProgram).Wait(); } else { Proxies.ControlService.RemoveFromPreviouslyRecordedHistory(upcomingProgram).Wait(); } RefreshUpcomingPrograms(); }
public static string BuildRecordingBaseFileName(UpcomingProgram program) { return BuildRecordingBaseFileName(null, program); }
private void OnLiveStreamEnded(LiveStream liveStream, LiveStreamAbortReason reason, UpcomingProgram program) { GUIMessage msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_STOP_SERVER_TIMESHIFTING, 0, 0, 0, 0, 0, null); msg.Object = liveStream; msg.Object2 = program; msg.Label = reason.ToString(); msg.Param1 = 4321;//indentification GUIGraphicsContext.SendMessage(msg); msg = null; }
/// <summary> /// Beginnt eine neue Aufzeichnung. /// </summary> /// <param name="serverHostName">Der Name des ArgusTV Steuerdienstes.</param> /// <param name="tcpPort">Die Adresse des Steuerdienstes.</param> /// <param name="channelAllocation">Das Gerät, auf dem die Aufzeichnung stattfinden soll.</param> /// <param name="startTimeUtc">Der Startzeitpunkt.</param> /// <param name="stopTimeUtc">Der Endzeitpunkt.</param> /// <param name="recordingProgram">Das aufzuzeichnende Programm.</param> /// <param name="suggestedBaseFileName">Ein Vorschlag für den Namen der Aufzeichnungsdatei.</param> /// <returns>Gesetzt, wenn der Start eingeleitet wurde.</returns> public bool StartRecording( string serverHostName, int tcpPort, CardChannelAllocation channelAllocation, DateTime startTimeUtc, DateTime stopTimeUtc, UpcomingProgram recordingProgram, string suggestedBaseFileName ) { // Enqueue return m_activities.GetOrCreate( recordingProgram.UpcomingProgramId, this ).Start( serverHostName, tcpPort, channelAllocation, startTimeUtc, stopTimeUtc, recordingProgram, suggestedBaseFileName ); }
public async Task LiveStreamAborted(LiveStream abortedStream, LiveStreamAbortReason reason, UpcomingProgram program) { var request = NewRequest(HttpMethod.Put, "RecorderCallback/LiveStream/Aborted"); request.AddBody(new { AbortedStream = abortedStream, Reason = reason, Program = program }); await ExecuteAsync(request).ConfigureAwait(false); }
/// <summary> /// Prüft eine Aufzeichnung und verändert optional den Endzeitpunkt. /// </summary> /// <param name="channelAllocation">Informationen zur Aufzeichnung.</param> /// <param name="recordingProgram">Das betroffene Programm.</param> /// <param name="stopTimeUtc">Der neue Endzeitpunkt.</param> /// <returns>Gesetzt, wenn die Änderung erfolgreich war.</returns> public bool ValidateAndUpdateRecording( CardChannelAllocation channelAllocation, UpcomingProgram recordingProgram, DateTime stopTimeUtc ) { // Locate var activity = m_activities.Get( recordingProgram.UpcomingProgramId ); if (activity == null) return false; // Forward return activity.SetNewStopTime( stopTimeUtc ); }
public abstract bool ValidateAndUpdateRecording(CardChannelAllocation channelAllocation, UpcomingProgram recordingProgram, DateTime stopTimeUtc);
public override void LiveStreamAborted(LiveStream abortedStream, LiveStreamAbortReason reason, UpcomingProgram program) { Log.Debug("Eventlistener: Livestreamaborted, stream = {0}, reason = {1}", abortedStream.RtspUrl, reason.ToString()); OnLiveStreamEnded(abortedStream, reason, program); }
public abstract bool AbortRecording(string schedulerBaseUrl, UpcomingProgram recordingProgram);
/// <summary> /// Tell the recorder to actually start a recording on the given card. The implementation /// must call /Recording/New on the Recorder callback service when the recording actually /// starts. If the recording can't start for some reason, StartRecordingFailed() must be called. /// In case the recording ends (prematurely or on time) /Recording/End must be called. IMPORTANT: /// If the suggested relative path and filename was used the recorder should /// return 'false' to /Recording/End's 'okToMoveFile'! /// </summary> /// <param name="schedulerBaseUrl">The callback URL for the Recorder to communicate with the Scheduler.</param> /// <param name="channelAllocation">The card allocation for the channel.</param> /// <param name="startTimeUtc">The actual time to start the recording (UTC).</param> /// <param name="stopTimeUtc">The actual time to stop the recording (UTC).</param> /// <param name="recordingProgram">The program to record.</param> /// <param name="suggestedBaseFileName">The suggested relative path and filename (without extension) of the recording file.</param> /// <returns>A boolean indicating the recording was initiated succesfully.</returns> public async Task<bool> StartRecording(string schedulerBaseUrl, CardChannelAllocation channelAllocation, DateTime startTimeUtc, DateTime stopTimeUtc, UpcomingProgram recordingProgram, string suggestedBaseFileName) { var request = NewRequest(HttpMethod.Post, "Recording/Start"); request.AddBody(new { schedulerBaseUrl = schedulerBaseUrl, channelAllocation = channelAllocation, startTimeUtc = startTimeUtc, stopTimeUtc = stopTimeUtc, recordingProgram = recordingProgram, suggestedBaseFileName = suggestedBaseFileName }); return await ExecuteResult<bool>(request).ConfigureAwait(false); }
private void Onrecord(ScheduleType scheduleType) { Schedule schedule = null; if (_upcomingProgram != null) { schedule = SchedulerAgent.GetScheduleById(_upcomingProgram.ScheduleId); } if (_upcomingProgram != null && schedule != null && schedule.ScheduleType == scheduleType)//delete schedule { if (_upcomingProgram.IsCancelled) { SchedulerAgent.UncancelUpcomingProgram(_upcomingProgram.ScheduleId, _upcomingProgram.GuideProgramId, _upcomingProgram.Channel.ChannelId, _upcomingProgram.StartTime); try { //refresh _upcomingProgram _upcomingProgram = SchedulerAgent.GetUpcomingPrograms(schedule, true)[0]; } catch { } } else { if (_upcomingProgram.IsPartOfSeries) { GUIDialogYesNo dlgYesNo = (GUIDialogYesNo)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_YES_NO); if (dlgYesNo != null) { dlgYesNo.SetHeading(Utility.GetLocalizedText(TextId.DeleteEntireSchedule)); dlgYesNo.SetLine(1, "\"" + schedule.Name + "\""); dlgYesNo.SetLine(2, Utility.GetLocalizedText(TextId.AreYouSure)); dlgYesNo.SetLine(3, String.Empty); dlgYesNo.SetDefaultToYes(false); dlgYesNo.DoModal(GUIWindowManager.ActiveWindow); if (dlgYesNo.IsConfirmed) { SchedulerAgent.DeleteSchedule(schedule.ScheduleId); _upcomingProgram = null; } } } else { SchedulerAgent.DeleteSchedule(_upcomingProgram.ScheduleId); _upcomingProgram = null; } } } else//create new schedule { TimeSpan duration = new TimeSpan(Int32.Parse(_spinHoursDuration.GetLabel()), Int32.Parse(_spinMinutesDuration.GetLabel()), 0); DateTime startTime = new DateTime(Int32.Parse(_spinStartYear.GetLabel()), Int32.Parse(_spinStartMonth.GetLabel()), Int32.Parse(_spinStartDay.GetLabel()), Int32.Parse(_spinStartHour.GetLabel()), Int32.Parse(_spinStartMinute.GetLabel()), 0); ScheduleDaysOfWeek daysOfWeek = new ScheduleDaysOfWeek(); //TODO: What if we have multiple channels with the same name Channel channel = SchedulerAgent.GetChannelByDisplayName(_channelType, _spinChannel.GetLabel()); Schedule newSchedule = null; newSchedule = SchedulerAgent.CreateNewSchedule(_channelType, scheduleType); newSchedule.Rules.Add(ScheduleRuleType.Channels, channel.ChannelId); newSchedule.Rules.Add(ScheduleRuleType.ManualSchedule, startTime, new ScheduleTime(duration)); if (!_recordOnce) { string days = " "; if (_mondayButton.Selected) { daysOfWeek = daysOfWeek | ScheduleDaysOfWeek.Mondays; days += Utility.GetLocalizedText(TextId.Mon) + ","; } if (_tuesdayButton.Selected) { daysOfWeek = daysOfWeek | ScheduleDaysOfWeek.Tuesdays; days += Utility.GetLocalizedText(TextId.Tue) + ","; } if (_wednesdayButton.Selected) { daysOfWeek = daysOfWeek | ScheduleDaysOfWeek.Wednesdays; days += Utility.GetLocalizedText(TextId.Wed) + ","; } if (_thursdayButton.Selected) { daysOfWeek = daysOfWeek | ScheduleDaysOfWeek.Thursdays; days += Utility.GetLocalizedText(TextId.Thu) + ","; } if (_fridayButton.Selected) { daysOfWeek = daysOfWeek | ScheduleDaysOfWeek.Fridays; days += Utility.GetLocalizedText(TextId.Fri) + ","; } if (_saturdayButton.Selected) { daysOfWeek = daysOfWeek | ScheduleDaysOfWeek.Saturdays; days += Utility.GetLocalizedText(TextId.Sat) + ","; } if (_sundayButton.Selected) { daysOfWeek = daysOfWeek | ScheduleDaysOfWeek.Sundays; days += Utility.GetLocalizedText(TextId.Sun) + ","; } days = days.Remove(days.Length - 1); newSchedule.Rules.Add(ScheduleRuleType.DaysOfWeek, daysOfWeek); newSchedule.Name = String.Format(CultureInfo.CurrentCulture, "{0} {1} {2:t}-{3:t}", channel.DisplayName, days, startTime, startTime.Add(duration)); } else { newSchedule.Name = String.Format(CultureInfo.CurrentCulture, "{0} {1:g}-{2:t}", channel.DisplayName, startTime, startTime.Add(duration)); } //TODO: try to prevent dublicate manual schedules //and find a better way to get the newly created "_schedule" and "_upcomingProgram" if (newSchedule != null) { newSchedule.ScheduleType = scheduleType; SchedulerAgent.SaveSchedule(newSchedule); bool found = false; UpcomingProgram[] _programs = SchedulerAgent.GetAllUpcomingPrograms(scheduleType, true); foreach (UpcomingProgram _prog in _programs) { if (_prog.Channel.ChannelId == channel.ChannelId && _prog.Duration == duration && !found) { Schedule _schedule = SchedulerAgent.GetScheduleById(_prog.ScheduleId); if (_schedule.Rules.FindRuleByType(ScheduleRuleType.ManualSchedule) != null) { if (_schedule.Name == newSchedule.Name) { if (_recordOnce && _prog.StartTime == startTime) { _upcomingProgram = _prog; found = true; } else if (!_recordOnce && _schedule.Rules.FindRuleByType(ScheduleRuleType.DaysOfWeek) != null && _schedule.Rules.FindRuleByType(ScheduleRuleType.DaysOfWeek).Arguments[0].ToString() == daysOfWeek.ToString() && Convert.ToDateTime(_schedule.Rules.FindRuleByType(ScheduleRuleType.ManualSchedule).Arguments[0]) == startTime) { _upcomingProgram = _prog; found = true; } Update(_schedule); break; } } } } if (!found) { GUIWindowManager.ShowPreviousWindow(); } } } }
/// <summary> /// Validate a recording is still running, and update its actual stop time. /// </summary> /// <param name="channelAllocation">The card allocation for the channel.</param> /// <param name="recordingProgram">The program being recorded.</param> /// <param name="stopTimeUtc">The up-to-date stop time (UTC).</param> /// <returns>True if the recording was still running (and its stop time was succesfully updated), false if there was a problem or the recording is not running.</returns> public async Task<bool> ValidateAndUpdateRecording(CardChannelAllocation channelAllocation, UpcomingProgram recordingProgram, DateTime stopTimeUtc) { var request = NewRequest(HttpMethod.Put, "Recording/ValidateAndUpdate"); request.AddBody(new { channelAllocation = channelAllocation, recordingProgram = recordingProgram, stopTimeUtc = stopTimeUtc }); return await ExecuteResult<bool>(request).ConfigureAwait(false); }
private bool BroadcastAlert(AddressList alertContactFilter, UpcomingProgram upcomingAlert) { bool result = false; if (_messenger.Nameserver.IsSignedIn) { foreach (Contact contact in _messenger.ContactList.Allowed) { if (!alertContactFilter.ContainsAddress(contact.Account) && BroadcastingAllowed(contact.Status) ) { StringBuilder text = new StringBuilder(); if (upcomingAlert.StartTime > DateTime.Now) { text.AppendLine("ALERT! This program is about to start:"); } else { text.AppendLine("ALERT! This program has already started:"); } Utility.AppendProgramDetails(text, upcomingAlert.Channel, upcomingAlert); if (result) { // We just sent out an alert, seems this is needed to give the system // some extra time :-( Thread.Sleep(100); } BroadcastMessage(contact, text.ToString()); result = true; } } } return result; }
/// <summary> /// Beginnt eine neue Aufzeichnung. /// </summary> /// <param name="serverHostName">Der Name des ArgusTV Steuerdienstes.</param> /// <param name="tcpPort">Die Adresse des Steuerdienstes.</param> /// <param name="channelAllocation">Das Gerät, auf dem die Aufzeichnung stattfinden soll.</param> /// <param name="startTimeUtc">Der Startzeitpunkt.</param> /// <param name="stopTimeUtc">Der Endzeitpunkt.</param> /// <param name="recordingProgram">Das aufzuzeichnende Programm.</param> /// <param name="suggestedBaseFileName">Ein Vorschlag für den Namen der Aufzeichnungsdatei.</param> /// <returns>Gesetzt, wenn der Start eingeleitet wurde.</returns> public bool Start( string serverHostName, int tcpPort, CardChannelAllocation channelAllocation, DateTime startTimeUtc, DateTime stopTimeUtc, UpcomingProgram recordingProgram, string suggestedBaseFileName ) { // Synchronize lock (m_synchronizer) { // Already active if (m_isRunning) return false; // Get the first recording path in local notation var recordingDir = m_service .Configuration .Directories .Where( d => (d.Usage & RecordingDirectoryUsage.Recording) != 0 ) .Select( d => d.LocalPath ) .First(); // Copy anything we need to us as the current state m_recordingPath = Path.Combine( recordingDir, (string.IsNullOrEmpty( suggestedBaseFileName ) ? Guid.NewGuid().ToString( "N" ) : suggestedBaseFileName) + ".ts" ); m_allocation = channelAllocation; m_schedulerHost = serverHostName; m_originalEndTime = stopTimeUtc; m_program = recordingProgram; CurrentEndTime = stopTimeUtc; m_startTime = startTimeUtc; m_schedulerPort = tcpPort; m_isRunning = true; // Do asynchronous validation m_run = Validate; // Fire as soon as possible on the dedicated timer thread NextTime = DateTime.UtcNow; // Did it - remote call will now end return true; } }
private bool NotifyProgram(UpcomingProgram program) { lock (this) { GUIMessage msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_NOTIFY_TV_PROGRAM, 0, 0, 0, 0, 0, null); msg.Object = program; GUIGraphicsContext.SendMessage(msg); msg = null; return true; } }
/// <summary> /// Create a unique upcoming program ID for a guide program that is scheduled on /// a specific channel. /// </summary> /// <returns>The unique upcoming program ID.</returns> public Guid GetUniqueUpcomingProgramId() { return(UpcomingProgram.GetUniqueUpcomingProgramId(this.GuideProgramId, this.Channel.ChannelId)); }