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"
24 using namespace SomePlayer::DataObjects;
26 Track::Track() : QObject() {
29 Track::Track(TrackMetadata metadata, QString source) : QObject() {
31 if (_metadata.title() == _UNKNOWN_TRACK_) {
32 QFileInfo info(source);
33 _metadata.setTitle(info.baseName());
39 Track::Track(const Track &track) : QObject() {
40 this->_metadata = track.metadata();
41 this->_source = track.source();
42 this->_count = track._count;
46 Track::Track(QString source) :QObject() {
47 _resolver = new TagResolver(this);
48 connect(_resolver, SIGNAL(decoded(Track)), this, SLOT(decoded(Track)));
51 _resolver->decode(foo);
55 TrackMetadata Track::metadata() const {
59 void Track::setMetadata(TrackMetadata meta) {
63 QString Track::source() const {
67 void Track::setSource(QString source) {
71 int Track::count() const{
75 void Track::setCount(int count) {
79 void Track::decoded(Track track) {
80 _source = track.source();
81 _metadata = track.metadata();
85 Track &Track::operator =(const Track &track) {
86 _source = track.source();
87 _metadata = track.metadata();
88 _count = track._count;
94 bool Track::operator ==(const Track &track) {
95 return _source == track._source;