~vanvugt/+junk/mediatomb

« back to all changes in this revision

Viewing changes to doc/scripting.txt

  • Committer: Bazaar Package Importer
  • Author(s): Andres Mejia
  • Date: 2008-03-02 13:09:16 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20080302130916-zlljdze3kt7vuq4b
Tags: 0.11.0-1
* New upstream release.
* Include message about which inotify headers will be used when enabling
  inotify runtime support.
* Fixed error with use of INTERFACE in init script. Also removed use of -m
  option.
* Including new config.xml options.
* Added more build dependencies for new upstream release.
* Removed build dependency of libid3-dev, taglib is now preferred.
* mediatomb.xpm and manpage.xml is now included in orig tarball.
* inotify patch is not needed anymore.
* md5 patch has been committed upstream and is no longer needed. Also removed
  README.Debian.
* TwinHelix PNG fix is now used. Removed from TODO.
* Adding dependency of iceweasel for mediatomb package.
* Updated copyright file.
* Updated watch file.
* Updated rules file for proper configure options.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
MediaTomb Scripting
2
2
 
3
 
This documentation is valid for MediaTomb version 0.10.0.
 
3
This documentation is valid for MediaTomb version 0.11.0.
4
4
 
5
5
Copyright   2005 Gena Batsyan, Sergey Bostandzhyan
6
6
 
151
151
    to the database, only a call to the addCdsObject() will permanently add the
152
152
    object.
153
153
 
 
154
3.1.1. General Properties
 
155
 
154
156
Here is a list of properties of an object, you can set them you create a new
155
157
object or when you modify a copy of the 'orig' object.
156
158
 
180
182
 
181
183
      o OBJECT_TYPE_ITEM_EXTERNAL_URL
182
184
 
183
 
        Object is a link to a resource on the internet.
 
185
        Object is a link to a resource on the Internet.
184
186
 
185
187
      o OBJECT_TYPE_ITEM_INTERNAL_URL
186
188
 
207
209
 
208
210
    The object ID of the parent container.
209
211
 
210
 
  * orig.class
 
212
  * orig.upnpclass
211
213
 
212
214
    RW
213
215
 
214
 
    The upnp class of the item, this corresponds to upnp:class in the DIDL-Lite
 
216
    The UPnP class of the item, this corresponds to upnp:class in the DIDL-Lite
215
217
    XML.
216
218
 
217
219
  * orig.location
220
222
 
221
223
    Location on disk, given by the absolute path and file name.
222
224
 
 
225
  * orig.theora
 
226
 
 
227
    RO
 
228
 
 
229
    This property is a boolean value, it is non zero if the particular item is
 
230
    of type OGG Theora. This is useful to allow proper sorting of media and
 
231
    thus placing OGG Vorbis into the Audio container and OGG Theora into the
 
232
    Video container.
 
233
 
 
234
  * orig.onlineservice
 
235
 
 
236
    RO
 
237
 
 
238
    Identifies if the item belongs to an online service and thus has extended
 
239
    properties. Following types are available:
 
240
 
 
241
      o ONLINE_SERVICE_NONE
 
242
 
 
243
        The item does not belong to an online service and does not have
 
244
        extended properties.
 
245
 
223
246
  * orig.mimetype
224
247
 
225
248
    RW
274
297
        Description of the item, this corresponds to dc:description in the
275
298
        DIDL-Lite XML.
276
299
 
 
300
      o orig.meta[M_REGION]
 
301
 
 
302
        RW
 
303
 
 
304
        Region description of the item, this corresponds to upnp:region in the
 
305
        DIDL-Lite XML.
 
306
 
277
307
      o orig.meta[M_TRACKNUMBER]
278
308
 
279
309
        RW
281
311
        Track number of the item, this corresponds to upnp:originalTrackNumber
282
312
        in the DIDL-Lite XML.
283
313
 
 
314
      o orig.meta[M_AUTHOR]
 
315
 
 
316
        RW
 
317
 
 
318
        Author of the media, this corresponds to upnp:author in the DIDL-Lite
 
319
        XML.
 
320
 
 
321
      o orig.meta[M_DIRECTOR]
 
322
 
 
323
        RW
 
324
 
 
325
        Director of the media, this corresponds to upnp:director in the
 
326
        DIDL-Lite XML.
 
327
 
284
328
  * orig.aux
285
329
 
286
330
    RO
293
337
    this array will hold the tags that you specified in your config.xml,
294
338
    allowing you to create your virtual structure according to your liking.
295
339
 
296
 
  * obj.playlistOrder
 
340
  * orig.playlistOrder
297
341
 
298
342
    RW
299
343
 
437
481
        for example, a value of '/Audio/All Music' will add the object to the
438
482
        Audio, All Music container in the server hierarchy. Make sure to
439
483
        properly escape the slash characters in container names. You will find
440
 
        more information on container chain escaping in ???.
 
484
        more information on container chain escaping later in this chapter.
441
485
 
442
486
      o lastContainerClass
443
487
 
739
783
 
740
784
Not much to say here... I think libextractor is capable of retrieving some
741
785
information from video files, however I seldom encountered any video files
742
 
populated with metadata. So for now we just put everything into the 'All Video'
743
 
container.
 
786
populated with metadata. You could also try ffmpeg to get more information,
 
787
however by default we keep it very simple - we just put everything into the
 
788
'All Video' container.
744
789
 
745
790
function addVideo(obj)
746
791
{
753
798
This is the main part of the script, it looks at the mimetype of the original
754
799
object and feeds the object to the appropriate content handler.
755
800
 
756
 
var arr = orig.mimetype.split('/');
757
 
var mime = arr[0];
 
801
if (getPlaylistType(orig.mimetype) == '')
 
802
{
 
803
    var arr = orig.mimetype.split('/');
 
804
    var mime = arr[0];
758
805
 
759
 
var obj = orig;
 
806
    var obj = orig;
760
807
 
761
808
All virtual objects are references to objects in the PC-Directory, so make sure
762
809
to correctly set the reference ID!
763
810
 
764
 
obj.refID = orig.id;
765
 
 
766
 
if ((mime == 'audio') || (orig.mimetype == 'application/ogg'))
767
 
{
768
 
    addAudio(obj);
769
 
}
770
 
 
771
 
if (mime == 'video')
772
 
{
773
 
    addVideo(obj);
774
 
}
775
 
 
776
 
if (mime == 'image')
777
 
{
778
 
    addImage(obj);
 
811
    obj.refID = orig.id;
 
812
 
 
813
    if ((mime == 'audio'))
 
814
    {
 
815
        addAudio(obj);
 
816
    }
 
817
 
 
818
    if (mime == 'video')
 
819
    {
 
820
        addVideo(obj);
 
821
    }
 
822
 
 
823
    if (mime == 'image')
 
824
    {
 
825
         addImage(obj);
 
826
    }
 
827
 
 
828
We now also have OGG Theora recognition, so we can ensure that Vorbis
 
829
 
 
830
    if (orig.mimetype == 'application/ogg')
 
831
    {
 
832
    if (obj.theora == 1)
 
833
            addVideo(obj);
 
834
        else
 
835
            addAudio(obj);
 
836
    }
779
837
}
780
838
 
781
839
5.2. Playlist Script