]> git.sesse.net Git - vlc/blobdiff - modules/codec/cmml/intf.c
Merge back branch 0.8.6-playlist-vlm to trunk.
[vlc] / modules / codec / cmml / intf.c
index 8d5a7725e4b3255c535b0df4b9f4746d836ae799..7c633b594a8a894c953a61b3d1651a7be1ba9c18 100644 (file)
@@ -13,7 +13,7 @@
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
@@ -21,7 +21,7 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
 /*****************************************************************************
@@ -192,7 +192,7 @@ static void RunIntf( intf_thread_t *p_intf )
     /* Main loop */
     while( !p_intf->b_die )
     {
-        
+
         /* find a video output if we currently don't have one */
         if( p_vout == NULL )
         {
@@ -412,7 +412,7 @@ static int KeyEvent( vlc_object_t *p_this, char const *psz_var,
     vlc_mutex_lock( &p_intf->change_lock );
 
     p_intf->p_sys->b_key_pressed = VLC_TRUE;
-    
+
     vlc_mutex_unlock( &p_intf->change_lock );
 
     return VLC_SUCCESS;
@@ -451,7 +451,7 @@ static void FollowAnchor ( intf_thread_t *p_intf )
         mtime_t i_seconds;
         vlc_value_t time;
 
-        p_playlist = (playlist_t *) vlc_object_find( p_intf, 
+        p_playlist = (playlist_t *) vlc_object_find( p_intf,
                 VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
         if ( !p_playlist )
         {
@@ -460,13 +460,13 @@ static void FollowAnchor ( intf_thread_t *p_intf )
         }
 
         /* Get new URL */
-        p_current_item = p_playlist->pp_items[p_playlist->i_index];
+        p_current_item = p_playlist->status.p_item;
 #ifdef CMML_INTF_DEBUG
         msg_Dbg( p_intf, "Current playlist item URL is \"%s\"",
                 p_current_item->input.psz_uri );
 #endif
 
-        psz_uri_to_load = XURL_Concat( p_current_item->input.psz_uri,
+        psz_uri_to_load = XURL_Concat( p_current_item->p_input->psz_uri,
                                        psz_url );
 
 #ifdef CMML_INTF_DEBUG
@@ -550,7 +550,7 @@ char *GetTimedURLFromPlaylistItem( intf_thread_t *p_intf,
     char *psz_return_value = NULL;
     char *psz_seconds = NULL;
     int i_seconds;
-    
+
     psz_url = XURL_GetWithoutFragment( p_current_item->input->psz_uri );
 
     /* Get current time as a string */
@@ -577,7 +577,7 @@ char *GetTimedURLFromPlaylistItem( intf_thread_t *p_intf,
     p = GetTimedURIFragmentForTime; /* unused */
     p = GetCurrentTimeInSeconds;    /* unused */
 
-    return strdup( p_current_item->input.psz_uri );
+    return strdup( p_current_item->p_input->psz_uri );
 #endif
 }
 
@@ -653,7 +653,7 @@ void GoBack( intf_thread_t *p_intf )
 #endif
 
     /* Find the playlist */
-    p_playlist = (playlist_t *) vlc_object_find( p_intf, 
+    p_playlist = (playlist_t *) vlc_object_find( p_intf,
             VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
     if ( !p_playlist )
     {
@@ -686,7 +686,7 @@ void GoBack( intf_thread_t *p_intf )
         return;
     }
 
-    p_current_item = p_playlist->pp_items[p_playlist->i_index];
+    p_current_item = p_playlist->status.p_item;
 
     /* Save the currently-playing media in a new history item */
     psz_timed_url = GetTimedURLFromPlaylistItem( p_intf, p_current_item );
@@ -731,7 +731,7 @@ void GoForward( intf_thread_t *p_intf )
 #endif
 
     /* Find the playlist */
-    p_playlist = (playlist_t *) vlc_object_find( p_intf, 
+    p_playlist = (playlist_t *) vlc_object_find( p_intf,
             VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
     if ( !p_playlist )
     {
@@ -774,8 +774,8 @@ void GoForward( intf_thread_t *p_intf )
         vlc_object_release( p_playlist );
         return;
     }
-    p_current_item = p_playlist->pp_items[p_playlist->i_index];
-    p_new_history_item->psz_uri = GetTimedURLFromPlaylistItem( p_intf, 
+    p_current_item = p_playlist->status.p_item;
+    p_new_history_item->psz_uri = GetTimedURLFromPlaylistItem( p_intf,
             p_current_item );
     p_new_history_item->psz_name = p_new_history_item->psz_uri;
 
@@ -796,9 +796,8 @@ void GoForward( intf_thread_t *p_intf )
 static void ReplacePlaylistItem( playlist_t *p_playlist, char *psz_uri )
 {
     playlist_Stop( p_playlist );
-    (void) playlist_Add( p_playlist, psz_uri, psz_uri,
-                         PLAYLIST_REPLACE, p_playlist->i_index );
-    playlist_Goto( p_playlist, p_playlist->i_index );
+    (void) playlist_PlaylistAdd( p_playlist, psz_uri, psz_uri,
+                         PLAYLIST_INSERT /* FIXME: used to be PLAYLIST_REPLACE */, PLAYLIST_END|PLAYLIST_GO /* FIXME: p_playlist->status.i_index */ );
 }
 
 /****************************************************************************
@@ -821,15 +820,11 @@ static int DisplayAnchor( intf_thread_t *p_intf,
     {
         text_style_t *p_style = NULL;
 
-        text_style_t blue_with_underline = default_text_style;
-        blue_with_underline.b_underline = VLC_TRUE;
-        blue_with_underline.i_color = 0x22ff22;
-
         if( psz_anchor_url )
         {
             /* Should display subtitle underlined and in blue, but it looks
              * like VLC doesn't implement any text styles yet.  D'oh! */
-            p_style = &blue_with_underline;
+            // p_style = &blue_with_underline;
 
         }
 
@@ -837,7 +832,7 @@ static int DisplayAnchor( intf_thread_t *p_intf,
          * coordinates.  Need to look at the subpicture display system to
          * work out why. */
         if ( vout_ShowTextAbsolute( p_vout, DEFAULT_CHAN,
-                psz_anchor_description, p_style, OSD_ALIGN_BOTTOM,
+                psz_anchor_description, NULL, OSD_ALIGN_BOTTOM,
                 i_margin_h, i_margin_v, i_now, 0 ) == VLC_SUCCESS )
         {
             /* Displayed successfully */