Revision: 2112
          http://gtkpod.svn.sourceforge.net/gtkpod/?rev=2112&view=rev
Author:   tmzullinger
Date:     2008-08-23 18:04:30 +0000 (Sat, 23 Aug 2008)

Log Message:
-----------
Python: Set the mediatype field for Track objects

Modified Paths:
--------------
    libgpod/trunk/ChangeLog
    libgpod/trunk/bindings/python/ipod.py

Modified: libgpod/trunk/ChangeLog
===================================================================
--- libgpod/trunk/ChangeLog     2008-08-23 18:03:52 UTC (rev 2111)
+++ libgpod/trunk/ChangeLog     2008-08-23 18:04:30 UTC (rev 2112)
@@ -18,6 +18,9 @@
        * bindings/python/tests/tests.py:
          Whitespace cleanup
 
+       * bindings/python/ipod.py:
+         Set the mediatype field for Track objects
+
 2008-08-20  Todd Zullinger  <tmzullinger at users.sourceforge.net>
 
        * bindings/python/examples/save_photos.py

Modified: libgpod/trunk/bindings/python/ipod.py
===================================================================
--- libgpod/trunk/bindings/python/ipod.py       2008-08-23 18:03:52 UTC (rev 
2111)
+++ libgpod/trunk/bindings/python/ipod.py       2008-08-23 18:04:30 UTC (rev 
2112)
@@ -297,13 +297,18 @@
                                     k.startswith("reserved") or
                                     k == "chapterdata")]
 
-    def __init__(self, filename=None,
+    def __init__(self, filename=None, mediatype=gpod.ITDB_MEDIATYPE_AUDIO,
                  proxied_track=None, podcast=False, ownerdb=None):
         """Create a Track object.
 
         If from_file or filename is set, the file specified will be
         used to create the track.
 
+        The mediatype parameter sets the mediatype for the track.  It
+        defaults to audio, unless 'podcast' is True, in which case it
+        is set to podcast.  See gpod.ITDB_MEDIATYPE_* for other valid
+        mediatypes.
+
         If proxied_track is set, it is expected to be an Itdb_Track
         object.
 
@@ -357,6 +362,8 @@
         else:
             self._track = gpod.itdb_track_new()
             self.set_podcast(podcast)
+        if not 'mediatype' in self:
+            self['mediatype'] = mediatype
 
     def _set_userdata_utf8(self, key, value):
         self['userdata']['%s_locale' % key] = value
@@ -440,6 +447,7 @@
             self['skip_when_shuffling'] = 0x01
             self['remember_playback_position'] = 0x01
             self['flag4'] = 0x01 # Show Title/Album on the 'Now Playing' page
+            self['mediatype'] = gpod.ITDB_MEDIATYPE_PODCAST
         else:
             self['skip_when_shuffling'] = 0x00
             self['remember_playback_position'] = 0x00


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
gtkpod-cvs2 mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gtkpod-cvs2

Reply via email to