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


C++ MeiElement::getName方法代码示例

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


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

示例1: ReadFacsTable

void MusMeiInput::ReadFacsTable(MeiElement *element, FacsTable *table)
{
	if (element->getChildren().size() > 0) {
		for (vector<MeiElement*>::iterator i = element->getChildren().begin(); i != element->getChildren().end(); i++) {
			MeiElement e = **i;
			if (e.getName() == "zone") {
				std::string id;
				if (e.getId() != "") {
					id = e.getId();
				} else {
					throw "missing xml:id attribute on zone element";
				}
				int ulx = atoi(e.getAttribute("ulx")->getValue().c_str());
				int uly = atoi(e.getAttribute("uly")->getValue().c_str());
				int lry = atoi(e.getAttribute("lry")->getValue().c_str());
				table->add(id, ulx, uly, lry);
			} else if (e.getName() == "system") {
				std::string id;
				if (e.getId() != "") {
					id = e.getId();
				} else {
					throw "missing xml:id attribute on system element";
				}
				std::string facs;
				if (e.getFacs() != NULL) {
					facs = e.getFacs()->getValue();
				} else {
					throw "missing facs attribute on system element";
				}
				int ulx = table->GetX(facs); //what if they haven't been stored yet? zones are always defined before systems, as the facs needs to refer to something.
				int uly = table->GetUY(facs); //"
				int lry = table->GetLY(facs);
				table->add(id, ulx, uly, lry);
			}				
			ReadFacsTable(*i,&*table);
		}
	}
}
开发者ID:DDMAL,项目名称:aruspix,代码行数:38,代码来源:musiomei2.cpp

示例2: staffnum


//.........这里部分代码省略.........
            
            //extract events - notes, rests ligatures, uneumes and/or ligatures
            for (std::vector<scribe_event>::const_iterator eventit = rowit->events.begin(); eventit!=rowit->events.end(); eventit++ )
            {
                current_color = eventit->local_coloration;
                
                //use temp TiXML pointer which is either syllable, uneume/ineume or ligature - add notes to this, but make sure that uneume/inueme/ligature pointer is preinserted into syllable
                //handle events for each row
                code_t event_type = scribe_data.GetCodes()->get_code_type(eventit->code);//codes->get_code_type(eventit->code);
                //foster parent will change roles according to child elements that need to be added
                MeiElement* foster = syllable;
                
                switch (event_type)
                {
                    case code_t::ineume:
                    {
#ifdef IGNOREGAPS
                        Ineume* ineume = new Ineume;
                        //ineume->addAttribute("name", scribe_data.GetCodes()->code_to_name(eventit->code));
                        foster->addChild(ineume);
                        foster = ineume;
                        
#else                   //this needs work, hence excluded
                        if (!eventit->preceding_gap || foster->getChildren().empty())
                        {
                            Ineume* ineume = new Ineume;
                            //ineume->addAttribute("name", scribe_data.GetCodes()->code_to_name(eventit->code));
                            foster->addChild(ineume);
                            foster = ineume;
                        }
                        else
                        {
                            MeiElement* lastNeume = foster->getChildren().back();
                            if (lastNeume->getName() == "ineume")
                            {
                                Ineume* newNeume = new Ineume(*dynamic_cast<Ineume*>(lastNeume));
                                /*for (std::vector<MeiElement*>::const_iterator child = lastNeume->getChildren().begin(); child!=lastNeume->getChildren().end(); child++ ) {
                                    MeiElement* clone = new MeiElement(**child);
                                    newNeume->addChild(clone);
                                }*/
                                foster->removeChild(lastNeume);
                                foster->addChild(newNeume);
                                //delete lastNeume;
                                foster = newNeume;
                            }
                            else
                                foster = lastNeume;
                        }
#endif
                        goto do_note;
                        break;
                    }
                    case code_t::uneume:
                    {
                        Uneume* uneume = new Uneume;
                        uneume->addAttribute("name", scribe_data.GetCodes()->code_to_name(eventit->code));
                        foster->addChild(uneume);
                        foster = uneume;
                        goto do_note;
                        break;
                    }
                    case code_t::ligature:
                    {
                        Ligature* ligature = new Ligature; //mensural.h
                        ligature->addAttribute("name", scribe_data.GetCodes()->code_to_name(eventit->code));
                        foster->addChild(ligature);
开发者ID:jjstoessel,项目名称:Scribe2NeoScribe,代码行数:67,代码来源:CScribeToNeoScribeXML.cpp

示例3: MeiElement

TEST(TestMeiElement, TestConstructor) {
    MeiElement *m = new MeiElement("note");
    ASSERT_EQ("note", m->getName());
}
开发者ID:annplaksin,项目名称:libmei,代码行数:4,代码来源:test_meielement.cpp


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