本文整理汇总了C++中Direction::GetPosition方法的典型用法代码示例。如果您正苦于以下问题:C++ Direction::GetPosition方法的具体用法?C++ Direction::GetPosition怎么用?C++ Direction::GetPosition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Direction
的用法示例。
在下文中一共展示了Direction::GetPosition方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TestCasePosition
/// Tests the Position Functions
/// @return True if all tests were executed, false if not
bool DirectionTestSuite::TestCasePosition()
{
//------Last Checked------//
// - Jan 11, 2005
Direction direction;
// TEST CASE: IsValidPosition
{
wxUint32 i = 0;
for (; i <= (Direction::MAX_POSITION + 1); i++)
{
TEST(wxString::Format(wxT("IsValidPosition - %d"), i),
(Direction::IsValidPosition(i) == (i <= Direction::MAX_POSITION))
);
}
}
// TEST CASE: SetPosition
{
wxUint32 i = 0;
for (; i <= (Direction::MAX_POSITION + 1); i++)
{
TEST(wxT("SetPosition - %d"),
(direction.SetPosition(i) == (i <= Direction::MAX_POSITION)) &&
((i > Direction::MAX_POSITION) ? 1 : (direction.GetPosition() == i))
);
}
}
return (true);
}
示例2: 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);
}
示例3: OnTestParseFile
//.........这里部分代码省略.........
wxCHECK2(floatingText != NULL, continue);
wxString text = floatingText->GetText();
wxRect rect = floatingText->GetRect();
wxByte alignment = floatingText->GetAlignment();
bool border = floatingText->HasBorder();
// Font setting for the text
const FontSetting& fontSetting = floatingText->GetFontSettingConstRef();
wxString faceName = fontSetting.GetFaceName();
wxInt32 pointSize = fontSetting.GetPointSize();
wxInt32 weight = fontSetting.GetWeight();
bool italic = fontSetting.IsItalic();
bool underline = fontSetting.IsUnderline();
bool strikeOut = fontSetting.IsStrikeOut();
wxColor color = fontSetting.GetColor();
}
// Parse the guitar ins in the score
// In Power Tab Editor v1.7, guitar ins can be accessed via the Guitar In dialog:
// Menu Guitar -> Guitar In
// Guitar Ins are stored in the array by order of their system, position and
// staff values
wxUint32 guitarInIndex = 0;
wxUint32 guitarInCount = score->GetGuitarInCount();
for (; guitarInIndex < guitarInCount; guitarInIndex++)
{
GuitarIn* guitarIn = score->GetGuitarIn(guitarInIndex);
wxCHECK2(guitarIn != NULL, continue);
wxWord system = guitarIn->GetSystem();
wxByte staff = guitarIn->GetStaff();
wxByte position = guitarIn->GetPosition();
if (guitarIn->HasStaffGuitarsSet())
{
wxByte staffGuitars = guitarIn->GetStaffGuitars();
}
if (guitarIn->HasRhythmSlashGuitarsSet())
{
wxByte rhythmSlashGuitars = guitarIn->GetRhythmSlashGuitars();
}
}
// Parse the tempo markers in the score
// In Power Tab Editor v1.7, tempo markers can be accessed via the Tempo Marker dialog:
// Menu Music Symbols -> Tempo Marker
// and the Alteration of Pace dialog:
// Menu Music Symbols -> Alteration of Pace
// Tempo Markers are stored in the array by order of their system, position and
// staff values
wxUint32 tempoMarkerIndex = 0;
wxUint32 tempoMarkerCount = score->GetTempoMarkerCount();
for (; tempoMarkerIndex < tempoMarkerCount; tempoMarkerIndex++)
{
TempoMarker* tempoMarker = score->GetTempoMarker(tempoMarkerIndex);
wxCHECK2(tempoMarker != NULL, continue);
if (tempoMarker->IsStandardMarker())
{
wxByte beatType = tempoMarker->GetBeatType();
wxUint32 beatsPerMinute = tempoMarker->GetBeatsPerMinute();
}