summaryrefslogtreecommitdiff
path: root/song.h
diff options
context:
space:
mode:
authorBenjamin Chausse <benjamin@chausse.xyz>2023-03-21 02:32:05 -0400
committerBenjamin Chausse <benjamin@chausse.xyz>2023-03-21 02:32:05 -0400
commit1acc49b21d850e035a2517930e6738b873953047 (patch)
tree7e5e50a4a5848d919d979f46b4383958c7096462 /song.h
parent433faac95e86a4ed61176061c4b0e8451cc58bf5 (diff)
Manual merge of chartFile branch
Diffstat (limited to 'song.h')
-rw-r--r--song.h59
1 files changed, 59 insertions, 0 deletions
diff --git a/song.h b/song.h
new file mode 100644
index 0000000..9e05564
--- /dev/null
+++ b/song.h
@@ -0,0 +1,59 @@
+#ifndef SONG_H
+#define SONG_H
+
+#include <string>
+#include <vector>
+
+#include "chordNote.h"
+#include "timestamp.h"
+
+#define DIFFICULTY_EASY 0
+#define DIFFICULTY_MEDIUM 1
+#define DIFFICULTY_HARD 2
+#define DIFFICULTY_EXPERT 3
+
+class Song{
+ public:
+ Song(std::string chartFile);
+ ~Song();
+
+ void parseInfo(); // info from "Song" section
+ void parseSync(); // timestamps from "SyncTrack" section
+ bool parseChords(int difficulty); // chords from "Events" section
+
+ void print();
+ void printTimestamps();
+ void printChords(int difficulty);
+
+ void consolidateChords(int difficulty); // Merge chords with same start/end times
+
+ std::string getChartFile();
+ std::string getTitle();
+ std::string getArtist();
+ std::string getCharter();
+ std::string getAlbum();
+ std::string getYear();
+ std::string getGenre();
+ std::string getAudioFile();
+
+ private:
+ const std::string chartFile;
+ std::string title;
+ std::string artist;
+ std::string charter;
+ std::string album;
+ std::string year;
+ std::string genre;
+ std::string audioFile;
+ bool difficulty[4]; // Which difficulties are available
+ int resolution;
+ std::vector<Timestamp> timestamps;
+ std::vector<ChordNote> easy;
+ std::vector<ChordNote> medium;
+ std::vector<ChordNote> hard;
+ std::vector<ChordNote> expert;
+};
+
+#include "song.cpp"
+#endif // SONG_H
+// vim: syntax=cpp.doxygen