示例#1
0
        private Beam NewBeam(DurationClass durationClass, float leftX, float rightX, bool isStub)
        {
            Beam newBeam = null;

            switch (durationClass)
            {
            case DurationClass.fiveFlags:
                if (isStub)
                {
                    newBeam = new FiveFlagsBeamStub(leftX, rightX);
                }
                else
                {
                    newBeam = new FiveFlagsBeam(leftX, rightX);
                }
                break;

            case DurationClass.fourFlags:
                if (isStub)
                {
                    newBeam = new FourFlagsBeamStub(leftX, rightX);
                }
                else
                {
                    newBeam = new FourFlagsBeam(leftX, rightX);
                }
                break;

            case DurationClass.threeFlags:
                if (isStub)
                {
                    newBeam = new ThreeFlagsBeamStub(leftX, rightX);
                }
                else
                {
                    newBeam = new ThreeFlagsBeam(leftX, rightX);
                }
                break;

            case DurationClass.semiquaver:
                if (isStub)
                {
                    newBeam = new SemiquaverBeamStub(leftX, rightX);
                }
                else
                {
                    newBeam = new SemiquaverBeam(leftX, rightX);
                }
                break;

            case DurationClass.quaver:
                newBeam = new QuaverBeam(leftX, rightX);
                break;

            default:
                Debug.Assert(false, "Illegal beam duration class");
                break;
            }
            return(newBeam);
        }
示例#2
0
 private Beam NewBeam(DurationClass durationClass, float leftX, float rightX, bool isStub)
 {
     Beam newBeam = null;
     switch(durationClass)
     {
         case DurationClass.fiveFlags:
             if(isStub)
                 newBeam = new FiveFlagsBeamStub(leftX, rightX);
             else
                 newBeam = new FiveFlagsBeam(leftX, rightX);
             break;
         case DurationClass.fourFlags:
             if(isStub)
                 newBeam = new FourFlagsBeamStub(leftX, rightX);
             else
                 newBeam = new FourFlagsBeam(leftX, rightX);
             break;
         case DurationClass.threeFlags:
             if(isStub)
                 newBeam = new ThreeFlagsBeamStub(leftX, rightX);
             else
                 newBeam = new ThreeFlagsBeam(leftX, rightX);
             break;
         case DurationClass.semiquaver:
             if(isStub)
                 newBeam = new SemiquaverBeamStub(leftX, rightX);
             else
                 newBeam = new SemiquaverBeam(leftX, rightX);
             break;
         case DurationClass.quaver:
             newBeam = new QuaverBeam(leftX, rightX);
             break;
         default:
             Debug.Assert(false, "Illegal beam duration class");
             break;
     }
     return newBeam;
 }