当前位置: 首页>>代码示例>>C++>>正文


C++ Staff::GetClef方法代码示例

本文整理汇总了C++中Staff::GetClef方法的典型用法代码示例。如果您正苦于以下问题:C++ Staff::GetClef方法的具体用法?C++ Staff::GetClef怎么用?C++ Staff::GetClef使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Staff的用法示例。


在下文中一共展示了Staff::GetClef方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: TestCaseClef

/// Tests the Clef Functions
/// @return True if all tests were executed, false if not
bool StaffTestSuite::TestCaseClef()
{
    //------Last Checked------//
    // - Jan 5, 2005
    
    // TEST CASE: IsValidClef
    {
        wxByte i = Staff::TREBLE_CLEF;
        for (; i <= (Staff::BASS_CLEF + 1); i++)
            TEST(wxString::Format(wxT("IsValidClef - %d"), i),
                (Staff::IsValidClef(i) == (i <= Staff::BASS_CLEF))
            );
    }
    
    // TEST CASE: SetClef
    {
        Staff staff;
        wxByte i = Staff::TREBLE_CLEF;
        for (; i <= (Staff::BASS_CLEF + 1); i++)
            TEST(wxString::Format(wxT("SetClef - %d"), i),
                (staff.SetClef(i) == (i <= Staff::BASS_CLEF)) &&
                ((i > Staff::BASS_CLEF) ? 1 : (staff.GetClef() == i))
            );
    }
    return (true);
}
开发者ID:BackupTheBerlios,项目名称:ptparser-svn,代码行数:28,代码来源:stafftestsuite.cpp

示例2: TestCaseConstructor

/// Tests the Constructors
/// @return True if all tests were executed, false if not
bool StaffTestSuite::TestCaseConstructor()
{
    //------Last Checked------//
    // - Jan 5, 2005
    
    // TEST CASE: Default Constructor
    {
        Staff staff;
        TEST(wxT("Default Constructor"),
            (staff.GetClef() == Staff::DEFAULT_CLEF) &&
            (staff.GetTablatureStaffType() == Staff::DEFAULT_TABLATURE_STAFF_TYPE) &&
            (staff.GetStandardNotationStaffAboveSpacing() == Staff::DEFAULT_STANDARD_NOTATION_STAFF_ABOVE_SPACING) &&
            (staff.GetStandardNotationStaffBelowSpacing() == Staff::DEFAULT_STANDARD_NOTATION_STAFF_BELOW_SPACING) &&
            (staff.GetSymbolSpacing() == Staff::DEFAULT_SYMBOL_SPACING) &&
            (staff.GetTablatureStaffBelowSpacing() == Staff::DEFAULT_TABLATURE_STAFF_BELOW_SPACING)
        );
    }
    
    // TEST CASE: Primary Constructor
    {
        Staff staff(4, Staff::BASS_CLEF);
        staff.m_positionArray[0].Add(new Position);
        staff.m_positionArray[1].Add(new Position);
        
        TEST(wxT("Copy Constructor"),
            (staff.GetClef() == Staff::BASS_CLEF) &&
            (staff.GetTablatureStaffType() == 4) &&
            (staff.GetStandardNotationStaffAboveSpacing() == Staff::DEFAULT_STANDARD_NOTATION_STAFF_ABOVE_SPACING) &&
            (staff.GetStandardNotationStaffBelowSpacing() == Staff::DEFAULT_STANDARD_NOTATION_STAFF_BELOW_SPACING) &&
            (staff.GetSymbolSpacing() == Staff::DEFAULT_SYMBOL_SPACING) &&
            (staff.GetTablatureStaffBelowSpacing() == Staff::DEFAULT_TABLATURE_STAFF_BELOW_SPACING)
        );
    }
    
    // TEST CASE: Copy Constructor
    {
        Staff staff(4, Staff::BASS_CLEF);
        staff.m_positionArray[0].Add(new Position);
        staff.m_positionArray[1].Add(new Position);
        Staff staff2(staff);
        
        TEST(wxT("Copy Constructor"), staff == staff2);
    }
    
    return (true);
}
开发者ID:BackupTheBerlios,项目名称:ptparser-svn,代码行数:48,代码来源:stafftestsuite.cpp

示例3: OnTestParseFile


//.........这里部分代码省略.........
                {
                }
                
                wxByte beat1 = 0;
                wxByte beat2 = 0;
                wxByte beat3 = 0;
                wxByte beat4 = 0;
                timeSignature.GetBeamingPattern(beat1, beat2, beat3, beat4);
                if (timeSignature.IsShown())
                {
                }
                wxByte pulses = timeSignature.GetPulses();
                
                const RehearsalSign& rehearsalSign = endBar.GetRehearsalSignConstRef();
                if (rehearsalSign.IsSet())
                {
                    wxInt8 letter = rehearsalSign.GetLetter();
                    wxString description = rehearsalSign.GetDescription();
                }
            }
            
            // Parse the staves in the system
            // In Power Tab Editor v1.7, staves can be accessed via the Section menu:
            // Menu Section -> Attach Staff
            // and by clicking the clef on the standard notation standard staff and
            // by clicking the "TAB" clef on the tablature staff
            wxUint32 staffIndex = 0;
            wxUint32 staffCount = system->GetStaffCount();
            for (; staffIndex < staffCount; staffIndex++)
            {
                Staff* staff = system->GetStaff(staffIndex);
                wxCHECK2(staff != NULL, continue);
                
                wxByte clef = staff->GetClef();
                wxByte tablatureStaffType = staff->GetTablatureStaffType();
                
                // Parse the positions in each voice
                wxUint32 voice = 0;
                for (; voice < NUM_STAFF_VOICES; voice++)
                {
                    wxUint32 positionIndex = 0;
                    wxUint32 positionCount = staff->GetPositionCount(voice);
                    for (; positionIndex < positionCount; positionIndex++)
                    {
                        Position* position = staff->GetPosition(voice, positionIndex);
                        wxCHECK2(position != NULL, continue);
                    
                        wxUint32 positionIndex = 0;
                        wxUint32 positionCount = staff->GetPositionCount(voice);
                        for (; positionIndex < positionCount; positionIndex++)
                        {
                            Position* position = staff->GetPosition(voice, positionIndex);
                            wxCHECK2(position != NULL, continue);
                            
                            wxUint32 position2 = position->GetPosition();
                            wxByte durationType = position->GetDurationType();
                            if (position->HasIrregularGroupingTiming())
                            {
                                wxByte notesPlayed = 0;
                                wxByte notesPlayedOver = 0;
                                position->GetIrregularGroupingTiming(notesPlayed, notesPlayedOver);
                            }
                            wxByte previousBeamDurationType = position->GetPreviousBeamDurationType();
                            bool beamStart = position->IsBeamStart();
                            bool fractionalLeftBeam = position->HasFractionalLeftBeam();
                            bool fractionalRightBeam = position->HasFractionalRightBeam();
开发者ID:BackupTheBerlios,项目名称:ptparser-svn,代码行数:67,代码来源:powertabview.cpp


注:本文中的Staff::GetClef方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。