summaryrefslogtreecommitdiff
path: root/song.h
diff options
context:
space:
mode:
authorBenjamin Chausse <benjamin@chausse.xyz>2023-02-14 16:34:40 -0500
committerBenjamin Chausse <benjamin@chausse.xyz>2023-02-14 16:34:40 -0500
commit6983e53daae8cab25ff113c7b5ccd3b31f39fcbb (patch)
tree5832db5c367b99ced3eb25591e325961630c7404 /song.h
parent8edabf33e46e1d2e5f69bbf856cf7f3595a4efa6 (diff)
Basic Song and chord structure
Diffstat (limited to 'song.h')
-rw-r--r--song.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/song.h b/song.h
new file mode 100644
index 0000000..e4b2389
--- /dev/null
+++ b/song.h
@@ -0,0 +1,32 @@
+#ifndef __SONG_H__
+#define __SONG_H__
+
+#include "chord.h"
+#include <vector>
+
+// Contains a song for a guitar hero clone
+class Song {
+ private:
+ std::string title;
+ std::string artist;
+ int duration; // in ms
+ std::string audioFile; // path to audio file
+ std::vector<Chord> chords;
+ public:
+ Song(std::string chartFile);
+ ~Song();
+ void consolidate(); // merges chords with the same start/end times
+ // into a single chord
+ Chord operator[](int index);
+ int size();
+
+ std::string getTitle();
+ std::string getArtist();
+ int getDuration();
+ std::string getAudioFile();
+ std::vector<Chord> getChords();
+};
+
+#include "song.cpp"
+#endif // __SONG_H__
+