2 * SomePlayer - An alternate music player for Maemo 5
3 * Copyright (C) 2010 Nikolay (somebody) Tischenko <niktischenko@gmail.com>
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23 #include "someplayer.h"
26 #include "dbstorage.h"
27 #include "filestorage.h"
28 #include "mediascanner.h"
29 #include "tagresolver.h"
31 // represents media library: tracks, playlists
32 // it uses different media storages for tracks and playlists
33 // but dynamic playlits will be stored with tracks into the same storage
35 using SomePlayer::DataObjects::Track;
36 using SomePlayer::DataObjects::Playlist;
37 using SomePlayer::Storage::DbStorage;
38 using SomePlayer::Storage::FileStorage;
39 using SomePlayer::Storage::MediaScanner;
41 namespace SomePlayer {
42 namespace DataObjects {
44 class Library : public QObject {
47 Library(QString databasePath, QString playlistsPath);
50 void addDirectory(QString path);
51 void addFile(QString path);
53 QList<QString> getArtists();
54 QList<QString> getAlbumsForArtist(QString artist);
55 QList<Track> getTracksForAlbum(QString album, QString artist);
57 Playlist getFavorites();
58 Playlist getMostPlayed();
59 Playlist getNeverPlayed();
60 Playlist getRecentlyAdded();
62 QList<Playlist> getPlaylists();
63 QStringList getPlaylistsNames();
64 Playlist getPlaylist(QString name);
65 void savePlaylist(const Playlist &playlist);
66 void removePlaylist(const Playlist &playlist);
67 void removePlaylist(QString name);
69 Playlist getCurrentPlaylist();
70 void saveCurrentPlaylist(const Playlist &playlist);
75 void addingTracks(int);
79 DbStorage *_library_storage;
80 FileStorage *_playlist_storage;
81 MediaScanner *_scanner;
82 TagResolver *_resolver;
85 void _scanned(QStringList);
89 void removeTrack(Track);
91 void addToFavorites(Track);
92 void updateTrackCount(Track);
93 void updateTrackMetadata(Track);