Package org.lilypondbeans.jccparser

Examples of org.lilypondbeans.jccparser.ASTBar


    public static boolean testLayout(LayoutEnv env, SimpleNode node) {
        if (node.id != ParserTreeConstants.JJTBAR) {
            return false;
        }
        ASTBar bar = (ASTBar) node;
        if (bar.generated == true && bar.barNumber == 0)//NULLBAR
        {
            return true;
        }
        BarLayout layout = new BarLayout();
        bar.setLayoutObject(layout);
        layout.distanceRight = 20;
        layout.priority = 100;
        return true;
    }
View Full Code Here


  

    public void calcLayout(LayoutEnv env, SimpleNode node) {
        if(node.inactive)
            return;
        ASTBar test = new ASTBar(ParserTreeConstants.JJTBAR);
        test.setBeattime(node.getBeattime());
        node.lastBar = score.getAllBar().floor(test);
      
        env.ignoreChilds = false;
        //Here are all Layoutobjects ordered by its most common usage
        if (PitchLayout.testLayout(env, node)) {
View Full Code Here

        }
        //bars
        Iterator<ASTBar> bars = score.getAllBar().iterator();
        while (bars.hasNext()) {
            ASTBar bar = bars.next();
            if (bar.getlayoutObject() != null)//no nullbar
            {
                for (int s = 0; s < linePosition[0].length; s++) {
                    Point pt = getPos(bar, s + 1);
                    //        int ypos = linePosition[0][s].y + top;//-pt.y;
                    bar.getlayoutObject().draw(pt.x, pt.y, gr);
                }
            }
        }
        //time
        Iterator<ASTTime> times = score.getAllTime().iterator();
View Full Code Here

    public void calcBars() {
        double maxTZ = score.highestBeattime;
        double lastBar = 0;
        double nextBar = 0;
        int barNumber = 1;
        ASTBar nullBar = new ASTBar(ParserTreeConstants.JJTBAR);
        nullBar.barNumber = 0;
        nullBar.setBeattime(0);
        nullBar.generated = true;
        score.getAllBar().add(nullBar);
        while (lastBar < maxTZ) {
            ASTTime test = new ASTTime(ParserTreeConstants.JJTTIME);
            test.setBeattime(lastBar);
            double taktlen = round(timeFor(lastBar).getTimeLen());
            Double partialLen = score.getAllPartial().get(lastBar);
            if (partialLen != null && partialLen < taktlen) {
                taktlen = partialLen;

            }
            if (taktlen == 0)//ein spaßvogel gibt 0/4 ein:-)
            {
                return;

            }
            double nextTimeChange = nextTimeChange(lastBar);// nextTaktChange(lastTaktstrich, score);
            double nextPart = nextPartial(lastBar); //nextPartial(lastTaktstrich, score);
            nextBar = lastBar + taktlen;
            if (nextTimeChange != -100 && nextTimeChange < nextBar) {
                nextBar = nextTimeChange;

            }
            if (nextPart != -100 && nextPart < nextBar) {
                nextBar = score.getAllPartial().get(nextPart);
                nextBar = nextBar + nextPart;
            } else {
                barNumber++;
            }
            if (nextBar > maxTZ) {
                return;
            }
            ASTBar newBar = new ASTBar(ParserTreeConstants.JJTBAR);
            newBar.barNumber = barNumber;
            newBar.setBeattime(nextBar);
            newBar.generated = true;
            lastBar = nextBar;
            // newBar.lastTime = lastTime;
            score.getAllBar().add(newBar);
            BarLayout.testLayout(null, newBar);
View Full Code Here

TOP

Related Classes of org.lilypondbeans.jccparser.ASTBar

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.