Revert previous commit, was incorrect
[amarok.git] / src / MediaDeviceMeta.h
blob7ed862ad9786dccfccb12f4b3790f7adadfa7e34
1 /*
2 * Copyright (c) 2007 Jamie Faris <farisj@gmail.com>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 * MediaDeviceMeta.h
22 * This file contains definitions of Meta classes used by media device plugins.
27 #ifndef MEDIADEVICEMETA_H
28 #define MEDIADEVICEMETA_H
30 // Amarok
31 #include "Meta.h"
33 class MediaDevice;
35 class MediaDeviceAlbum : public Meta::Album
37 public:
38 MediaDeviceAlbum( QString name )
39 : m_name( name )
43 virtual ~MediaDeviceAlbum() {}
45 // from Meta::MetaBase
46 QString name() const { return m_name; }
47 QString prettyName() const { return name(); }
49 // from Meta::Album
50 bool isCompilation() const { return false; }
51 bool hasAlbumArtist() const { return false; }
52 Meta::ArtistPtr albumArtist() const { return Meta::ArtistPtr(); }
53 Meta::TrackList tracks() { return Meta::TrackList(); }
55 private:
56 QString m_name;
60 class MediaDeviceGenre : public Meta::Genre
62 public:
63 MediaDeviceGenre( QString name )
64 : m_name( name )
68 virtual ~MediaDeviceGenre() {}
70 // from Meta::MetaBase
71 QString name() const { return m_name; }
72 QString prettyName() const { return name(); }
74 // from Meta::Genre
75 Meta::TrackList tracks() { return Meta::TrackList(); }
77 private:
78 QString m_name;
82 /**
83 * A simple implementation of Meta::Artist for media devices.
84 * This implementation holds it's values in member variables where
85 * they can be set by the device plugin.
87 * Device plugins can extend this class to fetch the data directly
88 * from the device or to allow editing the tags.
90 class MediaDeviceArtist : public Meta::Artist
92 public:
93 MediaDeviceArtist( QString name )
94 : m_name( name )
98 virtual ~MediaDeviceArtist() {}
100 //from Meta::MetaBase
101 QString name() const { return m_name; }
102 QString prettyName() const { return name(); }
104 //from Meta::Artist
105 Meta::TrackList tracks() { return Meta::TrackList(); }
106 Meta::AlbumList albums() { return Meta::AlbumList(); }
108 private:
109 QString m_name;
114 * A simple implementation of Meta::Track for media devices.
115 * This implementation holds it's values in member variables where
116 * they can be set by the device plugin.
118 * Device plugins can extend this class to fetch the data directly
119 * from the device and/or allow editing of the tags.
121 class MediaDeviceTrack : public Meta::Track
123 public:
124 MediaDeviceTrack( MediaDevice *device, QString title )
125 : m_device( device ),
126 m_name( title )
130 virtual ~MediaDeviceTrack() {}
132 //from Meta::MetaBase
133 virtual QString name() const { return m_name; }
134 virtual QString prettyName() const { return name(); }
136 //from Meta::Track
137 virtual KUrl playableUrl() const { return KUrl(); }
138 virtual QString prettyUrl() const { return QString(); }
139 virtual QString url() const { return QString(); }
140 virtual bool isPlayable() const { return false; }
141 virtual Meta::AlbumPtr album() const { return Meta::AlbumPtr(); }
142 virtual Meta::ArtistPtr artist() const { return Meta::ArtistPtr(); }
143 virtual Meta::ComposerPtr composer() const { return Meta::ComposerPtr(); }
144 virtual Meta::GenrePtr genre() const { return Meta::GenrePtr(); }
145 virtual Meta::YearPtr year() const { return Meta::YearPtr(); }
146 virtual QString comment() const { return QString(); }
147 virtual double score() const { return 0; }
148 virtual void setScore( double newScore ) { Q_UNUSED(newScore); return; }
149 virtual int rating() const { return 0; }
150 virtual void setRating( int newRating ) { Q_UNUSED(newRating); return; }
151 virtual int length() const { return 0; }
152 virtual int filesize() const { return 0; }
153 virtual int sampleRate() const { return 0; }
154 virtual int bitrate() const { return 0; }
155 virtual int trackNumber() const { return 0; }
156 virtual int discNumber() const { return 0; }
157 virtual uint lastPlayed() const { return 0; }
158 virtual uint firstPlayed() const { return 0; }
159 virtual int playCount() const { return 0; }
160 virtual QString type() const { return QString(); }
162 private:
163 MediaDevice *m_device;
164 QString m_name;
168 #endif //MEDIADEVICEMETA_H