MCPcopy Create free account
hub / github.com/audacity/audacity / OnPreferences

Method OnPreferences

src/widgets/MeterPanel.cpp:1925–2038  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1923}
1924
1925void MeterPanel::OnPreferences(wxCommandEvent & WXUNUSED(event))
1926{
1927 wxTextCtrl *rate;
1928 wxRadioButton *gradient;
1929 wxRadioButton *rms;
1930 wxRadioButton *db;
1931 wxRadioButton *linear;
1932 wxRadioButton *automatic;
1933 wxRadioButton *horizontal;
1934 wxRadioButton *vertical;
1935 int meterRefreshRate = mMeterRefreshRate;
1936
1937 auto title = mIsInput ? XO("Recording Meter Options") : XO("Playback Meter Options");
1938
1939 // Dialog is a child of the project, rather than of the toolbar.
1940 // This determines where it pops up.
1941
1942 wxDialogWrapper dlg( FindProjectFrame( mProject ), wxID_ANY, title);
1943 dlg.SetName();
1944 ShuttleGui S(&dlg, eIsCreating);
1945 S.StartVerticalLay();
1946 {
1947 S.StartStatic(XO("Refresh Rate"), 0);
1948 {
1949 S.AddFixedText(XO(
1950"Higher refresh rates make the meter show more frequent\nchanges. A rate of 30 per second or less should prevent\nthe meter affecting audio quality on slower machines."));
1951 S.StartHorizontalLay();
1952 {
1953 rate = S.Name(XO("Meter refresh rate per second [1-100]"))
1954 .Validator<IntegerValidator<long>>(
1955 &mMeterRefreshRate, NumValidatorStyle::DEFAULT,
1956 MIN_REFRESH_RATE, MAX_REFRESH_RATE)
1957 .AddTextBox(XXO("Meter refresh rate per second [1-100]: "),
1958 wxString::Format(wxT("%d"), meterRefreshRate),
1959 10);
1960 }
1961 S.EndHorizontalLay();
1962 }
1963 S.EndStatic();
1964
1965 S.StartHorizontalLay();
1966 {
1967 S.StartStatic(XO("Meter Style"), 0);
1968 {
1969 S.StartVerticalLay();
1970 {
1971 gradient = S.AddRadioButton(XXO("Gradient"), true, mGradient);
1972 rms = S.AddRadioButtonToGroup(XXO("RMS"), false, mGradient);
1973 }
1974 S.EndVerticalLay();
1975 }
1976 S.EndStatic();
1977
1978 S.StartStatic(XO("Meter Type"), 0);
1979 {
1980 S.StartVerticalLay();
1981 {
1982 db = S.AddRadioButton(XXO("dB"), true, mDB);

Callers

nothing calls this directly

Calls 15

FindProjectFrameFunction · 0.85
MeterPrefsIDFunction · 0.85
StartStaticMethod · 0.80
AddFixedTextMethod · 0.80
AddTextBoxMethod · 0.80
EndStaticMethod · 0.80
AddRadioButtonMethod · 0.80
AddRadioButtonToGroupMethod · 0.80
SetNameMethod · 0.45
LayoutMethod · 0.45
FitMethod · 0.45
ShowModalMethod · 0.45

Tested by

no test coverage detected