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


C++ Position::GetIrregularGroupingTiming方法代码示例

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


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

示例1: TestCaseIrregularGrouping

/// Tests the Irregular Grouping Functions
/// @return True if the all tests were executed, false if not
bool PositionTestSuite::TestCaseIrregularGrouping()
{
    //------Last Checked------//
    // - Jan 18, 2005
    
    // TEST CASE: IsValidIrregularGroupingTiming
    {
        wxByte i = Position::MIN_IRREGULAR_GROUPING_NOTES_PLAYED - 1;
        for (; i < (Position::MAX_IRREGULAR_GROUPING_NOTES_PLAYED + 1); i++)
        {
            wxByte j = Position::MIN_IRREGULAR_GROUPING_NOTES_PLAYED_OVER - 1;
            for (; j < (Position::MAX_IRREGULAR_GROUPING_NOTES_PLAYED_OVER + 1);
                j++)
            {
                TEST(
                    wxString::Format(wxT("IsValidIrregularGroupingTiming - %d, %d"),
                    i, j),
                    (Position::IsValidIrregularGroupingTiming(i, j) == 
                        (((i >= Position::MIN_IRREGULAR_GROUPING_NOTES_PLAYED) &&
                        (i <= Position::MAX_IRREGULAR_GROUPING_NOTES_PLAYED)) &&
                        ((j >= Position::MIN_IRREGULAR_GROUPING_NOTES_PLAYED_OVER) &&
                        (j <= Position::MAX_IRREGULAR_GROUPING_NOTES_PLAYED_OVER))))
                );
            }
        }   
    }
    
    // TEST CASE: SetIrregularGroupingTiming
    {
        Position position;
        
        wxByte i = Position::MIN_IRREGULAR_GROUPING_NOTES_PLAYED - 1;
        for (; i < (Position::MAX_IRREGULAR_GROUPING_NOTES_PLAYED + 1); i++)
        {
            wxByte j = Position::MIN_IRREGULAR_GROUPING_NOTES_PLAYED_OVER - 1;
            for (; j < (Position::MAX_IRREGULAR_GROUPING_NOTES_PLAYED_OVER + 1); j++)
            {
                bool set = position.SetIrregularGroupingTiming(i,j);
                bool valid = (i >= Position::MIN_IRREGULAR_GROUPING_NOTES_PLAYED) &&
                    (i <= Position::MAX_IRREGULAR_GROUPING_NOTES_PLAYED) &&
                        (j >= Position::MIN_IRREGULAR_GROUPING_NOTES_PLAYED_OVER) &&
                        (j <= Position::MAX_IRREGULAR_GROUPING_NOTES_PLAYED_OVER);
                         
                wxByte notesPlayed = 0;
                wxByte notesPlayedOver = 0;
                position.GetIrregularGroupingTiming(notesPlayed, notesPlayedOver);
                
                TEST(wxString::Format(wxT("SetIrregularGroupingTiming - %d, %d"),
                    i, j), (set == valid) &&
                    ((!valid) ? 1 : (position.HasIrregularGroupingTiming() &&
                    ((notesPlayed == i) && (notesPlayedOver == j))))
                );
            }
        }   
    }
    
    // TEST CASE: ClearIrregularGroupingTiming
    {
        Position position;
        position.SetIrregularGroupingTiming(3,2);
        
        bool clear = position.ClearIrregularGroupingTiming();
        TEST(wxT("ClearIrregularGroupingTiming"),
            (clear && !position.HasIrregularGroupingTiming())
        );
    }
    
    return (true);
}
开发者ID:RaptDept,项目名称:ptparser,代码行数:71,代码来源:positiontestsuite.cpp

示例2: OnTestParseFile


//.........这里部分代码省略.........
            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();
                            bool beamEnd = position->IsBeamEnd();
                            
                            bool dotted = position->IsDotted();
                            bool doubleDotted = position->IsDoubleDotted();
                            bool rest = position->IsRest();
                            bool vibrato = position->HasVibrato();
                            bool wideVibrato = position->HasWideVibrato();
                            bool arpeggioUp = position->HasArpeggioUp();
                            bool arpeggioDown = position->HasArpeggioDown();
                            bool pickstrokeUp = position->HasPickStrokeUp();
                            bool pickstrokeDown = position->HasPickStrokeDown();
                            bool staccato = position->IsStaccato();
                            bool marcato = position->HasMarcato();
                            bool sforzando = position->HasSforzando();
                            bool tremoloPicking = position->HasTremoloPicking();
                            bool palmMuting = position->HasPalmMuting();
                            bool tap = position->HasTap();
                            bool acciaccatura = position->IsAcciaccatura();
                            bool tripletFeel1st = position->IsTripletFeel1st();
                            bool tripletFeel2nd = position->IsTripletFeel2nd();
                            bool letRing = position->HasLetRing();
                            bool fermata = position->HasFermata();
                            bool irregularGroupingStart = position->IsIrregularGroupingStart();
                            bool irregularGroupingMiddle = position->IsIrregularGroupingMiddle();
                            bool irregularGroupingEnd = position->IsIrregularGroupingEnd();
                            
                            if (position->HasVolumeSwell())
开发者ID:BackupTheBerlios,项目名称:ptparser-svn,代码行数:67,代码来源:powertabview.cpp


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