-
Notifications
You must be signed in to change notification settings - Fork 185
Adding new element tags
If you want Verovio to accept new element tags, there are several places where you need to add code.
-
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.
-
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.
-
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]
* 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
* Add the class into the vrv namespace
* Add the function declarations for writing and reading
- 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.