mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 08:17:45 +00:00
Piano: Clean up code style with help from clang-tidy
Includes shadowed variables and if-else return.
This commit is contained in:
parent
401a21e4f4
commit
9f5f6b3868
4 changed files with 5 additions and 8 deletions
|
@ -23,7 +23,6 @@ int KeysWidget::mouse_note() const
|
|||
{
|
||||
if (m_mouse_down && m_mouse_note + m_keyboard->virtual_keyboard_octave_base() < note_count)
|
||||
return m_mouse_note; // Can be -1.
|
||||
else
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
|
@ -94,7 +94,6 @@ void MainWidget::keydown_event(GUI::KeyEvent& event)
|
|||
// This is to stop held-down keys from creating multiple events.
|
||||
if (m_keys_pressed[event.key()])
|
||||
return;
|
||||
else
|
||||
m_keys_pressed[event.key()] = true;
|
||||
|
||||
bool event_was_accepted = false;
|
||||
|
|
|
@ -30,12 +30,12 @@ ProcessorParameterSlider::ProcessorParameterSlider(Orientation orientation, DSP:
|
|||
if (m_value_label != nullptr)
|
||||
m_value_label->set_text(DeprecatedString::formatted("{:.2f}", static_cast<double>(m_parameter)));
|
||||
|
||||
on_change = [this](auto value) {
|
||||
on_change = [this](auto raw_value) {
|
||||
if (m_currently_setting_from_ui)
|
||||
return;
|
||||
m_currently_setting_from_ui = true;
|
||||
DSP::ParameterFixedPoint real_value;
|
||||
real_value.raw() = value;
|
||||
real_value.raw() = raw_value;
|
||||
if (is_logarithmic())
|
||||
// FIXME: Implement exponential for fixed point
|
||||
real_value = exp2(static_cast<double>(real_value));
|
||||
|
|
|
@ -74,6 +74,5 @@ int TrackManager::next_track_index() const
|
|||
auto next_track_index = m_current_track + 1;
|
||||
if (next_track_index >= m_tracks.size())
|
||||
return 0;
|
||||
else
|
||||
return next_track_index;
|
||||
return static_cast<int>(next_track_index);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue