3
* GNOME Do is the legal property of its developers. Please refer to the
4
* COPYRIGHT file distributed with this
7
* This program is free software: you can redistribute it and/or modify
8
* it under the terms of the GNU General Public License as published by
9
* the Free Software Foundation, either version 3 of the License, or
10
* (at your option) any later version.
12
* This program is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details.
17
* You should have received a copy of the GNU General Public License
18
* along with this program. If not, see <http://www.gnu.org/licenses/>.
28
public interface IMediaFile : IFileItem
32
string Artist { get; }
35
public class MediaItem : Item
37
protected string name, artist, year, cover;
43
public MediaItem (string name, string artist, string year, string cover)
49
if (System.IO.File.Exists (cover))
53
public override string Name {
57
public override string Description {
58
get { return year == null ? Artist : string.Format ("{0} ({1})", artist, Year); }
61
public override string Icon {
62
get { return cover ?? "applications-multimedia"; }
65
public virtual string Artist {
66
get { return artist; }
69
public virtual string Year {
73
public virtual string Cover {
78
public class VideoItem : MediaItem, IMediaFile
81
public VideoItem (string name, string artist, string year, string cover, string file) :
82
base (name, artist, year, cover)
87
public override string Icon {
88
get { return cover ?? "video-x-generic"; }
99
get { return string.Format ("file://{0}", Path); }
103
public class PodcastItem : MediaItem
105
public PodcastItem ()
109
public PodcastItem (string artist, string year, string cover) : base ()
111
this.artist = artist;
116
public override string Icon {
117
get { return cover ?? "audio-x-generic"; }
121
public class PodcastPublisherItem : PodcastItem
123
public PodcastPublisherItem (string artist, string year, string cover) :
124
base (artist, year, cover)
130
public class PodcastPodcastItem : PodcastItem, IMediaFile
133
public PodcastPodcastItem (string name, string artist, string year, string cover, string file) :
134
base (artist, year, cover)
140
public override string Icon {
141
get { return "audio-x-generic"; }
144
public string Title {
153
get { return string.Format ("file://{0}", Path); }
157
public class MusicItem : MediaItem
163
public MusicItem (string name, string artist, string year, string cover)
164
: base (name, artist, year, cover)
168
public override string Icon {
169
get { return cover ?? "gtk-cdrom"; }
173
public class AlbumMusicItem : MusicItem
175
public AlbumMusicItem (string name, string artist, string year, string cover) :
176
base (name, artist, year, cover)
181
public class ArtistMusicItem : MusicItem
183
public ArtistMusicItem (string name, string cover) : base ()
185
this.name = this.artist = name;
189
public override string Description {
190
get { return string.Format ("{0} {1} {2}",
191
Catalog.GetString ("All Music by"), artist, Year); }
194
public override string Icon {
195
get { return cover ?? "audio-input-microphone"; }
199
public class SongMusicItem : MusicItem, IMediaFile
201
string file, album, track;
203
public SongMusicItem (string name, string artist, string album, string year,
204
string cover, string track, string file) : base (name, artist, year, cover)
211
public override string Description {
212
get { return string.Format ("{0} - {1}", artist, album); }
215
public override string Icon {
216
get { return "audio-x-generic"; }
219
public string Title {
228
get { return string.Format ("file://{0}", Path); }
231
public string Album {
232
get { return album; }
235
public string Track {
236
get { return track != null ? track.PadLeft (3, '0') : string.Empty; }
b'\\ No newline at end of file'