Refactor!

This commit is contained in:
IlyaShurupov 2023-12-02 19:04:42 +03:00 committed by Ilya Shurupov
parent cb09a6f5de
commit cd451d1c2a
14 changed files with 13024 additions and 1920 deletions

View file

@ -0,0 +1,57 @@
#pragma once
#include "Window.hpp"
typedef tp::ualni SongId;
enum class SONG_FORMAT { WAV, FLAC, NONE };
tp::String getHome();
tp::String getSongLocalPath(SongId id);
SONG_FORMAT getSongFormat(const tp::String& path);
namespace tp {
extern ModuleManifest gModuleLibraryViewer;
}
class Track {
public:
Track() = default;
public:
SongId mId = 0;
tp::String mName = "undef";
tp::String mArtist = "undef";
tp::String mAlbumArtist = "undef";
tp::String mComposer = "undef";
tp::String mAlbum = "undef";
tp::String mGenre = "undef";
tp::ualni mSize = 0;
tp::ualni mTotalTime = 0;
tp::ualni mYear = 0;
tp::String mDateModified = "undef";
tp::String mDateAdded = "undef";
tp::ualni mPlayCount = 0;
tp::String mPlayDate = "undef";
tp::String mPlayDateUTC = "undef";
tp::ualni mSkipCount = 0;
tp::String mSkipDate = "undef";
tp::String mReleaseDate = "undef";
tp::ualni mAlbumRating = 0;
bool mAlbumRatingComputed = false;
bool mLoved = false;
bool mAlbumLoved = false;
bool mExplicit = false;
bool mExists = false;
};
class Library {
public:
Library() = default;
public:
bool loadJson(const tp::String& path);
void checkExisting();
public:
tp::Buffer<Track> mTraks;
};