diff options
-rw-r--r-- | chordNote.cpp | 6 | ||||
-rw-r--r-- | chordNote.h | 5 | ||||
-rw-r--r-- | main.cpp | 9 | ||||
-rw-r--r-- | song.cpp | 6 | ||||
-rw-r--r-- | song.h | 1 |
5 files changed, 25 insertions, 2 deletions
diff --git a/chordNote.cpp b/chordNote.cpp index 8b0051c..1fa7549 100644 --- a/chordNote.cpp +++ b/chordNote.cpp @@ -94,6 +94,12 @@ void ChordNote::print(){ std::cout << "Start: " << start << " End: " << end << std::endl; } +// Trim all timings to milliseconds +void ChordNote::trim(){ + start = start/1000000; + end = end/1000000; +} + // }}} // vim: syntax=cpp.doxygen diff --git a/chordNote.h b/chordNote.h index 47ca43f..b66af06 100644 --- a/chordNote.h +++ b/chordNote.h @@ -16,8 +16,8 @@ class ChordNote { private: - const int start; // Time in Nanoseconds - const int end; // 0 if not set + int start; // Time in Nanoseconds + int end; // 0 if not set bool notes[5]; // Which notes are in the chord int renderStart; // Time in Nanoseconds // Chords are initialized with a single button. @@ -45,6 +45,7 @@ class ChordNote { // Misc: bool has(int note); // check if a note is in the chord void print(); // For debugging + void trim(); // Trim all timings to milliseconds }; //#include "chordNote.cpp" @@ -75,6 +75,15 @@ int main() {
repertoire.push_back(Song(songRoot + songFolders[i] + chartFile));
}
+ // Parse all the songs
+ for (int i = 0; i < repertoire.size(); i++)
+ {
+ repertoire[i].parseSync();
+ repertoire[i].parseChords(0);
+ repertoire[i].consolidateChords(0);
+ repertoire[i].trim(0);
+ cout << repertoire[i].getTitle() << " parsed!" << endl;
+ }
string displayString;
@@ -321,5 +321,11 @@ std::string Song::getAudioFile(){ return audioFile; } +void Song::trim(int difficulty){ + // TODO: make this fuction use the difficulty parameter + std::vector<ChordNote>*chords = &expert; + chords->trim(); +} + // vim: syntax=cpp.doxygen @@ -26,6 +26,7 @@ class Song{ void printChords(int difficulty); void consolidateChords(int difficulty); // Merge chords with same start/end times + void trim(int difficulty); // Trim chord timings from nanoseconds to milliseconds std::string getChartFile(); std::string getTitle(); |