Keep maps of wxTreeListItem to Cinema/Screen.
[dcpomatic.git] / src / wx / screens_panel.h
index 4b7a801413a5c3e3d5b80c5a17ce1b241dcc3c29..78023264af47660455692b0407bda7e54c2941da 100644 (file)
@@ -69,8 +69,8 @@ private:
        typedef std::vector<std::pair<wxTreeListItem, std::shared_ptr<Cinema>>> Cinemas;
        typedef std::vector<std::pair<wxTreeListItem, std::shared_ptr<dcpomatic::Screen>>> Screens;
 
-       Cinemas::iterator cinema_by_tree_list_item (wxTreeListItem item);
-       Screens::const_iterator screen_by_tree_list_item (wxTreeListItem item) const;
+       std::shared_ptr<Cinema> item_to_cinema (wxTreeListItem item) const;
+       std::shared_ptr<dcpomatic::Screen> item_to_screen (wxTreeListItem item) const;
 
        wxSearchCtrl* _search;
        wxTreeListCtrl* _targets;
@@ -86,6 +86,9 @@ private:
        Cinemas _selected_cinemas;
        Screens _selected_screens;
 
+       std::map<wxTreeListItem, std::shared_ptr<Cinema>> _item_to_cinema;
+       std::map<wxTreeListItem, std::shared_ptr<dcpomatic::Screen>> _item_to_screen;
+
        bool _ignore_selection_change;
 
        class Comparator : public wxTreeListItemComparator