]> git.sesse.net Git - vlc/blobdiff - modules/gui/wxwindows/fileinfo.cpp
* modules/gui/wxwindows/*: new --wxwin-keep-size option to remember the size of the...
[vlc] / modules / gui / wxwindows / fileinfo.cpp
index 920c352669864f5dded5769d8ff1fb8ee24b80fb..fe30bf1601f1b0a2cbb43eee4468509207fd5f44 100644 (file)
@@ -1,8 +1,8 @@
 /*****************************************************************************
  * fileinfo.cpp : wxWindows plugin for vlc
  *****************************************************************************
- * Copyright (C) 2000-2001 VideoLAN
- * $Id: fileinfo.cpp,v 1.19 2003/09/21 18:07:51 gbazin Exp $
+ * Copyright (C) 2000-2004 VideoLAN
+ * $Id$
  *
  * Authors: Sigmund Augdal <sigmunau@idi.ntnu.no>
  *
 /*****************************************************************************
  * Preamble
  *****************************************************************************/
-#include <stdlib.h>                                      /* malloc(), free() */
-#include <errno.h>                                                 /* ENOMEM */
-#include <string.h>                                            /* strerror() */
-#include <stdio.h>
-
 #include <vlc/vlc.h>
 #include <vlc/intf.h>
 
 #include "wxwindows.h"
-#include <wx/treectrl.h>
 
 /*****************************************************************************
  * Event Table.
@@ -58,7 +52,7 @@ END_EVENT_TABLE()
  * Constructor.
  *****************************************************************************/
 FileInfo::FileInfo( intf_thread_t *_p_intf, wxWindow *p_parent ):
-    wxFrame( p_parent, -1, wxU(_("FileInfo")), wxDefaultPosition,
+    wxFrame( p_parent, -1, wxU(_("Stream and media info")), wxDefaultPosition,
              wxDefaultSize, wxDEFAULT_FRAME_STYLE )
 {
     /* Initializations */
@@ -109,38 +103,35 @@ void FileInfo::UpdateFileInfo()
          * retrieved with the GetItemText() method, but it doesn't work on
          * Windows when the wxTR_HIDE_ROOT style is set. That's why we need to
          * use the fileinfo_root_label variable... */
-        fileinfo_root = fileinfo_tree->AddRoot( wxU(p_input->psz_name) );
-        fileinfo_root_label = wxU(p_input->psz_name);
+        fileinfo_root = fileinfo_tree->AddRoot( wxL2U(p_input->psz_name) );
+        fileinfo_root_label = wxL2U(p_input->psz_name);
     }
-    else if( fileinfo_root_label == wxU(p_input->psz_name) )
+    else if( fileinfo_root_label == wxL2U(p_input->psz_name) )
     {
         return;
     }
 
     /* We rebuild the tree from scratch */
     fileinfo_tree->DeleteChildren( fileinfo_root );
-    fileinfo_root_label = wxU(p_input->psz_name);
-
-    vlc_mutex_lock( &p_input->stream.stream_lock );
-
-    input_info_category_t *p_cat = p_input->stream.p_info;
+    fileinfo_root_label = wxL2U(p_input->psz_name);
 
-    while( p_cat )
+    vlc_mutex_lock( &p_input->p_item->lock );
+    for( int i = 0; i < p_input->p_item->i_categories; i++ )
     {
+        info_category_t *p_cat = p_input->p_item->pp_categories[i];
+
         wxTreeItemId cat = fileinfo_tree->AppendItem( fileinfo_root,
-                                                      wxU(p_cat->psz_name) );
-        input_info_t *p_info = p_cat->p_info;
-        while( p_info )
+                                                      wxL2U(p_cat->psz_name) );
+        for( int j = 0; j < p_cat->i_infos; j++ )
         {
-            fileinfo_tree->AppendItem( cat, (wxString)wxU(p_info->psz_name) +
-                                       wxT(": ") + wxU(p_info->psz_value) );
-            p_info = p_info->p_next;
+            info_t *p_info = p_cat->pp_infos[j];
+
+            fileinfo_tree->AppendItem( cat, (wxString)wxL2U(p_info->psz_name) +
+                                       wxT(": ") + wxL2U(p_info->psz_value) );
         }
-        p_cat = p_cat->p_next;
         fileinfo_tree->Expand( cat );
     }
-
-    vlc_mutex_unlock( &p_input->stream.stream_lock );
+    vlc_mutex_unlock( &p_input->p_item->lock );
 
     return;
 }