StatsTree->setColumnWidth( 1 , 200 );
layout->addWidget(StatsTree, 1, 0 );
+ CONNECT( THEMIM->getIM() , statisticsUpdated( input_item_t* ),
+ this, update( input_item_t* ) );
}
InputStatsPanel::~InputStatsPanel()
void MediaInfoDialog::updateOnTimeOut()
{
- /* Timer runs at 150 ms, dont' update more than 2 times per second */
+ /* Timer runs at 150 ms, dont' update more than 2 times per second
i_runs++;
- if( i_runs % 4 != 0 ) return;
+ if( i_runs % 4 != 0 ) return;*/
/* Get Input and clear if non-existant */
input_thread_t *p_input = THEMIM->getInput();
vlc_value_t, vlc_value_t, void * );
static int InterfaceChanged( vlc_object_t *, const char *,
vlc_value_t, vlc_value_t, void * );
+static int StatisticsUpdated( vlc_object_t *, const char *,
+ vlc_value_t, vlc_value_t, void * );
static int InterfaceVoutChanged( vlc_object_t *, const char *,
vlc_value_t, vlc_value_t, void * );
static int ItemStateChanged( vlc_object_t *, const char *,
var_AddCallback( p_input, "title", ItemTitleChanged, this );
/* src/input/input.c:734 for timers update*/
var_AddCallback( p_input, "intf-change", InterfaceChanged, this );
+ /* src/input/input.c:710 for statistics update*/
+ var_AddCallback( p_input, "stats-change", StatisticsUpdated, this );
/* src/input/input.c for vout creation/destruction */
var_AddCallback( p_input, "intf-change-vout", InterfaceVoutChanged, this );
}
var_DelCallback( p_input, "rate-change", ItemRateChanged, this );
var_DelCallback( p_input, "title", ItemTitleChanged, this );
var_DelCallback( p_input, "intf-change", InterfaceChanged, this );
+ var_DelCallback( p_input, "stats-change", StatisticsUpdated, this );
var_DelCallback( p_input, "intf-change-vout", InterfaceVoutChanged, this );
}
type != ItemSpuChanged_Type &&
type != ItemTeletextChanged_Type &&
type != ItemStateChanged_Type &&
+ type != StatisticsUpdate_Type &&
type != InterfaceVoutUpdate_Type )
return;
type != ItemSpuChanged_Type &&
type != ItemTeletextChanged_Type &&
type != ItemStateChanged_Type &&
+ type != StatisticsUpdate_Type &&
type != InterfaceVoutUpdate_Type
)
&& ( i_input_id != ple->i_id ) )
return;
- if( type != PositionUpdate_Type )
+ if( type != PositionUpdate_Type &&
+ type != StatisticsUpdate_Type )
msg_Dbg( p_intf, "New Event: type %i", type );
/* Actions */
case PositionUpdate_Type:
UpdatePosition();
break;
+ case StatisticsUpdate_Type:
+ UpdateStats();
+ break;
case ItemChanged_Type:
UpdateMeta();
UpdateStatus();
}
}
+void InputManager::UpdateStats()
+{
+ emit statisticsUpdated( input_GetItem( p_input ) );
+}
+
void InputManager::UpdatePosition()
{
/* Update position */
return VLC_SUCCESS;
}
+static int StatisticsUpdated( vlc_object_t *p_this, const char *psz_var,
+ vlc_value_t oldval, vlc_value_t newval, void *param )
+{
+ InputManager *im = (InputManager*)param;
+
+ IMEvent *event = new IMEvent( StatisticsUpdate_Type, 0 );
+ QApplication::postEvent( im, static_cast<QEvent*>(event) );
+ return VLC_SUCCESS;
+}
+
static int InterfaceVoutChanged( vlc_object_t *p_this, const char *psz_var,
vlc_value_t oldval, vlc_value_t newval, void *param )
{
static int const ItemSpuChanged_Type = QEvent::User + IMEventType + 7;
static int const ItemTeletextChanged_Type= QEvent::User + IMEventType + 8;
static int const InterfaceVoutUpdate_Type= QEvent::User + IMEventType + 9;
+static int const StatisticsUpdate_Type = QEvent::User + IMEventType + 10;
-static int const FullscreenControlToggle_Type = QEvent::User + IMEventType + 10;
-static int const FullscreenControlShow_Type = QEvent::User + IMEventType + 11;
-static int const FullscreenControlHide_Type = QEvent::User + IMEventType + 12;
-static int const FullscreenControlPlanHide_Type = QEvent::User + IMEventType + 13;
+static int const FullscreenControlToggle_Type = QEvent::User + IMEventType + 11;
+static int const FullscreenControlShow_Type = QEvent::User + IMEventType + 12;
+static int const FullscreenControlHide_Type = QEvent::User + IMEventType + 13;
+static int const FullscreenControlPlanHide_Type = QEvent::User + IMEventType + 14;
class IMEvent : public QEvent
{
void UpdateTeletext();
void UpdateArt();
void UpdateVout();
+ void UpdateStats();
public slots:
void setInput( input_thread_t * ); ///< Our controlled input changed
void nameChanged( QString );
/// Used to signal whether we should show navigation buttons
void navigationChanged( int );
+ /// Statistics are updated
+ void statisticsUpdated( input_item_t* );
/// Play/pause status
void statusChanged( int );
void artChanged( input_item_t* );
EnablePixelDoubling( p_vout );
#endif
+#if 0
/* Activate the window (give it the focus) */
XClientMessageEvent event;
DefaultRootWindow( p_vout->p_sys->p_display ),
False, SubstructureRedirectMask,
(XEvent*)&event );
+#endif
}
else
{
* window has already been mapped because the XMapWindow() request
* has not necessarily been sent directly to our window (remember,
* the call is first redirected to the window manager) */
+#if 0
do
{
XWindowEvent( p_vout->p_sys->p_display,
p_vout->p_sys->p_win->base_window,
RevertToParent,
CurrentTime);
+#else
+ XSync( p_vout->p_sys->p_display, False );
+#endif
/* signal that the size needs to be updated */
p_vout->i_changes |= VOUT_SIZE_CHANGE;
* - intf-change
* - intf-change-vout for when a vout is created or destroyed
* - rate-change for when playback rate changes
+ * - stats-change for when statistics are updated
* TODO explain when Callback is called
* TODO complete this list (?)
*****************************************************************************/
stats_ComputeGlobalStats( p_input->p_libvlc,
p_input->p_libvlc->p_stats );
}
+ var_SetBool( p_input, "stats-change", true );
}
/**
*
* Add rate-change to inform about rate changin
*
+ * stats-change to inform when statistics are computed
+ *
* TODO list all changes warn by this callbacks */
var_Create( p_input, "intf-change", VLC_VAR_BOOL );
var_SetBool( p_input, "intf-change", true );
var_Create( p_input, "rate-change", VLC_VAR_BOOL );
var_SetBool( p_input, "rate-change", true );
+ var_Create( p_input, "stats-change", VLC_VAR_BOOL );
+ var_SetBool( p_input, "stats-change", true );
var_Create( p_input, "intf-change-vout", VLC_VAR_BOOL );
var_SetBool( p_input, "intf-change-vout", true );