diff options
author | Benjamin Chausse <benjamin@chausse.xyz> | 2023-04-08 13:36:34 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-08 13:36:34 -0400 |
commit | c3946e1a73aec0eb75ff4301dc42e1a2a71aab60 (patch) | |
tree | 9bfd6b6df4666491295b30088a6bf7bec6f61757 /song.h | |
parent | 0fd63dfa5dfcac42a45f0b247e8461b4b969d6f7 (diff) | |
parent | 3180cb7584c037463ee5c2047aea3e3ed0f0b364 (diff) |
Diffstat (limited to 'song.h')
-rw-r--r-- | song.h | 61 |
1 files changed, 61 insertions, 0 deletions
@@ -0,0 +1,61 @@ +#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: + // Constructors/Destructors + Song(std::string chartFile); + ~Song(); + // Pre-Processing + void parseInfo(); // info from "Song" section + void parseSync(); // timestamps from "SyncTrack" section + bool parseChords(int difficulty=0); // chords from "Events" section + void consolidateChords(int difficulty=0); // Merge chords with same start/end times + void trim(int difficulty); // Trim chord timings from + // nanoseconds to milliseconds + // Print statements for debugging + void print(); + void printTimestamps(); + void printChords(int difficulty=0); + // Getters + std::string getChartFile(); + std::string getTitle(); + std::string getArtist(); + std::string getCharter(); + std::string getAlbum(); + std::string getYear(); + std::string getGenre(); + std::string getAudioFile(); + // Public variables (Chord vectors for each difficulty) TODO: Make private + std::vector<ChordNote> easy; + std::vector<ChordNote> medium; + std::vector<ChordNote> hard; + std::vector<ChordNote> expert; + 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; +}; + +//#include "song.cpp" +#endif // SONG_H +// vim: syntax=cpp.doxygen |