Skip to content

Adding new element tags

Andrew Tran edited this page Sep 12, 2017 · 3 revisions

Adding new element tags

If you want Verovio to accept new element tags, there are several places where you need to add code.

  1. Creating the respective .cpp and .h files. .cpp files should go into the /src folder, and .h files go into the /include/vrv folder. More information for these files can be found [here], and you can see examples by looking at the structures of existing files.

  2. Open up /include/vrv/vrvdef.h to add the definition of the new element. You will need to add it to the enum ClassId, and possibly the typedef.

  3. Add the correct functions and definitions in iomei.cpp and iomei.h. This will allow verovio to correctly read and load your new MEI tags into the data structure. This includes:

[This is only for MEI support, not sure about humdrum or musicxml]

iomei.cpp

* The #include *.h at the top of the .cpp

* The write and read functions for your element, including the correct loading of the interfaces / mixins

* The if statement inside of ReadMeiLayerChildren and WriteObject

iomei.h

* Add the class into the vrv namespace

* Add the function declarations for writing and reading
  1. Add the correct files for rendering the layer element (if it is one)
  • Add the if statement + include in the view_element.cpp, in the function 'drawLayerElement'

  • Create the respective Draw* function for your element in either view_element.cpp or in its own file, such as view_neume.cpp [See this page for more information on this step].

After these steps, your MEI element should be able to be read into the data structure, and rendered based on your code in your draw function.

Clone this wiki locally