F.E.I.S/Fumen.h

71 lines
1.5 KiB
C
Raw Normal View History

2017-08-17 23:41:11 +02:00
//
// Created by Syméon on 17/08/2017.
//
#ifndef FEIS_FUMEN_H
#define FEIS_FUMEN_H
#include <iostream>
#include <map>
#include <set>
#include <fstream>
2019-01-12 03:13:30 +01:00
#include <filesystem>
#include <json.hpp>
2017-08-17 23:41:11 +02:00
2017-08-18 17:42:56 +02:00
#include "Note.h"
#include "Chart.h"
2017-08-18 17:42:56 +02:00
struct cmpDifName {
std::map<std::string,int> dif_names;
cmpDifName() {
dif_names = {{"BSC",1},{"ADV",2},{"EXT",3}};
}
bool operator()(const std::string& a, const std::string& b) const;
};
2017-08-17 23:41:11 +02:00
class Fumen {
2017-08-17 23:41:11 +02:00
public:
2019-01-12 03:13:30 +01:00
explicit Fumen(
const std::filesystem::path &path,
const std::string &songTitle = "",
const std::string &artist = "",
const std::string &musicPath = "",
const std::string &albumCoverPath = "",
2019-01-12 03:13:30 +01:00
float BPM = 120,
float offset = 0
);
void loadFromMemon(std::filesystem::path path);
void loadFromMemon_v0_1_0(nlohmann::json j);
void loadFromMemon_fallback(nlohmann::json j);
// TODO : implementer ça
//void loadFromMemo(std::string path);
//void loadFromEve(std::string path);
2019-01-12 03:13:30 +01:00
void saveAsMemon(std::filesystem::path path);
// TODO : implementer ça
//void saveAsMemo(std::string path);
//void saveAsEve(std::string path);
2019-01-12 03:13:30 +01:00
void autoLoadFromMemon() {loadFromMemon(path);};
void autoSaveAsMemon() {saveAsMemon(path);};
std::map<std::string,Chart,cmpDifName> Charts;
2019-01-12 03:13:30 +01:00
std::filesystem::path path;
std::string songTitle;
std::string artist;
std::string musicPath;
std::string albumCoverPath;
float BPM;
float offset;
2019-01-14 04:20:30 +01:00
float getChartRuntime(Chart c);
2017-08-17 23:41:11 +02:00
};
#endif //FEIS_FUMEN_H