Skip to content

Commit

Permalink
code formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
nikodemus committed Jul 16, 2024
1 parent 346f4a9 commit e0025c5
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 14 deletions.
6 changes: 2 additions & 4 deletions src/deluge/hid/display/display.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ class Display {
int32_t scrollPos = 0, uint8_t* blinkAddition = NULL, bool justReplaceBottomLayer = false){};

virtual void displayPopup(char const* newText, int8_t numFlashes = 3, bool alignRight = false,
uint8_t drawDot = 255, int32_t blinkSpeed = 1,
PopupType type = PopupType::GENERAL) = 0;
uint8_t drawDot = 255, int32_t blinkSpeed = 1, PopupType type = PopupType::GENERAL) = 0;

virtual void displayPopup(uint8_t val, int8_t numFlashes = 3, bool alignRight = false, uint8_t drawDot = 255,
int32_t blinkSpeed = 1, PopupType type = PopupType::GENERAL) {
Expand All @@ -53,8 +52,7 @@ class Display {
}

virtual void displayPopup(char const* shortLong[2], int8_t numFlashes = 3, bool alignRight = false,
uint8_t drawDot = 255, int32_t blinkSpeed = 1,
PopupType type = PopupType::GENERAL) {
uint8_t drawDot = 255, int32_t blinkSpeed = 1, PopupType type = PopupType::GENERAL) {
displayPopup(have7SEG() ? shortLong[0] : shortLong[1], numFlashes, alignRight, drawDot, blinkSpeed, type);
}

Expand Down
4 changes: 1 addition & 3 deletions src/deluge/hid/display/oled.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,7 @@ class OLED : public Display {
popupText(newText, !numFlashes, type);
}

void popupText(char const* text, PopupType type = PopupType::GENERAL) override {
popupText(text, true, type);
}
void popupText(char const* text, PopupType type = PopupType::GENERAL) override { popupText(text, true, type); }
void popupTextTemporary(char const* text, PopupType type = PopupType::GENERAL) override {
popupText(text, false, type);
}
Expand Down
17 changes: 11 additions & 6 deletions src/deluge/playback/playback_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1886,7 +1886,8 @@ void PlaybackHandler::commandNudgeClock(int8_t offset) {
else {
numOutputClocksWaitingToBeSent--; // Send one less clock
}
} else {
}
else {
// Nothing to nudge? TODO: Should we instead nudge the internal clock? Could be
// useful for manual beat syncs.
return;
Expand Down Expand Up @@ -1985,7 +1986,8 @@ void PlaybackHandler::tempoEncoderAction(int8_t offset, bool encoderButtonPresse
if (display->hasPopupOfType(PopupType::SWING)) {
// If not yet displaying, don't change the value
return commandEditSwingInterval(offset);
} else {
}
else {
return commandDisplaySwingInterval();
}
}
Expand All @@ -2001,7 +2003,8 @@ void PlaybackHandler::tempoEncoderAction(int8_t offset, bool encoderButtonPresse
else if (shiftButtonPressed) {
if (display->hasPopupOfType(PopupType::SWING)) {
return commandEditSwingAmount(offset);
} else {
}
else {
return commandDisplaySwingAmount();
}
}
Expand All @@ -2025,15 +2028,17 @@ void PlaybackHandler::tempoEncoderAction(int8_t offset, bool encoderButtonPresse
// Off | On | Fine
//
bool feature = runtimeFeatureSettings.get(RuntimeFeatureSettingType::FineTempoKnob)
== RuntimeFeatureStateToggle::On;
== RuntimeFeatureStateToggle::On;
bool button = Buttons::isButtonPressed(deluge::hid::button::TEMPO_ENC);

if (feature == button) {
return commandEditTempoCoarse(offset);
} else {
}
else {
return commandEditTempoFine(offset);
}
} else {
}
else {
commandDisplayTempo();
}
}
Expand Down
4 changes: 3 additions & 1 deletion src/deluge/util/d_string.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,9 @@ class StringBuf {
// TODO: Validate buffer size. These can overflow
void appendInt(int i, int minChars = 1) { intToString(i, buf_ + size(), minChars); }
void appendHex(int i, int minChars = 1) { intToHex(i, buf_ + size(), minChars); }
void appendFloat(float f, int32_t minDecimals, int32_t maxDecimals) { floatToString(f, buf_ + size(), minDecimals, maxDecimals); }
void appendFloat(float f, int32_t minDecimals, int32_t maxDecimals) {
floatToString(f, buf_ + size(), minDecimals, maxDecimals);
}

[[nodiscard]] char* data() { return buf_; }
[[nodiscard]] const char* data() const { return buf_; }
Expand Down

0 comments on commit e0025c5

Please sign in to comment.