3
// GNOME Do is the legal property of its developers, whose names are too
4
// numerous to list here. Please refer to the COPYRIGHT file distributed with
5
// this source distribution.
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/>.
21
using System.Collections.Generic;
30
public abstract class MusicItem : Item
32
protected string name, artist, year, cover;
38
public MusicItem (string name, string artist, string year, string cover):
47
public override string Name { get { return name; } }
48
public override string Description { get { return artist; } }
49
public override string Icon { get { return Cover ?? "gtk-cdrom"; } }
51
public virtual string Artist { get { return artist; } }
52
public virtual string Year { get { return year; } }
53
public virtual string Cover { get { return cover; } }
57
public class AlbumMusicItem : MusicItem
59
public AlbumMusicItem (string name, string artist, string year, string cover):
60
base (name, artist, year, cover)
65
public class ArtistMusicItem : MusicItem
67
public ArtistMusicItem (string artist, string cover):
70
this.artist = this.name = artist;
74
public override string Description
77
return string.Format (AddinManager.CurrentLocalizer.GetString ("All music by") + " {0}", artist);
82
public class SongMusicItem : MusicItem, IComparable<SongMusicItem>
87
public SongMusicItem (string name, string artist, string album, string year, string cover, string file, int track):
88
base (name, artist, year, cover)
95
public override string Icon { get { return "gnome-mime-audio"; } }
96
public override string Description
99
return string.Format ("{0} - {1}", artist, album);
103
public virtual string File { get { return file; } }
104
public virtual string Album { get { return album; } }
105
public virtual int Track { get { return track; } }
107
public int CompareTo (SongMusicItem other)
109
if (album.CompareTo (other.Album) == 0)
110
return track - other.Track;
111
return album.CompareTo (other.Album);