input.c: doxygenize vlc_input_item_GetInfo

wx/timer.cpp: show Now Playing in statusbar if available
parent 5dba7eb1
...@@ -33,6 +33,8 @@ ...@@ -33,6 +33,8 @@
#include <vlc/aout.h> #include <vlc/aout.h>
#include <vlc/intf.h> #include <vlc/intf.h>
#include "vlc_meta.h"
#include "wxwindows.h" #include "wxwindows.h"
#include <wx/timer.h> #include <wx/timer.h>
...@@ -133,8 +135,21 @@ void Timer::Notify() ...@@ -133,8 +135,21 @@ void Timer::Notify()
b_old_seekable = VLC_FALSE; b_old_seekable = VLC_FALSE;
b_disc_shown = VLC_FALSE; b_disc_shown = VLC_FALSE;
p_main_interface->statusbar->SetStatusText( char *psz_now_playing = vlc_input_item_GetInfo(
wxU(p_intf->p_sys->p_input->input.p_item->psz_name), 2 ); 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 ); p_main_interface->TogglePlayButton( PLAYING_S );
#ifdef wxHAS_TASK_BAR_ICON #ifdef wxHAS_TASK_BAR_ICON
...@@ -190,8 +205,21 @@ void Timer::Notify() ...@@ -190,8 +205,21 @@ void Timer::Notify()
p_intf->p_sys->b_playing = 1; p_intf->p_sys->b_playing = 1;
/* Update the item name */ /* Update the item name */
p_main_interface->statusbar->SetStatusText( char *psz_now_playing = vlc_input_item_GetInfo(
wxU(p_intf->p_sys->p_input->input.p_item->psz_name), 2 ); 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 */ /* Manage the slider */
/* FIXME --fenrir */ /* FIXME --fenrir */
......
...@@ -2518,6 +2518,16 @@ static void MRLSections( input_thread_t *p_input, char *psz_source, ...@@ -2518,6 +2518,16 @@ static void MRLSections( input_thread_t *p_input, char *psz_source,
/*********************************************************************** /***********************************************************************
* Info management functions * 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, char *vlc_input_item_GetInfo( input_item_t *p_i,
const char *psz_cat, const char *psz_cat,
const char *psz_name ) const char *psz_name )
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment