The second evaluation is on its way and it has been a pretty awesome GSoC for me so far.
During the last 2 weeks the main focus was to generalise things and make code cleaner, simpler, more robust and making implementation plan for our new activity Note Names (it was developed in the previous year’s GSoC by my current mentor Divyam Madaan but we’ve planned to change the concept and make it more suitable for long-term memorization). I reworked the API a few times but following the suggestions by my mentor Emmanuel Charruau has definitely proved to be lot beneficial both code-wise and learning-wise. It’s been a wonderful time for me experimenting and learning new ways of maintaing large files.
The following changes were made:
- Previously all the types of music element (notes, rests, clefs etc.) were implemented using separate models of their own which meant, for the same operation there will be different ways of treating these all which led to multiple functions doing the same operation but for different models.
Like a popular saying, “Everything which makes up a system is a file”, our idea also was to singularise them all in a common API file. We decided that all the elements’ data should be contained in a unique model and should be named as musicElementModel.
The file which was used as Note.qml to display the notes was modified to MusicElement.qml by introducing some more relevant properties needed. The function addNote was completely reworked to addMusicElement.
- Other features like undo, inserting, appending, redraw were too adjusted according to the rework.
- The next way to make user experience more easy was to modify the erase feature a bit.
Previously we had a toggable icon to switch between the erase mode (the user can click on a desired element to erase) and the add mode and another icon to erase all the notes on the staves by asking the user to confirm the action by showing a confirmation dialog.
In the new way, I removed the toggable icon and kept the activity always in add mode. Now if the user wants to erase an element, he would click on it and click on the erase icon (which previously acted as erase all elements). If he hasn’t selected any element and presses the erase icon, he will be shown the warning dialog like before to erase all the elements.
Through this method, we managed to make the user handling more easy and also gained cleanliness in code by removing the redundant parts.
- Me and my mentors discussed on the activity Note Names and finalised on an implementation. It’s currently open for any suggestions from the comunity. I will write about it in the next blog post and hope to give a complete report about it after completing it.