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


C++ Sheet::addBar方法代码示例

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


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

示例1: testNotePitch

    void testNotePitch()
    {
        Sheet* sheet = new Sheet();
        Bar* bar = sheet->addBar();
        Part* part = sheet->addPart("part");
        Voice* voice = part->addVoice();
        Staff* staff = part->addStaff();
        VoiceBar* vb = bar->voice(voice);

        for (int p = -20; p <= 20; p++) {
            Chord* c = new Chord(QuarterNote);
            c->addNote(staff, p);
            vb->addElement(c);
        }

        validateOutput(sheet, "notepitch.xml");
        delete sheet;
    }
开发者ID:KDE,项目名称:koffice-musicshape,代码行数:18,代码来源:MusicXmlWriterTest.cpp

示例2: testNoteAccidentals

    void testNoteAccidentals()
    {
        Sheet* sheet = new Sheet();
        Bar* bar = sheet->addBar();
        Part* part = sheet->addPart("part");
        Voice* voice = part->addVoice();
        Staff* staff = part->addStaff();
        VoiceBar* vb = bar->voice(voice);

        for (int a = -2; a <= 2; a++) {
            Chord* c = new Chord(QuarterNote);
            c->addNote(staff, 0, a);
            vb->addElement(c);
        }

        validateOutput(sheet, "noteaccidentals.xml");
        delete sheet;
    }
开发者ID:KDE,项目名称:koffice-musicshape,代码行数:18,代码来源:MusicXmlWriterTest.cpp

示例3: testNestedPartGroups

    void testNestedPartGroups()
    {
        Sheet* sheet = new Sheet();
        sheet->addBar();
        for (int i = 0; i < 7; i++) {
            sheet->addPart(QString("part %1").arg(i));
        }

        sheet->addPartGroup(0, 1)->setName("group 1");
        sheet->addPartGroup(1, 2)->setName("group 2");
        sheet->addPartGroup(2, 3)->setName("group 3");

        sheet->addPartGroup(0, 6)->setName("group 4");
        sheet->addPartGroup(4, 5)->setName("group 5");
        sheet->addPartGroup(4, 5)->setName("group 6");

        validateOutput(sheet, "nestedpartgroups.xml");
        delete sheet;
    }
开发者ID:KDE,项目名称:koffice-musicshape,代码行数:19,代码来源:MusicXmlWriterTest.cpp

示例4: testNoteDurations

    void testNoteDurations()
    {
        Sheet* sheet = new Sheet();
        Bar* bar = sheet->addBar();
        Part* part = sheet->addPart("part");
        Voice* voice = part->addVoice();
        Staff* staff = part->addStaff();
        VoiceBar* vb = bar->voice(voice);

        for (Duration d = HundredTwentyEighthNote; d <= BreveNote; d = (Duration)(d + 1)) {
            Chord* c = new Chord(d);
            c->addNote(staff, 0);
            vb->addElement(c);
        }
        for (int i = 1; i < 4; i++) {
            Chord* c = new Chord(QuarterNote, i);
            c->addNote(staff, 0);
            vb->addElement(c);
        }

        validateOutput(sheet, "notedurations.xml");
        delete sheet;
    }
开发者ID:KDE,项目名称:koffice-musicshape,代码行数:23,代码来源:MusicXmlWriterTest.cpp

示例5: testPartGroups

    void testPartGroups()
    {
        Sheet* sheet = new Sheet();
        sheet->addBar();
        for (int i = 0; i < 8; i++) {
            sheet->addPart(QString("part %1").arg(i));
        }

        PartGroup* pg = sheet->addPartGroup(0, 1);
        pg->setName("group 1");

        pg = sheet->addPartGroup(2, 3);
        pg->setSymbol(PartGroup::Brace);

        pg = sheet->addPartGroup(4, 5);
        pg->setSymbol(PartGroup::Line);

        pg = sheet->addPartGroup(6, 7);
        pg->setSymbol(PartGroup::Bracket);
        pg->setCommonBarLines(false);

        validateOutput(sheet, "partgroups.xml");
        delete sheet;
    }
开发者ID:KDE,项目名称:koffice-musicshape,代码行数:24,代码来源:MusicXmlWriterTest.cpp


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