From a00db59c676a0f3c06525ee7f423fdfb7b40c3cf Mon Sep 17 00:00:00 2001 From: Benjamin Chausse Date: Tue, 21 Mar 2023 16:41:34 -0400 Subject: Handle audiofile path --- main.cpp | 2 ++ song.cpp | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/main.cpp b/main.cpp index 9234ef7..2e80ac1 100644 --- a/main.cpp +++ b/main.cpp @@ -176,6 +176,8 @@ int main() json j_msg_send, j_msg_rcv; auto startTime = chrono::steady_clock::now(); + // TODO: Check if this command works as intended: + /* PlaySound(TEXT(song.getAudioFile().c_str()), NULL, SND_ASYNC); */ double totalDiff = 0; auto lastPrintTime = chrono::steady_clock::now();; bool SongNotDone = true; diff --git a/song.cpp b/song.cpp index ba1dcd8..14ac92d 100644 --- a/song.cpp +++ b/song.cpp @@ -9,6 +9,9 @@ #include "common.h" Song::Song(std::string chartFile): chartFile(chartFile){ + // substitute "notes.chart" for "song.wav" + string audioFile = chartFile; + audioFile.replace(audioFile.find("notes.chart"), 12, "song.wav"); parseInfo(); parseSync(); /* for(int i = 0; i < 4; i++){ */ @@ -271,7 +274,6 @@ bool Song::parseChords(int difficulty){ void Song::consolidateChords(int difficulty){ - // TODO: make this fuction use the difficulty parameter std::vector*chords; switch (difficulty){ case DIFFICULTY_EASY: -- cgit v1.2.3