SoK/2020/StatusReport/Abogical: Difference between revisions

From KDE Community Wiki
No edit summary
mNo edit summary
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
= Introduction =
= Introduction =


[JuK](https://kde.org/applications/multimedia/org.kde.juk), the jukebox music player, is one of the oldest music players out there in the FOSS world. In fact it has actually spanned for more than 17 years, and it is still usable to this day. Compared to [Elisa](https://kde.org/applications/multimedia/org.kde.elisa), JuK focuses mainly on the playlist system, coupled with tag editing support to organize your music files.
[https://kde.org/applications/multimedia/org.kde.juk JuK], the jukebox music player, is one of the oldest music players out there in the FOSS world. In fact it has actually spanned for more than 17 years, and it is still usable to this day. Compared to [https://kde.org/applications/multimedia/org.kde.elisa Elisa], JuK focuses mainly on the playlist system, coupled with tag editing support to organize your music files.


However, due to its age, accumulated legacy code and bugs still remain. Thus it is in bad need of modernization and a revamp. JuK has recently been ported to KF5, however this port removed key features and the result is still missing some modern design principles that would improve the community's ability to maintain it (e.g. model/view, threaded I/O).
However, due to its age, accumulated legacy code and bugs still remain. Thus it is in bad need of modernization and a revamp. JuK has recently been ported to KF5, however this port removed key features and the result is still missing some modern design principles that would improve the community's ability to maintain it (e.g. model/view, threaded I/O).
Line 15: Line 15:
This feature was forgotten while JuK was ported to use KF5. Now you can drag and drop tracks on arbitrary positions between playlists and JuK will switch playlists so you can drop the tracks to the right spot in the destination playlist.
This feature was forgotten while JuK was ported to use KF5. Now you can drag and drop tracks on arbitrary positions between playlists and JuK will switch playlists so you can drop the tracks to the right spot in the destination playlist.


== Replace observer pattern with Qt signals in `PlaylistInterface` ==
Commit: https://invent.kde.org/kde/juk/commit/ce7108fe90adb83982cc3cf9cd2e94b0dc6fbf2a


This is an internal refactor of complicated code that was written with efficiency in mind but is confusing in turn. The observer pattern is a classic software pattern, which `PlaylistInterface` uses to abstract playlist-related functions using custom subclasses. However Qt's signal/slot mechanism can be used directly for this instead, so I've refactored `PlaylistInterface` and related code to use Qt signals instead.
== Replace observer pattern with Qt signals in PlaylistInterface ==


= What's next =
This is an internal refactor of complicated code that was written with efficiency in mind but is confusing in turn. The observer pattern is a classic software pattern, which PlaylistInterface uses to abstract playlist-related functions using custom subclasses. However Qt's signal/slot mechanism can be used directly for this instead, so I've refactored PlaylistInterface and related code to use Qt signals instead.


* Using a proxy model for searching tracks, to replace slow manual filtering of tracks.
Commit: https://invent.kde.org/kde/juk/commit/c5259a6e933fccb34ee9656087db11657a1f617c
* Convert the list of playlists into a model/view paradigm, to prepare for converting the list of tracks (playlist) into a model/view paradigm.
 
== Using a proxy model for searching tracks ==
 
Another internal refactor of the legacy code. This time we're using Qt proxy models to search for the tracks instead of an in-house solution. This was more time-consuming than expected, as search result were stored as a list of tree view items, not model items, thus a long migration had to take place.
 
Unfortunately, due to the time-consumption of this task, there wasn't enough time to complete the bonus task, which was to convert the list of playlists into a model/view paradigm.
 
Commits:
* https://invent.kde.org/kde/juk/commit/8dc8504185ef34e37a284241230857713600bfae
* https://invent.kde.org/kde/juk/commit/b19e057c7bd452feed823b294cfe476fe8c76079
 
= Conclusion =
I've learned alot through this season, especially in dealing with large and old codebases with Qt5. This is my first serious step in contributing to KDE. JuK wasn't an easy first step but it does highlight the longevity of some of the KDE applications. Hopefully, with my modernization efforts this season, the project would last a bit longer.
 
= Contact =
* E-mail: [http://mailto:[email protected] abogical@gmail.com]
* KDE identity username: abogical

Latest revision as of 20:08, 17 February 2020

Introduction

JuK, the jukebox music player, is one of the oldest music players out there in the FOSS world. In fact it has actually spanned for more than 17 years, and it is still usable to this day. Compared to Elisa, JuK focuses mainly on the playlist system, coupled with tag editing support to organize your music files.

However, due to its age, accumulated legacy code and bugs still remain. Thus it is in bad need of modernization and a revamp. JuK has recently been ported to KF5, however this port removed key features and the result is still missing some modern design principles that would improve the community's ability to maintain it (e.g. model/view, threaded I/O).

I submitted a proposal to address this and I'm excited to be part of this year's season of KDE! I love the idea of JuK and wish to take part in reviving this project. I am mentored by Michael Pyne, who is currently the sole maintainer of JuK.

Work done

Not a lot has been done as I was interrupted by my college exams. However, I was still able to complete these tasks:

Switch playlists during drag and drop

This feature was forgotten while JuK was ported to use KF5. Now you can drag and drop tracks on arbitrary positions between playlists and JuK will switch playlists so you can drop the tracks to the right spot in the destination playlist.

Commit: https://invent.kde.org/kde/juk/commit/ce7108fe90adb83982cc3cf9cd2e94b0dc6fbf2a

Replace observer pattern with Qt signals in PlaylistInterface

This is an internal refactor of complicated code that was written with efficiency in mind but is confusing in turn. The observer pattern is a classic software pattern, which PlaylistInterface uses to abstract playlist-related functions using custom subclasses. However Qt's signal/slot mechanism can be used directly for this instead, so I've refactored PlaylistInterface and related code to use Qt signals instead.

Commit: https://invent.kde.org/kde/juk/commit/c5259a6e933fccb34ee9656087db11657a1f617c

Using a proxy model for searching tracks

Another internal refactor of the legacy code. This time we're using Qt proxy models to search for the tracks instead of an in-house solution. This was more time-consuming than expected, as search result were stored as a list of tree view items, not model items, thus a long migration had to take place.

Unfortunately, due to the time-consumption of this task, there wasn't enough time to complete the bonus task, which was to convert the list of playlists into a model/view paradigm.

Commits:

Conclusion

I've learned alot through this season, especially in dealing with large and old codebases with Qt5. This is my first serious step in contributing to KDE. JuK wasn't an easy first step but it does highlight the longevity of some of the KDE applications. Hopefully, with my modernization efforts this season, the project would last a bit longer.

Contact