MCPcopy Create free account
hub / github.com/HertzDevil/0CC-FamiTracker / DrawFrameEditor

Method DrawFrameEditor

Source/FrameEditor.cpp:212–437  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

210}
211
212void CFrameEditor::DrawFrameEditor(CDC *pDC)
213{
214 // Draw the frame editor window
215 const COLORREF QUEUE_COLOR = 0x108010; // Colour of row in play queue
216 const COLORREF RED_BAR_COLOR = 0x4030A0;
217 const COLORREF BLUE_BAR_COLOR = 0xA02030;
218
219 // Cache settings
220 const COLORREF ColBackground = FTEnv.GetSettings()->Appearance.iColBackground;
221 const COLORREF ColText = FTEnv.GetSettings()->Appearance.iColPatternText;
222 const COLORREF ColTextHilite = FTEnv.GetSettings()->Appearance.iColPatternTextHilite;
223 const COLORREF ColCursor = FTEnv.GetSettings()->Appearance.iColCursor;
224 const COLORREF ColSelect = FTEnv.GetSettings()->Appearance.iColSelection;
225 const COLORREF ColDragCursor = INTENSITY(ColBackground) > 0x80 ? BLACK : WHITE;
226 const COLORREF ColSelectEdge = BLEND(ColSelect, WHITE, .7);
227 const COLORREF ColTextDimmed = DIM(FTEnv.GetSettings()->Appearance.iColPatternText, .9);
228
229 const CFamiTrackerView *pView = m_pView;
230 const CConstSongView *pSongView = pView->GetSongView(); // // //
231 if (!pSongView)
232 return;
233 const auto &song = pSongView->GetSong();
234
235 const int ChannelCount = GetSongChannelCount();
236 if (!ChannelCount)
237 return;
238 const int FrameCount = GetSongFrameCount();
239 int ActiveFrame = GetEditFrame(); // // //
240 int ActiveChannel = pView->GetSelectedChannel();
241
242 m_iFirstChannel = std::clamp(m_iFirstChannel, ActiveChannel - (ChannelCount - 1), ActiveChannel);
243
244 if (m_bLastRow) // // //
245 ++ActiveFrame;
246 ActiveFrame = std::clamp(ActiveFrame, 0, FrameCount);
247
248 CFont *pOldFont = m_dcBack.SelectObject(&m_Font);
249
250 m_dcBack.SetBkMode(TRANSPARENT);
251 m_dcBack.SetTextAlign(TA_CENTER); // // //
252
253 // Draw background
254 m_dcBack.FillSolidRect(0, 0, m_iWinWidth, m_iWinHeight, ColBackground);
255
256 // Selected row
257 COLORREF RowColor = BLEND(ColCursor, ColBackground, .5);
258
259 if (GetFocus() == this) {
260 if (m_bInputEnable)
261 RowColor = BLEND(RED_BAR_COLOR, 0, .8);
262 else
263 RowColor = BLEND(BLUE_BAR_COLOR, ColBackground, .8);
264 }
265
266 // Draw selected row
267 GradientBar(m_dcBack, DPI::Rect(0, m_iMiddleRow * ROW_HEIGHT + 3, m_iWinWidth, ROW_HEIGHT + 1), RowColor, ColBackground); // // //
268
269 const int FirstVisibleFrame = ActiveFrame - m_iMiddleRow;

Callers

nothing calls this directly

Calls 15

INTENSITYFunction · 0.85
BLENDFunction · 0.85
DIMFunction · 0.85
clampFunction · 0.85
GradientBarFunction · 0.85
to_wideFunction · 0.85
sv_from_uint_hexFunction · 0.85
sv_from_uintFunction · 0.85
InvertFunction · 0.85
GetSongViewMethod · 0.80
GetSongMethod · 0.80
GetSelectedChannelMethod · 0.80

Tested by

no test coverage detected