Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add showRMS preference #6220

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

LWinterberg
Copy link
Member

Resolves: #6219

Another feature cherrypick from my themes branch

@LWinterberg LWinterberg self-assigned this Apr 4, 2024
@LWinterberg
Copy link
Member Author

LWinterberg commented Apr 4, 2024

though on second thought, I probably should have modified something in WaveformView so we can save a bunch of rectangle drawing calls. Maybe

+if(mShowRMS) {
   dc.SetPen(muted ? muteRmsPen : rmsPen);
   for (int x0 = 0; x0 < rect.width; ++x0) {
      int xx = rect.x + x0;
      if (r1[x0] != r2[x0]) {
         AColor::Line(dc, xx, rect.y + r2[x0], xx, rect.y + r1[x0]);
      }
   }
+}

when all you look at is colors, every problem is just a color change away, I suppose :)

@@ -101,13 +102,15 @@ void TrackArtist::SetColours( int iColorIndex)
theTheme.SetBrushColour( beatWeakBrush, clrBeatFillWeakBrush );
theTheme.SetBrushColour( beatStrongSelBrush, clrBeatFillStrongSelBrush );
theTheme.SetBrushColour( beatWeakSelBrush, clrBeatFillWeakSelBrush );


mShowRMS = gPrefs->Read(wxT("/GUI/ShowRMS"), mShowRMS);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See examples of BoolSetting. Avoid new string literals for preferences repeated in various places.

auto &commandManager = CommandManager::Get( project );
auto &trackPanel = TrackPanel::Get( project );

bool checked = !gPrefs->Read(wxT("/GUI/ShowRMS"), true);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use BoolSetting::Toggle instead

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do I do the same to the ShowClipping and ShowTrackNameInWaveform preferences right next door as well?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’m preparing a contribution to clean that up. So you done have to do that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add an option to show/hide RMS in waveform
2 participants