Skip to content

Commit

Permalink
Fix error.
Browse files Browse the repository at this point in the history
  • Loading branch information
linuscu committed Sep 5, 2024
1 parent 123ae2d commit 92592ec
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/hid/source/common/KeyboardPiano.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ namespace l::hid {
}
else {
int32_t note = ConvertKeyCodeToNote(keyCode, mOctave);
if (note > -l::math::constants::INTMIN) {
if (note > l::math::constants::INTMIN) {
noteHandler(note, true);
}
}
}
if (releasedNow) {
int32_t note = ConvertKeyCodeToNote(keyCode, mOctave);
if (note > -l::math::constants::INTMIN) {
if (note > l::math::constants::INTMIN) {
noteHandler(note, false);
}
}
Expand Down Expand Up @@ -66,14 +66,14 @@ namespace l::hid {
}
else {
int32_t note = ConvertKeyCodeToNote(keyCode, mOctave);
if (note > -l::math::constants::INTMIN) {
if (note > l::math::constants::INTMIN) {
mNotePlayer->NoteOn(note);
}
}
}
if (releasedNow) {
int32_t note = ConvertKeyCodeToNote(keyCode, mOctave);
if (note > -l::math::constants::INTMIN) {
if (note > l::math::constants::INTMIN) {
mNotePlayer->NoteOff(note);
}
}
Expand All @@ -86,15 +86,15 @@ namespace l::hid {
if (key > 0) {
return key + octave * 12;
}
return -l::math::constants::INTMIN;
return l::math::constants::INTMIN;
}

int32_t KeyboardPiano::ConvertCharCodeToNote(int32_t charCode, int32_t octave) {
auto key = mCharCodeToNote[charCode];
if (key > 0) {
return key + octave * 12;
}
return -l::math::constants::INTMIN;
return l::math::constants::INTMIN;
}

void KeyboardPiano::MapKeyFunctions(KeyFunctionTypes function, int32_t keyCode) {
Expand Down

0 comments on commit 92592ec

Please sign in to comment.