Warning, /multimedia/amarok/HACKING/architecture/Meta.txt is written in an unsupported language. File is not indexed.

0001 Meta Architecture
0002 -----------------
0003 
0004 The meta objects (located in src/core/meta) e.g. Meta::Track and the more
0005 often used Meta::TrackPtr represent data connected to music related objects.
0006 
0007 There are classes for Tracks, Albums, Artists, Composers, Genres, Years and Labels.
0008 These classes all derive from Meta::Base to facilitate their common methods (name
0009 and sorting) and observer interaction.
0010 
0011 [Design decision] They are not QObjects to avoid the overhead of the Qt MetaObject
0012 support variables. Collections are potentially millions of tracks where a significant
0013 proportion of tracks (in the case of MemoryCollections: all tracks) could at any time
0014 be loaded in memory.
0015 
0016 Meta::Observer is a virtual class that can be derived from by components that are
0017 interested in changes to the tracks during application lifetime. It has
0018 metadataChanged() methods for each of the Meta types and the ability to subscribe
0019 to any Meta object.
0020 
0021 KSharedPtr is used for all functions returning a pointer in the Meta classes. It strong,
0022 reference tracking smart pointer which will only delete an object once the last reference
0023 holding KSharedPtr goes out of scope or is deleted.
0024 
0025 [Note] Playlists will be made part of Meta as well. They have a similar Observer
0026 pattern but have been kept seperate because PlaylistObserver requires more functions.
0027 Pollution of the Observer class could be avoided using a playlistChanged(enum Change,
0028 QVariant value) type method.
0029 
0030 [Design decision] The list of meta objects contains Tracks, Albums, Artists, Composers,
0031 Genres, Years and Labels because these are the categories that you can sort by in
0032 the collection view and thus have to be returned by the QueryMaker and represented
0033 in an item in the CollectionTreeItem.
0034