ASAPCabinetFE
 
Loading...
Searching...
No Matches
vpsdb_catalog_manager.h
Go to the documentation of this file.
1
11#ifndef VPSDB_CATALOG_MANAGER_H
12#define VPSDB_CATALOG_MANAGER_H
13
14#include "vpsdb_metadata.h"
15#include "config/settings.h"
16#include "vpsdb_catalog_image.h"
17#include "vpsdb_catalog_json.h"
18#include "vpsdb_catalog_table.h"
19#include <SDL2/SDL.h>
20#include <imgui.h>
21#include <string>
22#include <vector>
23#include <memory>
24#include <thread>
25#include <atomic>
26#include <mutex>
27#include <queue>
28
29namespace vpsdb {
30
32 friend class VpsdbImage; // Allow VpsdbImage to access private members
33
34public:
35 VpsdbCatalog(const std::string& vpsdbFilePath, SDL_Renderer* renderer, const Settings& settings, VpsdbJsonLoader& jsonLoader);
37 bool render();
38
39private:
40 std::string vpsdbFilePath_;
41 SDL_Renderer* renderer_;
42 PinballTable currentTable_;
43 size_t currentIndex_;
44 std::atomic<bool> isTableLoading_;
45 bool isOpen;
46 std::unique_ptr<SDL_Texture, decltype(&SDL_DestroyTexture)> backglassTexture_;
47 std::unique_ptr<SDL_Texture, decltype(&SDL_DestroyTexture)> playfieldTexture_;
48 std::string currentBackglassPath_;
49 std::string currentPlayfieldPath_;
50 const Settings& settings_;
51 VpsdbJsonLoader& jsonLoader_;
52 std::thread tableLoadThread_;
53 std::mutex mutex_;
54 std::queue<LoadedTableData> loadedTableQueue_;
55
56 void renderField(const char* key, const std::string& value);
57 std::string join(const std::vector<std::string>& vec, const std::string& delim);
58 void applySearchFilter(const char* searchTerm);
59 void openUrl(const std::string& url);
60 void startTableLoad(size_t index, const std::string& exePath);
61};
62
63} // namespace vpsdb
64
65#endif // VPSDB_CATALOG_MANAGER_H
Definition vpsdb_catalog_manager.h:31
Definition vpsdb_catalog_image.h:12
Definition vpsdb_catalog_json.h:16
Definition settings.h:12
Definition vpsdb_metadata.h:45
Data structures for parsing VPSDB JSON in ASAPCabinetFE.