Amarok/Development/ArchitectureReview: Difference between revisions
Appearance
< Amarok | Development
Add part of the notes. |
m Mamarok moved page AmarokRanda2012 ArchitectureReview to Amarok/Development/ArchitectureReview: wrong link |
||
(4 intermediate revisions by one other user not shown) | |||
Line 20: | Line 20: | ||
== Meta == | == Meta == | ||
::Genre > QString | === Prevent Circular Referencing === | ||
::Label > QString | Meta::Album::tracks() > implemented using QueryMaker (blocking until result is ready)<br/> | ||
::Year > QString | === Simplify Compilation === | ||
Track::Artist() -> QString (display only) | Album::artist(): null > compilation, empty > bad tag, normal | ||
Album::Artist() -> Meta::Artist (has it's own properties: rating, year, image, ...) | === Simplify === | ||
Meta::Playlist inheriting Meta::Base. | Meta::Genre > QString<br/> | ||
Meta::Label > QString<br/> | |||
Meta::Year > QString<br/> | |||
Track::Artist() -> QString (display only)<br/> | |||
Album::Artist() -> Meta::Artist (has it's own properties: rating, year, image, ...)<br/> | |||
=== Playlists Folded into Meta === | |||
Meta::Playlist inheriting Meta::Base.<br/> | |||
PlaylistObserver methods moved into Meta::Observer | PlaylistObserver methods moved into Meta::Observer | ||
Line 46: | Line 53: | ||
** Option to copy tracks to containing folder. | ** Option to copy tracks to containing folder. | ||
** Don't show playlist files from collection by default. Alternatives? | ** Don't show playlist files from collection by default. Alternatives? | ||
== Services == | |||
* Easy to write | |||
* 1 instance per service plugin > no factory pattern needed | |||
* pre-init data can be read from desktop files (icon, name, description) | |||
* Auto-init optional for C++ plugins, not possible for scripts to prevent UI blocking and such | |||
* Unit tested | |||
=== Service Plugin Structure === | |||
* TrackProvider or PlaylistProvider (or multiple) when needed | |||
* QAbstractItemModel free from UI elements. | |||
** Custom roles for Amarok: uidUrl (for file/playlist load) | |||
* QActions for toolbar (next to search box) | |||
* Custom UI per platform | |||
** Delegate for ItemModel | |||
** UI or QML for custom interaction (location determined by platform implementation) |
Latest revision as of 16:05, 19 January 2013
Amarok @ Randa 2012: Architecture review
Source Structure
- only main.cpp/App.cpp/etc in src/
- group collections, providers, ... together in libraries or plugins
- get rid of core-impl.
- some stuff should be in core
- organize by libraries/plugins
- One CMakeFiles.txt per sub-folder: limited link target, faster linking
- Clean up includes: less files touched for rebuild
Components
Can be expected to always be there. Are created by main.cpp in the order needed or are interfaces with stub implementation until the real one is registered.
- CollectionManager
- PlaylistManager
- defaultPlaylistProvider
- PlaybackController, PlaybackQueue
- MainWindow: parent of the dialogs, keybindings, etc
- Notifier (ACTION: rename Logger) Stub implementation until MainWindow is ready.
Meta
Prevent Circular Referencing
Meta::Album::tracks() > implemented using QueryMaker (blocking until result is ready)
Simplify Compilation
Album::artist(): null > compilation, empty > bad tag, normal
Simplify
Meta::Genre > QString
Meta::Label > QString
Meta::Year > QString
Track::Artist() -> QString (display only)
Album::Artist() -> Meta::Artist (has it's own properties: rating, year, image, ...)
Playlists Folded into Meta
Meta::Playlist inheriting Meta::Base.
PlaylistObserver methods moved into Meta::Observer
MultiSource tracks
QList<KUrl> playableUrls() in the order of priority. Handled in PlaybackController.
File Layout Dialog
- Presets for Amarok, iTunes, Windows MediaPlayer standard layout. Useful for imported collections.
- Basic Layout Mode: Tokens in vertical list, small icons.
- Separate preset config, main dialog just showing selector and edit buttons.
Popup Dropper
- Remove overlay on more...
- 3 items max, easy muscle memory targets.
- PlaylistBrowser: 2 common actions: load, replace + most sensible (first?) provider action.
PlaylistFileProvider
- Use as export option:
- Open export playlist dialog
- Option to copy tracks to containing folder.
- Don't show playlist files from collection by default. Alternatives?
Services
- Easy to write
- 1 instance per service plugin > no factory pattern needed
- pre-init data can be read from desktop files (icon, name, description)
- Auto-init optional for C++ plugins, not possible for scripts to prevent UI blocking and such
- Unit tested
Service Plugin Structure
- TrackProvider or PlaylistProvider (or multiple) when needed
- QAbstractItemModel free from UI elements.
- Custom roles for Amarok: uidUrl (for file/playlist load)
- QActions for toolbar (next to search box)
- Custom UI per platform
- Delegate for ItemModel
- UI or QML for custom interaction (location determined by platform implementation)