playlist subsystem overhaul
Ian Monroe
ian at monroe.nu
Tue Oct 7 02:24:36 CEST 2008
On Mon, Oct 6, 2008 at 4:10 PM, Soren Harward <stharward at gmail.com> wrote:
> On Mon, Oct 6, 2008 at 3:26 PM, Ian Monroe <ian at monroe.nu> wrote:
>> Playlist::Actions/Playlist::Controller are poorly name. Controller
>> sounds like it should do everything Actions does as well. If they had
>> clear names to make their purposes clear I would be OK probably with
>> the Model/Controller/Actions trinity. As it is, I don't get why
>> Actions and Controller are separate really.
>
> I separated them because they're different conceptually. The
> Controller modifies the contents of the playlist; it forms the third
> part of the model/view/controller triad. On the other hand, the
> Actions act on the contents of the playlist; the four major actions
> that the Actions class provides (Play, Next, UserNext, and Previous)
> end up as globally available Actions. I agree that there are probably
> better names; if I think of some (or if someone suggests some) I'll
> happily change them.
Yes I understand what you were thinking, but as-is its just kind of confusing.
>> You say that it'd be possible to bring back animation, but I don't see
>> how. If PrettyListView isn't a QGraphicsView we've lost the ability to
>> animate and loads of functionality in that regard. Delegates and
>> animation don't mix well together.
>
> I'm not convinced animation is impossible, though it will take some
> serious reworking of the paintEvent function in the viewport.
Due to the issues you list below, I didn't make the decision to switch
to a QGraphicsView lightly. I really wanted delegates+animation to
work. You can trigger repaints of the whole delegate from a timer and
such. It works and takes a lot of CPU power. It was doing this at some
point. There was a Skype dev at aKademy 2007 and he told me how they
redid the listview for Skype about 3 different times, trying to get
interactive things on the listview to work right. Just trying to
emphasize that animation+delegate is a non-minor problem. :)
That said your solution might be the one to use for 2.0.
> And I
> really wonder what this "loads of functionality" of which you speak
> is. I replaced QGraphicsView with a QListView because with QListView,
> all you have to do is override the painting, whereas with
> QGraphicsView you have to patch in model accessing, selection
> handling, event processing, and you still have to do all the painting
> yourself.
Mostly animation I suppose. :)
>> Also be sure that you used svn move for all the renamed files so that
>> file histories are intact. Or that you are using git-svn, which tracks
>> moves automatically.
>
> This project would not have been possible without git-svn :)
Now I have tried the patch out:
* it crashes when dragging multiple items pretty easily.
* crashes when clearing the playlist
* a crash occured while I was away from the computer when it was in
dynamic mode: http://rafb.net/p/Vsutks59.html
* repopulating causes the current song to switch to the next (this
might not be a regression caused by your change; not sure :D)
More information about the Amarok-devel
mailing list