From: <do...@us...> - 2011-10-18 08:18:59
|
Revision: 4311 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4311&view=rev Author: dot-i Date: 2011-10-18 08:18:48 +0000 (Tue, 18 Oct 2011) Log Message: ----------- Updated to For The Record 1.6.0.1 release. Modified Paths: -------------- trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/ActiveRecordings.cs trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/ChannelNavigator.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/Properties/AssemblyInfo.cs trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/RadioHome.cs trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/RecordedBase.cs trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/SetupForm.Designer.cs trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/TextId.cs trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/TvFullScreen.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/UpcomingPrograms.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_ProgramInfo.xml trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/skin/Default/4TR_RecordedRadio.xml trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/skin/Default/4TR_RecordedTv.xml trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/skin/Default/4TR_TvGuideSearch.xml trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/skin/DefaultWide/4TR_Active.xml trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/skin/DefaultWide/4TR_Home.xml trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/skin/DefaultWide/4TR_ProgramInfo.xml trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/skin/DefaultWide/4TR_RadioGuideSearch.xml trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/skin/DefaultWide/4TR_RadioHome.xml trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/skin/DefaultWide/4TR_RecordedRadio.xml trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/skin/DefaultWide/4TR_RecordedTv.xml trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/skin/DefaultWide/4TR_TvGuideSearch.xml trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/skin/DefaultWide/4TR_Upcoming.xml 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/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/EventListener.cs trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/skin/DefaultWide/4TR_common.window.xml Modified: trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/ActiveRecordings.cs =================================================================== --- trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/ActiveRecordings.cs 2011-10-09 09:23:41 UTC (rev 4310) +++ trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/ActiveRecordings.cs 2011-10-18 08:18:48 UTC (rev 4311) @@ -371,8 +371,8 @@ _viewsList.Add(item); } - string strObjects = string.Format("{0} {1}", _viewsList.Count, Utility.GetLocalizedText(TextId.RecordingsListItemsSuffix)); - GUIPropertyManager.SetProperty("#itemcount", strObjects); + GUIPropertyManager.SetProperty("#itemcount", _viewsList.Count.ToString()); + GUIPropertyManager.SetProperty("#currentmodule", Utility.GetLocalizedText(TextId.ActiveRecordings)); UpdateButtonStates(); // OnSort(); UpdateProperties(); Modified: trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/ChannelNavigator.cs =================================================================== --- trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/ChannelNavigator.cs 2011-10-09 09:23:41 UTC (rev 4310) +++ trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/ChannelNavigator.cs 2011-10-18 08:18:48 UTC (rev 4311) @@ -78,6 +78,7 @@ private int _zapChannelNr = -1; private static LiveStreamResult result = LiveStreamResult.UnknownError; private int backupvolume = -1; + private static DateTime _updateTimer = DateTime.MinValue; public ChannelNavigator() { @@ -437,8 +438,13 @@ //UpdateCurrentChannel(); // Make sure current and next is up to date. - KeepCurrentNextUpToDate(ChannelType.Television); - KeepCurrentNextUpToDate(ChannelType.Radio); + TimeSpan ts = DateTime.Now - _updateTimer; + if (ts.TotalMilliseconds > 2000) + { + _updateTimer = DateTime.Now; + KeepCurrentNextUpToDate(ChannelType.Television); + KeepCurrentNextUpToDate(ChannelType.Radio); + } // Zapping to another group or channel? if (_zapGroup != null || _zapChannel != null) @@ -469,7 +475,8 @@ Channel zappingTo = _zapChannel; if (ForTheRecordMain.Navigator.CurrentChannel != null - && ForTheRecordMain.Navigator.CurrentChannel.ChannelId == zappingTo.ChannelId) + && ForTheRecordMain.Navigator.CurrentChannel.ChannelId == zappingTo.ChannelId + && _liveStream != null) { Log.Debug("ChannelNavigator: CheckChannelChange()_CurrentChannel.ChannelId = zappingTo.ChannelId --> break off zapping"); zappingTo = null; @@ -489,6 +496,20 @@ } _navigatorChannels[zappingTo.ChannelType].LastChannel = _currentChannel; _navigatorChannels[zappingTo.ChannelType].LastChannelGroup = _currentChannelGroup; + + try + { + if (zappingTo.ChannelType == ChannelType.Television) + { + TvHome.UpdateProgressPercentageBar(); + } + else + { + RadioHome.UpdateProgressPercentageBar(); + RadioHome.UpdateMusicProperties(); + } + } + catch { } } _zapChannelNr = -1; _reentrant = false; @@ -750,13 +771,14 @@ GetPlayerFileNameAndOffset(liveStream, out fileName, out seekOffset);*/ g_Player.OnZapping(-1); + double duration = g_Player.Duration; if (g_Player.Duration < 0.0) { result = LiveStreamResult.UnknownError; } else { - g_Player.SeekAbsolute(g_Player.Duration + 0); + g_Player.SeekAbsolute(duration); } } @@ -912,16 +934,44 @@ null); msg.TargetWindowId = (int)(int)GUIWindow.Window.WINDOW_TVFULLSCREEN; GUIGraphicsContext.SendMessage(msg); - return; } else { // if not fulscreen, show notify dialog with the error message + string caption = string.Empty; + string tvlogo = string.Empty; + + if (channel != null) + { + using (TvSchedulerServiceAgent TvSchedulerAgent = new TvSchedulerServiceAgent()) + { + tvlogo = Utility.GetLogoImage(channel, TvSchedulerAgent); + } + + if (channel.ChannelType == ChannelType.Television) + { + caption = GUILocalizeStrings.Get(605) + " - " + channel.DisplayName; + } + else + { + caption = GUILocalizeStrings.Get(665) + " - " + channel.DisplayName; + } + } + GUIDialogNotify pDlgNotify = (GUIDialogNotify)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_NOTIFY); - string caption = GUILocalizeStrings.Get(605) + " - " + channel.DisplayName; - pDlgNotify.SetHeading(caption); //my tv - pDlgNotify.SetText(TuningResult); - pDlgNotify.DoModal((int)GUIWindowManager.ActiveWindowEx); + if (pDlgNotify != null) + { + pDlgNotify.Reset(); + pDlgNotify.ClearAll(); + pDlgNotify.SetHeading(caption); + if (!string.IsNullOrEmpty(TuningResult)) + { + pDlgNotify.SetText(TuningResult); + } + pDlgNotify.SetImage(tvlogo); + pDlgNotify.TimeOut = 5; + pDlgNotify.DoModal(GUIWindowManager.ActiveWindow); + } } } @@ -934,6 +984,30 @@ GetPlayerFileNameAndOffset(liveStream, out fileName, out seekOffset); RecordedBase.RememberActiveRecordingPosition(); int timeout = 0; + + if (!ForTheRecordMain.PreferRtspForLiveTv && seekOffset == 0) + { + bool tsFileExists = false; + while (!tsFileExists && timeout < 100) + { + tsFileExists = System.IO.File.Exists(fileName); + if (!tsFileExists) + { + Log.Info("Channelnavigator: startplay: waiting for TS file {0}", fileName); + timeout++; + Thread.Sleep(10); + } + } + if (timeout >= 100) + { + result = LiveStreamResult.UnknownError; + g_Player.Stop(); + Log.Debug("ChannelNavigator: PlayLiveStream_Result = {0}", result); + return result; + } + timeout = 0; + } + for (; ; ) { if (g_Player.Play(fileName, @@ -945,10 +1019,10 @@ if (duration < 0.0) { g_Player.Stop(); - timeout = timeout + 10; + timeout++; Log.Debug("ChannelNavigator: PlayLiveStream_timeout = {0}", timeout); Thread.Sleep(20); - if (timeout > 5000) + if (timeout > 100) { result = LiveStreamResult.UnknownError; Log.Debug("ChannelNavigator: PlayLiveStream_timeout from 5000ms reached"); @@ -956,9 +1030,9 @@ } continue; } - g_Player.SeekAbsolute(g_Player.Duration + seekOffset); - _liveStream = liveStream; - _liveStreamIsRtsp = fileName.StartsWith("rtsp:", StringComparison.InvariantCultureIgnoreCase); + g_Player.SeekAbsolute(duration); + _liveStream = liveStream; + _liveStreamIsRtsp = fileName.StartsWith("rtsp:", StringComparison.InvariantCultureIgnoreCase); } else { @@ -1016,20 +1090,6 @@ } } } - if (g_Player.Playing - && (g_Player.IsTV || g_Player.IsRadio)) - { - if (_navigatorChannels[channelType].CurrentProgram != null) - { - g_Player.currentTitle = _navigatorChannels[channelType].CurrentProgram.CreateProgramTitle(); - g_Player.currentDescription = _navigatorChannels[channelType].CurrentProgram.CreateCombinedDescription(true); - } - else - { - g_Player.currentTitle = String.Empty; - g_Player.currentDescription = String.Empty; - } - } } private void RefreshCurrentAndNext(ChannelType channelType) Added: trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/EventListener.cs =================================================================== --- trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/EventListener.cs (rev 0) +++ trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/EventListener.cs 2011-10-18 08:18:48 UTC (rev 4311) @@ -0,0 +1,268 @@ +#region Copyright (C) 2007-2011 For The Record +/* + * Copyright (C) 2007-2011 For The Record + * http://www.4therecord.eu + * + * 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.Generic; +using System.Linq; +using System.Text; +using System.Net; +using System.ServiceModel; + +using MediaPortal.GUI.Library; +using MediaPortal.Player; + +using ForTheRecord.ServiceContracts.Events; +using ForTheRecord.ServiceAgents; +using ForTheRecord.Entities; +using ForTheRecord.Client.Common; + +namespace ForTheRecord.UI.MediaPortal +{ + [ServiceBehavior(ConcurrencyMode = ConcurrencyMode.Single, + InstanceContextMode = InstanceContextMode.Single)] + + public class EventListener : EventsListenerServiceBase + { + private string _serviceUrl = string.Empty; + private ServiceHost _serviceHost = null; + private bool stopping = false; + + # region EventListener Members + + public override void LiveStreamEnded(LiveStream liveStream) + { + Log.Debug("EventListener: LiveStreamEnded()"); + OnLiveStreamEnded(liveStream); + } + + public override void UpcomingRecordingsChanged() + { + Log.Debug("EventListener: UpcomingRecordingsChanged()"); + //ForTheRecordMain.UpcomingRecordingsChanged = true; + } + + public override void RecordingStarted(Recording recording) + { + Log.Debug("EventListener: recording started: {0}", recording.Title); + OnrecordingStarted(recording); + } + + public override void RecordingEnded(Recording recording) + { + Log.Debug("EventListener: recording ended: {0}", recording.Title); + //OnRecordingEnded(recording); + } + + public override void ActiveRecordingsChanged() + { + Log.Debug("EventListener: ActiveRecordingsChanged()"); + } + + public override void UpcomingAlertsChanged() + { + Log.Debug("EventListener: UpcomingAlertsChanged()"); + //ForTheRecordMain.UpcomingAlertsChanged = true; + } + + # endregion + + # region Start/Stop + + private object StartListenerLock = new object(); + public void StartListener() + { + lock (StartListenerLock) + { + int _port = GetFreeTcpPort(49800); + if (_port == -1) + { + Log.Error("EventListener: No free port found!"); + return; + } + + _serviceUrl = "net.tcp://" + Dns.GetHostName() + ":" + _port + "/MpClient/"; + StopListener(); + + Log.Debug("EventListener: start()"); + _serviceHost = CreateServiceHost(_serviceUrl); + _serviceHost.Open(); + + bool failed = true; + while (failed && !stopping) + { + failed = false; + try + { + using (ForTheRecordServiceAgent agent = new ForTheRecordServiceAgent()) + { + agent.EnsureEventListener(ForTheRecordEventGroup.RecordingEvents | ForTheRecordEventGroup.ScheduleEvents, _serviceUrl, Constants.EventListenerApiVersion); + } + } + catch (Exception ex) + { + Log.Error("EventListener: StartListener() error = {0}", ex.Message); + System.Threading.Thread.Sleep(2000); + failed = true; + } + } + } + } + + private object StopListenerLock = new object(); + public void StopListener() + { + lock (StopListenerLock) + { + Log.Debug("EventListener: stop()"); + stopping = true; + bool failed = true; + while (failed) + { + failed = false; + try + { + using (ForTheRecordServiceAgent agent = new ForTheRecordServiceAgent()) + { + agent.RemoveEventListener(_serviceUrl); + } + } + catch (Exception ex) + { + Log.Error("EventListener: StopListener() error = {0}", ex.Message); + System.Threading.Thread.Sleep(2000); + failed = true; + } + } + + if (_serviceHost != null) + { + _serviceHost.Close(); + } + stopping = false; + } + } + + #endregion + + #region Private Methods + + + private void OnLiveStreamEnded(LiveStream liveStream) + { + lock (this) + { + GUIMessage msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_STOP_SERVER_TIMESHIFTING, 0, 0, 0, 0, 0, null); + msg.Object = liveStream; + msg.Param1 = 4321; + GUIGraphicsContext.SendMessage(msg); + msg = null; + } + } + + private void OnRecordingEnded(Recording recording) + { + lock (this) + { + GUIMessage msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_NOTIFY_REC, 0, 0, 0, 0, 0, null); + msg.Param1 = 0;//ended + msg.Object = recording; + GUIGraphicsContext.SendMessage(msg); + msg = null; + } + } + + private void OnrecordingStarted(Recording recording) + { + lock (this) + { + if (ForTheRecordMain.Navigator.IsLiveStreamOn) + { + LiveStream livestream = ForTheRecordMain.Navigator.LiveStream; + if (livestream != null) + { + bool _streamStopped = false; + int timeout = 0; + + using (TvControlServiceAgent tvControlAgent = new TvControlServiceAgent()) + { + while (timeout < 20 && _streamStopped == false) + { + LiveStream[] livestreams = tvControlAgent.GetLiveStreams(); + _streamStopped = true; + foreach (LiveStream stream in livestreams) + { + if (stream.TimeshiftFile == livestream.TimeshiftFile) + { + _streamStopped = false; + } + } + timeout++; + System.Threading.Thread.Sleep(100); + } + + if (_streamStopped) + { + OnLiveStreamEnded(livestream); + } + } + } + } + + /*GUIMessage msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_NOTIFY_REC, 0, 0, 0, 0, 0, null); + msg.Param1 = 1;//started + msg.Object = recording; + GUIGraphicsContext.SendMessage(msg); + msg = null;*/ + } + } + + private static int GetFreeTcpPort(int port) + { + int _port = -1; + for (int i = 0; i < 100; i++) + { + try + { + System.Net.Sockets.TcpListener tcpListener = new System.Net.Sockets.TcpListener(IPAddress.Any, port); + tcpListener.Start(); + tcpListener.Stop(); + _port = port; + break; + } + catch (System.Net.Sockets.SocketException) + { + port--; + } + } + Log.Debug("EventListener: listener port = {0}", port); + return _port; + } + + private static ServiceHost CreateServiceHost(string eventsServiceBaseUrl) + { + return CreateServiceHost(typeof(EventListener), eventsServiceBaseUrl, typeof(IRecordingEventsListener), typeof(IScheduleEventsListener)); + } + + #endregion + } +} Modified: trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/ForTheRecord.UI.MediaPortal.csproj =================================================================== --- trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/ForTheRecord.UI.MediaPortal.csproj 2011-10-09 09:23:41 UTC (rev 4310) +++ trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/ForTheRecord.UI.MediaPortal.csproj 2011-10-18 08:18:48 UTC (rev 4311) @@ -95,6 +95,7 @@ <SpecificVersion>False</SpecificVersion> <HintPath>..\..\..\..\Program Files\Reference Assemblies\Microsoft\WinFX\v3.0\System.Runtime.Remoting.dll</HintPath> </Reference> + <Reference Include="System.ServiceModel" /> <Reference Include="System.Windows.Forms" /> <Reference Include="System.Xml" /> <Reference Include="TvLibrary.Interfaces, Version=1.0.3.28723, Culture=neutral, processorArchitecture=x86"> @@ -112,6 +113,7 @@ <ItemGroup> <Compile Include="ActiveRecordings.cs" /> <Compile Include="ChannelNavigator.cs" /> + <Compile Include="EventListener.cs" /> <Compile Include="Hamming.cs" /> <Compile Include="TeletextPageRenderer.cs" /> <Compile Include="TvFullscreenTeletext.cs" /> @@ -163,156 +165,68 @@ <Content Include="language\fortherecord_nl.xml" /> <Content Include="language\fortherecord_pl.xml" /> <Content Include="language\fortherecord_sv.xml" /> - <Content Include="skin\Aeon wide\4TR_Active.xml" /> - <Content Include="skin\Aeon wide\4TR_Home.xml" /> - <Content Include="skin\Aeon wide\4TR_ProgramInfo.xml" /> - <Content Include="skin\Aeon wide\4TR_RadioGuide.xml" /> - <Content Include="skin\Aeon wide\4TR_RadioGuideSearch.xml" /> - <Content Include="skin\Aeon wide\4TR_RadioHome.xml" /> - <Content Include="skin\Aeon wide\4TR_RecordedRadio.xml" /> - <Content Include="skin\Aeon wide\4TR_RecordedTv.xml" /> - <Content Include="skin\Aeon wide\4TR_TvGuide.xml" /> - <Content Include="skin\Aeon wide\4TR_TvGuideSearch.xml" /> - <Content Include="skin\Aeon wide\4TR_Upcoming.xml" /> - <Content Include="skin\Aeon wide\common.window.short.xml" /> - <Content Include="skin\Aeon wide\Media\4TR_Alert.png" /> - <Content Include="skin\Aeon wide\Media\4TR_AlertCancelled.png" /> - <Content Include="skin\Aeon wide\Media\4TR_AlertSeries.png" /> - <Content Include="skin\Aeon wide\Media\4TR_AlertSeriesCancelled.png" /> - <Content Include="skin\Aeon wide\Media\4TR_Recording.png" /> - <Content Include="skin\Aeon wide\Media\4TR_RecordingCancelled.png" /> - <Content Include="skin\Aeon wide\Media\4TR_RecordingCancelledHistory.png" /> - <Content Include="skin\Aeon wide\Media\4TR_RecordingInConflict.png" /> - <Content Include="skin\Aeon wide\Media\4TR_RecordingSeries.png" /> - <Content Include="skin\Aeon wide\Media\4TR_RecordingSeriesCancelled.png" /> - <Content Include="skin\Aeon wide\Media\4TR_RecordingSeriesCancelledHistory.png" /> - <Content Include="skin\Aeon wide\Media\4TR_RecordingSeriesInConflict.png" /> - <Content Include="skin\Aeon wide\Media\4TR_RecordingSeriesWithWarning.png" /> - <Content Include="skin\Aeon wide\Media\4TR_RecordingWithWarning.png" /> - <Content Include="skin\Aeon wide\Media\4TR_Suggestion.png" /> - <Content Include="skin\Aeon wide\Media\4TR_SuggestionCancelled.png" /> - <Content Include="skin\Aeon wide\Media\4TR_SuggestionSeries.png" /> - <Content Include="skin\Aeon wide\Media\4TR_SuggestionSeriesCancelled.png" /> - <Content Include="skin\Aeon wide\Media\togglebutton-off-focus.png" /> - <Content Include="skin\Aeon wide\Media\togglebutton-off-nofocus.png" /> - <Content Include="skin\Aeon wide\Media\togglebutton-on-focus.png" /> - <Content Include="skin\Aeon wide\Media\togglebutton-on-nofocus.png" /> - <Content Include="skin\Blue3wide\4TR_Active.xml" /> - <Content Include="skin\Blue3wide\4TR_Home.xml" /> - <Content Include="skin\Blue3wide\4TR_ProgramInfo.xml" /> - <Content Include="skin\Blue3wide\4TR_RadioGuide.xml" /> - <Content Include="skin\Blue3wide\4TR_RadioGuideSearch.xml" /> - <Content Include="skin\Blue3wide\4TR_RadioHome.xml" /> - <Content Include="skin\Blue3wide\4TR_RecordedRadio.xml" /> - <Content Include="skin\Blue3wide\4TR_RecordedTv.xml" /> - <Content Include="skin\Blue3wide\4TR_TvGuide.xml" /> - <Content Include="skin\Blue3wide\4TR_TvGuideSearch.xml" /> - <Content Include="skin\Blue3wide\4TR_Upcoming.xml" /> - <Content Include="skin\Blue3wide\Media\4TR_Alert.png" /> - <Content Include="skin\Blue3wide\Media\4TR_AlertCancelled.png" /> - <Content Include="skin\Blue3wide\Media\4TR_AlertSeries.png" /> - <Content Include="skin\Blue3wide\Media\4TR_AlertSeriesCancelled.png" /> - <Content Include="skin\Blue3wide\Media\4TR_Recording.png" /> - <Content Include="skin\Blue3wide\Media\4TR_RecordingCancelled.png" /> - <Content Include="skin\Blue3wide\Media\4TR_RecordingCancelledHistory.png" /> - <Content Include="skin\Blue3wide\Media\4TR_RecordingInConflict.png" /> - <Content Include="skin\Blue3wide\Media\4TR_RecordingSeries.png" /> - <Content Include="skin\Blue3wide\Media\4TR_RecordingSeriesCancelled.png" /> - <Content Include="skin\Blue3wide\Media\4TR_RecordingSeriesCancelledHistory.png" /> - <Content Include="skin\Blue3wide\Media\4TR_RecordingSeriesInConflict.png" /> - <Content Include="skin\Blue3wide\Media\4TR_RecordingSeriesWithWarning.png" /> - <Content Include="skin\Blue3wide\Media\4TR_RecordingWithWarning.png" /> - <Content Include="skin\Blue3wide\Media\4TR_Suggestion.png" /> - <Content Include="skin\Blue3wide\Media\4TR_SuggestionCancelled.png" /> - <Content Include="skin\Blue3wide\Media\4TR_SuggestionSeries.png" /> - <Content Include="skin\Blue3wide\Media\4TR_SuggestionSeriesCancelled.png" /> - <Content Include="skin\Blue3\4TR_Active.xml" /> - <Content Include="skin\Blue3\4TR_Home.xml" /> - <Content Include="skin\Blue3\4TR_ProgramInfo.xml" /> - <Content Include="skin\Blue3\4TR_RadioGuide.xml" /> - <Content Include="skin\Blue3\4TR_RadioGuideSearch.xml" /> - <Content Include="skin\Blue3\4TR_RadioHome.xml" /> - <Content Include="skin\Blue3\4TR_RecordedRadio.xml" /> - <Content Include="skin\Blue3\4TR_RecordedTv.xml" /> - <Content Include="skin\Blue3\4TR_TvGuide.xml" /> - <Content Include="skin\Blue3\4TR_TvGuideSearch.xml" /> - <Content Include="skin\Blue3\4TR_Upcoming.xml" /> - <Content Include="skin\Blue3\Media\4TR_Alert.png" /> - <Content Include="skin\Blue3\Media\4TR_AlertCancelled.png" /> - <Content Include="skin\Blue3\Media\4TR_AlertSeries.png" /> - <Content Include="skin\Blue3\Media\4TR_AlertSeriesCancelled.png" /> - <Content Include="skin\Blue3\Media\4TR_Recording.png" /> - <Content Include="skin\Blue3\Media\4TR_RecordingCancelled.png" /> - <Content Include="skin\Blue3\Media\4TR_RecordingCancelledHistory.png" /> - <Content Include="skin\Blue3\Media\4TR_RecordingInConflict.png" /> - <Content Include="skin\Blue3\Media\4TR_RecordingSeries.png" /> - <Content Include="skin\Blue3\Media\4TR_RecordingSeriesCancelled.png" /> - <Content Include="skin\Blue3\Media\4TR_RecordingSeriesCancelledHistory.png" /> - <Content Include="skin\Blue3\Media\4TR_RecordingSeriesInConflict.png" /> - <Content Include="skin\Blue3\Media\4TR_RecordingSeriesWithWarning.png" /> - <Content Include="skin\Blue3\Media\4TR_RecordingWithWarning.png" /> - <Content Include="skin\Blue3\Media\4TR_Suggestion.png" /> - <Content Include="skin\Blue3\Media\4TR_SuggestionCancelled.png" /> - <Content Include="skin\Blue3\Media\4TR_SuggestionSeries.png" /> - <Content Include="skin\Blue3\Media\4TR_SuggestionSeriesCancelled.png" /> - <Content Include="skin\Indigo\4TR_Active.xml" /> - <Content Include="skin\Indigo\4TR_Home.xml" /> - <Content Include="skin\Indigo\4TR_ProgramInfo.xml" /> - <Content Include="skin\Indigo\4TR_RadioGuide.xml" /> - <Content Include="skin\Indigo\4TR_RadioGuideSearch.xml" /> - <Content Include="skin\Indigo\4TR_RadioHome.xml" /> - <Content Include="skin\Indigo\4TR_RecordedRadio.xml" /> - <Content Include="skin\Indigo\4TR_RecordedTv.xml" /> - <Content Include="skin\Indigo\4TR_TvGuide.xml" /> - <Content Include="skin\Indigo\4TR_TvGuideSearch.xml" /> - <Content Include="skin\Indigo\4TR_Upcoming.xml" /> - <Content Include="skin\Indigo\Media\4TR_Alert.png" /> - <Content Include="skin\Indigo\Media\4TR_AlertCancelled.png" /> - <Content Include="skin\Indigo\Media\4TR_AlertSeries.png" /> - <Content Include="skin\Indigo\Media\4TR_AlertSeriesCancelled.png" /> - <Content Include="skin\Indigo\Media\4TR_Recording.png" /> - <Content Include="skin\Indigo\Media\4TR_RecordingCancelled.png" /> - <Content Include="skin\Indigo\Media\4TR_RecordingInConflict.png" /> - <Content Include="skin\Indigo\Media\4TR_RecordingSeries.png" /> - <Content Include="skin\Indigo\Media\4TR_RecordingSeriesCancelled.png" /> - <Content Include="skin\Indigo\Media\4TR_RecordingSeriesInConflict.png" /> - <Content Include="skin\Indigo\Media\4TR_RecordingSeriesWithWarning.png" /> - <Content Include="skin\Indigo\Media\4TR_RecordingWithWarning.png" /> - <Content Include="skin\Indigo\Media\4TR_Suggestion.png" /> - <Content Include="skin\Indigo\Media\4TR_SuggestionCancelled.png" /> - <Content Include="skin\Indigo\Media\4TR_SuggestionSeries.png" /> - <Content Include="skin\Indigo\Media\4TR_SuggestionSeriesCancelled.png" /> - <Content Include="skin\Indigo\Media\4TR_RecordingSeriesCancelledHistory.png" /> - <Content Include="skin\Indigo\Media\4TR_RecordingCancelledHistory.png" /> - <Content Include="skin\Monochrome\4TR_Active.xml" /> - <Content Include="skin\Monochrome\4TR_Home.xml" /> - <Content Include="skin\Monochrome\4TR_ProgramInfo.xml" /> - <Content Include="skin\Monochrome\4TR_RadioGuide.xml" /> - <Content Include="skin\Monochrome\4TR_RadioGuideSearch.xml" /> - <Content Include="skin\Monochrome\4TR_RadioHome.xml" /> - <Content Include="skin\Monochrome\4TR_RecordedRadio.xml" /> - <Content Include="skin\Monochrome\4TR_RecordedTv.xml" /> - <Content Include="skin\Monochrome\4TR_TvGuide.xml" /> - <Content Include="skin\Monochrome\4TR_TvGuideSearch.xml" /> - <Content Include="skin\Monochrome\4TR_Upcoming.xml" /> - <Content Include="skin\Monochrome\Media\4TR_Alert.png" /> - <Content Include="skin\Monochrome\Media\4TR_AlertCancelled.png" /> - <Content Include="skin\Monochrome\Media\4TR_AlertSeries.png" /> - <Content Include="skin\Monochrome\Media\4TR_AlertSeriesCancelled.png" /> - <Content Include="skin\Monochrome\Media\4TR_Recording.png" /> - <Content Include="skin\Monochrome\Media\4TR_RecordingCancelled.png" /> - <Content Include="skin\Monochrome\Media\4TR_RecordingCancelledHistory.png" /> - <Content Include="skin\Monochrome\Media\4TR_RecordingInConflict.png" /> - <Content Include="skin\Monochrome\Media\4TR_RecordingSeries.png" /> - <Content Include="skin\Monochrome\Media\4TR_RecordingSeriesCancelled.png" /> - <Content Include="skin\Monochrome\Media\4TR_RecordingSeriesCancelledHistory.png" /> - <Content Include="skin\Monochrome\Media\4TR_RecordingSeriesInConflict.png" /> - <Content Include="skin\Monochrome\Media\4TR_RecordingSeriesWithWarning.png" /> - <Content Include="skin\Monochrome\Media\4TR_RecordingWithWarning.png" /> - <Content Include="skin\Monochrome\Media\4TR_Suggestion.png" /> - <Content Include="skin\Monochrome\Media\4TR_SuggestionCancelled.png" /> - <Content Include="skin\Monochrome\Media\4TR_SuggestionSeries.png" /> - <Content Include="skin\Monochrome\Media\4TR_SuggestionSeriesCancelled.png" /> + <Content Include="skin\DefaultWide\4TR_Active.xml" /> + <Content Include="skin\DefaultWide\4TR_common.window.xml" /> + <Content Include="skin\DefaultWide\4TR_Home.xml" /> + <Content Include="skin\DefaultWide\4TR_ProgramInfo.xml" /> + <Content Include="skin\DefaultWide\4TR_RadioGuide.xml" /> + <Content Include="skin\DefaultWide\4TR_RadioGuideSearch.xml" /> + <Content Include="skin\DefaultWide\4TR_RadioHome.xml" /> + <Content Include="skin\DefaultWide\4TR_RecordedRadio.xml" /> + <Content Include="skin\DefaultWide\4TR_RecordedTv.xml" /> + <Content Include="skin\DefaultWide\4TR_TvGuide.xml" /> + <Content Include="skin\DefaultWide\4TR_TvGuideSearch.xml" /> + <Content Include="skin\DefaultWide\4TR_Upcoming.xml" /> + <Content Include="skin\DefaultWide\Media\4TR_Alert.png" /> + <Content Include="skin\DefaultWide\Media\4TR_AlertCancelled.png" /> + <Content Include="skin\DefaultWide\Media\4TR_AlertSeries.png" /> + <Content Include="skin\DefaultWide\Media\4TR_AlertSeriesCancelled.png" /> + <Content Include="skin\DefaultWide\Media\4TR_hover_logo-noglow.png" /> + <Content Include="skin\DefaultWide\Media\4TR_logo.png" /> + <Content Include="skin\DefaultWide\Media\4TR_Recording.png" /> + <Content Include="skin\DefaultWide\Media\4TR_RecordingCancelled.png" /> + <Content Include="skin\DefaultWide\Media\4TR_RecordingCancelledHistory.png" /> + <Content Include="skin\DefaultWide\Media\4TR_RecordingInConflict.png" /> + <Content Include="skin\DefaultWide\Media\4TR_RecordingSeries.png" /> + <Content Include="skin\DefaultWide\Media\4TR_RecordingSeriesCancelled.png" /> + <Content Include="skin\DefaultWide\Media\4TR_RecordingSeriesCancelledHistory.png" /> + <Content Include="skin\DefaultWide\Media\4TR_RecordingSeriesInConflict.png" /> + <Content Include="skin\DefaultWide\Media\4TR_RecordingSeriesWithWarning.png" /> + <Content Include="skin\DefaultWide\Media\4TR_RecordingWithWarning.png" /> + <Content Include="skin\DefaultWide\Media\4TR_Suggestion.png" /> + <Content Include="skin\DefaultWide\Media\4TR_SuggestionCancelled.png" /> + <Content Include="skin\DefaultWide\Media\4TR_SuggestionSeries.png" /> + <Content Include="skin\DefaultWide\Media\4TR_SuggestionSeriesCancelled.png" /> + <Content Include="skin\Default\4TR_Active.xml" /> + <Content Include="skin\Default\4TR_Home.xml" /> + <Content Include="skin\Default\4TR_ProgramInfo.xml" /> + <Content Include="skin\Default\4TR_RadioGuide.xml" /> + <Content Include="skin\Default\4TR_RadioGuideSearch.xml" /> + <Content Include="skin\Default\4TR_RadioHome.xml" /> + <Content Include="skin\Default\4TR_RecordedRadio.xml" /> + <Content Include="skin\Default\4TR_RecordedTv.xml" /> + <Content Include="skin\Default\4TR_TvGuide.xml" /> + <Content Include="skin\Default\4TR_TvGuideSearch.xml" /> + <Content Include="skin\Default\4TR_Upcoming.xml" /> + <Content Include="skin\Default\Media\4TR_Alert.png" /> + <Content Include="skin\Default\Media\4TR_AlertCancelled.png" /> + <Content Include="skin\Default\Media\4TR_AlertSeries.png" /> + <Content Include="skin\Default\Media\4TR_AlertSeriesCancelled.png" /> + <Content Include="skin\Default\Media\4TR_logo.png" /> + <Content Include="skin\Default\Media\4TR_Recording.png" /> + <Content Include="skin\Default\Media\4TR_RecordingCancelled.png" /> + <Content Include="skin\Default\Media\4TR_RecordingCancelledHistory.png" /> + <Content Include="skin\Default\Media\4TR_RecordingInConflict.png" /> + <Content Include="skin\Default\Media\4TR_RecordingSeries.png" /> + <Content Include="skin\Default\Media\4TR_RecordingSeriesCancelled.png" /> + <Content Include="skin\Default\Media\4TR_RecordingSeriesCancelledHistory.png" /> + <Content Include="skin\Default\Media\4TR_RecordingSeriesInConflict.png" /> + <Content Include="skin\Default\Media\4TR_RecordingSeriesWithWarning.png" /> + <Content Include="skin\Default\Media\4TR_RecordingWithWarning.png" /> + <Content Include="skin\Default\Media\4TR_Suggestion.png" /> + <Content Include="skin\Default\Media\4TR_SuggestionCancelled.png" /> + <Content Include="skin\Default\Media\4TR_SuggestionSeries.png" /> + <Content Include="skin\Default\Media\4TR_SuggestionSeriesCancelled.png" /> </ItemGroup> <ItemGroup> <None Include="PostBuild.cmd" /> Modified: trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/ForTheRecordMain.cs =================================================================== --- trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/ForTheRecordMain.cs 2011-10-09 09:23:41 UTC (rev 4310) +++ trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/ForTheRecordMain.cs 2011-10-18 08:18:48 UTC (rev 4311) @@ -103,6 +103,18 @@ return false; } + internal static bool IsRecordingStillActive(Guid recordingID) + { + foreach (ActiveRecording rec in ActiveRecordings) + { + if (rec.RecordingId == recordingID) + { + return true; + } + } + return false; + } + #endregion #region Settings @@ -147,10 +159,10 @@ internal static bool EnsureConnection() { - return EnsureConnection(true); + return EnsureConnection(true, true); } - internal static bool EnsureConnection(bool showPreviousOnError) + internal static bool EnsureConnection(bool showPreviousOnError, bool schowError) { if (!ServiceChannelFactories.IsInitialized) { @@ -166,8 +178,8 @@ } catch (ForTheRecordNotFoundException ex) { - if ((showPreviousOnError || !_connectionErrorShown) - && GUIWindowManager.ActiveWindow != 0) + if (((showPreviousOnError || !_connectionErrorShown) + && GUIWindowManager.ActiveWindow != 0) && schowError) { GUIDialogOK dlg = (GUIDialogOK)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_OK); dlg.SetHeading("Failed to connect to For The Record"); @@ -180,8 +192,8 @@ } catch (Exception ex) { - if ((showPreviousOnError || !_connectionErrorShown) - && GUIWindowManager.ActiveWindow != 0) + if (((showPreviousOnError || !_connectionErrorShown) + && GUIWindowManager.ActiveWindow != 0) && schowError) { GUIDialogOK dlg = (GUIDialogOK)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_OK); dlg.SetHeading("Failed to connect to For The Record"); @@ -195,7 +207,8 @@ } if (!ServiceChannelFactories.IsInitialized) { - if (showPreviousOnError) + if (showPreviousOnError + && GUIWindowManager.ActiveWindow != 0) { GUIWindowManager.ShowPreviousWindow(); } @@ -214,6 +227,15 @@ { if (_navigator == null) { + if (!ServiceChannelFactories.IsInitialized) + { + Log.Error("waiting for a connection to the core service, before starting the navigator"); + while (!EnsureConnection(false, false)) + { + System.Threading.Thread.Sleep(1000); + } + Log.Error("waiting for a connection to the core service, before starting the navigator, succeed!!"); + } _navigator = new ChannelNavigator(); } return _navigator; Modified: trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/GuideBase.cs =================================================================== --- trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/GuideBase.cs 2011-10-09 09:23:41 UTC (rev 4310) +++ trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/GuideBase.cs 2011-10-18 08:18:48 UTC (rev 4311) @@ -289,6 +289,11 @@ { currentChannelName = _currentChannel.DisplayName; } + + if (_channelOffset < 0) + { + _channelOffset = 0; + } } _useNewRecordingButtonColor = Utils.FileExistsInCache(Path.Combine(GUIGraphicsContext.Skin, @"media\tvguide_recButton_Focus_middle.png")); @@ -804,14 +809,18 @@ int iItemHeight = cntlChannelTemplate.Height; _channelCount = (int)(((float)iHeight) / ((float)iItemHeight)); - if (message.Param1 != (int)WindowId.ProgramInfo) + bool isPreviousWindowTvGuideRelated = (message.Param1 == (int)Window.WINDOW_TV_PROGRAM_INFO || + message.Param1 == (int)Window.WINDOW_VIDEO_INFO); + + if (!isPreviousWindowTvGuideRelated) { UnFocus(); } + GetChannels(true); LoadSchedules(true); _currentProgram = null; - if (message.Param1 != (int)WindowId.ProgramInfo) + if (!isPreviousWindowTvGuideRelated) { _viewingTime = DateTime.Now; _cursorY = 0; @@ -834,19 +843,20 @@ } } - // Last page adjust (To get a full page channel listing) - if ((_channelList.Count > _channelCount) && (_cursorX > _channelList.Count - Math.Min(_channelList.Count, _channelCount) + 1)) - { - _channelOffset = _channelList.Count - _channelCount; - _cursorX = _cursorX - _channelOffset; - } - while (_cursorX >= _channelCount) { _cursorX -= _channelCount; _channelOffset += _channelCount; } + // Mantis 3579: the above lines can lead to too large channeloffset. + // Now we check if the offset is too large, and if it is, we reduce it and increase the cursor position accordingly + if (!_guideContinuousScroll && (_channelOffset > _channelList.Count - _channelCount) && (_channelList.Count - _channelCount > 0)) + { + _cursorX += _channelOffset - (_channelList.Count - _channelCount); + _channelOffset = _channelList.Count - _channelCount; + } + GUISpinControl cntlDay = GetControl((int)Controls.SPINCONTROL_DAY) as GUISpinControl; if (cntlDay != null) { @@ -905,7 +915,7 @@ Log.Debug("TvGuideBase: SpinControl cntlTimeInterval is null!"); } - if (message.Param1 != (int)WindowId.ProgramInfo) + if (!isPreviousWindowTvGuideRelated) { Update(true); } @@ -1528,8 +1538,12 @@ && chan.LogicalChannelNumber.HasValue) { channelNumber = chan.LogicalChannelNumber.Value.ToString(); + GUIPropertyManager.SetProperty(SkinPropertyPrefix + ".Guide.ChannelNumber", channelNumber); } - GUIPropertyManager.SetProperty(SkinPropertyPrefix + ".Guide.ChannelNumber", channelNumber); + else + { + GUIPropertyManager.SetProperty(SkinPropertyPrefix + ".Guide.ChannelNumber", String.Empty); + } } if (_cursorY == 0 || _currentProgram == null) @@ -3686,10 +3700,13 @@ if (channel != null && _currentProgram != null) { - if (TvProgramInfo.RecordProgram(channel, _currentProgram)) + if (TvProgramInfo.RecordProgram(channel, _currentProgram, true)) { LoadSchedules(true); UpdateCurrentProgram(true); + UnFocus(); + Update(false); + SetFocus(); } } } @@ -3739,7 +3756,7 @@ UnFocus(); for (int i = 0; i < Steps; ++i) { - OnUp(true, true); + OnUp(false, true); } Correct(); Update(false); @@ -3775,7 +3792,7 @@ UnFocus(); for (int i = 0; i < Steps; ++i) { - OnDown(true); + OnDown(false); } Correct(); Update(false); Modified: trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/GuideSearchBase.cs =================================================================== --- trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/GuideSearchBase.cs 2011-10-09 09:23:41 UTC (rev 4310) +++ trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/GuideSearchBase.cs 2011-10-18 08:18:48 UTC (rev 4311) @@ -363,8 +363,16 @@ } } - string strObjects = string.Format("{0} {1}", _viewsList.Count, Utility.GetLocalizedText(TextId.RecordingsListItemsSuffix)); - GUIPropertyManager.SetProperty("#itemcount", strObjects); + GUIPropertyManager.SetProperty("#itemcount", _viewsList.Count.ToString()); + if (this._channelType == ChannelType.Television) + { + GUIPropertyManager.SetProperty("#currentmodule", GUILocalizeStrings.Get(100604)); + } + else + { + //TODO: new string for radio search + GUIPropertyManager.SetProperty("#currentmodule", GUILocalizeStrings.Get(100604)); + } _sortByButton.IsEnabled = !showTitles; Modified: trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/HomeBase.cs =================================================================== --- trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/HomeBase.cs 2011-10-09 09:23:41 UTC (rev 4310) +++ trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/HomeBase.cs 2011-10-18 08:18:48 UTC (rev 4311) @@ -179,6 +179,15 @@ GUIPropertyManager.SetProperty("#itemcount", String.Empty); GUIPropertyManager.SetProperty("#selecteditem", String.Empty); + if (this._channelType == ChannelType.Television) + { + GUIPropertyManager.SetProperty("#currentmodule", GUILocalizeStrings.Get(100001)); + } + else + { + GUIPropertyManager.SetProperty("#currentmodule", GUILocalizeStrings.Get(100030)); + } + if (!ForTheRecordMain.Navigator.IsLiveStreamOn && this.AutoTurnOnStream && !PreviousWindowWasPluginWindow()) @@ -674,8 +683,8 @@ GUIPropertyManager.SetProperty(guiPropertyPrefix + ".Record.percent1", percentage); GUIPropertyManager.SetProperty(guiPropertyPrefix + ".Record.percent2", "0"); GUIPropertyManager.SetProperty(guiPropertyPrefix + ".Record.percent3", "0"); - GUIPropertyManager.SetProperty(guiPropertyPrefix + ".View.title", g_Player.currentTitle); - GUIPropertyManager.SetProperty(guiPropertyPrefix + ".View.description", g_Player.currentDescription); + GUIPropertyManager.SetProperty(guiPropertyPrefix + ".View.title", playingRecording.Title/*g_Player.currentTitle*/); + GUIPropertyManager.SetProperty(guiPropertyPrefix + ".View.description", playingRecording.CreateCombinedDescription(true)/*g_Player.currentDescription*/); GUIPropertyManager.SetProperty(guiPropertyPrefix + ".View.start", global::MediaPortal.Util.Utils.SecondsToHMSString((int)currentPosition)); GUIPropertyManager.SetProperty(guiPropertyPrefix + ".View.stop", global::MediaPortal.Util.Utils.SecondsToHMSString((int)duration)); // GUIPropertyManager.SetProperty(guiPropertyPrefix + ".View.remaining", String.Empty); --> not needed? to be checked! @@ -728,7 +737,6 @@ IMG_REC_CHANNEL = 21, LABEL_REC_INFO = 22, IMG_REC_RECTANGLE = 23, - }; private bool _turnOnStreamNow; @@ -757,6 +765,11 @@ && ForTheRecordMain.Navigator.CurrentChannel.ChannelType == _channelType; } + /*if (_teletextButton != null && _teletextButton.IsEnabled != (ForTheRecordMain.Navigator.HasTeletext() && !g_Player.IsTVRecording && ForTheRecordMain.Navigator.IsLiveStreamOn)) + { + _teletextButton.IsEnabled = (ForTheRecordMain.Navigator.HasTeletext() && !g_Player.IsTVRecording && ForTheRecordMain.Navigator.IsLiveStreamOn); + }*/ + base.Process(); } @@ -897,6 +910,14 @@ { xmlSettings.SetValueAsBool("general", "wait for tvserver", false); } + + //hack for minidisplay plugin, minidislay don't work with 4TR as it wants to connect to mp tv server. + //by clearing the hostname, minidisplay don't search for a tv server and minidisplay is working. + string mpTvserviceHostname = xmlSettings.GetValueAsString("tvservice", "hostname", ""); + if (mpTvserviceHostname != string.Empty) + { + xmlSettings.SetValue("tvservice", "hostname", string.Empty); + } } } @@ -922,6 +943,8 @@ || prevId == (int)GUIWindow.Window.WINDOW_SCHEDULER || prevId == (int)GUIWindow.Window.WINDOW_SEARCHTV || prevId == (int)GUIWindow.Window.WINDOW_TV_TUNING_DETAILS + || prevId == (int)GUIWindow.Window.WINDOW_TV + || prevId == (int)GUIWindow.Window.WINDOW_TVGUIDE || prevId == (int)GUIWindow.Window.WINDOW_RADIO || prevId == (int)GUIWindow.Window.WINDOW_RADIO_GUIDE || prevId == WindowId.TvGuide Modified: trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/Properties/AssemblyInfo.cs 2011-10-09 09:23:41 UTC (rev 4310) +++ trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/Properties/AssemblyInfo.cs 2011-10-18 08:18:48 UTC (rev 4311) @@ -36,4 +36,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.UI.MediaPortal/RadioHome.cs =================================================================== --- trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/RadioHome.cs 2011-10-09 09:23:41 UTC (rev 4310) +++ trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/RadioHome.cs 2011-10-18 08:18:48 UTC (rev 4311) @@ -26,8 +26,10 @@ using MediaPortal.GUI.Library; using MediaPortal.Configuration; +using MediaPortal.Player; using ForTheRecord.Entities; +using ForTheRecord.ServiceAgents; namespace ForTheRecord.UI.MediaPortal { @@ -73,6 +75,7 @@ strButtonImage = String.Empty; strButtonImageFocus = String.Empty; strPictureImage = @"hover_my radio.png"; + //_teletextButton = null; return true; } @@ -102,7 +105,7 @@ bool result = Load(GUIGraphicsContext.Skin + @"\4TR_RadioHome.xml"); if (result) { - ForTheRecordMain.EnsureConnection(false); + ForTheRecordMain.EnsureConnection(false,true); LoadSettings(); base.Init(); } @@ -145,6 +148,54 @@ DoUpdateProgressPercentageBar(ChannelType.Radio); } + public static void UpdateMusicProperties() + { + if (g_Player.Playing && g_Player.IsRadio) + { + Recording playingRecording = RecordedBase.GetPlayingRecording(); + string chanName = string.Empty; + Channel chan = ForTheRecordMain.Navigator.CurrentChannel; + Guid channelId = Guid.Empty; + + if (playingRecording != null + && playingRecording.ChannelType == ChannelType.Radio + && ForTheRecordMain.Navigator.IsLiveStreamOn == false) + { + chanName = playingRecording.ChannelDisplayName; + channelId = playingRecording.ChannelId; + } + else if (chan != null && chan.ChannelType == ChannelType.Radio + && ForTheRecordMain.Navigator.IsLiveStreamOn) + { + chanName = chan.DisplayName; + channelId = chan.ChannelId; + } + + if (chanName != string.Empty) + { + string logo = String.Empty; + if (channelId != Guid.Empty) + { + using (TvSchedulerServiceAgent tvSchedulerAgent = new TvSchedulerServiceAgent()) + { + logo = Utility.GetLogoImage(channelId, chanName, tvSchedulerAgent); + } + if (String.IsNullOrEmpty(logo)) + { + logo = "defaultMyRadioBig.png"; + } + } + + GUIPropertyManager.RemovePlayerProperties(); + GUIPropertyManager.SetProperty("#Play.Current.ArtistThumb", logo); + GUIPropertyManager.SetProperty("#Play.Current.Thumb", logo); + GUIPropertyManager.SetProperty("#Play.Current.Album", chanName); + GUIPropertyManager.SetProperty("#Play.Current.Title", chanName); + GUIPropertyManager.SetProperty("#Play.Current.Artist", chanName); + } + } + } + private void LoadSettings() { if (!_settingsLoaded) Modified: trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/RecordedBase.cs =================================================================== --- trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/RecordedBase.cs 2011-10-09 09:23:41 UTC (rev 4310) +++ trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/RecordedBase.cs 2011-10-18 08:18:48 UTC (rev 4311) @@ -29,6 +29,7 @@ using System.Globalization; using System.IO; using System.Thre... [truncated message content] |