* ./plugins/win32/*: tried to port the Win32 interface to the new API. Seems
authorSam Hocevar <sam@videolan.org>
Fri, 7 Jun 2002 23:53:44 +0000 (23:53 +0000)
committerSam Hocevar <sam@videolan.org>
Fri, 7 Jun 2002 23:53:44 +0000 (23:53 +0000)
    to be still crashing.

21 files changed:
include/playlist.h [deleted file]
include/vlc/intf.h
include/vlc_common.h
include/vlc_playlist.h [new file with mode: 0644]
plugins/macosx/intf_vlc_wrapper.m
plugins/win32/control.cpp
plugins/win32/disc.cpp
plugins/win32/intf_win32.cpp
plugins/win32/mainframe.cpp
plugins/win32/menu.cpp
plugins/win32/messages.cpp
plugins/win32/network.cpp
plugins/win32/playlist.cpp
plugins/win32/preferences.cpp
plugins/win32/win32_common.h
src/input/input.c
src/libvlc.c
src/misc/modules.c
src/misc/netutils.c
src/misc/objects.c
src/playlist/playlist.c

diff --git a/include/playlist.h b/include/playlist.h
deleted file mode 100644 (file)
index bd08161..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-/*****************************************************************************
- * vlc_playlist.h : Playlist functions
- *****************************************************************************
- * Copyright (C) 1999, 2000, 2001, 2002 VideoLAN
- * $Id: playlist.h,v 1.7 2002/06/07 19:54:37 sam Exp $
- *
- * Authors: Samuel Hocevar <sam@zoy.org>
- *
- * This program is free software; you can redistribute it and/or modify
- * 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
- * GNU General Public License for more details.
- *
- * 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.
- *****************************************************************************/
-
-/*****************************************************************************
- * playlist_item_t: playlist item
- *****************************************************************************/
-struct playlist_item_s
-{
-    char *  psz_name;
-    int     i_type;   /* unused yet */
-    int     i_status; /* unused yet */
-};
-
-/*****************************************************************************
- * playlist_t: playlist structure
- *****************************************************************************
- * The structure contains information about the size and browsing mode of
- * the playlist, a change lock, a dynamic array of playlist items, and a
- * current item which is an exact copy of one of the array members.
- *****************************************************************************/
-struct playlist_s
-{
-    VLC_COMMON_MEMBERS
-
-    int                   i_index;                          /* current index */
-    int                   i_status;
-    int                   i_size;                              /* total size */
-
-    playlist_item_t **    pp_items;
-
-    input_thread_t *      p_input;
-};
-
-/* Used by playlist_Add */
-#define PLAYLIST_INSERT      0x0001
-#define PLAYLIST_REPLACE     0x0002
-#define PLAYLIST_APPEND      0x0004
-#define PLAYLIST_GO          0x0008
-
-#define PLAYLIST_END           -666
-
-/* Playlist parsing mode */
-#define PLAYLIST_REPEAT_CURRENT   0             /* Keep playing current item */
-#define PLAYLIST_FORWARD          1              /* Parse playlist until end */
-#define PLAYLIST_BACKWARD        -1                       /* Parse backwards */
-#define PLAYLIST_FORWARD_LOOP     2               /* Parse playlist and loop */
-#define PLAYLIST_BACKWARD_LOOP   -2              /* Parse backwards and loop */
-#define PLAYLIST_RANDOM           3                          /* Shuffle play */
-#define PLAYLIST_REVERSE_RANDOM  -3                  /* Reverse shuffle play */
-
-/* Playlist commands */
-#define PLAYLIST_PLAY   1                         /* Starts playing. No arg. */
-#define PLAYLIST_PAUSE  2                 /* Toggles playlist pause. No arg. */
-#define PLAYLIST_STOP   3                          /* Stops playing. No arg. */
-#define PLAYLIST_SKIP   4                          /* Skip X items and play. */
-#define PLAYLIST_GOTO   5                                  /* Goto Xth item. */
-#define PLAYLIST_MODE   6                          /* Set playlist mode. ??? */
-
-/*****************************************************************************
- * Prototypes
- *****************************************************************************/
-#define playlist_Create(a) __playlist_Create(CAST_TO_VLC_OBJECT(a))
-playlist_t * __playlist_Create   ( vlc_object_t * );
-void           playlist_Destroy  ( playlist_t * );
-
-#define playlist_Play(p) playlist_Command(p,PLAYLIST_PLAY,0)
-#define playlist_Pause(p) playlist_Command(p,PLAYLIST_PAUSE,0)
-#define playlist_Stop(p) playlist_Command(p,PLAYLIST_STOP,0)
-#define playlist_Next(p) playlist_Command(p,PLAYLIST_SKIP,1)
-#define playlist_Prev(p) playlist_Command(p,PLAYLIST_SKIP,-1)
-#define playlist_Skip(p,i) playlist_Command(p,PLAYLIST_SKIP,i)
-#define playlist_Goto(p,i) playlist_Command(p,PLAYLIST_GOTO,i)
-VLC_EXPORT( void, playlist_Command, ( playlist_t *, int, int ) );
-
-VLC_EXPORT( int,  playlist_Add,    ( playlist_t *, const char *, int, int ) );
-VLC_EXPORT( int,  playlist_Delete, ( playlist_t *, int ) );
-
index 4394232..3d325b2 100644 (file)
@@ -2,7 +2,7 @@
  * intf.h: interface header for vlc
  *****************************************************************************
  * Copyright (C) 2002 VideoLAN
