Author: jbevain
Date: 2007-10-02 08:43:10 -0400 (Tue, 02 Oct 2007)
New Revision: 86742

Modified:
   trunk/moon/src/ChangeLog
   trunk/moon/src/playlist.cpp
   trunk/moon/src/playlist.h
Log:
2007-10-02  Jb Evain  <[EMAIL PROTECTED]>

        * playlist.cpp|h: implemented start time for playlist entries.



Modified: trunk/moon/src/ChangeLog
===================================================================
--- trunk/moon/src/ChangeLog    2007-10-02 12:42:35 UTC (rev 86741)
+++ trunk/moon/src/ChangeLog    2007-10-02 12:43:10 UTC (rev 86742)
@@ -1,5 +1,9 @@
 2007-10-02  Jb Evain  <[EMAIL PROTECTED]>
 
+       * playlist.cpp|h: implemented start time for playlist entries.
+
+2007-10-02  Jb Evain  <[EMAIL PROTECTED]>
+
        * playlist.cpp|h, media.cpp|h: rename MediaSource::OpenSource to 
OpenInternal.
 
 2007-10-02  Larry Ewing  <[EMAIL PROTECTED]>

Modified: trunk/moon/src/playlist.cpp
===================================================================
--- trunk/moon/src/playlist.cpp 2007-10-02 12:42:35 UTC (rev 86741)
+++ trunk/moon/src/playlist.cpp 2007-10-02 12:43:10 UTC (rev 86742)
@@ -160,15 +160,12 @@
 Playlist::OpenEntry (PlaylistEntry *entry)
 {
        GString *uri;
-       MediaSource *source;
 
        current_entry = entry;
 
-       source = current_entry->GetSource ();
-
        // if the source if already downloaded, no need to go further
-       if (source)
-               return source->Open ();
+       if (HasMediaSource ())
+               return OpenCurrentSource ();
 
        media_element_set_current_state (element, "Buffering");
 
@@ -189,6 +186,27 @@
 }
 
 bool
+Playlist::OpenCurrentSource ()
+{
+       bool success;
+       MediaSource *source;
+
+       if (!current_entry)
+               return false;
+       
+       source = current_entry->GetSource ();
+
+       if (!source)
+               return false;
+
+       success = source->Open ();
+       if (success)
+               element->mplayer->Seek (current_entry->GetStartTime ());
+
+       return success;
+}
+
+bool
 Playlist::OpenInternal ()
 {
        if (!Parse ())

Modified: trunk/moon/src/playlist.h
===================================================================
--- trunk/moon/src/playlist.h   2007-10-02 12:42:35 UTC (rev 86741)
+++ trunk/moon/src/playlist.h   2007-10-02 12:43:10 UTC (rev 86742)
@@ -165,6 +165,7 @@
        bool Parse ();
        bool HasMediaSource ();
        bool OpenEntry (PlaylistEntry *entry);
+       bool OpenCurrentSource ();
        void OnMediaEnded ();
        void OnMediaDownloaded ();
 

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to