Skip to content

Commit

Permalink
[Ref] Small NOTE_MAX related cleanups.
Browse files Browse the repository at this point in the history
git-svn-id: https://source.openmpt.org/svn/openmpt/trunk/OpenMPT@22098 56274372-70c3-4bfc-bfc3-4c3a0b034d27
  • Loading branch information
sagamusix committed Nov 4, 2024
1 parent e27586c commit c3167a1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
2 changes: 1 addition & 1 deletion mptrack/Draw_pat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1686,7 +1686,7 @@ CString CViewPattern::GetCursorDescription() const
{
ModInstrument *pIns = sndFile.Instruments[m->instr];
s += mpt::ToCString(sndFile.GetCharsetInternal(), pIns->name);
if((m->note) && (m->note <= NOTE_MAX))
if(m->IsNote())
{
const SAMPLEINDEX nsmp = pIns->Keyboard[m->note - 1];
if((nsmp) && (nsmp <= sndFile.GetNumSamples()))
Expand Down
7 changes: 1 addition & 6 deletions mptrack/dlg_misc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1165,12 +1165,7 @@ BOOL CSampleMapDlg::OnInitDialog()
DialogBase::OnInitDialog();
ModInstrument *pIns = sndFile.Instruments[m_nInstrument];
if(pIns)
{
for(UINT i = 0; i < NOTE_MAX; i++)
{
KeyboardMap[i] = pIns->Keyboard[i];
}
}
KeyboardMap = pIns->Keyboard;
m_Keyboard.Init(this, 3, TRUE);
m_SbOctave.SetRange(0, 7);
m_SbOctave.SetPos(4);
Expand Down
6 changes: 3 additions & 3 deletions mptrack/dlg_misc.h
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ class CKeyboardControl: public CWnd
bool m_mouseCapture = false, m_cursorNotify = false;
bool m_mouseDown = false;

uint8 KeyFlags[NOTE_MAX]; // 10 octaves max
SAMPLEINDEX m_sampleNum[NOTE_MAX];
std::array<uint8, NOTE_MAX> KeyFlags; // 10 octaves max
std::array<SAMPLEINDEX, NOTE_MAX> m_sampleNum;

public:
CKeyboardControl() = default;
Expand Down Expand Up @@ -211,7 +211,7 @@ class CSampleMapDlg : public DialogBase

CSoundFile &sndFile;
const INSTRUMENTINDEX m_nInstrument;
SAMPLEINDEX KeyboardMap[NOTE_MAX];
std::array<SAMPLEINDEX, NOTE_MAX - NOTE_MIN + 1> KeyboardMap;
MouseAction mouseAction = MouseAction::Unknown;

public:
Expand Down

0 comments on commit c3167a1

Please sign in to comment.