         playlistTableView.doubleAction = #selector(playPlaylist(_:))
         playitemTableView.doubleAction = #selector(playPlaylist(_:))
         
+        //  Load playlists shared by all document; our delegate maintains history
         self.restorePlaylists(restoreButton)
-        //  Maintain a history of titles
 
         NotificationCenter.default.addObserver(
             self,

            }
            col.isHidden = isHidden
        }

    }

    var historyCache: NSDictionaryControllerKeyValuePair? = nil
    override func viewWillAppear() {
        // add existing history entry if any AVQueuePlayer
        if historyCache == nil
        {
            historyCache = playlistArrayController.newObject() as NSDictionaryControllerKeyValuePair
            historyCache!.key = UserSettings.HistoryName.value
            historyCache!.value = [PlayItem]()
        }
        else
        if appDelegate.histories.count > 0 {
            playlists[UserSettings.HistoryName.value] = nil
            

            playlists = playCache
        }
        else
        if let playArray = defaults.dictionary(forKey: UserSettings.Playlists.keyPath) {
            for (name,plist) in playArray {
                guard let items = plist as? [Dictionary<String,Any>] else {
                    let item = PlayItem.init(with: (plist as? Dictionary<String,Any>)!)
                    playlists[name] = [item]
                    continue
                }
                var list : [PlayItem] = [PlayItem]()
                for playitem in items {
                    let item = PlayItem.init(with: playitem)
                    list.append(item)
                }
                playlists[name] = list
            }
        }
    }
