sbILibraryResource.idl
Go to the documentation of this file.
1 /*
2 //
3 // BEGIN SONGBIRD GPL
4 //
5 // This file is part of the Songbird web player.
6 //
7 // Copyright(c) 2005-2008 POTI, Inc.
8 // http://songbirdnest.com
9 //
10 // This file may be licensed under the terms of of the
11 // GNU General Public License Version 2 (the "GPL").
12 //
13 // Software distributed under the License is distributed
14 // on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either
15 // express or implied. See the GPL for the specific language
16 // governing rights and limitations.
17 //
18 // You should have received a copy of the GPL along with this
19 // program. If not, go to http://www.gnu.org/licenses/gpl.html
20 // or write to the Free Software Foundation, Inc.,
21 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 //
23 // END SONGBIRD GPL
24 //
25 */
26 
32 #include "nsISupports.idl"
33 
34 interface nsIStringEnumerator;
35 interface nsIURI;
36 interface sbIPropertyArray;
37 
47 [scriptable, uuid(d0ed8ac0-1a2a-11dd-bd0b-0800200c9a66)]
49 {
54  /*
55  Group: Resource Properties
56  */
57 
58  /*
59  Prop: guid
60 
61  The global unique identifier of this Library object.
62 
63  Type:
64  String
65 
66  Note:
67  <MediaItem>, <MediaList> and <Library> are all Library Objects.
68  */
69  readonly attribute AString guid;
70 
75  /*
76  Prop: created
77 
78  The creation time of this Library object.
79 
80  Type:
81  Number, in (TODO units???)
82 
83  Note:
84  <MediaItem>, <MediaList> and <Library> are all Library Objects.
85  */
86  readonly attribute long long created;
87 
92  /*
93  Prop: updated
94 
95  The last update time of this Library object. Changing any property
96  constitutes an update.
97 
98  Type:
99  Number, in (TODO units???)
100 
101  Note:
102  <MediaItem>, <MediaList> and <Library> are all Library Objects.
103  */
104  readonly attribute long long updated;
105 
110  readonly attribute nsIStringEnumerator propertyIDs;
111 
116  readonly attribute boolean userEditable;
117 
129  /*
130  Group: Resource Methods
131  */
132 
133  /*
134  Method: getProperty()
135 
136  Get the value of a property for this library object.
137 
138  Prototype:
139  String getProperty(String id)
140 
141  Parameters:
142  id - The ID property value requested.
143 
144  Example:
145  (start code)
146  //This example assumes you already have created
147  //a mediaitem and assigned it to mediaItem.
148 
149  //Get the albumName property from a mediaitem.
150  var albumName = mediaItem.getProperty("http://songbirdnest.com/data/1.0#albumName");
151  (end)
152 
153  Standard Properties:
154  http://songbirdnest.com/data/1.0#albumDetailUrl - A URL with information on the album
155  http://songbirdnest.com/data/1.0#albumName - The name of the album
156  http://songbirdnest.com/data/1.0#artistDetailUrl - A URL with information on the artist
157  http://songbirdnest.com/data/1.0#artistName - The name of the artist
158  http://songbirdnest.com/data/1.0#bitRate - The bit rate of the media, in bits per second
159  http://songbirdnest.com/data/1.0#bpm - The number of beats per minute
160  http://songbirdnest.com/data/1.0#columnSpec - Column display data
161  http://songbirdnest.com/data/1.0#composerName - The name of the composer
162  http://songbirdnest.com/data/1.0#copyrightURL - A URL with information on the copyright
163  http://songbirdnest.com/data/1.0#defaultColumnSpec - Default column display data
164  http://songbirdnest.com/data/1.0#disableDownload - Prevent this item from being downloaded
165  http://songbirdnest.com/data/1.0#discNumber - The number of disc this media appears on in a compilation
166  http://songbirdnest.com/data/1.0#downloadDetails - Download state and progress
167  http://songbirdnest.com/data/1.0#duration - The duration of this media, in microseconds
168  http://songbirdnest.com/data/1.0#enableAutoDownload - whether this item should be automatically downloaded when added to the main library
169  http://songbirdnest.com/data/1.0#excludeFromHistory - This track should not be logged in playback history when played
170  http://songbirdnest.com/data/1.0#genre - The genre of this media
171  http://songbirdnest.com/data/1.0#hidden - Whether this item should be hidden from the user
172  http://songbirdnest.com/data/1.0#isPartOfCompilation - Whether this media is part of a compilation
173  http://songbirdnest.com/data/1.0#lastPlayTime - The last time the media was played
174  http://songbirdnest.com/data/1.0#lyricistName - The name of the lyricist
175  http://songbirdnest.com/data/1.0#lyrics - The lyrics of the media
176  http://songbirdnest.com/data/1.0#originPage - The page this media was located on
177  http://songbirdnest.com/data/1.0#originPageTitle - The title of the page this media was located on
178  http://songbirdnest.com/data/1.0#originURL - The URL this media was retrived from
179  http://songbirdnest.com/data/1.0#playCount - The number of times this media has been played
180  http://songbirdnest.com/data/1.0#primaryImageURL - The URL of the primary image
181  http://songbirdnest.com/data/1.0#producerName - The name of the producer
182  http://songbirdnest.com/data/1.0#rating - The user-set rating of the item, either 0 (unset) or in the range 1-5
183  http://songbirdnest.com/data/1.0#recordLabelName - The name of the record label
184  http://songbirdnest.com/data/1.0#sampleRate - The sample rate of the media, in samples per second
185  http://songbirdnest.com/data/1.0#skipCount - The number of times this item was skipped
186  http://songbirdnest.com/data/1.0#totalDiscs - The total number of discs in a compilation
187  http://songbirdnest.com/data/1.0#totalTracks - The total number of tracks in a compilation
188  http://songbirdnest.com/data/1.0#trackName - The name of the track
189  http://songbirdnest.com/data/1.0#trackNumber - The track number of this media in a compilation
190  http://songbirdnest.com/data/1.0#year - The year the media was released
191 
192  Note:
193  Metadata for the <MediaItems> may get updated and overwritten during playback.
194  See <Metadata Updates> for more details about cases where metadata may
195  get updated.
196 
197  See Also:
198  <setProperty()>
199  */
200  AString getProperty(in AString aID);
201 
208  /*
209  Method: setProperty()
210 
211  Set the value of a property for this library object.
212 
213  Prototype:
214  setProperty(String id, String value)
215 
216  Example:
217  (start code)
218  //This example assumes you already have created
219  //a mediaitem and assigned it to mediaItem.
220 
221  //Set the albumName property from a mediaitem.
222  mediaItem.setProperty("http://songbirdnest.com/data/1.0#albumName", "Let Us Play");
223  (end)
224 
225  Standard Properties:
226  http://songbirdnest.com/data/1.0#albumDetailUrl - A URL with information on the album
227  http://songbirdnest.com/data/1.0#albumName - The name of the album
228  http://songbirdnest.com/data/1.0#artistDetailUrl - A URL with information on the artist
229  http://songbirdnest.com/data/1.0#artistName - The name of the artist
230  http://songbirdnest.com/data/1.0#bitRate - The bit rate of the media, in bits per second
231  http://songbirdnest.com/data/1.0#bpm - The number of beats per minute
232  http://songbirdnest.com/data/1.0#columnSpec - Column display data
233  http://songbirdnest.com/data/1.0#composerName - The name of the composer
234  http://songbirdnest.com/data/1.0#defaultColumnSpec - Default column display data
235  http://songbirdnest.com/data/1.0#disableDownload - Prevent this item from being downloaded
236  http://songbirdnest.com/data/1.0#discNumber - The number of disc this media appears on in a compilation
237  http://songbirdnest.com/data/1.0#downloadDetails - Download state and progress
238  http://songbirdnest.com/data/1.0#duration - The duration of this media, in microseconds
239  http://songbirdnest.com/data/1.0#enableAutoDownload - whether this item should be automatically downloaded when added to the main library
240  http://songbirdnest.com/data/1.0#excludeFromHistory - This track should not be logged in playback history when played
241  http://songbirdnest.com/data/1.0#genre - The genre of this media
242  http://songbirdnest.com/data/1.0#hidden - Whether this item should be hidden from the user
243  http://songbirdnest.com/data/1.0#isPartOfCompilation - Whether this media is part of a compilation
244  http://songbirdnest.com/data/1.0#lyricistName - The name of the lyricist
245  http://songbirdnest.com/data/1.0#lyrics - The lyrics of the media
246  http://songbirdnest.com/data/1.0#primaryImageURL - The URL of the primary image
247  http://songbirdnest.com/data/1.0#producerName - The name of the producer
248  http://songbirdnest.com/data/1.0#rating - The user-set rating of the item, either 0 (unset) or in the range 1-5
249  http://songbirdnest.com/data/1.0#recordLabelName - The name of the record label
250  http://songbirdnest.com/data/1.0#sampleRate - The sample rate of the media, in samples per second
251  http://songbirdnest.com/data/1.0#totalDiscs - The total number of discs in a compilation
252  http://songbirdnest.com/data/1.0#totalTracks - The total number of tracks in a compilation
253  http://songbirdnest.com/data/1.0#trackName - The name of the track
254  http://songbirdnest.com/data/1.0#trackNumber - The track number of this media in a compilation
255  http://songbirdnest.com/data/1.0#year - The year the media was released
256 
257  Note:
258  Metadata for the <MediaItems> may get updated and overwritten during playback.
259  See <Metadata Updates> for more details about cases where metadata may
260  get updated.
261 
262  See Also:
263  <getProperty()>
264  */
265  void setProperty(in AString aID, in AString aValue);
266 
275  sbIPropertyArray getProperties([optional] in sbIPropertyArray aPropertyIDs);
276 
289  void setProperties(in sbIPropertyArray aProperties);
290 
294  boolean equals(in sbILibraryResource aOtherLibraryResource);
295 };
296 
297 
sbIPropertyArray getProperties([optional] in sbIPropertyArray aPropertyIDs)
Get properties from this resource in a property array.
void setProperty(in AString aID, in AString aValue)
Set the value of a property on this resource.
onPageChanged aValue
Definition: FeedWriter.js:1395
readonly attribute nsIStringEnumerator propertyIDs
Returns a string enumerator of the IDs of all the properties set on this resource.
AString getProperty(in AString aID)
Get the value of a property of this resource.
var uuid
readonly attribute long long updated
The last update time of this resource as a unix timestamp.
readonly attribute AString guid
The guid of this resource.
boolean equals(in sbILibraryResource aOtherLibraryResource)
Tests the equality of two library resources.
readonly attribute boolean userEditable
True if users should be allowed to modify the resource.
General interface to data resources.
void setProperties(in sbIPropertyArray aProperties)
Sets the properties and values in the supplied property array to this resource. This works as if you ...
readonly attribute long long created
The creation time of this resource as a unix timestamp.
An interface to carry around arrays of nsIProperty instances. Users of this interface should only QI ...