From: <do...@us...> - 2012-07-16 07:23:45
|
Revision: 4500 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4500&view=rev Author: dot-i Date: 2012-07-16 07:23:33 +0000 (Mon, 16 Jul 2012) Log Message: ----------- Updated to 1.7.0.0 source code, in combination with MP 1.3 alpha. Modified Paths: -------------- trunk/plugins/ForTheRecord/ForTheRecord.MPPlugins.sln 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/DvbEpgThread.cs trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/ForTheRecord.RecorderTuners.MediaPortalTvServer.csproj trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/MediaPortalRecorderTunerService.cs trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/Properties/AssemblyInfo.cs trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/RecordingThread.cs trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/SettingName.cs trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/SetupForm.cs trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/TvServerPlugin.cs trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/Utility.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/ChannelNavigator.cs trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/EventListener.cs trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/ForTheRecord.UI.MediaPortal.csproj 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/Properties/AssemblyInfo.cs trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/RadioGuide.cs trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/RadioGuideSearch.cs trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/RadioHome.cs trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/RadioRecorded.cs trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/RecordedBase.cs trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/SetupForm.Designer.cs trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/SetupForm.cs trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/TVZapOSD.cs trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/TextId.cs trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/Translator.cs trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/TvCropManager.cs trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/TvCropSettings.cs trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/TvFullScreen.cs trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/TvGuide.cs trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/TvGuideSearch.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/TvRecorded.cs trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/TvRecordingOverlay.cs trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/Utility.cs trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/WindowId.cs trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/language/fortherecord_da.xml trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/language/fortherecord_de.xml trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/language/fortherecord_en.xml trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/language/fortherecord_nl.xml trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/language/fortherecord_no.xml trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/language/fortherecord_pl.xml trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/language/fortherecord_sv.xml trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/skin/Default/4TR_Home.xml trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/skin/Default/4TR_RadioHome.xml 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/UpcomingOrActiveProgramView.cs trunk/plugins/ForTheRecord/ForTheRecord.UI.Process/UpcomingOrActiveProgramsList.cs trunk/plugins/ForTheRecord/ReferencedAssemblies/Common.Utils.dll 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 trunk/plugins/ForTheRecord/ReferencedAssemblies/WindowPlugins.dll Added Paths: ----------- trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/TVNotifyYesNoDialog.cs trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/TuningDetails.cs trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/UpcomingBase.cs trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/UpcomingRadio.cs trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/UpcomingTv.cs trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/settings/ trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/settings/ChannelManagment.cs trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/settings/ClientSettingsBase.cs trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/settings/ServerSettingsBase.cs trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/skin/Default/4TR_ManualSchedule.xml trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/skin/Default/4TR_ProgramInfo2.xml trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/skin/Default/4TR_RadioGuideSearch2.xml trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/skin/Default/4TR_RecordedRadio2.xml trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/skin/Default/4TR_RecordedTv2.xml trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/skin/Default/4TR_TvGuideSearch2.xml trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/skin/Default/4TR_UpcomingRadio.xml trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/skin/Default/4TR_UpcomingTv.xml trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/skin/DefaultWide/4TR_ChannelManagment.xml trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/skin/DefaultWide/4TR_ClientSettings.xml trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/skin/DefaultWide/4TR_ManualSchedule.xml trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/skin/DefaultWide/4TR_ProgramInfo2.xml trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/skin/DefaultWide/4TR_RadioGuideSearch2.xml trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/skin/DefaultWide/4TR_RecordedRadio2.xml trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/skin/DefaultWide/4TR_RecordedTv2.xml trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/skin/DefaultWide/4TR_ServerSettings.xml trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/skin/DefaultWide/4TR_TuningDetails.xml trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/skin/DefaultWide/4TR_TvGuideSearch2.xml trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/skin/DefaultWide/4TR_UpcomingRadio.xml trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/skin/DefaultWide/4TR_UpcomingTv.xml trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/skin/DefaultWide/settings_tv.xml trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/teletext/ trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/teletext/Hamming.cs trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/teletext/TeletextPageRenderer.cs trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/teletext/TvFullscreenTeletext.cs trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/teletext/TvTeletext.cs trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/teletext/TvTeletextBase.cs trunk/plugins/ForTheRecord/ReferencedAssemblies/DirectShowLib.dll Removed Paths: ------------- trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/ActiveRecordings.cs trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/Hamming.cs trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/TeletextPageRenderer.cs trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/TvFullscreenTeletext.cs trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/TvGuideDialog.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 Modified: trunk/plugins/ForTheRecord/ForTheRecord.MPPlugins.sln =================================================================== --- trunk/plugins/ForTheRecord/ForTheRecord.MPPlugins.sln 2012-07-11 10:05:47 UTC (rev 4499) +++ trunk/plugins/ForTheRecord/ForTheRecord.MPPlugins.sln 2012-07-16 07:23:33 UTC (rev 4500) @@ -10,6 +10,7 @@ ReferencedAssemblies\Core.dll = ReferencedAssemblies\Core.dll ReferencedAssemblies\Databases.dll = ReferencedAssemblies\Databases.dll ReferencedAssemblies\Dialogs.dll = ReferencedAssemblies\Dialogs.dll + ReferencedAssemblies\DirectShowLib.dll = ReferencedAssemblies\DirectShowLib.dll ReferencedAssemblies\ForTheRecord.Client.Common.dll = ReferencedAssemblies\ForTheRecord.Client.Common.dll ReferencedAssemblies\ForTheRecord.Entities.dll = ReferencedAssemblies\ForTheRecord.Entities.dll ReferencedAssemblies\ForTheRecord.RecorderTuners.Common.dll = ReferencedAssemblies\ForTheRecord.RecorderTuners.Common.dll Modified: trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/Channels/ChannelLink.cs =================================================================== --- trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/Channels/ChannelLink.cs 2012-07-11 10:05:47 UTC (rev 4499) +++ trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/Channels/ChannelLink.cs 2012-07-16 07:23:33 UTC (rev 4500) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2011 For The Record + * Copyright (C) 2007-2012 For The Record * 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 2012-07-11 10:05:47 UTC (rev 4499) +++ trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/Channels/ChannelLinks.cs 2012-07-16 07:23:33 UTC (rev 4500) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2011 For The Record + * Copyright (C) 2007-2012 For The Record * http://www.4therecord.eu * * This Program is free software; you can redistribute it and/or modify @@ -36,7 +36,7 @@ { internal class ChannelLinks { - private ReaderWriterLock _readerWriterLock = new ReaderWriterLock(); + private ReaderWriterLockSlim _readerWriterLock = new ReaderWriterLockSlim(LockRecursionPolicy.SupportsRecursion); private Dictionary<Guid, ChannelLink> _linksById = new Dictionary<Guid, ChannelLink>(); private Dictionary<int, bool> _autoLinkedMPChannels = new Dictionary<int, bool>(); @@ -148,7 +148,7 @@ string settingsFileName = this.SettingsFileName; if (!File.Exists(settingsFileName)) { - _readerWriterLock.AcquireWriterLock(Timeout.Infinite); + _readerWriterLock.EnterWriteLock(); try { _linksById.Clear(); @@ -157,7 +157,7 @@ } finally { - _readerWriterLock.ReleaseWriterLock(); + _readerWriterLock.ExitWriteLock(); } } @@ -165,7 +165,7 @@ if (forceLoad || lastWriteTimeUtc != _lastFileWriteTimeUtc) { - _readerWriterLock.AcquireWriterLock(Timeout.Infinite); + _readerWriterLock.EnterWriteLock(); try { _lastFileWriteTimeUtc = lastWriteTimeUtc; @@ -198,14 +198,14 @@ } finally { - _readerWriterLock.ReleaseWriterLock(); + _readerWriterLock.ExitWriteLock(); } } } private void SaveChannelLinks() { - _readerWriterLock.AcquireReaderLock(Timeout.Infinite); + _readerWriterLock.EnterReadLock(); try { string settingsFileName = this.SettingsFileName; @@ -229,7 +229,7 @@ } finally { - _readerWriterLock.ReleaseReaderLock(); + _readerWriterLock.ExitReadLock(); } } @@ -241,7 +241,7 @@ { EnsureLoaded(); - _readerWriterLock.AcquireReaderLock(Timeout.Infinite); + _readerWriterLock.EnterReadLock(); try { isAutoLinked = false; @@ -266,7 +266,7 @@ } finally { - _readerWriterLock.ReleaseReaderLock(); + _readerWriterLock.ExitReadLock(); } } @@ -274,7 +274,7 @@ { EnsureLoaded(); - _readerWriterLock.AcquireReaderLock(Timeout.Infinite); + _readerWriterLock.EnterReadLock(); try { foreach (ChannelLink link in _linksById.Values) @@ -289,7 +289,7 @@ } finally { - _readerWriterLock.ReleaseReaderLock(); + _readerWriterLock.ExitReadLock(); } } @@ -297,14 +297,14 @@ { EnsureLoaded(); - _readerWriterLock.AcquireReaderLock(Timeout.Infinite); + _readerWriterLock.EnterReadLock(); try { return _autoLinkedMPChannels.ContainsKey(mpChannel.IdChannel); } finally { - _readerWriterLock.ReleaseReaderLock(); + _readerWriterLock.ExitReadLock(); } } @@ -312,7 +312,7 @@ { EnsureLoaded(); - _readerWriterLock.AcquireWriterLock(Timeout.Infinite); + _readerWriterLock.EnterWriteLock(); try { ClearLinkedMediaPortalChannel(channel); @@ -321,7 +321,7 @@ } finally { - _readerWriterLock.ReleaseWriterLock(); + _readerWriterLock.ExitWriteLock(); } } @@ -329,7 +329,7 @@ { EnsureLoaded(); - _readerWriterLock.AcquireWriterLock(Timeout.Infinite); + _readerWriterLock.EnterWriteLock(); try { if (_linksById.ContainsKey(channel.ChannelId)) @@ -339,7 +339,7 @@ } finally { - _readerWriterLock.ReleaseWriterLock(); + _readerWriterLock.ExitWriteLock(); } } @@ -347,7 +347,7 @@ { EnsureLoaded(); - _readerWriterLock.AcquireWriterLock(Timeout.Infinite); + _readerWriterLock.EnterWriteLock(); try { List<Guid> obsoleteLinks = new List<Guid>(); @@ -366,7 +366,7 @@ } finally { - _readerWriterLock.ReleaseWriterLock(); + _readerWriterLock.ExitWriteLock(); } } Modified: trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/Channels/LinkedMediaPortalChannel.cs =================================================================== --- trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/Channels/LinkedMediaPortalChannel.cs 2012-07-11 10:05:47 UTC (rev 4499) +++ trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/Channels/LinkedMediaPortalChannel.cs 2012-07-16 07:23:33 UTC (rev 4500) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2011 For The Record + * Copyright (C) 2007-2012 For The Record * http://www.4therecord.eu * * This Program is free software; you can redistribute it and/or modify Modified: trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/DvbEpgThread.cs =================================================================== --- trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/DvbEpgThread.cs 2012-07-11 10:05:47 UTC (rev 4499) +++ trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/DvbEpgThread.cs 2012-07-16 07:23:33 UTC (rev 4500) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2011 For The Record + * Copyright (C) 2007-2012 For The Record * http://www.4therecord.eu * * This Program is free software; you can redistribute it and/or modify Modified: trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/ForTheRecord.RecorderTuners.MediaPortalTvServer.csproj =================================================================== --- trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/ForTheRecord.RecorderTuners.MediaPortalTvServer.csproj 2012-07-11 10:05:47 UTC (rev 4499) +++ trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/ForTheRecord.RecorderTuners.MediaPortalTvServer.csproj 2012-07-16 07:23:33 UTC (rev 4500) @@ -59,12 +59,14 @@ <Reference Include="Common.Utils"> <HintPath>..\ReferencedAssemblies\Common.Utils.dll</HintPath> </Reference> + <Reference Include="DirectShowLib"> + <HintPath>..\ReferencedAssemblies\DirectShowLib.dll</HintPath> + </Reference> <Reference Include="ForTheRecord.Entities, Version=1.4.0.0, Culture=neutral, PublicKeyToken=a9a5dfc20b8d6175, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> <HintPath>..\ReferencedAssemblies\ForTheRecord.Entities.dll</HintPath> </Reference> - <Reference Include="ForTheRecord.RecorderTuners.Common, Version=1.4.0.0, Culture=neutral, PublicKeyToken=a9a5dfc20b8d6175, processorArchitecture=MSIL"> - <SpecificVersion>False</SpecificVersion> + <Reference Include="ForTheRecord.RecorderTuners.Common"> <HintPath>..\ReferencedAssemblies\ForTheRecord.RecorderTuners.Common.dll</HintPath> </Reference> <Reference Include="ForTheRecord.ServiceAgents, Version=1.4.0.0, Culture=neutral, PublicKeyToken=a9a5dfc20b8d6175, processorArchitecture=MSIL"> Modified: trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/MediaPortalRecorderTunerService.cs =================================================================== --- trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/MediaPortalRecorderTunerService.cs 2012-07-11 10:05:47 UTC (rev 4499) +++ trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/MediaPortalRecorderTunerService.cs 2012-07-16 07:23:33 UTC (rev 4500) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2011 For The Record + * Copyright (C) 2007-2012 For The Record * http://www.4therecord.eu * * This Program is free software; you can redistribute it and/or modify @@ -38,6 +38,7 @@ using TvLibrary.Log; using ForTheRecord.Entities; +using ForTheRecord.Entities.Tuning; using ForTheRecord.ServiceContracts; using ForTheRecord.ServiceAgents; using ForTheRecord.RecorderTuners.Common; @@ -585,6 +586,141 @@ return liveStates.ToArray(); } + public override ServiceTuning GetLiveStreamTuningDetails(LiveStream liveStream) + { + ServiceTuning result = null; + + lock (_liveStreamsLock) + { + if (_liveStreams.ContainsKey(liveStream.RtspUrl)) + { + IUser tve3User = _liveStreamUsers[liveStream.RtspUrl]; + + IChannel channel = TvServerPlugin.TvController_CurrentChannel(tve3User); + + var dvbSChannel = channel as TvLibrary.Channels.DVBSChannel; + if (dvbSChannel != null) + { + result = new ServiceTuning() + { + CardType = Entities.Tuning.CardType.DvbS, + Frequency = (int)dvbSChannel.Frequency, + InnerFecRate = (ForTheRecord.Entities.Tuning.FecCodeRate)dvbSChannel.InnerFecRate, + Modulation = (ForTheRecord.Entities.Tuning.Modulation)dvbSChannel.ModulationType, + Name = dvbSChannel.Name, + ONID = dvbSChannel.NetworkId, + OrbitalPosition = dvbSChannel.SatelliteIndex, // TODO: check if this is the right number + Pilot = (ForTheRecord.Entities.Tuning.Pilot)dvbSChannel.Pilot, + ProviderName = dvbSChannel.Provider, + IsFreeToAir = dvbSChannel.FreeToAir, + RollOff = (ForTheRecord.Entities.Tuning.RollOff)dvbSChannel.Rolloff, + SID = dvbSChannel.ServiceId, + SignalPolarisation = (ForTheRecord.Entities.Tuning.SignalPolarisation)dvbSChannel.Polarisation, + SymbolRate = dvbSChannel.SymbolRate, + TSID = dvbSChannel.TransportId + }; + } + else + { + var dvbCChannel = channel as TvLibrary.Channels.DVBCChannel; + if (dvbCChannel != null) + { + result = new ServiceTuning() + { + CardType = Entities.Tuning.CardType.DvbC, + Frequency = (int)dvbCChannel.Frequency, + Modulation = (ForTheRecord.Entities.Tuning.Modulation)dvbCChannel.ModulationType, + Name = dvbCChannel.Name, + ONID = dvbCChannel.NetworkId, + ProviderName = dvbCChannel.Provider, + IsFreeToAir = dvbCChannel.FreeToAir, + SID = dvbCChannel.ServiceId, + SymbolRate = dvbCChannel.SymbolRate, + TSID = dvbCChannel.TransportId + }; + } + else + { + var dvbTChannel = channel as TvLibrary.Channels.DVBTChannel; + if (dvbTChannel != null) + { + result = new ServiceTuning() + { + CardType = Entities.Tuning.CardType.DvbT, + Frequency = (int)dvbTChannel.Frequency, + Bandwidth = dvbTChannel.BandWidth, + Name = dvbTChannel.Name, + ONID = dvbTChannel.NetworkId, + ProviderName = dvbTChannel.Provider, + IsFreeToAir = dvbTChannel.FreeToAir, + SID = dvbTChannel.ServiceId, + TSID = dvbTChannel.TransportId + }; + } + else + { + var atscChannel = channel as TvLibrary.Channels.ATSCChannel; + if (atscChannel != null) + { + result = new ServiceTuning() + { + CardType = Entities.Tuning.CardType.Atsc, + Frequency = (int)atscChannel.Frequency, + MajorChannel = atscChannel.MajorChannel, + MinorChannel = atscChannel.MinorChannel, + Name = atscChannel.Name, + PhysicalChannel = atscChannel.PhysicalChannel, + ProviderName = atscChannel.Provider, + IsFreeToAir = atscChannel.FreeToAir, + SID = atscChannel.ServiceId, + TSID = atscChannel.TransportId + }; + } + else + { + var analogChannel = channel as TvLibrary.Implementations.AnalogChannel; + if (analogChannel != null) + { + result = new ServiceTuning() + { + CardType = Entities.Tuning.CardType.Analog, + Frequency = (int)analogChannel.Frequency, + Name = analogChannel.Name, + IsFreeToAir = analogChannel.FreeToAir, + PhysicalChannel = analogChannel.ChannelNumber + }; + } + else + { + var dvbIPChannel = channel as TvLibrary.Channels.DVBIPChannel; + if (dvbIPChannel != null) + { + result = new ServiceTuning() + { + CardType = Entities.Tuning.CardType.DvbIP, + Url = dvbIPChannel.Url, + Name = dvbIPChannel.Name, + ProviderName = dvbIPChannel.Provider, + IsFreeToAir = dvbIPChannel.FreeToAir + }; + } + } + } + } + } + } + + if (result != null) + { + result.SignalQuality = TvServerPlugin.TvController_SignalQuality(tve3User.CardId); + result.SignalStrength = TvServerPlugin.TvController_SignalLevel(tve3User.CardId); + } + } + } + + return result; + } + #endregion #region TeleText Modified: trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/Properties/AssemblyInfo.cs 2012-07-11 10:05:47 UTC (rev 4499) +++ trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/Properties/AssemblyInfo.cs 2012-07-16 07:23:33 UTC (rev 4500) @@ -12,7 +12,7 @@ [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("For The Record")] [assembly: AssemblyProduct("ForTheRecord.RecorderTuners.MediaPortalTvServer")] -[assembly: AssemblyCopyright("Copyright © For The Record 2007-2011")] +[assembly: AssemblyCopyright("Copyright © For The Record 2007-2012")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -37,4 +37,4 @@ [assembly: AssemblyFileVersion(ForTheRecord.Entities.Constants.AssemblyVersion)] // MediaPortal version -[assembly: CompatibleVersion("1.1.7.0")] +[assembly: CompatibleVersion("1.2.0.0")] Modified: trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/RecordingThread.cs =================================================================== --- trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/RecordingThread.cs 2012-07-11 10:05:47 UTC (rev 4499) +++ trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/RecordingThread.cs 2012-07-16 07:23:33 UTC (rev 4500) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2011 For The Record + * Copyright (C) 2007-2012 For The Record * http://www.4therecord.eu * * This Program is free software; you can redistribute it and/or modify @@ -135,7 +135,7 @@ return null; } - if (TvServerPlugin.TvController_StartRecording(ref _tve3User, ref _tve3RecordingFileName, false, 0) != TvResult.Succeeded) + if (TvServerPlugin.TvController_StartRecording(ref _tve3User, ref _tve3RecordingFileName) != TvResult.Succeeded) { errorMessage = "TV Server failed to start recording on channel " + _channel.DisplayName; return null; Modified: trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/SettingName.cs =================================================================== --- trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/SettingName.cs 2012-07-11 10:05:47 UTC (rev 4499) +++ trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/SettingName.cs 2012-07-16 07:23:33 UTC (rev 4500) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2011 For The Record + * Copyright (C) 2007-2012 For The Record * http://www.4therecord.eu * * This Program is free software; you can redistribute it and/or modify Modified: trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/SetupForm.cs =================================================================== --- trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/SetupForm.cs 2012-07-11 10:05:47 UTC (rev 4499) +++ trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/SetupForm.cs 2012-07-16 07:23:33 UTC (rev 4500) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2011 For The Record + * Copyright (C) 2007-2012 For The Record * http://www.4therecord.eu * * This Program is free software; you can redistribute it and/or modify Modified: trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/TvServerPlugin.cs =================================================================== --- trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/TvServerPlugin.cs 2012-07-11 10:05:47 UTC (rev 4499) +++ trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/TvServerPlugin.cs 2012-07-16 07:23:33 UTC (rev 4500) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2011 For The Record + * Copyright (C) 2007-2012 For The Record * http://www.4therecord.eu * * This Program is free software; you can redistribute it and/or modify @@ -614,11 +614,11 @@ } } - public static TvResult TvController_StartRecording(ref IUser user, ref string fileName, bool contentRecording, long startTime) + public static TvResult TvController_StartRecording(ref IUser user, ref string fileName) { lock (_tvControllerLock) { - return _controller.StartRecording(ref user, ref fileName, contentRecording, startTime); + return _controller.StartRecording(ref user, ref fileName); } } @@ -686,6 +686,14 @@ } } + public static IChannel TvController_CurrentChannel(IUser user) + { + lock (_tvControllerLock) + { + return _controller.CurrentChannel(ref user); + } + } + public static void TvController_HeartBeat(IUser user) { lock (_tvControllerLock) @@ -750,6 +758,22 @@ } } + public static int TvController_SignalLevel(int cardId) + { + lock (_tvControllerLock) + { + return _controller.SignalLevel(cardId); + } + } + + public static int TvController_SignalQuality(int cardId) + { + lock (_tvControllerLock) + { + return _controller.SignalQuality(cardId); + } + } + #endregion } } Modified: trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/Utility.cs =================================================================== --- trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/Utility.cs 2012-07-11 10:05:47 UTC (rev 4499) +++ trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/Utility.cs 2012-07-16 07:23:33 UTC (rev 4500) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2011 For The Record + * Copyright (C) 2007-2012 For The Record * http://www.4therecord.eu * * This Program is free software; you can redistribute it and/or modify @@ -283,6 +283,12 @@ { return true; } + if (tuning.ChannelType == 0 // Analog + && tuning.ChannelType == otherTuning.ChannelType + && tuning.IdChannel == otherTuning.IdChannel) + { + return true; + } } return false; } Modified: trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/Wizards/ImportChannels/FinishPage.cs =================================================================== --- trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/Wizards/ImportChannels/FinishPage.cs 2012-07-11 10:05:47 UTC (rev 4499) +++ trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/Wizards/ImportChannels/FinishPage.cs 2012-07-16 07:23:33 UTC (rev 4500) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2011 For The Record + * Copyright (C) 2007-2012 For The Record * 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 2012-07-11 10:05:47 UTC (rev 4499) +++ trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/Wizards/ImportChannels/ImportChannelsContext.cs 2012-07-16 07:23:33 UTC (rev 4500) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2011 For The Record + * Copyright (C) 2007-2012 For The Record * 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 2012-07-11 10:05:47 UTC (rev 4499) +++ trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/Wizards/ImportChannels/ImportChannelsPage.cs 2012-07-16 07:23:33 UTC (rev 4500) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2011 For The Record + * Copyright (C) 2007-2012 For The Record * 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 2012-07-11 10:05:47 UTC (rev 4499) +++ trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/Wizards/ImportChannels/ImportChannelsPageBase.cs 2012-07-16 07:23:33 UTC (rev 4500) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2011 For The Record + * Copyright (C) 2007-2012 For The Record * 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 2012-07-11 10:05:47 UTC (rev 4499) +++ trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/Wizards/ImportChannels/ImportChannelsWizard.cs 2012-07-16 07:23:33 UTC (rev 4500) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2011 For The Record + * Copyright (C) 2007-2012 For The Record * 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 2012-07-11 10:05:47 UTC (rev 4499) +++ trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/Wizards/WizardForm.cs 2012-07-16 07:23:33 UTC (rev 4500) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2011 For The Record + * Copyright (C) 2007-2012 For The Record * 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 2012-07-11 10:05:47 UTC (rev 4499) +++ trunk/plugins/ForTheRecord/ForTheRecord.RecorderTuners.MediaPortalTvServer/Wizards/WizardPage.cs 2012-07-16 07:23:33 UTC (rev 4500) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2011 For The Record + * Copyright (C) 2007-2012 For The Record * http://www.4therecord.eu * * This Program is free software; you can redistribute it and/or modify Deleted: trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/ActiveRecordings.cs =================================================================== --- trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/ActiveRecordings.cs 2012-07-11 10:05:47 UTC (rev 4499) +++ trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/ActiveRecordings.cs 2012-07-16 07:23:33 UTC (rev 4500) @@ -1,637 +0,0 @@ -#region Copyright (C) 2005-2008 Team MediaPortal - -/* - * Copyright (C) 2005-2008 Team MediaPortal - * http://www.team-mediaportal.com - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Make; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#endregion - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.IO; -using System.Threading; - -using MediaPortal.Dialogs; -using MediaPortal.GUI.Library; -using MediaPortal.Player; -using MediaPortal.Services; -using MediaPortal.Threading; -using MediaPortal.Util; -using MediaPortal.Configuration; -using Action = MediaPortal.GUI.Library.Action; - -using ForTheRecord.Entities; -using ForTheRecord.ServiceAgents; -using ForTheRecord.ServiceContracts; -using ForTheRecord.UI.Process.Recordings; - -namespace ForTheRecord.UI.MediaPortal -{ - public class ActiveRecordings : GUIWindow, IComparer<GUIListItem> - { - #region variables - - private enum SortMethod - { - Channel = 0, - Date = 1, - Name = 2, - Genre = 3, - Played = 4, - Duration = 5 - } - - private SortMethod _currentSortMethod = SortMethod.Date; - - private bool _sortAscending = true; - private int _selectedItemIndex; - - [SkinControl(10)] - protected GUIListControl _viewsList; - - #endregion - - public ActiveRecordings() - { - GetID = (int)WindowId.ActiveRecordings; - } - - #region Service Agents - - private TvSchedulerServiceAgent _tvSchedulerAgent; - - public ITvSchedulerService TvSchedulerAgent - { - get - { - if (_tvSchedulerAgent == null) - { - _tvSchedulerAgent = new TvSchedulerServiceAgent(); - } - return _tvSchedulerAgent; - } - } - - private TvGuideServiceAgent _tvGuideAgent; - - public ITvGuideService TvGuideAgent - { - get - { - if (_tvGuideAgent == null) - { - _tvGuideAgent = new TvGuideServiceAgent(); - } - return _tvGuideAgent; - } - } - - private TvControlServiceAgent _tvControlAgent; - - public ITvControlService TvControlAgent - { - get - { - if (_tvControlAgent == null) - { - _tvControlAgent = new TvControlServiceAgent(); - } - return _tvControlAgent; - } - } - - private ConfigurationServiceAgent _configurationAgent; - - public IConfigurationService ConfigurationAgent - { - get - { - if (_configurationAgent == null) - { - _configurationAgent = new ConfigurationServiceAgent(); - } - return _configurationAgent; - } - } - - #endregion - - public override void OnAdded() - { - Log.Info("ActiveRecordings:OnAdded"); - Restore(); - PreInit(); - ResetAllControls(); - } - - public override bool IsTv - { - get { return true; } - } - - #region Serialisation - - private void LoadSettings() - { - } - - private void SaveSettings() - { - } - - #endregion - - #region overrides - - public override bool Init() - { - bool bResult = Load(GUIGraphicsContext.Skin + @"\4TR_Active.xml"); - LoadSettings(); - Restore(); - PreInit(); - ResetAllControls(); - return bResult; - } - - public override void OnAction(Action action) - { - switch (action.wID) - { - case Action.ActionType.ACTION_DELETE_ITEM: - { - int itemIndex = GetSelectedItemNo(); - if (itemIndex >= 0) - { - OnAbortRecording(GetItem(itemIndex)); - } - } - break; - } - base.OnAction(action); - } - - protected override void OnPageDestroy(int newWindowId) - { - _selectedItemIndex = GetSelectedItemNo(); - SaveSettings(); - if (_tvSchedulerAgent != null) - { - _tvSchedulerAgent.Dispose(); - } - if (_tvGuideAgent != null) - { - _tvGuideAgent.Dispose(); - } - if (_tvControlAgent != null) - { - _tvControlAgent.Dispose(); - } - if (_configurationAgent != null) - { - _configurationAgent.Dispose(); - } - base.OnPageDestroy(newWindowId); - } - - protected override void OnPageLoad() - { - base.OnPageLoad(); - - LoadSettings(); - LoadActiveRecordings(); - - GUIControl.FocusControl(GetID, 10); - - //_sortByButton.SortChanged += new SortEventHandler(SortChanged); - } - - protected override void OnClicked(int controlId, GUIControl control, global::MediaPortal.GUI.Library.Action.ActionType actionType) - { - base.OnClicked(controlId, control, actionType); - - if (control == _viewsList) - { - GUIMessage msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_ITEM_SELECTED, GetID, 0, control.GetID, 0, 0, null); - OnMessage(msg); - int iItem = (int)msg.Param1; - if (actionType == Action.ActionType.ACTION_SELECT_ITEM) - { - OnPlayRecording(iItem); - } - if (actionType == Action.ActionType.ACTION_SHOW_INFO) - { - OnShowContextMenu(); - } - } - } - - public override bool OnMessage(GUIMessage message) - { - switch (message.Message) - { - case GUIMessage.MessageType.GUI_MSG_ITEM_FOCUS_CHANGED: - UpdateProperties(); - break; - } - return base.OnMessage(message); - } - - protected override void OnShowContextMenu() - { - int iItem = GetSelectedItemNo(); - GUIListItem pItem = GetItem(iItem); - if (pItem == null) return; - if (pItem.IsFolder) return; - ActiveRecording activeRecording = pItem.TVTag as ActiveRecording; - if (activeRecording != null) - { - GUIDialogMenu dlg = (GUIDialogMenu)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_MENU); - if (dlg == null) return; - dlg.Reset(); - dlg.SetHeading(activeRecording.Program.Title); - dlg.AddLocalizedString(655); //Play recorded tv - dlg.AddLocalizedString(1449); //Stop recording - dlg.DoModal(GetID); - switch (dlg.SelectedId) - { - case 655: // Play - PlayRecording(activeRecording, false); - break; - - case 1449: // Abort - OnAbortRecording(pItem); - break; - } - } - } - - private void OnAbortRecording(GUIListItem item) - { - if (item == null) return; - ActiveRecording activeRecording = item.TVTag as ActiveRecording; - if (activeRecording != null) - { - GUIDialogYesNo dlgYesNo = (GUIDialogYesNo)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_YES_NO); - if (dlgYesNo != null) - { - UpcomingProgram program = activeRecording.Program; - - dlgYesNo.SetHeading(Utility.GetLocalizedText(TextId.StopRecording)); - dlgYesNo.SetLine(1, program.Channel.DisplayName); - dlgYesNo.SetLine(2, program.Title); - dlgYesNo.SetLine(3, string.Empty); - dlgYesNo.SetDefaultToYes(false); - dlgYesNo.DoModal(GetID); - - if (dlgYesNo.IsConfirmed) - { - this.TvSchedulerAgent.CancelUpcomingProgram(program.ScheduleId, program.GuideProgramId, - program.Channel.ChannelId, program.StartTime); - _viewsList.ListItems.Remove(item); - GUIControl.RefreshControl(GetID, _viewsList.GetID); - UpdateProperties(); - _selectedItemIndex = GetSelectedItemNo(); - } - } - } - } - - private bool OnPlayRecording(int itemIndex) - { - GUIListItem item = GetItem(itemIndex); - if (item == null) return false; - - ActiveRecording activeRecording = item.TVTag as ActiveRecording; - if (activeRecording != null) - { - return PlayRecording(activeRecording, false); - } - return false; - } - - internal static bool PlayRecording(ActiveRecording activeRecording, bool jumpToLivePoint) - { - using (TvControlServiceAgent tvControlAgent = new TvControlServiceAgent()) - { - Recording recording = tvControlAgent.GetRecordingById(activeRecording.RecordingId); - if (recording != null) - { - int? jumpTo = null; - if (jumpToLivePoint) - { - TimeSpan duration = DateTime.Now - activeRecording.RecordingStartTime; - jumpTo = (int)duration.TotalSeconds - 3; - } - RecordedBase.PlayRecording(recording, jumpTo); - return true; - } - return false; - } - } - - public override void Process() - { - base.Process(); - } - - #endregion - - #region recording methods - - private void LoadActiveRecordings() - { - string strDefaultUnseenIcon = GUIGraphicsContext.Skin + @"\Media\defaultVideoBig.png"; - string strDefaultSeenIcon = GUIGraphicsContext.Skin + @"\Media\defaultVideoSeenBig.png"; - GUIControl.ClearControl(GetID, _viewsList.GetID); - - List<ActiveRecording> activeRecordings = new List<ActiveRecording>( - this.TvControlAgent.GetActiveRecordings()); - foreach (ActiveRecording recording in activeRecordings) - { - GUIListItem item = CreateListItem(recording); - _viewsList.Add(item); - } - - GUIPropertyManager.SetProperty("#itemcount", _viewsList.Count.ToString()); - GUIPropertyManager.SetProperty("#currentmodule", Utility.GetLocalizedText(TextId.ActiveRecordings)); - - UpdateButtonStates(); // OnSort(); - UpdateProperties(); - - if (GetItemCount() > 0) - { - while (_selectedItemIndex >= GetItemCount() && _selectedItemIndex > 0) - { - _selectedItemIndex--; - } - GUIControl.SelectItemControl(GetID, _viewsList.GetID, _selectedItemIndex); - } - } - - private GUIListItem CreateListItem(ActiveRecording activeRecording) - { - GUIListItem item = new GUIListItem(); - string title = activeRecording.Program.CreateProgramTitle(); - item.Label = title; - //item.OnItemSelected += new global::MediaPortal.GUI.Library.GUIListItem.ItemSelectedHandler(item_OnItemSelected); - string logoImagePath = Utility.GetLogoImage(activeRecording.Program.Channel, TvSchedulerAgent); - if (logoImagePath == null - || !System.IO.File.Exists(logoImagePath)) - { - item.Label = String.Format("[{0}] {1}", activeRecording.Program.Channel.DisplayName, title); - logoImagePath = "defaultVideoBig.png"; - } - item.PinImage = Utility.GetIconImageFileName(activeRecording); - item.TVTag = activeRecording; - item.ThumbnailImage = logoImagePath; - item.IconImageBig = logoImagePath; - item.IconImage = logoImagePath; - item.Label2 = String.Format("{0} {1} - {2}", Utility.GetShortDayDateString(activeRecording.Program.StartTime), - activeRecording.Program.StartTime.ToString("t", CultureInfo.CurrentCulture.DateTimeFormat), - activeRecording.Program.StopTime.ToString("t", CultureInfo.CurrentCulture.DateTimeFormat)); - return item; - } - - private void UpdateButtonStates() - { - //_sortByButton.IsAscending = _sortAscending; - _viewsList.IsVisible = true; - } - - private void UpdateProperties() - { - ActiveRecording recording = null; - GUIListItem item = GetItem(GetSelectedItemNo()); - if (item != null) - { - recording = item.TVTag as ActiveRecording; - } - SetProperties(recording); - } - - private void SetProperties(ActiveRecording recording) - { - if (recording == null) - { - GUIPropertyManager.SetProperty("#TV.Active.Channel", String.Empty); - GUIPropertyManager.SetProperty("#TV.Active.Title", String.Empty); - GUIPropertyManager.SetProperty("#TV.Active.Genre", String.Empty); - GUIPropertyManager.SetProperty("#TV.Active.Time", String.Empty); - GUIPropertyManager.SetProperty("#TV.Active.Description", " "); - GUIPropertyManager.SetProperty("#TV.Active.thumb", String.Empty); - } - else - { - GuideProgram guideProgram = recording.Program.GuideProgramId.HasValue ? - this.TvGuideAgent.GetProgramById(recording.Program.GuideProgramId.Value) : null; - - string strTime = string.Format("{0} {1} - {2}", - Utility.GetShortDayDateString(recording.Program.StartTime), - recording.Program.StartTime.ToString("t", CultureInfo.CurrentCulture.DateTimeFormat), - recording.Program.StopTime.ToString("t", CultureInfo.CurrentCulture.DateTimeFormat)); - - GUIPropertyManager.SetProperty("#TV.Active.Channel", recording.Program.Channel.DisplayName); - GUIPropertyManager.SetProperty("#TV.Active.Title", recording.Program.Title); - GUIPropertyManager.SetProperty("#TV.Active.Genre", recording.Program.Category); - GUIPropertyManager.SetProperty("#TV.Active.Time", strTime); - string description; - if (guideProgram == null) - { - description = String.Empty; - } - else - { - description = guideProgram.CreateCombinedDescription(true); - } - GUIPropertyManager.SetProperty("#TV.Active.Description", description); - - string logo = Utility.GetLogoImage(recording.Program.Channel.ChannelId, - recording.Program.Channel.DisplayName, TvSchedulerAgent); - if (System.IO.File.Exists(... [truncated message content] |