- * $Id: intf.h,v 1.1 2002/06/01 12:31:58 sam Exp $
+ * $Id: intf.h,v 1.2 2002/06/07 23:53:44 sam Exp $
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -36,7 +36,7 @@ extern "C" {
  *****************************************************************************/
 #include "interface.h"
 #include "intf_eject.h"
-#include "playlist.h"
+#include "vlc_playlist.h"
 #include "stream_control.h"
 #include "input_ext-intf.h"
 
index 57b5c23..065b99f 100644 (file)
@@ -3,7 +3,7 @@
  * Collection of useful common types and macros definitions
  *****************************************************************************
  * Copyright (C) 1998, 1999, 2000 VideoLAN
- * $Id: vlc_common.h,v 1.6 2002/06/04 00:11:12 sam Exp $
+ * $Id: vlc_common.h,v 1.7 2002/06/07 23:53:44 sam Exp $
  *
  * Authors: Samuel Hocevar <sam@via.ecp.fr>
  *          Vincent Seguin <seguin@via.ecp.fr>
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
  *****************************************************************************/
 
+/*****************************************************************************
+ * Compiler-specific workarounds
+ *****************************************************************************/
+#if defined( __BORLANDC__ )
+#   undef HAVE_VARIADIC_MACROS
+#   undef HAVE_STDINT_H
+#endif
+
 /*****************************************************************************
  * Required system headers
  *****************************************************************************/
@@ -200,13 +208,6 @@ VLC_DECLARE_STRUCT(iso639_lang)
 
 #include "vlc_threads.h"
 
-/*****************************************************************************
- * Compiler-specific workarounds
- *****************************************************************************/
-#if defined( __BORLANDC__ )
-#   undef HAVE_VARIADIC_MACROS
-#endif
-
 /*****************************************************************************
  * Common structure members
  *****************************************************************************/
diff --git a/include/vlc_playlist.h b/include/vlc_playlist.h
new file mode 100644 (file)
index 0000000..705479b
--- /dev/null
@@ -0,0 +1,97 @@
+/*****************************************************************************
+ * vlc_playlist.h : Playlist functions
+ *****************************************************************************
+ * Copyright (C) 1999, 2000, 2001, 2002 VideoLAN
+ * $Id: vlc_playlist.h,v 1.1 2002/06/07 23:53:44 sam Exp $
+ *
+ * Authors: Samuel Hocevar <sam@zoy.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * 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
+ * GNU General Public License for more details.
+ *
+ * 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.
+ *****************************************************************************/
+
+/*****************************************************************************
+ * playlist_item_t: playlist item
+ *****************************************************************************/
+struct playlist_item_s
+{
+    char *  psz_name;
+    int     i_type;   /* unused yet */
+    int     i_status; /* unused yet */
+};
+
+/*****************************************************************************
+ * playlist_t: playlist structure
+ *****************************************************************************
+ * The structure contains information about the size and browsing mode of
+ * the playlist, a change lock, a dynamic array of playlist items, and a
+ * current item which is an exact copy of one of the array members.
+ *****************************************************************************/
+struct playlist_s
+{
+    VLC_COMMON_MEMBERS
+
+    int                   i_index;                          /* current index */
+    int                   i_status;
+    int                   i_size;                              /* total size */
+
+    playlist_item_t **    pp_items;
+
+    input_thread_t *      p_input;
+};
+
+/* Used by playlist_Add */
+#define PLAYLIST_INSERT      0x0001
+#define PLAYLIST_REPLACE     0x0002
+#define PLAYLIST_APPEND      0x0004
+#define PLAYLIST_GO          0x0008
+
+#define PLAYLIST_END           -666
+
+/* Playlist parsing mode */
+#define PLAYLIST_REPEAT_CURRENT   0             /* Keep playing current item */
+#define PLAYLIST_FORWARD          1              /* Parse playlist until end */
+#define PLAYLIST_BACKWARD        -1                       /* Parse backwards */
+#define PLAYLIST_FORWARD_LOOP     2               /* Parse playlist and loop */
+#define PLAYLIST_BACKWARD_LOOP   -2              /* Parse backwards and loop */
+#define PLAYLIST_RANDOM           3                          /* Shuffle play */
+#define PLAYLIST_REVERSE_RANDOM  -3                  /* Reverse shuffle play */
+
+/* Playlist commands */
+#define PLAYLIST_PLAY   1                         /* Starts playing. No arg. */
+#define PLAYLIST_PAUSE  2                 /* Toggles playlist pause. No arg. */
+#define PLAYLIST_STOP   3                          /* Stops playing. No arg. */
+#define PLAYLIST_SKIP   4                          /* Skip X items and play. */
+#define PLAYLIST_GOTO   5                                  /* Goto Xth item. */
+#define PLAYLIST_MODE   6                          /* Set playlist mode. ??? */
+
+/*****************************************************************************
+ * Prototypes
+ *****************************************************************************/
+#define playlist_Create(a) __playlist_Create(CAST_TO_VLC_OBJECT(a))
+playlist_t * __playlist_Create   ( vlc_object_t * );
+void           playlist_Destroy  ( playlist_t * );
+
+#define playlist_Play(p) playlist_Command(p,PLAYLIST_PLAY,0)
+#define playlist_Pause(p) playlist_Command(p,PLAYLIST_PAUSE,0)
+#define playlist_Stop(p) playlist_Command(p,PLAYLIST_STOP,0)
+#define playlist_Next(p) playlist_Command(p,PLAYLIST_SKIP,1)
+#define playlist_Prev(p) playlist_Command(p,PLAYLIST_SKIP,-1)
+#define playlist_Skip(p,i) playlist_Command(p,PLAYLIST_SKIP,i)
+#define playlist_Goto(p,i) playlist_Command(p,PLAYLIST_GOTO,i)
+VLC_EXPORT( void, playlist_Command, ( playlist_t *, int, int ) );
+
+VLC_EXPORT( int,  playlist_Add,    ( playlist_t *, const char *, int, int ) );
+VLC_EXPORT( int,  playlist_Delete, ( playlist_t *, int ) );
+
index 5e72c0f..fc28eca 100644 (file)
@@ -2,7 +2,7 @@
  * intf_vlc_wrapper.c: MacOS X plugin for vlc
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: intf_vlc_wrapper.m,v 1.12 2002/06/02 22:31:52 massiot Exp $
+ * $Id: intf_vlc_wrapper.m,v 1.13 2002/06/07 23:53:44 sam Exp $
  *
  * Authors: Florian G. Pflug <fgp@phlo.org>
  *          Jon Lech Johansen <jon-vl@nanocrew.net>
@@ -33,7 +33,7 @@
 #include <videolan/vlc.h>
 
 #include "interface.h"
-#include "intf_playlist.h"
+#include "vlc_playlist.h"
 #include "intf_eject.h"
 
 #include "video.h"
index 6dbdc03..da70656 100644 (file)
@@ -44,55 +44,42 @@ bool ControlBack( TObject *Sender )
 \r
 bool ControlStop( TObject *Sender )\r
 {\r
-    if( p_intfGlobal->p_vlc->p_input_bank->pp_input[0] != NULL )\r
+    playlist_t * p_playlist = (playlist_t *)\r
+        vlc_object_find( p_intfGlobal, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );\r
+    if( p_playlist == NULL )\r
     {\r
-        /* end playing item */\r
-        p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->b_eof = 1;\r
-\r
-        /* update playlist */\r
-        vlc_mutex_lock( &p_intfGlobal->p_vlc->p_playlist->change_lock );\r
-\r
-        p_intfGlobal->p_vlc->p_playlist->i_index--;\r
-        p_intfGlobal->p_vlc->p_playlist->b_stopped = 1;\r
-\r
-        vlc_mutex_unlock( &p_intfGlobal->p_vlc->p_playlist->change_lock );\r
-\r
+        return false;\r
     }\r
 \r
+    playlist_Stop( p_playlist );\r
+    vlc_object_release( p_playlist );\r
+\r
     return true;\r
 }\r
 \r
 \r
 bool ControlPlay( TObject *Sender )\r
 {\r
-    if( p_intfGlobal->p_vlc->p_input_bank->pp_input[0] != NULL )\r
+    playlist_t * p_playlist = (playlist_t *)\r
+        vlc_object_find( p_intfGlobal, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );\r
+    if( p_playlist == NULL )\r
+    {\r
+        p_intfGlobal->p_sys->p_window->MenuOpenFileClick( Sender );\r
+        return false;\r
+    }\r
+\r
+    vlc_mutex_lock( &p_playlist->object_lock );\r
+    if( p_playlist->i_size )\r
     {\r
-        input_SetStatus( p_intfGlobal->p_vlc->p_input_bank->pp_input[0], INPUT_STATUS_PLAY );\r
-        p_intfGlobal->p_vlc->p_playlist->b_stopped = 0;\r
+        vlc_mutex_unlock( &p_playlist->object_lock );\r
+        playlist_Play( p_playlist );\r
+        vlc_object_release( p_playlist );\r
     }\r
     else\r
     {\r
-        vlc_mutex_lock( &p_intfGlobal->p_vlc->p_playlist->change_lock );\r
-\r
-        if( p_intfGlobal->p_vlc->p_playlist->b_stopped )\r
-        {\r
-            if( p_intfGlobal->p_vlc->p_playlist->i_size )\r
-            {\r
-                vlc_mutex_unlock( &p_intfGlobal->p_vlc->p_playlist->change_lock );\r
-                intf_PlaylistJumpto( p_intfGlobal->p_vlc->p_playlist,\r
-                                     p_intfGlobal->p_vlc->p_playlist->i_index );\r
-            }\r
-            else\r
-            {\r
-                vlc_mutex_unlock( &p_intfGlobal->p_vlc->p_playlist->change_lock );\r
-                p_intfGlobal->p_sys->p_window->MenuOpenFileClick( Sender );\r
-            }\r
-        }\r
-        else\r
-        {\r
-            vlc_mutex_unlock( &p_intfGlobal->p_vlc->p_playlist->change_lock );\r
-        }\r
-\r
+        vlc_mutex_unlock( &p_playlist->object_lock );\r
+        vlc_object_release( p_playlist );\r
+        p_intfGlobal->p_sys->p_window->MenuOpenFileClick( Sender );\r
     }\r
 \r
     return true;\r
@@ -101,13 +88,9 @@ bool ControlPlay( TObject *Sender )
 \r
 bool ControlPause( TObject *Sender )\r
 {\r
-    if( p_intfGlobal->p_vlc->p_input_bank->pp_input[0] != NULL )\r
+    if( p_intfGlobal->p_sys->p_input != NULL )\r
     {\r
-        input_SetStatus( p_intfGlobal->p_vlc->p_input_bank->pp_input[0], INPUT_STATUS_PAUSE );\r
-\r
-        vlc_mutex_lock( &p_intfGlobal->p_vlc->p_playlist->change_lock );\r
-        p_intfGlobal->p_vlc->p_playlist->b_stopped = 0;\r
-        vlc_mutex_unlock( &p_intfGlobal->p_vlc->p_playlist->change_lock );\r
+        input_SetStatus( p_intfGlobal->p_sys->p_input, INPUT_STATUS_PAUSE );\r
     }\r
 \r
     return true;\r
@@ -116,13 +99,9 @@ bool ControlPause( TObject *Sender )
 \r
 bool ControlSlow( TObject *Sender )\r
 {\r
-    if( p_intfGlobal->p_vlc->p_input_bank->pp_input[0] != NULL )\r
+    if( p_intfGlobal->p_sys->p_input != NULL )\r
     {\r
-        input_SetStatus( p_intfGlobal->p_vlc->p_input_bank->pp_input[0], INPUT_STATUS_SLOWER );\r
-\r
-        vlc_mutex_lock( &p_intfGlobal->p_vlc->p_playlist->change_lock );\r
-        p_intfGlobal->p_vlc->p_playlist->b_stopped = 0;\r
-        vlc_mutex_unlock( &p_intfGlobal->p_vlc->p_playlist->change_lock );\r
+        input_SetStatus( p_intfGlobal->p_sys->p_input, INPUT_STATUS_SLOWER );\r
     }\r
 \r
     return true;\r
@@ -131,13 +110,9 @@ bool ControlSlow( TObject *Sender )
 \r
 bool ControlFast( TObject *Sender )\r
 {\r
-    if( p_intfGlobal->p_vlc->p_input_bank->pp_input[0] != NULL )\r
+    if( p_intfGlobal->p_sys->p_input != NULL )\r
     {\r
-        input_SetStatus( p_intfGlobal->p_vlc->p_input_bank->pp_input[0], INPUT_STATUS_FASTER );\r
-\r
-        vlc_mutex_lock( &p_intfGlobal->p_vlc->p_playlist->change_lock );\r
-        p_intfGlobal->p_vlc->p_playlist->b_stopped = 0;\r
-        vlc_mutex_unlock( &p_intfGlobal->p_vlc->p_playlist->change_lock );\r
+        input_SetStatus( p_intfGlobal->p_sys->p_input, INPUT_STATUS_FASTER );\r
     }\r
 \r
     return true;\r
index a285071..fff7ca3 100644 (file)
@@ -64,7 +64,14 @@ void __fastcall TDiscDlg::BitBtnCancelClick( TObject *Sender )
 void __fastcall TDiscDlg::BitBtnOkClick( TObject *Sender )\r
 {\r
     AnsiString  Device, Source, Method, Title, Chapter;\r
-    int         i_end = p_intfGlobal->p_vlc->p_playlist->i_size;\r
+    playlist_t *    p_playlist;\r
+\r
+    p_playlist = (playlist_t *)\r
+        vlc_object_find( p_intfGlobal, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );\r
+    if( p_playlist == NULL )\r
+    {   \r
+        return;\r
+    }                        \r
 \r
     Hide();\r
 \r
@@ -86,20 +93,13 @@ void __fastcall TDiscDlg::BitBtnOkClick( TObject *Sender )
 \r
     /* Build source name and add it to playlist */\r
     Source = Method + ":" + Device + "@" + Title + "," + Chapter;\r
-    intf_PlaylistAdd( p_intfGlobal->p_vlc->p_playlist,\r
-                      PLAYLIST_END, Source.c_str() );\r
+    playlist_Add( p_playlist, Source.c_str(),\r
+                  PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END );\r
 \r
     /* update the display */\r
-    p_intfGlobal->p_sys->p_playlist->\r
-                            UpdateGrid( p_intfGlobal->p_vlc->p_playlist );\r
-\r
-    /* stop current item, select added item */\r
-    if( p_intfGlobal->p_vlc->p_input_bank->pp_input[0] != NULL )\r
-    {\r
-        p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->b_eof = 1;\r
-    }\r
+    p_intfGlobal->p_sys->p_playwin->UpdateGrid( p_playlist );\r
 \r
-    intf_PlaylistJumpto( p_intfGlobal->p_vlc->p_playlist, i_end - 1 );\r
+    vlc_object_release( p_playlist );\r
 }\r
 //---------------------------------------------------------------------------\r
 void __fastcall TDiscDlg::RadioGroupTypeClick( TObject *Sender )\r
index 5bf3a3a..41307e4 100644 (file)
@@ -77,6 +77,8 @@ static int intf_Open( intf_thread_t *p_intf )
     /* Initialize Win32 thread */\r
     p_intf->p_sys->b_playing = 0;\r
     p_intf->p_sys->b_popup_changed = 0;\r
+\r
+    p_intf->p_sys->p_input = NULL;\r
     p_intf->p_sys->i_playing = -1;\r
     p_intf->p_sys->b_slider_free = 1;\r
 \r
@@ -88,6 +90,11 @@ static int intf_Open( intf_thread_t *p_intf )
  *****************************************************************************/\r
 static void intf_Close( intf_thread_t *p_intf )\r
 {\r
+    if( p_intf->p_sys->p_input )\r
+    {\r
+        vlc_object_release( p_intf->p_sys->p_input );\r
+    }\r
+\r
     msg_Unsubscribe( p_intf, p_intf->p_sys->p_sub );\r
 \r
     /* Destroy structure */\r
@@ -100,7 +107,7 @@ static void intf_Close( intf_thread_t *p_intf )
 static void intf_Run( intf_thread_t *p_intf )\r
 {\r
     p_intf->p_sys->p_window = new TMainFrameDlg( NULL );\r
-    p_intf->p_sys->p_playlist = new TPlaylistDlg( NULL );\r
+    p_intf->p_sys->p_playwin = new TPlaylistDlg( NULL );\r
     p_intf->p_sys->p_messages = new TMessagesDlg( NULL );\r
 \r
     /* show main window and wait until it is closed */\r
@@ -110,7 +117,7 @@ static void intf_Run( intf_thread_t *p_intf )
     if( p_intf->p_sys->p_network ) delete p_intf->p_sys->p_network;\r
     if( p_intf->p_sys->p_preferences ) delete p_intf->p_sys->p_preferences;\r
     delete p_intf->p_sys->p_messages;\r
-    delete p_intf->p_sys->p_playlist;\r
+    delete p_intf->p_sys->p_playwin;\r
 }\r
 \r
 /*****************************************************************************\r
@@ -138,16 +145,30 @@ int Win32Manage( intf_thread_t *p_intf )
     p_intf->p_sys->p_messages->UpdateLog();\r
 \r
     /* Update the playlist */\r
-    p_intf->p_sys->p_playlist->Manage( p_intf );\r
+    p_intf->p_sys->p_playwin->Manage( p_intf );\r
 \r
-    if( p_intf->p_vlc->p_input_bank->pp_input[0] != NULL )\r
+    /* Update the input */\r
+    if( p_intf->p_sys->p_input == NULL )\r
+    {\r
+        p_intf->p_sys->p_input = (input_thread_t *)\r
+                    vlc_object_find( p_intf, VLC_OBJECT_INPUT, FIND_ANYWHERE );\r
+    }\r
+    else if( p_intf->p_sys->p_input->b_dead )\r
+    {\r
+        vlc_object_release( p_intf->p_sys->p_input );\r
+        p_intf->p_sys->p_input = NULL;\r
+    }\r
+    \r
+    if( p_intf->p_sys->p_input )\r
     {\r
-        vlc_mutex_lock( &p_intf->p_vlc->p_input_bank->pp_input[0]->stream.stream_lock );\r
+        input_thread_t *p_input = p_intf->p_sys->p_input;\r
 \r
-        if( !p_intf->p_vlc->p_input_bank->pp_input[0]->b_die )\r
+        vlc_mutex_lock( &p_input->stream.stream_lock );\r
+\r
+        if( !p_input->b_die )\r
         {\r
             /* New input or stream map change */\r
-            if( p_intf->p_vlc->p_input_bank->pp_input[0]->stream.b_changed )\r
+            if( p_input->stream.b_changed )\r
             {\r
                 p_intf->p_sys->p_window->ModeManage();\r
                 SetupMenus( p_intf );\r
@@ -155,13 +176,12 @@ int Win32Manage( intf_thread_t *p_intf )
             }\r
 \r
             /* Manage the slider */\r
-            if( p_intf->p_vlc->p_input_bank->pp_input[0]->stream.b_seekable &&\r
-                p_intf->p_sys->b_playing )\r
+            if( p_input->stream.b_seekable && p_intf->p_sys->b_playing )\r
             {\r
                 TTrackBar * TrackBar = p_intf->p_sys->p_window->TrackBar;\r
                 off_t NewValue = TrackBar->Position;\r
 \r
-#define p_area p_intf->p_vlc->p_input_bank->pp_input[0]->stream.p_selected_area\r
+#define p_area p_input->stream.p_selected_area\r
                 /* If the user hasn't touched the slider since the last time,\r
                  * then the input can safely change it */\r
                 if( NewValue == p_intf->p_sys->OldValue )\r
@@ -179,9 +199,9 @@ int Win32Manage( intf_thread_t *p_intf )
                                 (off_t)SLIDER_MAX_VALUE;\r
 \r
                     /* release the lock to be able to seek */\r
-                    vlc_mutex_unlock( &p_intf->p_vlc->p_input_bank->pp_input[0]->stream.stream_lock );\r
-                    input_Seek( p_intf->p_vlc->p_input_bank->pp_input[0]->p_this, i_seek, INPUT_SEEK_SET );\r
-                    vlc_mutex_lock( &p_intf->p_vlc->p_input_bank->pp_input[0]->stream.stream_lock );\r
+                    vlc_mutex_unlock( &p_input->stream.stream_lock );\r
+                    input_Seek( p_input, i_seek, INPUT_SEEK_SET );\r
+                    vlc_mutex_lock( &p_input->stream.stream_lock );\r
 \r
                     /* Update the old value */\r
                     p_intf->p_sys->OldValue = NewValue;\r
@@ -194,14 +214,14 @@ int Win32Manage( intf_thread_t *p_intf )
             }\r
 \r
             if( p_intf->p_sys->i_part !=\r
-                p_intf->p_vlc->p_input_bank->pp_input[0]->stream.p_selected_area->i_part )\r
+                p_input->stream.p_selected_area->i_part )\r
             {\r
 //                p_intf->p_sys->b_chapter_update = 1;\r
                 SetupMenus( p_intf );\r
             }\r
         }\r
 \r
-        vlc_mutex_unlock( &p_intf->p_vlc->p_input_bank->pp_input[0]->stream.stream_lock );\r
+        vlc_mutex_unlock( &p_input->stream.stream_lock );\r
     }\r
     else if( p_intf->p_sys->b_playing && !p_intf->p_vlc->b_die )\r
     {\r
@@ -209,9 +229,6 @@ int Win32Manage( intf_thread_t *p_intf )
         p_intf->p_sys->b_playing = 0;\r
     }\r
 \r
-    /* Manage core vlc functions through the callback */\r
-    p_intf->pf_manage( p_intf );\r
-\r
     if( p_intf->p_vlc->b_die )\r
     {\r
         vlc_mutex_unlock( &p_intf->change_lock );\r
index e50a9a4..4d3d080 100644 (file)
@@ -91,21 +91,21 @@ void __fastcall TMainFrameDlg::TrackBarChange( TObject *Sender )
      * the stream. It is called whenever the slider changes its value.\r
      * The lock has to be taken before the function is called */\r
 \r
-//    vlc_mutex_lock( &p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.stream_lock );\r
+//    vlc_mutex_lock( &p_intfGlobal->p_sys->p_input->stream.stream_lock );\r
 \r
-    if( p_intfGlobal->p_vlc->p_input_bank->pp_input[0] != NULL )\r
+    if( p_intfGlobal->p_sys->p_input != NULL )\r
     {\r
-#define p_area p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.p_selected_area\r
+#define p_area p_intfGlobal->p_sys->p_input->stream.p_selected_area\r
         char psz_time[ OFFSETTOTIME_MAX_SIZE ];\r
         off_t Value = TrackBar->Position;\r
 \r
         GroupBoxSlider->Caption =\r
-                input_OffsetToTime( p_intfGlobal->p_vlc->p_input_bank->pp_input[0], psz_time,\r
+                input_OffsetToTime( p_intfGlobal->p_sys->p_input, psz_time,\r
                         ( p_area->i_size * Value ) / (off_t)SLIDER_MAX_VALUE );\r
 #undef p_area\r
      }\r
 \r
-//    vlc_mutex_unlock( &p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.stream_lock );\r
+//    vlc_mutex_unlock( &p_intfGlobal->p_sys->p_input->stream.stream_lock );\r
 }\r
 //---------------------------------------------------------------------------\r
 void __fastcall TMainFrameDlg::FormClose( TObject *Sender,\r
@@ -128,26 +128,28 @@ void __fastcall TMainFrameDlg::FormClose( TObject *Sender,
  ****************************************************************************/\r
 void __fastcall TMainFrameDlg::MenuOpenFileClick( TObject *Sender )\r
 {\r
-    int             i_end = p_intfGlobal->p_vlc->p_playlist->i_size;\r
     AnsiString      FileName;\r
+    playlist_t *    p_playlist;\r
+\r
+    p_playlist = (playlist_t *)vlc_object_find( p_intfGlobal,\r
+                                       VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );\r
+    if( p_playlist == NULL )\r
+    {\r
+        return;\r
+    }\r
+\r
     if( OpenDialog1->Execute() )\r
     {\r
         /* add the new file to the interface playlist */\r
         FileName = OpenDialog1->FileName;\r
-        intf_PlaylistAdd( p_intfGlobal->p_vlc->p_playlist, PLAYLIST_END,\r
-            (char*)FileName.c_str() );\r
+        playlist_Add( p_playlist, (char*)FileName.c_str(),\r
+                      PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END );\r
 \r
         /* update the plugin display */\r
-        p_intfGlobal->p_sys->p_playlist->UpdateGrid( p_intfGlobal->p_vlc->p_playlist );\r
-\r
-        /* end current item, select added item  */\r
-        if( p_intfGlobal->p_vlc->p_input_bank->pp_input[0] != NULL )\r
-        {\r
-            p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->b_eof = 1;\r
-        }\r
-\r
-        intf_PlaylistJumpto( p_intfGlobal->p_vlc->p_playlist, i_end - 1 );\r
+        p_intfGlobal->p_sys->p_playwin->UpdateGrid( p_playlist );\r
     };\r
+\r
+    vlc_object_release( p_playlist );\r
 }\r
 //---------------------------------------------------------------------------\r
 void __fastcall TMainFrameDlg::MenuOpenDiscClick( TObject *Sender )\r
@@ -184,27 +186,39 @@ void __fastcall TMainFrameDlg::MenuHideinterfaceClick( TObject *Sender )
 //---------------------------------------------------------------------------\r
 void __fastcall TMainFrameDlg::MenuFullscreenClick( TObject *Sender )\r
 {\r
-    if( p_intfGlobal->p_vlc->p_vout_bank->i_count )\r
-    {\r
-        vlc_mutex_lock( &p_intfGlobal->p_vlc->p_vout_bank->pp_vout[0]->change_lock );\r
-\r
-        p_intfGlobal->p_vlc->p_vout_bank->pp_vout[0]->i_changes |= VOUT_FULLSCREEN_CHANGE;\r
+    vout_thread_t *p_vout;\r
 \r
-        vlc_mutex_unlock( &p_intfGlobal->p_vlc->p_vout_bank->pp_vout[0]->change_lock );\r
+    p_vout = (vout_thread_t *)vlc_object_find( p_intfGlobal->p_sys->p_input,\r
+                                               VLC_OBJECT_VOUT, FIND_CHILD );\r
+    if( p_vout == NULL )\r
+    {\r
+        return;\r
     }\r
+\r
+    p_vout->i_changes |= VOUT_FULLSCREEN_CHANGE;\r
+    vlc_object_release( p_vout );\r
 }\r
 //---------------------------------------------------------------------------\r
 void __fastcall TMainFrameDlg::MenuPlaylistClick( TObject *Sender )\r
 {\r
-    TPlaylistDlg *p_playlist = p_intfGlobal->p_sys->p_playlist;\r
-    if( p_playlist->Visible )\r
+    TPlaylistDlg *p_playwin = p_intfGlobal->p_sys->p_playwin;\r
+    if( p_playwin->Visible )\r
     {\r
-        p_playlist->Hide();\r
+        p_playwin->Hide();\r
     }\r
     else\r
     {\r
-        p_playlist->UpdateGrid( p_intfGlobal->p_vlc->p_playlist );\r
-        p_playlist->Show();\r
+        playlist_t * p_playlist;\r
+        p_playlist = (playlist_t *)vlc_object_find( p_intfGlobal,\r
+                                         VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );\r
+        if( p_playlist == NULL )\r
+        {\r
+            return;\r
+        }\r
+\r
+        p_playwin->UpdateGrid( p_playlist );\r
+        vlc_object_release( p_playlist );\r
+        p_playwin->Show();\r
     }\r
 }\r
 //---------------------------------------------------------------------------\r
@@ -282,17 +296,26 @@ void __fastcall TMainFrameDlg::ToolButtonFastClick( TObject *Sender )
 //---------------------------------------------------------------------------\r
 void __fastcall TMainFrameDlg::ToolButtonPrevClick( TObject *Sender )\r
 {\r
-    p_intfGlobal->p_sys->p_playlist->Previous();\r
+    p_intfGlobal->p_sys->p_playwin->Previous();\r
 }\r
 //---------------------------------------------------------------------------\r
 void __fastcall TMainFrameDlg::ToolButtonNextClick( TObject *Sender )\r
 {\r
-    p_intfGlobal->p_sys->p_playlist->Next();\r
+    p_intfGlobal->p_sys->p_playwin->Next();\r
 }\r
 //---------------------------------------------------------------------------\r
 void __fastcall TMainFrameDlg::ToolButtonEjectClick( TObject *Sender )\r
 {\r
     AnsiString Device = "";\r
+    char * psz_current;\r
+    playlist_t * p_playlist;\r
+\r
+    p_playlist = (playlist_t *)vlc_object_find( p_intfGlobal,\r
+                                       VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );\r
+    if( p_playlist == NULL )\r
+    {\r
+        return;\r
+    }\r
 \r
     /*\r
      * Get the active input\r
@@ -300,29 +323,35 @@ void __fastcall TMainFrameDlg::ToolButtonEjectClick( TObject *Sender )
      * If it's neither a VCD nor a DVD, then return\r
      */\r
 \r
-    if( p_intfGlobal->p_vlc->p_playlist->current.psz_name != NULL )\r
+    vlc_mutex_lock( &p_playlist->object_lock );\r
+    psz_current = p_playlist->pp_items[ p_playlist->i_index ]->psz_name;\r
+\r
+    if( psz_current != NULL )\r
     {\r
-        if( strncmp( p_intfGlobal->p_vlc->p_playlist->current.psz_name, "dvd", 3 )\r
-            || strncmp( p_intfGlobal->p_vlc->p_playlist->current.psz_name, "vcd", 3 ) )\r
+        if( strncmp( psz_current, "dvd", 3 )\r
+            || strncmp( psz_current, "vcd", 3 ) )\r
         {\r
             /* Determine the device name by omitting the first 4 characters\r
              * and keeping 3 characters */\r
-            Device = strdup( ( p_intfGlobal->p_vlc->p_playlist->current.psz_name + 4 ) );\r
+            Device = strdup( ( psz_current + 4 ) );\r
             Device = Device.SubString( 1, 2 );\r
         }\r
     }\r
 \r
+    vlc_mutex_unlock( &p_playlist->object_lock );\r
+    vlc_object_release( p_playlist );\r
+\r
     if( Device == "" )\r
     {\r
         return;\r
     }\r
 \r
     /* If there's a stream playing, we aren't allowed to eject ! */\r
-    if( p_input_bank->pp_input[0] == NULL )\r
+    if( p_intfGlobal->p_sys->p_input == NULL )\r
     {\r
-        intf_WarnMsg( 4, "intf: ejecting %s", Device.c_str() );\r
+        msg_Dbg( p_intfGlobal, "ejecting %s", Device.c_str() );\r
 \r
-        intf_Eject( Device.c_str() );\r
+        intf_Eject( p_intfGlobal, Device.c_str() );\r
     }\r
 }\r
 //--------------------------------------------------------------------------\r
@@ -431,95 +460,89 @@ void __fastcall TMainFrameDlg::PopupNetworkStreamClick( TObject *Sender )
 void __fastcall TMainFrameDlg::ButtonTitlePrevClick( TObject *Sender )\r
 {\r
     intf_thread_t * p_intf;\r
-    input_bank_t  * p_input_bank;\r
     input_area_t  * p_area;\r
     int             i_id;\r
 \r
     p_intf = p_intfGlobal;\r
-    p_input_bank = p_intf->p_vlc->p_input_bank;\r
-    i_id = p_input_bank->pp_input[0]->stream.p_selected_area->i_id - 1;\r
+    i_id = p_intf->p_sys->p_input->stream.p_selected_area->i_id - 1;\r
 \r
     /* Disallow area 0 since it is used for video_ts.vob */\r
     if( i_id > 0 )\r
     {\r
-        p_area = p_input_bank->pp_input[0]->stream.pp_areas[i_id];\r
-        input_ChangeArea( p_input_bank->pp_input[0], (input_area_t*)p_area );\r
+        p_area = p_intf->p_sys->p_input->stream.pp_areas[i_id];\r
+        input_ChangeArea( p_intf->p_sys->p_input, (input_area_t*)p_area );\r
 \r
-        input_SetStatus( p_input_bank->pp_input[0], INPUT_STATUS_PLAY );\r
+        input_SetStatus( p_intf->p_sys->p_input, INPUT_STATUS_PLAY );\r
 \r
         p_intf->p_sys->b_title_update = 1;\r
-        vlc_mutex_lock( &p_input_bank->pp_input[0]->stream.stream_lock );\r
+        vlc_mutex_lock( &p_intf->p_sys->p_input->stream.stream_lock );\r
         SetupMenus( p_intf );\r
-        vlc_mutex_unlock( &p_input_bank->pp_input[0]->stream.stream_lock );\r
+        vlc_mutex_unlock( &p_intf->p_sys->p_input->stream.stream_lock );\r
     }\r
 }\r
 //---------------------------------------------------------------------------\r
 void __fastcall TMainFrameDlg::ButtonTitleNextClick( TObject *Sender )\r
 {\r
     intf_thread_t * p_intf;\r
-    input_bank_t  * p_input_bank;\r
     input_area_t  * p_area;\r
     int             i_id;\r
 \r
     p_intf = p_intfGlobal;\r
-    p_input_bank = p_intf->p_vlc->p_input_bank;\r
-    i_id = p_input_bank->pp_input[0]->stream.p_selected_area->i_id + 1;\r
+    i_id = p_intf->p_sys->p_input->stream.p_selected_area->i_id + 1;\r
 \r
-    if( i_id < p_input_bank->pp_input[0]->stream.i_area_nb )\r
+    if( i_id < p_intf->p_sys->p_input->stream.i_area_nb )\r
     {\r
-        p_area = p_input_bank->pp_input[0]->stream.pp_areas[i_id];   \r
-        input_ChangeArea( p_input_bank->pp_input[0], (input_area_t*)p_area );\r
+        p_area = p_intf->p_sys->p_input->stream.pp_areas[i_id];   \r
+        input_ChangeArea( p_intf->p_sys->p_input, (input_area_t*)p_area );\r
                   \r
-        input_SetStatus( p_input_bank->pp_input[0], INPUT_STATUS_PLAY );\r
+        input_SetStatus( p_intf->p_sys->p_input, INPUT_STATUS_PLAY );\r
 \r
         p_intf->p_sys->b_title_update = 1;\r
-        vlc_mutex_lock( &p_input_bank->pp_input[0]->stream.stream_lock );\r
+        vlc_mutex_lock( &p_intf->p_sys->p_input->stream.stream_lock );\r
         SetupMenus( p_intf );\r
-        vlc_mutex_unlock( &p_input_bank->pp_input[0]->stream.stream_lock );\r
+        vlc_mutex_unlock( &p_intf->p_sys->p_input->stream.stream_lock );\r
     }\r
 }\r
 //---------------------------------------------------------------------------\r
 void __fastcall TMainFrameDlg::ButtonChapterPrevClick( TObject *Sender )\r
 {\r
     intf_thread_t * p_intf = p_intfGlobal;\r
-    input_bank_t  * p_input_bank = p_intf->p_vlc->p_input_bank;\r
     input_area_t  * p_area;\r
 \r
-    p_area = p_input_bank->pp_input[0]->stream.p_selected_area;\r
+    p_area = p_intf->p_sys->p_input->stream.p_selected_area;\r
 \r
     if( p_area->i_part > 0 )\r
     {\r
         p_area->i_part--;\r
-        input_ChangeArea( p_input_bank->pp_input[0], (input_area_t*)p_area );\r
+        input_ChangeArea( p_intf->p_sys->p_input, (input_area_t*)p_area );\r
 \r
-        input_SetStatus( p_input_bank->pp_input[0], INPUT_STATUS_PLAY );\r
+        input_SetStatus( p_intf->p_sys->p_input, INPUT_STATUS_PLAY );\r
 \r
         p_intf->p_sys->b_chapter_update = 1;\r
-        vlc_mutex_lock( &p_input_bank->pp_input[0]->stream.stream_lock );\r
+        vlc_mutex_lock( &p_intf->p_sys->p_input->stream.stream_lock );\r
         SetupMenus( p_intf );\r
-        vlc_mutex_unlock( &p_input_bank->pp_input[0]->stream.stream_lock );\r
+        vlc_mutex_unlock( &p_intf->p_sys->p_input->stream.stream_lock );\r
     }\r
 }\r
 //---------------------------------------------------------------------------\r
 void __fastcall TMainFrameDlg::ButtonChapterNextClick( TObject *Sender )\r
 {\r
     intf_thread_t * p_intf = p_intfGlobal;\r
-    input_bank_t  * p_input_bank = p_intf->p_vlc->p_input_bank;\r
     input_area_t  * p_area;\r
 \r
-    p_area = p_input_bank->pp_input[0]->stream.p_selected_area;\r
+    p_area = p_intf->p_sys->p_input->stream.p_selected_area;\r
     \r
     if( p_area->i_part < p_area->i_part_nb )\r
     {\r
         p_area->i_part++;\r
-        input_ChangeArea( p_input_bank->pp_input[0], (input_area_t*)p_area );\r
+        input_ChangeArea( p_intf->p_sys->p_input, (input_area_t*)p_area );\r
 \r
-        input_SetStatus( p_input_bank->pp_input[0], INPUT_STATUS_PLAY );\r
+        input_SetStatus( p_intf->p_sys->p_input, INPUT_STATUS_PLAY );\r
 \r
         p_intf->p_sys->b_chapter_update = 1;\r
-        vlc_mutex_lock( &p_input_bank->pp_input[0]->stream.stream_lock );\r
+        vlc_mutex_lock( &p_intf->p_sys->p_input->stream.stream_lock );\r
         SetupMenus( p_intf );\r
-        vlc_mutex_unlock( &p_input_bank->pp_input[0]->stream.stream_lock );\r
+        vlc_mutex_unlock( &p_intf->p_sys->p_input->stream.stream_lock );\r
     }\r
 }\r
 //---------------------------------------------------------------------------\r
@@ -531,7 +554,6 @@ void __fastcall TMainFrameDlg::ButtonChapterNextClick( TObject *Sender )
 void __fastcall TMainFrameDlg::ButtonGoClick( TObject *Sender )\r
 {\r
     intf_thread_t *p_intf = p_intfGlobal;\r
-    input_bank_t  *p_input_bank = p_intf->p_vlc->p_input_bank;\r
     int i_channel;\r
 \r
     i_channel = SpinEditChannel->Value;\r
@@ -541,7 +563,7 @@ void __fastcall TMainFrameDlg::ButtonGoClick( TObject *Sender )
     network_ChannelJoin( p_intf, i_channel );\r
     vlc_mutex_unlock( &p_intf->change_lock );\r
 \r
-//    input_SetStatus( p_input_bank->pp_input[0], INPUT_STATUS_PLAY );\r
+//    input_SetStatus( p_intf->p_sys->p_input, INPUT_STATUS_PLAY );\r
 }\r
 //---------------------------------------------------------------------------\r
 \r
@@ -555,7 +577,6 @@ void __fastcall TMainFrameDlg::ButtonGoClick( TObject *Sender )
 void __fastcall TMainFrameDlg::ModeManage()\r
 {\r
     intf_thread_t * p_intf = p_intfGlobal;\r
-    input_bank_t  * p_input_bank = p_intf->p_vlc->p_input_bank;\r
     TGroupBox     * ActiveGB;\r
     int             i_Height;\r
     bool            b_control;\r
@@ -572,14 +593,14 @@ void __fastcall TMainFrameDlg::ModeManage()
     b_control = 0;\r
 \r
     /* show the box related to current input mode */\r
-    if( p_input_bank->pp_input[0] != NULL )\r
+    if( p_intf->p_sys->p_input != NULL )\r
     {\r
-        switch( p_input_bank->pp_input[0]->stream.i_method & 0xf0 )\r
+        switch( p_intf->p_sys->p_input->stream.i_method & 0xf0 )\r
         {    \r
             case INPUT_METHOD_FILE:\r
                 GroupBoxFile->Visible = true;\r
                 ActiveGB = GroupBoxFile;\r
-                LabelFileName->Caption = p_input_bank->pp_input[0]->psz_source;\r
+                LabelFileName->Caption = p_intf->p_sys->p_input->psz_source;\r
                 break;\r
             case INPUT_METHOD_DISC:\r
                 GroupBoxDisc->Visible = true;\r
@@ -588,7 +609,7 @@ void __fastcall TMainFrameDlg::ModeManage()
             case INPUT_METHOD_NETWORK:\r
                 GroupBoxNetwork->Visible = true;\r
                 ActiveGB = GroupBoxNetwork;\r
-                LabelServer->Caption = p_input_bank->pp_input[0]->psz_source;\r
+                LabelServer->Caption = p_intf->p_sys->p_input->psz_source;\r
                 if( config_GetInt( p_intf, "network-channel" ) )\r
                 {\r
                     LabelChannel->Visible = true;\r
@@ -602,14 +623,14 @@ void __fastcall TMainFrameDlg::ModeManage()
                 msg_Warn( p_intf, "cannot determine input method" );\r
                 GroupBoxFile->Visible = true;\r
                 ActiveGB = GroupBoxFile;\r
-                LabelFileName->Caption = p_input_bank->pp_input[0]->psz_source;\r
+                LabelFileName->Caption = p_intf->p_sys->p_input->psz_source;\r
                 break;\r
         }\r
 \r
         i_Height = StatusBar->Height + ActiveGB->Height + ToolBar->Height + 54;\r
 \r
         /* initialize and show slider for seekable streams */\r
-        if( p_input_bank->pp_input[0]->stream.b_seekable )\r
+        if( p_intf->p_sys->p_input->stream.b_seekable )\r
         {\r
             TrackBar->Position = p_intf->p_sys->OldValue = 0;\r
             GroupBoxSlider->Show();\r
@@ -617,7 +638,7 @@ void __fastcall TMainFrameDlg::ModeManage()
         }\r
 \r
         /* control buttons for free pace streams */\r
-        b_control = p_input_bank->pp_input[0]->stream.b_pace_control;\r
+        b_control = p_intf->p_sys->p_input->stream.b_pace_control;\r
 \r
         /* get ready for menu regeneration */\r
         p_intf->p_sys->b_program_update = 1;\r
@@ -627,7 +648,7 @@ void __fastcall TMainFrameDlg::ModeManage()
         p_intf->p_sys->b_spu_update = 1;\r
         p_intf->p_sys->i_part = 0;\r
 \r
-        p_input_bank->pp_input[0]->stream.b_changed = 0;\r
+        p_intf->p_sys->p_input->stream.b_changed = 0;\r
         msg_Dbg( p_intf, "stream has changed, refreshing interface" );\r
     }\r
     else\r
index 51ef04e..1de6140 100644 (file)
@@ -100,9 +100,9 @@ static void __fastcall LangChange( TMenuItem *RootCurrent, TMenuItem *Item,
     }\r
     else\r
     {\r
-        vlc_mutex_lock( &p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.stream_lock );\r
-        p_es = p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.pp_es[i_es];\r
-        vlc_mutex_unlock( &p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.stream_lock );\r
+        vlc_mutex_lock( &p_intfGlobal->p_sys->p_input->stream.stream_lock );\r
+        p_es = p_intfGlobal->p_sys->p_input->stream.pp_es[i_es];\r
+        vlc_mutex_unlock( &p_intfGlobal->p_sys->p_input->stream.stream_lock );\r
     }\r
 \r
     /* find the current ES */\r
@@ -118,8 +118,8 @@ static void __fastcall LangChange( TMenuItem *RootCurrent, TMenuItem *Item,
     }\r
 \r
     /* exchange them */\r
-    input_ToggleES( p_intfGlobal->p_vlc->p_input_bank->pp_input[0], p_es_old, false );\r
-    input_ToggleES( p_intfGlobal->p_vlc->p_input_bank->pp_input[0], p_es, true );\r
+    input_ToggleES( p_intfGlobal->p_sys->p_input, p_es_old, false );\r
+    input_ToggleES( p_intfGlobal->p_sys->p_input, p_es, true );\r
 \r
     Item->Checked = true;\r
     Index2Item( RootOther, i_index + 1, true )->Checked = true;\r
@@ -137,7 +137,7 @@ static void __fastcall ProgramChange( TMenuItem *Item, TMenuItem *RootOther )
     int             i_program = Item->Tag;\r
 \r
     /* toggle the program */\r
-    input_ChangeProgram( p_intfGlobal->p_vlc->p_input_bank->pp_input[0], (u16)i_program );\r
+    input_ChangeProgram( p_intfGlobal->p_sys->p_input, (u16)i_program );\r
 \r
     /* check selected menu items */\r
     Item->Checked = true;\r
@@ -146,13 +146,13 @@ static void __fastcall ProgramChange( TMenuItem *Item, TMenuItem *RootOther )
     /* update audio/subtitles menus */\r
     p_intf->p_sys->b_audio_update = 1;\r
     p_intf->p_sys->b_spu_update = 1;\r
-    vlc_mutex_lock( &p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.stream_lock );\r
+    vlc_mutex_lock( &p_intfGlobal->p_sys->p_input->stream.stream_lock );\r
     SetupMenus( p_intf );\r
-    vlc_mutex_unlock( &p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.stream_lock );\r
+    vlc_mutex_unlock( &p_intfGlobal->p_sys->p_input->stream.stream_lock );\r
     p_intf->p_sys->b_audio_update = 0;\r
     p_intf->p_sys->b_spu_update = 0;\r
 \r
-    input_SetStatus( p_intfGlobal->p_vlc->p_input_bank->pp_input[0], INPUT_STATUS_PLAY );\r
+    input_SetStatus( p_intfGlobal->p_sys->p_input, INPUT_STATUS_PLAY );\r
 }\r
 \r
 \r
@@ -217,10 +217,10 @@ void __fastcall TMainFrameDlg::PopupNavigationClick( TObject *Sender )
     int             i_title   = DATA2TITLE( Item->Tag );\r
     int             i_chapter = DATA2CHAPTER( Item->Tag );\r
 \r
-    p_area = p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.pp_areas[i_title];\r
+    p_area = p_intfGlobal->p_sys->p_input->stream.pp_areas[i_title];\r
     p_area->i_part = i_chapter;\r
 \r
-    input_ChangeArea( p_intfGlobal->p_vlc->p_input_bank->pp_input[0], (input_area_t*)p_area );\r
+    input_ChangeArea( p_intfGlobal->p_sys->p_input, (input_area_t*)p_area );\r
 \r
     Item->Checked = true;\r
     ItemTitle = Index2Item( MenuTitle, i_title - 1, false );\r
@@ -232,14 +232,14 @@ void __fastcall TMainFrameDlg::PopupNavigationClick( TObject *Sender )
     else\r
     {\r
         /* new title => we must rebuild the chapter menu */\r
-        vlc_mutex_lock( &p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.stream_lock );\r
+        vlc_mutex_lock( &p_intfGlobal->p_sys->p_input->stream.stream_lock );\r
         RadioMenu( MenuChapter, "Chapter",\r
-                   p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.p_selected_area->i_part_nb,\r
+                   p_intfGlobal->p_sys->p_input->stream.p_selected_area->i_part_nb,\r
                    i_chapter, MenuChapterClick );\r
-        vlc_mutex_unlock( &p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.stream_lock );\r
+        vlc_mutex_unlock( &p_intfGlobal->p_sys->p_input->stream.stream_lock );\r
     }\r
 \r
-    input_SetStatus( p_intfGlobal->p_vlc->p_input_bank->pp_input[0], INPUT_STATUS_PLAY );\r
+    input_SetStatus( p_intfGlobal->p_sys->p_input, INPUT_STATUS_PLAY );\r
 }\r
 \r
 /*\r
@@ -252,13 +252,13 @@ void __fastcall TMainFrameDlg::MenuTitleClick( TObject *Sender )
     TMenuItem     * ItemTitle;\r
     int             i_title = Item->Tag;\r
 \r
-    input_ChangeArea( p_intfGlobal->p_vlc->p_input_bank->pp_input[0],\r
-                      p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.pp_areas[i_title] );\r
+    input_ChangeArea( p_intfGlobal->p_sys->p_input,\r
+                      p_intfGlobal->p_sys->p_input->stream.pp_areas[i_title] );\r
     Item->Checked = true;\r
     ItemTitle = Index2Item( PopupNavigation, i_title - 1, false );\r
     Index2Item( ItemTitle, 0, false )->Checked = true;\r
 \r
-    input_SetStatus( p_intfGlobal->p_vlc->p_input_bank->pp_input[0], INPUT_STATUS_PLAY );\r
+    input_SetStatus( p_intfGlobal->p_sys->p_input, INPUT_STATUS_PLAY );\r
 }\r
 \r
 /*\r
@@ -273,16 +273,16 @@ void __fastcall TMainFrameDlg::MenuChapterClick( TObject *Sender )
     int             i_title;\r
     int             i_chapter = Item->Tag;\r
 \r
-    p_area = p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.p_selected_area;\r
+    p_area = p_intfGlobal->p_sys->p_input->stream.p_selected_area;\r
     p_area->i_part = i_chapter;\r
 \r
-    input_ChangeArea( p_intfGlobal->p_vlc->p_input_bank->pp_input[0], (input_area_t*)p_area );\r
+    input_ChangeArea( p_intfGlobal->p_sys->p_input, (input_area_t*)p_area );\r
 \r
-    i_title = p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.p_selected_area->i_id;\r
+    i_title = p_intfGlobal->p_sys->p_input->stream.p_selected_area->i_id;\r
     ItemTitle = Index2Item( PopupNavigation, i_title - 1, false );\r
     Index2Item( ItemTitle, i_chapter - 1, false )->Checked = true;\r
 \r
-    input_SetStatus( p_intfGlobal->p_vlc->p_input_bank->pp_input[0], INPUT_STATUS_PLAY );\r
+    input_SetStatus( p_intfGlobal->p_sys->p_input, INPUT_STATUS_PLAY );\r
 }\r
 \r
 \r
@@ -405,10 +405,10 @@ static void __fastcall ProgramMenu( TMenuItem * Root,
     ItemActive = NULL;\r
 \r
     /* create a set of program buttons and append them to the container */\r
-    for( i = 0; i < p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.i_pgrm_number; i++ )\r
+    for( i = 0; i < p_intfGlobal->p_sys->p_input->stream.i_pgrm_number; i++ )\r
     {\r
         Name.sprintf( "id %d",\r
-            p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.pp_programs[i]->i_number );\r
+            p_intfGlobal->p_sys->p_input->stream.pp_programs[i]->i_number );\r
 \r
         Item = new TMenuItem( Root );\r
         Item->Caption = Name;\r
@@ -420,7 +420,7 @@ static void __fastcall ProgramMenu( TMenuItem * Root,
          * It will be used in the callback. */\r
         Item->Tag = i + 1;\r
 \r
-        if( p_pgrm == p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.pp_programs[i] )\r
+        if( p_pgrm == p_intfGlobal->p_sys->p_input->stream.pp_programs[i] )\r
         {\r
             /* don't lose Item when we append into menu */\r
             ItemActive = Item;\r
@@ -437,7 +437,7 @@ static void __fastcall ProgramMenu( TMenuItem * Root,
     }\r
 \r
     /* be sure that menu is enabled if more than 1 program */\r
-    if( p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.i_pgrm_number > 1 )\r
+    if( p_intfGlobal->p_sys->p_input->stream.i_pgrm_number > 1 )\r
     {\r
         Root->Enabled = true;\r
     }\r
@@ -485,19 +485,19 @@ static void __fastcall LanguageMenu( TMenuItem * Root, es_descriptor_t * p_es,
     ItemActive = NULL;\r
     i_item = 0;\r
 \r
-    vlc_mutex_lock( &p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.stream_lock );\r
+    vlc_mutex_lock( &p_intfGlobal->p_sys->p_input->stream.stream_lock );\r
 \r
-#define ES p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.pp_es[i]\r
+#define ES p_intfGlobal->p_sys->p_input->stream.pp_es[i]\r
     /* create a set of language buttons and append them to the Root */\r
-    for( i = 0; i < p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.i_es_number; i++ )\r
+    for( i = 0; i < p_intfGlobal->p_sys->p_input->stream.i_es_number; i++ )\r
     {\r
         if( ( ES->i_cat == i_cat ) &&\r
             ( !ES->p_pgrm ||\r
               ES->p_pgrm ==\r
-                 p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.p_selected_program ) )\r
+                 p_intfGlobal->p_sys->p_input->stream.p_selected_program ) )\r
         {\r
             i_item++;\r
-            Name = p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.pp_es[i]->psz_desc;\r
+            Name = p_intfGlobal->p_sys->p_input->stream.pp_es[i]->psz_desc;\r
             if( Name.IsEmpty() )\r
             {\r
                 Name.sprintf( "Language %d", i_item );\r
@@ -509,7 +509,7 @@ static void __fastcall LanguageMenu( TMenuItem * Root, es_descriptor_t * p_es,
             Item->Caption = Name;\r
             Item->Tag = i;\r
 \r
-            if( p_es == p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.pp_es[i] )\r
+            if( p_es == p_intfGlobal->p_sys->p_input->stream.pp_es[i] )\r
             {\r
                 /* don't lose Item when we append into menu */\r
                 ItemActive = Item;\r
@@ -522,7 +522,7 @@ static void __fastcall LanguageMenu( TMenuItem * Root, es_descriptor_t * p_es,
     }\r
 #undef ES\r
 \r
-    vlc_mutex_unlock( &p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.stream_lock );\r
+    vlc_mutex_unlock( &p_intfGlobal->p_sys->p_input->stream.stream_lock );\r
 \r
     /* check currently selected item */\r
     if( ItemActive != NULL )\r
@@ -565,7 +565,7 @@ static void __fastcall NavigationMenu( TMenuItem * Root,
     Root->Clear();\r
 \r
     ItemActive = NULL;\r
-    i_title_nb = p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.i_area_nb;\r
+    i_title_nb = p_intfGlobal->p_sys->p_input->stream.i_area_nb;\r
     \r
     /* loop on titles */\r
     for( i_title = 1; i_title < i_title_nb; i_title++ )\r
@@ -586,7 +586,7 @@ static void __fastcall NavigationMenu( TMenuItem * Root,
         }\r
 \r
         Name.sprintf( "Title %d (%d)", i_title,\r
-            p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.pp_areas[i_title]->i_part_nb );\r
+            p_intfGlobal->p_sys->p_input->stream.pp_areas[i_title]->i_part_nb );\r
 \r
         {\r
             TitleItem = new TMenuItem( Root );\r
@@ -595,7 +595,7 @@ static void __fastcall NavigationMenu( TMenuItem * Root,
             TitleItem->Caption = Name;\r
 \r
             i_chapter_nb =\r
-                p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.pp_areas[i_title]->i_part_nb;\r
+                p_intfGlobal->p_sys->p_input->stream.pp_areas[i_title]->i_part_nb;\r
 \r
             /* loop on chapters */\r
             for( i_chapter = 0; i_chapter < i_chapter_nb; i_chapter++ )\r
@@ -626,9 +626,9 @@ static void __fastcall NavigationMenu( TMenuItem * Root,
                  * ChapterItem, since we will need them in the callback */\r
                  ChapterItem->Tag = (int)POS2DATA( i_title, i_chapter + 1 );\r
 \r
-#define p_area p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.pp_areas[i_title]\r
+#define p_area p_intfGlobal->p_sys->p_input->stream.pp_areas[i_title]\r
                 if( ( p_area ==\r
-                        p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.p_selected_area ) &&\r
+                        p_intfGlobal->p_sys->p_input->stream.p_selected_area ) &&\r
                     ( p_area->i_part == i_chapter + 1 ) )\r
                 {\r
                     ItemActive = ChapterItem;\r
@@ -653,7 +653,7 @@ static void __fastcall NavigationMenu( TMenuItem * Root,
                 TitleItem->Add( ChapterGroup );\r
             }\r
 \r
-            if( p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.pp_areas[i_title]->i_part_nb\r
+            if( p_intfGlobal->p_sys->p_input->stream.pp_areas[i_title]->i_part_nb\r
                 > 1 )\r
             {\r
                 /* be sure that menu is sensitive */\r
@@ -708,13 +708,13 @@ int __fastcall SetupMenus( intf_thread_t * p_intf )
     { \r
         pgrm_descriptor_t * p_pgrm;\r
 \r
-        if( p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.p_new_program )\r
+        if( p_intfGlobal->p_sys->p_input->stream.p_new_program )\r
         {\r
-            p_pgrm = p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.p_new_program;\r
+            p_pgrm = p_intfGlobal->p_sys->p_input->stream.p_new_program;\r
         }\r
         else\r
         {\r
-            p_pgrm = p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.p_selected_program;\r
+            p_pgrm = p_intfGlobal->p_sys->p_input->stream.p_selected_program;\r
         }\r
 \r
         ProgramMenu( p_window->MenuProgram, p_pgrm,\r
@@ -729,13 +729,13 @@ int __fastcall SetupMenus( intf_thread_t * p_intf )
     {\r
         RadioMenu( p_window->MenuTitle, "Title",\r
 //why "-1" ?\r
-                   p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.i_area_nb - 1,\r
-                   p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.p_selected_area->i_id,\r
+                   p_intfGlobal->p_sys->p_input->stream.i_area_nb - 1,\r
+                   p_intfGlobal->p_sys->p_input->stream.p_selected_area->i_id,\r
                    p_window->MenuTitleClick );\r
 \r
         AnsiString CurrentTitle;\r
         CurrentTitle.sprintf( "%d",\r
-                    p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.p_selected_area->i_id );\r
+                    p_intfGlobal->p_sys->p_input->stream.p_selected_area->i_id );\r
         p_window->LabelTitleCurrent->Caption = CurrentTitle;\r
 \r
         p_intf->p_sys->b_title_update = 0;\r
@@ -744,8 +744,8 @@ int __fastcall SetupMenus( intf_thread_t * p_intf )
     if( p_intf->p_sys->b_chapter_update )\r
     {\r
         RadioMenu( p_window->MenuChapter, "Chapter",\r
-                   p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.p_selected_area->i_part_nb,\r
-                   p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.p_selected_area->i_part,\r
+                   p_intfGlobal->p_sys->p_input->stream.p_selected_area->i_part_nb,\r
+                   p_intfGlobal->p_sys->p_input->stream.p_selected_area->i_part,\r
                    p_window->MenuChapterClick );\r
 \r
         NavigationMenu( p_window->PopupNavigation,\r
@@ -753,11 +753,11 @@ int __fastcall SetupMenus( intf_thread_t * p_intf )
 \r
         AnsiString CurrentChapter;\r
         CurrentChapter.sprintf( "%d",\r
-                    p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.p_selected_area->i_part );\r
+                    p_intfGlobal->p_sys->p_input->stream.p_selected_area->i_part );\r
         p_window->LabelChapterCurrent->Caption = CurrentChapter;\r
 \r
         p_intf->p_sys->i_part =\r
-                    p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.p_selected_area->i_part;\r
+                    p_intfGlobal->p_sys->p_input->stream.p_selected_area->i_part;\r
 \r
         p_intf->p_sys->b_chapter_update = 0;\r
     }\r
@@ -766,24 +766,24 @@ int __fastcall SetupMenus( intf_thread_t * p_intf )
     p_audio_es = NULL;\r
     p_spu_es = NULL;\r
 \r
-     for( i = 0; i < p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.i_selected_es_number; i++ )\r
+     for( i = 0; i < p_intfGlobal->p_sys->p_input->stream.i_selected_es_number; i++ )\r
     {\r
-        if( p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.pp_selected_es[i]->i_cat\r
+        if( p_intfGlobal->p_sys->p_input->stream.pp_selected_es[i]->i_cat\r
             == AUDIO_ES )\r
         {\r
-            p_audio_es = p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.pp_selected_es[i];\r
+            p_audio_es = p_intfGlobal->p_sys->p_input->stream.pp_selected_es[i];\r
             p_intfGlobal->p_sys->p_audio_es_old = p_audio_es;\r
         }\r
 \r
-        if( p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.pp_selected_es[i]->i_cat\r
+        if( p_intfGlobal->p_sys->p_input->stream.pp_selected_es[i]->i_cat\r
             == SPU_ES )\r
         {\r
-            p_spu_es = p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.pp_selected_es[i];\r
+            p_spu_es = p_intfGlobal->p_sys->p_input->stream.pp_selected_es[i];\r
             p_intfGlobal->p_sys->p_spu_es_old = p_spu_es;\r
         }\r
     }\r
 \r
-    vlc_mutex_unlock( &p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.stream_lock );\r
+    vlc_mutex_unlock( &p_intfGlobal->p_sys->p_input->stream.stream_lock );\r
 \r
     /* audio menus */\r
     if( p_intf->p_sys->b_audio_update )\r
@@ -807,7 +807,7 @@ int __fastcall SetupMenus( intf_thread_t * p_intf )
         p_intf->p_sys->b_spu_update = 0;\r
     }\r
 \r
-    vlc_mutex_lock( &p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.stream_lock );\r
+    vlc_mutex_lock( &p_intfGlobal->p_sys->p_input->stream.stream_lock );\r
 \r
     return true;\r
 }\r
index 49077b3..ef723ea 100644 (file)
@@ -89,7 +89,7 @@ void __fastcall TMessagesDlg::UpdateLog()
 \r
             /* Limit log size */\r
             i_count = RichEditMessages->Lines->Count;\r
-            i_max_lines = config_GetIntVariable( "intfwin-max-lines" );\r
+            i_max_lines = config_GetInt( p_intfGlobal, "intfwin-max-lines" );\r
             if( i_max_lines > 0 )\r
             {\r
                 for( i_del = 0; i_del <= i_count - i_max_lines; i_del++ )\r
index 4b70502..eb499f6 100644 (file)
@@ -90,33 +90,33 @@ void __fastcall TNetworkDlg::BitBtnOkClick( TObject *Sender )
     AnsiString      Channel = ComboBoxCSAddress->Text;\r
     unsigned int    i_channel_port = SpinEditCSPort->Value;\r
     unsigned int    i_port;\r
-    int             i_end = p_intfGlobal->p_vlc->p_playlist->i_size;\r
+    playlist_t *    p_playlist;\r
 \r
-    Hide();\r
+    p_playlist = (playlist_t *)\r
+        vlc_object_find( p_intfGlobal, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );\r
+    if( p_playlist == NULL )\r
+    {   \r
+        return;\r
+    }                        \r
 \r
-    /* select added item */\r
-    if( p_intfGlobal->p_vlc->p_input_bank->pp_input[0] != NULL )\r
-    {\r
-        p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->b_eof = 1;\r
-    }\r
+    Hide();\r
 \r
     /* Check which option was chosen */\r
     switch( OldRadioValue )\r
     {\r
         /* UDP */\r
         case 0:\r
-            config_PutIntVariable( "network-channel", FALSE );\r
+            config_PutInt( p_intfGlobal, "network-channel", FALSE );\r
             i_port = SpinEditUDPPort->Value;\r
 \r
             /* Build source name */\r
             Source = "udp:@:" + IntToStr( i_port );\r
 \r
-            intf_PlaylistAdd( p_main->p_playlist, PLAYLIST_END, Source.c_str() );\r
+            playlist_Add( p_playlist, Source.c_str(),\r
+                          PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END );\r
 \r
             /* update the display */\r
-            p_intfGlobal->p_sys->p_playlist->UpdateGrid( p_main->p_playlist );\r
-\r
-            intf_PlaylistJumpto( p_main->p_playlist, i_end - 1 );\r
+            p_intfGlobal->p_sys->p_playwin->UpdateGrid( p_playlist );\r
             break;\r
 \r
         /* UDP Multicast */\r
@@ -128,12 +128,11 @@ void __fastcall TNetworkDlg::BitBtnOkClick( TObject *Sender )
             /* Build source name */\r
             Source = "udp:@" + Address + ":" + IntToStr( i_port );\r
 \r
-            intf_PlaylistAdd( p_main->p_playlist, PLAYLIST_END, Source.c_str() );\r
+            playlist_Add( p_playlist, Source.c_str(),\r
+                          PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END );\r
 \r
             /* update the display */\r
-            p_intfGlobal->p_sys->p_playlist->UpdateGrid( p_main->p_playlist );\r
-\r
-            intf_PlaylistJumpto( p_main->p_playlist, i_end - 1 );\r
+            p_intfGlobal->p_sys->p_playwin->UpdateGrid( p_playlist );\r
             break;\r
 \r
         /* Channel server */\r
@@ -142,9 +141,9 @@ void __fastcall TNetworkDlg::BitBtnOkClick( TObject *Sender )
             config_PutPsz( p_intfGlobal, "channel-server", Channel.c_str() );\r
             config_PutInt( p_intfGlobal, "channel-port", i_channel_port );\r
 \r
-            if( p_main->p_channel == NULL )\r
+            if( p_intfGlobal->p_vlc->p_channel == NULL )\r
             {\r
-                network_ChannelCreate();\r
+                network_ChannelCreate( p_intfGlobal );\r
             }\r
 \r
             p_intfGlobal->p_sys->b_playing = 1;\r
@@ -165,14 +164,15 @@ void __fastcall TNetworkDlg::BitBtnOkClick( TObject *Sender )
                 Source = "http://" + Address;\r
             }\r
 \r
-            intf_PlaylistAdd( p_main->p_playlist, PLAYLIST_END, Source.c_str() );\r
+            playlist_Add( p_playlist, Source.c_str(),\r
+                          PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END );\r
 \r
             /* update the display */\r
-            p_intfGlobal->p_sys->p_playlist->UpdateGrid( p_main->p_playlist );\r
-\r
-            intf_PlaylistJumpto( p_main->p_playlist, i_end - 1 );\r
+            p_intfGlobal->p_sys->p_playwin->UpdateGrid( p_playlist );\r
             break;\r
     }\r
+\r
+    vlc_object_release( p_playlist );\r
 }\r
 //---------------------------------------------------------------------------\r
 void __fastcall TNetworkDlg::ChangeEnabled( int i_selected )\r
index 3d9fa6d..a3a2c49 100644 (file)
@@ -91,6 +91,13 @@ void __fastcall TPlaylistDlg::ListViewPlaylistDblClick( TObject *Sender )
     TListItem *ItemStart;\r
     TItemStates Focused;\r
 \r
+    playlist_t * p_playlist = (playlist_t *)\r
+        vlc_object_find( p_intfGlobal, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );\r
+    if( p_playlist == NULL )\r
+    {\r
+        return;\r
+    }\r
+\r
     /* search the selected item */\r
     if( ListViewPlaylist->SelCount > 0 )\r
     {\r
@@ -106,15 +113,10 @@ void __fastcall TPlaylistDlg::ListViewPlaylistDblClick( TObject *Sender )
             Item = ListViewPlaylist->GetNextItem( ItemStart, sdAll, Focused );\r
         }\r
 \r
-        /* stop current item, select the good one */\r
-        if( ( p_intfGlobal->p_vlc->p_input_bank->pp_input[0] != NULL ) &&\r
-            ( Item->Index != p_intfGlobal->p_sys->i_playing ) )\r
-        {\r
-            /* FIXME: temporary hack */\r
-            p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->b_eof = 1;\r
-        }\r
-        intf_PlaylistJumpto( p_intfGlobal->p_vlc->p_playlist, Item->Index - 1 );\r
+        playlist_Goto( p_playlist, Item->Index - 1 );\r
     }\r
+\r
+    vlc_object_release( p_playlist );\r
 }\r
 //---------------------------------------------------------------------------\r
 void __fastcall TPlaylistDlg::ListViewPlaylistKeyDown( TObject *Sender,\r
@@ -179,6 +181,7 @@ void __fastcall TPlaylistDlg::MenuAddUrlClick( TObject *Sender )
 //---------------------------------------------------------------------------\r
 void __fastcall TPlaylistDlg::MenuDeleteSelectedClick( TObject *Sender )\r
 {\r
+#if 0 /* PLAYLIST TARASS */\r
     /* user wants to delete a file in the queue */\r
     int         i_pos;\r
     playlist_t *p_playlist = p_intfGlobal->p_vlc->p_playlist;\r
@@ -199,10 +202,12 @@ void __fastcall TPlaylistDlg::MenuDeleteSelectedClick( TObject *Sender )
     UpdateGrid( p_playlist );\r
 \r
     vlc_mutex_unlock( &p_intfGlobal->change_lock );\r
+#endif\r
 }\r
 //---------------------------------------------------------------------------\r
 void __fastcall TPlaylistDlg::MenuDeleteAllClick( TObject *Sender )\r
 {\r
+#if 0 /* PLAYLIST TARASS */\r
     int         i_pos;\r
     playlist_t *p_playlist = p_intfGlobal->p_vlc->p_playlist;\r
 \r
@@ -219,10 +224,12 @@ void __fastcall TPlaylistDlg::MenuDeleteAllClick( TObject *Sender )
     UpdateGrid( p_playlist );\r
 \r
     vlc_mutex_unlock( &p_intfGlobal->change_lock );\r
+#endif\r
 }\r
 //---------------------------------------------------------------------------\r
 void __fastcall TPlaylistDlg::MenuSelectionInvertClick( TObject *Sender )\r
 {\r
+#if 0 /* PLAYLIST TARASS */\r
 #define NOT( var ) ( (var) ? false : true )\r
     int         i_pos;\r
     playlist_t *p_playlist = p_intfGlobal->p_vlc->p_playlist;\r
@@ -234,6 +241,7 @@ void __fastcall TPlaylistDlg::MenuSelectionInvertClick( TObject *Sender )
         Items->Item[i_pos]->Selected = NOT( Items->Item[i_pos]->Selected );\r
     }\r
 #undef NOT\r
+#endif\r
 }\r
 //---------------------------------------------------------------------------\r
 void __fastcall TPlaylistDlg::MenuSelectionCropClick( TObject *Sender )\r
@@ -293,14 +301,14 @@ void __fastcall TPlaylistDlg::UpdateGrid( playlist_t * p_playlist )
     {\r
 #ifdef WIN32\r
         /* Position of the last '\' in the string */\r
-        FileName = rindex( p_playlist->p_item[i_dummy].psz_name, '\\' );\r
+        FileName = rindex( p_playlist->pp_items[i_dummy]->psz_name, '\\' );\r
 #else\r
         /* Position of the last '/' in the string */\r
-        FileName = rindex( p_playlist->p_item[i_dummy].psz_name, '/' );\r
+        FileName = rindex( p_playlist->pp_items[i_dummy]->psz_name, '/' );\r
 #endif\r
         if( ( FileName == NULL ) || ( *(FileName + 1) == '\0' ) )\r
         {\r
-            FileName = p_playlist->p_item[i_dummy].psz_name;\r
+            FileName = p_playlist->pp_items[i_dummy]->psz_name;\r
         }\r
         else\r
         {\r
@@ -319,9 +327,14 @@ void __fastcall TPlaylistDlg::UpdateGrid( playlist_t * p_playlist )
 //---------------------------------------------------------------------------\r
 void __fastcall TPlaylistDlg::Manage( intf_thread_t * p_intf )\r
 {\r
-    playlist_t *p_playlist = p_intfGlobal->p_vlc->p_playlist ;\r
+    playlist_t * p_playlist = (playlist_t *)\r
+        vlc_object_find( p_intfGlobal, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );\r
+    if( p_playlist == NULL )\r
+    {\r
+        return;\r
+    }\r
 \r
-    vlc_mutex_lock( &p_playlist->change_lock );\r
+    vlc_mutex_lock( &p_playlist->object_lock );\r
 \r
     if( p_intf->p_sys->i_playing != p_playlist->i_index )\r
     {\r
@@ -331,47 +344,44 @@ void __fastcall TPlaylistDlg::Manage( intf_thread_t * p_intf )
         UpdateGrid( p_playlist );\r
     }\r
 \r
-    vlc_mutex_unlock( &p_playlist->change_lock );\r
+    vlc_mutex_unlock( &p_playlist->object_lock );\r
+    vlc_object_release( p_playlist );\r
 }\r
 //---------------------------------------------------------------------------\r
 void __fastcall TPlaylistDlg::DeleteItem( int i_pos )\r
 {\r
-    intf_PlaylistDelete( p_intfGlobal->p_vlc->p_playlist, i_pos );\r
-\r
-    /* are we deleting the current played stream */\r
-    if( p_intfGlobal->p_sys->i_playing == i_pos )\r
+    playlist_t * p_playlist = (playlist_t *)\r
+        vlc_object_find( p_intfGlobal, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );\r
+    if( p_playlist == NULL )\r
     {\r
-        /* next ! */\r
-        p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->b_eof = 1;\r
-        /* this has to set the slider to 0 */\r
-        \r
-        /* step minus one */\r
-        p_intfGlobal->p_sys->i_playing-- ;\r
-\r
-        vlc_mutex_lock( &p_intfGlobal->p_vlc->p_playlist->change_lock );\r
-        p_intfGlobal->p_vlc->p_playlist->i_index-- ;\r
-        vlc_mutex_unlock( &p_intfGlobal->p_vlc->p_playlist->change_lock );\r
+        return;\r
     }\r
+\r
+    playlist_Delete( p_playlist, i_pos );\r
 }\r
 //---------------------------------------------------------------------------\r
 void __fastcall TPlaylistDlg::Previous()\r
 {\r
-    if( p_intfGlobal->p_vlc->p_input_bank->pp_input[0] != NULL )\r
+    playlist_t * p_playlist = (playlist_t *)\r
+        vlc_object_find( p_intfGlobal, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );\r
+    if( p_playlist == NULL )\r
     {\r
-        /* FIXME: temporary hack */\r
-        intf_PlaylistPrev( p_intfGlobal->p_vlc->p_playlist );\r
-        intf_PlaylistPrev( p_intfGlobal->p_vlc->p_playlist );\r
-        p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->b_eof = 1;\r
+        return;\r
     }\r
+\r
+    playlist_Prev( p_playlist );\r
 }\r
 //---------------------------------------------------------------------------\r
 void __fastcall TPlaylistDlg::Next()\r
 {\r
-    if( p_intfGlobal->p_vlc->p_input_bank->pp_input[0] != NULL )\r
+    playlist_t * p_playlist = (playlist_t *)\r
+        vlc_object_find( p_intfGlobal, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );\r
+    if( p_playlist == NULL )\r
     {\r
-        /* FIXME: temporary hack */\r
-        p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->b_eof = 1;\r
+        return;\r
     }\r
+\r
+    playlist_Next( p_playlist );\r
 }\r
 //---------------------------------------------------------------------------\r
 \r
index b4f181d..21d0570 100644 (file)
@@ -194,7 +194,7 @@ void __fastcall TGroupBoxPlugin::ListViewSelectItem( TObject *Sender,
              p_module != NULL ;\r
              p_module = p_module->next )\r
         {\r
-            if( strcmp( p_module->psz_name, Name.c_str() ) == 0 )\r
+            if( strcmp( p_module->psz_object_name, Name.c_str() ) == 0 )\r
             {\r
                 ModuleSelected = p_module;\r
                 LabelHint->Caption = p_module->psz_longname ?\r
@@ -210,12 +210,13 @@ void __fastcall TGroupBoxPlugin::ListViewSelectItem( TObject *Sender,
 void __fastcall TGroupBoxPlugin::ButtonSelectClick( TObject *Sender )\r
 {\r
     if( !ModuleSelected ) return;\r
-    Edit->Text = ModuleSelected->psz_name;\r
+    Edit->Text = ModuleSelected->psz_object_name;\r
 }\r
 //---------------------------------------------------------------------------\r
 void __fastcall TGroupBoxPlugin::ButtonConfigClick( TObject *Sender )\r
 {\r
-    p_intfGlobal->p_sys->p_window->CreatePreferences( ModuleSelected->psz_name );\r
+    p_intfGlobal->p_sys->p_window->\r
+                        CreatePreferences( ModuleSelected->psz_object_name );\r
 }\r
 //---------------------------------------------------------------------------\r
 void __fastcall TGroupBoxPlugin::UpdateChanges()\r
@@ -272,10 +273,6 @@ __fastcall TGroupBoxInteger::TGroupBoxInteger( TComponent* Owner,
     SpinEdit = CreateSpinEdit( this, 16, 164, 24, 21,\r
                                -1, 100000, p_config->i_value );\r
 \r
-    /* init updown */\r
-    UpDown = CreateUpDown( this, -1, 32767, p_config->i_value, false );\r
-    UpDown->Associate = Edit;\r
-\r
     /* vertical alignment */\r
     Height = LabelDesc->Height + 24;\r
     LabelDesc->Top = Top + ( Height - LabelDesc->Height ) / 2 + 4;\r
@@ -380,8 +377,11 @@ void __fastcall TPreferencesDlg::CreateConfigDialog( char *psz_module_name )
     for( p_module = p_intfGlobal->p_vlc->module_bank.first ; p_module != NULL ;\r
          p_module = p_module->next )\r
     {\r
-        if( psz_module_name && !strcmp( psz_module_name, p_module->psz_name ) )\r
+        if( psz_module_name\r
+             && !strcmp( psz_module_name, p_module->psz_object_name ) )\r
+        {\r
             break;\r
+        }\r
     }\r
     if( !p_module ) return;\r
 \r
@@ -431,7 +431,7 @@ void __fastcall TPreferencesDlg::CreateConfigDialog( char *psz_module_name )
                     ( 1 << p_item->i_value ) )\r
                 {\r
                     ListItem = GroupBoxPlugin->ListView->Items->Add();\r
-                    ListItem->Caption = p_module_plugins->psz_name;\r
+                    ListItem->Caption = p_module_plugins->psz_object_name;\r
                 }\r
             }\r
 \r
index f981041..7eab9f2 100644 (file)
@@ -59,7 +59,7 @@ struct intf_sys_s
 \r
     /* windows and widgets */\r
     TMainFrameDlg     * p_window;                             /* main window */\r
-    TPlaylistDlg      * p_playlist;                              /* playlist */\r
+    TPlaylistDlg      * p_playwin;                               /* playlist */\r
     TPopupMenu        * p_popup;                               /* popup menu */\r
     TAboutDlg         * p_about;                             /* about window */\r
     TDiscDlg          * p_disc;                     /* disc selection window */\r
@@ -84,5 +84,8 @@ struct intf_sys_s
     /* Language information */\r
     es_descriptor_t   * p_audio_es_old;\r
     es_descriptor_t   * p_spu_es_old;\r
+\r
+    /* The input thread */\r
+    input_thread_t    * p_input;\r
 };\r
 \r
index fabb4fe..a3669f6 100644 (file)
@@ -4,7 +4,7 @@
  * decoders.
  *****************************************************************************
  * Copyright (C) 1998-2001 VideoLAN
- * $Id: input.c,v 1.202 2002/06/07 14:30:41 sam Exp $
+ * $Id: input.c,v 1.203 2002/06/07 23:53:44 sam Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *
@@ -41,7 +41,7 @@
 #endif
 
 #include "netutils.h"
-#include "playlist.h"
+#include "vlc_playlist.h"
 
 #include "stream_control.h"
 #include "input_ext-intf.h"
index 74b6c3c..d91cf54 100644 (file)
@@ -4,7 +4,7 @@
  * and spawns threads.
  *****************************************************************************
  * Copyright (C) 1998-2001 VideoLAN
- * $Id: libvlc.c,v 1.8 2002/06/07 14:30:41 sam Exp $
+ * $Id: libvlc.c,v 1.9 2002/06/07 23:53:44 sam Exp $
  *
  * Authors: Vincent Seguin <seguin@via.ecp.fr>
  *          Samuel Hocevar <sam@zoy.org>
@@ -72,7 +72,7 @@
 #include "stream_control.h"
 #include "input_ext-intf.h"
 
-#include "playlist.h"
+#include "vlc_playlist.h"
 #include "interface.h"
 
 #include "audio_output.h"
index 8b59a3e..fcfff93 100644 (file)
@@ -2,7 +2,7 @@
  * modules.c : Builtin and plugin modules management functions
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: modules.c,v 1.66 2002/06/07 14:30:41 sam Exp $
+ * $Id: modules.c,v 1.67 2002/06/07 23:53:44 sam Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *          Ethan C. Baldridge <BaldridgeE@cadmus.com>
@@ -53,7 +53,7 @@
 #include "netutils.h"
 
 #include "interface.h"
-#include "playlist.h"
+#include "vlc_playlist.h"
 #include "intf_eject.h"
 
 #include "stream_control.h"
index cf43b7d..0b6d2b1 100644 (file)
@@ -2,7 +2,7 @@
  * netutils.c: various network functions
  *****************************************************************************
  * Copyright (C) 1999-2001 VideoLAN
- * $Id: netutils.c,v 1.70 2002/06/07 21:45:30 sam Exp $
+ * $Id: netutils.c,v 1.71 2002/06/07 23:53:44 sam Exp $
  *
  * Authors: Vincent Seguin <seguin@via.ecp.fr>
  *          Benoit Steiner <benny@via.ecp.fr>
@@ -75,7 +75,7 @@
 #endif
 
 #include "netutils.h"
-#include "playlist.h"
+#include "vlc_playlist.h"
 
 #include "network.h"
 
index 556e818..ad1a778 100644 (file)
@@ -2,7 +2,7 @@
  * objects.c: vlc_object_t handling
  *****************************************************************************
  * Copyright (C) 2002 VideoLAN
- * $Id: objects.c,v 1.9 2002/06/07 16:06:09 sam Exp $
+ * $Id: objects.c,v 1.10 2002/06/07 23:53:44 sam Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
@@ -41,7 +41,7 @@
 
 #include "audio_output.h"
 
-#include "playlist.h"
+#include "vlc_playlist.h"
 #include "interface.h"
 
 /*****************************************************************************
index a72b9f3..40c7d3d 100644 (file)
@@ -2,7 +2,7 @@
  * playlist.c : Playlist management functions
  *****************************************************************************
  * Copyright (C) 1999-2001 VideoLAN
- * $Id: playlist.c,v 1.8 2002/06/07 19:54:37 sam Exp $
+ * $Id: playlist.c,v 1.9 2002/06/07 23:53:44 sam Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
@@ -30,7 +30,7 @@
 #include "stream_control.h"
 #include "input_ext-intf.h"
 
-#include "playlist.h"
+#include "vlc_playlist.h"
 
 #define PLAYLIST_STOPPED 0
 #define PLAYLIST_RUNNING 1