~ubuntu-branches/ubuntu/precise/rygel/precise

« back to all changes in this revision

Viewing changes to src/plugins/media-export/rygel-media-export-plugin.vala

  • Committer: Bazaar Package Importer
  • Author(s): Andreas Henriksson
  • Date: 2009-09-26 14:04:05 UTC
  • Revision ID: james.westby@ubuntu.com-20090926140405-d5x3j13k10psa1gu
Tags: upstream-0.4.1
ImportĀ upstreamĀ versionĀ 0.4.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (C) 2008-2009 Jens Georg <mail@jensge.org>.
 
3
 *
 
4
 * This file is part of Rygel.
 
5
 *
 
6
 * Rygel is free software; you can redistribute it and/or modify
 
7
 * it under the terms of the GNU Lesser General Public License as published by
 
8
 * the Free Software Foundation; either version 2 of the License, or
 
9
 * (at your option) any later version.
 
10
 *
 
11
 * Rygel is distributed in the hope that it will be useful,
 
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
14
 * GNU Lesser General Public License for more details.
 
15
 *
 
16
 * You should have received a copy of the GNU Lesser General Public License
 
17
 * along with this program; if not, write to the Free Software Foundation,
 
18
 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 
19
 */
 
20
 
 
21
using Rygel;
 
22
using GUPnP;
 
23
using Gee;
 
24
using GLib;
 
25
 
 
26
/**
 
27
 * Simple plugin which exposes the media contents of a directory via UPnP.
 
28
 *
 
29
 */
 
30
[ModuleInit]
 
31
public void module_init (PluginLoader loader) {
 
32
    var plugin = new Plugin.MediaServer ("MediaExport", "@REALNAME@'s media");
 
33
 
 
34
    var resource_info = new ResourceInfo (ContentDirectory.UPNP_ID,
 
35
                                          ContentDirectory.UPNP_TYPE,
 
36
                                          ContentDirectory.DESCRIPTION_PATH,
 
37
                                          typeof (Rygel.MediaExportContentDir));
 
38
 
 
39
    plugin.add_resource (resource_info);
 
40
 
 
41
    loader.add_plugin (plugin);
 
42
}
 
43
 
 
44
public class Rygel.MediaExportContentDir : ContentDirectory {
 
45
    public override MediaContainer? create_root_container () {
 
46
        return MediaExportRootContainer.get_instance ();
 
47
    }
 
48
}