From: <do...@us...> - 2010-08-31 07:22:42
|
Revision: 3772 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=3772&view=rev Author: dot-i Date: 2010-08-31 07:22:36 +0000 (Tue, 31 Aug 2010) Log Message: ----------- Updated to 1.5.0.2 release. Modified Paths: -------------- trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/ChannelNavigator.cs trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/RecordedBase.cs trunk/plugins/ForTheRecord/ReferencedAssemblies/Core.dll trunk/plugins/ForTheRecord/ReferencedAssemblies/Databases.dll trunk/plugins/ForTheRecord/ReferencedAssemblies/Dialogs.dll trunk/plugins/ForTheRecord/ReferencedAssemblies/PluginBase.dll trunk/plugins/ForTheRecord/ReferencedAssemblies/SetupControls.dll trunk/plugins/ForTheRecord/ReferencedAssemblies/TVDatabase.dll trunk/plugins/ForTheRecord/ReferencedAssemblies/TvBusinessLayer.dll trunk/plugins/ForTheRecord/ReferencedAssemblies/TvControl.dll trunk/plugins/ForTheRecord/ReferencedAssemblies/TvLibrary.Interfaces.dll trunk/plugins/ForTheRecord/ReferencedAssemblies/Utils.dll Modified: trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/ChannelNavigator.cs =================================================================== --- trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/ChannelNavigator.cs 2010-08-26 10:04:14 UTC (rev 3771) +++ trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/ChannelNavigator.cs 2010-08-31 07:22:36 UTC (rev 3772) @@ -78,10 +78,10 @@ public ChannelNavigator() { + _navigatorChannels[ChannelType.Radio] = new NavigatorChannels(); + RefreshChannelGroups(ChannelType.Radio); _navigatorChannels[ChannelType.Television] = new NavigatorChannels(); RefreshChannelGroups(ChannelType.Television); - _navigatorChannels[ChannelType.Radio] = new NavigatorChannels(); - RefreshChannelGroups(ChannelType.Radio); _waitForBlackScreenEvent = new ManualResetEvent(false); GUIGraphicsContext.OnBlackImageRendered += GUIGraphicsContext_OnBlackImageRendered; GUIGraphicsContext.OnVideoReceived += GUIGraphicsContext_OnVideoReceived; @@ -444,10 +444,12 @@ if (zappingTo != null) { Channel prevChannel = _currentChannel; + ChannelGroup prevGroup = _currentChannelGroup; TuneLiveStream(zappingTo); if (prevChannel != null) { _navigatorChannels[prevChannel.ChannelType].PreviousChannel = prevChannel; + _navigatorChannels[prevGroup.ChannelType].PreviousChannelGroup = prevGroup; } _navigatorChannels[zappingTo.ChannelType].LastChannel = _currentChannel; _navigatorChannels[zappingTo.ChannelType].LastChannelGroup = _currentChannelGroup; @@ -803,12 +805,12 @@ { fileName = liveStream.TimeshiftFile; seekOffset = 0; - DateTime maxWaitTime = DateTime.Now.AddSeconds(5); - while (!System.IO.File.Exists(fileName)) - { - Thread.Sleep(100); - } } + else + { + // Small delay to allow RTSP stream to start up. + Thread.Sleep(100); + } } private void SetCurrentAndNext(ChannelType channelType, CurrentAndNextProgram currentAndNext) @@ -1057,30 +1059,28 @@ { Log.Info("ChannelNavigator::LoadSettings()"); _autoFullScreen = xmlreader.GetValueAsBool("mytv", "autofullscreen", true); - string channelName = xmlreader.GetValueAsString("mytv", "channel", String.Empty); _zapDelayMs = 1000 * xmlreader.GetValueAsInt("movieplayer", "zapdelay", 2); - - LoadGroupAndChannelSettings(xmlreader, ChannelType.Radio, "myradio", channelName); - LoadGroupAndChannelSettings(xmlreader, ChannelType.Television, "mytv", channelName); + LoadGroupAndChannelSettings(xmlreader, ChannelType.Radio, "myradio"); + LoadGroupAndChannelSettings(xmlreader, ChannelType.Television, "mytv"); } private void LoadGroupAndChannelSettings(global::MediaPortal.Profile.Settings xmlreader, - ChannelType channelType, string section, string channelName) + ChannelType channelType, string section) { + string channelName = xmlreader.GetValueAsString(section, "channel", String.Empty); + string groupname = xmlreader.GetValueAsString(section, "group", Utility.GetLocalizedText(TextId.AllChannels)); foreach (ChannelGroup group in _navigatorChannels[channelType].Groups) { if (group.GroupName == groupname) { + _navigatorChannels[channelType].PreviousChannelGroup = group; _currentChannelGroup = group; RefreshChannelsInGroup(channelType); break; } } - if (_currentChannelGroup != null) - { - _navigatorChannels[_currentChannelGroup.ChannelType].PreviousChannelGroup = _currentChannelGroup; - } + _navigatorChannels[channelType].LastChannelGroup = _navigatorChannels[channelType].PreviousChannelGroup; _navigatorChannels[channelType].PreviousChannel = null; foreach (Channel channel in _navigatorChannels[channelType].Channels) @@ -1091,6 +1091,7 @@ break; } } + _navigatorChannels[channelType].LastChannel = _navigatorChannels[channelType].PreviousChannel; } public void SaveSettings(global::MediaPortal.Profile.Settings xmlwriter) Modified: trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/RecordedBase.cs =================================================================== --- trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/RecordedBase.cs 2010-08-26 10:04:14 UTC (rev 3771) +++ trunk/plugins/ForTheRecord/ForTheRecord.UI.MediaPortal/RecordedBase.cs 2010-08-31 07:22:36 UTC (rev 3772) @@ -92,6 +92,7 @@ private bool _sortAscending = true; private int _selectedItemIndex; + private int _selectedParentItemIndex; private object _currentGroupId; private ChannelType _channelType; @@ -423,7 +424,7 @@ { case Action.ActionType.ACTION_DELETE_ITEM: { - int item = GetSelectedItemNo(); + int item = GetSelectedItemIndex(); if (item >= 0) OnDeleteRecording(item); UpdateProperties(); @@ -442,6 +443,7 @@ { _currentGroupId = null; LoadDirectory(false); + SelectItemByIndex(ref _selectedParentItemIndex); return; } } @@ -454,7 +456,7 @@ protected override void OnPageDestroy(int newWindowId) { - _selectedItemIndex = GetSelectedItemNo(); + _selectedItemIndex = GetSelectedItemIndex(); SaveSettings(); if (_tvSchedulerAgent != null) { @@ -497,13 +499,8 @@ LoadSettings(); LoadDirectory(true); + SelectItemByIndex(ref _selectedItemIndex); - while (_selectedItemIndex >= GetItemCount() && _selectedItemIndex > 0) - { - _selectedItemIndex--; - } - GUIControl.SelectItemControl(GetID, _facadeView.GetID, _selectedItemIndex); - _sortByButton.SortChanged += new SortEventHandler(SortChanged); } } @@ -647,7 +644,7 @@ protected override void OnShowContextMenu() { - int itemIndex = GetSelectedItemNo(); + int itemIndex = GetSelectedItemIndex(); GUIListItem item = GetItem(itemIndex); if (item == null || item.IsFolder) @@ -726,6 +723,7 @@ List<GUIListItem> itemlist = new List<GUIListItem>(); + bool isSubDirectory = false; int groupIndex = 0; foreach (RecordingGroup recordingGroup in _model.RecordingGroups) { @@ -751,6 +749,7 @@ Utils.SetDefaultIcons(item); item.ThumbnailImage = item.IconImageBig; + isSubDirectory = true; itemlist.Add(item); } if (recordings != null) @@ -820,7 +819,7 @@ Log.Error("TvRecorded: Error adding recordings to list - {0}", ex2.Message); } - string strObjects = string.Format("{0} {1}", itemlist.Count, Utility.GetLocalizedText(TextId.RecordingsListItemsSuffix)); + string strObjects = string.Format("{0}", itemlist.Count - (isSubDirectory ? 1 : 0)); GUIPropertyManager.SetProperty("#itemcount", strObjects); OnSort(); @@ -971,6 +970,8 @@ if (pItem.Label == _parentDirectoryLabel) { _currentGroupId = null; + LoadDirectory(false); + SelectItemByIndex(ref _selectedParentItemIndex); } else { @@ -990,8 +991,9 @@ _currentGroupId = EnsureCategoryName(recordingGroup.Category); break; } + _selectedParentItemIndex = GetSelectedItemIndex(); + LoadDirectory(false); } - LoadDirectory(false); return false; } @@ -1009,7 +1011,7 @@ private void OnDeleteRecording(int itemIndex) { - _selectedItemIndex = GetSelectedItemNo(); + _selectedItemIndex = GetSelectedItemIndex(); GUIListItem item = GetItem(itemIndex); if (item != null && !item.IsFolder) @@ -1032,11 +1034,7 @@ TvControlAgent.DeleteRecording(rec.RecordingFileName, true); LoadDirectory(true); - while (_selectedItemIndex >= GetItemCount() && _selectedItemIndex > 0) - { - _selectedItemIndex--; - } - GUIControl.SelectItemControl(GetID, _facadeView.GetID, _selectedItemIndex); + SelectItemByIndex(ref _selectedItemIndex); } } } @@ -1047,7 +1045,7 @@ try { RecordingSummary rec; - GUIListItem pItem = GetItem(GetSelectedItemNo()); + GUIListItem pItem = GetItem(GetSelectedItemIndex()); if (pItem == null) { GUIPropertyManager.SetProperty("#selectedthumb", String.Empty); @@ -1078,6 +1076,7 @@ if (rec == null) { + Utility.ClearProperty(guiPropertyPrefix + ".RecordedTV.Channel"); Utility.ClearProperty(guiPropertyPrefix + ".RecordedTV.Title"); Utility.ClearProperty(guiPropertyPrefix + ".RecordedTV.Genre"); Utility.ClearProperty(guiPropertyPrefix + ".RecordedTV.Time"); @@ -1093,6 +1092,7 @@ rec.ProgramStartTime.ToString("t", CultureInfo.CurrentCulture.DateTimeFormat), rec.ProgramStopTime.ToString("t", CultureInfo.CurrentCulture.DateTimeFormat)); + GUIPropertyManager.SetProperty(guiPropertyPrefix + ".RecordedTV.Channel", rec.ChannelDisplayName); GUIPropertyManager.SetProperty(guiPropertyPrefix + ".RecordedTV.Title", rec.Title); GUIPropertyManager.SetProperty(guiPropertyPrefix + ".RecordedTV.Genre", rec.Category); GUIPropertyManager.SetProperty(guiPropertyPrefix + ".RecordedTV.Time", strTime); @@ -1137,7 +1137,7 @@ return _facadeView[iItem]; } - private int GetSelectedItemNo() + private int GetSelectedItemIndex() { if (_facadeView.Count > 0) { @@ -1149,6 +1149,15 @@ } } + private void SelectItemByIndex(ref int index) + { + while (index >= GetItemCount() && index > 0) + { + index--; + } + GUIControl.SelectItemControl(GetID, _facadeView.GetID, index); + } + private int GetItemCount() { return _facadeView.Count; Modified: trunk/plugins/ForTheRecord/ReferencedAssemblies/Core.dll =================================================================== (Binary files differ) Modified: trunk/plugins/ForTheRecord/ReferencedAssemblies/Databases.dll =================================================================== (Binary files differ) Modified: trunk/plugins/ForTheRecord/ReferencedAssemblies/Dialogs.dll =================================================================== (Binary files differ) Modified: trunk/plugins/ForTheRecord/ReferencedAssemblies/PluginBase.dll =================================================================== (Binary files differ) Modified: trunk/plugins/ForTheRecord/ReferencedAssemblies/SetupControls.dll =================================================================== (Binary files differ) Modified: trunk/plugins/ForTheRecord/ReferencedAssemblies/TVDatabase.dll =================================================================== (Binary files differ) Modified: trunk/plugins/ForTheRecord/ReferencedAssemblies/TvBusinessLayer.dll =================================================================== (Binary files differ) Modified: trunk/plugins/ForTheRecord/ReferencedAssemblies/TvControl.dll =================================================================== (Binary files differ) Modified: trunk/plugins/ForTheRecord/ReferencedAssemblies/TvLibrary.Interfaces.dll =================================================================== (Binary files differ) Modified: trunk/plugins/ForTheRecord/ReferencedAssemblies/Utils.dll =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |