Skip to content

Commit

Permalink
[Imp] Add label to metronome volume setting.
Browse files Browse the repository at this point in the history
git-svn-id: https://source.openmpt.org/svn/openmpt/trunk/OpenMPT@22862 56274372-70c3-4bfc-bfc3-4c3a0b034d27
  • Loading branch information
sagamusix committed Feb 1, 2025
1 parent 84e1b84 commit bc2f0a3
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
13 changes: 11 additions & 2 deletions mptrack/PatternEditorDialogs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1783,16 +1783,26 @@ BOOL MetronomeSettingsDlg::OnInitDialog()
}
SetSampleInfo(TrackerSettings::Instance().metronomeSampleMeasure, m_measureCombo, m_measureEdit, m_measureButton);
SetSampleInfo(TrackerSettings::Instance().metronomeSampleBeat, m_beatCombo, m_beatEdit, m_beatButton);
GetDlgItem(IDC_VOLUME)->SetWindowText(GetVolumeString());
return TRUE;
}


CString MetronomeSettingsDlg::GetVolumeString() const
{
CString s = (m_volumeSlider.GetPos() >= 0) ? _T("+") : _T("");
s.AppendFormat(_T("%.2f dB"), m_volumeSlider.GetPos() * METRONOME_VOLUME_SCALE);
return s;
}


void MetronomeSettingsDlg::OnHScroll(UINT, UINT, CScrollBar *bar)
{
if(bar == static_cast<CWnd *>(&m_volumeSlider))
{
TrackerSettings::Instance().metronomeVolume = m_volumeSlider.GetPos() * METRONOME_VOLUME_SCALE;
CMainFrame::GetMainFrame()->UpdateMetronomeVolume();
GetDlgItem(IDC_VOLUME)->SetWindowText(GetVolumeString());
}
}

Expand Down Expand Up @@ -1892,8 +1902,7 @@ CString MetronomeSettingsDlg::GetToolTipText(UINT id, HWND) const
switch(id)
{
case IDC_SLIDER1:
s = (m_volumeSlider.GetPos() >= 0) ? _T("+") : _T("");
s.AppendFormat(_T("%.2f dB"), m_volumeSlider.GetPos() * METRONOME_VOLUME_SCALE);
s = GetVolumeString();
break;
}

Expand Down
1 change: 1 addition & 0 deletions mptrack/PatternEditorDialogs.h
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ class MetronomeSettingsDlg : public DialogBase
BOOL OnInitDialog() override;
CString GetToolTipText(UINT id, HWND hwnd) const override;

CString GetVolumeString() const;
void SetSampleInfo(const mpt::PathString &path, CComboBox &combo, CEdit &edit, CButton &browseButton);
bool GetSampleInfo(Setting<mpt::PathString> &path, CComboBox &combo, CEdit &edit, CButton &browseButton);
mpt::PathString BrowseForSample(const mpt::PathString &path);
Expand Down
1 change: 1 addition & 0 deletions mptrack/mptrack.rc
Original file line number Diff line number Diff line change
Expand Up @@ -669,6 +669,7 @@ BEGIN
GROUPBOX "Common Settings",IDC_STATIC,6,6,264,54
CONTROL "&Enable Metronome",IDC_CHECK1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,18,75,10
LTEXT "&Volume:",IDC_STATIC,12,39,26,8
RTEXT "Static",IDC_VOLUME,210,19,48,8
CONTROL "",IDC_SLIDER1,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOOLTIPS | WS_TABSTOP,54,36,204,15
GROUPBOX "Measure",IDC_STATIC,6,66,264,55
COMBOBOX IDC_COMBO1,12,78,192,30,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
Expand Down
1 change: 1 addition & 0 deletions mptrack/resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -728,6 +728,7 @@
#define IDC_DELPLUGIN 2239
#define IDC_AUTOSAVE_USECUSTOMDIR 2245
#define IDC_BUTTON_MODTYPE2 2246
#define IDC_VOLUME 2247
#define IDC_SLIDER_SAMPLEPREAMP3 2248
#define IDC_SLIDER_GLOBALVOL 2249
#define IDC_EDIT_VSTIVOL 2250
Expand Down

0 comments on commit bc2f0a3

Please sign in to comment.