~ubuntu-branches/ubuntu/jaunty/beagle/jaunty-security

« back to all changes in this revision

Viewing changes to search/Beagle.Search.Tiles/Audio.cs

  • Committer: Bazaar Package Importer
  • Author(s): Stefan Ebner
  • Date: 2008-05-04 00:31:32 UTC
  • mfrom: (1.1.21 upstream)
  • Revision ID: james.westby@ubuntu.com-20080504003132-2tkm5o8moo5952ri
Tags: 0.3.7-2ubuntu1
 * Merge from Debian unstable. (LP: #225746) Remaining Ubuntu changes:
  - debian/control:
    + Rename ice{weasel,dove}-beagle to {mozilla,thunderbird}-beagle and
      and update the dependencies accordingly.
    + Change Maintainer to Ubuntu Mono Team.
  - debian/rules:
    + Install the mozilla-beagle and thunderbird-beagle extensions.
  - ice{dove,weasel}.dirs:
    + Renamed to {mozilla,thunderbird}-beagle.dirs.
    + Fixed paths to point to usr/lib/{firefox,thunderbird}

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
using System;
 
2
using Mono.Unix;
 
3
 
 
4
namespace Beagle.Search.Tiles {
 
5
 
 
6
        public class AudioActivator : TileActivator {
 
7
 
 
8
                public AudioActivator () : base ()
 
9
                {
 
10
                        AddSupportedFlavor (new HitFlavor (null, "File", "audio/*"));
 
11
                        AddSupportedFlavor (new HitFlavor (null, "File", "application/ogg")); // FIXME: What about videos?
 
12
                }
 
13
 
 
14
                public override Tile BuildTile (Beagle.Hit hit, Beagle.Query query)
 
15
                {
 
16
                        return new Audio (hit, query);
 
17
                }
 
18
        }
 
19
 
 
20
        public class Audio : TileFile {
 
21
 
 
22
                public Audio (Beagle.Hit hit, Beagle.Query query) : base (hit, query)
 
23
                {
 
24
                        Group = TileGroup.Audio;
 
25
 
 
26
                        // FIXME: Show album art if any. Needs implementation in Beagle.Util
 
27
 
 
28
                        string title = Hit.GetFirstProperty ("dc:title");
 
29
                        if (String.IsNullOrEmpty (title))
 
30
                                title = Hit.GetFirstProperty ("fixme:title");
 
31
 
 
32
                        if (! String.IsNullOrEmpty (title))
 
33
                                Title = title;
 
34
 
 
35
                        string artist = Hit.GetFirstProperty ("fixme:artist");
 
36
                        if (! String.IsNullOrEmpty (artist))
 
37
                                Description = artist;
 
38
 
 
39
                        //AddAction (new TileAction (Catalog.GetString ("Add to Library"), AddToLibrary));
 
40
                }
 
41
 
 
42
                // FIXME: Check if Banshee exists and supports this?
 
43
                public void AddToLibrary ()
 
44
                {
 
45
                }
 
46
        }
 
47
}