Refactor json handling for SongItems and add new fields.
Some checks failed
Build eismuliplexer for linux / Build (push) Has been cancelled
Some checks failed
Build eismuliplexer for linux / Build (push) Has been cancelled
This commit is contained in:
parent
64357be451
commit
4cacaa04e4
10 changed files with 224 additions and 108 deletions
|
|
@ -7,22 +7,25 @@
|
|||
#include <QString>
|
||||
#include <QRandomGenerator>
|
||||
#include <cstdint>
|
||||
#include <QJsonObject>
|
||||
|
||||
class SongItem
|
||||
{
|
||||
public:
|
||||
QString caption;
|
||||
QString lyrics;
|
||||
uint64_t uniqueId;
|
||||
QString file;
|
||||
unsigned int bpm;
|
||||
QString key;
|
||||
QString vocalLanguage;
|
||||
bool cotCaption;
|
||||
|
||||
uint64_t uniqueId;
|
||||
QString file;
|
||||
QString json;
|
||||
|
||||
inline SongItem(const QString &caption = "", const QString &lyrics = "")
|
||||
: caption(caption), lyrics(lyrics), cotCaption(true)
|
||||
{
|
||||
// Generate a unique ID using a cryptographically secure random number
|
||||
uniqueId = QRandomGenerator::global()->generate64();
|
||||
}
|
||||
SongItem(const QString &caption = "", const QString &lyrics = "");
|
||||
SongItem(const QJsonObject& json);
|
||||
|
||||
void store(QJsonObject& json) const;
|
||||
void load(const QJsonObject& json);
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue