Peoplemon  0.1.0
Peoplemon 3 game source documentation
PlaylistEditorWindow.hpp
Go to the documentation of this file.
1 #ifndef EDITOR_COMPONENTS_PLAYLISTEDITORWINDOW_HPP
2 #define EDITOR_COMPONENTS_PLAYLISTEDITORWINDOW_HPP
3 
4 #include <BLIB/Interfaces/GUI.hpp>
5 
6 namespace editor
7 {
8 namespace component
9 {
17 public:
18  using SelectedCb = std::function<void(const std::string&)>;
19  using CancelCb = std::function<void()>;
20 
27  PlaylistEditorWindow(const SelectedCb& onSelect, const CancelCb& onCancel);
28 
35  void open(bl::gui::GUI* gui, const std::string& plist);
36 
37 private:
38  const SelectedCb onSelect;
39  const CancelCb onCancel;
40  bl::gui::GUI* gui;
41  bl::gui::Window::Ptr window;
42  bl::gui::SelectBox::Ptr songList;
43  bl::gui::CheckButton::Ptr shuffleBut;
44  bl::gui::CheckButton::Ptr loopShuffleBut;
45  bl::gui::Label::Ptr fileLabel;
46  bl::gui::Button::Ptr saveBut;
47  bool dirty;
48 
49  bl::gui::FilePicker songPicker;
50  void onSongPick(const std::string& song);
51 
52  bl::gui::FilePicker plistPicker;
53  bool settingFile;
54  void onPlaylistPick(const std::string& plist);
55 
56  void makeNew();
57  void markDirty();
58  void markClean();
59  void removeSong();
60 
61  bool confirmUnsaved();
62  void select();
63 
64  void save();
65  void load(const std::string& file);
66 
67  void close();
68  void closePickers();
69 };
70 
71 } // namespace component
72 } // namespace editor
73 
74 #endif
All classes and functionality used for implementing the game editor.
Definition: Tile.hpp:11
The playlist editor and chooser.
PlaylistEditorWindow(const SelectedCb &onSelect, const CancelCb &onCancel)
Creates the playlist editor.
void open(bl::gui::GUI *gui, const std::string &plist)
Opens the window with an optional file to load.
std::function< void(const std::string &)> SelectedCb