- * : start playing only when opening a stream from the main window;
authorBoris Dorès <babal@videolan.org>
Fri, 13 Dec 2002 17:05:12 +0000 (17:05 +0000)
committerBoris Dorès <babal@videolan.org>
Fri, 13 Dec 2002 17:05:12 +0000 (17:05 +0000)
  when opening it from the playlist window, add it to the list, but
  don't change anything to the playing state and current stream.

- playlist.dfm : proper resizing behaviour

modules/gui/win32/disc.cpp
modules/gui/win32/mainframe.cpp
modules/gui/win32/network.cpp
modules/gui/win32/playlist.cpp
modules/gui/win32/playlist.dfm
modules/gui/win32/win32.cpp
modules/gui/win32/win32_common.h

index e8162d0..bb174a2 100644 (file)
@@ -81,8 +81,9 @@ void __fastcall TDiscDlg::BitBtnOkClick( TObject *Sender )
     /* Build source name and add it to playlist */\r
     Source = Method + ":" + Device + "@" + Title + "," + Chapter;\r
 \r
-    p_intf->p_sys->p_playwin->Add( Source, PLAYLIST_APPEND | PLAYLIST_GO,\r
-                                   PLAYLIST_END );\r
+    p_intf->p_sys->p_playwin->Add( Source, PLAYLIST_APPEND\r
+            | ( p_intf->p_sys->b_play_when_adding ? PLAYLIST_GO : 0 ),\r
+            PLAYLIST_END );\r
 }\r
 //---------------------------------------------------------------------------\r
 void __fastcall TDiscDlg::RadioGroupTypeClick( TObject *Sender )\r
index add53a7..a9afecc 100644 (file)
@@ -149,8 +149,9 @@ void __fastcall TMainFrameDlg::OpenFileActionExecute( TObject *Sender )
         /* add the new file to the interface playlist */\r
         for ( int i = 0 ; i < OpenDialog1->Files->Count ; i++ )\r
             p_intf->p_sys->p_playwin->Add( OpenDialog1->Files->Strings[i],\r
-                                        PLAYLIST_APPEND,\r
-                                        PLAYLIST_END );\r
+                    PLAYLIST_APPEND\r
+                    | ( p_intf->p_sys->b_play_when_adding ? PLAYLIST_GO : 0 ),\r
+                    PLAYLIST_END );\r
     };\r
 }\r
 //---------------------------------------------------------------------------\r
index 91f385e..a46b86d 100644 (file)
@@ -105,8 +105,9 @@ void __fastcall TNetworkDlg::BitBtnOkClick( TObject *Sender )
             Source = "udp:@:" + IntToStr( i_port );\r
 \r
             p_intf->p_sys->p_playwin->Add( Source,\r
-                                           PLAYLIST_APPEND | PLAYLIST_GO,\r
-                                           PLAYLIST_END );\r
+                    PLAYLIST_APPEND\r
+                    | ( p_intf->p_sys->b_play_when_adding ? PLAYLIST_GO : 0 )\r
+                    , PLAYLIST_END );\r
             break;\r
 \r
         /* UDP Multicast */\r
@@ -119,8 +120,9 @@ void __fastcall TNetworkDlg::BitBtnOkClick( TObject *Sender )
             Source = "udp:@" + Address + ":" + IntToStr( i_port );\r
 \r
             p_intf->p_sys->p_playwin->Add( Source,\r
-                                           PLAYLIST_APPEND | PLAYLIST_GO,\r
-                                           PLAYLIST_END );\r
+                    PLAYLIST_APPEND\r
+                    | ( p_intf->p_sys->b_play_when_adding ? PLAYLIST_GO : 0 )\r
+                    , PLAYLIST_END );\r
 \r
         /* Channel server */\r
         case 2:\r
@@ -152,8 +154,9 @@ void __fastcall TNetworkDlg::BitBtnOkClick( TObject *Sender )
             }\r
 \r
             p_intf->p_sys->p_playwin->Add( Source,\r
-                                           PLAYLIST_APPEND | PLAYLIST_GO,\r
-                                           PLAYLIST_END );\r
+                    PLAYLIST_APPEND\r
+                    | ( p_intf->p_sys->b_play_when_adding ? PLAYLIST_GO : 0 )\r
+                    , PLAYLIST_END );\r
 \r
             break;\r
     }\r
index f659f06..204df11 100644 (file)
@@ -189,17 +189,23 @@ void __fastcall TPlaylistDlg::ListViewPlaylistCustomDrawItem(
  ****************************************************************************/\r
 void __fastcall TPlaylistDlg::MenuAddFileClick( TObject *Sender )\r
 {\r
+    p_intf->p_sys->b_play_when_adding = false;\r
     p_intf->p_sys->p_window->OpenFileActionExecute( Sender );\r
+    p_intf->p_sys->b_play_when_adding = true;\r
 }\r
 //---------------------------------------------------------------------------\r
 void __fastcall TPlaylistDlg::MenuAddDiscClick( TObject *Sender )\r
 {\r
+    p_intf->p_sys->b_play_when_adding = false;\r
     p_intf->p_sys->p_window->OpenDiscActionExecute( Sender );\r
+    p_intf->p_sys->b_play_when_adding = true;\r
 }\r
 //---------------------------------------------------------------------------\r
 void __fastcall TPlaylistDlg::MenuAddNetClick( TObject *Sender )\r
 {\r
+    p_intf->p_sys->b_play_when_adding = false;\r
     p_intf->p_sys->p_window->NetworkStreamActionExecute( Sender );\r
+    p_intf->p_sys->b_play_when_adding = true;\r
 }\r
 //---------------------------------------------------------------------------\r
 void __fastcall TPlaylistDlg::MenuAddUrlClick( TObject *Sender )\r
index a9afc6f..0a13c11 100644 (file)
@@ -34,7 +34,7 @@ object PlaylistDlg: TPlaylistDlg
     Top = 10\r
     Width = 305\r
     Height = 331\r
-    Anchors = [akTop, akBottom]\r
+    Anchors = [akLeft, akTop, akRight, akBottom]\r
     Columns = <\r
       item\r
         Caption = 'Filename'\r
index 9350d7a..ae7d9ca 100644 (file)
@@ -2,7 +2,7 @@
  * win32.cpp : Win32 interface plugin for vlc
  *****************************************************************************
  * Copyright (C) 2002 VideoLAN
- * $Id: win32.cpp,v 1.5 2002/12/13 03:52:58 videolan Exp $
+ * $Id: win32.cpp,v 1.6 2002/12/13 17:05:12 babal Exp $
  *
  * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
  *
@@ -76,6 +76,7 @@ static int Open ( vlc_object_t *p_this )
 
     p_intf->p_sys->p_input = NULL;
     p_intf->p_sys->i_playing = -1;
+    p_intf->p_sys->b_play_when_adding = true;
     p_intf->p_sys->b_slider_free = 1;
 
     return( 0 );
index 01a10fb..04f35e7 100644 (file)
@@ -73,6 +73,7 @@ struct intf_sys_t
 \r
     /* Playlist management */\r
     int                 i_playing;                 /* playlist selected item */\r
+    vlc_bool_t          b_play_when_adding;\r
 \r
     /* The window labels for DVD mode */\r
     TLabel            * p_label_title;\r