]> git.sesse.net Git - vlc/commitdiff
* modules/gui/wxwindows/*: adapted to the new playlist api.
authorGildas Bazin <gbazin@videolan.org>
Mon, 26 Jan 2004 22:10:20 +0000 (22:10 +0000)
committerGildas Bazin <gbazin@videolan.org>
Mon, 26 Jan 2004 22:10:20 +0000 (22:10 +0000)
   "Add MRL" in the playlist dialog now only appends the new item to the playlist.

modules/gui/wxwindows/dialogs.cpp
modules/gui/wxwindows/open.cpp
modules/gui/wxwindows/wxwindows.h

index b51f614cffde6912966a5fc0032d1711c5557b9c..ff2c23892da4456c777a06730e5079796cdc593e 100644 (file)
@@ -2,7 +2,7 @@
  * dialogs.cpp : wxWindows plugin for vlc
  *****************************************************************************
  * Copyright (C) 2000-2004 VideoLAN
- * $Id: dialogs.cpp,v 1.14 2004/01/25 03:29:01 hartman Exp $
+ * $Id: dialogs.cpp,v 1.15 2004/01/26 22:10:19 gbazin Exp $
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *
@@ -320,8 +320,8 @@ void DialogsProvider::Open( int i_access_method, int i_arg )
 {
     /* Show/hide the open dialog */
     if( !p_open_dialog )
-        p_open_dialog = new OpenDialog(p_intf, this, i_access_method, i_arg ,
-                                       OPEN_NORMAL );
+        p_open_dialog = new OpenDialog( p_intf, this, i_access_method, i_arg,
+                                        OPEN_NORMAL );
 
     if( p_open_dialog )
     {
index 4daa4a9c2ffb349d2cefc737697767ce3ed26cb5..7bc0f9c09bcd3460e803e2c61dff936ab58a6302 100644 (file)
@@ -2,7 +2,7 @@
  * open.cpp : wxWindows plugin for vlc
  *****************************************************************************
  * Copyright (C) 2000-2004 VideoLAN
- * $Id: open.cpp,v 1.65 2004/01/25 08:01:13 rocky Exp $
+ * $Id: open.cpp,v 1.66 2004/01/26 22:10:20 gbazin Exp $
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *
@@ -223,6 +223,7 @@ OpenDialog::OpenDialog( intf_thread_t *_p_intf, wxWindow *_p_parent,
     SetIcon( *p_intf->p_sys->p_icon );
     file_dialog = NULL;
     i_disc_type_selection = 0;
+    i_open_arg = i_arg;
 
 #ifndef WIN32
     v4l_dialog = NULL;
@@ -383,6 +384,7 @@ int OpenDialog::Show( int i_access_method, int i_arg )
     i_ret = wxFrame::Show();
     Raise();
     SetFocus();
+    i_open_arg = i_arg;
     return i_ret;
 }
 
@@ -891,8 +893,8 @@ void OpenDialog::OnOk( wxCommandEvent& WXUNUSED(event) )
 
         int i_id = playlist_Add( p_playlist, (const char *)mrl[i].mb_str(),
                       (const char *)mrl[i].mb_str(),
-                      PLAYLIST_APPEND | (i ? 0 : PLAYLIST_GO), PLAYLIST_END );
-        int i_pos = playlist_GetPositionById( p_playlist, i_id );
+                      PLAYLIST_APPEND, PLAYLIST_END );
+        playlist_item_t *p_item = playlist_GetItemById( p_playlist , i_id );
 
         /* Count the input options */
         while( i + i_options + 1 < (int)mrl.GetCount() &&
@@ -904,7 +906,7 @@ void OpenDialog::OnOk( wxCommandEvent& WXUNUSED(event) )
         /* Insert options */
         for( int j = 0; j < i_options; j++ )
         {
-            playlist_AddOption( p_playlist, i_pos, mrl[i + j  + 1].mb_str() );
+            playlist_AddItemOption( p_item, mrl[i + j  + 1].mb_str() );
         }
 
         /* Get the options from the subtitles dialog */
@@ -912,8 +914,7 @@ void OpenDialog::OnOk( wxCommandEvent& WXUNUSED(event) )
         {
             for( int j = 0; j < (int)subsfile_mrl.GetCount(); j++ )
             {
-                playlist_AddOption( p_playlist, i_pos ,
-                                    subsfile_mrl[j].mb_str() );
+                playlist_AddItemOption( p_item, subsfile_mrl[j].mb_str() );
             }
         }
 
@@ -922,10 +923,15 @@ void OpenDialog::OnOk( wxCommandEvent& WXUNUSED(event) )
         {
             for( int j = 0; j < (int)sout_mrl.GetCount(); j++ )
             {
-                playlist_AddOption( p_playlist, i_pos ,
-                                    sout_mrl[j].mb_str() );
+                playlist_AddItemOption( p_item, sout_mrl[j].mb_str() );
             }
         }
+
+        if( !i && i_open_arg )
+        {
+            int i_pos = playlist_GetPositionById( p_playlist , i_id );
+            playlist_Command( p_playlist, PLAYLIST_GOTO, i_pos );
+        }
         i += i_options;
     }
 
index c3a578a82ab712ebbdda7968cb38964b0fdef202..418a7bfe39c6378579023e1ffcc9894cc532a0c4 100644 (file)
@@ -2,7 +2,7 @@
  * wxwindows.h: private wxWindows interface description
  *****************************************************************************
  * Copyright (C) 1999-2004 VideoLAN
- * $Id: wxwindows.h,v 1.87 2004/01/25 03:29:02 hartman Exp $
+ * $Id: wxwindows.h,v 1.88 2004/01/26 22:10:20 gbazin Exp $
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *
@@ -375,6 +375,8 @@ private:
     int i_disc_type_selection;
 
     int i_method; /* Normal or for the stream dialog ? */
+    int i_open_arg;
+
     wxComboBox *mrl_combo;
     wxNotebook *notebook;