本文整理汇总了C++中CFamiTrackerDoc::GetFrameCount方法的典型用法代码示例。如果您正苦于以下问题:C++ CFamiTrackerDoc::GetFrameCount方法的具体用法?C++ CFamiTrackerDoc::GetFrameCount怎么用?C++ CFamiTrackerDoc::GetFrameCount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFamiTrackerDoc
的用法示例。
在下文中一共展示了CFamiTrackerDoc::GetFrameCount方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SaveState
bool CFrameAction::SaveState(CMainFrame *pMainFrm)
{
// Perform action
CFrameEditor *pFrameEditor = pMainFrm->GetFrameEditor();
CFamiTrackerView *pView = (CFamiTrackerView*)pMainFrm->GetActiveView();
CFamiTrackerDoc *pDocument = pView->GetDocument();
m_iUndoFramePos = pView->GetSelectedFrame();
m_iUndoChannelPos = pView->GetSelectedChannel();
switch (m_iAction) {
case ACT_ADD:
if (!pDocument->InsertFrame(m_iUndoFramePos + 1))
return false;
pDocument->UpdateAllViews(NULL, CHANGED_FRAMES);
break;
case ACT_REMOVE:
SaveFrame(pDocument);
if (!pDocument->RemoveFrame(m_iUndoFramePos))
return false;
pDocument->UpdateAllViews(NULL, CHANGED_FRAMES);
break;
case ACT_DUPLICATE:
if (!pDocument->DuplicateFrame(m_iUndoFramePos))
return false;
pDocument->UpdateAllViews(NULL, CHANGED_FRAMES);
break;
case ACT_DUPLICATE_PATTERNS:
if (!pDocument->DuplicatePatterns(m_iUndoFramePos + 1))
return false;
pDocument->UpdateAllViews(NULL, CHANGED_FRAMES);
break;
case ACT_CHANGE_COUNT:
m_iUndoFrameCount = pDocument->GetFrameCount();
pDocument->SetFrameCount(m_iNewFrameCount);
pDocument->UpdateAllViews(NULL, CHANGED_FRAMES);
break;
case ACT_SET_PATTERN:
m_iOldPattern = pDocument->GetPatternAtFrame(m_iUndoFramePos, m_iUndoChannelPos);
pDocument->SetPatternAtFrame(m_iUndoFramePos, m_iUndoChannelPos, m_iNewPattern);
pDocument->UpdateAllViews(NULL, CHANGED_PATTERN);
break;
case ACT_SET_PATTERN_ALL:
{
int Channels = pDocument->GetAvailableChannels();
for (int i = 0; i < Channels; ++i) {
m_iPatterns[i] = pDocument->GetPatternAtFrame(m_iUndoFramePos, i);
pDocument->SetPatternAtFrame(m_iUndoFramePos, i, m_iNewPattern);
}
pDocument->UpdateAllViews(NULL, CHANGED_PATTERN);
}
break;
case ACT_CHANGE_PATTERN:
{
m_iOldPattern = pDocument->GetPatternAtFrame(m_iUndoFramePos, m_iUndoChannelPos);
int NewPattern = m_iOldPattern + m_iPatternDelta;
if (NewPattern < 0)
NewPattern = 0;
if (NewPattern >= MAX_FRAMES)
NewPattern = MAX_FRAMES - 1;
if (NewPattern == m_iOldPattern)
return false;
pDocument->SetPatternAtFrame(m_iUndoFramePos, m_iUndoChannelPos, NewPattern);
pDocument->UpdateAllViews(NULL, CHANGED_PATTERN);
}
break;
case ACT_CHANGE_PATTERN_ALL:
{
int Channels = pDocument->GetAvailableChannels();
for (int i = 0; i < Channels; ++i) {
m_iPatterns[i] = pDocument->GetPatternAtFrame(m_iUndoFramePos, i);
if (m_iPatterns[i] + m_iPatternDelta < 0 || m_iPatterns[i] + m_iPatternDelta >= MAX_FRAMES)
return false;
}
for (int i = 0; i < Channels; ++i)
pDocument->SetPatternAtFrame(m_iUndoFramePos, i, m_iPatterns[i] + m_iPatternDelta);
pDocument->UpdateAllViews(NULL, CHANGED_PATTERN);
}
break;
case ACT_MOVE_DOWN:
if (!pDocument->MoveFrameDown(m_iUndoFramePos))
return false;
pView->SelectFrame(m_iUndoFramePos + 1);
pDocument->UpdateAllViews(NULL, CHANGED_FRAMES);
break;
case ACT_MOVE_UP:
if (!pDocument->MoveFrameUp(m_iUndoFramePos))
return false;
pView->SelectFrame(m_iUndoFramePos - 1);
pDocument->UpdateAllViews(NULL, CHANGED_FRAMES);
break;
case ACT_PASTE:
SaveFrame(pDocument);
{
int Channels = pDocument->GetAvailableChannels();
for (int i = 0; i < Channels; ++i)
pDocument->SetPatternAtFrame(m_iUndoFramePos, i, m_iPasteData[i]);
}
pDocument->UpdateAllViews(NULL, CHANGED_PATTERN);
//.........这里部分代码省略.........