⬆️ ⬇️

We realize the dream of the perfect player with Qt Quick to the advantage!

Prehistory



We all love to listen to music. All of us for this purpose use devices / applications for its listening. Someone is Winamp or a standard Windows media player, and someone has a player on a mobile phone or a completely separate mp3 player.



But all players have one common unpleasant feature - congestion with all sorts of unnecessary junk, interface cramming, a bunch of drawn icons, equalizers and other things ... The most interesting thing is that all this additional functionality has almost no effect on the comfort of listening and controlling the music itself. In general, the darkness. And it always surprised me, really the developers of these players themselves never used them? This is impossible! What for me 150 visualizations and the same equalizer parameters? Why the hell do weird interfaces? Who entrusted these mentally ill people to write software?



All that I want from the music player I found only in one player - Amarok 1.x, now Clementine. Namely:



Everything! Everything else - This is just an additional functionality, hide it from me, remove from the main screen and do not distract my attention! In general, simplicity is our everything.



Actually for the Desktop in its time, I found the embodiment of a dream and listening to music for me turned into a sheer pleasure. As for listening to music, for example, on the road from your Nokia on the s60 - this is already a real hard labor. The standard player does not know how to determine clicking on the button on the headset, hides the playlist somewhere far away, although of course it looks cool. The second option - vaunted powerMP3 - looks like a sweetie. has a bunch of skins, can receive a signal from the headset button, and even (who would have thought) block the keyboard. To the question "Why?" He can not answer. the rest of the players for Simba and do not deserve attention, for the HS.

')

What if...



In short, I spat, sat down and sprinkled a prototype of the burner that would fit my requirements. At the moment, he is not able to do a lot of the above, and he looks clumsy, but I taught him everything that I taught him to make as comfortable as possible.



Let's start an acquaintance? Let's start with the description of the principle of the player. The application's main screen is the current playlist with a drop of controls at the top and bottom of the screen. It looks quite simple at the moment:

image


Here, from above, from left to right: the button for adding songs to the list, the name of the list, the inclusion of the list editing mode.



Next comes the list itself with all the tracks, the slider to indicate the playback position, and the playback control buttons — the previous track, play / pause, next, linear / random play switch. The volume indicator appears for a few seconds only at the moment of its change through the physical buttons of the device.



When you click on the add songs button, a simple file browser opens, allowing you to select the necessary songs and add them. After switching to editing mode, the user has at his disposal the functions of removing songs from the current list, as well as the ability to edit and delete the entire list and add a new one.



Other playlists are also hidden in an interesting way - to switch to them, you should drag your finger to the right / left across the screen, while they should be moved from top to bottom to scroll through tracks and vice versa. Actually the playlists themselves are automatically saved after the change on the disk and after starting the program everything is neatly restored. To make it clearer, I advise you to take a look at the video (do not pay attention to the brakes, Windows started to slow down terribly on a typewriter, it’s still impossible to reach the hands)







As a matter of fact, from the video I think it immediately becomes clear what exactly I was focusing on when developing. This is the convenience of personal use. In order for the case to work, he took the cell phone out of his pocket, quickly changed the song or even the playlist, put it in his pocket - I enjoy it further. And if a free minute appeared - he sat down, made a new playlist as quickly as possible (you can add both individual files and entire directories) and immediately began to listen to him, without being distracted by anything else.



The only thing that depresses me is the application interface. Since nothing more interesting, I will come up with simply can not.



Add something and nothing ...



Yes, really nothing, the program came out small, but convenient. At the moment, there is still something to work on - for example, there is no way to get a signal from the button on the headset. In addition, the playback queue has not yet been implemented, but otherwise I like the fact that now you don’t need to look for something on the huge pop-up menu, just a couple of strokes with your fingers are enough.



The application was written in Qt Quick / C ++ in about a week (an hour and a half in the evening after study). Most of which went to the C ++ part, since it was necessary to implement data storage models and find the best solution for this. The part on QML was as usual the simplest.



Source codes can be taken here . Unfortunately, the assembled version can not be shown right now. The SDK has started to be terribly buggy ... Otherwise, I would like to hear an opinion - would a player of this format really be convenient for the user? Thank.

Source: https://habr.com/ru/post/133428/



All Articles