summaryrefslogtreecommitdiff
path: root/chordNote.cpp
diff options
context:
space:
mode:
authorSimon Gagne <gags2431@usherbrooke.ca>2023-03-16 10:06:04 -0400
committerSimon Gagne <gags2431@usherbrooke.ca>2023-03-16 10:06:04 -0400
commitb8dadd82d4afff0e5e6b6a8a00df948045d31503 (patch)
treec0613c30de11d5261bc0bdf4a1d5522515f41eb5 /chordNote.cpp
parent8332074b391e824ae4b92edfd5aa658c71265449 (diff)
Commit pour deplacement vers VSStudio
Diffstat (limited to 'chordNote.cpp')
-rw-r--r--chordNote.cpp52
1 files changed, 52 insertions, 0 deletions
diff --git a/chordNote.cpp b/chordNote.cpp
new file mode 100644
index 0000000..cea7ae5
--- /dev/null
+++ b/chordNote.cpp
@@ -0,0 +1,52 @@
+#include "chordNote.h"
+
+ChordNote::ChordNote(int btn, int startTime, int endTime) {
+ start = startTime;
+ end = endTime;
+ for (int i=0; i<5; i++) {
+ notes[i] = false;
+ }
+ notes[btn] = true;
+};
+
+ChordNote::~ChordNote() {};
+
+void ChordNote::change(int button) {
+ notes[button] = !notes[button];
+};
+
+void ChordNote::setEnd(int endTime) {
+ end = endTime;
+};
+
+void ChordNote::setRenderStart(int renderTime) {
+ renderStart = start - renderTime;
+};
+
+bool* ChordNote::getNotes() {
+ return notes;
+};
+
+int ChordNote::getStart() {
+ return start;
+};
+
+int ChordNote::getEnd() {
+ return end;
+};
+
+int ChordNote::getRenderStart() {
+ return renderStart;
+};
+
+std::regex ChordNote::getRegex() {
+ // empty string
+ std::string regex = "";
+ // true becomes "t" and false becomes "f"
+ // this is used to create a string of 5 characters
+ // which can be used as a regex
+ for (int i=0; i<5; i++) {
+ regex += notes[i] ? "t" : "f";
+ }
+ return std::regex(regex);
+};