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.
21 #include "tagresolver.h"
23 using namespace SomePlayer::DataObjects;
25 Track::Track() : QObject() {
28 Track::Track(int id, TrackMetadata metadata, QString source) : QObject() {
35 Track::Track(const Track &track) : QObject() {
36 this->_metadata = track.metadata();
37 this->_source = track.source();
38 this->_id = track._id;
39 this->_count = track._count;
42 Track::Track(QString source) :QObject() {
43 _resolver = new TagResolver(this);
44 connect(_resolver, SIGNAL(decoded(Track)), this, SLOT(decoded(Track)));
47 _resolver->decode(foo);
52 TrackMetadata Track::metadata() const {
56 QString Track::source() const {
60 int Track::id() const {
64 void Track::setSource(QString source) {
68 int Track::count() const{
72 void Track::setCount(int count) {
76 void Track::decoded(Track track) {
78 _source = track.source();
79 _metadata = track.metadata();
83 Track &Track::operator =(const Track &track) {
85 _source = track.source();
86 _metadata = track.metadata();
87 _count = track._count;
93 bool Track::operator ==(const Track &track) {
94 return _source == track._source;