GSoC: Week 4
This week I finished the GUI for the new excerptsdialog. This is an important step, because it is now possible to test the function with different scores and choose the voices individually.
My actual PR.
As already said I finished the GUI. I didn't had much problems with it, but it was quite a big change on the dialog, so it did take its time. Major change was to use QTreeWidgetItems instead of QListItems for the actual parts of an excerpt, so it is possible to expand a part and select some voices.
The new excerptsdialog has two main parts. In the left at point 1 in the picture we can select the excerpt as we already can do it. The right part has changed. At the moment we only have one Widget in the right which shows us all instrument of the score. If we want to add an instrument to the score we check the box before an entry of the instrument list. This method makes it impossible to add an instrument more than once. This is sometimes needed, for example if you have an SA-TB score and want a S-A-T-B you have to add both instruments two times.
To achieve this I added one Widget which lists all the instruments of the score (2) and another which lists the added instruments and provides the possibility to select the voices for every staff (3).
The changes are executed by clicking on "Ok", but the tracklist I implemented last weeks is set after every change on the voice selection, so it is stored correctly.
I had one big problem when I wanted to add one instrument twice as described above. The problem was the use of a QMap. To add a new element to _tracks I used to function insert(key, value). The problem is that it simply overwrites the last entry which has the same key. I choose to use a QMultiMap, so I could use the insert method as before, because now it simply adds a new entry and does keep the old. Therefore I had to change some things I implemented before, because now it is possible, that there is more than one destination track for the same source.
There is a question I asked myself again and again. What is the difference between a part and an excerpt. When translating it to German I think part means more a specific instrument of the score and excerpt a selection of instruments of the score, so I would have said the dialog is called excerptsdialog, so we should name it excerpts and not parts and give it the heading (as I did already) Excerpts. But I'm not a native English speaker, so correct me if there is a different meaning of parts, but for me it often isn't clear why we can use part and excerpt synonymous.
Goals for the next week
For the next week I plan to create some test cases for the new excerptsdialog which are extending the current tst_parts. Maybe I'll do some more investigation on the gaps implementation, because one big aim for this was to get rid of some expanding of voices and stuff like this, so I'll check if we can remove some redundant code.
If it is possible and I can't work much more on the excerptsdialog I would go on with my next topic, so I'll have more time for my exams at the end of July, but actually this isn't really needed because it seems as I am good in time.
Edit: Maybe I could add some explanation in the documentation, too.
Until next week,