本文整理汇总了C++中Direction::GetSymbolCount方法的典型用法代码示例。如果您正苦于以下问题:C++ Direction::GetSymbolCount方法的具体用法?C++ Direction::GetSymbolCount怎么用?C++ Direction::GetSymbolCount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Direction
的用法示例。
在下文中一共展示了Direction::GetSymbolCount方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TestCaseConstructor
/// Tests the Constructors
/// @return True if all tests were executed, false if not
bool DirectionTestSuite::TestCaseConstructor()
{
//------Last Checked------//
// - Jan 11, 2005
// TEST CASE: Default constructor
{
Direction direction;
TEST(wxT("Default Constructor"),
(direction.GetPosition() == Direction::DEFAULT_POSITION) &&
(direction.GetSymbolCount() == 0)
);
}
// TEST CASE: Primary constructor
{
Direction direction(12, Direction::toCoda, Direction::activeDaCapo, 4);
wxByte symbolType = 0;
wxByte activeSymbol = 0;
wxByte repeatNumber = 0;
bool ok = direction.GetSymbol(0, symbolType, activeSymbol, repeatNumber);
TEST(wxT("Primary Constructor"),
(ok) &&
(direction.GetPosition() == 12) &&
(symbolType == Direction::toCoda) &&
(activeSymbol == Direction::activeDaCapo) &&
(repeatNumber == 4)
);
}
// TEST CASE: Copy constructor
{
Direction direction(12, Direction::toCoda, Direction::activeDaCapo, 4);
Direction direction2(direction);
TEST(wxT("Copy Constructor"),
(direction2 == direction)
);
}
return (true);
}
示例2: GetSymbolCount
/// Equality Operator
bool Direction::operator==(const Direction& direction) const
{
//------Last Checked------//
// - Jan 11, 2005
size_t thisSymbolCount = GetSymbolCount();
size_t otherSymbolCount = direction.GetSymbolCount();
// Directions have differing number of symbols
if (thisSymbolCount != otherSymbolCount)
return (false);
// All symbols must match
size_t i = 0;
for (; i < thisSymbolCount; i++)
{
if (m_symbolArray[i] != direction.m_symbolArray[i])
return (false);
}
return (m_position == direction.m_position);
}
示例3: OnTestParseFile
//.........这里部分代码省略.........
}
}
}
// Parse the systems in the score
// In Power Tab Editor v1.7, systems can be accessed via the Section menu:
// Menu Section -> New Section
// Systems are stored in the array by order they are drawn in the score
wxUint32 systemIndex = 0;
wxUint32 systemCount = score->GetSystemCount();
for (; systemIndex < systemCount; systemIndex++)
{
System* system = score->GetSystem(systemIndex);
wxCHECK2(system != NULL, continue);
wxRect rect = system->GetRect();
wxByte positionSpacing = system->GetPositionSpacing();
// Parse the directions in the system
// In Power Tab Editor v1.7, directions can be accessed via the Musical Direction dialog:
// Menu Music Symbols -> Musical Direction
wxUint32 directionIndex = 0;
wxUint32 directionCount = system->GetDirectionCount();
for (; directionIndex < directionCount; directionIndex++)
{
Direction* direction = system->GetDirection(directionIndex);
wxCHECK2(direction != NULL, continue);
wxUint32 position = direction->GetPosition();
// There may be up to 3 symbols per object
size_t symbolIndex = 0;
size_t symbolCount = direction->GetSymbolCount();
for (; symbolIndex < symbolCount; symbolIndex++)
{
wxByte symbolType = 0;
wxByte activeSymbol = 0;
wxByte repeatNumber = 0;
direction->GetSymbol(symbolIndex, symbolType, activeSymbol, repeatNumber);
}
}
// Parse the chord text items in the system
// In Power Tab Editor v1.7, chord text/chord name data can be accessed via the Chord Name dialog:
// Menu Text -> Chord Name
wxUint32 chordTextIndex = 0;
wxUint32 chordTextCount = system->GetChordTextCount();
for (; chordTextIndex < chordTextCount; chordTextIndex++)
{
ChordText* chordText = system->GetChordText(chordTextIndex);
wxCHECK2(chordText != NULL, continue);
wxUint32 positon = chordText->GetPosition();
const ChordName& chordName = chordText->GetChordNameConstRef();
wxByte tonicKey = 0;
wxByte tonicKeyVariation = 0;
chordName.GetTonic(tonicKey, tonicKeyVariation);
wxByte bassNoteKey = 0;
wxByte bassNoteKeyVariation = 0;
chordName.GetBassNote(bassNoteKey, bassNoteKeyVariation);
wxByte formula = chordName.GetFormula();
bool brackets = chordName.HasBrackets();
bool noChord = chordName.IsNoChord();