diff --git a/PepperDashEssentials/AppServer/Messengers/VideoCodecBaseMessenger.cs b/PepperDashEssentials/AppServer/Messengers/VideoCodecBaseMessenger.cs index 1f3f42b6..eb56c01e 100644 --- a/PepperDashEssentials/AppServer/Messengers/VideoCodecBaseMessenger.cs +++ b/PepperDashEssentials/AppServer/Messengers/VideoCodecBaseMessenger.cs @@ -40,6 +40,7 @@ namespace PepperDash.Essentials.AppServer.Messengers if (dirCodec != null) { dirCodec.DirectoryResultReturned += new EventHandler(dirCodec_DirectoryResultReturned); + } var recCodec = codec as IHasCallHistory; @@ -74,12 +75,30 @@ namespace PepperDash.Essentials.AppServer.Messengers /// void dirCodec_DirectoryResultReturned(object sender, DirectoryEventArgs e) { - PostStatusMessage(new - { - currentDirectory = e.Directory - }); + SendDirectory((Codec as IHasDirectory).CurrentDirectoryResult, e.DirectoryIsOnRoot); } + /// + /// Posts the current directory + /// + void SendDirectory(CodecDirectory directory, bool isRoot) + { + var dirCodec = Codec as IHasDirectory; + + if (dirCodec != null) + { + var directoryMessage = new + { + currentDirectory = new + { + directoryResults = directory.CurrentDirectoryResults, + isRootDirectory = isRoot + } + }; + PostStatusMessage(directoryMessage); + } + } + /// /// /// @@ -130,6 +149,7 @@ namespace PepperDash.Essentials.AppServer.Messengers appServerController.AddAction(MessagePath + "/getDirectory", new Action(GetDirectoryRoot)); appServerController.AddAction(MessagePath + "/directoryById", new Action(s => GetDirectory(s))); appServerController.AddAction(MessagePath + "/directorySearch", new Action(s => DirectorySearch(s))); + appServerController.AddAction(MessagePath + "/directoryBack", new Action(GetPreviousDirectory)); } // History actions @@ -228,12 +248,28 @@ namespace PepperDash.Essentials.AppServer.Messengers return; } - PostStatusMessage(new - { - currentDirectory = dirCodec.DirectoryRoot - }); + dirCodec.SetCurrentDirectoryToRoot(); + + //PostStatusMessage(new + //{ + // currentDirectory = dirCodec.DirectoryRoot + //}); } + /// + /// Requests the parent folder contents + /// + void GetPreviousDirectory() + { + var dirCodec = Codec as IHasDirectory; + if (dirCodec == null) + { + return; + } + + dirCodec.GetDirectoryParentFolderContents(); + } + /// /// Handler for codec changes /// @@ -284,6 +320,7 @@ namespace PepperDash.Essentials.AppServer.Messengers }, showSelfViewByDefault = Codec.ShowSelfViewByDefault, hasDirectory = Codec is IHasDirectory, + hasDirectorySearch = true, hasRecents = Codec is IHasCallHistory, hasCameras = Codec is IHasCameraControl }); diff --git a/PepperDashEssentials/UIDrivers/VC/EssentialsVideoCodecUiDriver.cs b/PepperDashEssentials/UIDrivers/VC/EssentialsVideoCodecUiDriver.cs index 17eb18b6..c9a2ae12 100644 --- a/PepperDashEssentials/UIDrivers/VC/EssentialsVideoCodecUiDriver.cs +++ b/PepperDashEssentials/UIDrivers/VC/EssentialsVideoCodecUiDriver.cs @@ -58,16 +58,7 @@ namespace PepperDash.Essentials.UIDrivers.VC SmartObjectDynamicList RecentCallsList; SmartObjectDynamicList DirectoryList; - - //CodecDirectory CurrentDirectoryResult; - - ///// - ///// Tracks the directory browse history when browsing beyond the root directory - ///// - //List DirectoryBrowseHistory; - bool NextDirectoryResultIsFolderContents; - BoolFeedback DirectoryBackButtonVisibleFeedback; // These are likely temp until we get a keyboard built @@ -558,6 +549,7 @@ namespace PepperDash.Essentials.UIDrivers.VC { (Codec as IHasDirectory).SetCurrentDirectoryToRoot(); +#warning Deal with this recursive issue SearchKeypadClear(); RefreshDirectory(); @@ -585,10 +577,7 @@ namespace PepperDash.Essentials.UIDrivers.VC /// void dir_DirectoryResultReturned(object sender, DirectoryEventArgs e) { - if (NextDirectoryResultIsFolderContents) - { - NextDirectoryResultIsFolderContents = false; - } + RefreshDirectory(); } @@ -600,7 +589,6 @@ namespace PepperDash.Essentials.UIDrivers.VC { (Codec as IHasDirectory).GetDirectoryFolderContents(folder.FolderId); - NextDirectoryResultIsFolderContents = true; } /// @@ -614,7 +602,7 @@ namespace PepperDash.Essentials.UIDrivers.VC { codec.GetDirectoryParentFolderContents(); - RefreshDirectory(); + //RefreshDirectory(); } } diff --git a/essentials-framework b/essentials-framework index efa39eb6..3e7dbeb1 160000 --- a/essentials-framework +++ b/essentials-framework @@ -1 +1 @@ -Subproject commit efa39eb6fd171fc53c163a8d348d5af47bc5ccf0 +Subproject commit 3e7dbeb111513cfed55db5012375bec1de7239a1