Revision a43e7e6...

Go back to digest for 26th May 2013

Features in Multimedia

Matěj Laitl committed changes in [amarok] /:

Make playlist-related actions consistent throughout Amarok code (behaviour change)

This commits boasts a couple of changes, starting with the
uncontroversial ones:

1. The Playlist::AddOptions enum is extended with extended with
"convenience consistency" aliases:
OnDoubleClickOnSelectedItems
OnMiddleClickOnSelectedItems
OnReturnPressedOnSelectedItems
OnPlayMediaAction
OnAppendToPlaylistAction
OnReplacePlaylistAction
OnQueueToPlaylistAction

...and all callers of PlaylistController::insertOptioned() are modified
to use one of these values instead of the "low-level" flags like
DirectPlay that are actually tested for in the insertOptioned()
implementation. This serves that we remain consistent across Amarok
from now on.

2. The actual "low-level" enum values have been changed and
insertOptioned() was updated accordingly:
a) PrependToQueue, which implies Queue, was added.
b) StartPlay (start playing unless something is already playing)
was removed. No caller uses it anymore (see below) and this was
convoluted anyway, IMO.
c) DirectPlay now implies PrependToQueue. This may seem strange,
but the rationale is following: when you directplay just one
track (which is the case 90% of the time), it is played
immediately, and this should apply even when you add more
tracks. PrependToQueue makes this possible without hacks and is
invisible in case of just one track, because it is immediately
popped from the queue. Plus it has a positive side-effect of
inserting the track at a meaningful place (affects what track is
played next).
d) LoadAndPlay and LoadAndPlayImmediatelly were removed, because
they were replaces with consistency aliases.

3. Thanks to 2b), 2c) and implementation changes, the actual action
performed upon a certain trigger no longer depends on any state.
The state of playlist search no longer affects whether a track will
be played in case of DirectPlay.

4. insertOptioned() was cleaned up and changed, for example it tries
to choose the best place to insert tracks according to
PrependToQueue or Queue.

5. The convenience aliases were assigned as follows:

OnDoubleClickOnSelectedItems = OnReturnPressedOnSelectedItems =
= OnPlayMediaAction = DirectPlay.
OnMiddleClickOnSelectedItems = OnAppendToPlaylistAction = Append (0).
OnReplacePlaylistAction = Replace (no-brainer).
OnQueueToPlaylistAction = Queue (no-brainer).

These aren't of course set in stone, they were however chosen to be
as much consistent with other KDE apps as possible.

Especially the "DirectPlay implies PrependToQueue" change is a bit
controversial, my opinion in that matter is anything but strong and I'm
open to any discussion. But perhaps try to use it for a couple of days
to get over the barrier of change.

CHANGES:
* Playlist-related actions were harmonized: double-clicking, pressing
enter or using any "play media" action will prepend tracks to queue
and immediately start playing; middle-clicking appends to playlist;
append or replace actions will no longer start playback.






FIXED-IN: 2.8
GUI: Behavioural change in some places, to increase consistency. Please
check that the docs don't mention the old behaviour, see CHANGES.
DIGEST: Amarok harmonizes playlist-related actions (double-clicking,
pressing Enter, middle clicking...)

File Changes

Modified 29 files
  •   ChangeLog
  •   src/App.cpp
  •   src/MainWindow.cpp
  •   src/amarokurls/BookmarkTreeView.cpp
  •   src/browsers/CollectionTreeView.cpp
  •   src/browsers/CollectionTreeView.h
  •   src/playlist/PlaylistController.cpp
  •   src/playlist/PlaylistController.h
  •   src/playlist/PlaylistModel.cpp
  •   src/playlistgenerator/Preset.cpp
  •   src/scriptengine/AmarokPlaylistScript.cpp
  •   src/browsers/filebrowser/FileView.cpp
  •   src/browsers/playlistbrowser/DynamicView.cpp
  •   src/browsers/playlistbrowser/PlaylistBrowserView.cpp
  •   src/browsers/playlistbrowser/PlaylistBrowserView.h
  •   src/dbus/mpris1/TrackListHandler.cpp
  •   src/dbus/mpris2/MediaPlayer2Player.cpp
  •   src/services/amazon/AmazonStore.cpp
  •   src/services/lastfm/LastFmService.cpp
  •   src/services/lastfm/LastFmTreeView.cpp
  •   src/services/lastfm/SimilarArtistsAction.cpp
  •   src/context/applets/albums/AlbumsView.cpp
  •   src/context/applets/albums/AlbumsView.h
  •   src/context/applets/similarartists/ArtistWidget.cpp
  •   src/playlist/view/listview/InlineEditorWidget.cpp
  •   src/playlist/view/listview/PrettyListView.cpp
  •   playground/src/context/applets/coverbling/CoverBlingApplet.cpp
  •   playground/src/context/applets/coverbling/CoverBlingApplet.h
  •   playground/src/context/applets/covergrid/AlbumItem.cpp
29 files changed in total