ASAPCabinetFE
 
Loading...
Searching...
No Matches
table_data.h
Go to the documentation of this file.
1
11#ifndef TABLE_DATA_H
12#define TABLE_DATA_H
13
14#include <string>
15#include <cstdint>
16
26 // vpx = visual pinball X file
27 // vbs = visual basic script file
28 // vps = virtual pinball spreadsheet (database)
29struct TableData {
30 // ------------------ FILE PATHS ------------------
31 // We need to get the most out of the files before trying to
32 // match with vpsdb. We should get the most without any tool, than
33 // upgrade the metadata with vpin to get best of both, than finally
34 // try to match with the online db to get the best match possible.
35 // ----------------- BEST MATCHES --------------------
36 // Sorting metadata (calculated best results)
37 // title is a generic string to be shown on the UI.
38 // with filename it uses the filename, with vpin it uses the best
39 // of both (for bad metadata), used to match against vpsdb.
40 std::string title;
41 // if all fails we should try to extract these from the file name.
42 std::string manufacturer;
43 std::string year;
44
45 std::string vpxFile;
46 std::string folder;
47 std::string playfieldImage;
48 std::string wheelImage;
49 std::string backglassImage;
50 std::string dmdImage;
51 std::string topperImage;
52 std::string playfieldVideo;
53 std::string backglassVideo;
54 std::string dmdVideo;
55 std::string topperVideo;
56 std::string music;
57 std::string launchAudio;
58 std::string romPath;
59 std::string romName;
60 bool hasAltSound = false;
61 bool hasAltColor = false;
62 bool hasPup = false;
63 bool hasAltMusic = false;
64 bool hasUltraDMD = false;
65
66 // ------------ FILE METADATA (vpin/vpxtool) -----------
67 // we must keep repeated fields if found for better vpsdb matching
68 std::string tableName;
69 std::string tableAuthor;
70 std::string tableDescription;
71 std::string tableSaveDate;
72 std::string tableLastModified;
73 std::string tableReleaseDate;
74 std::string tableVersion;
75 std::string tableRevision;
76 std::string tableBlurb;
77 std::string tableRules;
78 std::string tableAuthorEmail;
79 std::string tableAuthorWebsite;
80 // These are inside 'properties' dictionary in 'table_info'
81 std::string tableType;
82 std::string tableManufacturer;
83 std::string tableYear;
84
85 // --------------- VPSDB METADATA -------------
86 // These fields will be populated ONLY IF a match is found in the VPS database.
87 std::string vpsId;
88 std::string vpsName;
89 std::string vpsType;
90 std::string vpsThemes;
91 std::string vpsDesigners;
92 std::string vpsPlayers;
93 std::string vpsIpdbUrl;
94 std::string vpsVersion;
95 std::string vpsAuthors;
96 std::string vpsFeatures;
97 std::string vpsComment;
98 std::string vpsManufacturer;
99 std::string vpsYear;
100 std::string vpsTableImgUrl;
101 std::string vpsTableUrl;
102 std::string vpsB2SImgUrl;
103 std::string vpsB2SUrl;
104 std::string vpsFormat;
105
106 // --------------- OPERATIONAL TAGS ------------------
107 float matchConfidence = 0.0f;
109 // vbs script patcher related
110 std::string hashFromVpx;
111 std::string hashFromVbs;
112 bool hasDiffVbs = false;
113 // table launch related
114 int playCount = 0;
115 bool isBroken = false;
116 float playTimeLast = 0.0f;
117 float playTimeTotal = 0.0f;
118
119 //TODO: use this to control which scanner to use/increment so we dont have to rebuild
120 std::string jsonOwner;
121};
122
123#endif // TABLE_DATA_H
Stores metadata and media paths for a VPX table.
Definition table_data.h:29
std::string backglassVideo
Path to the backglass video, if available.
Definition table_data.h:53
bool isBroken
true if failed to load, dont increment playCount
Definition table_data.h:115
std::string hashFromVpx
SHA256 hash of internal .vpx VB script.
Definition table_data.h:110
std::string vpsFeatures
Comma-separated features from vpsdb.json tableFiles (tableFiles[].features).
Definition table_data.h:96
std::string launchAudio
Path to the custom launch audio, if available.
Definition table_data.h:57
std::string tableRevision
Table revision from file metadata (e.g., from vpin's table_save_rev).
Definition table_data.h:75
bool hasAltMusic
True if found the music/ folder (non-empty)
Definition table_data.h:63
std::string folder
Directory containing the .vpx file.
Definition table_data.h:46
std::string vpsFormat
table format (VPX etc) (from tableFiles[].tableFormat)
Definition table_data.h:104
std::string tableManufacturer
Manufacturer/Company from file metadata properties (e.g., from vpin's properties.CompanyName or Compa...
Definition table_data.h:82
std::string vpsAuthors
Comma-separated authors from vpsdb.json tableFiles (tableFiles[].authors).
Definition table_data.h:95
std::string romName
file found in romPath without extension.
Definition table_data.h:59
std::string vpsVersion
Table version from vpsdb.json tableFiles (tableFiles[].version).
Definition table_data.h:94
std::string tableAuthorWebsite
Author's website from file metadata (from vpin's author_website).
Definition table_data.h:79
bool hasPup
True if found the pupvideos/ folder (non-empty)
Definition table_data.h:62
std::string topperImage
Path to the static topper image.
Definition table_data.h:51
bool hasUltraDMD
True if found the *.UltraDMD folder (non-empty)
Definition table_data.h:64
std::string vpsName
Table name from vpsdb.json (game.name).
Definition table_data.h:88
std::string vpsPlayers
Number of Players from vpsdb.json (game.players).
Definition table_data.h:92
std::string tableAuthorEmail
Author's email from file metadata (from vpin's author_email).
Definition table_data.h:78
std::string vpsComment
Comment from vpsdb.json tableFiles (tableFiles[].comment).
Definition table_data.h:97
std::string vpsTableImgUrl
table image from vpsdb (from tableFiles[].imgUrl, or other media files).
Definition table_data.h:100
bool hasDiffVbs
check if sidecar .vbs is different than the .vbs inside the VPX file.
Definition table_data.h:112
std::string tableLastModified
Last modified date from file metadata (this is usually from file system, not internal metadata).
Definition table_data.h:72
bool hasAltSound
True if found the pinmame/altsound folder (non-empty)
Definition table_data.h:60
std::string dmdVideo
Path to the DMD video, if available.
Definition table_data.h:54
std::string tableDescription
Description from file metadata (e.g., from vpin's table_description).
Definition table_data.h:70
std::string tableName
Table name from file metadata (e.g., from vpin's table_name).
Definition table_data.h:68
std::string vpsType
Table type (e.g., SS, EM) from vpsdb.json (game.type).
Definition table_data.h:89
std::string romPath
Path to the pinmame/roms/'romname'.zip.
Definition table_data.h:58
std::string vpsTableUrl
table URL to download (from tableFiles[].urls[0].url).
Definition table_data.h:101
std::string hashFromVbs
SHA256 hash of (patched) sidecar vb script.
Definition table_data.h:111
uint64_t fileLastModified
Timestamp of the last modification of the .vpx file.
Definition table_data.h:108
std::string vpsManufacturer
Manufacturer from vpsdb (game.manufacturer).
Definition table_data.h:98
std::string tableYear
Year from file metadata properties (e.g., from vpin's properties.CompanyYear or Year).
Definition table_data.h:83
float playTimeTotal
sums playTimeLast
Definition table_data.h:117
int playCount
capture successful launches
Definition table_data.h:114
std::string vpxFile
Full path to the .vpx file.
Definition table_data.h:45
std::string vpsId
Unique ID from vpsdb.json (game.id).
Definition table_data.h:87
std::string tableBlurb
Short blurb/summary from file metadata (from vpin's table_blurb).
Definition table_data.h:76
std::string tableAuthor
Author(s) from file metadata (e.g., from vpin's author_name).
Definition table_data.h:69
bool hasAltColor
True if found the pinmame/AltColor folder (non-empty)
Definition table_data.h:61
std::string tableType
Table type from file metadata properties (e.g., from vpin's properties.TableType).
Definition table_data.h:81
std::string tableRules
Rules from file metadata (from vpin's table_rules).
Definition table_data.h:77
std::string topperVideo
Path to the topper video, if available.
Definition table_data.h:55
std::string playfieldImage
Path to the static playfield image.
Definition table_data.h:47
std::string vpsIpdbUrl
IPDB URL from vpsdb.json (game.ipdbUrl).
Definition table_data.h:93
std::string dmdImage
Path to the static DMD image.
Definition table_data.h:50
std::string music
Path to the music file, if available.
Definition table_data.h:56
std::string playfieldVideo
Path to the playfield video, if available.
Definition table_data.h:52
std::string wheelImage
Path to the static wheel image.
Definition table_data.h:48
float matchConfidence
Confidence score of match with vpsdb.
Definition table_data.h:107
std::string manufacturer
Manufacturer from title, vpin/vpxtool or vpsdb, used for sorting.
Definition table_data.h:42
std::string vpsThemes
Comma-separated themes from vpsdb.json (game.theme).
Definition table_data.h:90
std::string vpsB2SImgUrl
table image from vpsdb (from b2sFiles[].imgUrl, or other media files).
Definition table_data.h:102
std::string vpsB2SUrl
table URL to download (from b2sFiles[].urls[0].url).
Definition table_data.h:103
std::string tableReleaseDate
Release date from file metadata (e.g., from vpin's release_date).
Definition table_data.h:73
std::string tableSaveDate
Save date from file metadata (e.g., from vpin's table_save_date).
Definition table_data.h:71
std::string tableVersion
Table version from file metadata (e.g., from vpin's table_version).
Definition table_data.h:74
std::string backglassImage
Path to the static backglass image.
Definition table_data.h:49
std::string year
Year from title, vpin/vpxtool or vpsdb, used for sorting.
Definition table_data.h:43
std::string vpsDesigners
Comma-separated Designers from vpsdb.json (game.designers).
Definition table_data.h:91
std::string jsonOwner
file_scanner, vpin_scanner, vpxtool_scanner, vpsdb_scanner
Definition table_data.h:120
float playTimeLast
last session play time
Definition table_data.h:116
std::string vpsYear
Year from vpsdb (game.year).
Definition table_data.h:99
std::string title
Table title (from filename).
Definition table_data.h:40