~ubuntu-branches/ubuntu/jaunty/gnome-do-plugins/jaunty-proposed

« back to all changes in this revision

Viewing changes to MPD/src/MusicItems.cs

  • Committer: Bazaar Package Importer
  • Author(s): Christopher James Halse Rogers, Christopher James Halse Rogers, Iain Lane
  • Date: 2009-02-05 16:58:51 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20090205165851-bku2c9rmrny93b31
Tags: 0.8.0.2+dfsg-1~ubuntu1
[ Christopher James Halse Rogers ]
* New upstream version
* debian/control:
  + gnome-sharp2 transition (LP: #314516)
  + Add banshee build-dep
  + Drop monodevelop build-dep; upstream uses mautil rather than mdtool now
  + Bump required gnome-do version in Build-Dep & Depends.
  + Suggest Banshee
* debian/copyright:
  + Refresh for new upstream version; new plugins added.
* debian/rules:
  + Rework clean target to simply delete files generated by autoreconf,
    rather than trying to preserve them.
  + Remove XDG_CONFIG_DIR hack needed for mdtool
* debian/patches/01_firefox_iceweasel_rename:
  + Refresh for new upsteam changes.
  + Extend to also make the Firefox bookmark plugin index iceweasel bookmarks

[ Iain Lane ]
* Tag pkg-cli-apps SVN revision into Jaunty, to get in before Feature
  Freeze. Should be a sync after the next Debian upload.
* debian/control: Add ${misc:Depends} build-dep 
* debian/rules: Do not fail if configure is missing (e.g. clean twice in a
  row) 

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//  MusicItems.cs
 
2
//
 
3
//  GNOME Do is the legal property of its developers, whose names are too numerous
 
4
//  to list here.  Please refer to the COPYRIGHT file distributed with this
 
5
//  source distribution.
 
6
//
 
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.
 
11
//
 
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.
 
16
//
 
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/>.
 
19
 
 
20
using System;
 
21
using System.Collections.Generic;
 
22
 
 
23
 
 
24
using Do.Universe;
 
25
 
 
26
namespace MPD
 
27
{
 
28
        public abstract class MusicItem : Item
 
29
        {
 
30
                protected string name, artist, year, cover;
 
31
 
 
32
                public MusicItem ()
 
33
                {
 
34
                }
 
35
 
 
36
                public MusicItem (string name, string artist, string year, string cover):
 
37
                        this ()
 
38
                {
 
39
                        this.name = name;
 
40
                        this.artist = artist;
 
41
                        this.year = year;
 
42
                        this.cover = cover;
 
43
                }
 
44
 
 
45
                public override string Name { get { return name; } }
 
46
                public override string Description { get { return artist; } }
 
47
                public override string Icon { get { return Cover ?? "gtk-cdrom"; } }
 
48
 
 
49
                public virtual string Artist { get { return artist; } }
 
50
                public virtual string Year { get { return year; } }
 
51
                public virtual string Cover { get { return cover; } }
 
52
 
 
53
        }
 
54
 
 
55
        public class AlbumMusicItem : MusicItem
 
56
        {
 
57
                public AlbumMusicItem (string name, string artist, string year, string cover):
 
58
                        base (name, artist, year, cover)
 
59
                {
 
60
                }
 
61
        }
 
62
 
 
63
        public class ArtistMusicItem : MusicItem
 
64
        {
 
65
                public ArtistMusicItem (string artist, string cover):
 
66
                        base ()
 
67
                {
 
68
                        this.artist = this.name = artist;
 
69
                        this.cover = cover;
 
70
                }
 
71
 
 
72
                public override string Description
 
73
                {
 
74
                        get {
 
75
                                return string.Format ("All music by {0}", artist);
 
76
                        }
 
77
                }
 
78
        }
 
79
 
 
80
        public class SongMusicItem : MusicItem
 
81
        {
 
82
                string album, file;
 
83
                int number;
 
84
                
 
85
                public SongMusicItem (string name, string artist, string album, string cover, string file, int number):
 
86
                        base (name, artist, "", cover)
 
87
                {
 
88
                        this.file = file;
 
89
                        this.album = album;
 
90
                        this.number = number;
 
91
                }
 
92
 
 
93
                public override string Icon { get { return "gnome-mime-audio"; } }
 
94
                public override string Description
 
95
                {
 
96
                        get {
 
97
                                return string.Format ("{0} - {1}", artist, album);
 
98
                        }
 
99
                }
 
100
                public virtual string Album { get { return album; } }
 
101
                public virtual string File { get { return file; } }
 
102
                public virtual int Number { get {return number; } }
 
103
        }
 
104
}