The code seems to be in a better shape now, and removes duplicates calls.
However: there seems to be a few issues left:
- If you open the MediaInfo Dialog before an input, it doesn't fill after
- If you stop, the MediaInfo doesn't clean itself.
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
+
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "components/info_panels.hpp"
#include "components/interface_widgets.hpp"
+#include <assert.h>
+
#include <QTreeWidget>
-#include <QListView>
-#include <QPushButton>
#include <QHeaderView>
#include <QList>
#include <QStringList>
#include <QLineEdit>
#include <QLabel>
#include <QSpinBox>
-#include <QTabWidget>
/************************************************************************
* Single panels
b_inEditMode = false;
}
-MetaPanel::~MetaPanel(){}
-
/**
* Update all the MetaData and art on an "item-changed" event
**/
void MetaPanel::update( input_item_t *p_item )
{
+ if( !p_item ) clear();
+
/* Don't update if you are in edit mode */
if( b_inEditMode ) return;
else p_input = p_item;
**/
void ExtraMetaPanel::update( input_item_t *p_item )
{
+ if( !p_item ) clear();
+
QStringList tempItem;
QList<QTreeWidgetItem *> items;
layout->addWidget(InfoTree, 1, 0 );
}
-InfoPanel::~InfoPanel()
-{
-}
-
/**
* Update the Codecs information on parent->update()
**/
void InfoPanel::update( input_item_t *p_item)
{
+ if( !p_item ) clear();
+
InfoTree->clear();
QTreeWidgetItem *current_item = NULL;
QTreeWidgetItem *child_item = NULL;
StatsTree->setColumnWidth( 1 , 200 );
layout->addWidget(StatsTree, 1, 0 );
-
- CONNECT( THEMIM->getIM() , statisticsUpdated( input_item_t* ),
- this, update( input_item_t* ) );
-}
-
-InputStatsPanel::~InputStatsPanel()
-{
}
/**
**/
void InputStatsPanel::update( input_item_t *p_item )
{
+ assert( p_item );
vlc_mutex_lock( &p_item->p_stats->lock );
#define UPDATE( widget, format, calc... ) \
void InputStatsPanel::clear()
{
}
+
#include <vlc_meta.h>
#include <QWidget>
-#include <QLabel>
#include <limits.h>
Q_OBJECT;
public:
MetaPanel( QWidget *, intf_thread_t * );
- virtual ~MetaPanel();
void saveMeta();
bool isInEditMode();
Q_OBJECT;
public:
ExtraMetaPanel( QWidget *, intf_thread_t * );
- virtual ~ExtraMetaPanel() {};
private:
intf_thread_t *p_intf;
QTreeWidget *extraMetaTree;
Q_OBJECT;
public:
InputStatsPanel( QWidget *, intf_thread_t * );
- virtual ~InputStatsPanel();
private:
intf_thread_t *p_intf;
Q_OBJECT;
public:
InfoPanel( QWidget *, intf_thread_t * );
- virtual ~InfoPanel();
private:
intf_thread_t *p_intf;
QTreeWidget *InfoTree;
/*****************************************************************************
* mediainfo.cpp : Information about an item
****************************************************************************
- * Copyright (C) 2006-2007 the VideoLAN team
+ * Copyright (C) 2006-2008 the VideoLAN team
* $Id$
*
* Authors: Clément Stenac <zorglub@videolan.org>
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
******************************************************************************/
+
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
CONNECT( MP, uriSet( QString ), uriLine, setText( QString ) );
CONNECT( MP, editing(), saveMetaButton, show() );
+ /* Display the buttonBar according to the Tab selected */
CONNECT( infoTabW, currentChanged( int ), this, updateButtons( int ) );
/* If using the General Mode */
if( isMainInputInfo )
{
msg_Dbg( p_intf, "Using a general info windows" );
+ /**
+ * Connects on the various signals of input_Manager
+ * For the currently playing element
+ **/
+ CONNECT( THEMIM, infoChanged( input_item_t* ),
+ IP, update( input_item_t* ) );
+ CONNECT( THEMIM, metaChanged( input_item_t* ),
+ MP, update( input_item_t* ) );
+ CONNECT( THEMIM, metaChanged( input_item_t* ),
+ EMP, update( input_item_t* ) );
+ CONNECT( THEMIM, statisticsUpdated( input_item_t* ),
+ ISP, update( input_item_t* ) );
+
if( THEMIM->getInput() )
p_item = input_GetItem( THEMIM->getInput() );
}
else
msg_Dbg( p_intf, "Using an item specific info windows" );
- /* Call update at start, so info is shown for a running input */
+ /* Call update at start, so info is filled up at begginning */
if( p_item )
updateAllTabs( p_item );
MP->update( p_item );
EMP->update( p_item );
- if( isMainInputInfo )
- ISP->update( p_item );
+ if( isMainInputInfo ) ISP->update( p_item );
}
void MediaInfoDialog::clearAllTabs()
IP->clear();
MP->clear();
EMP->clear();
+
if( isMainInputInfo ) ISP->clear();
}
p_input is released once here */
void InputManager::delInput()
{
- if( p_input )
- {
- delCallbacks();
- i_old_playing_status = END_S;
- i_input_id = 0;
- oldName = "";
- artUrl = "";
- b_video = false;
- timeA = 0;
- timeB = 0;
- emit positionUpdated( -1.0, 0 ,0 );
- emit statusChanged( END_S );
- emit nameChanged( "" );
- emit artChanged( NULL );
- emit rateChanged( INPUT_RATE_DEFAULT );
- emit voutChanged( false );
- emit chapterChanged( 0 );
- emit titleChanged( 0 );
- vlc_object_release( p_input );
- p_input = NULL;
- UpdateTeletext();
- }
+ if( !p_input ) return;
+
+ delCallbacks();
+ i_old_playing_status = END_S;
+ i_input_id = 0;
+ oldName = "";
+ artUrl = "";
+ b_video = false;
+ timeA = 0;
+ timeB = 0;
+
+ emit positionUpdated( -1.0, 0 ,0 );
+ emit rateChanged( INPUT_RATE_DEFAULT ); /* TODO: Do we want this ? */
+ emit nameChanged( "" );
+ emit chapterChanged( 0 );
+ emit titleChanged( 0 );
+ emit statusChanged( END_S );
+
+ /* Reset InfoPanels but stats */
+ emit artChanged( NULL );
+ emit infoChanged( NULL );
+ emit metaChanged( NULL );
+
+ emit teletextPossible( false );
+ emit voutChanged( false );
+
+// FIXME emit AtoBchanged( );
+ vlc_object_release( p_input ); /* FIXME: Can't we release sooner ? */
+
+ p_input = NULL;
}
/* Add the callbacks on Input. Self explanatory */
-void InputManager::addCallbacks()
+inline void InputManager::addCallbacks()
{
var_AddCallback( p_input, "intf-event", InputEvent, this );
}
/* Delete the callbacks on Input. Self explanatory */
-void InputManager::delCallbacks()
+inline void InputManager::delCallbacks()
{
var_DelCallback( p_input, "intf-event", InputEvent, this );
}