]> git.sesse.net Git - vlc/commitdiff
input.c: doxygenize vlc_input_item_GetInfo
authorSigmund Augdal Helberg <sigmunau@videolan.org>
Wed, 30 Mar 2005 22:45:13 +0000 (22:45 +0000)
committerSigmund Augdal Helberg <sigmunau@videolan.org>
Wed, 30 Mar 2005 22:45:13 +0000 (22:45 +0000)
wx/timer.cpp: show Now Playing in statusbar if available

modules/gui/wxwindows/timer.cpp
src/input/input.c

index 1e1c4a284e691441526f44b16b7a3162707f2490..71220e5680808c9a6dc31ae5f8b8181856d13151 100644 (file)
@@ -33,6 +33,8 @@
 #include <vlc/aout.h>
 #include <vlc/intf.h>
 
+#include "vlc_meta.h"
+
 #include "wxwindows.h"
 #include <wx/timer.h>
 
@@ -133,8 +135,21 @@ void Timer::Notify()
             b_old_seekable = VLC_FALSE;
             b_disc_shown = VLC_FALSE;
 
-            p_main_interface->statusbar->SetStatusText(
-                wxU(p_intf->p_sys->p_input->input.p_item->psz_name), 2 );
+            char *psz_now_playing = vlc_input_item_GetInfo(
+                p_intf->p_sys->p_input->input.p_item,
+                _("Meta-information"), _( "Now Playing" ) );
+            if( psz_now_playing && *psz_now_playing )
+            {
+                p_main_interface->statusbar->SetStatusText(
+                    wxU(psz_now_playing) + wxT( " - " ) +
+                    wxU(p_intf->p_sys->p_input->input.p_item->psz_name), 2 );
+            }
+            else
+            {
+                p_main_interface->statusbar->SetStatusText(
+                    wxU(p_intf->p_sys->p_input->input.p_item->psz_name), 2 );
+            }
+            free( psz_now_playing );
 
             p_main_interface->TogglePlayButton( PLAYING_S );
 #ifdef wxHAS_TASK_BAR_ICON
@@ -190,8 +205,21 @@ void Timer::Notify()
             p_intf->p_sys->b_playing = 1;
 
             /* Update the item name */
-            p_main_interface->statusbar->SetStatusText(
-                wxU(p_intf->p_sys->p_input->input.p_item->psz_name), 2 );
+            char *psz_now_playing = vlc_input_item_GetInfo(
+                p_intf->p_sys->p_input->input.p_item,
+                _("Meta-information"), _( "Now Playing" ) );
+            if( psz_now_playing && *psz_now_playing )
+            {
+                p_main_interface->statusbar->SetStatusText(
+                    wxU(psz_now_playing) + wxT( " - " ) +
+                    wxU(p_intf->p_sys->p_input->input.p_item->psz_name), 2 );
+            }
+            else
+            {
+                p_main_interface->statusbar->SetStatusText(
+                    wxU(p_intf->p_sys->p_input->input.p_item->psz_name), 2 );
+            }
+            free( psz_now_playing );
 
             /* Manage the slider */
             /* FIXME --fenrir */
index 8c3c2d24f0bd7c80698651b8440861cc66fe52ef..38c81e9a37a9583da3e4c2840d6d524c591c34b4 100644 (file)
@@ -2518,6 +2518,16 @@ static void MRLSections( input_thread_t *p_input, char *psz_source,
 /***********************************************************************
  * Info management functions
  ***********************************************************************/
+/**
+ * Get a info item from a given category in a given input item.
+ *
+ * \param p_i The input item to get info from
+ * \param psz_cat String representing the category for the info
+ * \param psz_name String representing the name of the desired info
+ * \return A pointer to the string with the given info if found, or an
+ *         empty string otherwise. The caller should free the returned
+ *         pointer.
+ */
 char *vlc_input_item_GetInfo( input_item_t *p_i,
                               const char *psz_cat,
                               const char *psz_name )