From: <do...@us...> - 2010-05-01 19:38:24
|
Revision: 3562 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=3562&view=rev Author: dot-i Date: 2010-05-01 19:38:16 +0000 (Sat, 01 May 2010) Log Message: ----------- Updated to plugins for the For The Record 1.5.0.0 release. Modified Paths: -------------- trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/Channels/ChannelLink.cs trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/Channels/ChannelLinks.cs trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/Channels/LinkedMediaPortalChannel.cs trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/Properties/AssemblyInfo.cs trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/Wizards/ImportChannels/FinishPage.cs trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/Wizards/ImportChannels/ImportChannelsContext.cs trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/Wizards/ImportChannels/ImportChannelsPage.cs trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/Wizards/ImportChannels/ImportChannelsPageBase.cs trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/Wizards/ImportChannels/ImportChannelsWizard.cs trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/Wizards/WizardForm.cs trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/Wizards/WizardPage.cs trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/ActiveRecordings.cs trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/ChannelNavigator.cs trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/ForTheRecordMain.cs trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/GuideBase.cs trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/GuideSearchBase.cs trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/HomeBase.cs trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/MiniGuide.cs trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/PostBuild.cmd trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/Properties/AssemblyInfo.cs trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/RecordedBase.cs trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/TVZapOSD.cs trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/TvCropSettings.cs trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/TvFullScreen.cs trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/TvGuideDialog.cs trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/TvHome.cs trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/TvOSD.cs trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/TvProgramInfo.cs trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/TvTeletext.cs trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/TvTeletextBase.cs trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/UpcomingPrograms.cs trunk/plugins/ForTheRecord/ForTheRecord.UI.Process/ChannelProgramView.cs trunk/plugins/ForTheRecord/ForTheRecord.UI.Process/ChannelProgramsList.cs trunk/plugins/ForTheRecord/ForTheRecord.UI.Process/CurrentAndNextProgramView.cs trunk/plugins/ForTheRecord/ForTheRecord.UI.Process/CurrentAndNextProgramsList.cs trunk/plugins/ForTheRecord/ForTheRecord.UI.Process/EditSchedule/EditScheduleController.cs trunk/plugins/ForTheRecord/ForTheRecord.UI.Process/EditSchedule/EditScheduleModel.cs trunk/plugins/ForTheRecord/ForTheRecord.UI.Process/EditSchedule/TitleRuleTypeIndex.cs trunk/plugins/ForTheRecord/ForTheRecord.UI.Process/Guide/ChannelPrograms.cs trunk/plugins/ForTheRecord/ForTheRecord.UI.Process/Guide/GuideController.cs trunk/plugins/ForTheRecord/ForTheRecord.UI.Process/Guide/GuideModel.cs trunk/plugins/ForTheRecord/ForTheRecord.UI.Process/Guide/GuideUpcomingProgram.cs trunk/plugins/ForTheRecord/ForTheRecord.UI.Process/KeepUntilControlUtility.cs trunk/plugins/ForTheRecord/ForTheRecord.UI.Process/LiveStreamView.cs trunk/plugins/ForTheRecord/ForTheRecord.UI.Process/LiveStreamsList.cs trunk/plugins/ForTheRecord/ForTheRecord.UI.Process/ProcessUtility.cs trunk/plugins/ForTheRecord/ForTheRecord.UI.Process/Properties/AssemblyInfo.cs trunk/plugins/ForTheRecord/ForTheRecord.UI.Process/RecorderTunersCache.cs trunk/plugins/ForTheRecord/ForTheRecord.UI.Process/Recordings/RecordingsController.cs trunk/plugins/ForTheRecord/ForTheRecord.UI.Process/Recordings/RecordingsModel.cs trunk/plugins/ForTheRecord/ForTheRecord.UI.Process/ScheduleNamesCache.cs trunk/plugins/ForTheRecord/ForTheRecord.UI.Process/SearchGuide/SearchGuideController.cs trunk/plugins/ForTheRecord/ForTheRecord.UI.Process/SearchGuide/SearchGuideModel.cs trunk/plugins/ForTheRecord/ForTheRecord.UI.Process/SerializableDictionary.cs trunk/plugins/ForTheRecord/ForTheRecord.UI.Process/SortableBindingList.cs trunk/plugins/ForTheRecord/ForTheRecord.UI.Process/UpcomingGuideProgramsDictionary.cs trunk/plugins/ForTheRecord/ForTheRecord.UI.Process/UpcomingOrActiveProgramView.cs trunk/plugins/ForTheRecord/ForTheRecord.UI.Process/UpcomingOrActiveProgramsList.cs trunk/plugins/ForTheRecord/ReferencedAssemblies/Core.dll trunk/plugins/ForTheRecord/ReferencedAssemblies/Databases.dll trunk/plugins/ForTheRecord/ReferencedAssemblies/Dialogs.dll trunk/plugins/ForTheRecord/ReferencedAssemblies/ForTheRecord.Client.Common.dll trunk/plugins/ForTheRecord/ReferencedAssemblies/ForTheRecord.Entities.dll trunk/plugins/ForTheRecord/ReferencedAssemblies/ForTheRecord.RecorderTuners.Common.dll trunk/plugins/ForTheRecord/ReferencedAssemblies/ForTheRecord.ServiceAgents.dll trunk/plugins/ForTheRecord/ReferencedAssemblies/ForTheRecord.ServiceContracts.dll trunk/plugins/ForTheRecord/ReferencedAssemblies/Gentle.Common.dll trunk/plugins/ForTheRecord/ReferencedAssemblies/Gentle.Framework.dll trunk/plugins/ForTheRecord/ReferencedAssemblies/PluginBase.dll trunk/plugins/ForTheRecord/ReferencedAssemblies/SetupControls.dll trunk/plugins/ForTheRecord/ReferencedAssemblies/TVDatabase.dll trunk/plugins/ForTheRecord/ReferencedAssemblies/TvBusinessLayer.dll trunk/plugins/ForTheRecord/ReferencedAssemblies/TvControl.dll trunk/plugins/ForTheRecord/ReferencedAssemblies/TvLibrary.Interfaces.dll trunk/plugins/ForTheRecord/ReferencedAssemblies/Utils.dll Modified: trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/Channels/ChannelLink.cs =================================================================== --- trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/Channels/ChannelLink.cs 2010-04-30 17:18:30 UTC (rev 3561) +++ trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/Channels/ChannelLink.cs 2010-05-01 19:38:16 UTC (rev 3562) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2009 ForTheRecord + * Copyright (C) 2007-2010 ForTheRecord * http://www.4therecord.eu * * This Program is free software; you can redistribute it and/or modify Modified: trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/Channels/ChannelLinks.cs =================================================================== --- trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/Channels/ChannelLinks.cs 2010-04-30 17:18:30 UTC (rev 3561) +++ trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/Channels/ChannelLinks.cs 2010-05-01 19:38:16 UTC (rev 3562) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2009 ForTheRecord + * Copyright (C) 2007-2010 ForTheRecord * http://www.4therecord.eu * * This Program is free software; you can redistribute it and/or modify Modified: trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/Channels/LinkedMediaPortalChannel.cs =================================================================== --- trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/Channels/LinkedMediaPortalChannel.cs 2010-04-30 17:18:30 UTC (rev 3561) +++ trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/Channels/LinkedMediaPortalChannel.cs 2010-05-01 19:38:16 UTC (rev 3562) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2009 ForTheRecord + * Copyright (C) 2007-2010 ForTheRecord * http://www.4therecord.eu * * This Program is free software; you can redistribute it and/or modify Modified: trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/Properties/AssemblyInfo.cs 2010-04-30 17:18:30 UTC (rev 3561) +++ trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/Properties/AssemblyInfo.cs 2010-05-01 19:38:16 UTC (rev 3562) @@ -11,7 +11,7 @@ [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("ForTheRecord.RecorderTuners.MediaPortalTvServer")] -[assembly: AssemblyCopyright("Copyright © ForTheRecord 2007-2009")] +[assembly: AssemblyCopyright("Copyright © ForTheRecord 2007-2010")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] Modified: trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/Wizards/ImportChannels/FinishPage.cs =================================================================== --- trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/Wizards/ImportChannels/FinishPage.cs 2010-04-30 17:18:30 UTC (rev 3561) +++ trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/Wizards/ImportChannels/FinishPage.cs 2010-05-01 19:38:16 UTC (rev 3562) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2009 ForTheRecord + * Copyright (C) 2007-2010 ForTheRecord * http://www.4therecord.eu * * This Program is free software; you can redistribute it and/or modify Modified: trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/Wizards/ImportChannels/ImportChannelsContext.cs =================================================================== --- trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/Wizards/ImportChannels/ImportChannelsContext.cs 2010-04-30 17:18:30 UTC (rev 3561) +++ trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/Wizards/ImportChannels/ImportChannelsContext.cs 2010-05-01 19:38:16 UTC (rev 3562) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2009 ForTheRecord + * Copyright (C) 2007-2010 ForTheRecord * http://www.4therecord.eu * * This Program is free software; you can redistribute it and/or modify Modified: trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/Wizards/ImportChannels/ImportChannelsPage.cs =================================================================== --- trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/Wizards/ImportChannels/ImportChannelsPage.cs 2010-04-30 17:18:30 UTC (rev 3561) +++ trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/Wizards/ImportChannels/ImportChannelsPage.cs 2010-05-01 19:38:16 UTC (rev 3562) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2009 ForTheRecord + * Copyright (C) 2007-2010 ForTheRecord * http://www.4therecord.eu * * This Program is free software; you can redistribute it and/or modify Modified: trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/Wizards/ImportChannels/ImportChannelsPageBase.cs =================================================================== --- trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/Wizards/ImportChannels/ImportChannelsPageBase.cs 2010-04-30 17:18:30 UTC (rev 3561) +++ trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/Wizards/ImportChannels/ImportChannelsPageBase.cs 2010-05-01 19:38:16 UTC (rev 3562) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2009 ForTheRecord + * Copyright (C) 2007-2010 ForTheRecord * http://www.4therecord.eu * * This Program is free software; you can redistribute it and/or modify Modified: trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/Wizards/ImportChannels/ImportChannelsWizard.cs =================================================================== --- trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/Wizards/ImportChannels/ImportChannelsWizard.cs 2010-04-30 17:18:30 UTC (rev 3561) +++ trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/Wizards/ImportChannels/ImportChannelsWizard.cs 2010-05-01 19:38:16 UTC (rev 3562) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2009 ForTheRecord + * Copyright (C) 2007-2010 ForTheRecord * http://www.4therecord.eu * * This Program is free software; you can redistribute it and/or modify Modified: trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/Wizards/WizardForm.cs =================================================================== --- trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/Wizards/WizardForm.cs 2010-04-30 17:18:30 UTC (rev 3561) +++ trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/Wizards/WizardForm.cs 2010-05-01 19:38:16 UTC (rev 3562) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2009 ForTheRecord + * Copyright (C) 2007-2010 ForTheRecord * http://www.4therecord.eu * * This Program is free software; you can redistribute it and/or modify Modified: trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/Wizards/WizardPage.cs =================================================================== --- trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/Wizards/WizardPage.cs 2010-04-30 17:18:30 UTC (rev 3561) +++ trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/Wizards/WizardPage.cs 2010-05-01 19:38:16 UTC (rev 3562) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2009 ForTheRecord + * Copyright (C) 2007-2010 ForTheRecord * http://www.4therecord.eu * * This Program is free software; you can redistribute it and/or modify Modified: trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/ActiveRecordings.cs =================================================================== --- trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/ActiveRecordings.cs 2010-04-30 17:18:30 UTC (rev 3561) +++ trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/ActiveRecordings.cs 2010-05-01 19:38:16 UTC (rev 3562) @@ -37,6 +37,7 @@ using MediaPortal.Threading; using MediaPortal.Util; using MediaPortal.Configuration; +using Action = MediaPortal.GUI.Library.Action; using ForTheRecord.Entities; using ForTheRecord.ServiceAgents; Modified: trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/ChannelNavigator.cs =================================================================== --- trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/ChannelNavigator.cs 2010-04-30 17:18:30 UTC (rev 3561) +++ trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/ChannelNavigator.cs 2010-05-01 19:38:16 UTC (rev 3562) @@ -73,6 +73,8 @@ private GuideProgramSummary _zapProgram; private long _zapDelayMs; private bool _autoFullScreen; + private ManualResetEvent _waitForBlackScreenEvent; + private int _framesBeforeStopRenderBlackImage; public ChannelNavigator() { @@ -80,8 +82,61 @@ RefreshChannelGroups(ChannelType.Television); _navigatorChannels[ChannelType.Radio] = new NavigatorChannels(); RefreshChannelGroups(ChannelType.Radio); + _waitForBlackScreenEvent = new ManualResetEvent(false); + GUIGraphicsContext.OnBlackImageRendered += GUIGraphicsContext_OnBlackImageRendered; + GUIGraphicsContext.OnVideoReceived += GUIGraphicsContext_OnVideoReceived; } + #region Black Image + + private void RenderBlackImage() + { + if (!GUIGraphicsContext.RenderBlackImage) + { + Log.Debug("ChannelNavigator.RenderBlackImage()"); + _waitForBlackScreenEvent.Reset(); + GUIGraphicsContext.RenderBlackImage = true; + _waitForBlackScreenEvent.WaitOne(1000, false); + } + } + + private void StopRenderBlackImage() + { + if (GUIGraphicsContext.RenderBlackImage) + { + _framesBeforeStopRenderBlackImage = 3; + // Ambass : we need to wait the 3rd frame to avoid persistance of previous channel....Why ????? + // Morpheus: number of frames depends on hardware, from 1..5 or higher might be needed! + // Probably the faster the graphics card is, the more frames required??? + } + } + + private void GUIGraphicsContext_OnBlackImageRendered() + { + if (GUIGraphicsContext.RenderBlackImage) + { + _waitForBlackScreenEvent.Set(); + } + } + + private void GUIGraphicsContext_OnVideoReceived() + { + if (GUIGraphicsContext.RenderBlackImage) + { + Log.Debug("ChannelNavigator.OnVideoReceived() {0}", _framesBeforeStopRenderBlackImage); + if (_framesBeforeStopRenderBlackImage > 0) + { + if (--_framesBeforeStopRenderBlackImage == 0) + { + GUIGraphicsContext.RenderBlackImage = false; + Log.Debug("ChannelNavigator.StopRenderBlackImage()"); + } + } + } + } + + #endregion + private TvControlServiceAgent _tvControlAgent; private TvControlServiceAgent TvControlAgent @@ -551,84 +606,101 @@ if (liveStream != null) { - bool resumeGraph = true; - g_Player.PauseGraph(); - g_Player.OnZapping(0x80); - - LiveStreamResult firstResult = LiveStreamResult.Succeeded; - LiveStreamResult result = LiveStreamResult.UnknownError; try { - // - // First try to re-tune the existing TV stream (staying on the same card). - // - result = this.TvControlAgent.TuneLiveStream(currentAndNext.Channel, ref liveStream); - if (result == LiveStreamResult.Succeeded) - { - SetCurrentAndNext(channel.ChannelType, currentAndNext); - _currentChannel = channel; + RenderBlackImage(); - string fileName; - int seekOffset; - GetPlayerFileNameAndOffset(liveStream, out fileName, out seekOffset); + bool resumeGraph = true; + g_Player.PauseGraph(); + g_Player.OnZapping(0x80); - g_Player.OnZapping(-1); - g_Player.SeekAbsolute(g_Player.Duration + seekOffset); - } - else + LiveStreamResult firstResult = LiveStreamResult.Succeeded; + LiveStreamResult result = LiveStreamResult.UnknownError; + try { - // Seems a re-tune has failed, so keep track of the channel that - // was already being streamed and stop the current stream. - Channel resumeChannel = _currentChannel; - g_Player.OnZapping(-1); - g_Player.ContinueGraph(); - resumeGraph = false; - SilentlyStopLiveStream(liveStream); - - // Now re-try the new channel with a new stream. - liveStream = null; - result = this.TvControlAgent.TuneLiveStream(channel, ref liveStream); + // + // First try to re-tune the existing TV stream (staying on the same card). + // + result = this.TvControlAgent.TuneLiveStream(currentAndNext.Channel, ref liveStream); if (result == LiveStreamResult.Succeeded) { - // Success! Let's show the new stream. - result = PlayLiveStream(liveStream); + SetCurrentAndNext(channel.ChannelType, currentAndNext); _currentChannel = channel; + + string fileName; + int seekOffset; + GetPlayerFileNameAndOffset(liveStream, out fileName, out seekOffset); + + g_Player.OnZapping(-1); + if (g_Player.Duration < 0.0) + { + result = LiveStreamResult.ChannelTuneFailed; + } + else + { + g_Player.SeekAbsolute(g_Player.Duration + seekOffset); + } } - else + + if (result != LiveStreamResult.Succeeded) { - // Still nothing :-( So keep track of the error-code and let's - // try to re-tune to the original channel. - firstResult = result; + // Seems a re-tune has failed, so keep track of the channel that + // was already being streamed and stop the current stream. + Channel resumeChannel = _currentChannel; + g_Player.OnZapping(-1); + g_Player.ContinueGraph(); + resumeGraph = false; + SilentlyStopLiveStream(liveStream); + + // Now re-try the new channel with a new stream. liveStream = null; - result = this.TvControlAgent.TuneLiveStream(resumeChannel, ref liveStream); + result = this.TvControlAgent.TuneLiveStream(channel, ref liveStream); if (result == LiveStreamResult.Succeeded) { + // Success! Let's show the new stream. result = PlayLiveStream(liveStream); - _currentChannel = resumeChannel; + _currentChannel = channel; } + else + { + // Still nothing :-( So keep track of the error-code and let's + // try to re-tune to the original channel. + firstResult = result; + liveStream = null; + result = this.TvControlAgent.TuneLiveStream(resumeChannel, ref liveStream); + if (result == LiveStreamResult.Succeeded) + { + result = PlayLiveStream(liveStream); + _currentChannel = resumeChannel; + } + } } } - } - catch - { - result = LiveStreamResult.UnknownError; - } - finally - { - if (resumeGraph) + catch { - g_Player.ContinueGraph(); + result = LiveStreamResult.UnknownError; } - } + finally + { + if (resumeGraph) + { + g_Player.ContinueGraph(); + } + } - if (result != LiveStreamResult.Succeeded) - { - SilentlyStopLiveStream(liveStream); - ShowLiveStreamError(result); + if (result != LiveStreamResult.Succeeded) + { + SilentlyStopLiveStream(liveStream); + ShowLiveStreamError(result); + } + else if (firstResult != LiveStreamResult.Succeeded) + { + ShowLiveStreamError(firstResult); + } } - else if (firstResult != LiveStreamResult.Succeeded) + finally { - ShowLiveStreamError(firstResult); + StopRenderBlackImage(); } } @@ -669,20 +741,31 @@ GetPlayerFileNameAndOffset(liveStream, out fileName, out seekOffset); RecordedBase.RememberActiveRecordingPosition(); - if (g_Player.Play(fileName, - liveStream.Channel.ChannelType == ChannelType.Television ? g_Player.MediaType.TV : g_Player.MediaType.Radio)) + for (; ; ) { - _liveStream = liveStream; - // TODO: check why this hangs with radio?? - if (liveStream.Channel.ChannelType == ChannelType.Television) + if (g_Player.Play(fileName, + liveStream.Channel.ChannelType == ChannelType.Television ? g_Player.MediaType.TV : g_Player.MediaType.Radio)) { - g_Player.SeekAbsolute(g_Player.Duration + seekOffset); + // TODO: check why this hangs with radio?? + if (liveStream.Channel.ChannelType == ChannelType.Television) + { + double duration = g_Player.Duration; + if (duration < 0.0) + { + g_Player.Stop(); + Thread.Sleep(20); + continue; + } + g_Player.SeekAbsolute(g_Player.Duration + seekOffset); + } + _liveStream = liveStream; } + else + { + result = LiveStreamResult.UnknownError; + } + break; } - else - { - result = LiveStreamResult.UnknownError; - } return result; } @@ -1056,6 +1139,10 @@ if (disposing) { // Managed resources + GUIGraphicsContext.OnVideoReceived -= GUIGraphicsContext_OnVideoReceived; + GUIGraphicsContext.OnBlackImageRendered -= GUIGraphicsContext_OnBlackImageRendered; + _waitForBlackScreenEvent.Close(); + _waitForBlackScreenEvent = null; if (_tvControlAgent != null) { _tvControlAgent.Dispose(); Modified: trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/ForTheRecordMain.cs =================================================================== --- trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/ForTheRecordMain.cs 2010-04-30 17:18:30 UTC (rev 3561) +++ trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/ForTheRecordMain.cs 2010-05-01 19:38:16 UTC (rev 3562) @@ -67,18 +67,19 @@ } } - internal static bool IsActiveRecording(GuideProgram guideProgram) + internal static bool IsActiveRecording(Guid channelId, GuideProgram guideProgram) { ActiveRecording activeRecording; - return IsActiveRecording(guideProgram, out activeRecording); + return IsActiveRecording(channelId, guideProgram, out activeRecording); } - internal static bool IsActiveRecording(GuideProgram guideProgram, out ActiveRecording activeRecording) + internal static bool IsActiveRecording(Guid channelId, GuideProgram guideProgram, out ActiveRecording activeRecording) { + Guid upcomingProgramId = guideProgram.GetUniqueUpcomingProgramId(channelId); + foreach (ActiveRecording recording in ActiveRecordings) { - if (recording.Program.GuideProgramId.HasValue - && recording.Program.GuideProgramId.Value == guideProgram.GuideProgramId) + if (recording.Program.UpcomingProgramId == upcomingProgramId) { activeRecording = recording; return true; Modified: trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/GuideBase.cs =================================================================== --- trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/GuideBase.cs 2010-04-30 17:18:30 UTC (rev 3561) +++ trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/GuideBase.cs 2010-05-01 19:38:16 UTC (rev 3562) @@ -41,6 +41,7 @@ using MediaPortal.Player; using MediaPortal.Configuration; using MediaPortal.Video.Database; +using Action = MediaPortal.GUI.Library.Action; using ForTheRecord.Entities; using ForTheRecord.ServiceAgents; @@ -1446,7 +1447,7 @@ } _currentChannel = channel; - _currentRecOrNotify = _currentProgram != null && ForTheRecordMain.IsActiveRecording(_currentProgram); + _currentRecOrNotify = _currentProgram != null && ForTheRecordMain.IsActiveRecording(_currentChannel.ChannelId, _currentProgram); } private void RenderSingleChannel(TvSchedulerServiceAgent tvSchedulerAgent, TvGuideServiceAgent tvGuideAgent, Channel channel) @@ -2883,7 +2884,7 @@ if (_currentProgram != null && _currentChannel != null) { - if (ForTheRecordMain.IsActiveRecording(_currentProgram)) + if (ForTheRecordMain.IsActiveRecording(_currentChannel.ChannelId, _currentProgram)) { dlg.AddLocalizedString(637); // Edit Recording } @@ -3078,7 +3079,7 @@ try { ActiveRecording activeRecording; - if (ForTheRecordMain.IsActiveRecording(_currentProgram, out activeRecording)) + if (ForTheRecordMain.IsActiveRecording(_currentChannel.ChannelId, _currentProgram, out activeRecording)) { Log.Info("TVGuide: clicked on a currently running recording"); GUIDialogMenu dlg = (GUIDialogMenu)GUIWindowManager.GetWindow((int)Window.WINDOW_DIALOG_MENU); @@ -4058,24 +4059,26 @@ private string GetChannelProgramIcon(Channel channel, Guid guideProgramId, out bool isRecording) { + Guid upcomingProgramId = UpcomingProgram.GetUniqueUpcomingProgramId(guideProgramId, channel.ChannelId); + isRecording = false; string recordIconImage = null; GuideUpcomingProgram upcoming = null; ScheduleType type = ScheduleType.Recording; - if (_model.UpcomingRecordingsById.ContainsKey(guideProgramId)) + if (_model.UpcomingRecordingsById.ContainsKey(upcomingProgramId)) { type = ScheduleType.Recording; - upcoming = _model.UpcomingRecordingsById[guideProgramId]; + upcoming = _model.UpcomingRecordingsById[upcomingProgramId]; } - else if (_model.UpcomingAlertsById.ContainsKey(guideProgramId)) + else if (_model.UpcomingAlertsById.ContainsKey(upcomingProgramId)) { type = ScheduleType.Alert; - upcoming = _model.UpcomingAlertsById[guideProgramId]; + upcoming = _model.UpcomingAlertsById[upcomingProgramId]; } - else if (_model.UpcomingSuggestionsById.ContainsKey(guideProgramId)) + else if (_model.UpcomingSuggestionsById.ContainsKey(upcomingProgramId)) { type = ScheduleType.Suggestion; - upcoming = _model.UpcomingSuggestionsById[guideProgramId]; + upcoming = _model.UpcomingSuggestionsById[upcomingProgramId]; } if (upcoming != null && upcoming.ChannelId == channel.ChannelId) Modified: trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/GuideSearchBase.cs =================================================================== --- trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/GuideSearchBase.cs 2010-04-30 17:18:30 UTC (rev 3561) +++ trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/GuideSearchBase.cs 2010-05-01 19:38:16 UTC (rev 3562) @@ -37,6 +37,7 @@ using MediaPortal.Threading; using MediaPortal.Util; using MediaPortal.Configuration; +using Action = MediaPortal.GUI.Library.Action; using ForTheRecord.Entities; using ForTheRecord.ServiceAgents; @@ -427,16 +428,15 @@ item.Label = String.Format("[{0}] {1}", program.Channel.DisplayName, title); logoImagePath = "defaultVideoBig.png"; } - if (_model.AllUpcomingGuidePrograms.ContainsKey(program.GuideProgramId)) + + item.PinImage = null; + Guid upcomingProgramId = program.GetUniqueUpcomingProgramId(); + if (_model.AllUpcomingGuidePrograms.ContainsKey(upcomingProgramId)) { - GuideUpcomingProgram programInfo = _model.AllUpcomingGuidePrograms[program.GuideProgramId]; + GuideUpcomingProgram programInfo = _model.AllUpcomingGuidePrograms[upcomingProgramId]; item.PinImage = Utility.GetIconImageFileName(programInfo.Type, programInfo.IsPartOfSeries, - programInfo.CancellationReason, programInfo.UpcomingRecording); + programInfo.CancellationReason, programInfo.UpcomingRecording); } - else - { - item.PinImage = null; - } item.ThumbnailImage = logoImagePath; item.IconImageBig = logoImagePath; item.IconImage = logoImagePath; Modified: trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/HomeBase.cs =================================================================== --- trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/HomeBase.cs 2010-04-30 17:18:30 UTC (rev 3561) +++ trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/HomeBase.cs 2010-05-01 19:38:16 UTC (rev 3562) @@ -30,6 +30,7 @@ using MediaPortal.Player; using TvLibrary.Interfaces; using TvLibrary.Implementations.DVB; +using Action = MediaPortal.GUI.Library.Action; using ForTheRecord.ServiceAgents; using ForTheRecord.ServiceContracts; Modified: trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/MiniGuide.cs =================================================================== --- trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/MiniGuide.cs 2010-04-30 17:18:30 UTC (rev 3561) +++ trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/MiniGuide.cs 2010-05-01 19:38:16 UTC (rev 3562) @@ -36,6 +36,7 @@ using MediaPortal.GUI.Library; using MediaPortal.Player; using MediaPortal.Util; +using Action = MediaPortal.GUI.Library.Action; using ForTheRecord.Entities; using ForTheRecord.ServiceAgents; Modified: trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/PostBuild.cmd =================================================================== --- trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/PostBuild.cmd 2010-04-30 17:18:30 UTC (rev 3561) +++ trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/PostBuild.cmd 2010-05-01 19:38:16 UTC (rev 3562) @@ -1,13 +1,15 @@ if %3 == Release goto reallyEnd set mpDir="C:\Program Files\Team MediaPortal\MediaPortal" + set progDir="C:\ProgramData\Team MediaPortal\MediaPortal" IF NOT EXIST %mpDir% goto end copy %1ForTheRecord.ServiceContracts.dll %mpDir%\plugins\Windows copy %1ForTheRecord.ServiceAgents.dll %mpDir%\plugins\Windows copy %1ForTheRecord.Entities.dll %mpDir%\plugins\Windows copy %1ForTheRecord.UI.Process.dll %mpDir%\plugins\Windows copy %1ForTheRecord.UI.MediaPortal.* %mpDir%\plugins\Windows - xcopy /S /Y /I %1..\..\skin %mpDir%\skin - xcopy /S /Y /I %1..\..\language %mpDir%\language + copy %1ForTheRecord.Client.Common.* %mpDir%\plugins\Windows + xcopy /S /Y /I %1..\..\skin %progDir%\skin + xcopy /S /Y /I %1..\..\language %progDir%\language :end set mpDir="C:\Program Files (x86)\Team MediaPortal\MediaPortal" IF NOT EXIST %mpDir% goto reallyEnd @@ -16,8 +18,9 @@ copy %1ForTheRecord.Entities.dll %mpDir%\plugins\Windows copy %1ForTheRecord.UI.Process.dll %mpDir%\plugins\Windows copy %1ForTheRecord.UI.MediaPortal.* %mpDir%\plugins\Windows - xcopy /S /Y /I %1..\..\skin %mpDir%\skin - xcopy /S /Y /I %1..\..\language %mpDir%\language + copy %1ForTheRecord.Client.Common.* %mpDir%\plugins\Windows + xcopy /S /Y /I %1..\..\skin %progDir%\skin + xcopy /S /Y /I %1..\..\language %progDir%\language :reallyEnd REM IF EXIST "C:\ProgramData\Team MediaPortal\MediaPortal\Cache" DEL /S /Q "C:\ProgramData\Team MediaPortal\MediaPortal\Cache" REM IF EXIST "C:\Documents And Settings\All Users\Application Data\Team Mediaportal\Mediaportal\Cache" DEL /S /Q "C:\Documents And Settings\All Users\Application Data\Team Mediaportal\Mediaportal\Cache" Modified: trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/Properties/AssemblyInfo.cs 2010-04-30 17:18:30 UTC (rev 3561) +++ trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/Properties/AssemblyInfo.cs 2010-05-01 19:38:16 UTC (rev 3562) @@ -10,7 +10,7 @@ [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("ForTheRecord.UI.MediaPortal")] -[assembly: AssemblyCopyright("Copyright © ForTheRecord 2007-2009")] +[assembly: AssemblyCopyright("Copyright © ForTheRecord 2007-2010")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] Modified: trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/RecordedBase.cs =================================================================== --- trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/RecordedBase.cs 2010-04-30 17:18:30 UTC (rev 3561) +++ trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/RecordedBase.cs 2010-05-01 19:38:16 UTC (rev 3562) @@ -37,6 +37,7 @@ using MediaPortal.Threading; using MediaPortal.Util; using MediaPortal.Configuration; +using Action = MediaPortal.GUI.Library.Action; using ForTheRecord.Entities; using ForTheRecord.ServiceAgents; Modified: trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/TVZapOSD.cs =================================================================== --- trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/TVZapOSD.cs 2010-04-30 17:18:30 UTC (rev 3561) +++ trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/TVZapOSD.cs 2010-05-01 19:38:16 UTC (rev 3562) @@ -32,6 +32,7 @@ using MediaPortal.GUI.Library; using MediaPortal.Player; using MediaPortal.Util; +using Action = MediaPortal.GUI.Library.Action; using ForTheRecord.ServiceAgents; using ForTheRecord.Entities; Modified: trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/TvCropSettings.cs =================================================================== --- trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/TvCropSettings.cs 2010-04-30 17:18:30 UTC (rev 3561) +++ trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/TvCropSettings.cs 2010-05-01 19:38:16 UTC (rev 3562) @@ -32,6 +32,7 @@ using MediaPortal.GUI.Library; using MediaPortal.Player; using MediaPortal.Util; +using Action = MediaPortal.GUI.Library.Action; #endregion namespace ForTheRecord.UI.MediaPortal Modified: trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/TvFullScreen.cs =================================================================== --- trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/TvFullScreen.cs 2010-04-30 17:18:30 UTC (rev 3561) +++ trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/TvFullScreen.cs 2010-05-01 19:38:16 UTC (rev 3562) @@ -40,6 +40,7 @@ using ForTheRecord.Entities; using ForTheRecord.ServiceAgents; using ForTheRecord.UI.Process.Guide; +using Action = MediaPortal.GUI.Library.Action; #endregion namespace ForTheRecord.UI.MediaPortal @@ -819,7 +820,7 @@ { ActiveRecording activeRecording; if (currentProgram == null - || !ForTheRecordMain.IsActiveRecording(currentProgram, out activeRecording)) + || !ForTheRecordMain.IsActiveRecording(currentChannel.ChannelId, currentProgram, out activeRecording)) { ForTheRecordMain.IsChannelRecording(currentChannel, out activeRecording); } Modified: trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/TvGuideDialog.cs =================================================================== --- trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/TvGuideDialog.cs 2010-04-30 17:18:30 UTC (rev 3561) +++ trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/TvGuideDialog.cs 2010-05-01 19:38:16 UTC (rev 3562) @@ -38,6 +38,7 @@ using MediaPortal.Util; using MediaPortal.Dialogs; using MediaPortal.Player; +using Action = MediaPortal.GUI.Library.Action; #endregion namespace ForTheRecord.UI.MediaPortal Modified: trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/TvHome.cs =================================================================== --- trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/TvHome.cs 2010-04-30 17:18:30 UTC (rev 3561) +++ trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/TvHome.cs 2010-05-01 19:38:16 UTC (rev 3562) @@ -173,18 +173,18 @@ } } - internal static bool IsActiveRecording(GuideProgram guideProgram) + internal static bool IsActiveRecording(Guid channelId, GuideProgram guideProgram) { ActiveRecording activeRecording; - return IsActiveRecording(guideProgram, out activeRecording); + return IsActiveRecording(channelId, guideProgram, out activeRecording); } - internal static bool IsActiveRecording(GuideProgram guideProgram, out ActiveRecording activeRecording) + internal static bool IsActiveRecording(Guid channelId, GuideProgram guideProgram, out ActiveRecording activeRecording) { + Guid upcomingProgramId = guideProgram.GetUniqueUpcomingProgramId(channelId); foreach (ActiveRecording recording in ActiveRecordings) { - if (recording.Program.GuideProgramId.HasValue - && recording.Program.GuideProgramId.Value == guideProgram.GuideProgramId) + if (recording.Program.UpcomingProgramId == upcomingProgramId) { activeRecording = recording; return true; @@ -346,6 +346,7 @@ private void OnPlayRecordingBackStopped(global::MediaPortal.Player.g_Player.MediaType type, int stoptime, string filename) { + GUIGraphicsContext.RenderBlackImage = false; if (type == g_Player.MediaType.TV || type == g_Player.MediaType.Radio) { @@ -355,6 +356,7 @@ private void OnPlayRecordingBackEnded(global::MediaPortal.Player.g_Player.MediaType type, string filename) { + GUIGraphicsContext.RenderBlackImage = false; if ((type == g_Player.MediaType.TV || type == g_Player.MediaType.Radio) && ForTheRecordMain.Navigator.IsLiveStreamOn) { Modified: trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/TvOSD.cs =================================================================== --- trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/TvOSD.cs 2010-04-30 17:18:30 UTC (rev 3561) +++ trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/TvOSD.cs 2010-05-01 19:38:16 UTC (rev 3562) @@ -32,6 +32,7 @@ using MediaPortal.GUI.Library; using MediaPortal.Player; using MediaPortal.Util; +using Action = MediaPortal.GUI.Library.Action; using ForTheRecord.Entities; using ForTheRecord.ServiceAgents; @@ -1363,7 +1364,7 @@ { imgRecIcon.Visible = (!g_Player.IsTVRecording && prog != null - && ForTheRecordMain.IsActiveRecording(prog)); + && ForTheRecordMain.IsActiveRecording(_channelId, prog)); } if (prog != null && !g_Player.IsTVRecording) Modified: trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/TvProgramInfo.cs =================================================================== --- trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/TvProgramInfo.cs 2010-04-30 17:18:30 UTC (rev 3561) +++ trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/TvProgramInfo.cs 2010-05-01 19:38:16 UTC (rev 3562) @@ -254,7 +254,7 @@ Schedule schedule = null; UpcomingRecording upcomingRecording; - if (GetUpcomingRecordingAndSchedule(_currentProgram, out upcomingRecording, out schedule) + if (GetUpcomingRecordingAndSchedule(_channel.ChannelId, _currentProgram, out upcomingRecording, out schedule) && !upcomingRecording.Program.IsCancelled) { bool isRecordOnce = (schedule.Rules.FindRuleByType(ScheduleRuleType.OnDate) != null); @@ -366,7 +366,7 @@ { UpcomingRecording upcomingRecording; Schedule schedule; - if (GetUpcomingRecordingAndSchedule(_currentProgram, out upcomingRecording, out schedule)) + if (GetUpcomingRecordingAndSchedule(_channel.ChannelId, _currentProgram, out upcomingRecording, out schedule)) { ScheduleRule newEpisodesRule = FindNewEpisodesOnlyRule(schedule); if (newEpisodesRule != null) @@ -388,7 +388,7 @@ UpcomingRecording upcomingRecording; Schedule schedule; - if (GetUpcomingRecordingAndSchedule(_currentProgram, out upcomingRecording, out schedule)) + if (GetUpcomingRecordingAndSchedule(_channel.ChannelId, _currentProgram, out upcomingRecording, out schedule)) { GUIDialogMenu dlg = (GUIDialogMenu)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_MENU); if (dlg != null) @@ -427,7 +427,7 @@ using (TvSchedulerServiceAgent tvSchedulerAgent = new TvSchedulerServiceAgent()) { UpcomingRecording upcomingRecording; - if (HasUpcomingRecording(guideProgram, out upcomingRecording)) + if (HasUpcomingRecording(channel.ChannelId, guideProgram, out upcomingRecording)) { if (upcomingRecording.Program.IsCancelled) { @@ -504,7 +504,7 @@ } else { - if (ForTheRecordMain.IsActiveRecording(guideProgram)) + if (ForTheRecordMain.IsActiveRecording(_channel.ChannelId, guideProgram)) { GUIDialogYesNo dlgYesNo = (GUIDialogYesNo)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_YES_NO); if (dlgYesNo != null) @@ -602,7 +602,7 @@ { UpcomingRecording upcomingRecording; Schedule schedule; - if (GetUpcomingRecordingAndSchedule(_currentProgram, out upcomingRecording, out schedule)) + if (GetUpcomingRecordingAndSchedule(_channel.ChannelId, _currentProgram, out upcomingRecording, out schedule)) { int? newSeconds; if (GetPrePostRecordValue(Utility.GetLocalizedText(TextId.PreRecord), schedule.PreRecordSeconds, out newSeconds)) @@ -618,7 +618,7 @@ { UpcomingRecording upcomingRecording; Schedule schedule; - if (GetUpcomingRecordingAndSchedule(_currentProgram, out upcomingRecording, out schedule)) + if (GetUpcomingRecordingAndSchedule(_channel.ChannelId, _currentProgram, out upcomingRecording, out schedule)) { int? newSeconds; if (GetPrePostRecordValue(Utility.GetLocalizedText(TextId.PostRecord), schedule.PostRecordSeconds, out newSeconds)) @@ -685,7 +685,7 @@ { UpcomingRecording upcomingRecording; Schedule schedule; - if (GetUpcomingRecordingAndSchedule(_currentProgram, out upcomingRecording, out schedule)) + if (GetUpcomingRecordingAndSchedule(_channel.ChannelId, _currentProgram, out upcomingRecording, out schedule)) { KeepUntilMode newMode; int? newValue; @@ -832,15 +832,17 @@ Log.Warn("TVProgrammInfo.item_OnItemSelected: params where NULL!"); } - internal static bool HasUpcomingRecording(GuideProgram program, out UpcomingRecording upcomingRecording) + internal static bool HasUpcomingRecording(Guid channelId, GuideProgram program, out UpcomingRecording upcomingRecording) { using (TvControlServiceAgent tvControlAgent = new TvControlServiceAgent()) { upcomingRecording = null; + Guid upcomingProgramId = program.GetUniqueUpcomingProgramId(channelId); + UpcomingRecording[] upcomingRecordings = tvControlAgent.GetAllUpcomingRecordings(UpcomingRecordingsFilter.All, true); foreach (UpcomingRecording recording in upcomingRecordings) { - if (recording.Program.GuideProgramId == program.GuideProgramId) + if (recording.Program.UpcomingProgramId == upcomingProgramId) { upcomingRecording = recording; return true; @@ -850,10 +852,10 @@ } } - internal static bool GetUpcomingRecordingAndSchedule(GuideProgram program, out UpcomingRecording upcomingRecording, out Schedule schedule) + internal static bool GetUpcomingRecordingAndSchedule(Guid channelId, GuideProgram program, out UpcomingRecording upcomingRecording, out Schedule schedule) { schedule = null; - if (HasUpcomingRecording(program, out upcomingRecording)) + if (HasUpcomingRecording(channelId, program, out upcomingRecording)) { using (TvSchedulerServiceAgent tvSchedulerAgent = new TvSchedulerServiceAgent()) { Modified: trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/TvTeletext.cs =================================================================== --- trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/TvTeletext.cs 2010-04-30 17:18:30 UTC (rev 3561) +++ trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/TvTeletext.cs 2010-05-01 19:38:16 UTC (rev 3562) @@ -25,6 +25,7 @@ using System; using MediaPortal.GUI.Library; +using Action = MediaPortal.GUI.Library.Action; namespace ForTheRecord.UI.MediaPortal { Modified: trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/TvTeletextBase.cs =================================================================== --- trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/TvTeletextBase.cs 2010-04-30 17:18:30 UTC (rev 3561) +++ trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/TvTeletextBase.cs 2010-05-01 19:38:16 UTC (rev 3562) @@ -31,6 +31,7 @@ using MediaPortal.Configuration; using MediaPortal.GUI.Library; using MediaPortal.Profile; +using Action = MediaPortal.GUI.Library.Action; using ForTheRecord.ServiceAgents; using ForTheRecord.ServiceContracts; Modified: trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/UpcomingPrograms.cs =================================================================== --- trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/UpcomingPrograms.cs 2010-04-30 17:18:30 UTC (rev 3561) +++ trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/UpcomingPrograms.cs 2010-05-01 19:38:16 UTC (rev 3562) @@ -36,6 +36,7 @@ using MediaPortal.Threading; using MediaPortal.Util; using MediaPortal.Configuration; +using Action = MediaPortal.GUI.Library.Action; using ForTheRecord.Entities; using ForTheRecord.ServiceAgents; Modified: trunk/plugins/ForTheRecord/ForTheRecord.UI.Process/ChannelProgramView.cs =================================================================== --- trunk/plugins/ForTheRecord/ForTheRecord.UI.Process/ChannelProgramView.cs 2010-04-30 17:18:30 UTC (rev 3561) +++ trunk/plugins/ForTheRecord/ForTheRecord.UI.Process/ChannelProgramView.cs 2010-05-01 19:38:16 UTC (rev 3562) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2009 ForTheRecord + * Copyright (C) 2007-2010 ForTheRecord * http://www.4therecord.eu * * This Program is free software; you can redistribute it and/or modify @@ -29,10 +29,12 @@ public class ChannelProgramView { private ChannelProgram _program; + private Guid _upcomingProgramId; public ChannelProgramView(ChannelProgram program) { _program = program; + _upcomingProgramId = program.GetUniqueUpcomingProgramId(); } public ChannelProgram Program @@ -40,6 +42,16 @@ get { return _program; } } + public Guid UpcomingProgramId + { + get { return _upcomingProgramId; } + } + + public Guid ChannelId + { + get { return _program.Channel.ChannelId; } + } + public string ChannelName { get { return _program.Channel.DisplayName; } Modified: trunk/plugins/ForTheRecord/ForTheRecord.UI.Process/ChannelProgramsList.cs =================================================================== --- trunk/plugins/ForTheRecord/ForTheRecord.UI.Process/ChannelProgramsList.cs 2010-04-30 17:18:30 UTC (rev 3561) +++ trunk/plugins/ForTheRecord/ForTheRecord.UI.Process/ChannelProgramsList.cs 2010-05-01 19:38:16 UTC (rev 3562) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2009 ForTheRecord + * Copyright (C) 2007-2010 ForTheRecord * http://www.4therecord.eu * * This Program is free software; you can redistribute it and/or modify Modified: trunk/plugins/ForTheRecord/ForTheRecord.UI.Process/CurrentAndNextProgramView.cs =================================================================== --- trunk/plugins/ForTheRecord/ForTheRecord.UI.Process/CurrentAndNextProgramView.cs 2010-04-30 17:18:30 UTC (rev 3561) +++ trunk/plugins/ForTheRecord/ForTheRecord.UI.Process/CurrentAndNextProgramView.cs 2010-05-01 19:38:16 UTC (rev 3562) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2009 ForTheRecord + * Copyright (C) 2007-2010 ForTheRecord * http://www.4therecord.eu * * This Program is free software; you can redistribute it and/or modify Modified: trunk/plugins/ForTheRecord/ForTheRecord.UI.Process/CurrentAndNextProgramsList.cs =================================================================== --- trunk/plugins/ForTheRecord/ForTheRecord.UI.Process/CurrentAndNextProgramsList.cs 2010-04-30 17:18:30 UTC (rev 3561) +++ trunk/plugins/ForTheRecord/ForTheRecord.UI.Process/CurrentAndNextProgramsList.cs 2010-05-01 19:38:16 UTC (rev 3562) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2009 ForTheRecord + * Copyright (C) 2007-2010 ForTheRecord * http://www.4therecord.eu * * This Program is free software; you can redistribute it and/or modify Modified: trunk/plugins/ForTheRecord/ForTheRecord.UI.Process/EditSchedule/EditScheduleController.cs =================================================================== --- trunk/plugins/ForTheRecord/ForTheRecord.UI.Process/EditSchedule/EditScheduleController.cs 2010-04-30 17:18:30 UTC (rev 3561) +++ trunk/plugins/ForTheRecord/ForTheRecord.UI.Process/EditSchedule/EditScheduleController.cs 2010-05-01 19:38:16 UTC (rev 3562) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2009 ForTheRecord + * Copyright (C) 2007-2010 ForTheRecord * http://www.4therecord.eu * * This Program is free software; you can redistribute it and/or modify @@ -468,19 +468,24 @@ private static Operator GetNextOperator(string expression, int startIndex, out int operatorIndex, out int nextIndex) { - int orOperatorIndex = expression.IndexOf(" OR ", startIndex); - int andOperatorIndex = expression.IndexOf(" AND ", startIndex); - int notOperatorIndex = expression.IndexOf("NOT ", startIndex); - if (notOperatorIndex != startIndex) + string orOperator = " OR "; + string andOperator = " AND "; + string notOperator = "NOT "; + + int orOperatorIndex = expression.IndexOf(orOperator, startIndex); + int andOperatorIndex = expression.IndexOf(andOperator, startIndex); + int notOperatorIndex = expression.IndexOf(notOperator, startIndex); + if (notOperatorIndex > startIndex) { - notOperatorIndex = expression.IndexOf(" NOT ", startIndex); + notOperator = " NOT "; + notOperatorIndex = expression.IndexOf(notOperator, startIndex); } if (orOperatorIndex >= 0 && (andOperatorIndex < 0 || orOperatorIndex < andOperatorIndex) && (notOperatorIndex < 0 || orOperatorIndex < notOperatorIndex)) { ... [truncated message content] |