core,plugins,ui: `make clean` don't clean generated files
[profile/ivi/rygel.git] / src / plugins / tracker / rygel-tracker-item.vala
1 /*
2  * Copyright (C) 2008 Zeeshan Ali <zeenix@gmail.com>.
3  * Copyright (C) 2008 Nokia Corporation, all rights reserved.
4  *
5  * Author: Zeeshan Ali <zeenix@gmail.com>
6  *
7  * This file is part of Rygel.
8  *
9  * Rygel is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU Lesser General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * Rygel is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public License
20  * along with this program; if not, write to the Free Software Foundation,
21  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22  */
23
24 using Rygel;
25 using GUPnP;
26 using DBus;
27
28 /**
29  * Represents Tracker item.
30  */
31 public abstract class Rygel.TrackerItem : MediaItem {
32     protected string path;
33
34     public TrackerItem (string          id,
35                         string          path,
36                         TrackerCategory parent,
37                         string[]        metadata) {
38         base (id, parent, "", parent.child_class);
39
40         this.path = path;
41
42         this.init_from_metadata (metadata);
43     }
44
45     protected string seconds_to_iso8601 (string seconds) {
46         string date;
47
48         if (seconds != "") {
49             TimeVal tv = TimeVal ();
50
51             tv.tv_sec = seconds.to_int ();
52             tv.tv_usec = 0;
53
54             date = tv.to_iso8601 ();
55         } else {
56             date = "";
57         }
58
59         return date;
60     }
61
62     protected abstract void init_from_metadata (string[] values);
63 }
64