Commit 39852e8b authored by Erwan Tulou's avatar Erwan Tulou

skins2: fix playlist not displaying cuurent playing item correctly

This patch
  - ensure that current playing item is properly detected
  - deactivate item changes since it is wrongly implemented
    (i_id from input_item_t and playlist_item_t are compared,
     which is wrong)
parent 5a07a426
...@@ -268,12 +268,14 @@ int VlcProc::onItemChange( vlc_object_t *pObj, const char *pVariable, ...@@ -268,12 +268,14 @@ int VlcProc::onItemChange( vlc_object_t *pObj, const char *pVariable,
vlc_value_t oldval, vlc_value_t newval, vlc_value_t oldval, vlc_value_t newval,
void *pParam ) void *pParam )
{ {
// TODO: FIXME
// Deactivated because it mixes up i_id from input_item_t
// and i_id from playlist_item_t
#if 0
VlcProc *pThis = (VlcProc*)pParam; VlcProc *pThis = (VlcProc*)pParam;
input_item_t *p_item = static_cast<input_item_t*>(newval.p_address); input_item_t *p_item = static_cast<input_item_t*>(newval.p_address);
// Update the stream variable
pThis->updateStreamName();
// Create a playtree notify command // Create a playtree notify command
CmdPlaytreeUpdate *pCmdTree = new CmdPlaytreeUpdate( pThis->getIntf(), CmdPlaytreeUpdate *pCmdTree = new CmdPlaytreeUpdate( pThis->getIntf(),
p_item->i_id ); p_item->i_id );
...@@ -282,6 +284,8 @@ int VlcProc::onItemChange( vlc_object_t *pObj, const char *pVariable, ...@@ -282,6 +284,8 @@ int VlcProc::onItemChange( vlc_object_t *pObj, const char *pVariable,
AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() ); AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
pQueue->push( CmdGenericPtr( pCmdTree ), true ); pQueue->push( CmdGenericPtr( pCmdTree ), true );
#endif
return VLC_SUCCESS; return VLC_SUCCESS;
} }
...@@ -445,24 +449,28 @@ int VlcProc::onGenericCallback( vlc_object_t *pObj, const char *pVariable, ...@@ -445,24 +449,28 @@ int VlcProc::onGenericCallback( vlc_object_t *pObj, const char *pVariable,
return VLC_SUCCESS; return VLC_SUCCESS;
} }
#define SET_BOOL(m,v) ((VarBoolImpl*)(m).get())->set(v)
#define SET_STREAMTIME(m,v,b) ((StreamTime*)(m).get())->set(v,b)
#define SET_TEXT(m,v) ((VarText*)(m).get())->set(v)
#define SET_VOLUME(m,v,b) ((Volume*)(m).get())->set(v,b)
void VlcProc::on_item_current_changed( vlc_object_t* p_obj, vlc_value_t newVal ) void VlcProc::on_item_current_changed( vlc_object_t* p_obj, vlc_value_t newVal )
{ {
input_item_t *p_item = static_cast<input_item_t*>(newVal.p_address); input_item_t *p_item = static_cast<input_item_t*>(newVal.p_address);
// Update the stream variable // Update short name
updateStreamName(); char *psz_name = input_item_GetName( p_item );
SET_TEXT( m_cVarStreamName, UString( getIntf(), psz_name ) );
free( psz_name );
// Create a playtree notify command // Update full uri
AsyncQueue *pQueue = AsyncQueue::instance( getIntf() ); char *psz_uri = input_item_GetURI( p_item );
CmdPlaytreeUpdate *pCmdTree = SET_TEXT( m_cVarStreamURI, UString( getIntf(), psz_uri ) );
new CmdPlaytreeUpdate( getIntf(), p_item->i_id ); free( psz_uri );
pQueue->push( CmdGenericPtr( pCmdTree ) , true );
}
#define SET_BOOL(m,v) ((VarBoolImpl*)(m).get())->set(v) // Update playtree
#define SET_STREAMTIME(m,v,b) ((StreamTime*)(m).get())->set(v,b) getPlaytreeVar().onUpdateCurrent();
#define SET_TEXT(m,v) ((VarText*)(m).get())->set(v) }
#define SET_VOLUME(m,v,b) ((Volume*)(m).get())->set(v,b)
void VlcProc::on_intf_event_changed( vlc_object_t* p_obj, vlc_value_t newVal ) void VlcProc::on_intf_event_changed( vlc_object_t* p_obj, vlc_value_t newVal )
{ {
...@@ -734,6 +742,8 @@ void VlcProc::reset_input() ...@@ -734,6 +742,8 @@ void VlcProc::reset_input()
SET_BOOL( m_cVarPaused, false ); SET_BOOL( m_cVarPaused, false );
SET_STREAMTIME( m_cVarTime, 0, false ); SET_STREAMTIME( m_cVarTime, 0, false );
SET_TEXT( m_cVarStreamName, UString( getIntf(), "") );
SET_TEXT( m_cVarStreamURI, UString( getIntf(), "") );
SET_TEXT( m_cVarStreamBitRate, UString( getIntf(), "") ); SET_TEXT( m_cVarStreamBitRate, UString( getIntf(), "") );
SET_TEXT( m_cVarStreamSampleRate, UString( getIntf(), "") ); SET_TEXT( m_cVarStreamSampleRate, UString( getIntf(), "") );
} }
......
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