Now 'Artist name' and 'ArTist Name' is the same for library
[someplayer] / src / playlist.cpp
1 /*
2  * SomePlayer - An alternate music player for Maemo 5
3  * Copyright (C) 2010 Nikolay (somebody) Tischenko <niktischenko@gmail.com>
4  *
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.
9  *
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.
14  *
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.
18  */
19
20 #include "playlist.h"
21 #include <QDebug>
22
23 using namespace SomePlayer::DataObjects;
24
25 Playlist::Playlist()
26 {
27         _name = "New playlist";
28 }
29
30 Playlist::Playlist(const Playlist &playlist) {
31         _name = playlist._name;
32         _tracks = playlist._tracks;
33 }
34
35 QString Playlist::name() {
36         return _name;
37 }
38
39 QList<Track> Playlist::tracks() {
40         return _tracks;
41 }
42
43 void Playlist::setName(QString name) {
44         _name = name;
45 }
46
47 void Playlist::addTrack(Track track) {
48         if (!_tracks.contains(track))
49                 _tracks.append(track);
50 }
51
52 void Playlist::removeTrack(Track track) {
53         _tracks.removeOne(track);
54 }
55
56 void Playlist::removeTrackAt(int id) {
57         _tracks.removeAt(id);
58 }
59
60 void Playlist::clear() {
61         _tracks.clear();
62 }