From 433faac95e86a4ed61176061c4b0e8451cc58bf5 Mon Sep 17 00:00:00 2001 From: Benjamin Chausse Date: Tue, 21 Mar 2023 00:57:34 -0400 Subject: Rename change() to toggle() --- chordNote.cpp | 2 +- chordNote.h | 2 +- main.cpp | 18 +++++++++--------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/chordNote.cpp b/chordNote.cpp index cea7ae5..e912a97 100644 --- a/chordNote.cpp +++ b/chordNote.cpp @@ -11,7 +11,7 @@ ChordNote::ChordNote(int btn, int startTime, int endTime) { ChordNote::~ChordNote() {}; -void ChordNote::change(int button) { +void ChordNote::toggle(int button) { notes[button] = !notes[button]; }; diff --git a/chordNote.h b/chordNote.h index c6b833a..315bf24 100644 --- a/chordNote.h +++ b/chordNote.h @@ -27,7 +27,7 @@ class ChordNote { // that the chord is held for longer than the default 1/16th note. ChordNote(int btn, int startTime, int endTime); ~ChordNote(); - void change(int button); // change note in existing chord + void toggle(int button); // change note in existing chord void setRenderStart(int renderTime); // sets when to start rendering bool* getNotes(); // get the notes in the chord int getStart(); // get the start time of the chord diff --git a/main.cpp b/main.cpp index b53a772..9c8c1b7 100644 --- a/main.cpp +++ b/main.cpp @@ -76,7 +76,7 @@ int main() ChordNote note9(3, 8600, 8600); ChordNote note10(4, 9000, 9000);*/ - note2.change(0); + note2.toggle(0); const int FRAMERATE = 100; int renderStart = FRAMERATE * (NB_SQUARES); @@ -90,7 +90,7 @@ int main() note8.setRenderStart(renderStart); note9.setRenderStart(renderStart); note10.setRenderStart(renderStart);*/ - + string displayArray[NB_SQUARES + 1][5]; for (int i = 0; i < NB_SQUARES + 1; i++) { @@ -99,7 +99,7 @@ int main() displayArray[i][j] = " "; } } - + const int NB_NOTES = 5; ChordNote song[NB_NOTES] = {note1, note2, note3, note4, note5}; @@ -110,8 +110,8 @@ int main() cerr << "Impossible de se connecter au port "<< string(com.c_str()) <<". Fermeture du programme!" <MSG_MAX_SIZE){ return false; @@ -463,7 +463,7 @@ int main() { bool compDown = CompareIndividualButton(true, StrumDown); bool compUp = CompareIndividualButton(true, StrumUp); - + if (compDown || compUp) { correctlyPlayed = true; -- cgit v1.2.3