improve adding tracks or albums from the proxy models (fast and not blocking)
ClosedPublic

Authored by mgallien on Feb 11 2018, 10:14 PM.

Details

Summary

now adding albums from AllAlbumsProxyModel is fast

when adding tracks from the proxy models, use a working thread and
signals

this means that the main thread and the interface is no longer blocked

adds new methods to MediaPlayList to add list of albums or list of
tracks or list of artists

adding a lot of tracks or artists is still very slow and blocks the
interface

include QtConcurrentRun instead of QtConcurrent (suggested by ebn.kde.org)

enqueue a lot of tracks is now much faster

Test Plan

The tracks or the albums are still added to the playlist but much faster and without blocking the UI.

Diff Detail

Repository
R255 Elisa
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
mgallien requested review of this revision.Feb 11 2018, 10:14 PM
mgallien created this revision.
mgallien edited the test plan for this revision. (Show Details)
mgallien added a reviewer: Elisa.
mgallien added a project: Elisa.

Thanks for cleaning up the mess I caused :)

Works fine and is indeed very fast. I just noticed when using the replace and play button, the mediaplaylist shortly shows the text of an empty playlist, probably because the clearplaylist command gets executed instantly while the rest still takes a short amount of time.

src/mediaplaylist.h
238

why name this one differently?

Thanks for cleaning up the mess I caused :)

It is a very good feature that I use quite a lot and really appreciate.

Works fine and is indeed very fast. I just noticed when using the replace and play button, the mediaplaylist shortly shows the text of an empty playlist, probably because the clearplaylist command gets executed instantly while the rest still takes a short amount of time.

Yes, I will have to think about that. The code that adds the new tracks is effectively fully asynchronous. We could maybe delay the clearing to the time we add the tracks (a bit like a replace).

src/mediaplaylist.h
238

I have the problem that an overload with a string list already exists. I should probably rename all the others. That would be easier to understand.

mgallien updated this revision to Diff 27657.Feb 21 2018, 6:53 AM
  • improve replace for the playlist to not show the empty playlist state

does not compile here

src/elisautils.h
43

Qt Creator complains "expected a declaration"
same for the other enum

does not compile here

What is your compile error ?
Is it only the problem related to QtCreator ?

src/elisautils.h
43

This is https://bugreports.qt.io/browse/QTCREATORBUG-17850 . Should not be really a problem.

does not compile here

What is your compile error ?
Is it only the problem related to QtCreator ?

The error is
elisa/src/main.cpp:-1: error: undefined reference to `ElisaUtils::staticMetaObject'

I've cleaned and completely rebuilt the source.

does not compile here

What is your compile error ?
Is it only the problem related to QtCreator ?

The error is
elisa/src/main.cpp:-1: error: undefined reference to `ElisaUtils::staticMetaObject'

I've cleaned and completely rebuilt the source.

Thanks I will work on a solution. Sorry for the inconvenience, on my laptop I do not reproduce this situation.

does not compile here

What is your compile error ?
Is it only the problem related to QtCreator ?

The error is
elisa/src/main.cpp:-1: error: undefined reference to `ElisaUtils::staticMetaObject'

I've cleaned and completely rebuilt the source.

Thanks I will work on a solution. Sorry for the inconvenience, on my laptop I do not reproduce this situation.

Could you give me the full error message ?
I am not able to understand where it comes from.

mgallien updated this revision to Diff 27823.Feb 22 2018, 10:54 PM
  • improve replace for the playlist to not show the empty playlist state
  • maybe solve the compilation problem
astippich accepted this revision.Feb 24 2018, 2:16 PM

working fine now

This revision is now accepted and ready to land.Feb 24 2018, 2:16 PM
This revision was automatically updated to reflect the committed changes.